]> oss.titaniummirror.com Git - tinyos-2.x.git/blobdiff - tos/lib/tossim/TossimActiveMessageP.nc
Added the AM group stuff.
[tinyos-2.x.git] / tos / lib / tossim / TossimActiveMessageP.nc
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;
   }