This patch adds echo canceling and noise reduction implementation to
hfpmodem.
---
drivers/hfpmodem/handsfree.c | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/drivers/hfpmodem/handsfree.c b/drivers/hfpmodem/handsfree.c
index ce28de3..2b96566 100644
--- a/drivers/hfpmodem/handsfree.c
+++ b/drivers/hfpmodem/handsfree.c
@@ -260,12 +260,32 @@ static void hfp_voice_recognition(struct ofono_handsfree
*hf,
CALLBACK_WITH_FAILURE(cb, data);
}
+static void hfp_echocanceling_noisereduction(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,
+ .echocanceling_noisereduction = hfp_echocanceling_noisereduction,
};
void hfp_handsfree_init(void)
--
1.7.11.7
_______________________________________________
ofono mailing list
[email protected]
https://lists.ofono.org/mailman/listinfo/ofono