From bbe400718b0d461435405b459273cde7919d472b Mon Sep 17 00:00:00 2001 From: Szymon Janc Date: Tue, 11 Mar 2014 10:25:05 +0100 Subject: [PATCH] android/handsfree: Add support for AT+CCWA command --- android/handsfree.c | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/android/handsfree.c b/android/handsfree.c index 9422dd9f6..210673a0a 100644 --- a/android/handsfree.c +++ b/android/handsfree.c @@ -113,6 +113,7 @@ static struct { uint32_t features; bool clip_enabled; bool cmee_enabled; + bool ccwa_enabled; bool indicators_enabled; struct indicator inds[IND_COUNT]; guint ring; @@ -463,9 +464,28 @@ static void at_cmd_d(struct hfp_gw_result *result, enum hfp_gw_cmd_type type, static void at_cmd_ccwa(struct hfp_gw_result *result, enum hfp_gw_cmd_type type, void *user_data) { + unsigned int val; + DBG(""); - /* TODO */ + switch (type) { + case HFP_GW_CMD_TYPE_SET: + if (!hfp_gw_result_get_number(result, &val) || val > 1) + break; + + if (hfp_gw_result_has_next(result)) + break; + + device.ccwa_enabled = val; + + hfp_gw_send_result(device.gw, HFP_RESULT_OK); + + return; + case HFP_GW_CMD_TYPE_READ: + case HFP_GW_CMD_TYPE_TEST: + case HFP_GW_CMD_TYPE_COMMAND: + break; + } hfp_gw_send_result(device.gw, HFP_RESULT_ERROR); } -- 2.47.3