mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-04-18 05:42:49 +00:00
hfp: fix binary search, don't assert on unexpected CIND command
This commit is contained in:
parent
95f00c7ec8
commit
4700518231
@ -923,6 +923,7 @@ static hfp_command_t parse_command(const char * line_buffer, int isHandsFree){
|
|||||||
int match = strcmp(line_buffer, entry->command);
|
int match = strcmp(line_buffer, entry->command);
|
||||||
if (match < 0){
|
if (match < 0){
|
||||||
// search term is lower than middle element
|
// search term is lower than middle element
|
||||||
|
if (right == 0) break;
|
||||||
right = middle - 1;
|
right = middle - 1;
|
||||||
} else if (match == 0){
|
} else if (match == 0){
|
||||||
return entry->command_id;
|
return entry->command_id;
|
||||||
@ -1057,7 +1058,6 @@ static bool hfp_parse_byte(hfp_connection_t * hfp_connection, uint8_t byte, int
|
|||||||
hfp_connection->command = HFP_CMD_RETRIEVE_AG_INDICATORS;
|
hfp_connection->command = HFP_CMD_RETRIEVE_AG_INDICATORS;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
btstack_assert(false);
|
|
||||||
hfp_connection->command = HFP_CMD_UNKNOWN;
|
hfp_connection->command = HFP_CMD_UNKNOWN;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user