Ping#
The Ping component implements a ping service based on the ICMPv6 protocol. The component sends ICMPv6 packets, receives the associated responses, and computes the round-trip latency. Using the sl_wisun_ping_request() API, an application emits a single ping packet. To receive the pong response, the application can then call the sl_wisun_ping_response() API.
The sl_wisun_ping() function provides a simple solution to periodically send and receive ping packets. To stop the process, call the sl_wisun_ping_stop() function. A ping test is configurable in size, number of pings sent, and timeout if a response is not received. Ping service supports multicast group addresses, where multiple response can be received from different addresses.
To initialize the component, call sl_wisun_ping_init() function.
The Ping component implements a ping service utilizing the ICMPv6 protocol. It can send ICMPv6 packets, receive corresponding responses, and calculate round-trip latency.
Applications can emit a single ping packet using the sl_wisun_ping_request() API. To receive the pong response, the sl_wisun_ping_response() API is called. The sl_wisun_ping() function offers a straightforward solution for periodic ping packet transmission and reception. To halt the process, use the sl_wisun_ping_stop() function.
Ping test parameters such as size, number of pings sent, and timeout for response absence are configurable. Initialization of the component is done by calling the sl_wisun_ping_init() function.
Modules#
Functions#
Provide a high level ping API.
Initialize the ping service module.
Send a ping request.
Retrieve a ping response.
Stop the current ping process.
Function Documentation#
sl_wisun_ping#
sl_status_t sl_wisun_ping (const sockaddr_in6_t *const remote_addr, const uint16_t packet_count, const uint16_t packet_length, sl_wisun_ping_stat_hnd_t stat_hnd, sl_wisun_ping_req_resp_done_hnd_t req_resp_sent_hnd)
Provide a high level ping API.
Type | Direction | Argument Name | Description |
---|---|---|---|
const sockaddr_in6_t *const | [in] | remote_addr | Remote destination address |
const uint16_t | [in] | packet_count | Count of packets |
const uint16_t | [in] | packet_length | ICMPv6 packet length including header |
sl_wisun_ping_stat_hnd_t | [in] | stat_hnd | Custom statistic handler function |
sl_wisun_ping_req_resp_done_hnd_t | [in] | req_resp_sent_hnd | Request/Response sent handler function |
The function provides an interface for periodically sending and receiving ping ICMPv6 packets, and collecting statistic data. Returns
sl_status_t SL_STATUS_OK on success, otherwise SL_STATUS_FAIL or SL_STATUS_ABORT
sl_wisun_ping_init#
void sl_wisun_ping_init (void )
Initialize the ping service module.
Type | Direction | Argument Name | Description |
---|---|---|---|
void | N/A |
This function initializes the service thread, mutex, and message queues.
sl_wisun_ping_request#
void sl_wisun_ping_request (const sl_wisun_ping_info_t *const ping_request)
Send a ping request.
Type | Direction | Argument Name | Description |
---|---|---|---|
const sl_wisun_ping_info_t *const | [in] | ping_request | Ping Request Information |
The function sends a single ICMPv6 request.
sl_wisun_ping_response#
void sl_wisun_ping_response (sl_wisun_ping_info_t *const ping_response)
Retrieve a ping response.
Type | Direction | Argument Name | Description |
---|---|---|---|
sl_wisun_ping_info_t *const | [out] | ping_response | Ping Response Information |
The function retrieves a ping response information.
sl_wisun_ping_stop#
void sl_wisun_ping_stop (void )
Stop the current ping process.
Type | Direction | Argument Name | Description |
---|---|---|---|
void | N/A |
Reset request and response queues and send a special ping request with interrupt ping status.