From 59147fffe4e1a83355aa4f4b47055887eb1fad2a Mon Sep 17 00:00:00 2001 From: hiro Date: Fri, 22 Jun 2007 21:15:01 +0000 Subject: [PATCH] Added the AM group stuff. --- tos/lib/tossim/TossimActiveMessageP.nc | 16 +++++++++++++--- tos/lib/tossim/TossimRadioMsg.h | 1 + 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/tos/lib/tossim/TossimActiveMessageP.nc b/tos/lib/tossim/TossimActiveMessageP.nc index 79cb9da1..d55e7ced 100644 --- a/tos/lib/tossim/TossimActiveMessageP.nc +++ b/tos/lib/tossim/TossimActiveMessageP.nc @@ -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; } diff --git a/tos/lib/tossim/TossimRadioMsg.h b/tos/lib/tossim/TossimRadioMsg.h index 5ab8c798..27355e8f 100644 --- a/tos/lib/tossim/TossimRadioMsg.h +++ b/tos/lib/tossim/TossimRadioMsg.h @@ -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; -- 2.39.2