connectcore-demo-example: limit demo to use only native BT adapter

By default, when retrieving the Bluetooth interface to use in the demo, the service
first tries with the native Bluetooth adapter and, in the case it fails, it looks
for connected XBee devices with Bluetooth capabilities. This is causing the demo to
lock the XBee port if the native Bluetooth interface is not present or fails to
initialize. Avoid this behavior by limiting the Bluetooth service to use only
the native Bluetooth interface for this demo.

Signed-off-by: David Escalona <david.escalona@digi.com>
This commit is contained in:
David Escalona 2023-03-27 13:54:42 +02:00
parent 4bb2a81a46
commit 148f0dc99c
1 changed files with 1 additions and 1 deletions

View File

@ -666,7 +666,7 @@ class BluetoothService:
""" """
with self._lock: with self._lock:
try: try:
self._ble_service = ConnectCoreBLEService.get_instance() self._ble_service = ConnectCoreBLEService.get_instance(ble_interface=BLEInterface.ADAPTER)
self._ble_service.add_connect_callback(self._connection_cb) self._ble_service.add_connect_callback(self._connection_cb)
self._ble_service.add_data_received_callback(self._data_received_cb) self._ble_service.add_data_received_callback(self._data_received_cb)
self._ble_service.set_password(get_bt_password()) self._ble_service.set_password(get_bt_password())