Skip to content

Commit

Permalink
Merge branch 'bugfix/hf_cind_ind_index_v4.4' into 'release/v4.4'
Browse files Browse the repository at this point in the history
bt: Fixed the inconsistency between the indicator event received by the HF application layer and the actually received indicator(v4.4)

See merge request espressif/esp-idf!23562
  • Loading branch information
jack0c committed Jun 9, 2023
2 parents 01cc59c + 017517b commit ff4ae8d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions components/bt/host/bluedroid/bta/hf_client/bta_hf_client_at.c
Original file line number Diff line number Diff line change
Expand Up @@ -427,15 +427,16 @@ static void bta_hf_client_handle_ciev(UINT32 index, UINT32 value)

APPL_TRACE_DEBUG("%s index: %u value: %u", __FUNCTION__, index, value);

if (index >= BTA_HF_CLIENT_AT_INDICATOR_COUNT) {
if (index == 0 || index > BTA_HF_CLIENT_AT_INDICATOR_COUNT) {
APPL_TRACE_WARNING("%s: Invalid index %d", __FUNCTION__, index);
return;
}

if (service_index == index - 1) {
service_availability = value == 0 ? FALSE : TRUE;
}

realind = bta_hf_client_cb.scb.at_cb.indicator_lookup[index];
realind = bta_hf_client_cb.scb.at_cb.indicator_lookup[index - 1];

if (realind >= 0 && realind < BTA_HF_CLIENT_AT_SUPPORTED_INDICATOR_COUNT) {
/* get the real in-array index from lookup table by index it comes at */
Expand Down

0 comments on commit ff4ae8d

Please sign in to comment.