BLEM Connectivity Status Observation (CM Detached)
- 1 General
- 2 Implementation Outline
- 3 Northbound API
- 3.1 OVSDB
- 3.1.1 AW_Bluetooth_Config
- 3.1.2 AW_Bluetooth_State
- 3.1.3 AWLAN_Node
- 3.1.4 LED_Config
- 3.1 OVSDB
- 4 Southbound API
- 5 Requirements
General
Until now, CM was responsible for calculation of the connectivity status bitmask (https://opensync.atlassian.net/wiki/spaces/OCC/pages/40054194179 ) and starting the BLE advertising. It started the BLE advertising by writing to AW_Bluetooth_Config table, which is the same table as used by the cloud also for other BLE advertising related features (https://opensync.atlassian.net/wiki/spaces/OCC/pages/40054194179/Bluetooth+Manager+BLEM#MsgType ).
While the pod was disconnected from the cloud, concurrent writes were not an issue. However, during normal operation, simultaneous updates to the same configuration table by both the Connection Manager (CM) and the cloud could lead to race conditions. Additionally, CM had to handle BLE status bit calculations, which properly belong within the scope of the Bluetooth Manager’s responsibilities.
Implementation Outline
The Connectivity Status byte is advertised via BLE as a first byte of the 6-byte Message field, when the Message Type is Onboarding (0x00).
Bit | Bitmask | Description | Condition |
|---|---|---|---|
0 | 0x01
| Ethernet physical link | Any
|
1 | 0x02
| Wi-Fi physical link | Any
|
2 | 0x04
| Backhaul over Ethernet | Any
|
3 | 0x08
| Backhaul over Wi-Fi | Any
|
4 | 0x10
| Connected to Router | Any
|
5 | 0x20
| Connected to Internet | Any
|
6 | 0x40
| Connected to Cloud |
|
Kconfig BLEM_CONNECTIVITY_STATUS_DEBOUNCE_TIME
The connectivity status bitmask value (conditions in the table above) can change rapidly during link selection, and there is no need to try to advertise every change via BLE. The interval between status changes can sometimes be even shorter than the BLE advertising interval (meaning no BLE packet with specific status is broadcast at all), and sub-second status updates provide little value to the end user, except for possibly even overwhelming the BLE scanner.
New Kconfig option BLEM_CONNECTIVITY_STATUS_DEBOUNCE_TIME specifies the in milliseconds for which the connectivity status must remain unchanged before the new status is advertised via BLE. Setting this to 0 will disable debouncing, and the new status value will be advertised immediately after it changes.
Default value is 2000 ms.
Kconfig BLEM_CONFIG_VIA_BLE_ENABLED
If Kconfig option BLEM_CONFIG_VIA_BLE_ENABLED is enabled (disabled by default), then BLEM will enable BLE connectable mode (https://opensync.atlassian.net/wiki/spaces/OCC/pages/40054194179/Bluetooth+Manager+BLEM#Advertising-as-connectable ) when the internet connection is not available for at least BLEM_CONFIG_VIA_BLE_OFFLINE_TIMEOUT seconds.
The check for internet connection is done by checking the Connected to Internet (5th) bit of the Connectivity Status Byte: while this bit is 0, an internal timer counts down from BLEM_CONFIG_VIA_BLE_OFFLINE_TIMEOUT seconds and when it reaches 0, the connectable mode is enabled. When the Connected to Internet bit is set to 1, this timer is reset (stopped and reloaded with its initial value of BLEM_CONFIG_VIA_BLE_OFFLINE_TIMEOUT seconds) and the BLE connectable mode is disabled, if it has been enabled.
Note that this feature does not observe any other status bit (e.g., Connected to Cloud): the role of Advanced Onboarding is the ability to configure WAN parameters (PPPoE credentials, VLAN, QoS, …) via BLE to establish an operational internet connection.
Kconfig BLEM_CONFIG_VIA_BLE_OFFLINE_TIMEOUT
New Kconfig option BLEM_CONFIG_VIA_BLE_OFFLINE_TIMEOUT (depends on BLEM_CONFIG_VIA_BLE_ENABLED) specifies the number of seconds of no internet connection before the BLE connectable mode is enabled.
The default value is 60 seconds.
Northbound API
OVSDB
AW_Bluetooth_Config
The schema and usage of the AW_Bluetooth_Config table remains the same as detailed under https://opensync.atlassian.net/wiki/spaces/OCC/pages/40054194179/Bluetooth+Manager+BLEM#AW_Bluetooth_Config .
The cloud is now the only entity writing to this table.
AW_Bluetooth_State
The schema of the AW_Bluetooth_State table remains the same, identical to AW_Bluetooth_Config, representing the current Bluetooth state on the node.
AWLAN_Node
AWLAN_Node table (specifically the led_config column) is not used anymore, the functionality is now implemented using LED_Config table.
LED_Config
When BLEM enables connectable mode internally (sets AW_Bluetooth_State::connectable to true, while AW_Bluetooth_Config::connectable is not present or set to false), it inserts the following to the LED_Config table to signalize a pattern:
LED_Config field name | Value |
|---|---|
name |
|
priority | Default ( |
position | Default ( |
The OVSDB transaction is performed using LED OSP API:
osp_led_ovsdb_add_led_config(OSP_LED_ST_BTCONNECTABLE, OSP_LED_PRIORITY_DEFAULT, OSP_LED_POSITION_DEFAULT);
osp_led_ovsdb_delete_led_config(OSP_LED_ST_BTCONNECTABLE, OSP_LED_POSITION_DEFAULT);Southbound API
There are no modifications to the southbound API.
Requirements
There are no changes to existing Bluetooth Manager requirements.