NetBurner 3.5.6
PDF Version
NTPServer::NtpTimeStamp Class Reference

#include <NTPServer.h>

Public Member Functions

bool SetFrom (uint32_t tt, uint32_t From1588)
 
 NtpTimeStamp ()
 
NtpTimeStampoperator= (UDPPacket &upkt)
 
NtpTimeStampoperator= (const NtpTimeStamp &src)
 

Static Public Member Functions

static NtpTimeStamp Now ()
 

Public Attributes

beuint32_t sec
 Seconds since NTP epoch (big endian)
 
beuint32_t frac
 Fractional seconds (big endian)
 

Detailed Description

NtpTimeStamp struct - Represents an NTP timestamp

NTP timestamps are 64-bit values with 32-bit seconds and 32-bit fraction The epoch is January 1, 1900 00:00:00 UTC

Constructor & Destructor Documentation

◆ NtpTimeStamp()

NTPServer::NtpTimeStamp::NtpTimeStamp ( )
inline

Default constructor - initializes to zero

Member Function Documentation

◆ Now()

NTPServer::NtpTimeStamp NTPServer::NtpTimeStamp::Now ( )
static

Create timestamp for current time

Returns
NtpTimeStamp representing current time

◆ operator=() [1/2]

NTPServer::NtpTimeStamp & NTPServer::NtpTimeStamp::operator= ( const NtpTimeStamp & src)

Copy assignment operator

Parameters
srcSource timestamp to copy
Returns
Reference to this timestamp

◆ operator=() [2/2]

NTPServer::NtpTimeStamp & NTPServer::NtpTimeStamp::operator= ( UDPPacket & upkt)

Extract timestamp from UDP packet Uses packet timing information to create precise timestamp

Parameters
upktReference to UDP packet
Returns
Reference to this timestamp

◆ SetFrom()

bool NTPServer::NtpTimeStamp::SetFrom ( uint32_t tt,
uint32_t From1588 )

Set timestamp from OS tick and 1588 timer values

Parameters
ttOS tick count
From15881588 timer value
Returns
true if timestamp was set successfully, false if no valid GPS time

The documentation for this class was generated from the following files: