diff --git a/android/hal-av.c b/android/hal-av.c
index b70a071..6b04f87 100644
--- a/android/hal-av.c
+++ b/android/hal-av.c
#include <stdbool.h>
#include <stddef.h>
+#include <string.h>
#include "hal-log.h"
#include "hal.h"
#include "hal-msg.h"
+#include "hal-ipc.h"
static const btav_callbacks_t *cbs = NULL;
static bt_status_t av_connect(bt_bdaddr_t *bd_addr)
{
+ struct hal_op_av_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));
- return BT_STATUS_UNSUPPORTED;
+ return hal_ipc_cmd(HAL_SERVICE_ID_A2DP, HAL_OP_AV_CONNECT,
+ sizeof(cmd), &cmd, NULL, NULL, NULL);
}
static bt_status_t av_disconnect(bt_bdaddr_t *bd_addr)
diff --git a/android/hal-msg.h b/android/hal-msg.h
index ced24b9..d556762 100644
--- a/android/hal-msg.h
+++ b/android/hal-msg.h
uint8_t bdaddr[6];
} __attribute__((packed));
+#define HAL_OP_AV_CONNECT 0x01
+struct hal_op_av_connect {
+ uint8_t bdaddr[6];
+} __attribute__((packed));
+
/* Notifications and confirmations */