diff options
author | Jim Mussared <jim.mussared@gmail.com> | 2021-07-23 15:12:26 +1000 |
---|---|---|
committer | Damien George <damien@micropython.org> | 2021-08-14 22:21:55 +1000 |
commit | 1d9e489af3d00d737917b09c1f0d007705e970e9 (patch) | |
tree | accb081390ddda3bc2c9a36579480f0921934dbf /extmod/btstack/modbluetooth_btstack.c | |
parent | 5733c49174a200b59196f44377a1418a6c38c877 (diff) | |
download | micropython-1d9e489af3d00d737917b09c1f0d007705e970e9.tar.gz micropython-1d9e489af3d00d737917b09c1f0d007705e970e9.zip |
extmod/modbluetooth: Add send_update arg to gatts_write.
This allows the write to trigger a notification or indication, but only to
subscribed clients. This is different to gatts_notify/gatts_indicate,
which will unconditionally notify/indicate.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
Diffstat (limited to 'extmod/btstack/modbluetooth_btstack.c')
-rw-r--r-- | extmod/btstack/modbluetooth_btstack.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/extmod/btstack/modbluetooth_btstack.c b/extmod/btstack/modbluetooth_btstack.c index 9c88878038..4e81e21fe2 100644 --- a/extmod/btstack/modbluetooth_btstack.c +++ b/extmod/btstack/modbluetooth_btstack.c @@ -1085,11 +1085,14 @@ int mp_bluetooth_gatts_read(uint16_t value_handle, uint8_t **value, size_t *valu return mp_bluetooth_gatts_db_read(MP_STATE_PORT(bluetooth_btstack_root_pointers)->gatts_db, value_handle, value, value_len); } -int mp_bluetooth_gatts_write(uint16_t value_handle, const uint8_t *value, size_t value_len) { +int mp_bluetooth_gatts_write(uint16_t value_handle, const uint8_t *value, size_t value_len, bool send_update) { DEBUG_printf("mp_bluetooth_gatts_write\n"); if (!mp_bluetooth_is_active()) { return ERRNO_BLUETOOTH_NOT_ACTIVE; } + if (send_update) { + return MP_EOPNOTSUPP; + } return mp_bluetooth_gatts_db_write(MP_STATE_PORT(bluetooth_btstack_root_pointers)->gatts_db, value_handle, value, value_len); } |