Application Status over CoAP (Alpha)#
The component implements status notifications and resources over CoAP. The component can be used in any application to gather runtime information about devices. The component should be initialized with the sl_wisun_app_status_init() function. Conditional sending can be customized by implementing the sl_wisun_app_status_condition_cb() function. Server and notification parameters can be configured in the sl_wisun_app_status_config.h file or at runtime using the appropriate setters/getters.
When the application starts, the component is initialized automatically with the default values from the configuration header. The configuration interface provides options to enable or disable the expected statistics data from the nodes, such as device information, execution time statistics, and neighbor information.
Notifications can be received on any CoAP server, such as the libcoap server application. Over the prebuilt binaries, any custom library can be used to implement a CoAP server that receives the notifications from the Wi-SUN node.
CoAP resources can be accessed using the CoAP client, such as the libcoap client application to provide a solution for handling CoAP requests sent directly to the node. The application status resource is configurable through the configuration header file and can be optionally enabled or disabled at compile time.
The following JSON shows the payload of the status notification/resource:
{
"dev_info": {
"hw": "BRD4270B A06 EFR32FG25B222F1920IM56",
"sw": "Wi-SUN Ping Application v2.0.0 (stack: v2.3.0 FFN)",
"mac": "60:A4:23:FF:FE:37:A7:57",
"ip": "fd12:3456::62a4:23ff:fe37:a757"
},
"stat": {
"run": "000-02:47:37",
"conn_cnt": 2,
"conn": "000-00:30:35",
"tot_conn": "000-02:43:23",
"disconn": "000-00:26:26",
"tot_disconn": "000-00:04:26",
"available": "97.35%"
},
"nb_info": {
"ip":["t","lt","txc","txf","txms","txmsf","rpl","etx","rslo","rsli"],
"fd12:3456::62a4:23ff:fe37:aed9":[0,2191,1352,0,0,0,128,134,133,143],
"fd12:3456::32fb:10ff:feed:414e":[2,2080,29,0,0,0,65535,141,119,132],
"fd12:3456::62a4:23ff:fe37:aee3":[2,545,14,0,0,0,65535,160,101,114]
}
}
Modules#
Functions#
Application Status notification callback.
Application Status notification remote address and port getter.
Application Status notification schedule time getter.
Init Application Status notification content.
Application Status notification remote address and port setter.
Application Status notification schedule time setter.
Function Documentation#
sl_wisun_app_status_condition_cb#
bool sl_wisun_app_status_condition_cb (const sl_wisun_coap_notify_t * notify)
Application Status notification callback.
Type | Direction | Argument Name | Description |
---|---|---|---|
const sl_wisun_coap_notify_t * | N/A | notify | Notification context. |
The function provides an implementable callback to create custom condition check to send notification. It's a weak implementation, by default it returns true always. Returns
bool The result of the condition check.
sl_wisun_app_status_get_remote_address#
sockaddr_in6_t * sl_wisun_app_status_get_remote_address (void )
Application Status notification remote address and port getter.
Type | Direction | Argument Name | Description |
---|---|---|---|
void | N/A |
The function provides a getter function for the address and port parameters that are static for the file Returns
sockaddr_in6_t The pointer to the address setting structure
sl_wisun_app_status_get_schedule_time_ms#
uint32_t sl_wisun_app_status_get_schedule_time_ms (void )
Application Status notification schedule time getter.
Type | Direction | Argument Name | Description |
---|---|---|---|
void | N/A |
The function provides a getter function for the schedule time parameters that are static for the file Returns
uint32_t The schedule time in ms
sl_wisun_app_status_init#
void sl_wisun_app_status_init (void )
Init Application Status notification content.
Type | Direction | Argument Name | Description |
---|---|---|---|
void | N/A |
Init notification content and callbacks.
sl_wisun_app_status_set_remote_address#
sl_status_t sl_wisun_app_status_set_remote_address (const char * remote_address, const uint16_t port)
Application Status notification remote address and port setter.
Type | Direction | Argument Name | Description |
---|---|---|---|
const char * | N/A | remote_address | remote address to be selected |
const uint16_t | N/A | port | remote port to be selected |
The function provides a setter function for the address and port parameters that are static for the file Returns
sl_status_t SL_STATUS_OK if setting was success or the proper sl_status enum of the error
sl_wisun_app_status_set_schedule_time_ms#
void sl_wisun_app_status_set_schedule_time_ms (const uint32_t new_schedule_time_ms)
Application Status notification schedule time setter.
Type | Direction | Argument Name | Description |
---|---|---|---|
const uint32_t | N/A | new_schedule_time_ms | The schedule time in ms |
The function provides a setter function for the schedule time parameters that are static for the file