add commands to set speaker/microphone gain in ag test

This commit is contained in:
Matthias Ringwald 2015-11-25 19:18:08 +01:00
parent c25cc90f4f
commit f78627e315
2 changed files with 34 additions and 0 deletions

View File

@ -1772,6 +1772,7 @@ void hfp_ag_set_microphone_gain(bd_addr_t bd_addr, int gain){
connection->microphone_gain = gain;
connection->send_microphone_gain = 1;
}
hfp_run_for_context(connection);
}
/*
@ -1783,6 +1784,7 @@ void hfp_ag_set_speaker_gain(bd_addr_t bd_addr, int gain){
connection->speaker_gain = gain;
connection->send_speaker_gain = 1;
}
hfp_run_for_context(connection);
}
/*

View File

@ -155,6 +155,14 @@ static void show_usage(void){
printf("n - Disable Voice Regocnition\n");
printf("N - Enable Voice Recognition\n");
printf("o - Set speaker volume to 0 (minimum)\n");
printf("O - Set speaker volume to 9 (default)\n");
printf("p - Set speaker volume to 12 (higher)\n");
printf("P - Set speaker volume to 15 (maximum)\n");
printf("q - Set microphone gain to 9\n");
printf("Q - Set microphone gain to 12\n");
printf("t - terminate connection\n");
printf("---\n");
@ -281,6 +289,30 @@ static int stdin_process(struct data_source *ds){
printf("Enable Voice Recognition\n");
hfp_ag_activate_voice_recognition(device_addr, 1);
break;
case 'o':
printf("Set speaker gain to 0 (minimum)\n");
hfp_ag_set_speaker_gain(device_addr, 0);
break;
case 'O':
printf("Set speaker gain to 9 (default)\n");
hfp_ag_set_speaker_gain(device_addr, 9);
break;
case 'p':
printf("Set speaker gain to 12 (higher)\n");
hfp_ag_set_speaker_gain(device_addr, 12);
break;
case 'P':
printf("Set speaker gain to 15 (maximum)\n");
hfp_ag_set_speaker_gain(device_addr, 15);
break;
case 'q':
printf("Set microphone gain to 9\n");
hfp_ag_set_microphone_gain(device_addr, 9);
break;
case 'Q':
printf("Set microphone gain to 12\n");
hfp_ag_set_microphone_gain(device_addr, 12);
break;
case 'R':
printf("Enable in-band ring tone\n");
hfp_ag_set_use_in_band_ring_tone(1);