Application Status over CoAP (Alpha)#

The component implements status notifications over CoAP. It 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.

The following JSON shows the payload of the status notificaiton:

{
"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#

Configurations

Functions#

bool
sl_wisun_app_status_condition_cb(const sl_wisun_coap_notify_t *notify)

Application Status notification callback.

Application Status notification remote address and port getter.

uint32_t

Application Status notification schedule time getter.

void

Init Application Status notification content.

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.

void
sl_wisun_app_status_set_schedule_time_ms(const uint32_t new_schedule_time_ms)

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.

Parameters
N/Anotify

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.


Definition at line 76 of file /mnt/raid/workspaces/ws.obQFDUprC/overlay/gsdk/app/wisun/component/app_status/sl_wisun_app_status.h

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.

Parameters
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


Definition at line 84 of file /mnt/raid/workspaces/ws.obQFDUprC/overlay/gsdk/app/wisun/component/app_status/sl_wisun_app_status.h

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.

Parameters
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


Definition at line 92 of file /mnt/raid/workspaces/ws.obQFDUprC/overlay/gsdk/app/wisun/component/app_status/sl_wisun_app_status.h

sl_wisun_app_status_init#

void sl_wisun_app_status_init (void )

Init Application Status notification content.

Parameters
N/A

Init notification content and callbacks.


Definition at line 66 of file /mnt/raid/workspaces/ws.obQFDUprC/overlay/gsdk/app/wisun/component/app_status/sl_wisun_app_status.h

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.

Parameters
N/Aremote_address

remote address to be selected

N/Aport

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


Definition at line 103 of file /mnt/raid/workspaces/ws.obQFDUprC/overlay/gsdk/app/wisun/component/app_status/sl_wisun_app_status.h

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.

Parameters
N/Anew_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


Definition at line 111 of file /mnt/raid/workspaces/ws.obQFDUprC/overlay/gsdk/app/wisun/component/app_status/sl_wisun_app_status.h