]> oss.titaniummirror.com Git - tinyos-2.x.git/blobdiff - tos/chips/cc2420/packet/CC2420PacketP.nc
- commit reorg of 2420 stack to support Ieee154 messaging component
[tinyos-2.x.git] / tos / chips / cc2420 / packet / CC2420PacketP.nc
index f0c2e3849ba639be9d653fe5b8894f7b85ce5013..ec4b50df881ea5c91e1a9ff018cf836f2793d735 100644 (file)
@@ -95,6 +95,23 @@ implementation {
     return (call CC2420PacketBody.getMetadata( p_msg ))->lqi;
   }
 
+  async command uint8_t CC2420Packet.getNetwork( message_t* p_msg ) {
+#if defined(CC2420_IFRAME_TYPE)
+    return (call CC2420PacketBody.getHeader( p_msg ))->network;
+#elif defined(IEEE154FRAMES_ENABLED)
+    return 0;
+#else
+    return TINYOS_6LOWPAN_NETWORK_ID;
+#endif
+  }
+
+  async command void CC2420Packet.setNetwork( message_t* p_msg , uint8_t networkId ) {
+#if defined(CC2420_IFRAME_TYPE)
+    (call CC2420PacketBody.getHeader( p_msg ))->network = networkId;
+#endif
+  }    
+
+
   /***************** CC2420PacketBody Commands ****************/
   async command cc2420_header_t * ONE CC2420PacketBody.getHeader( message_t* ONE msg ) {
     return TCAST(cc2420_header_t* ONE, (uint8_t *)msg + offsetof(message_t, data) - sizeof( cc2420_header_t ));