tree */
if (error == SUCCESS)
{
- call LowPowerListening.setLocalDutyCycle(200);
+ call LowPowerListening.setLocalWakeupInterval(512);
call DisseminationControl.start();
call CollectionControl.start();
call RootControl.setRoot();
{
/* Copy payload (newAlert) from collection system to our serial
message buffer (fwdAlert), then send our serial message */
- alert_t *fwdAlert = call AlertsForward.getPayload(&fwdMsg);
-
- *fwdAlert = *newAlert;
- if (call AlertsForward.send(AM_BROADCAST_ADDR, &fwdMsg, sizeof *fwdAlert) == SUCCESS)
- fwdBusy = TRUE;
+ alert_t *fwdAlert = call AlertsForward.getPayload(&fwdMsg, sizeof(alert_t));
+ if (fwdAlert != NULL) {
+ *fwdAlert = *newAlert;
+ if (call AlertsForward.send(AM_BROADCAST_ADDR, &fwdMsg, sizeof *fwdAlert) == SUCCESS)
+ fwdBusy = TRUE;
+ }
}
return msg;
}