Application Settings#
The Application Settings component provides the fundamental API for getting and setting Wi-SUN related settings within the application code. After initializing with the app_wisun_setting_init() function, the setters and getters can be used in the application to interface with runtime settings such as network name, network size, TX power, and PHY configuration.
A notification mechanism is implemented and is triggered by the appropriate settings changes.
The following code snippet demonstrates the API usage:
#include "sl_wisun_api.h"
#include "sl_wisun_app_setting.h"
#include "sl_wisun_app_core_util.h"
static void change_settings(void) {
app_setting_wisun_t setting = { 0 };
sl_status_t status = SL_STATUS_FAIL;
// Disconnect before setting new values
sl_wisun_disconnect();
// Get all the settings
status = app_wisun_setting_get(&setting);
if (status != SL_STATUS_OK) {
// Error handling
return;
}
// Increasing TX power
setting.tx_power += 10;
status = app_wisun_setting_set_tx_power(&setting.tx_power);
if (status != SL_STATUS_OK) {
// Error handling
return;
}
// Connect with the new settings
sl_wisun_app_core_util_connect_and_wait();
}
Modules#
Functions#
Acknowledge notification.
Get the Wi-SUN settings.
Get the Wi-SUN network name.
Get the Wi-SUN network size.
Get the Wi-SUN PHY.
Get the Wi-SUN TX power.
Initialize Wi-SUN setting.
Init internal PHY settings.
Is setting notified getter.
Set the Wi-SUN network name.
Set the Wi-SUN network size.
Set the Wi-SUN PHY.
Set the Wi-SUN TX power.
Subscribe to setting notification channel.
Unsubscribe from setting notification.
Macros#
Wi-SUN settings default subscription channel.
Wi-SUN default network name size.
Function Documentation#
app_wisun_setting_ack_notification#
void app_wisun_setting_ack_notification (const app_setting_notification_t notif, const uint8_t channel)
Acknowledge notification.
[in] | notif | ype of the notification 'app_setting_notification_t' |
[in] | channel | channel number, this is the output of the subscription |
Delete notification channel flag
226
of file /mnt/raid/workspaces/ws.obQFDUprC/overlay/gsdk/app/wisun/component/app_setting/sl_wisun_app_setting.h
app_wisun_setting_get#
sl_status_t app_wisun_setting_get (app_setting_wisun_t *const wisun_setting)
Get the Wi-SUN settings.
[out] | wisun_setting | is the obtained Wi-SUN setting |
Returns
sl_status_t if the getting is successful it returns SL_STATUS_OK, otherwise error code.
115
of file /mnt/raid/workspaces/ws.obQFDUprC/overlay/gsdk/app/wisun/component/app_setting/sl_wisun_app_setting.h
app_wisun_setting_get_network_name#
sl_status_t app_wisun_setting_get_network_name (char *const name, uint8_t size)
Get the Wi-SUN network name.
[out] | name | pointer where the name is copied onto |
[in] | size | is the size of the name buffer |
Returns
sl_status_t it is successful if it returns SL_STATUS_OK otherwise it is not.
156
of file /mnt/raid/workspaces/ws.obQFDUprC/overlay/gsdk/app/wisun/component/app_setting/sl_wisun_app_setting.h
app_wisun_setting_get_network_size#
sl_status_t app_wisun_setting_get_network_size (uint8_t *const size)
Get the Wi-SUN network size.
[out] | size | pointer where the network size is copied onto |
Returns
sl_status_t it is successful if it returns SL_STATUS_OK otherwise it is not.
164
of file /mnt/raid/workspaces/ws.obQFDUprC/overlay/gsdk/app/wisun/component/app_setting/sl_wisun_app_setting.h
app_wisun_setting_get_phy#
sl_status_t app_wisun_setting_get_phy (sl_wisun_phy_config_t *const phy)
Get the Wi-SUN PHY.
[out] | phy | pointer where the PHY is copied onto |
Returns
sl_status_t it is successful if it returns SL_STATUS_OK otherwise it is not.
180
of file /mnt/raid/workspaces/ws.obQFDUprC/overlay/gsdk/app/wisun/component/app_setting/sl_wisun_app_setting.h
app_wisun_setting_get_tx_power#
sl_status_t app_wisun_setting_get_tx_power (int16_t *const tx_power)
Get the Wi-SUN TX power.
[out] | tx_power | pointer where the TX power is copied onto |
Returns
sl_status_t it is successful if it returns SL_STATUS_OK otherwise it is not.
172
of file /mnt/raid/workspaces/ws.obQFDUprC/overlay/gsdk/app/wisun/component/app_setting/sl_wisun_app_setting.h
app_wisun_setting_init#
void app_wisun_setting_init (void )
Initialize Wi-SUN setting.
N/A |
107
of file /mnt/raid/workspaces/ws.obQFDUprC/overlay/gsdk/app/wisun/component/app_setting/sl_wisun_app_setting.h
app_wisun_setting_init_phy_cfg#
sl_status_t app_wisun_setting_init_phy_cfg (void )
Init internal PHY settings.
N/A |
Full radio config: data initialized with default HPY for appropriate board Simple PHY: get first element of PHY list by 'sl_wisun_util_get_rf_settings' Returns
sl_status_t it is successful if it returns SL_STATUS_OK otherwise it is not.
189
of file /mnt/raid/workspaces/ws.obQFDUprC/overlay/gsdk/app/wisun/component/app_setting/sl_wisun_app_setting.h
app_wisun_setting_is_notified#
bool app_wisun_setting_is_notified (const app_setting_notification_t notif, const uint8_t channel)
Is setting notified getter.
[in] | notif | Type of the notification 'app_setting_notification_t' |
[in] | channel | channel number, this is the output of the subscription |
Polling notification flag Returns
bool true if channel is notified by setting, otherwise false
208
of file /mnt/raid/workspaces/ws.obQFDUprC/overlay/gsdk/app/wisun/component/app_setting/sl_wisun_app_setting.h
app_wisun_setting_set_network_name#
sl_status_t app_wisun_setting_set_network_name (const char *const name)
Set the Wi-SUN network name.
[out] | name | is the network name that will be set. |
Returns
sl_status_t if the set is successful it returns SL_STATUS_OK, otherwise error code.
123
of file /mnt/raid/workspaces/ws.obQFDUprC/overlay/gsdk/app/wisun/component/app_setting/sl_wisun_app_setting.h
app_wisun_setting_set_network_size#
sl_status_t app_wisun_setting_set_network_size (const uint8_t *const size)
Set the Wi-SUN network size.
[in] | size | is the pointer to network size that will be set. |
Returns
sl_status_t if the set is successful it returns SL_STATUS_OK, otherwise error code.
131
of file /mnt/raid/workspaces/ws.obQFDUprC/overlay/gsdk/app/wisun/component/app_setting/sl_wisun_app_setting.h
app_wisun_setting_set_phy#
sl_status_t app_wisun_setting_set_phy (const sl_wisun_phy_config_t *const phy)
Set the Wi-SUN PHY.
[out] | phy | is the PHY that will be set. |
Returns
sl_status_t if the set is successful it returns SL_STATUS_OK, otherwise error code.
147
of file /mnt/raid/workspaces/ws.obQFDUprC/overlay/gsdk/app/wisun/component/app_setting/sl_wisun_app_setting.h
app_wisun_setting_set_tx_power#
sl_status_t app_wisun_setting_set_tx_power (const int16_t *const tx_power)
Set the Wi-SUN TX power.
[out] | tx_power | is the pointer to TX power that will be set. |
Returns
sl_status_t if the set is successful it returns SL_STATUS_OK, otherwise error code.
139
of file /mnt/raid/workspaces/ws.obQFDUprC/overlay/gsdk/app/wisun/component/app_setting/sl_wisun_app_setting.h
app_wisun_setting_subscribe_notification#
sl_status_t app_wisun_setting_subscribe_notification (const app_setting_notification_t notif, uint8_t *const channel)
Subscribe to setting notification channel.
[in] | notif | Type of the notification 'app_setting_notification_t' |
[out] | channel | Provided channel number, this is the output of the subscription |
Notifications are received on the channel (output) about notification type Returns
sl_status_t SL_STATUS_OK on success, otherwise SL_STATUS_FAIL
198
of file /mnt/raid/workspaces/ws.obQFDUprC/overlay/gsdk/app/wisun/component/app_setting/sl_wisun_app_setting.h
app_wisun_setting_unsubscribe#
void app_wisun_setting_unsubscribe (const app_setting_notification_t notif, const uint8_t channel)
Unsubscribe from setting notification.
[in] | notif | Type of the notification 'app_setting_notification_t' |
[in] | channel | channel number, this is the output of the subscription |
Delete notification channel flag from subscripted channel flags
217
of file /mnt/raid/workspaces/ws.obQFDUprC/overlay/gsdk/app/wisun/component/app_setting/sl_wisun_app_setting.h
Macro Definition Documentation#
APP_SETTING_DEFAULT_SUBSCRIPT_CH#
#define APP_SETTING_DEFAULT_SUBSCRIPT_CHValue:
0U
Wi-SUN settings default subscription channel.
58
of file /mnt/raid/workspaces/ws.obQFDUprC/overlay/gsdk/app/wisun/component/app_setting/sl_wisun_app_setting.h
APP_SETTING_NETWORK_NAME_MAX_SIZE#
#define APP_SETTING_NETWORK_NAME_MAX_SIZEValue:
(SL_WISUN_NETWORK_NAME_SIZE + 1)
Wi-SUN default network name size.
55
of file /mnt/raid/workspaces/ws.obQFDUprC/overlay/gsdk/app/wisun/component/app_setting/sl_wisun_app_setting.h