Network Time Protocol functions. More...

Modules

Types
NTP data types.

Functions

gos_result_t gos_ntp_update ( ntp_packet_t *packet_buffer, gos_ntp_update_event_t event_handler)
Invoke a NTP update. More...

Detailed Description

Network Time Protocol functions.

Function Documentation

gos_ntp_update()

gos_result_t gos_ntp_update ( ntp_packet_t * packet_buffer,
gos_ntp_update_event_t event_handler
)

Invoke a NTP update.

A network connection is required for this API. Once invoked Gecko OS will attempt to retrieve the time from the NTP server specified in the 'ntp.server' setting.

The API is non-blocking. Once called a background process attempts to retrieve the time. When the process passes/fails, the supplied event handler is called. See gos_ntp_update_event_t .

Note
The 'ntp.enabled' setting MUST be enabled on startup for this API to work.
a NTP update is automatically invoked every 'ntp.interval' seconds.

See the NTP settings documentation NTP Update .

Parameters
[in] packet_buffer Buffer to hold NTP packet supplied to event handler, optional, leave NULL if unused
[in] event_handler Event handler to be called when new NTP time is received, see gos_ntp_update_event_t
Returns
Result of API call, gos_result_t