From 9b67ebb0e6e8e8d3cf9c6d2518a2ffefb30cc172 Mon Sep 17 00:00:00 2001 From: Grzegorz Kolodziejczyk Date: Fri, 25 Oct 2013 17:52:03 +0200 Subject: [PATCH] android/hal: Add skeleton for handling av notifications Only default case is handled in skeleton --- android/hal-av.c | 13 +++++++++++++ android/hal-ipc.c | 3 +++ android/hal.h | 1 + 3 files changed, 17 insertions(+) diff --git a/android/hal-av.c b/android/hal-av.c index 0fe1b74a8..051fc3ef0 100644 --- a/android/hal-av.c +++ b/android/hal-av.c @@ -28,6 +28,19 @@ static bool interface_ready(void) return cbs != NULL; } +/* will be called from notification thread context */ +void bt_notify_av(uint16_t opcode, void *buf, uint16_t len) +{ + if (!interface_ready()) + return; + + switch (opcode) { + default: + DBG("Unhandled callback opcode=0x%x", opcode); + break; + } +} + static bt_status_t av_connect(bt_bdaddr_t *bd_addr) { DBG(""); diff --git a/android/hal-ipc.c b/android/hal-ipc.c index 57238410d..f68e789c4 100644 --- a/android/hal-ipc.c +++ b/android/hal-ipc.c @@ -49,6 +49,9 @@ static void notification_dispatch(struct hal_hdr *msg, int fd) case HAL_SERVICE_ID_BLUETOOTH: bt_notify_adapter(msg->opcode, msg->payload, msg->len); break; + case HAL_SERVICE_ID_A2DP: + bt_notify_av(msg->opcode, msg->payload, msg->len); + break; default: DBG("Unhandled notification service=%d opcode=0x%x", msg->service_id, msg->opcode); diff --git a/android/hal.h b/android/hal.h index 5cd5cabf7..a377649c0 100644 --- a/android/hal.h +++ b/android/hal.h @@ -29,3 +29,4 @@ btav_interface_t *bt_get_av_interface(void); void bt_notify_adapter(uint16_t opcode, void *buf, uint16_t len); void bt_thread_associate(void); void bt_thread_disassociate(void); +void bt_notify_av(uint16_t opcode, void *buf, uint16_t len); -- 2.11.0