SNTP Client#
Functions#
Create SNTP client. This is a non-blocking API.
Get the current time parameters (NTP epoch time). This is a blocking API.
Get current time in time date format parameters. This is a blocking API.
Get SNTP server info. This is a blocking API.
Delete SNTP client. This is a non-blocking API.
Function Documentation#
rsi_sntp_client_create_async#
int32_t rsi_sntp_client_create_async (uint8_t flags, uint8_t * server_ip, uint8_t sntp_method, uint16_t sntp_retry_count, void(*)(uint16_t status, const uint8_t cmd_type, const uint8_t *buffer) rsi_sntp_client_create_response_handler)
Create SNTP client. This is a non-blocking API.
[in] | flags | - Select IP version and security
| ||||||||
[in] | server_ip | - Server IP address | ||||||||
[in] | sntp_method | - SNTP methods to use | ||||||||
[in] | sntp_retry_count | - Configures SNTP max retry count | ||||||||
[in] | rsi_sntp_client_create_response_handler | - Callback function when asynchronous response comes for the request. |
Returns
0 - Success
Negative Value - Failure (Possible Error Codes - 0xfffffffe,0xfffffffd,0xfffffffa)
Note
Precondition - rsi_config_ipaddress() API needs to be called before this API.
SNTP broadcast method is currently not supported.
Refer to Error Codes for the description of above error codes.
59
of file network/protocols/rsi_sntp_client.c
rsi_sntp_client_gettime#
int32_t rsi_sntp_client_gettime (uint16_t length, uint8_t * sntp_time_rsp)
Get the current time parameters (NTP epoch time). This is a blocking API.
[in] | length | - Length of the buffer |
[in] | sntp_time_rsp | - Current time response |
Returns
0 - Success
Negative Value - Failure (Possible Error Codes - 0xfffffffe,0xfffffffd,0xfffffffa)
Note
Precondition - rsi_sntp_client_create_async() API needs to be called before this API.
Refer to Error Codes for the description of above error codes.
189
of file network/protocols/rsi_sntp_client.c
rsi_sntp_client_gettime_date#
int32_t rsi_sntp_client_gettime_date (uint16_t length, uint8_t * sntp_time_date_rsp)
Get current time in time date format parameters. This is a blocking API.
[in] | length | - Length of the buffer |
[in] | sntp_time_date_rsp | - Current time and date response |
Returns
0 - Success
Negative Value - Failure (Possible Error Codes - 0xfffffffe,0xfffffffd,0xfffffffa)
Note
Precondition - rsi_sntp_client_create_async() API needs to be called before this API.
Refer to Error Codes for the description of above error codes.
297
of file network/protocols/rsi_sntp_client.c
rsi_sntp_client_server_info#
int32_t rsi_sntp_client_server_info (uint16_t length, uint8_t * sntp_server_response)
Get SNTP server info. This is a blocking API.
[in] | length | - Reponse buffer length |
[in] | sntp_server_response | - Pointer to the SNTP Reponse buffer |
Returns
0 - Success
Negative Value - Failure (Possible Error Codes - 0xfffffffe,0xfffffffd,0xfffffffa)
Note
Precondition - rsi_sntp_client_create_async() API needs to be called before this API.
Refer to Error Codes for the description of above error codes.
405
of file network/protocols/rsi_sntp_client.c
rsi_sntp_client_delete_async#
int32_t rsi_sntp_client_delete_async (void )
Delete SNTP client. This is a non-blocking API.
[in] |
Returns
0 - Success
Negative Value - Failure (Possible Error Codes - 0xfffffffe,0xfffffffd,0xfffffffa)
Note
Precondition - rsi_sntp_client_create_async() API needs to be called before this API.
Refer to Error Codes for the description of above error codes.
513
of file network/protocols/rsi_sntp_client.c