[Tinyos-help] How to get current time in TinyOS

Michiel Konstapel m.konstapel at sownet.nl
Tue Jan 8 00:25:02 PST 2008


> For one mote, how do I get the its current time? Which
command/interface should I use?

The LocalTime interface gives you the time since the node was started. A
LocalTime<TMilli, uint32_t> (millisecond precision, 32 bits wide) should
be provided by your platform's HilTimerMilliC. If you need a different
precision or width, you'll have to wire it up yourself, probably by
using lib/timer/CounterToLocalTimeC.
HTH,
Michiel



More information about the Tinyos-help mailing list