You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 19, 2024. It is now read-only.
In ble_adapter.py, there are several spots where the dict values are accessed without checking if they exist, that causes KeyErrors.
For e.g. in ble_adapter.py : 272:
@NordicSemiErrorCheck(expected=BLEGattStatusCode.success)defservice_discovery(self, conn_handle, uuid=None):
vendor_services= []
self.driver.ble_gattc_prim_srvc_disc(conn_handle, uuid, 0x0001)
whileTrue:
response=self.evt_sync[conn_handle].wait( # Here sometimes, the conn_handle could not be in the evt_sync dictevt=BLEEvtID.gattc_evt_prim_srvc_disc_rsp
)
ifresponse["status"] ==BLEGattStatusCode.success: # Here the response can be None, or it may not contain "status"forsinresponse["services"]:
ifs.uuid.value==BLEUUID.Standard.unknown:
I've found that every now and then the BLE service discovery will fail because of a KeyError here or sometimes a None response is returned. Adding a Key check and None check here seems to fix most of the disconnections during discovery.
I'll go ahead and submit PR with my changes. Feel free to iterate.
In ble_adapter.py, there are several spots where the dict values are accessed without checking if they exist, that causes KeyErrors.
For e.g. in ble_adapter.py : 272:
I've found that every now and then the BLE service discovery will fail because of a KeyError here or sometimes a None response is returned. Adding a Key check and None check here seems to fix most of the disconnections during discovery.
I'll go ahead and submit PR with my changes. Feel free to iterate.
Thank you