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_timeout, 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 1-For Broadcast Method, 2-For Unicast Method | ||||||||
[in] | sntp_timeout | - SNTP timeout value | ||||||||
[in] | rsi_sntp_client_create_response_handler | - Callback function when asynchronous response comes for the request. status: Expected error codes are : 0xBB0A, 0xFF5F, 0xBB0B, 0xBB15, 0xBB10 cmd_type: Command type buffer: Buffer pointer |
rsi_config_ipaddress() API needs to be called before this API.
Returns
0 - Success Negative Value - Failure -2 - Invalid parameters, call back not registered -3 - Command given in wrong state -4 - Buffer not available to serve the command
Note
SNTP broadcast method is currently not supported.
Refer to Error Codes section for more error codes Error Codes.
58
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 |
rsi_sntp_client_create_async() API needs to be called before this API.
Returns
0 - Success Negative Value - Failure -2 - Invalid parameters, callback not registered -3 - Command given in wrong state -4 - Buffer not available to serve the command
Note
Refer to Error Codes section for more error codes Error Codes.
191
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 |
rsi_sntp_client_create_async() API needs to be called before this API.
Returns
0 - Success Negative Value - Failure -2 - Invalid parameters, callback not registered -3 - Command given in wrong state -4 - Buffer not available to serve the command
Note
Refer to Error Codes section for more error codes Error Codes.
302
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 |
rsi_sntp_client_create_async() API needs to be called before this API.
Returns
0 - Success Negative Value - Failure -2 - Invalid parameters, call back not registered -3 - Command given in wrong state -4 - Buffer not available to serve the command
Note
Refer to Error Codes section for more error codes Error Codes.
413
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] |
rsi_sntp_client_create_async() API needs to be called before this API.
Returns
0 - Success Negative Value - Failure -2 - Invalid parameters, callback not registered -3 - Command given in wrong state -4 - Buffer not available to serve the command
Note
Refer to Error Codes section for more error codes Error Codes.
524
of file network/protocols/rsi_sntp_client.c