]> oss.titaniummirror.com Git - tinyos-2.x.git/blobdiff - apps/tests/mica2/mts300/TestMts300P.nc
The big interface switchover for Packet, Send, Receive, and AMSend.
[tinyos-2.x.git] / apps / tests / mica2 / mts300 / TestMts300P.nc
index 334c032f95108db32f2a12de64a5583566d96925..f0d011da0fd4fc96564f33fdba3ffe62008eb313 100644 (file)
@@ -98,7 +98,11 @@ implementation
     sending_packet = FALSE;\r
     packet_ready = FALSE;\r
     state = STATE_IDLE;\r
-    pMsg = (Mts300Msg*)call RadioPacket.getPayload(&packet, NULL);\r
+    pMsg = (Mts300Msg*)call RadioPacket.getPayload(&packet, sizeof(Mts300Msg));\r
+    if (pMsg == NULL) {\r
+      call Leds.led0On();\r
+      return;\r
+    }\r
 \r
     // Zero out the accelerometer, chrl@20070213\r
     accel_ave_x = 0;\r