Hi all,
I use tinyos to program my sensor motes. Because I want to measure the
delay of the packets, I have to record the current system time.
The part of my program is the following:
command result_t IntOutput.output(uint16_t value)
{
int aaa;
uint32_t time = call Time.getLow32();
IntMsg *message = (IntMsg *)data.data;
if (!pending)
{
pending = TRUE;
atomic {
message->src = TOS_LOCAL_ADDRESS;
}
if (time == 0) call Leds.yellowToggle();
aaa = (int)time;
message->val = aaa;
if (call Send.send(TOS_BCAST_ADDR, sizeof(IntMsg), &data))
return SUCCESS;
pending = FALSE;
}
return FAIL;
}
I use the LED to arbitrate the value of time (which is used to record the
current time)
if (time == 0) call Leds.yellowToggle();
but I find that time is always 0. I don't know why. Can anybody give me
some suggestion or advice? Thanks.
Best wishes,
Ferris
_________________________________________________________________
与联机的朋友进行交流,请使用 MSN Messenger: http://messenger.msn.com/cn
_______________________________________________
Tinyos-help mailing list
[email protected]
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help