summaryrefslogtreecommitdiff
path: root/extmod/nimble/modbluetooth_nimble.c
diff options
context:
space:
mode:
authorJim Mussared <jim.mussared@gmail.com>2020-06-02 14:22:47 +1000
committerDamien George <damien.p.george@gmail.com>2020-06-05 14:08:15 +1000
commitc07ea3e4c2cfd9fe75a8b207a39d8bb0295fcc3b (patch)
tree0732d6941d18a4ecd9a1d36c9c7419234883ac17 /extmod/nimble/modbluetooth_nimble.c
parent919d640aec637004110d9f4df9814523a3bfd847 (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 'extmod/nimble/modbluetooth_nimble.c')
-rw-r--r--extmod/nimble/modbluetooth_nimble.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/extmod/nimble/modbluetooth_nimble.c b/extmod/nimble/modbluetooth_nimble.c
index 4b0f25848..9b95d05f3 100644
--- a/extmod/nimble/modbluetooth_nimble.c
+++ b/extmod/nimble/modbluetooth_nimble.c
@@ -844,6 +844,7 @@ STATIC int ble_gatt_attr_read_cb(uint16_t conn_handle, const struct ble_gatt_err
if (error->status == 0) {
gattc_on_data_available(MP_BLUETOOTH_IRQ_GATTC_READ_RESULT, conn_handle, attr->handle, attr->om);
}
+ mp_bluetooth_gattc_on_read_write_status(MP_BLUETOOTH_IRQ_GATTC_READ_DONE, conn_handle, attr->handle, error->status);
return 0;
}
@@ -861,7 +862,7 @@ STATIC int ble_gatt_attr_write_cb(uint16_t conn_handle, const struct ble_gatt_er
if (!mp_bluetooth_is_active()) {
return 0;
}
- mp_bluetooth_gattc_on_write_status(conn_handle, attr->handle, error->status);
+ mp_bluetooth_gattc_on_read_write_status(MP_BLUETOOTH_IRQ_GATTC_WRITE_DONE, conn_handle, attr->handle, error->status);
return 0;
}