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_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 the 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 149 of file C:/SiliconLabs/SimplicityStudio/v5/developer/sdks/gecko_sdk_suite/v3.2/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 155 of file C:/SiliconLabs/SimplicityStudio/v5/developer/sdks/gecko_sdk_suite/v3.2/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 161 of file C:/SiliconLabs/SimplicityStudio/v5/developer/sdks/gecko_sdk_suite/v3.2/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 169 of file C:/SiliconLabs/SimplicityStudio/v5/developer/sdks/gecko_sdk_suite/v3.2/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


Definition at line 177 of file C:/SiliconLabs/SimplicityStudio/v5/developer/sdks/gecko_sdk_suite/v3.2/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 the connection state.

Parameters
N/A

set the custom callback ptr to NULL Returns

  • wisun_network_connection_state_t Connection state


Definition at line 184 of file C:/SiliconLabs/SimplicityStudio/v5/developer/sdks/gecko_sdk_suite/v3.2/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 193 of file C:/SiliconLabs/SimplicityStudio/v5/developer/sdks/gecko_sdk_suite/v3.2/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 203 of file C:/SiliconLabs/SimplicityStudio/v5/developer/sdks/gecko_sdk_suite/v3.2/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 the IP address.

Parameters
[in]value

IP address raw byte values.

Uses the internal circular buffer. Returns

  • const char* converted string ptr


Definition at line 213 of file C:/SiliconLabs/SimplicityStudio/v5/developer/sdks/gecko_sdk_suite/v3.2/app/wisun/component/app_core/sl_wisun_app_core.h