mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-01-26 12:35:25 +00:00
implement hfp_ag_set_signal_strength
This commit is contained in:
parent
47850ba16e
commit
15cadb4796
24
src/hfp_ag.c
24
src/hfp_ag.c
@ -1058,13 +1058,10 @@ void hfp_ag_place_a_call_with_phone_number(void){
|
||||
// }
|
||||
}
|
||||
|
||||
/*
|
||||
* @breif
|
||||
*/
|
||||
void hfp_ag_set_registration_status(int status){
|
||||
int indicator_index = get_ag_indicator_index_for_name("service");
|
||||
static void hfp_ag_set_ag_indicator(const char * name, int value){
|
||||
int indicator_index = get_ag_indicator_index_for_name(name);
|
||||
if (indicator_index < 0) return;
|
||||
hfp_ag_indicators[indicator_index].status = status;
|
||||
hfp_ag_indicators[indicator_index].status = value;
|
||||
|
||||
linked_list_iterator_t it;
|
||||
linked_list_iterator_init(&it, hfp_get_connections());
|
||||
@ -1075,3 +1072,18 @@ void hfp_ag_set_registration_status(int status){
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* @brief
|
||||
*/
|
||||
void hfp_ag_set_registration_status(int status){
|
||||
hfp_ag_set_ag_indicator("service", status);
|
||||
}
|
||||
|
||||
/*
|
||||
* @brief
|
||||
*/
|
||||
void hfp_ag_set_signal_strength(int strength){
|
||||
hfp_ag_set_ag_indicator("signal", strength);
|
||||
|
||||
}
|
||||
|
||||
|
@ -201,10 +201,15 @@ void hfp_ag_audio_connection_transfer_towards_ag(bd_addr_t bd_addr);
|
||||
void hfp_ag_place_a_call_with_phone_number(void);
|
||||
|
||||
/*
|
||||
* @breif
|
||||
* @brief
|
||||
*/
|
||||
void hfp_ag_set_registration_status(int status);
|
||||
|
||||
/*
|
||||
* @brief
|
||||
*/
|
||||
void hfp_ag_set_signal_strength(int strength);
|
||||
|
||||
/* API_END */
|
||||
|
||||
#if defined __cplusplus
|
||||
|
@ -129,6 +129,9 @@ static void show_usage(void){
|
||||
printf("f - Disable cellular network\n");
|
||||
printf("F - Enable cellular network\n");
|
||||
|
||||
printf("g - Set signal strength to 0\n");
|
||||
printf("G - Set signal strength to 5\n");
|
||||
|
||||
printf("t - terminate connection\n");
|
||||
|
||||
printf("---\n");
|
||||
@ -189,6 +192,14 @@ static int stdin_process(struct data_source *ds){
|
||||
printf("Enable cellular network\n");
|
||||
hfp_ag_set_registration_status(1);
|
||||
break;
|
||||
case 'g':
|
||||
printf("Set signal strength to 0\n");
|
||||
hfp_ag_set_signal_strength(0);
|
||||
break;
|
||||
case 'G':
|
||||
printf("Set signal strength to 5\n");
|
||||
hfp_ag_set_signal_strength(5);
|
||||
break;
|
||||
case 'r':
|
||||
printf("Disable in-band ring tone\n");
|
||||
hfp_ag_set_use_in_band_ring_tone(0);
|
||||
|
Loading…
x
Reference in New Issue
Block a user