Wi-SUN Stack API#
Wi-SUN Stack API is based on requests from the application to the stack and events from the stack to the application.
Requests are made using function calls, where a function call either performs the required action immediately or initiates an internal operation within the stack, which terminates with an event. All events contain a status code, indicating the result of the requested operation. Events are also used by the stack to notify the application of any important information, such as the state of the connection.
The application is expected to override sl_wisun_on_event() to handle events from the stack. Because all events share a common header, the function may be implemented as a switch statement. The event-specific data can be accessed through the sl_wisun_evt_t::evt union.
void sl_wisun_on_event(sl_wisun_evt_t *evt)
{
switch (evt->header.id) {
case SL_WISUN_MSG_CONNECTED_IND_ID:
handle_connected_event(evt->evt.connected);
break;
default:
break;
}
}
The API is thread-safe, which means can be called from multiple RTOS tasks. The stack guarantees that only a single request is executed at a time and that requests are handled in the order they were made. Event callback is executed in a different context than the request, so the API functions may be called from the event callback.
Modules#
Callbacks#
Callback handler for a single event.
Functions#
Accept a Direct Connect link.
Add a MAC address to the list of allowed addresses.
Clear the credential cache.
Set the mode switch configuration.
Add a MAC address to the list of denied addresses.
Disconnect from the Wi-SUN network.
Get the mask of channels excluded from channel plan.
Read an IP address.
Get the current join state.
Get the current device MAC address in use.
Get the number of RPL neighbors (parents and children).
Get information about a RPL neighbor (parent or child).
Get a list of RPL neighbor (parents and children) MAC addresses.
Get Wi-SUN network information.
Get the POM-IE configuration.
Get RPL information.
Get the Wi-SUN stack version.
Read a set of statistics.
Initiate a connection to a Wi-SUN network.
Reset a set of statistics in the stack.
Set the async transmission fragmentation parameters.
Set a mask of operating channels.
Set a mask of operating channels.
Configure the FFN parameter set.
Set the device certificate used to authenticate to the authentication server.
Set the private key of the device certificate.
Set the private key of the device certificate.
Set the device type.
Set the Pairwise Master Key (PMK) to use for Direct Connect.
Enable/disable Direct Connect.
Set the RPL leaf mode.
Configure the LFN parameter set.
Configure LFN parenting support.
Set the device MAC address to be used.
Set the PHY mode switch configuration.
Set neighbor table size.
Set the radio sensitivity for the given PHY.
Set the POM-IE configuration.
Set the PTI state.
Set the regional regulation.
Set the thresholds for transmission duration level event.
Set the connection security state.
Set a trusted certificate used to verify the authentication server certificate.
Set the maximum TX power.
Set the maximum TX power.
Set unicast settings.
Trigger a transmission of a periodic frame (FAN Discovery, RPL).
Callbacks Documentation#
sl_wisun_on_event#
void sl_wisun_on_event (sl_wisun_evt_t * evt)
Callback handler for a single event.
[out] | evt | The event to be handled |
This function is called when the stack sends an event to the application. The application can declare its own version this function to customize event handling. The default implementation discards all events.
See Also
100
of file /mnt/raid/workspaces/ws.obQFDUprC/overlay/gsdk/protocol/wisun/stack/inc/sl_wisun_api.h
Function Documentation#
sl_wisun_accept_direct_connect_link#
sl_status_t sl_wisun_accept_direct_connect_link (in6_addr_t * link_local_ipv6)
Accept a Direct Connect link.
[in] | link_local_ipv6 | Link-Local IPv6 address of the client |
Returns
SL_STATUS_OK if successful, an error code otherwise
Available in libraries: Full, FFN (see Wi-SUN API availability)
827
of file /mnt/raid/workspaces/ws.obQFDUprC/overlay/gsdk/protocol/wisun/stack/inc/sl_wisun_api.h
sl_wisun_allow_mac_address#
sl_status_t sl_wisun_allow_mac_address (const sl_wisun_mac_address_t * address)
Add a MAC address to the list of allowed addresses.
[in] | address | MAC address
|
Returns
SL_STATUS_OK if successful, an error code otherwise
This function adds a MAC address to the list of allowed addresses. When the first address is added to the list, the list of denied addresses is cleared and the device will start preventing communication with any device whose MAC address does not match any of addresses on the list. By default, all MAC addresses are allowed. Up to 10 MAC addresses may be added to the list. The access list affects only directly connected nodes such as parents, children, and neighbors.
Available in libraries: Full, FFN, LFN, BR (see Wi-SUN API availability)
296
of file /mnt/raid/workspaces/ws.obQFDUprC/overlay/gsdk/protocol/wisun/stack/inc/sl_wisun_api.h
sl_wisun_clear_credential_cache#
sl_status_t sl_wisun_clear_credential_cache ()
Clear the credential cache.
Returns
SL_STATUS_OK if successful, an error code otherwise
This function clears the cached authentication credentials stored in non-volatile storage. The function is intended for test purposes. Note that clearing the credential cache may prevent the node from reconnecting to the same parent until the corresponding cache entry has expired on the parent.
Available in libraries: Full, FFN, LFN, BR (see Wi-SUN API availability)
343
of file /mnt/raid/workspaces/ws.obQFDUprC/overlay/gsdk/protocol/wisun/stack/inc/sl_wisun_api.h
sl_wisun_config_mode_switch#
sl_status_t sl_wisun_config_mode_switch (uint8_t mode, uint8_t phy_mode_id, const sl_wisun_mac_address_t * neighbor_address, bool reserved)
Set the mode switch configuration.
[in] | mode | Mode switch configuration of the neighbor. If set to SL_WISUN_MODE_SWITCH_DEFAULT, the configuration of the neighbor is reset back to the default mode switch behavior. |
[in] | phy_mode_id | PhyModeId to use when mode is set to SL_WISUN_MODE_SWITCH_ENABLED, ignored otherwise. |
[in] | neighbor_address | MAC address of the neighbor to configure. If set to sl_wisun_broadcast_mac, configures the default mode switch behavior for all non-configured neighbors. |
[in] | reserved | Reserved for future use, set to false. |
Returns
SL_STATUS_OK if successful, an error code otherwise
Available in libraries: Full, FFN, LFN, BR (see Wi-SUN API availability)
557
of file /mnt/raid/workspaces/ws.obQFDUprC/overlay/gsdk/protocol/wisun/stack/inc/sl_wisun_api.h
sl_wisun_deny_mac_address#
sl_status_t sl_wisun_deny_mac_address (const sl_wisun_mac_address_t * address)
Add a MAC address to the list of denied addresses.
[in] | address | MAC address
|
Returns
SL_STATUS_OK if successful, an error code otherwise
This function adds a MAC address to the list of denied addresses. When the first address is added to the list, the list of allowed addresses is cleared and the device will start preventing communication with any device whose MAC address matches any of the addresses on the list. By default, all MAC addresses are allowed. Up to 10 MAC addresses may be added to the list. The access list affects only directly connected nodes such as parents, children, and neighbors.
Available in libraries: Full, FFN, LFN, BR (see Wi-SUN API availability)
316
of file /mnt/raid/workspaces/ws.obQFDUprC/overlay/gsdk/protocol/wisun/stack/inc/sl_wisun_api.h
sl_wisun_disconnect#
sl_status_t sl_wisun_disconnect ()
Disconnect from the Wi-SUN network.
Returns
SL_STATUS_OK if successful, an error code otherwise
This function disconnects an active connection or cancels an ongoing connection attempt.
Available in libraries: Full, FFN, LFN (see Wi-SUN API availability)
147
of file /mnt/raid/workspaces/ws.obQFDUprC/overlay/gsdk/protocol/wisun/stack/inc/sl_wisun_api.h
sl_wisun_get_excluded_channel_mask#
sl_status_t sl_wisun_get_excluded_channel_mask (sl_wisun_channel_mask_type_t type, sl_wisun_channel_mask_t * channel_mask, uint8_t * channel_count)
Get the mask of channels excluded from channel plan.
[in] | type | Type of channel mask to retrieve |
[out] | channel_mask | Pointer where channel mask is written |
[out] | channel_count | Number of channels in the mask |
Returns
SL_STATUS_OK if successful, an error code otherwise
Available in libraries: Full, FFN, LFN, BR (see Wi-SUN API availability)
768
of file /mnt/raid/workspaces/ws.obQFDUprC/overlay/gsdk/protocol/wisun/stack/inc/sl_wisun_api.h
sl_wisun_get_ip_address#
sl_status_t sl_wisun_get_ip_address (sl_wisun_ip_address_type_t address_type, in6_addr_t * address)
Read an IP address.
[in] | address_type | Type of the IP address to read
|
[out] | address | IP address to read |
Returns
SL_STATUS_OK if successful, an error code otherwise.
Available in libraries: Full, FFN, LFN (see Wi-SUN API availability)
134
of file /mnt/raid/workspaces/ws.obQFDUprC/overlay/gsdk/protocol/wisun/stack/inc/sl_wisun_api.h
sl_wisun_get_join_state#
sl_status_t sl_wisun_get_join_state (sl_wisun_join_state_t * join_state)
Get the current join state.
[out] | join_state | Join state |
Returns
SL_STATUS_OK if successful, an error code otherwise
This function retrieves the current state of the connection process. The function can only be used once a connection has been initiated.
Available in libraries: Full, FFN, LFN (see Wi-SUN API availability)
329
of file /mnt/raid/workspaces/ws.obQFDUprC/overlay/gsdk/protocol/wisun/stack/inc/sl_wisun_api.h
sl_wisun_get_mac_address#
sl_status_t sl_wisun_get_mac_address (sl_wisun_mac_address_t * address)
Get the current device MAC address in use.
[out] | address | MAC address |
Returns
SL_STATUS_OK if successful, an error code otherwise
Available in libraries: Full, FFN, LFN, BR (see Wi-SUN API availability)
353
of file /mnt/raid/workspaces/ws.obQFDUprC/overlay/gsdk/protocol/wisun/stack/inc/sl_wisun_api.h
sl_wisun_get_neighbor_count#
sl_status_t sl_wisun_get_neighbor_count (uint8_t * neighbor_count)
Get the number of RPL neighbors (parents and children).
[out] | neighbor_count | Number of neighbors |
Returns
SL_STATUS_OK if successful, an error code otherwise
Available in libraries: Full, FFN, LFN, BR (see Wi-SUN API availability)
392
of file /mnt/raid/workspaces/ws.obQFDUprC/overlay/gsdk/protocol/wisun/stack/inc/sl_wisun_api.h
sl_wisun_get_neighbor_info#
sl_status_t sl_wisun_get_neighbor_info (const sl_wisun_mac_address_t * neighbor_mac_address, sl_wisun_neighbor_info_t * neighbor_info)
Get information about a RPL neighbor (parent or child).
[in] | neighbor_mac_address | Pointer to neighbor MAC address |
[out] | neighbor_info | Pointer to where the read information is stored |
Returns
SL_STATUS_OK if successful, an error code otherwise
Available in libraries: Full, FFN, LFN, BR (see Wi-SUN API availability)
417
of file /mnt/raid/workspaces/ws.obQFDUprC/overlay/gsdk/protocol/wisun/stack/inc/sl_wisun_api.h
sl_wisun_get_neighbors#
sl_status_t sl_wisun_get_neighbors (uint8_t * neighbor_count, sl_wisun_mac_address_t * neighbor_mac_addresses)
Get a list of RPL neighbor (parents and children) MAC addresses.
[inout] | neighbor_count | Maximum number of neighbors to read on input, number of neighbors read on output |
[out] | neighbor_mac_addresses | Pointer to memory where to store neighbor MAC addresses |
Returns
SL_STATUS_OK if successful, an error code otherwise
Available in libraries: Full, FFN, LFN, BR (see Wi-SUN API availability)
405
of file /mnt/raid/workspaces/ws.obQFDUprC/overlay/gsdk/protocol/wisun/stack/inc/sl_wisun_api.h
sl_wisun_get_network_info#
sl_status_t sl_wisun_get_network_info (sl_wisun_network_info_t * network_info)
Get Wi-SUN network information.
[out] | network_info | Pointer where network information is written |
Returns
SL_STATUS_OK if successful, an error code otherwise
Available in libraries: Full, FFN, LFN, BR (see Wi-SUN API availability)
746
of file /mnt/raid/workspaces/ws.obQFDUprC/overlay/gsdk/protocol/wisun/stack/inc/sl_wisun_api.h
sl_wisun_get_pom_ie#
sl_status_t sl_wisun_get_pom_ie (uint8_t * phy_mode_id_count, uint8_t * phy_mode_ids, uint8_t * is_mdr_command_capable)
Get the POM-IE configuration.
[out] | phy_mode_id_count | Number of PhyModeId retrieved |
[out] | phy_mode_ids | List of phy_mode_id_count PhyModeId. Caller must allocate space for at least SL_WISUN_MAX_PHY_MODE_ID_COUNT entries. |
[out] | is_mdr_command_capable | Set to 1 if the device supports MAC mode switch, 0 otherwise |
Returns
SL_STATUS_OK if successful, an error code otherwise
This function retrieves the PHY operating mode information advertised to neighboring nodes.
Available in libraries: Full, FFN, LFN, BR (see Wi-SUN API availability)
633
of file /mnt/raid/workspaces/ws.obQFDUprC/overlay/gsdk/protocol/wisun/stack/inc/sl_wisun_api.h
sl_wisun_get_rpl_info#
sl_status_t sl_wisun_get_rpl_info (sl_wisun_rpl_info_t * rpl_info)
Get RPL information.
[out] | rpl_info | Pointer where RPL information is written |
Returns
SL_STATUS_OK if successful, an error code otherwise
Available in libraries: Full, FFN, BR (see Wi-SUN API availability)
756
of file /mnt/raid/workspaces/ws.obQFDUprC/overlay/gsdk/protocol/wisun/stack/inc/sl_wisun_api.h
sl_wisun_get_stack_version#
sl_status_t sl_wisun_get_stack_version (uint8_t * major, uint8_t * minor, uint8_t * patch, uint16_t * build)
Get the Wi-SUN stack version.
[out] | major | Wi-SUN stack version major |
[out] | minor | Wi-SUN stack version minor |
[out] | patch | Wi-SUN stack version patch |
[out] | build | Build number, set to 0 in public versions |
Returns
SL_STATUS_OK if successful, an error code otherwise
Available in libraries: Full, FFN, LFN, BR (see Wi-SUN API availability)
648
of file /mnt/raid/workspaces/ws.obQFDUprC/overlay/gsdk/protocol/wisun/stack/inc/sl_wisun_api.h
sl_wisun_get_statistics#
sl_status_t sl_wisun_get_statistics (sl_wisun_statistics_type_t statistics_type, sl_wisun_statistics_t * statistics)
Read a set of statistics.
[in] | statistics_type | Type of statistics to read
|
[out] | statistics | Set of statistics read |
Returns
SL_STATUS_OK if successful, an error code otherwise.
This function reads a set of statistics from the stack. Statistics are cumulative and reset when a connection is initiated or by calling sl_wisun_reset_statistics().
Available in libraries: Full, FFN, LFN, BR (see Wi-SUN API availability)
222
of file /mnt/raid/workspaces/ws.obQFDUprC/overlay/gsdk/protocol/wisun/stack/inc/sl_wisun_api.h
sl_wisun_join#
sl_status_t sl_wisun_join (const uint8_t * name, sl_wisun_phy_config_t * phy_config)
Initiate a connection to a Wi-SUN network.
[in] | name | Name of the Wi-SUN network as a zero-terminated string |
[in] | phy_config | Pointer to PHY configuration |
Returns
SL_STATUS_OK if successful, an error code otherwise
This function initiates connection to a Wi-SUN network. Completion of the request is indicated with a SL_WISUN_MSG_CONNECTED_IND_ID event.
Available in libraries: Full, FFN, LFN (see Wi-SUN API availability)
118
of file /mnt/raid/workspaces/ws.obQFDUprC/overlay/gsdk/protocol/wisun/stack/inc/sl_wisun_api.h
sl_wisun_reset_statistics#
sl_status_t sl_wisun_reset_statistics (sl_wisun_statistics_type_t statistics_type)
Reset a set of statistics in the stack.
[in] | statistics_type | Type of statistics to reset
|
Returns
SL_STATUS_OK if successful, an error code otherwise.
Available in libraries: Full, FFN, LFN, BR (see Wi-SUN API availability)
382
of file /mnt/raid/workspaces/ws.obQFDUprC/overlay/gsdk/protocol/wisun/stack/inc/sl_wisun_api.h
sl_wisun_set_advert_fragment_duration#
sl_status_t sl_wisun_set_advert_fragment_duration (uint32_t fragment_duration_ms)
Set the async transmission fragmentation parameters.
[in] | fragment_duration_ms | Max duration of a fragment in ms (min 500 ms) |
Returns
SL_STATUS_OK if successful, an error code otherwise
Async transmissions, such as Wi-SUN PAN advertisement packets, are sent to every allowed operating channel and may therefore block broadcast and unicast traffic. This impact can be reduced by splitting the channel list into fragments based on the maximum transmission duration and by forcing a delay between the fragments, allowing other traffic to occur. This function sets the maximum duration of a PA, PAS, PC, and PCS advertisement period fragments. A small value trades off longer connection times for shorter latencies. Setting the duration to SL_WISUN_ADVERT_FRAGMENT_DISABLE disables async transmission fragmentation.
By default, the maximum fragment duration is set to 500 ms.
Available in libraries: Full, FFN, BR (see Wi-SUN API availability)
523
of file /mnt/raid/workspaces/ws.obQFDUprC/overlay/gsdk/protocol/wisun/stack/inc/sl_wisun_api.h
sl_wisun_set_allowed_channel_mask#
sl_status_t sl_wisun_set_allowed_channel_mask (const sl_wisun_channel_mask_t * channel_mask)
Set a mask of operating channels.
[in] | channel_mask | Mask of operating channels |
Returns
SL_STATUS_OK if successful, an error code otherwise
This function sets a mask of channels the device is allowed to operate in for unicast frequency hopping. By default, all channels in the channel plan are allowed. The mask can only be used to further restrict the channels. Channels outside the channel plan or channels internally excluded are ignored. This mask will be used in the following connections.
Available in libraries: Full, FFN, LFN, BR (see Wi-SUN API availability)
Warnings
By comparison to the Wi-SUN FAN specification, the channel mask logic is inverted. The specification references a mask of excluded channels.
260
of file /mnt/raid/workspaces/ws.obQFDUprC/overlay/gsdk/protocol/wisun/stack/inc/sl_wisun_api.h
sl_wisun_set_channel_mask#
sl_status_t sl_wisun_set_channel_mask (const sl_wisun_channel_mask_t * channel_mask)
Set a mask of operating channels.
[in] | channel_mask | Mask of operating channels |
Returns
SL_STATUS_OK if successful, an error code otherwise
This function sets a mask of channels the device is allowed to operate in for unicast frequency hopping. By default, all channels in the channel plan are allowed. The mask can only be used to further restrict the channels. Channels outside the channel plan or channels internally excluded are ignored. This mask will be used in the following connections.
Available in libraries: Full, FFN, LFN, BR (see Wi-SUN API availability)
276
of file /mnt/raid/workspaces/ws.obQFDUprC/overlay/gsdk/protocol/wisun/stack/inc/sl_wisun_api.h
sl_wisun_set_connection_parameters#
sl_status_t sl_wisun_set_connection_parameters (const sl_wisun_connection_params_t * params)
Configure the FFN parameter set.
[in] | params | Parameter set to use |
Returns
SL_STATUS_OK if successful, an error code otherwise
This function sets the FFN parameter set. These parameters impact connection time, bandwidth usage, and latency. Use of a predefined parameter set is recommended (Predefined FFN parameter sets). The function must be called before initiating a connection.
Available in libraries: Full, FFN (see Wi-SUN API availability)
596
of file /mnt/raid/workspaces/ws.obQFDUprC/overlay/gsdk/protocol/wisun/stack/inc/sl_wisun_api.h
sl_wisun_set_device_certificate#
sl_status_t sl_wisun_set_device_certificate (uint16_t certificate_options, uint16_t certificate_length, const uint8_t * certificate)
Set the device certificate used to authenticate to the authentication server.
[in] | certificate_options | Options for the certificate.
|
[in] | certificate_length | Size of the certificate data |
[in] | certificate | Pointer to the certificate data |
Returns
SL_STATUS_OK if successful, an error code otherwise
Available in libraries: Full, FFN, LFN (see Wi-SUN API availability)
182
of file /mnt/raid/workspaces/ws.obQFDUprC/overlay/gsdk/protocol/wisun/stack/inc/sl_wisun_api.h
sl_wisun_set_device_private_key#
sl_status_t sl_wisun_set_device_private_key (uint16_t key_options, uint16_t key_length, const uint8_t * key)
Set the private key of the device certificate.
[in] | key_options | Options for the private key
|
[in] | key_length | Size of the private key data |
[in] | key | Pointer to the private key data |
Returns
SL_STATUS_OK if successful, an error code otherwise
Available in libraries: Full, FFN, LFN, BR (see Wi-SUN API availability)
198
of file /mnt/raid/workspaces/ws.obQFDUprC/overlay/gsdk/protocol/wisun/stack/inc/sl_wisun_api.h
sl_wisun_set_device_private_key_id#
sl_status_t sl_wisun_set_device_private_key_id (uint32_t key_id)
Set the private key of the device certificate.
[in] | key_id | Key ID of the private key |
Returns
SL_STATUS_OK if successful, an error code otherwise
This function sets the device private key using a key identifier, referencing a key stored in PSA cryptography module. The corresponding device certificate must still be set using sl_wisun_set_device_certificate(). The stored key must have correct PSA key attributes, see the Wi-SUN FAN Security Concepts and Design Considerations document for details.
Available in libraries: Full, FFN, LFN, BR (see Wi-SUN API availability)
450
of file /mnt/raid/workspaces/ws.obQFDUprC/overlay/gsdk/protocol/wisun/stack/inc/sl_wisun_api.h
sl_wisun_set_device_type#
sl_status_t sl_wisun_set_device_type (sl_wisun_device_type_t device_type)
Set the device type.
[in] | device_type | Type of the device |
Returns
SL_STATUS_OK if successful, an error code otherwise
This function sets the operational mode of the node.
Available in libraries: Full, FFN, LFN, BR (see Wi-SUN API availability)
Note
This is a no-op with BR, FFN and LFN libraries.
537
of file /mnt/raid/workspaces/ws.obQFDUprC/overlay/gsdk/protocol/wisun/stack/inc/sl_wisun_api.h
sl_wisun_set_direct_connect_pmk#
sl_status_t sl_wisun_set_direct_connect_pmk (const uint32_t pmk_key_id)
Set the Pairwise Master Key (PMK) to use for Direct Connect.
[in] | pmk_key_id | The Pairwise Master Key (PMK) ID to use. |
Returns
SL_STATUS_OK if successful, an error code otherwise
This function sets the Direct Connect PMK using a key identifier, referencing a key stored in PSA cryptography module. The stored key must have correct PSA key attributes, see the Wi-SUN FAN Security Concepts and Design Considerations document for details.
Available in libraries: Full, FFN (see Wi-SUN API availability)
868
of file /mnt/raid/workspaces/ws.obQFDUprC/overlay/gsdk/protocol/wisun/stack/inc/sl_wisun_api.h
sl_wisun_set_direct_connect_state#
sl_status_t sl_wisun_set_direct_connect_state (bool is_enabled)
Enable/disable Direct Connect.
[in] | is_enabled | Direct Connect status
|
Returns
SL_STATUS_OK if successful, an error code otherwise
Available in libraries: Full, FFN (see Wi-SUN API availability)
Note
Enabling this feature may increase connection time.
817
of file /mnt/raid/workspaces/ws.obQFDUprC/overlay/gsdk/protocol/wisun/stack/inc/sl_wisun_api.h
sl_wisun_set_leaf#
sl_status_t sl_wisun_set_leaf (bool is_leaf)
Set the RPL leaf mode.
[in] | is_leaf | RPL leaf mode
|
Returns
SL_STATUS_OK if successful, an error code otherwise
This function configures RPL leaf mode on FFNs. When enabled, it prevents the FFN from parenting other nodes (FFN or LFN).
Available in libraries: Full, FFN (see Wi-SUN API availability)
803
of file /mnt/raid/workspaces/ws.obQFDUprC/overlay/gsdk/protocol/wisun/stack/inc/sl_wisun_api.h
sl_wisun_set_lfn_parameters#
sl_status_t sl_wisun_set_lfn_parameters (const sl_wisun_lfn_params_t * params)
Configure the LFN parameter set.
[in] | params | Parameter set to use |
Returns
SL_STATUS_OK if successful, an error code otherwise
This function sets the LFN parameter set. These parameters impact connection time, bandwidth usage, power consumption, and latency. Use of a predefined parameter set is recommended (Predefined LFN parameter sets). The function must be called before initiating a connection.
Available in libraries: Full, LFN (see Wi-SUN API availability)
667
of file /mnt/raid/workspaces/ws.obQFDUprC/overlay/gsdk/protocol/wisun/stack/inc/sl_wisun_api.h
sl_wisun_set_lfn_support#
sl_status_t sl_wisun_set_lfn_support (uint8_t lfn_limit)
Configure LFN parenting support.
[in] | lfn_limit | Maximum number of LFN children
|
Returns
SL_STATUS_OK if successful, an error code otherwise
This function sets the maximum number of LFN children this node can parent.
Available in libraries: Full, FFN (see Wi-SUN API availability)
682
of file /mnt/raid/workspaces/ws.obQFDUprC/overlay/gsdk/protocol/wisun/stack/inc/sl_wisun_api.h
sl_wisun_set_mac_address#
sl_status_t sl_wisun_set_mac_address (const sl_wisun_mac_address_t * address)
Set the device MAC address to be used.
[in] | address | MAC address |
Returns
SL_STATUS_OK if successful, an error code otherwise
This function sets the MAC address for use in the following connections. By default, the device will use the built-in unique device MAC address. The address is reset to the built-in value upon power up.
Available in libraries: Full, FFN, LFN, BR (see Wi-SUN API availability)
367
of file /mnt/raid/workspaces/ws.obQFDUprC/overlay/gsdk/protocol/wisun/stack/inc/sl_wisun_api.h
sl_wisun_set_mode_switch#
sl_status_t sl_wisun_set_mode_switch (uint8_t mode, uint8_t phy_mode_id, const sl_wisun_mac_address_t * neighbor_address)
Set the PHY mode switch configuration.
[in] | mode | Mode switch configuration of the neighbor. If set to SL_WISUN_MODE_SWITCH_DEFAULT, the configuration of the neighbor is reset back to the default mode switch behavior. |
[in] | phy_mode_id | PhyModeId to use when mode is set to SL_WISUN_MODE_SWITCH_ENABLED, ignored otherwise. |
[in] | neighbor_address | MAC address of the neighbor to configure. If set to sl_wisun_broadcast_mac, configures the default mode switch behavior for all non-configured neighbors. |
Returns
SL_STATUS_OK if successful, an error code otherwise
Available in libraries: Full, FFN, LFN, BR (see Wi-SUN API availability)
579
of file /mnt/raid/workspaces/ws.obQFDUprC/overlay/gsdk/protocol/wisun/stack/inc/sl_wisun_api.h
sl_wisun_set_neighbor_table_size#
sl_status_t sl_wisun_set_neighbor_table_size (uint8_t size)
Set neighbor table size.
[in] | size | Size of the neighbor table |
Returns
SL_STATUS_OK if successful, an error code otherwise
This function sets the limit of regular neighbors supported by the node [1, 245], without considering temporary or RPL parents. Increasing this parameter means a higher number of potential neighbors while lowering it means reduced RAM consumption. The default value is 22.
Available in libraries: Full, FFN, LFN, BR (see Wi-SUN API availability)
481
of file /mnt/raid/workspaces/ws.obQFDUprC/overlay/gsdk/protocol/wisun/stack/inc/sl_wisun_api.h
sl_wisun_set_phy_sensitivity#
sl_status_t sl_wisun_set_phy_sensitivity (uint8_t phy_mode_id, int16_t sensitivity_dbm)
Set the radio sensitivity for the given PHY.
[in] | phy_mode_id | PHY mode ID |
[in] | sensitivity_dbm | Sensitivity in dBm |
Returns
SL_STATUS_OK if successful, SL_STATUS_INVALID_PARAMETER if the PHY mode ID is invalid, SL_STATUS_FULL if you a have already set SL_WISUN_MAX_PHY_MODE_ID_COUNT different entries
This function sets the radio sensitivity for RX state. It allows to fine tune it according to the user's hardware and needs. The stack possesses a set of default values for each PHY mode, but the user can override them with this function. User's modifications generated by this API are not saved in the NVM.
Available in libraries: Full, FFN, LFN, BR (see Wi-SUN API availability)
Warnings
Changing the RX sensitivity can have a significant impact on the network's behavior and performance and should be done with caution. The stack follows the Wi-SUN specification, and as such, takes a margin around the given sensitivity (hysteresis). It is strongly advised to only use this API when using a Low-noise amplifier with an FEM.
852
of file /mnt/raid/workspaces/ws.obQFDUprC/overlay/gsdk/protocol/wisun/stack/inc/sl_wisun_api.h
sl_wisun_set_pom_ie#
sl_status_t sl_wisun_set_pom_ie (uint8_t phy_mode_id_count, uint8_t phy_mode_ids, uint8_t is_mdr_command_capable)
Set the POM-IE configuration.
[in] | phy_mode_id_count | Number of PhyModeId to configure |
[in] | phy_mode_ids | List of phy_mode_id_count PhyModeId. It must contain the base operating mode. |
[in] | is_mdr_command_capable | Indicate if the device supports MAC mode switch. Feature currently unsupported, must be set to 0. |
Returns
SL_STATUS_OK if successful, an error code otherwise
This function sets the PHY operating mode information advertised to neighboring nodes. By default the PhyModeId list contains the first fifteen PhyModeId listed in radio multi-PHY configuration, MAC mode switch is disabled.
Available in libraries: Full, FFN, LFN, BR (see Wi-SUN API availability)
614
of file /mnt/raid/workspaces/ws.obQFDUprC/overlay/gsdk/protocol/wisun/stack/inc/sl_wisun_api.h
sl_wisun_set_pti_state#
sl_status_t sl_wisun_set_pti_state (bool pti_state)
Set the PTI state.
[in] | pti_state | PTI state
|
Returns
SL_STATUS_OK if successful, an error code otherwise
This function sets Packet Trace Interface (PTI) state. PTI is enabled by default.
Available in libraries: Full, FFN, LFN, BR (see Wi-SUN API availability)
697
of file /mnt/raid/workspaces/ws.obQFDUprC/overlay/gsdk/protocol/wisun/stack/inc/sl_wisun_api.h
sl_wisun_set_regulation#
sl_status_t sl_wisun_set_regulation (sl_wisun_regulation_t regulation)
Set the regional regulation.
[in] | regulation | Regional regulation |
Returns
SL_STATUS_OK if successful, an error code otherwise
This function sets the regional regulation for use in the following connections. The selected regional regulation will impact both the Wi-SUN stack performance and its behavior. See regulation standards for details. No regulation is set by default.
Available in libraries: Full, FFN, LFN, BR (see Wi-SUN API availability)
465
of file /mnt/raid/workspaces/ws.obQFDUprC/overlay/gsdk/protocol/wisun/stack/inc/sl_wisun_api.h
sl_wisun_set_regulation_tx_thresholds#
sl_status_t sl_wisun_set_regulation_tx_thresholds (int8_t warning_threshold, int8_t alert_threshold)
Set the thresholds for transmission duration level event.
[in] | warning_threshold | Warning threshold in percent or -1 to disable |
[in] | alert_threshold | Alert threshold in percent or -1 to disable |
Returns
SL_STATUS_OK if successful, an error code otherwise
This function sets the thresholds for transmission duration level event. When set and when a regional regulation is enabled using sl_wisun_set_regulation(), a SL_WISUN_MSG_REGULATION_TX_LEVEL_IND_ID event is sent when one of the configured thresholds is exceeded. This can be used by the application to prevent exceeding the total transmission duration allowed in the regional regulation. Thresholds are defined as a percentage of the maximum transmission duration permitted by the regional regulation.
Available in libraries: Full, FFN, LFN, BR (see Wi-SUN API availability)
500
of file /mnt/raid/workspaces/ws.obQFDUprC/overlay/gsdk/protocol/wisun/stack/inc/sl_wisun_api.h
sl_wisun_set_security_state#
sl_status_t sl_wisun_set_security_state (uint32_t security_state)
Set the connection security state.
[in] | security_state | Connection security state
|
Returns
SL_STATUS_OK if successful, an error code otherwise
This function sets the connection security state. By default, authentication and link encryption are enabled. The function is intended for test purposes.
Available in libraries: Full, FFN, LFN, BR (see Wi-SUN API availability)
Note
Authentication and link encryption can only be disabled when the application is linked against a library supporting this option.
736
of file /mnt/raid/workspaces/ws.obQFDUprC/overlay/gsdk/protocol/wisun/stack/inc/sl_wisun_api.h
sl_wisun_set_trusted_certificate#
sl_status_t sl_wisun_set_trusted_certificate (uint16_t certificate_options, uint16_t certificate_length, const uint8_t * certificate)
Set a trusted certificate used to verify the authentication server certificate.
[in] | certificate_options | Options for the certificate
|
[in] | certificate_length | Size of the certificate data |
[in] | certificate | Pointer to the certificate data |
Returns
SL_STATUS_OK if successful, an error code otherwise
Available in libraries: Full, FFN, LFN, BR (see Wi-SUN API availability)
163
of file /mnt/raid/workspaces/ws.obQFDUprC/overlay/gsdk/protocol/wisun/stack/inc/sl_wisun_api.h
sl_wisun_set_tx_power#
sl_status_t sl_wisun_set_tx_power (int8_t tx_power)
Set the maximum TX power.
[in] | tx_power | TX power in dBm |
Returns
SL_STATUS_OK if successful, an error code otherwise
This function sets the maximum TX power. The device may use a lower value based on internal decision making or hardware limitations but will never exceed the given value. The function must be called before initiating a connection.
Available in libraries: Full, FFN, LFN, BR (see Wi-SUN API availability)
DeprecatedThis function will be removed in the future versions of the Wi-SUN stack, use sl_wisun_set_tx_power_ddbm() instead.
240
of file /mnt/raid/workspaces/ws.obQFDUprC/overlay/gsdk/protocol/wisun/stack/inc/sl_wisun_api.h
sl_wisun_set_tx_power_ddbm#
sl_status_t sl_wisun_set_tx_power_ddbm (int16_t tx_power_ddbm)
Set the maximum TX power.
[in] | tx_power_ddbm | TX power in deci-dBm |
Returns
SL_STATUS_OK if successful, an error code otherwise
This function sets the maximum TX power. The device may use a lower value based on internal decision making or hardware limitations but will never exceed the given value. The function must be called before initiating a connection.
Available in libraries: Full, FFN, LFN, BR (see Wi-SUN API availability)
Note
When replacing sl_wisun_set_tx_power() function calls with this function, note the change from dBm units to deci-dBm units.
788
of file /mnt/raid/workspaces/ws.obQFDUprC/overlay/gsdk/protocol/wisun/stack/inc/sl_wisun_api.h
sl_wisun_set_unicast_settings#
sl_status_t sl_wisun_set_unicast_settings (uint8_t dwell_interval_ms)
Set unicast settings.
[in] | dwell_interval_ms | Unicast Dwell Interval (15-255 ms) |
Returns
SL_STATUS_OK if successful, an error code otherwise
This function sets the parameters for unicast channel hopping to be used in the following connections. The Unicast Dwell Interval specifies the duration which the node will listen to a channel within its listening schedule. The default value is 255 ms.
Available in libraries: Full, FFN, BR (see Wi-SUN API availability)
433
of file /mnt/raid/workspaces/ws.obQFDUprC/overlay/gsdk/protocol/wisun/stack/inc/sl_wisun_api.h
sl_wisun_trigger_frame#
sl_status_t sl_wisun_trigger_frame (sl_wisun_frame_type_t frame_type)
Trigger a transmission of a periodic frame (FAN Discovery, RPL).
[in] | frame_type | Type of frame to transmit
|
Returns
SL_STATUS_OK if successful, an error code otherwise
This function causes a periodic frame (FAN Discovery, RPL) to be transmitted immediately. The frame can only be transmitted in the appropriate connection state, i.e. the associated trickle timer must be running. The function is intended for test purposes.
Available in libraries: Full, FFN, LFN, BR (see Wi-SUN API availability)
718
of file /mnt/raid/workspaces/ws.obQFDUprC/overlay/gsdk/protocol/wisun/stack/inc/sl_wisun_api.h