[Tinyos-devel] Re: [Tinyos Core WG] time sync interfaces

Philip Levis pal at cs.stanford.edu
Tue Dec 18 15:42:40 PST 2007


On Dec 18, 2007, at 3:09 PM, Matt Welsh wrote:

> The applications that we study generally require millisecond or  
> better time synchronization. In general anything that is timing  
> sensitive is going to want to exploit the capabilities of the  
> platform on which it is being developed. A platform-independent  
> time interface is not very useful in these cases. If we're  
> concerned about things like portability for, say, time sync  
> protocols, I suggest that we make the datatype representing time be  
> very fine-grained (say, 1 usec or better) and provide a compile- 
> time constant indicating the true resolution.
>

The typical way to do this is to have a two-typed interface, where  
the first is the timer fidelity and the second is the width. E.g.,

interface SynchronizedTime<a, b>;

interface SynchronizedTime<TMicro, uint32_t>

That way you get compile-time checks, rather than depend on compile- 
time constants for resolution.

Phil


More information about the Tinyos-devel mailing list