summaryrefslogtreecommitdiff
path: root/extmod/modbluetooth.h
diff options
context:
space:
mode:
authorJim Mussared <jim.mussared@gmail.com>2020-11-03 17:46:11 +1100
committerDamien George <damien@micropython.org>2020-11-13 17:19:05 +1100
commitc398e46b29f5c780b8016f2e88afe4c6984c54d8 (patch)
tree77cfcb38d5133db94464e66c86f395229ab55371 /extmod/modbluetooth.h
parent4559bcb4679e04e0a5e24030675676ff6a9803f2 (diff)
extmod/modbluetooth: Combine gattc-data-available callbacks into one.
Instead of having the stack indicate a "start", "data"..., "end", pass through the data in one callback as an array of chunks of data. This is because the upcoming non-ringbuffer modbluetooth implementation cannot buffer the data in the ringbuffer and requires instead a single callback with all the data, to pass to the Python callback. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
Diffstat (limited to 'extmod/modbluetooth.h')
-rw-r--r--extmod/modbluetooth.h6
1 files changed, 1 insertions, 5 deletions
diff --git a/extmod/modbluetooth.h b/extmod/modbluetooth.h
index 618939ab1..dee7186a2 100644
--- a/extmod/modbluetooth.h
+++ b/extmod/modbluetooth.h
@@ -289,11 +289,7 @@ void mp_bluetooth_gattc_on_descriptor_result(uint16_t conn_handle, uint16_t hand
void mp_bluetooth_gattc_on_discover_complete(uint8_t event, uint16_t conn_handle, uint16_t status);
// Notify modbluetooth that a read has completed with data (or notify/indicate data available, use `event` to disambiguate).
-// Note: these functions are to be called in a group protected by MICROPY_PY_BLUETOOTH_ENTER/EXIT.
-// _start returns the number of bytes to submit to the calls to _chunk, followed by a call to _end.
-size_t mp_bluetooth_gattc_on_data_available_start(uint8_t event, uint16_t conn_handle, uint16_t value_handle, size_t data_len, mp_uint_t *atomic_state_out);
-void mp_bluetooth_gattc_on_data_available_chunk(const uint8_t *data, size_t data_len);
-void mp_bluetooth_gattc_on_data_available_end(mp_uint_t atomic_state);
+void mp_bluetooth_gattc_on_data_available(uint8_t event, uint16_t conn_handle, uint16_t value_handle, const uint8_t **data, uint16_t *data_len, size_t num);
// Notify modbluetooth that a read or write operation has completed.
void mp_bluetooth_gattc_on_read_write_status(uint8_t event, uint16_t conn_handle, uint16_t value_handle, uint16_t status);