weAut_01 / weAutSys    R 2.2.1
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines
Data Fields
ntpState_t Struct Reference

Data Fields

uint8_t adjuState
 State / actions of actual and previous adjustment.
struct uip_udp_conn * conn
 pointer to the connection (structure)
uint8_t count
 NTP state machine counter (used in some states)
struct ntpTimestamp_t lastReceiveTimestamp
 our receive (T4)
struct ntpTimestamp_t lastSendTimestamp
 our send / server' originate (T1)
struct ntpTimestamp_t lastT21
 the last T2-T1
struct ntpTimestamp_t lastT34
 the last T3-T4
uint8_t logLev
 NTP repoprt level.
uint16_t msDif
 Actual ms deviation.
uint16_t msDifPrev
 Previous ms deviation.
struct pt pt
 the protothreads (raw) structure
uint32_t secDif
 Actual deviation in seconds.
uint8_t state
 NTP state machine state.
struct timer_t timer
 the protocol timer, seconds resolution, duration type

Detailed Description

Structure for NTP (client) application state.


Field Documentation

uint8_t state

NTP state machine state.

The lower NTP_STATE_SRVMSK two bits are 0 = no connection or the number (1, 2) of a configured NTP server connected to.
Bit 3 (8) means waiting for server's reply.
At the upper 4 bits 0x10 means first try respectively first request,
0xF0 says connection problematic or faulty,
0xB0 is server answer problematic (bogus, alarm),
0xE0 means connection established and
0xC0 signals continuous synchronisation.

uint8_t logLev

NTP repoprt level.

The higher the value the more events will be reported to the buffered log device.
0: uninitialised; will be set according to macro DEBUG_NTP + 3 when initialising NTP.
0..3: silent
4 : quiet (almost silent)
5 : info
6 : verbose
7 : debug

uint8_t adjuState

State / actions of actual and previous adjustment.

Bits 7,6 : 1 = last positive, 2 = last negative, 0 = last 0
Bits 5,4 : 0 = in the range -100 .. + 50ms
    1 = in the range -999 .. +999 ms
    2 = in the range +1s .. +1999 ms; 3 = outside -999 .. +1999 ms

Bits 4,5 : same as 6,7 for previous action
Bits 0,1 : same as 2,3 for previous action

uint32_t secDif

Actual deviation in seconds.

This is the current seconds deviation (mod 2**32 in normal byte order). The effective sign of the correction is Bit 7 of adjuState. If bit 5 of adjuState is not set this value is old / irrelevant.

uint16_t msDif

Actual ms deviation.

This is the current fraction deviation converted to milliseconds (0..999). The sign is Bit 7 of adjuState.

uint16_t msDifPrev

Previous ms deviation.

This is the previous fraction deviation converted to milliseconds (0..999). The sign is Bit 3 of adjuState.


The documentation for this struct was generated from the following file: