avrcp_controller: sent interim notification only once, as initial value

This commit is contained in:
Milanka Ringwald 2021-10-13 12:02:21 +02:00
parent 367e3c559c
commit dac572e657
2 changed files with 7 additions and 0 deletions

View File

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

View File

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