]> oss.titaniummirror.com Git - tinyos-2.x.git/commitdiff
add support for IRIS (it was CC2420 only)
authormmaroti <mmaroti>
Sat, 27 Mar 2010 21:52:41 +0000 (21:52 +0000)
committermmaroti <mmaroti>
Sat, 27 Mar 2010 21:52:41 +0000 (21:52 +0000)
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/

tos/lib/serial/SerialPacketInfo802_15_4P.nc

index a70beb779f090349b3629781da6a55a7de620052..45cafe162375cf1f99de327b58f16bf54d71e6e7 100644 (file)
@@ -34,13 +34,25 @@ module SerialPacketInfo802_15_4P {
   provides interface SerialPacketInfo as Info;
 }
 implementation {
+#ifdef PLATFORM_IRIS
+  enum {
+    HEADER_SIZE = sizeof(rf230packet_header_t),
+    FOOTER_SIZE = sizeof(rf230packet_footer_t),
+  };
+#else
+  enum {
+    HEADER_SIZE = sizeof(cc2420_header_t),
+    FOOTER_SIZE = sizeof(cc2420_footer_t),
+  };
+#endif
+
   async command uint8_t Info.offset() {
-    return sizeof(message_header_t)-sizeof(cc2420_header_t);
+    return sizeof(message_header_t)-HEADER_SIZE;
   }
   async command uint8_t Info.dataLinkLength(message_t* msg, uint8_t upperLen) {
-    return upperLen + sizeof(cc2420_header_t) + sizeof(cc2420_footer_t);
+    return upperLen + HEADER_SIZE + FOOTER_SIZE;
   }
   async command uint8_t Info.upperLength(message_t* msg, uint8_t dataLinkLen) {
-    return dataLinkLen - (sizeof(cc2420_header_t) + sizeof(cc2420_footer_t));
+    return dataLinkLen - (HEADER_SIZE + FOOTER_SIZE);
   }
 }