Interface: tos.lib.ftsp.GlobalTime

interface GlobalTime<typedef precision_tag>

Commands
command error_t getGlobalTime(uint32_t *time) Reads the current global time.
command uint32_t getLocalTime() Returns the current local time of this mote.
command error_t global2Local(uint32_t *time) Converts the global time given in time into the correspoding local time and stores this again in time.
command error_t local2Global(uint32_t *time) Converts the local time given in time into the corresponding global time and stores this again in time.

Commands - Details

getGlobalTime

command error_t getGlobalTime(uint32_t *time)

Reads the current global time. This method is a combination of getLocalTime and local2Global.

Returns:
SUCCESS if this mote is synchronized, FAIL otherwise.

getLocalTime

command uint32_t getLocalTime()

Returns the current local time of this mote.

global2Local

command error_t global2Local(uint32_t *time)

Converts the global time given in time into the correspoding local time and stores this again in time. This method performs the inverse of the local2Global transformation.

Returns:
SUCCESS if this mote is synchronized, FAIL otherwise.

local2Global

command error_t local2Global(uint32_t *time)

Converts the local time given in time into the corresponding global time and stores this again in time. The following equation is used to compute the conversion: globalTime = localTime + offset + skew * (localTime - syncPoint) The skew is normalized to 0.0 (1.0 is subtracted) to increase the machine precision. The syncPoint value is periodically updated to increase the machine precision of the floating point arithmetic and also to allow time wrap.

Returns:
SUCCESS if this mote is synchronized, FAIL otherwise.