mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-01-25 09:35:42 +00:00
hfp cleanup: removing state code from ag client test
This commit is contained in:
parent
585dcc17b0
commit
d2a4fb4f32
@ -68,9 +68,6 @@
|
|||||||
|
|
||||||
static bd_addr_t pts_addr = {0x00,0x15,0x83,0x5F,0x9D,0x46};
|
static bd_addr_t pts_addr = {0x00,0x15,0x83,0x5F,0x9D,0x46};
|
||||||
|
|
||||||
static hfp_enhanced_call_status_t current_call_status_a;
|
|
||||||
static hfp_enhanced_call_status_t current_call_status_b;
|
|
||||||
|
|
||||||
const uint8_t rfcomm_channel_nr = 1;
|
const uint8_t rfcomm_channel_nr = 1;
|
||||||
|
|
||||||
static bd_addr_t device_addr = {0xD8,0xBb,0x2C,0xDf,0xF1,0x08};
|
static bd_addr_t device_addr = {0xD8,0xBb,0x2C,0xDf,0xF1,0x08};
|
||||||
@ -156,13 +153,11 @@ static void user_command(char cmd){
|
|||||||
break;
|
break;
|
||||||
case 'c':
|
case 'c':
|
||||||
printf("Simulate incoming call from 1234567\n");
|
printf("Simulate incoming call from 1234567\n");
|
||||||
current_call_status_a = HFP_ENHANCED_CALL_STATUS_INCOMING;
|
|
||||||
hfp_ag_set_clip(129, "1234567");
|
hfp_ag_set_clip(129, "1234567");
|
||||||
hfp_ag_incoming_call();
|
hfp_ag_incoming_call();
|
||||||
break;
|
break;
|
||||||
case 'm':
|
case 'm':
|
||||||
printf("Simulate incoming call from 7654321\n");
|
printf("Simulate incoming call from 7654321\n");
|
||||||
current_call_status_b = HFP_ENHANCED_CALL_STATUS_INCOMING;
|
|
||||||
hfp_ag_set_clip(129, "7654321");
|
hfp_ag_set_clip(129, "7654321");
|
||||||
hfp_ag_incoming_call();
|
hfp_ag_incoming_call();
|
||||||
break;
|
break;
|
||||||
@ -176,13 +171,6 @@ static void user_command(char cmd){
|
|||||||
break;
|
break;
|
||||||
case 'e':
|
case 'e':
|
||||||
printf("Answer call on AG\n");
|
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();
|
hfp_ag_answer_incoming_call();
|
||||||
break;
|
break;
|
||||||
case 'E':
|
case 'E':
|
||||||
@ -443,20 +431,6 @@ void packet_handler(uint8_t * event, uint16_t event_size){
|
|||||||
printf("\n** Send DTMF Codes: '%s'\n", &event[3]);
|
printf("\n** Send DTMF Codes: '%s'\n", &event[3]);
|
||||||
hfp_ag_send_dtmf_code_done(device_addr);
|
hfp_ag_send_dtmf_code_done(device_addr);
|
||||||
break;
|
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_status_a = HFP_ENHANCED_CALL_STATUS_ACTIVE;
|
|
||||||
current_call_status_b = HFP_ENHANCED_CALL_STATUS_ACTIVE;
|
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
printf("Event not handled %u\n", event[2]);
|
printf("Event not handled %u\n", event[2]);
|
||||||
break;
|
break;
|
||||||
@ -484,9 +458,6 @@ TEST_GROUP(HFPClient){
|
|||||||
void teardown(void){
|
void teardown(void){
|
||||||
hfp_ag_release_audio_connection(device_addr);
|
hfp_ag_release_audio_connection(device_addr);
|
||||||
hfp_ag_release_service_level_connection(device_addr);
|
hfp_ag_release_service_level_connection(device_addr);
|
||||||
|
|
||||||
current_call_status_b = HFP_ENHANCED_CALL_STATUS_ACTIVE;
|
|
||||||
current_call_status_a = HFP_ENHANCED_CALL_STATUS_ACTIVE;
|
|
||||||
|
|
||||||
service_level_connection_established = 0;
|
service_level_connection_established = 0;
|
||||||
codecs_connection_established = 0;
|
codecs_connection_established = 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user