[Tinyos-help] - A mote capture and send the message to two other
Tiago Wanderley
tiagowanderleyufcg at gmail.com
Thu Dec 6 09:23:52 PST 2007
Hi,
first, I would warn that my English is not good. =D
I'am with problem, captured a date e turn on leds if this value is greater
than 0x300. After I sent the value for other two motes, using the tasks
send02() and send03(). The task send02() is executed with success, the mote
of id 02 receive the message,but the send03 () was not executed,
consequently the mote of id 03 has not received the message. Below the part
of the code involved:
task void send03()
{
SenseMessage *message3 = (SenseMessage *)data3.data;
if (!pending) {
atomic {
pending = TRUE;
message3->value = value;
}
message3->source = TOS_LOCAL_ADDRESS;
if (! call SendMsg.send(03, sizeof(SenseMessage), &data3))
pending = FALSE;
}
}
task void send02()
{
SenseMessage *message = (SenseMessage *)data.data;
if (!pending) {
atomic {
pending = TRUE;
message->value = value;
}
message->source = TOS_LOCAL_ADDRESS;
if (! call SendMsg.send(02, sizeof(SenseMessage), &data))
pending = FALSE;
}
}
async event result_t ADC.dataReady(uint16_t val) {
atomic value = val;
post send02();
pending = FALSE;
post send03();
display(val);
return SUCCESS;
}
Help-me... =D
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://www.millennium.berkeley.edu/pipermail/tinyos-help/attachments/20071206/e8eca38e/attachment.htm
More information about the Tinyos-help
mailing list