Do you use TOSSIM or real motes ?
in TOSSIM getlow32() doesn't work,
it always returns 0.
If you use real motes you probably
must search specific timers for your platform (in \platform\NAME\ directory)

Andrea
----- Original Message ----- From: "zeng 国锴" <[EMAIL PROTECTED]>
To: <tinyos-help@Millennium.Berkeley.EDU>
Sent: Monday, March 06, 2006 10:48 PM
Subject: [Tinyos-help] A question about getting the system time


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
Tinyos-help@Millennium.Berkeley.EDU
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help





--
Email.it, the professional e-mail, gratis per te: http://www.email.it/f

Sponsor:
Per la casa dei tuoi sogni, la soluzione � un Credito Casa Findomestic, facile 
e senza anticipi!
Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?mid=3939&d=6-3
_______________________________________________
Tinyos-help mailing list
Tinyos-help@Millennium.Berkeley.EDU
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to