mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-03-15 04:21:01 +00:00
remove state code from pts hfp ag test
This commit is contained in:
parent
d2a4fb4f32
commit
58dd385e16
@ -80,15 +80,6 @@ static uint16_t handle = -1;
|
||||
static int memory_1_enabled = 1;
|
||||
static int last_number_exists = 1;
|
||||
|
||||
static int current_call_index = 0;
|
||||
static hfp_enhanced_call_dir_t current_call_dir;
|
||||
static int current_call_exists_a = 0;
|
||||
static int current_call_exists_b = 0;
|
||||
static hfp_enhanced_call_status_t current_call_status_a;
|
||||
static hfp_enhanced_call_status_t current_call_status_b;
|
||||
static hfp_enhanced_call_mpty_t current_call_mpty = HFP_ENHANCED_CALL_MPTY_NOT_A_CONFERENCE_CALL;
|
||||
|
||||
|
||||
static int ag_indicators_nr = 7;
|
||||
static hfp_ag_indicator_t ag_indicators[] = {
|
||||
// index, name, min range, max range, status, mandatory, enabled, status changed
|
||||
@ -387,18 +378,12 @@ static int stdin_process(struct data_source *ds){
|
||||
case 'c':
|
||||
log_info("USER:\'%c\'", cmd);
|
||||
printf("Simulate incoming call from 1234567\n");
|
||||
current_call_exists_a = 1;
|
||||
current_call_status_a = HFP_ENHANCED_CALL_STATUS_INCOMING;
|
||||
current_call_dir = HFP_ENHANCED_CALL_DIR_INCOMING;
|
||||
hfp_ag_set_clip(129, "1234567");
|
||||
hfp_ag_incoming_call();
|
||||
break;
|
||||
case 'm':
|
||||
log_info("USER:\'%c\'", cmd);
|
||||
printf("Simulate incoming call from 7654321\n");
|
||||
current_call_exists_b = 1;
|
||||
current_call_status_b = HFP_ENHANCED_CALL_STATUS_INCOMING;
|
||||
current_call_dir = HFP_ENHANCED_CALL_DIR_INCOMING;
|
||||
hfp_ag_set_clip(129, "7654321");
|
||||
hfp_ag_incoming_call();
|
||||
break;
|
||||
@ -415,13 +400,6 @@ static int stdin_process(struct data_source *ds){
|
||||
case 'e':
|
||||
log_info("USER:\'%c\'", cmd);
|
||||
printf("Answer call on AG\n");
|
||||
if (current_call_status_a == HFP_ENHANCED_CALL_STATUS_INCOMING){
|
||||
current_call_status_a = HFP_ENHANCED_CALL_STATUS_ACTIVE;
|
||||
}
|
||||
if (current_call_status_b == HFP_ENHANCED_CALL_STATUS_INCOMING){
|
||||
current_call_status_b = HFP_ENHANCED_CALL_STATUS_ACTIVE;
|
||||
current_call_status_a = HFP_ENHANCED_CALL_STATUS_HELD;
|
||||
}
|
||||
hfp_ag_answer_incoming_call();
|
||||
break;
|
||||
case 'E':
|
||||
@ -562,7 +540,6 @@ static int stdin_process(struct data_source *ds){
|
||||
case 'u':
|
||||
log_info("USER:\'%c\'", cmd);
|
||||
printf("Join held call\n");
|
||||
current_call_mpty = HFP_ENHANCED_CALL_MPTY_CONFERENCE_CALL;
|
||||
hfp_ag_join_held_call();
|
||||
break;
|
||||
case 'v':
|
||||
@ -683,39 +660,8 @@ static void packet_handler(uint8_t * event, uint16_t event_size){
|
||||
printf("\n** Send DTMF Codes: '%s'\n", &event[3]);
|
||||
hfp_ag_send_dtmf_code_done(device_addr);
|
||||
break;
|
||||
case HFP_SUBEVENT_TRANSMIT_STATUS_OF_CURRENT_CALL:
|
||||
if (current_call_index == 0 && current_call_exists_a){
|
||||
printf("hfp_ag_send_current_call_status 111 index %d, dir %d, status %d, mode %d, mpty %d, type %d, number %s\n", 1, current_call_dir, current_call_status_a,
|
||||
HFP_ENHANCED_CALL_MODE_VOICE, current_call_mpty, 129, "1234567");
|
||||
// hfp_ag_send_current_call_status(device_addr, 1, current_call_dir, current_call_status_a,
|
||||
// HFP_ENHANCED_CALL_MODE_VOICE, current_call_mpty, 129, "1234567");
|
||||
current_call_index = 1;
|
||||
break;
|
||||
}
|
||||
if (current_call_index == 1 && current_call_exists_b){
|
||||
// hfp_ag_send_current_call_status(device_addr, 2, current_call_dir, current_call_status_b,
|
||||
// HFP_ENHANCED_CALL_MODE_VOICE, current_call_mpty, 129, "7654321");
|
||||
printf("hfp_ag_send_current_call_status 111 index %d, dir %d, status %d, mode %d, mpty %d, type %d, number %s\n", 2, current_call_dir, current_call_status_a,
|
||||
HFP_ENHANCED_CALL_MODE_VOICE, current_call_mpty, 129, "7654321");
|
||||
|
||||
current_call_index = 2;
|
||||
break;
|
||||
}
|
||||
hfp_ag_send_current_call_status_done(device_addr);
|
||||
break;
|
||||
case HFP_CMD_CALL_ANSWERED:
|
||||
printf("Call answered by HF\n");
|
||||
if (current_call_status_a == HFP_ENHANCED_CALL_STATUS_INCOMING){
|
||||
current_call_status_a = HFP_ENHANCED_CALL_STATUS_ACTIVE;
|
||||
}
|
||||
if (current_call_status_b == HFP_ENHANCED_CALL_STATUS_INCOMING){
|
||||
current_call_status_b = HFP_ENHANCED_CALL_STATUS_ACTIVE;
|
||||
}
|
||||
break;
|
||||
case HFP_SUBEVENT_CONFERENCE_CALL:
|
||||
current_call_mpty = HFP_ENHANCED_CALL_MPTY_CONFERENCE_CALL;
|
||||
current_call_status_a = HFP_ENHANCED_CALL_STATUS_ACTIVE;
|
||||
current_call_status_b = HFP_ENHANCED_CALL_STATUS_ACTIVE;
|
||||
break;
|
||||
default:
|
||||
printf("Event not handled %u\n", event[2]);
|
||||
|
Loading…
x
Reference in New Issue
Block a user