android/hal: Add support for handling av audio state event

This commit is contained in:
Grzegorz Kolodziejczyk 2013-10-25 17:52:05 +02:00 committed by Luiz Augusto von Dentz
parent 7bca531f62
commit c737af9301
2 changed files with 17 additions and 0 deletions

View File

@ -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;

View File

@ -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));