Hi to all,
i've a problem with telosb / tinyos-2.x, it is the sequent:
event message_t* Receive.receive(message_t* msg, void* payload, uint8_t
len){
BlinkToRadioMsg* btrpkt;
if (len == sizeof(BlinkToRadioMsg)) {
btrpkt = (BlinkToRadioMsg*)payload;
if(btrpkt->destid==TOS_NODE_ID) {
setLeds(btrpkt->LedDaAccendere);
btrpkt->LedDaAccendere++;
if(btrpkt->LedDaAccendere==3)
btrpkt->LedDaAccendere=0;
btrpkt->destid=1;
btrpkt->sourceid=TOS_NODE_ID;
}
}
if(!busy){
msg=(message_t *)btrpkt;
if(call
AMSend.send(AM_BROADCAST_ADDR,msg,sizeof(BlinkToRadioMsg))
== SUCCESS) busy=TRUE;
}
return msg;
}
}
my problem is that the mote don't send any packet , maybe there is
something in the build of the msg before call AMSend, i don't know how
to put the structure in a variable message_t like msg.
specify that : BlinkToRadioMsg is a structure :
typedef nx_struct BlinkToRadioMsg {
nx_uint8_t sourceid;
nx_uint8_t destid;
nx_uint8_t LedDaAccendere;
} BlinkToRadioMsg;
thank you so much
--
Nino Caruso <[email protected]>
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help