contiki学习笔记(十)隐式网络时间同步、protothreads

十三、隐式网络时间同步

这个粗糙而简单的网络时间同步模块对网络中所有节点的时钟进行同步。

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	(	
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值