Border Router API#
Wi-SUN Border Router API contains functions for Border Router specific functionality.
This API is an extension, not a replacement of Wi-SUN Stack API. An application implementing Border Router capability may utilize functions from both APIs. See Wi-SUN API availability for further information.
Functions#
Get Group AES Key.
Get the unicast IPv6 addresses configured in the Border Router.
Get the Border Router state.
Forward an IPv6 packet to Wi-SUN network.
Check if the IPv6 destination address is routable in the Wi-SUN network.
Start or stop PAN Defect advertisement.
Set broadcast settings.
Configure the Border Router parameter set.
Set the Border Router device certificate.
Set DHCPv6 Vendor Data.
Set Group Transient Key.
Set IPv6 prefix for DODAG.
Register a function to handle IPv6 packets received from Wi-SUN network.
Configure LFN parenting parameter set.
Configure LFN parenting support.
Set the size of the Wi-SUN network.
Start the Border Router.
Stop the Border Router.
Macros#
Define sl_wisun_set_br_device_certificate for legacy.
Function Documentation#
sl_wisun_br_get_gak#
sl_status_t sl_wisun_br_get_gak (uint8_t index, uint8_t * gak)
Get Group AES Key.
[in] | index | Index of the key from 0 to 3 for GAKs and 4 to 6 for LFN GAKs |
[out] | gak | Pointer to Group AES Key |
Returns
SL_STATUS_OK if successful, an error code otherwise
This function exports (L)GAK as a plaintext key.
Note
This functionality is only available when using the debug library.
110
of file /mnt/raid/workspaces/ws.obQFDUprC/overlay/gsdk/protocol/wisun/stack/inc/border_router/sl_wisun_br_api.h
sl_wisun_br_get_ip_addresses#
sl_status_t sl_wisun_br_get_ip_addresses (uint8_t * addr_ll, uint8_t * addr_gua, uint8_t * addr_dodagid)
Get the unicast IPv6 addresses configured in the Border Router.
[out] | addr_ll | Pointer to Link-Local address |
[out] | addr_gua | Pointer to Unique Local Address or Global Unicast Address |
[out] | addr_dodagid | Pointer to DODAG ID |
Returns
SL_STATUS_OK if successful, an error code otherwise
97
of file /mnt/raid/workspaces/ws.obQFDUprC/overlay/gsdk/protocol/wisun/stack/inc/border_router/sl_wisun_br_api.h
sl_wisun_br_get_state#
sl_status_t sl_wisun_br_get_state (sl_wisun_br_state_t * state)
Get the Border Router state.
[out] | state | Pointer to state
|
Returns
SL_STATUS_OK if successful, an error code otherwise
120
of file /mnt/raid/workspaces/ws.obQFDUprC/overlay/gsdk/protocol/wisun/stack/inc/border_router/sl_wisun_br_api.h
sl_wisun_br_ipv6_down#
sl_status_t sl_wisun_br_ipv6_down (const uint8_t * data, size_t data_length)
Forward an IPv6 packet to Wi-SUN network.
[in] | data | Pointer to IPv6 header |
[out] | data_length | Length of IPv6 packet data in bytes |
Returns
SL_STATUS_OK if successful, an error code otherwise
This function forwards an IPv6 packet to Wi-SUN network. The destination address must belong to the DODAG prefix. This function is used for handling downlink packets from the backhaul interface, see sl_wisun_br_set_ipv6_up_handler() for uplink. It's recommended to use sl_wisun_br_ipv6_route_exists() before forwarding a packet.
287
of file /mnt/raid/workspaces/ws.obQFDUprC/overlay/gsdk/protocol/wisun/stack/inc/border_router/sl_wisun_br_api.h
sl_wisun_br_ipv6_route_exists#
sl_status_t sl_wisun_br_ipv6_route_exists (const uint8_t * ipv6_address, bool * exists)
Check if the IPv6 destination address is routable in the Wi-SUN network.
[in] | ipv6_address | Pointer to IPv6 destination address |
[out] | exists | Whether the address is routable
|
Returns
SL_STATUS_OK if successful, an error code otherwise
This function checks if the given IPv6 address is a valid destination in the Wi-SUN network. The destination address must belong to the Border Router or one of the connected nodes.
302
of file /mnt/raid/workspaces/ws.obQFDUprC/overlay/gsdk/protocol/wisun/stack/inc/border_router/sl_wisun_br_api.h
sl_wisun_br_pan_defect_advertise#
sl_status_t sl_wisun_br_pan_defect_advertise (bool defect_advertise, uint32_t min_scan_duration_s, uint32_t max_scan_duration_s)
Start or stop PAN Defect advertisement.
[in] | defect_advertise | True to start PAN Defect procedure, false to stop it. |
[in] | min_scan_duration_s | Minimum duration after which devices are allowed to switch their PAN if an alternative one is available. |
[in] | max_scan_duration_s | Duration after which devices should systemically switch to the alternative PAN if one is available. |
Returns
SL_STATUS_OK if successful, an error code otherwise.
Note
The values for
min_scan_duration_s
andmax_scan_duration_s
should be chosen based on the estimated performance of the backup power source. Specifically,max_scan_duration_s
should be set to a value smaller than the estimated lifetime of the backup power source to ensure a seamless transition to the alternative PAN without long connection interruptions.
241
of file /mnt/raid/workspaces/ws.obQFDUprC/overlay/gsdk/protocol/wisun/stack/inc/border_router/sl_wisun_br_api.h
sl_wisun_br_set_broadcast_settings#
sl_status_t sl_wisun_br_set_broadcast_settings (uint32_t interval_ms, uint8_t dwell_interval_ms)
Set broadcast settings.
[in] | interval_ms | Broadcast Interval (BDI < BI <= 16777215 ms) (default: 1020 ms) |
[in] | dwell_interval_ms | Broadcast Dwell Interval (100-255 ms) (default: 255 ms) |
Returns
SL_STATUS_OK if successful, an error code otherwise
This function sets the broadcast channel hopping schedule. The Broadcast Interval is the duration, between Broadcast Dwell Intervals within the advertising node’s broadcast schedule. Its resolution is limited to 24 bits (16777215 ms). The Broadcast Dwell Interval specifies the duration during which the node may transmit a broadcast message. It is recommended a BI value of 4.0 times the maximum of (UDI, BDI). These values affect the whole PAN, since they are propagated from parent to children. This function must be called before starting the Border Router.
163
of file /mnt/raid/workspaces/ws.obQFDUprC/overlay/gsdk/protocol/wisun/stack/inc/border_router/sl_wisun_br_api.h
sl_wisun_br_set_connection_parameters#
sl_status_t sl_wisun_br_set_connection_parameters (const sl_wisun_br_connection_params_t * params)
Configure the Border Router parameter set.
[in] | params | Parameter set to use |
Returns
SL_STATUS_OK if successful, an error code otherwise
This functions sets the Border Router parameter set. These parameters impact connection time, bandwidth usage, and latency. Use of a predefined parameter set is recommended (Predefined BR parameter sets). This function must be called before starting the Border Router.
177
of file /mnt/raid/workspaces/ws.obQFDUprC/overlay/gsdk/protocol/wisun/stack/inc/border_router/sl_wisun_br_api.h
sl_wisun_br_set_device_certificate#
sl_status_t sl_wisun_br_set_device_certificate (uint16_t certificate_options, uint16_t certificate_length, const uint8_t * certificate)
Set the Border Router device 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
135
of file /mnt/raid/workspaces/ws.obQFDUprC/overlay/gsdk/protocol/wisun/stack/inc/border_router/sl_wisun_br_api.h
sl_wisun_br_set_dhcp_vendor_data#
sl_status_t sl_wisun_br_set_dhcp_vendor_data (uint32_t enterprise_number, uint16_t data_length, const uint8_t * data)
Set DHCPv6 Vendor Data.
[in] | enterprise_number | Vendor Specific Enterprise Number |
[in] | data_length | Length of Vendor specific data |
[in] | data | Vendor specific data |
Returns
SL_STATUS_OK if successful, an error code otherwise
This function sets the vendor-specific information transmitted during DHCPv6 exchange. This function must be called before starting the Border Router.
220
of file /mnt/raid/workspaces/ws.obQFDUprC/overlay/gsdk/protocol/wisun/stack/inc/border_router/sl_wisun_br_api.h
sl_wisun_br_set_gtk#
sl_status_t sl_wisun_br_set_gtk (const uint8_t * gtk, uint8_t index)
Set Group Transient Key.
[in] | gtk | Group Transient Key |
[in] | index | Index of the key from 0 to 3 for GTKs and 4 to 6 for LGTKs |
Note
This API is provided for test and debug purposes: setting a specific key in production is not recommended. Furthermore, using this API to set a GTK or LGTK disables the rotation of this key type so the application is responsible for setting new ones when suitable.
Returns
SL_STATUS_OK if successful, an error code otherwise
68
of file /mnt/raid/workspaces/ws.obQFDUprC/overlay/gsdk/protocol/wisun/stack/inc/border_router/sl_wisun_br_api.h
sl_wisun_br_set_ipv6_prefix#
sl_status_t sl_wisun_br_set_ipv6_prefix (const uint8_t * ipv6_prefix, uint8_t prefix_length)
Set IPv6 prefix for DODAG.
[in] | ipv6_prefix | IPv6 prefix |
[in] | prefix_length | Prefix length. Currently, only 64 bit prefixes are supported. |
Note
Must not be called after the border router is started
Returns
SL_STATUS_OK if successful, an error code otherwise
This function sets the prefix used to generate IP addresses for RPL traffic (DODAGID will derive from it). This function must be called before starting the Border Router.
258
of file /mnt/raid/workspaces/ws.obQFDUprC/overlay/gsdk/protocol/wisun/stack/inc/border_router/sl_wisun_br_api.h
sl_wisun_br_set_ipv6_up_handler#
sl_status_t sl_wisun_br_set_ipv6_up_handler (sl_wisun_ipv6_up_handler_t handler)
Register a function to handle IPv6 packets received from Wi-SUN network.
[in] | handler | Pointer to handler function |
Returns
SL_STATUS_OK if successful, an error code otherwise
This function registers a handler function that will be called when the destination address of a received IPv6 packet is outside the DODAG prefix. Setting the handler function to NULL disables the forwarding. This function is used for handling uplink packets towards the backhaul interface, see sl_wisun_br_ipv6_down() for downlink.
272
of file /mnt/raid/workspaces/ws.obQFDUprC/overlay/gsdk/protocol/wisun/stack/inc/border_router/sl_wisun_br_api.h
sl_wisun_br_set_lfn_parameters#
sl_status_t sl_wisun_br_set_lfn_parameters (const sl_wisun_br_lfn_params_t * params)
Configure LFN parenting parameter set.
[in] | params | Parameter set to use |
Returns
SL_STATUS_OK if successful, an error code otherwise
This function sets the LFN parenting parameter set. These parameters impact battery life of all LFNs in the PAN. Use of a predefined parameter set is recommended (Predefined BR LFN-parenting parameter sets). This function must be called before starting the Border Router.
190
of file /mnt/raid/workspaces/ws.obQFDUprC/overlay/gsdk/protocol/wisun/stack/inc/border_router/sl_wisun_br_api.h
sl_wisun_br_set_lfn_support#
sl_status_t sl_wisun_br_set_lfn_support (uint8_t lfn_limit, bool lfn_support_pan)
Configure LFN parenting support.
[in] | lfn_limit | Maximum number of LFN children
|
[in] | lfn_support_pan | LFN parenting support in the PAN
|
Returns
SL_STATUS_OK if successful, an error code otherwise
This function configures LFN parenting support in the Border Router and in the PAN.
206
of file /mnt/raid/workspaces/ws.obQFDUprC/overlay/gsdk/protocol/wisun/stack/inc/border_router/sl_wisun_br_api.h
sl_wisun_br_set_network_size#
sl_status_t sl_wisun_br_set_network_size (sl_wisun_network_size_t size)
Set the size of the Wi-SUN network.
[in] | size | Size of the network |
Returns
SL_STATUS_OK if successful, an error code otherwise
This function sets the size of the network. The size is to used set various stack parameters, such as timing parameters to optimize device behavior in regards to node count. The device will function with any setting but may exhibit non-optimal behavior. Setting the size too large may cause slow connection speed and increased latency. Conversely, a value too small may cause increased network traffic.
87
of file /mnt/raid/workspaces/ws.obQFDUprC/overlay/gsdk/protocol/wisun/stack/inc/border_router/sl_wisun_br_api.h
sl_wisun_br_start#
sl_status_t sl_wisun_br_start (const uint8_t * name, const sl_wisun_phy_config_t * phy_config)
Start the Border Router.
[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
48
of file /mnt/raid/workspaces/ws.obQFDUprC/overlay/gsdk/protocol/wisun/stack/inc/border_router/sl_wisun_br_api.h
sl_wisun_br_stop#
sl_status_t sl_wisun_br_stop (void )
Stop the Border Router.
N/A |
Returns
SL_STATUS_OK if successful, an error code otherwise
55
of file /mnt/raid/workspaces/ws.obQFDUprC/overlay/gsdk/protocol/wisun/stack/inc/border_router/sl_wisun_br_api.h
Macro Definition Documentation#
sl_wisun_set_br_device_certificate#
#define sl_wisun_set_br_device_certificateValue:
sl_wisun_br_set_device_certificate
Define sl_wisun_set_br_device_certificate for legacy.
142
of file /mnt/raid/workspaces/ws.obQFDUprC/overlay/gsdk/protocol/wisun/stack/inc/border_router/sl_wisun_br_api.h