mirror of
https://git.kernel.org/pub/scm/bluetooth/bluez.git
synced 2024-11-23 12:14:26 +08:00
android/hal-pan: Add implementation of .get_local_role
This commit is contained in:
parent
ab2a0efba8
commit
209f302f7b
@ -297,6 +297,11 @@ struct hal_cmd_pan_enable {
|
||||
uint8_t local_role;
|
||||
} __attribute__((packed));
|
||||
|
||||
#define HAL_OP_PAN_GET_ROLE 0x02
|
||||
struct hal_rsp_pan_get_role {
|
||||
uint8_t local_role;
|
||||
} __attribute__((packed));
|
||||
|
||||
/* Notifications and confirmations */
|
||||
|
||||
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user