This patch adds echo canceling and noise reduction implementation to
hfpmodem.
---
 drivers/hfpmodem/handsfree.c | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/drivers/hfpmodem/handsfree.c b/drivers/hfpmodem/handsfree.c
index ce28de3..d7561e7 100644
--- a/drivers/hfpmodem/handsfree.c
+++ b/drivers/hfpmodem/handsfree.c
@@ -260,12 +260,31 @@ static void hfp_voice_recognition(struct ofono_handsfree 
*hf,
        CALLBACK_WITH_FAILURE(cb, data);
 }
 
+static void hfp_nrec(struct ofono_handsfree *hf, ofono_bool_t enabled,
+                               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);
+       char buf[16];
+
+       snprintf(buf, sizeof(buf), "AT+NREC=%d", (int)(enabled));
+
+       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,
+       .nrec                   = hfp_nrec,
 };
 
 void hfp_handsfree_init(void)
-- 
1.7.11.7

_______________________________________________
ofono mailing list
ofono@ofono.org
https://lists.ofono.org/mailman/listinfo/ofono

Reply via email to