-
Notifications
You must be signed in to change notification settings - Fork 16
[toble] Enable Thread-over-BLE configuration. #38
Conversation
main/main.cpp
Outdated
@@ -285,6 +298,19 @@ int main(void) | |||
} | |||
} | |||
|
|||
// Disable Weave Pairing if Thread network has already been provisioned. | |||
// TODO: Change this to only disable WoBLE when *full provisioning* has completed, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs to be resolved before we merge this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed. The proposal is to disable pairing after a device has been fully provisioned (net, fabric, and service). A device will need to be factory reset to re-enable pairing mode. Will that paradigm be sufficient for the example apps?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Having to factory reset is unfortunate, but unavoidabled. Since this won't be on by default, it shouldn't affect most users.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want to encapsulate this factory-reset behavior with the TOBLE flag or some new flag?
20bfa10
to
6812470
Compare
main/main.cpp
Outdated
{ | ||
// Disable advertising when Commissioner connected over WoBLE | ||
// so ToBLE connectivity checks can occur. | ||
ConnectivityMgr().SetBLEAdvertisingEnabled(false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be conditional on OPENTHREAD_CONFIG_ENABLE_TOBLE as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok. Though what is the use case for leaving advertising on while a WoBLE connection is active? BTP doesn't support multi-connection and closing the connection should restart WoBLE advertisements.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This API instructs the connectivity manager to enable/disable advertising altogether. It's value is entirely under the control of the application; it is never changed by the Device Layer. So while BLEAdvertisingEnabled() == false, closing the connection will not restart advertising.
I suggest the following approach to coordinating advertising when ToBLE is enabled:
-
Add a compile-time option to the Device Layer that suppresses advertising while a WoBLE connection is active. E.g.: WEAVE_DEVICE_CONFIG_SINGLE_WOBLE_CONNECTION. For devices that use ToBLE, they would also need to enable this option.
-
In the example app, inside the event handler function, monitor all changes to the device's network, fabric and service provisioning states. For any change to any of these states, evaluate whether the device is fully provisioned (network, fabric and service). If so, disable advertising by calling SetBLEAdvertisingEnabled(false). If not, enable advertising by calling SetBLEAdvertisingEnabled(true).
Using this approach, advertising is automatically disabled when a WoBLE connection is established, and only re-enabled when the connection ends and the device has not been fully provisioned.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, applied these suggestion in d178b9b.
f797ac9
to
d178b9b
Compare
Note: this PR will need to be updated to include openweave/openweave-core#398 in openweave-core submodule. |
d178b9b
to
e4c4977
Compare
- Add OpenThread configuration for ToBLE feature. - Make WoBLE and ToBLE use same BLE config tag on Nordic platforms. - Increase GATT table size to account for both services. - Add logic to disable WoBLE when ToBLE is provisioned. - Add OpenThread logging configuration for platform and debug. - Pivot to event-based evaluation of provisioning state.
…ing framework in openweave-core.
e4c4977
to
c873335
Compare
Replaced by #59. |
No description provided.