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.
This commit is contained in:
Jim Mussared
2020-06-02 14:22:47 +10:00
committed by Damien George
parent 919d640aec
commit c07ea3e4c2
5 changed files with 19 additions and 9 deletions

View File

@@ -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