From 4700518231a3efa146a3161648f6e71c0258e99c Mon Sep 17 00:00:00 2001 From: Milanka Ringwald Date: Thu, 18 Jun 2020 14:43:47 +0200 Subject: [PATCH] hfp: fix binary search, don't assert on unexpected CIND command --- src/classic/hfp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/classic/hfp.c b/src/classic/hfp.c index b34eb5112..c654462b0 100644 --- a/src/classic/hfp.c +++ b/src/classic/hfp.c @@ -923,6 +923,7 @@ static hfp_command_t parse_command(const char * line_buffer, int isHandsFree){ int match = strcmp(line_buffer, entry->command); if (match < 0){ // search term is lower than middle element + if (right == 0) break; right = middle - 1; } else if (match == 0){ 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; break; default: - btstack_assert(false); hfp_connection->command = HFP_CMD_UNKNOWN; break; }