Tizen RT Libs&Environment  v1.0 D5
NTP Client

Provides APIs for NTP(Network Time Protocol) Client. More...

Collaboration diagram for NTP Client:

Files

file  ntpclient.h
 APIs for NTP Client.
 

Data Structures

struct  ntpc_server_conn_s
 Structure of NTP server's connection information. More...
 
struct  ntpc_server_s
 Structure of NTP server information. More...
 

Macros

#define MAX_NTP_SERVER_NUM   5
 
#define MIN_NTP_POLL_INTERVAL_SECS   10 /* 10 seconds */
 
#define MAX_NTP_POLL_INTERVAL_SECS   (24 * 60 * 60) /* 24 hours */
 
#define EXTERN   extern
 

Enumerations

Functions

int ntpc_start (struct ntpc_server_conn_s *server_list, uint32_t num_of_servers, uint32_t interval_secs, void *link_error_cb)
 ntpc_start() starts the NTP client daemon. More...
 
int ntpc_stop (void)
 ntpc_stop() stops the NTP client daemon. More...
 
int ntpc_get_status (void)
 ntpc_get_status() gets NTP client daemon's status value. More...
 

Detailed Description

Provides APIs for NTP(Network Time Protocol) Client.

Macro Definition Documentation

#define EXTERN   extern

Definition at line 131 of file ntpclient.h.

#define MAX_NTP_POLL_INTERVAL_SECS   (24 * 60 * 60) /* 24 hours */

Definition at line 79 of file ntpclient.h.

#define MAX_NTP_SERVER_NUM   5

Definition at line 77 of file ntpclient.h.

#define MIN_NTP_POLL_INTERVAL_SECS   10 /* 10 seconds */

Definition at line 78 of file ntpclient.h.

Enumeration Type Documentation

This enumeration describes the state of the NTP daemon.

Enumerator
NTP_NOT_RUNNING 
NTP_STARTED 
NTP_RUNNING 
NTP_STOP_REQUESTED 
NTP_STOPPED 

Definition at line 88 of file ntpclient.h.

This enumeration describes the state of the NTP Client's Link.

Enumerator
NTP_LINK_NOT_SET 
NTP_LINK_DOWN 
NTP_LINK_UP 

Definition at line 99 of file ntpclient.h.

Function Documentation

int ntpc_get_status ( void  )

ntpc_get_status() gets NTP client daemon's status value.

Parameters
[in]none
Returns
ntpc daemon's status value is returned (please, refer to enum ntpc_daemon_e definition).
Since
Tizen RT v1.0
int ntpc_start ( struct ntpc_server_conn_s server_list,
uint32_t  num_of_servers,
uint32_t  interval_secs,
void *  link_error_cb 
)

ntpc_start() starts the NTP client daemon.

Parameters
[in]server_listthe array of struct ntpc_server_conn_s
  • server_list[n]->hostname : ntp server's hostname
  • server_list[n]->port : ntp server's port number
[in]num_of_serversnumber of servers
[in]interval_secspolling interval seconds
[in]link_error_cbcallback function for link error case
Returns
On success, the non-negative task ID of the NTPC daemon is returned. On failure, a negative value is returned.
Since
Tizen RT v1.0
int ntpc_stop ( void  )

ntpc_stop() stops the NTP client daemon.

Parameters
[in]none
Returns
On success, 0 is returned. On failure, a negative value is returned.
Since
Tizen RT v1.0