From c07ea3e4c2cfd9fe75a8b207a39d8bb0295fcc3b Mon Sep 17 00:00:00 2001 From: Jim Mussared Date: Tue, 2 Jun 2020 14:22:47 +1000 Subject: extmod/modbluetooth: Implement read done event. On btstack there's no status associated with the read result, it comes through as a separate event. This allows you to detect read failures or timeouts. --- examples/bluetooth/ble_temperature_central.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'examples') diff --git a/examples/bluetooth/ble_temperature_central.py b/examples/bluetooth/ble_temperature_central.py index 19dc93409..619578462 100644 --- a/examples/bluetooth/ble_temperature_central.py +++ b/examples/bluetooth/ble_temperature_central.py @@ -161,6 +161,10 @@ class BLETemperatureCentral: self._read_callback(self._value) self._read_callback = None + elif event == _IRQ_GATTC_READ_DONE: + # Read completed. + conn_handle, value_handle, status = data + elif event == _IRQ_GATTC_NOTIFY: # The ble_temperature.py demo periodically notifies its value. conn_handle, value_handle, notify_data = data -- cgit v1.2.3