Modules#

Application Core type definitions

Utilities

Application Core#

The Application Core component aims at providing utilities common to most Wi-SUN applications. Following this objective, the component offers the following features:

  • A Wi-SUN connection helper function app_wisun_network_connect(). This function configures the network size setting, the TX output power, the certificates, and keys. The last function action is to start the catual Wi-SUN connection process.

  • An event handler and callback mechanisms. It provides a thread-safe abstraction layer on the Wi-SUN stack events reported in sl_wisun_on_event(). Two APIs (app_wisun_register_custom_callback() and app_wisun_remove_custom_callback()) are exposed to the application to add or remove custom callbacks associated with stack events.

  • A ping capability through the app_wisun_ping() function. It can be used to test communications and latencies in a Wi-SUN network.

  • A Socket FIFO overflow handler. The application can redefine the weakly implemented app_wisun_socket_fifo_overflow_handler() function to handle the socket FIFO overflow events.

  • A graphical interface in Simplicity Studio to configure the network name, TX power, and network size to be used during the connection process.

To use the component in your application, add it to your project and initialize it with app_wisun_core_init().

Functions#

void

Initialize Wi-SUN application core.

void

Connect to the Wi-SUN network.

void

Disconnect from the Wi-SUN network.

void
app_wisun_register_custom_callback(const sl_wisun_msg_ind_id_t id, custom_wisun_event_callback_t custom_callback)

Register custom callback.

void
app_wisun_remove_custom_callback(const sl_wisun_msg_ind_id_t id)

Remove custom callback.

bool
app_wisun_get_phy(wisun_phy_t *const wisun_phy)

Getting Wi-SUN PHY.

bool
app_wisun_ping(wisun_addr_t *const remote_addr)

Ping remote address.

void
app_wisun_socket_fifo_overflow_handler(const int32_t socketid, const uint8_t *remaining_buffer, const uint32_t remaining_size)

Wi-SUN socket FiFO overflow handler.

const char *
app_wisun_get_ip_address_str(const void *const value)

Get IP address.

Function Documentation#

app_wisun_core_init#

void app_wisun_core_init (void)

Initialize Wi-SUN application core.

Parameters
N/A

Init mutex, init socket handler and set Wi-SUN setting.


Definition at line 158 of file /mnt/raid/workspaces/ws.zJeaRLJo0/overlay/super/app/wisun/component/app_core/sl_wisun_app_core.h

app_wisun_network_connect#

void app_wisun_network_connect (void)

Connect to the Wi-SUN network.

Parameters
N/A

Network init and connecting.


Definition at line 164 of file /mnt/raid/workspaces/ws.zJeaRLJo0/overlay/super/app/wisun/component/app_core/sl_wisun_app_core.h

app_wisun_network_disconnect#

void app_wisun_network_disconnect (void)

Disconnect from the Wi-SUN network.

Parameters
N/A

Call Wi-SUN disconnect API.


Definition at line 170 of file /mnt/raid/workspaces/ws.zJeaRLJo0/overlay/super/app/wisun/component/app_core/sl_wisun_app_core.h

app_wisun_register_custom_callback#

void app_wisun_register_custom_callback (const sl_wisun_msg_ind_id_t id, custom_wisun_event_callback_t custom_callback)

Register custom callback.

Parameters
[in]id

sl_wisun_msg_ind_id_t message ID from the stack

[in]custom_callback

callback to regist.

Set the custom callback ptr.


Definition at line 178 of file /mnt/raid/workspaces/ws.zJeaRLJo0/overlay/super/app/wisun/component/app_core/sl_wisun_app_core.h

app_wisun_remove_custom_callback#

void app_wisun_remove_custom_callback (const sl_wisun_msg_ind_id_t id)

Remove custom callback.

Parameters
[in]id

sl_wisun_msg_ind_id_t message id from stack.

Set the custom callback ptr to NULL.


Definition at line 186 of file /mnt/raid/workspaces/ws.zJeaRLJo0/overlay/super/app/wisun/component/app_core/sl_wisun_app_core.h

app_wisun_get_connection_state#

wisun_network_connection_state_t app_wisun_get_connection_state (void)

Get connection state.

Parameters
N/A

Get internal connection bool variable value. Returns

  • wisun_network_connection_state_t Connection state.


Definition at line 193 of file /mnt/raid/workspaces/ws.zJeaRLJo0/overlay/super/app/wisun/component/app_core/sl_wisun_app_core.h

app_wisun_get_phy#

bool app_wisun_get_phy (wisun_phy_t *const wisun_phy)

Getting Wi-SUN PHY.

Parameters
[out]wisun_phy

structure that the parameters are going to be got into.

returns the set Wi-SUN PHY parameters in the stack. Returns

  • bool true if it is successful otherwise false


Definition at line 201 of file /mnt/raid/workspaces/ws.zJeaRLJo0/overlay/super/app/wisun/component/app_core/sl_wisun_app_core.h

app_wisun_ping#

bool app_wisun_ping (wisun_addr_t *const remote_addr)

Ping remote address.

Parameters
[in]remote_addr

Remote byte address.

Send ICMP packets to the remote and receive the response. Returns

  • True if ping was successful.

  • False error.


Definition at line 210 of file /mnt/raid/workspaces/ws.zJeaRLJo0/overlay/super/app/wisun/component/app_core/sl_wisun_app_core.h

app_wisun_socket_fifo_overflow_handler#

void app_wisun_socket_fifo_overflow_handler (const int32_t socketid, const uint8_t *remaining_buffer, const uint32_t remaining_size)

Wi-SUN socket FiFO overflow handler.

Parameters
[in]socketid

socket ID.

[in]remaining_buffer

remaining buffer ptr.

[in]remaining_size

remeaing size of buffer.

Weak implementation, which can be overridden. Users can create custom backup process to store remaining data.


Definition at line 220 of file /mnt/raid/workspaces/ws.zJeaRLJo0/overlay/super/app/wisun/component/app_core/sl_wisun_app_core.h

app_wisun_get_ip_address_str#

const char* app_wisun_get_ip_address_str (const void *const value)

Get IP address.

Parameters
[in]value

IP address raw byte values.

Uses the internal circular buffer. Returns

  • const char* converted string ptr.


Definition at line 230 of file /mnt/raid/workspaces/ws.zJeaRLJo0/overlay/super/app/wisun/component/app_core/sl_wisun_app_core.h