]> oss.titaniummirror.com Git - tinyos-2.x.git/blobdiff - tos/lib/net/UARTDebugSenderP.nc
The big interface switchover for Packet, Send, Receive, and AMSend.
[tinyos-2.x.git] / tos / lib / net / UARTDebugSenderP.nc
index b339d87b80b5d0b2f80c7afa93368d7ac071e106..ebce09bb6a3c9a740bfb6564e2d334e3bc011fd1 100644 (file)
@@ -79,7 +79,11 @@ implementation {
             return FAIL;
         } else {
             message_t* msg = call MessagePool.get();
-            CollectionDebugMsg* dbg_msg = call UARTSend.getPayload(msg);
+            CollectionDebugMsg* dbg_msg = call UARTSend.getPayload(msg, sizeof(CollectionDebugMsg));
+           if (dbg_msg == NULL) {
+             return FAIL;
+           }
+           
             memset(dbg_msg, 0, len);
 
             dbg_msg->type = type;
@@ -102,7 +106,10 @@ implementation {
             return FAIL;
         } else {
             message_t* msg = call MessagePool.get();
-            CollectionDebugMsg* dbg_msg = call UARTSend.getPayload(msg);
+            CollectionDebugMsg* dbg_msg = call UARTSend.getPayload(msg, sizeof(CollectionDebugMsg));
+           if (dbg_msg == NULL) {
+             return FAIL;
+           }
             memset(dbg_msg, 0, len);
 
             dbg_msg->type = type;
@@ -128,7 +135,10 @@ implementation {
             return FAIL;
         } else {
             message_t* msg = call MessagePool.get();
-            CollectionDebugMsg* dbg_msg = call UARTSend.getPayload(msg);
+            CollectionDebugMsg* dbg_msg = call UARTSend.getPayload(msg, sizeof(CollectionDebugMsg));
+           if (dbg_msg == NULL) {
+             return FAIL;
+           }
             memset(dbg_msg, 0, len);
 
             dbg_msg->type = type;
@@ -154,7 +164,10 @@ implementation {
             return FAIL;
         } else {
             message_t* msg = call MessagePool.get();
-            CollectionDebugMsg* dbg_msg = call UARTSend.getPayload(msg);
+            CollectionDebugMsg* dbg_msg = call UARTSend.getPayload(msg, sizeof(CollectionDebugMsg));
+           if (dbg_msg == NULL) {
+             return FAIL;
+           }
             memset(dbg_msg, 0, len);
 
             dbg_msg->type = type;
@@ -178,7 +191,10 @@ implementation {
             return FAIL;
         } else {
             message_t* msg = call MessagePool.get();
-            CollectionDebugMsg* dbg_msg = call UARTSend.getPayload(msg);
+            CollectionDebugMsg* dbg_msg = call UARTSend.getPayload(msg, sizeof(CollectionDebugMsg));
+           if (dbg_msg == NULL) {
+             return FAIL;
+           }
             memset(dbg_msg, 0, len);
 
             dbg_msg->type = type;