From 6e13e408eb7deed6e20d7fb1b136c29ade6d38b9 Mon Sep 17 00:00:00 2001
From: Matthias Ringwald <matthias@ringwald.ch>
Date: Sun, 29 Aug 2021 10:28:06 +0200
Subject: [PATCH] hfp_ag: use explicit cases for vra_state_requested

---
 src/classic/hfp_ag.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/classic/hfp_ag.c b/src/classic/hfp_ag.c
index 5b4a770b9..46b72e166 100644
--- a/src/classic/hfp_ag.c
+++ b/src/classic/hfp_ag.c
@@ -891,11 +891,12 @@ static int hfp_ag_voice_recognition_state_machine(hfp_connection_t * hfp_connect
                     hfp_connection->vra_state_requested = hfp_connection->vra_state;
                     return done;
 
-                default:
+                case HFP_VRA_W2_SEND_VOICE_RECOGNITION_ACTIVATED:
+                case HFP_VRA_W2_SEND_VOICE_RECOGNITION_OFF:
                     done = hfp_ag_send_voice_recognition_cmd(hfp_connection, hfp_connection->ag_activate_voice_recognition_value);
                     if (done == 0){
                         hfp_connection->vra_state_requested = hfp_connection->vra_state;
-                        
+
                         if (hfp_connection->ag_activate_voice_recognition_value == 1){
                             hfp_emit_voice_recognition_enabled(hfp_connection, done);
                         } else {
@@ -904,6 +905,10 @@ static int hfp_ag_voice_recognition_state_machine(hfp_connection_t * hfp_connect
                         return 0;
                     }
                     break;
+                default:
+                    log_error("state %u", hfp_connection->vra_state_requested);
+                    btstack_assert(false);
+                    break;
             }
             break;