From 1c7f9bee6776fae6e3f2bfdaefd4ef754a4a68eb Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Thu, 19 Nov 2015 22:20:19 +0100 Subject: [PATCH] add hfp_ag_set_battery_level --- src/hfp_ag.c | 6 ++++++ src/hfp_ag.h | 5 +++++ test/pts/hfp_ag_test.c | 11 +++++++++++ 3 files changed, 22 insertions(+) diff --git a/src/hfp_ag.c b/src/hfp_ag.c index dc610b497..349e6a820 100644 --- a/src/hfp_ag.c +++ b/src/hfp_ag.c @@ -1093,3 +1093,9 @@ void hfp_ag_set_roaming_status(int status){ hfp_ag_set_ag_indicator("roam", status); } +/* + * @brief + */ +void hfp_ag_set_battery_level(int level){ + hfp_ag_set_ag_indicator("battchg", level); +} diff --git a/src/hfp_ag.h b/src/hfp_ag.h index 7971897bb..ac00a9c99 100644 --- a/src/hfp_ag.h +++ b/src/hfp_ag.h @@ -215,6 +215,11 @@ void hfp_ag_set_signal_strength(int strength); */ void hfp_ag_set_roaming_status(int status); +/* + * @brief + */ +void hfp_ag_set_battery_level(int level); + /* API_END */ #if defined __cplusplus diff --git a/test/pts/hfp_ag_test.c b/test/pts/hfp_ag_test.c index 2f5a58a2f..5b206125f 100644 --- a/test/pts/hfp_ag_test.c +++ b/test/pts/hfp_ag_test.c @@ -135,6 +135,9 @@ static void show_usage(void){ printf("h - Disable roaming\n"); printf("H - Enable roaming\n"); + printf("i - Set battery level to 3\n"); + printf("I - Set battery level to 5\n"); + printf("t - terminate connection\n"); printf("---\n"); @@ -211,6 +214,14 @@ static int stdin_process(struct data_source *ds){ printf("Enable roaming\n"); hfp_ag_set_roaming_status(1); break; + case 'i': + printf("Set battery level to 3\n"); + hfp_ag_set_battery_level(3); + break; + case 'I': + printf("Set battery level to 5\n"); + hfp_ag_set_battery_level(5); + break; case 'r': printf("Disable in-band ring tone\n"); hfp_ag_set_use_in_band_ring_tone(0);