From efc65c77c755ebdb4d3769b23ffe4c52bad226a8 Mon Sep 17 00:00:00 2001 From: "mila@ringwald.ch" Date: Sun, 2 Feb 2014 09:39:06 +0000 Subject: [PATCH] check callback error for write requests --- ble/att.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ble/att.c b/ble/att.c index f4e9dca57..08a0baffb 100644 --- a/ble/att.c +++ b/ble/att.c @@ -875,7 +875,10 @@ static uint16_t handle_write_request(att_connection_t * att_connection, uint8_t if (error_code) { return setup_error(response_buffer, request_type, handle, error_code); } - (*att_write_callback)(handle, ATT_TRANSACTION_MODE_NONE, 0, request_buffer + 3, request_len - 3, NULL); + error_code = (*att_write_callback)(handle, ATT_TRANSACTION_MODE_NONE, 0, request_buffer + 3, request_len - 3, NULL); + if (error_code) { + return setup_error(response_buffer, request_type, handle, error_code); + } response_buffer[0] = ATT_WRITE_RESPONSE; return 1; }