diff options
author | Jim Mussared <jim.mussared@gmail.com> | 2020-06-02 14:22:47 +1000 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2020-06-05 14:08:15 +1000 |
commit | c07ea3e4c2cfd9fe75a8b207a39d8bb0295fcc3b (patch) | |
tree | 0732d6941d18a4ecd9a1d36c9c7419234883ac17 /examples/bluetooth/ble_temperature_central.py | |
parent | 919d640aec637004110d9f4df9814523a3bfd847 (diff) |
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.
Diffstat (limited to 'examples/bluetooth/ble_temperature_central.py')
-rw-r--r-- | examples/bluetooth/ble_temperature_central.py | 4 |
1 files changed, 4 insertions, 0 deletions
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 |