avrcp_target.c (c57adf92cf7b35466b6a9dcf88d8752636f5d9b3) | avrcp_target.c (3e5c3c5b807437b5d987cad94dce8dd88c84a500) |
---|---|
1/* 2 * Copyright (C) 2016 BlueKitchen GmbH 3 * 4 * Redistribution and use in source and binary forms, with or without 5 * modification, are permitted provided that the following conditions 6 * are met: 7 * 8 * 1. Redistributions of source code must retain the above copyright --- 733 unchanged lines hidden (view full) --- 742} 743 744uint8_t avrcp_target_volume_changed(uint16_t avrcp_cid, uint8_t volume_percentage){ 745 avrcp_connection_t * connection = get_avrcp_connection_for_avrcp_cid(AVRCP_TARGET, avrcp_cid); 746 if (!connection){ 747 log_error("avrcp_unit_info: could not find a connection."); 748 return ERROR_CODE_UNKNOWN_CONNECTION_IDENTIFIER; 749 } | 1/* 2 * Copyright (C) 2016 BlueKitchen GmbH 3 * 4 * Redistribution and use in source and binary forms, with or without 5 * modification, are permitted provided that the following conditions 6 * are met: 7 * 8 * 1. Redistributions of source code must retain the above copyright --- 733 unchanged lines hidden (view full) --- 742} 743 744uint8_t avrcp_target_volume_changed(uint16_t avrcp_cid, uint8_t volume_percentage){ 745 avrcp_connection_t * connection = get_avrcp_connection_for_avrcp_cid(AVRCP_TARGET, avrcp_cid); 746 if (!connection){ 747 log_error("avrcp_unit_info: could not find a connection."); 748 return ERROR_CODE_UNKNOWN_CONNECTION_IDENTIFIER; 749 } |
750 // if (connection->volume_percentage == volume_percentage) return ERROR_CODE_SUCCESS; | 750 connection->volume_percentage = volume_percentage; |
751 if (connection->notifications_enabled & (1 << AVRCP_NOTIFICATION_EVENT_VOLUME_CHANGED )) { | 751 if (connection->notifications_enabled & (1 << AVRCP_NOTIFICATION_EVENT_VOLUME_CHANGED )) { |
752 connection->volume_percentage = volume_percentage; | |
753 connection->notify_volume_percentage_changed = 1; 754 avrcp_request_can_send_now(connection, connection->l2cap_signaling_cid); 755 } 756 return ERROR_CODE_SUCCESS; 757} 758 759static void avrcp_target_set_transaction_label_for_notification(avrcp_connection_t * connection, avrcp_notification_event_id_t notification, uint8_t transaction_label){ 760 if (notification > AVRCP_NOTIFICATION_EVENT_MAX_VALUE) return; --- 548 unchanged lines hidden --- | 752 connection->notify_volume_percentage_changed = 1; 753 avrcp_request_can_send_now(connection, connection->l2cap_signaling_cid); 754 } 755 return ERROR_CODE_SUCCESS; 756} 757 758static void avrcp_target_set_transaction_label_for_notification(avrcp_connection_t * connection, avrcp_notification_event_id_t notification, uint8_t transaction_label){ 759 if (notification > AVRCP_NOTIFICATION_EVENT_MAX_VALUE) return; --- 548 unchanged lines hidden --- |