Hi All,
I'm having trouble with sending packets, I just moved from tinyos 1 to
tinyos 2. In the following code a node should blinkwhen a packet is
received. The problem is that no packets are sent. AMSend.send, apparently,
always returns FAIL. Does anybody know if I am missing something?
Thanks
event void Timer0.fired()
{
//dbg("BlinkC", "Timer 0 fired @ %s.\n", sim_time_string());
my_msg_t* rcm = (my_msg_t*)call Packet.getPayload(&packet,
sizeof(my_msg_t));
if (rcm == NULL) {
return;
}
// call Leds.led0Toggle();
rcm->color = value;
if (call AMSend.send(AM_BROADCAST_ADDR, &packet, sizeof(my_msg_t)) ==
SUCCESS) {
dbg("RadioCountToLedsC", "RadioCountToLedsC: packet sent.\n",
counter);
call Leds.led0Toggle();
locked = TRUE;
}
call Timer0.startOneShot( (call Random.rand32()) % 2048 + 100 );
}
event message_t* Receive.receive(message_t* bufPtr, void* payload, uint8_t
len) {
call Leds.led1Toggle();
return bufPtr;
}
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help