]> oss.titaniummirror.com Git - tinyos-2.x.git/commitdiff
Added the AM group stuff.
authorhiro <hiro>
Fri, 22 Jun 2007 21:15:01 +0000 (21:15 +0000)
committerhiro <hiro>
Fri, 22 Jun 2007 21:15:01 +0000 (21:15 +0000)
tos/lib/tossim/TossimActiveMessageP.nc
tos/lib/tossim/TossimRadioMsg.h

index 79cb9da170e7a4bb5633d7ca81d947b5befbeda5..d55e7ced9d0a411556436f549b078c4df3394659 100644 (file)
@@ -191,10 +191,20 @@ implementation {
     return msg->data;
   }
 
-  //command am_group_t AMPacket.group(message_t* amsg) {
-  //  return amsg->header.group;
-  //}
+  command am_group_t AMPacket.group(message_t* amsg) {
+    tossim_header_t* header = getHeader(amsg);
+    return header->group;
+  }
   
+  command void AMPacket.setGroup(message_t* msg, am_group_t group) {
+    tossim_header_t* header = getHeader(msg);
+    header->group = group;
+  }
+
+  command am_group_t AMPacket.localGroup() {
+    return TOS_AM_GROUP;
+  }
+
  default event message_t* Receive.receive[am_id_t id](message_t* msg, void* payload, uint8_t len) {
     return msg;
   }
index 5ab8c7983713ef41f1e60091697084d50fc711d7..27355e8fbb52ffc052da16b2d8ce79dbeac095ed 100644 (file)
@@ -7,6 +7,7 @@ typedef nx_struct tossim_header {
   nx_am_addr_t dest;
   nx_am_addr_t src;
   nx_uint8_t length;
+  nx_am_group_t group;
   nx_am_id_t type;
 } tossim_header_t;