]> oss.titaniummirror.com Git - tinyos-2.x.git/blobdiff - tos/lib/byte_radio/PacketSerializerP.nc
The big interface switchover for Packet, Send, Receive, and AMSend.
[tinyos-2.x.git] / tos / lib / byte_radio / PacketSerializerP.nc
index 48615c5c34dd92a057992f0d8471123cb6cab610..9ddbcce2b46f270cf8abf65373a7371538c9b2e8 100644 (file)
@@ -203,11 +203,13 @@ implementation {
     return TOSH_DATA_LENGTH;
   }
 
-  command void* Packet.getPayload(message_t* msg, uint8_t* len) {
-    if (len != NULL) {
-      *len = (getHeader(msg))->length;
+  command void* Packet.getPayload(message_t* msg, uint8_t len) {
+    if (len <= TOSH_DATA_LENGTH) {
+      return (void*)msg->data;
+    }
+    else {
+      return NULL;
     }
-    return (void*)msg->data;
   }
   
   // Default events for radio send/receive coordinators do nothing.