mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-04-09 21:45:54 +00:00
test/hfp: update test sequences
This commit is contained in:
parent
0c873afde1
commit
9840d7c868
@ -468,6 +468,13 @@ TEST(HFPClient, PTSSLCTests){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TEST(HFPClient, IssueTests){
|
||||||
|
for (int i = 0; i < hfp_pts_ag_issues_tests_size(); i++){
|
||||||
|
setup();
|
||||||
|
simulate_test_sequence(&hfp_pts_ag_issues_tests()[i]);
|
||||||
|
teardown();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
int main (int argc, const char * argv[]){
|
int main (int argc, const char * argv[]){
|
||||||
hfp_ag_register_packet_handler(packet_handler);
|
hfp_ag_register_packet_handler(packet_handler);
|
||||||
|
@ -79,7 +79,45 @@ static uint8_t start_ringing = 0;
|
|||||||
static uint8_t stop_ringing = 0;
|
static uint8_t stop_ringing = 0;
|
||||||
static uint8_t call_termiated = 0;
|
static uint8_t call_termiated = 0;
|
||||||
|
|
||||||
static int supported_features_with_codec_negotiation = 438;
|
|
||||||
|
static void dump_vra_state(hfp_connection_t * connection, const char * desc){
|
||||||
|
const char * vra_state[] = {
|
||||||
|
"VOICE_RECOGNITION_OFF",
|
||||||
|
"W2_SEND_VOICE_RECOGNITION_OFF",
|
||||||
|
"W4_VOICE_RECOGNITION_OFF",
|
||||||
|
"W2_SEND_VOICE_RECOGNITION_ACTIVATED",
|
||||||
|
"W4_VOICE_RECOGNITION_ACTIVATED",
|
||||||
|
"VOICE_RECOGNITION_ACTIVATED",
|
||||||
|
"W2_SEND_ENHANCED_VOICE_RECOGNITION_READY_FOR_AUDIO",
|
||||||
|
"W4_ENHANCED_VOICE_RECOGNITION_READY_FOR_AUDIO",
|
||||||
|
"ENHANCED_VOICE_RECOGNITION_READY_FOR_AUDIO",
|
||||||
|
"W2_SEND_ENHANCED_VOICE_RECOGNITION_STATUS",
|
||||||
|
"W2_SEND_ENHANCED_VOICE_RECOGNITION_MSG"
|
||||||
|
};
|
||||||
|
if (connection->enhanced_voice_recognition_enabled){
|
||||||
|
printf("%s, VRA=%d: %s -> %s, delay emit %d, ok pending %d\n",
|
||||||
|
desc,
|
||||||
|
connection->activate_voice_recognition,
|
||||||
|
vra_state[connection->vra_state],
|
||||||
|
vra_state[connection->vra_state_requested],
|
||||||
|
connection->emit_vra_enabled_after_audio_established, connection->ok_pending);
|
||||||
|
} else {
|
||||||
|
printf("%s, VRA not enabled\n", desc);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
// static int supported_features_with_codec_negotiation = 438;
|
||||||
|
static int supported_features_with_codec_negotiation =
|
||||||
|
(1<<HFP_HFSF_ESCO_S4) |
|
||||||
|
(1<<HFP_HFSF_CLI_PRESENTATION_CAPABILITY) |
|
||||||
|
(1<<HFP_HFSF_HF_INDICATORS) |
|
||||||
|
(1<<HFP_HFSF_CODEC_NEGOTIATION) |
|
||||||
|
(1<<HFP_HFSF_ENHANCED_CALL_STATUS) |
|
||||||
|
(1<<HFP_HFSF_VOICE_RECOGNITION_FUNCTION) |
|
||||||
|
(1<<HFP_HFSF_ENHANCED_VOICE_RECOGNITION_STATUS) |
|
||||||
|
(1<<HFP_HFSF_VOICE_RECOGNITION_TEXT) |
|
||||||
|
(1<<HFP_HFSF_EC_NR_FUNCTION) |
|
||||||
|
(1<<HFP_HFSF_REMOTE_VOLUME_CONTROL);
|
||||||
|
|
||||||
static uint16_t acl_handle = -1;
|
static uint16_t acl_handle = -1;
|
||||||
|
|
||||||
@ -313,7 +351,7 @@ static void simulate_test_sequence(hfp_test_item_t * test_item){
|
|||||||
int previous_step = -1;
|
int previous_step = -1;
|
||||||
while ( i < test_item->len){
|
while ( i < test_item->len){
|
||||||
previous_step++;
|
previous_step++;
|
||||||
CHECK_EQUAL(i >= previous_step, 1);
|
CHECK_EQUAL(i >= previous_step, true);
|
||||||
|
|
||||||
char * expected_cmd = test_steps[i];
|
char * expected_cmd = test_steps[i];
|
||||||
int expected_cmd_len = strlen(expected_cmd);
|
int expected_cmd_len = strlen(expected_cmd);
|
||||||
@ -460,6 +498,18 @@ static void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t * even
|
|||||||
case HFP_SUBEVENT_CALLING_LINE_IDENTIFICATION_NOTIFICATION:
|
case HFP_SUBEVENT_CALLING_LINE_IDENTIFICATION_NOTIFICATION:
|
||||||
printf("Caller ID, number %s\n", hfp_subevent_calling_line_identification_notification_get_number(event));
|
printf("Caller ID, number %s\n", hfp_subevent_calling_line_identification_notification_get_number(event));
|
||||||
break;
|
break;
|
||||||
|
case HFP_SUBEVENT_AG_INDICATOR_MAPPING:
|
||||||
|
printf("Received HFP_SUBEVENT_AG_INDICATOR_MAPPING\n");
|
||||||
|
break;
|
||||||
|
case HFP_SUBEVENT_CALL_ANSWERED:
|
||||||
|
printf("Received HFP_SUBEVENT_CALL_ANSWERED\n");
|
||||||
|
break;
|
||||||
|
case HFP_SUBEVENT_VOICE_RECOGNITION_DEACTIVATED:
|
||||||
|
printf("Received HFP_SUBEVENT_VOICE_RECOGNITION_DEACTIVATED\n");
|
||||||
|
break;
|
||||||
|
case HFP_SUBEVENT_VOICE_RECOGNITION_ACTIVATED:
|
||||||
|
printf("Received HFP_SUBEVENT_VOICE_RECOGNITION_ACTIVATED\n");
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
printf("event not handled %u\n", event[2]);
|
printf("event not handled %u\n", event[2]);
|
||||||
break;
|
break;
|
||||||
@ -541,6 +591,14 @@ TEST(HFPClient, PTSSLCTests){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TEST(HFPClient, IssuesTests){
|
||||||
|
for (int i = 0; i < hfp_pts_hf_issues_tests_size(); i++){
|
||||||
|
setup();
|
||||||
|
simulate_test_sequence(&hfp_pts_hf_issues_tests()[i]);
|
||||||
|
teardown();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
int main (int argc, const char * argv[]){
|
int main (int argc, const char * argv[]){
|
||||||
hfp_hf_register_packet_handler(packet_handler);
|
hfp_hf_register_packet_handler(packet_handler);
|
||||||
return CommandLineTestRunner::RunAllTests(argc, argv);
|
return CommandLineTestRunner::RunAllTests(argc, argv);
|
||||||
|
@ -4122,6 +4122,16 @@ hfp_test_item_t pts_hf_rhh_tests[] = {
|
|||||||
// TEST_SEQUENCE(TC_HF_RHH_BV_08_I)
|
// TEST_SEQUENCE(TC_HF_RHH_BV_08_I)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
const char * TC_HF_ISSUES_BVRA_01[] = {
|
||||||
|
};
|
||||||
|
|
||||||
|
hfp_test_item_t pts_hf_issues_tests[] = {
|
||||||
|
TEST_SEQUENCE(TC_HF_ISSUES_BVRA_01),
|
||||||
|
};
|
||||||
|
|
||||||
|
hfp_test_item_t pts_ag_issues_tests[] = {
|
||||||
|
};
|
||||||
/////////
|
/////////
|
||||||
static int test_item_size = sizeof(hfp_test_item_t);
|
static int test_item_size = sizeof(hfp_test_item_t);
|
||||||
|
|
||||||
@ -4168,4 +4178,8 @@ hfp_test_item_t * hfp_pts_ag_rhh_tests(void){ return pts_ag_rhh_tests;}
|
|||||||
int hfp_pts_hf_rhh_tests_size(void){ return sizeof(pts_hf_rhh_tests)/test_item_size;}
|
int hfp_pts_hf_rhh_tests_size(void){ return sizeof(pts_hf_rhh_tests)/test_item_size;}
|
||||||
hfp_test_item_t * hfp_pts_hf_rhh_tests(void){ return pts_hf_rhh_tests;}
|
hfp_test_item_t * hfp_pts_hf_rhh_tests(void){ return pts_hf_rhh_tests;}
|
||||||
|
|
||||||
|
// HFP Issues
|
||||||
|
int hfp_pts_ag_issues_tests_size(void){ return sizeof(pts_ag_issues_tests)/test_item_size;}
|
||||||
|
hfp_test_item_t * hfp_pts_ag_issues_tests(void){ return pts_ag_issues_tests;}
|
||||||
|
int hfp_pts_hf_issues_tests_size(void){ return sizeof(pts_hf_issues_tests)/test_item_size;}
|
||||||
|
hfp_test_item_t * hfp_pts_hf_issues_tests(void){ return pts_hf_issues_tests;}
|
||||||
|
@ -97,6 +97,12 @@ hfp_test_item_t * hfp_pts_ag_rhh_tests();
|
|||||||
int hfp_pts_hf_rhh_tests_size();
|
int hfp_pts_hf_rhh_tests_size();
|
||||||
hfp_test_item_t * hfp_pts_hf_rhh_tests();
|
hfp_test_item_t * hfp_pts_hf_rhh_tests();
|
||||||
|
|
||||||
|
/* Test sequences - Issues Group */
|
||||||
|
int hfp_pts_ag_issues_tests_size();
|
||||||
|
hfp_test_item_t * hfp_pts_ag_issues_tests();
|
||||||
|
int hfp_pts_hf_issues_tests_size();
|
||||||
|
hfp_test_item_t * hfp_pts_hf_issues_tests();
|
||||||
|
|
||||||
#if defined __cplusplus
|
#if defined __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user