[Tinyos Core WG] TEP102 and binary vs decimal units

Kevin Klues klueska at gmail.com
Tue May 22 09:25:52 PDT 2007


>
> Oh, and one more. Any objections to adding LocalTimeMilliC to the HIL
> requirements (provides LocalTime)? Was proposed by Cory, but hasn't
> been implemented or described in the TEP:
>

It might make sense to extend the LocalTime interface to be able to
hold a time larger than 32 bits, as well as perform a number of
operations on the local time.

i.e.
typedef nx_struct local_time16 {
  nx_uint16_t sticks; /* s: Ticks of 16 bit counter */
  nx_uint32_t mticks; /* m: Ticks incremented upon overflow of 16 bit counter */
} local_time16_t;

typedef nx_struct local_time32 {
  nx_uint32_t sticks; /* s: Ticks of 32 bit counter */
  nx_uint32_t mticks; /* m: Ticks incremented upon overflow of 32 bit counter */
} local_time32_t;

interface LocalTimeExtended<precision_tag, local_time_t> {
        async command local_time_t getNow();
        async command local_time_t add(local_time_t* t1, local_time_t* t2);
        async command local_time_t sub(local_time_t* t1, local_time_t* t2);
        async command int8_t compare(local_time_t* t1, local_time_t* t2);
        async command bool lessThan(local_time_t* t1, local_time_t* t2);
        async command bool greaterThan(local_time_t* t1, local_time_t* t2);
        async command bool equal(local_time_t* t1, local_time_t* t2);
}

Kevin


More information about the Tinyos-2.0wg mailing list