summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorClaudio Takahasi <claudio.takahasi@openbossa.org>2013-04-23 14:21:42 -0300
committerDenis Kenzior <denkenz@gmail.com>2013-04-23 10:28:46 -0500
commitcf6dce3445290ee96015d9d524e90a588c4b9bc4 (patch)
tree3228117b82183f55eea99238480c0281c55a7de0 /drivers
parentc90b7032897deddb74fcb6cbf6b6dfd62c1fc417 (diff)
hfpmodem: Add EchoCancelingNoiseReduction
This patch adds echo canceling and noise reduction implementation to hfpmodem. It adds the implementation to send the command "AT+NREC=0" to the AG.
Diffstat (limited to 'drivers')
-rw-r--r--drivers/hfpmodem/handsfree.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/drivers/hfpmodem/handsfree.c b/drivers/hfpmodem/handsfree.c
index ce28de3d..78ee8017 100644
--- a/drivers/hfpmodem/handsfree.c
+++ b/drivers/hfpmodem/handsfree.c
@@ -260,12 +260,29 @@ static void hfp_voice_recognition(struct ofono_handsfree *hf,
CALLBACK_WITH_FAILURE(cb, data);
}
+static void hfp_disable_nrec(struct ofono_handsfree *hf,
+ ofono_handsfree_cb_t cb, void *data)
+{
+ struct hf_data *hd = ofono_handsfree_get_data(hf);
+ struct cb_data *cbd = cb_data_new(cb, data);
+ const char *buf = "AT+NREC=0";
+
+ if (g_at_chat_send(hd->chat, buf, NULL, hf_generic_set_cb,
+ cbd, g_free) > 0)
+ return;
+
+ g_free(cbd);
+
+ CALLBACK_WITH_FAILURE(cb, data);
+}
+
static struct ofono_handsfree_driver driver = {
.name = "hfpmodem",
.probe = hfp_handsfree_probe,
.remove = hfp_handsfree_remove,
.request_phone_number = hfp_request_phone_number,
.voice_recognition = hfp_voice_recognition,
+ .disable_nrec = hfp_disable_nrec,
};
void hfp_handsfree_init(void)