Return-Path: From: Bharat Panda To: linux-bluetooth@vger.kernel.org Cc: cpgs@samsung.com, Bharat Panda Subject: [PATCH 2/2] audio/avrcp: Handle Addressed Player Changed event Date: Mon, 10 Aug 2015 16:37:41 +0530 Message-id: <1439204861-4716-2-git-send-email-bharat.panda@samsung.com> In-reply-to: <1439204861-4716-1-git-send-email-bharat.panda@samsung.com> References: <1439204861-4716-1-git-send-email-bharat.panda@samsung.com> Sender: linux-bluetooth-owner@vger.kernel.org List-ID: Added AVRCP_EVENT_ADDRESSED_PLAYER_CHANGED to TG supported events. Send response and notify on change in addressed player. AVCTP Control: Response: type 0x00 label 12 PID 0x110e AV/C: Interim: address 0x48 opcode 0x00 Subunit: Panel Opcode: Vendor Dependent Company ID: 0x001958 AVRCP: RegisterNotification pt Single len 0x0005 EventID: 0x0b (EVENT_ADDRESSED_PLAYER_CHANGED) PlayerID: 0x0000 (0) UIDCounter: 0x0000 (0) AVCTP Control: Response: type 0x00 label 3 PID 0x110e AV/C: Interim: address 0x48 opcode 0x00 Subunit: Panel Opcode: Vendor Dependent Company ID: 0x001958 AVRCP: RegisterNotification pt Single len 0x0005 EventID: 0x0b (EVENT_ADDRESSED_PLAYER_CHANGED) PlayerID: 0x0002 (2) UIDCounter: 0x0a8a (2698) --- profiles/audio/avrcp.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/profiles/audio/avrcp.c b/profiles/audio/avrcp.c index 003e978..596a866 100644 --- a/profiles/audio/avrcp.c +++ b/profiles/audio/avrcp.c @@ -676,6 +676,11 @@ void avrcp_player_event(struct avrcp_player *player, uint8_t id, pdu->params[size++] = attr; pdu->params[size++] = val; break; + case AVRCP_EVENT_ADDRESSED_PLAYER_CHANGED: + size = 5; + memcpy(&pdu->params[1], &player->id, sizeof(uint16_t)); + memcpy(&pdu->params[3], &player->uid_counter, sizeof(uint16_t)); + break; case AVRCP_EVENT_AVAILABLE_PLAYERS_CHANGED: size = 1; break; @@ -1496,6 +1501,11 @@ static uint8_t avrcp_handle_register_notification(struct avrcp *session, } break; + case AVRCP_EVENT_ADDRESSED_PLAYER_CHANGED: + len = 5; + memcpy(&pdu->params[1], &player->id, sizeof(uint16_t)); + memcpy(&pdu->params[3], &player->uid_counter, sizeof(uint16_t)); + break; case AVRCP_EVENT_AVAILABLE_PLAYERS_CHANGED: len = 1; break; @@ -3576,6 +3586,7 @@ static void target_init(struct avrcp *session) return; session->supported_events |= + (1 << AVRCP_EVENT_ADDRESSED_PLAYER_CHANGED) | (1 << AVRCP_EVENT_AVAILABLE_PLAYERS_CHANGED); /* Only check capabilities if controller is not supported */ -- 1.9.1