diff options
author | Ravi Nagarajan <nravi@broadcom.com> | 2012-03-27 20:10:19 +0530 |
---|---|---|
committer | Matthew Xie <mattx@google.com> | 2012-07-14 11:19:13 -0700 |
commit | f2b7dab37bdd8736b9ffb2b8e99e77236850b81c (patch) | |
tree | 534fdf9bd61f13613d79d572024d67e0901823aa /btif/src | |
parent | 793a50c94f27855c9ed8a7a4f8df4c64eb6d4ef5 (diff) | |
download | external_bluetooth_bluedroid-f2b7dab37bdd8736b9ffb2b8e99e77236850b81c.zip external_bluetooth_bluedroid-f2b7dab37bdd8736b9ffb2b8e99e77236850b81c.tar.gz external_bluetooth_bluedroid-f2b7dab37bdd8736b9ffb2b8e99e77236850b81c.tar.bz2 |
Add support for Voice Recognition. Stack will verify that the peer supports VR prior to sending VR events. Additionally, response to BVRA from headset will come from the app
Change-Id: Id00897e92277fec1e8f8f1cdd0596c4435b76e1d
Diffstat (limited to 'btif/src')
-rw-r--r-- | btif/src/btif_hf.c | 38 |
1 files changed, 26 insertions, 12 deletions
diff --git a/btif/src/btif_hf.c b/btif/src/btif_hf.c index 0df79f4..ddc4a14 100644 --- a/btif/src/btif_hf.c +++ b/btif/src/btif_hf.c @@ -571,15 +571,22 @@ static bt_status_t start_voice_recognition() CHECK_BTHF_INIT(); if (is_connected(NULL)) { - tBTA_AG_RES_DATA ag_res; - memset(&ag_res, 0, sizeof(ag_res)); - ag_res.state = 1; - BTA_AgResult (btif_hf_cb.handle, BTA_AG_BVRA_RES, &ag_res); + if (btif_hf_cb.peer_feat & BTA_AG_PEER_FEAT_VREC) + { + tBTA_AG_RES_DATA ag_res; + memset(&ag_res, 0, sizeof(ag_res)); + ag_res.state = 1; + BTA_AgResult (btif_hf_cb.handle, BTA_AG_BVRA_RES, &ag_res); - return BT_STATUS_SUCCESS; + return BT_STATUS_SUCCESS; + } + else + { + return BT_STATUS_UNSUPPORTED; + } } - return BT_STATUS_FAIL; + return BT_STATUS_NOT_READY; } /******************************************************************************* @@ -597,15 +604,22 @@ static bt_status_t stop_voice_recognition() if (is_connected(NULL)) { - tBTA_AG_RES_DATA ag_res; - memset(&ag_res, 0, sizeof(ag_res)); - ag_res.state = 0; - BTA_AgResult (btif_hf_cb.handle, BTA_AG_BVRA_RES, &ag_res); + if (btif_hf_cb.peer_feat & BTA_AG_PEER_FEAT_VREC) + { + tBTA_AG_RES_DATA ag_res; + memset(&ag_res, 0, sizeof(ag_res)); + ag_res.state = 0; + BTA_AgResult (btif_hf_cb.handle, BTA_AG_BVRA_RES, &ag_res); - return BT_STATUS_SUCCESS; + return BT_STATUS_SUCCESS; + } + else + { + return BT_STATUS_UNSUPPORTED; + } } - return BT_STATUS_FAIL; + return BT_STATUS_NOT_READY; } /******************************************************************************* |