Hello All,
I am new to TinyOS and I am trying to modify the BlinkToRadio program to
read in the ID and Counter of received messages at one mote from its
surrounding motes. I assume I should be modifying this portion of the code:
event message_t* Receive.receive(message_t* msg, void* payload, uint8_t
len){
if (len == sizeof(BlinkToRadioMsg)) {
BlinkToRadioMsg* btrpkt = (BlinkToRadioMsg*)payload;
setLeds(btrpkt->counter);
}
return msg;
}
I tried to establish another variable "recpkt" built as a BlinkToRadioMsg
struct, but set to the received packet's ID and Counter.
event message_t* Receive.receive(message_t* msg, void* payload, uint8_t
len){
if (len == sizeof(BlinkToRadioMsg)) {
BlinkToRadioMsg* btrpkt = (BlinkToRadioMsg*)payload;
setLeds(btrpkt->counter);
BlinkToRadioMsg* recpkt = msg;
recpkt->nodeid = TOS_NODE_ID;
recpkt->counter = counter;
}
return msg;
}
I don't think msg and recpkt are in the same format, which is probably why
my code doesn't work and "recpkt" gives the same values as the sent packets,
not the received ones.
I would greatly appreciate any suggestions (improvements or other ways to go
about this are both welcome!)
Thanks in advance,
Ellen
--
Columbia University
MS Electrical Engineering
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help