mirror of
https://git.kernel.org/pub/scm/bluetooth/bluez.git
synced 2024-11-27 06:04:32 +08:00
android/hal: Add support for handling av audio state event
This commit is contained in:
parent
7bca531f62
commit
c737af9301
@ -38,6 +38,14 @@ static void handle_connection_state(void *buf)
|
||||
(bt_bdaddr_t *) (ev->bdaddr));
|
||||
}
|
||||
|
||||
static void handle_audio_state(void *buf)
|
||||
{
|
||||
struct hal_ev_av_audio_state *ev = buf;
|
||||
|
||||
if (cbs->audio_state_cb)
|
||||
cbs->audio_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)
|
||||
{
|
||||
@ -48,6 +56,9 @@ void bt_notify_av(uint16_t opcode, void *buf, uint16_t len)
|
||||
case HAL_EV_AV_CONNECTION_STATE:
|
||||
handle_connection_state(buf);
|
||||
break;
|
||||
case HAL_EV_AV_AUDIO_STATE:
|
||||
handle_audio_state(buf);
|
||||
break;
|
||||
default:
|
||||
DBG("Unhandled callback opcode=0x%x", opcode);
|
||||
break;
|
||||
|
@ -370,3 +370,9 @@ struct hal_ev_av_connection_state {
|
||||
uint8_t state;
|
||||
uint8_t bdaddr[6];
|
||||
} __attribute__((packed));
|
||||
|
||||
#define HAL_EV_AV_AUDIO_STATE 0x82
|
||||
struct hal_ev_av_audio_state {
|
||||
uint8_t state;
|
||||
uint8_t bdaddr[6];
|
||||
} __attribute__((packed));
|
||||
|
Loading…
Reference in New Issue
Block a user