mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-02-13 15:41:17 +00:00
allow to return ok in att_write_callback. not ok -> prepare queue full error
This commit is contained in:
parent
1ce7a558b1
commit
0c1a43c084
@ -847,10 +847,14 @@ static uint16_t handle_prepare_write_request(att_connection_t * att_connection,
|
||||
// check security requirements
|
||||
uint8_t error_code = att_validate_security(att_connection, &it);
|
||||
if (error_code) {
|
||||
return setup_error(response_buffer, ATT_READ_REQUEST, handle, error_code);
|
||||
return setup_error(response_buffer, ATT_PREPARE_WRITE_REQUEST, handle, error_code);
|
||||
}
|
||||
(*att_write_callback)(handle, ATT_TRANSACTION_MODE_ACTIVE, 0, request_buffer + 3, request_len - 3, NULL);
|
||||
|
||||
ok = (*att_write_callback)(handle, ATT_TRANSACTION_MODE_ACTIVE, 0, request_buffer + 3, request_len - 3, NULL);
|
||||
if (!ok){
|
||||
return setup_error(response_buffer, ATT_PREPARE_WRITE_REQUEST, handle, ATT_ERROR_PREPARE_QUEUE_FULL);
|
||||
}
|
||||
|
||||
// response: echo request
|
||||
memcpy(response_buffer, request_buffer, request_len);
|
||||
response_buffer[0] = ATT_PREPARE_WRITE_RESPONSE;
|
||||
|
@ -155,8 +155,9 @@ typedef uint16_t (*att_read_callback_t)(uint16_t handle, uint16_t offset, uint8_
|
||||
// @param offset into the value - used for queued writes and long attributes
|
||||
// @param buffer
|
||||
// @param buffer_size
|
||||
// @Param signature used for signed write commmands
|
||||
typedef void (*att_write_callback_t)(uint16_t handle, uint16_t transaction_mode, uint16_t offset, uint8_t *buffer, uint16_t buffer_size, signature_t * signature);
|
||||
// @param signature used for signed write commmands
|
||||
// @returns 1 if request could be queue for ATT_TRANSACTION_MODE_ACTIVE
|
||||
typedef int (*att_write_callback_t)(uint16_t handle, uint16_t transaction_mode, uint16_t offset, uint8_t *buffer, uint16_t buffer_size, signature_t * signature);
|
||||
|
||||
// MARK: ATT Operations
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user