Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
6LoWPAN network load balance control API. More...
Go to the source code of this file.
Typedefs | |
typedef bool | net_load_balance_network_switch_notify (void) |
load_balance_network_switch_notify This function is called by the load balancer when it has detected a better network to switch to. | |
Functions | |
int8_t | net_load_balance_network_switch_cb_set (int8_t interface_id, net_load_balance_network_switch_notify *network_switch_notify) |
Set user callback for accepting the network switch. | |
int8_t | net_load_balance_create (int8_t interface_id, bool enable_periodic_beacon_interval) |
Create and enable load balance to the selected interface. | |
int8_t | net_load_balance_delete (int8_t interface_id) |
Disable and delete load balancing from the interface. | |
int8_t | net_load_balance_threshold_set (int8_t interface_id, uint8_t threshold_min, uint8_t threshold_max) |
Set load balance threshold min and max. | |
int8_t | net_load_balance_set_max_probability (int8_t interface_id, uint8_t max_p) |
Set the network probability percent when the new network is better than threshold max. | |
int8_t | net_load_balance_load_level_update_enable (int8_t interface_id, uint16_t expected_device_count) |
Set load balance expected device count and enable automatic network load level update. | |
int8_t | net_load_balance_load_level_update_disable (int8_t interface_id) |
Disable the automatic network load level update. |
Detailed Description
6LoWPAN network load balance control API.
Definition in file net_load_balance_api.h.
Typedef Documentation
typedef bool net_load_balance_network_switch_notify(void) |
load_balance_network_switch_notify This function is called by the load balancer when it has detected a better network to switch to.
- Returns:
- true The network can be switched immediately.
- false The load balancer will ask later a time for network switching if a better network is still available at that time.
Definition at line 34 of file net_load_balance_api.h.
Function Documentation
int8_t net_load_balance_create | ( | int8_t | interface_id, |
bool | enable_periodic_beacon_interval | ||
) |
Create and enable load balance to the selected interface.
- Parameters:
-
interface_id Interface ID. enable_periodic_beacon_interval Set True when you want to activate load balance periodic beacon; false will work only properly with the FHSS system.
- Returns:
- 0 Enable OK.
- -1 unknown Interface or parameter error.
- -2 Out of memory.
- -3 Load balance already configured to this interface.
Definition at line 154 of file net_load_balance.c.
int8_t net_load_balance_delete | ( | int8_t | interface_id ) |
Disable and delete load balancing from the interface.
- Parameters:
-
interface_id Interface ID.
- Returns:
- 0 Process OK.
- -1 Unknown interface.
Definition at line 196 of file net_load_balance.c.
int8_t net_load_balance_load_level_update_disable | ( | int8_t | interface_id ) |
Disable the automatic network load level update.
- Parameters:
-
interface_id Interface ID.
- Returns:
- 0 Process OK, -1 Unknown interface ID.
Disable the automatic network load level update.
- Parameters:
-
interface_id interface id
- Returns:
- 0 process ok -1 Unknown interface id
Definition at line 330 of file net_load_balance.c.
int8_t net_load_balance_load_level_update_enable | ( | int8_t | interface_id, |
uint16_t | expected_device_count | ||
) |
Set load balance expected device count and enable automatic network load level update.
This feature is just for RPL DoDAG root device!
- Parameters:
-
interface_id Interface ID. expected_device_count Device count that sets the max load level. - If the count is not divisible by 8, the function rounds the number up to reach that.
- It is not hard limit it define max DoDAG preference.
- For hard limit, check whiteboard_api.h.
- Returns:
- 0 Process OK, -1 Unknown interface ID, -2 Out of memory.
Definition at line 300 of file net_load_balance.c.
int8_t net_load_balance_network_switch_cb_set | ( | int8_t | interface_id, |
net_load_balance_network_switch_notify * | network_switch_notify | ||
) |
Set user callback for accepting the network switch.
- Parameters:
-
interface_id Interface ID. network_switch_notify User callback.
- Returns:
- 0 Set OK.
- -1 unknown Interface.
Definition at line 139 of file net_load_balance.c.
int8_t net_load_balance_set_max_probability | ( | int8_t | interface_id, |
uint8_t | max_p | ||
) |
Set the network probability percent when the new network is better than threshold max.
- Parameters:
-
interface_id Interface ID. max_p Probability percent to switch the network. Default is 25%. Accepted values are [1,100], recommend values are 10-25.
- Returns:
- 0 Process OK, -1 Unknown interface ID or parameter fail.
Definition at line 348 of file net_load_balance.c.
int8_t net_load_balance_threshold_set | ( | int8_t | interface_id, |
uint8_t | threshold_min, | ||
uint8_t | threshold_max | ||
) |
Set load balance threshold min and max.
Network switch: diff_priority >= randLIB_get_random_in_range(threshold_min, threshold_max) --> switch network if true. For border router: Disable network compare by setting threshold_min and threshold_max to 0.
- Parameters:
-
interface_id Interface ID. threshold_min Min value defines a random minimum value for compare (must be bigger than 0). threshold_max Max value defines a random maximum value for compare (must be bigger than 0).
- Returns:
- 0 Process OK, -1 Unknown interface ID.
Definition at line 212 of file net_load_balance.c.
Generated on Tue Jul 12 2022 14:25:46 by
