diff --git a/android/hal-av.c b/android/hal-av.c
index 051fc3e..4fb37a2 100644
--- a/android/hal-av.c
+++ b/android/hal-av.c
#include "hal-log.h"
#include "hal.h"
+#include "hal-msg.h"
static const btav_callbacks_t *cbs = NULL;
return cbs != NULL;
}
+static void handle_connection_state(void *buf)
+{
+ struct hal_ev_av_connection_state *ev = buf;
+
+ if (cbs->connection_state_cb)
+ cbs->connection_state_cb(ev->state,
+ (bt_bdaddr_t *) (ev->bdaddr));
+}
+
/* will be called from notification thread context */
void bt_notify_av(uint16_t opcode, void *buf, uint16_t len)
{
return;
switch (opcode) {
+ case HAL_EV_AV_CONNECTION_STATE:
+ handle_connection_state(buf);
+ break;
default:
DBG("Unhandled callback opcode=0x%x", opcode);
break;
diff --git a/android/hal-msg.h b/android/hal-msg.h
index 8edd0ce..a7c961e 100644
--- a/android/hal-msg.h
+++ b/android/hal-msg.h
uint8_t status;
uint16_t num_packets;
} __attribute__((packed));
+
+#define HAL_EV_AV_CONNECTION_STATE 0x81
+struct hal_ev_av_connection_state {
+ uint8_t state;
+ uint8_t bdaddr[6];
+} __attribute__((packed));