[Tinyos-2-commits] CVS: tinyos-2.x/tos/lib/tossim SerialActiveMessageC.nc, 1.4, 1.5

Chad Metcalf hiro at users.sourceforge.net
Fri Jun 22 20:33:18 PDT 2007


Update of /cvsroot/tinyos/tinyos-2.x/tos/lib/tossim
In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv28329

Modified Files:
	SerialActiveMessageC.nc 
Log Message:
Adding the AM group stuff to TOSSIM's serial AM.


Index: SerialActiveMessageC.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/lib/tossim/SerialActiveMessageC.nc,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** SerialActiveMessageC.nc	12 Dec 2006 18:23:32 -0000	1.4
--- SerialActiveMessageC.nc	23 Jun 2007 03:33:16 -0000	1.5
***************
*** 73,80 ****
--- 73,89 ----
  					  message_t* amsg,
  					  uint8_t len) {
+     int i;
+     char* payload = call Packet.getPayload(amsg, NULL);
+     dbg("Serial", "Serial: sending a packet of size %d\n", len);
+     for (i = 0; i < len; i++)
+       printf("%02x ", payload[i]);
+ 
+     printf("\n");
+ 
      return FAIL;
    }
  
    command error_t AMSend.cancel[am_id_t id](message_t* msg) {
+     dbg("Serial", "Serial: cancelled a packet\n");
      return FAIL;
    }
***************
*** 142,146 ****
      header->type = t;
    }
!  
    command void Packet.clear(message_t* msg) {}
    
--- 151,168 ----
      header->type = t;
    }
! 
!   command am_group_t AMPacket.group(message_t* amsg) {
!     serial_header_t* header = getHeader(amsg);
!     return header->group;
!   }
!   
!   command void AMPacket.setGroup(message_t* msg, am_group_t group) {
!     serial_header_t* header = getHeader(msg);
!     header->group = group;
!   }
! 
!   command am_group_t AMPacket.localGroup() {
!     return TOS_AM_GROUP;
!   }
    command void Packet.clear(message_t* msg) {}
    



More information about the Tinyos-2-commits mailing list