]> oss.titaniummirror.com Git - tinyos-2.x.git/blobdiff - tos/chips/tda5250/Tda5250ActiveMessageP.nc
Merge over into the trunk.
[tinyos-2.x.git] / tos / chips / tda5250 / Tda5250ActiveMessageP.nc
index 10601e345e73b3e8b5e3bcf04b665bed2b8c8510..a0513609f8256bd1cd3351ef2c89b11a03d80d09 100644 (file)
@@ -66,8 +66,8 @@ implementation {
                                           uint8_t len) {
     tda5250_header_t* header = getHeader(msg);
     header->type = id;
-    header->addr = addr;
-    header->group = TOS_AM_GROUP;
+    header->dest = addr;
+    header->src = call amAddress();
     return call SubSend.send(msg, len);
   }
 
@@ -120,14 +120,24 @@ implementation {
 
   command am_addr_t AMPacket.destination(message_t* amsg) {
     tda5250_header_t* header = getHeader(amsg);
-    return header->addr;
+    return header->dest;
   }
 
   command void AMPacket.setDestination(message_t* amsg, am_addr_t addr) {
     tda5250_header_t* header = getHeader(amsg);
-    header->addr = addr;
+    header->dest = addr;
   }
 
+  command am_addr_t AMPacket.source(message_t* amsg) {
+    tda5250_header_t* header = getHeader(amsg);
+    return header->src;
+  }
+  
+  command void AMPacket.setSource(message_t* amsg, am_addr_t addr) {
+    tda5250_header_t* header = getHeader(amsg);
+    header->src = addr;
+  }
+  
   command bool AMPacket.isForMe(message_t* amsg) {
     return (call AMPacket.destination(amsg) == call AMPacket.address() ||
             call AMPacket.destination(amsg) == AM_BROADCAST_ADDR);