mirror of
https://github.com/espressif/esp-idf.git
synced 2026-10-01 18:50:34 +03:00
fix(nimble): initialize return value in LED characteristic access callback
When the NimBLE stack called this callback for a GATT Write Request, the uninitialized stack value was interpreted as a non-zero GATT error code, causing the stack to send BLE_ATT_ERR_UNLIKELY (0x0E) back to the client.
This commit is contained in:
committed by
Shreeyash Bhakare
parent
de77e11ec6
commit
5ae25bd6b5
@@ -117,9 +117,6 @@ error:
|
||||
|
||||
static int led_chr_access(uint16_t conn_handle, uint16_t attr_handle,
|
||||
struct ble_gatt_access_ctxt *ctxt, void *arg) {
|
||||
/* Local variables */
|
||||
int rc = 0;
|
||||
|
||||
/* Handle access events */
|
||||
/* Note: LED characteristic is write only */
|
||||
switch (ctxt->op) {
|
||||
@@ -151,7 +148,7 @@ static int led_chr_access(uint16_t conn_handle, uint16_t attr_handle,
|
||||
} else {
|
||||
goto error;
|
||||
}
|
||||
return rc;
|
||||
return 0;
|
||||
}
|
||||
goto error;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user