OpenWSN Firmware
Adpativesync

adaptive sync module More...

Data Structures

struct  compensationInfo_t
 
struct  adaptive_sync_vars_t
 

Enumerations

enum  adaptive_sync_state_t { S_NONE = 0x00, S_FASTER = 0x01, S_SLOWER = 0x02 }
 

Functions

void adaptive_sync_init (void)
 initial this module More...
 
void adaptive_sync_preprocess (int16_t timeCorrection, open_addr_t timesource)
 Calculated how many slots have elapsed since last synchronized. More...
 
void adaptive_sync_calculateCompensatedSlots (int16_t timeCorrection)
 Calculate the compensation interval, in number of slots. More...
 
void adaptive_sync_countCompensationTimeout (void)
 update compensationTimeout at the beginning of each slot and adjust current slot length when the elapsed slots rearch to compensation interval. More...
 
void adaptive_sync_countCompensationTimeout_compoundSlots (uint16_t compoundSlots)
 update compensationTimeout when compound slots are scheduled and adjust the slot when the elapsed slots rearch to compensation interval(e.g. SERIALRX slots) More...
 
void adaptive_sync_driftChanged (void)
 set driftChanged to true. More...
 

Detailed Description

adaptive sync module

Author
Tengfei Chang tengf.nosp@m.ei.c.nosp@m.hang@.nosp@m.eecs.nosp@m..berk.nosp@m.eley.nosp@m..edu, January 2014.

Enumeration Type Documentation

Enumerator
S_NONE 
S_FASTER 
S_SLOWER 

Function Documentation

void adaptive_sync_calculateCompensatedSlots ( int16_t  timeCorrection)

Calculate the compensation interval, in number of slots.

Parameters
[in]timeCorrectiontime to be corrected
Returns
compensationSlots the number of slots.
void adaptive_sync_countCompensationTimeout ( void  )

update compensationTimeout at the beginning of each slot and adjust current slot length when the elapsed slots rearch to compensation interval.

Once compensationTimeout == 0, extend or shorten current slot length for one tick.

void adaptive_sync_countCompensationTimeout_compoundSlots ( uint16_t  compoundSlots)

update compensationTimeout when compound slots are scheduled and adjust the slot when the elapsed slots rearch to compensation interval(e.g. SERIALRX slots)

Parameters
[in]compoundSlotshow many slots will be elapsed before wakeup next time.
void adaptive_sync_driftChanged ( void  )

set driftChanged to true.

void adaptive_sync_init ( void  )

initial this module

void adaptive_sync_preprocess ( int16_t  timeCorrection,
open_addr_t  timesource 
)

Calculated how many slots have elapsed since last synchronized.

Parameters
[in]timeCorrectiontime to be corrected
[in]timesourceThe address of neighbor.
Returns
the number of slots