summaryrefslogtreecommitdiff
path: root/extmod/modbluetooth.h
diff options
context:
space:
mode:
authorJim Mussared <jim.mussared@gmail.com>2019-10-28 17:27:31 +1100
committerDamien George <damien.p.george@gmail.com>2019-10-29 23:09:02 +1100
commitd16a27da5197e2369611bef4f18b47c183880510 (patch)
tree195023164a09185f702f1134e2a80a859730b431 /extmod/modbluetooth.h
parent53f3cbc2c4f07236fe022c9c7af20b33443c60b1 (diff)
extmod/modbluetooth: Add gatts_set_buffer.
- Adds an explicit way to set the size of a value's internal buffer, replacing `ble.gatts_write(handle, bytes(size))` (although that still works). - Add an "append" mode for values, which means that remote writes will append to the buffer.
Diffstat (limited to 'extmod/modbluetooth.h')
-rw-r--r--extmod/modbluetooth.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/extmod/modbluetooth.h b/extmod/modbluetooth.h
index 20476b183..bce28a6d1 100644
--- a/extmod/modbluetooth.h
+++ b/extmod/modbluetooth.h
@@ -183,6 +183,10 @@ int mp_bluetooth_gatts_notify_send(uint16_t conn_handle, uint16_t value_handle,
// Indicate the central.
int mp_bluetooth_gatts_indicate(uint16_t conn_handle, uint16_t value_handle);
+// Resize and enable/disable append-mode on a value.
+// Append-mode means that remote writes will append and local reads will clear after reading.
+int mp_bluetooth_gatts_set_buffer(uint16_t value_handle, size_t len, bool append);
+
// Disconnect from a central or peripheral.
int mp_bluetooth_gap_disconnect(uint16_t conn_handle);