Modules#
Application Core API type definitions
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. The app_wisun_network_is_connected() function provides a simple connection status getter too.
Event handlers for basic Wi-SUN network events. The component includes the basic event handler implementations.
Available addresses. Retrieve known IPv6 addresses with the app_wisun_get_current_addresses() function.
Error Getter. app_wisun_core_get_error() function for getting status of the Stack API calls.
To use the component in your application, add it to your project and initialize it with app_wisun_core_init().
Functions#
Initialize Wi-SUN application core.
Get application core error.
Connect to the Wi-SUN network.
Get current addresses .
app_wisun_wait_for_connection#
void app_wisun_wait_for_connection (void )
Wait for the connection.
Type | Direction | Argument Name | Description |
---|---|---|---|
void | N/A |
This function doesn't call the app_wisun_network_connect() function. The function provides a delay loop with optional heart beat printing till the connection state has not been changed.
app_wisun_connect_and_wait#
void app_wisun_connect_and_wait (void )
Connect and wait for connection.
Type | Direction | Argument Name | Description |
---|---|---|---|
void | N/A |
The function calls app_wisun_network_connect() function and app_wisun_wait_for_connection() function. It can be useful at the beginning of application thread.
app_wisun_network_is_connected#
bool app_wisun_network_is_connected (void )
Network is connected.
Type | Direction | Argument Name | Description |
---|---|---|---|
void | N/A |
Wrapper function of join state getter Returns
true Connected
false Not connected
Function Documentation#
app_wisun_core_init#
void app_wisun_core_init (void )
Initialize Wi-SUN application core.
Type | Direction | Argument Name | Description |
---|---|---|---|
void | N/A |
Initializing mutex, socket handler and set Wi-SUN settings.
app_wisun_core_get_error#
bool app_wisun_core_get_error (app_core_error_state_flag_t flag)
Get application core error.
Type | Direction | Argument Name | Description |
---|---|---|---|
app_core_error_state_flag_t | [in] | flag | is the indicator of the error |
The function retrieves the application core error status based on flag
app_wisun_network_connect#
void app_wisun_network_connect (void )
Connect to the Wi-SUN network.
Type | Direction | Argument Name | Description |
---|---|---|---|
void | N/A |
Network initialization and connection. The function initializes the network with parameters (Network name, TX Power, Network size, etc.) by the stored settings in NVM if the settings component is added to the project, otherwise with the default settings.
app_wisun_get_current_addresses#
void app_wisun_get_current_addresses (current_addr_t *const dest_addresses)
Get current addresses .
Type | Direction | Argument Name | Description |
---|---|---|---|
current_addr_t *const | [out] | dest_addresses | Destination |
Copy cached addresses into destination.