十三、隐式网络时间同步
这个粗糙而简单的网络时间同步模块对网络中所有节点的时钟进行同步。
Files
file timesynch.c
A simple time synchronization mechanism.
file timesynch.h
Header file for a simple time synchronization mechanism.
Functions
void timesynch_init (void)
Initialize the timesynch module.
初始化timesynch模块。
rtimer_clock_t timesynch_time (void)
Get the current time-synchronized time.
获取当前时间同步时间。
rtimer_clock_t timesynch_time_to_rtimer (rtimer_clock_t synched_time)
Get the current time-synchronized time,
suitable for use with the rtimer module.
获取当前的时间同步时间,适合与rtimer模块一起使用。
rtimer_clock_t timesynch_rtimer_to_time (rtimer_clock_t rtimer_time)
Get the synchronized equivalent of an rtimer time.
获取与rtimer时间相等的同步时间。
rtimer_clock_t timesynch_offset (void)
Get the current time-synchronized offset from the rtimer clock,
which is used mainly for debugging.
从rtimer时钟获取当前时间同步偏移量,主要用于调试。
int timesynch_authority_level (void)
Get the current authority level of the time-synchronized time.
获取时间同步时间的当前权限级别。
void timesynch_set_authority_level (int level)
Set the authority level of the current time.
设置当前时间的权限级别。
Detailed Description
这个粗糙而简单的网络时间同步模块对网络中所有节点的时钟进行同步。
时间同步是隐式的,因为没有发送显式的时间同步消息:模块依赖于底层的网络设备驱动程序来对所有发出和传入的无线电消息进行时间戳。代码目前只能在Tmote Sky平台和cc2420驱动程序上工作。
每个节点都有一个权限级别,它包含在每个传出包中。如果从具有较高权限(较低权限号)的节点接收到消息,则节点将其时钟调整为与发送节点的时钟一致。
timesynch模块被实现为一个meta-MAC协议,因此对每个传入包调用该模块。
Function Documentation
int timesynch_authority_level (