From 11949c27e65aa10ab3d13358b4fea5013e3c7199 Mon Sep 17 00:00:00 2001 From: zhanghaipeng Date: Fri, 11 Sep 2026 16:48:48 +0800 Subject: [PATCH] fix(ble/bluedroid): use valid ATT error for Read Multiple assembly failure Return GATT_INVALID_HANDLE instead of GATT_NOT_FOUND when Read Multiple (Variable) response assembly fails, since 0x0A is not a valid ATT error for these PDUs per Core Spec Vol 3 Part F. --- components/bt/host/bluedroid/stack/gatt/gatt_sr.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/components/bt/host/bluedroid/stack/gatt/gatt_sr.c b/components/bt/host/bluedroid/stack/gatt/gatt_sr.c index a2061c05a04..2f2783ff504 100644 --- a/components/bt/host/bluedroid/stack/gatt/gatt_sr.c +++ b/components/bt/host/bluedroid/stack/gatt/gatt_sr.c @@ -342,7 +342,7 @@ static BOOLEAN process_read_multi_rsp (tGATT_SR_CMD *p_cmd, tGATT_STATUS status, } } else { - p_cmd->status = GATT_NOT_FOUND; + p_cmd->status = GATT_INVALID_HANDLE; break; } @@ -352,7 +352,7 @@ static BOOLEAN process_read_multi_rsp (tGATT_SR_CMD *p_cmd, tGATT_STATUS status, /* Sanity check on the buffer length */ if (p_buf->len <= 1) { GATT_TRACE_ERROR("process_read_multi_rsp - nothing found!!"); - p_cmd->status = GATT_NOT_FOUND; + p_cmd->status = GATT_INVALID_HANDLE; osi_free (p_buf); GATT_TRACE_DEBUG(" osi_free (p_buf)"); } else if (p_cmd->p_rsp_msg != NULL) { @@ -443,7 +443,7 @@ static BOOLEAN process_read_multi_var_rsp (tGATT_SR_CMD *p_cmd, tGATT_STATUS sta p += len; p_buf->len += (2+len); } else { - p_cmd->status = GATT_NOT_FOUND; + p_cmd->status = GATT_INVALID_HANDLE; break; } @@ -452,7 +452,7 @@ static BOOLEAN process_read_multi_var_rsp (tGATT_SR_CMD *p_cmd, tGATT_STATUS sta /* Sanity check on the buffer length */ if (p_buf->len <= 1) { GATT_TRACE_ERROR("%s - nothing found!!", __func__); - p_cmd->status = GATT_NOT_FOUND; + p_cmd->status = GATT_INVALID_HANDLE; osi_free (p_buf); } else if (p_cmd->p_rsp_msg != NULL) { osi_free (p_buf);