Interface: moteiv.tos.lib.timer.GlobalTime
interface GlobalTime<typedef precision_tag>
Acquisition of a global time source with a given precision.
- Parameters:
-
precision_tag
- The precision of the time source, ie T32khz or TMilli
- Author:
-
Joe Polastre, Moteiv Corporation <info@moteiv.com>
Commands
command uint32_t convertToGlobal(uint32_t local)
command uint32_t convertToLocal(uint32_t global)
command uint32_t get()
command global_time_t getBoth()
command bool isValid()
Commands - Details
convertToGlobal
command uint32_t convertToGlobal(uint32_t local)
- Parameters:
-
local
- The local time to convert to global time
- Returns:
-
Global time value
convertToLocal
command uint32_t convertToLocal(uint32_t global)
- Parameters:
-
local
- The global time to convert to local time
- Returns:
-
Local time value
get
command uint32_t get()
- Returns:
-
a 32-bit value with the units of precision_tag
getBoth
command global_time_t getBoth()
- Returns:
-
A struct (global_time_t) returning both the global time
accessible through .global and the local time accessible
through .local
isValid
command bool isValid()
- Returns:
-
TRUE if the time is valid, FALSE if no time has been established
globally by this node.