mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
Merge branch 'bugfix/hf_cind_ind_index_v4.2' into 'release/v4.2'
bt: Fixed the inconsistency between the indicator event received by the HF application layer and the actually received indicator(v4.2) See merge request espressif/esp-idf!23564
This commit is contained in:
commit
3d0cfc8cc3
@ -427,7 +427,8 @@ static void bta_hf_client_handle_ciev(UINT32 index, UINT32 value)
|
|||||||
|
|
||||||
APPL_TRACE_DEBUG("%s index: %u value: %u", __FUNCTION__, index, 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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -435,7 +436,7 @@ static void bta_hf_client_handle_ciev(UINT32 index, UINT32 value)
|
|||||||
service_availability = value == 0 ? FALSE : TRUE;
|
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) {
|
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 */
|
/* get the real in-array index from lookup table by index it comes at */
|
||||||
|
Loading…
Reference in New Issue
Block a user