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 .connect
This commit is contained in:
parent
209f302f7b
commit
ca999716d9
@ -302,6 +302,13 @@ struct hal_rsp_pan_get_role {
|
||||
uint8_t local_role;
|
||||
} __attribute__((packed));
|
||||
|
||||
#define HAL_OP_PAN_CONNECT 0x03
|
||||
struct hal_cmd_pan_connect {
|
||||
uint8_t bdaddr[6];
|
||||
uint8_t local_role;
|
||||
uint8_t remote_role;
|
||||
} __attribute__((packed));
|
||||
|
||||
/* Notifications and confirmations */
|
||||
|
||||
|
||||
|
@ -17,6 +17,7 @@
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stddef.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "hal-log.h"
|
||||
#include "hal.h"
|
||||
@ -67,15 +68,19 @@ static int pan_get_local_role(void)
|
||||
static bt_status_t pan_connect(const bt_bdaddr_t *bd_addr, int local_role,
|
||||
int remote_role)
|
||||
{
|
||||
struct hal_cmd_pan_connect cmd;
|
||||
|
||||
DBG("");
|
||||
|
||||
if (!interface_ready())
|
||||
return BT_STATUS_NOT_READY;
|
||||
|
||||
if (!bd_addr)
|
||||
return BT_STATUS_PARM_INVALID;
|
||||
memcpy(cmd.bdaddr, bd_addr, sizeof(cmd.bdaddr));
|
||||
cmd.local_role = local_role;
|
||||
cmd.remote_role = remote_role;
|
||||
|
||||
return BT_STATUS_UNSUPPORTED;
|
||||
return hal_ipc_cmd(HAL_SERVICE_ID_PAN, HAL_OP_PAN_CONNECT,
|
||||
sizeof(cmd), &cmd, 0, NULL, NULL);
|
||||
}
|
||||
|
||||
static bt_status_t pan_disconnect(const bt_bdaddr_t *bd_addr)
|
||||
|
Loading…
Reference in New Issue
Block a user