hfp: answer +CCWA

This commit is contained in:
Matthias Ringwald 2015-11-22 21:14:19 +01:00
parent 40a7976ab3
commit 42b0282bb3
3 changed files with 13 additions and 0 deletions

View File

@ -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;
}

View File

@ -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:<enabled>,,<enabled>,,,<enabled>
#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;

View File

@ -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;
}