mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-02-05 00:40:19 +00:00
prepared writes need to write complete value from offset 0
This commit is contained in:
parent
b21b3b8fd1
commit
d83370750a
@ -329,6 +329,7 @@ static int att_write_callback(uint16_t handle, uint16_t transaction_mode, uint16
|
|||||||
writes_index = att_write_queue_for_handle(handle);
|
writes_index = att_write_queue_for_handle(handle);
|
||||||
if (writes_index < 0) return ATT_ERROR_PREPARE_QUEUE_FULL;
|
if (writes_index < 0) return ATT_ERROR_PREPARE_QUEUE_FULL;
|
||||||
if (offset > ATT_VALUE_MAX_LEN) return ATT_ERROR_INVALID_OFFSET;
|
if (offset > ATT_VALUE_MAX_LEN) return ATT_ERROR_INVALID_OFFSET;
|
||||||
|
if (offset > att_write_queues[writes_index].len) return ATT_ERROR_INVALID_OFFSET;
|
||||||
if (buffer_size + offset > ATT_VALUE_MAX_LEN) {
|
if (buffer_size + offset > ATT_VALUE_MAX_LEN) {
|
||||||
// truncat value
|
// truncat value
|
||||||
buffer_size = ATT_VALUE_MAX_LEN - offset;
|
buffer_size = ATT_VALUE_MAX_LEN - offset;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user