mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-04-07 16:20:19 +00:00
avrcp_controller: sent interim notification only once, as initial value
This commit is contained in:
parent
367e3c559c
commit
dac572e657
@ -553,6 +553,8 @@ typedef struct {
|
||||
bool press_and_hold_cmd_release;
|
||||
|
||||
uint16_t notifications_enabled;
|
||||
uint16_t initial_status_reported;
|
||||
|
||||
uint16_t notifications_to_register;
|
||||
uint16_t notifications_to_deregister;
|
||||
uint8_t notifications_transaction_label[AVRCP_NOTIFICATION_EVENT_MAX_VALUE+1];
|
||||
|
@ -664,10 +664,15 @@ avrcp_controller_handle_notification(avrcp_connection_t *connection, avrcp_comma
|
||||
avrcp_notification_event_id_t event_id = (avrcp_notification_event_id_t) payload[pos++];
|
||||
uint16_t event_mask = (1 << event_id);
|
||||
uint16_t reset_event_mask = ~event_mask;
|
||||
|
||||
switch (ctype){
|
||||
case AVRCP_CTYPE_RESPONSE_INTERIM:
|
||||
// register as enabled
|
||||
connection->notifications_enabled |= event_mask;
|
||||
if ( (connection->initial_status_reported & event_mask) > 0 ){
|
||||
return;
|
||||
}
|
||||
connection->initial_status_reported |= event_mask;
|
||||
break;
|
||||
case AVRCP_CTYPE_RESPONSE_CHANGED_STABLE:
|
||||
// received change, event is considered deregistered
|
||||
|
Loading…
x
Reference in New Issue
Block a user