diff options
author | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2013-10-28 14:09:04 +0200 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@intel.com> | 2013-10-28 14:42:38 +0200 |
commit | 209f302f7be5a7760e5e941b4f609976715ad778 (patch) | |
tree | ed91812ff76bd34325c21c4577bec9e62219c6ab /android/hal-pan.c | |
parent | ab2a0efba8f5b2c909dced31e2d2e78b7a15b522 (diff) | |
download | bluez-209f302f7be5a7760e5e941b4f609976715ad778.tar.gz |
android/hal-pan: Add implementation of .get_local_role
Diffstat (limited to 'android/hal-pan.c')
-rw-r--r-- | android/hal-pan.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/android/hal-pan.c b/android/hal-pan.c index 8fb2563cd..c8dcdec75 100644 --- a/android/hal-pan.c +++ b/android/hal-pan.c @@ -47,12 +47,21 @@ static bt_status_t pan_enable(int local_role) static int pan_get_local_role(void) { + struct hal_rsp_pan_get_role rsp; + size_t len = sizeof(rsp); + bt_status_t status; + DBG(""); if (!interface_ready()) return BTPAN_ROLE_NONE; - return BTPAN_ROLE_NONE; + status = hal_ipc_cmd(HAL_SERVICE_ID_PAN, HAL_OP_PAN_GET_ROLE, 0, NULL, + &len, &rsp, NULL); + if (status != BT_STATUS_SUCCESS) + return BTPAN_ROLE_NONE; + + return rsp.local_role; } static bt_status_t pan_connect(const bt_bdaddr_t *bd_addr, int local_role, |