From 42b0282bb313f7fdef2a346f364089eebb283aa1 Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Sun, 22 Nov 2015 21:14:19 +0100 Subject: [PATCH] hfp: answer +CCWA --- src/hfp.c | 4 ++++ src/hfp.h | 3 +++ src/hfp_ag.c | 6 ++++++ 3 files changed, 13 insertions(+) diff --git a/src/hfp.c b/src/hfp.c index 3921d3af9..7e7ef274e 100644 --- a/src/hfp.c +++ b/src/hfp.c @@ -675,6 +675,10 @@ static hfp_command_t parse_command(const char * line_buffer, int isHandsFree){ return HFP_CMD_ENABLE_CLIP; } + if (strncmp(line_buffer+offset, HFP_ENABLE_CALL_WAITING_NOTIFICATION, strlen(HFP_ENABLE_CALL_WAITING_NOTIFICATION)) == 0){ + return HFP_CMD_ENABLE_CALL_WAITING_NOTIFICATION; + } + if (strncmp(line_buffer+offset, HFP_SUPPORT_CALL_HOLD_AND_MULTIPARTY_SERVICES, strlen(HFP_SUPPORT_CALL_HOLD_AND_MULTIPARTY_SERVICES)) == 0){ return HFP_CMD_SUPPORT_CALL_HOLD_AND_MULTIPARTY_SERVICES; } diff --git a/src/hfp.h b/src/hfp.h index 7231a2c0b..649ead4e7 100644 --- a/src/hfp.h +++ b/src/hfp.h @@ -107,6 +107,7 @@ extern "C" { #define HFP_INDICATOR "+CIND" #define HFP_ENABLE_STATUS_UPDATE_FOR_AG_INDICATORS "+CMER" #define HFP_ENABLE_CLIP "+CLIP" +#define HFP_ENABLE_CALL_WAITING_NOTIFICATION "+CCWA" #define HFP_UPDATE_ENABLE_STATUS_FOR_INDIVIDUAL_AG_INDICATORS "+BIA" // +BIA:,,,,, #define HFP_SUPPORT_CALL_HOLD_AND_MULTIPARTY_SERVICES "+CHLD" #define HFP_GENERIC_STATUS_INDICATOR "+BIND" @@ -144,6 +145,7 @@ typedef enum { HFP_CMD_ENABLE_INDIVIDUAL_AG_INDICATOR_STATUS_UPDATE, HFP_CMD_SUPPORT_CALL_HOLD_AND_MULTIPARTY_SERVICES, HFP_CMD_ENABLE_CLIP, + HFP_CMD_ENABLE_CALL_WAITING_NOTIFICATION, HFP_CMD_LIST_GENERIC_STATUS_INDICATORS, HFP_CMD_RETRIEVE_GENERIC_STATUS_INDICATORS, @@ -405,6 +407,7 @@ typedef struct hfp_connection { // HF -> AG configuration uint8_t clip_enabled; + uint8_t call_waiting_notification_enabled; // TODO: put these bit flags in a bitmap uint8_t ok_pending; diff --git a/src/hfp_ag.c b/src/hfp_ag.c index d9851c20b..5a0cd6eb0 100644 --- a/src/hfp_ag.c +++ b/src/hfp_ag.c @@ -1202,6 +1202,12 @@ static void hfp_handle_rfcomm_data(uint8_t packet_type, uint16_t channel, uint8_ log_info("hfp: clip set, now: %u", context->clip_enabled); context->ok_pending = 1; break; + case HFP_CMD_ENABLE_CALL_WAITING_NOTIFICATION: + context->command = HFP_CMD_NONE; + context->call_waiting_notification_enabled = context->line_buffer[8] != '0'; + log_info("hfp: call waiting notification set, now: %u", context->call_waiting_notification_enabled); + context->ok_pending = 1; + break; default: break; }