audio/avrcp: Fix not always requesting capabilities
Luiz Augusto von Dentz
maintainerPATCH 1/3 audio/avrcp: Fix not always requesting capabilities
From: Luiz Augusto von Dentz <[email protected]>
This fixes not requesting capabilities of targets that are not player category, instead just make the creation of the player object conditional to the category 1 so that GetCapabities is still sent in order to fetch the supported events which might be still useful even without a player.
--- profiles/audio/avrcp.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-)
profiles/audio/avrcp.c +5 -6
@@ -3843,12 +3843,11 @@ static void controller_init(struct avrcp *session)btd_service_connecting_complete (service,0 );/* Only create player if category 1 is supported */ -if (!(controller->features &AVRCP_FEATURE_CATEGORY_1 )) -return ; - - player =create_ct_player (session,0 ); -if (player ==NULL ) -return ; +if (controller->features &AVRCP_FEATURE_CATEGORY_1 ) { + player =create_ct_player (session,0 ); +if (player ==NULL ) +return ; + }if (controller->version <0x0103 )return ;
Signature · 1 line
2.5.0
Luiz Augusto von Dentz
maintainerPATCH 2/3 monitor/avctp: Print <empty> if folder lenght is 0
From: Luiz Augusto von Dentz <[email protected]>
This is a bit more clear that is was not a parsing error but just that there is nothing to print:
Quoted 1 line
ACL Data RX: Handle 256 flags
0x02dlen 39
Channel: 68 len 35 ctrl 0x0304 [PSM 27 mode 3] {chan 4}
I-frame: Unsegmented TxSeq 2 ReqSeq 3
AVCTP Browsing: Response: type 0x00 label 2 PID 0x110e
AVRCP: SetBrowsedPlayer: len 0x0019
Status: 0x04 (Success)
UIDCounter: 0x0000 (0)
Number of Items: 0x00000002 (2)
CharsetID: 0x006a (UTF-8)
Folder Depth: 0x01 (1)
Folder: <empty>
---
monitor/avctp.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)monitor/avctp.c +6 -1
@@ -2430,7 +2430,12 @@ response:if (!l2cap_frame_get_u8 (frame, &len))return false; -printf ("Folder: " ); +if (!len) { +print_field ("%*cFolder: <empty>" , indent,' ' ); +continue ; + } + +printf ("%*cFolder: " , indent+8 ,' ' );for (; len >0 ; len--) {uint8_t c;
Signature · 1 line
2.5.0
Luiz Augusto von Dentz
maintainerPATCH 3/3 audio/avrcp: Don't print an error if folder length is 0
In reply to Luiz Augusto von DentzFrom: Luiz Augusto von Dentz <[email protected]>
Some stacks, for instance iOS, does actually send 0 as folder length so just ignore if that happens since that means only means the folder doesn't have a name.
--- profiles/audio/avrcp.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
profiles/audio/avrcp.c +3 -1
@@ -2655,8 +2655,10 @@ static gboolean avrcp_set_browsed_player_rsp(struct avctp *conn,uint8_t len; len = pdu->params[i++]; +if (!len) +continue ; -if (i + len > operand_count || len ==0 ) { +if (i + len > operand_count) {error ("Invalid folder length" );break ; }
Signature · 1 line
2.5.0
Luiz Augusto von Dentz
maintainerHi,
Quoted 34 lines · Luiz Augusto von Dentz
From: Luiz Augusto von Dentz <[email protected]>
This fixes not requesting capabilities of targets that are not player category, instead just make the creation of the player object conditional to the category 1 so that GetCapabities is still sent in order to fetch the supported events which might be still useful even without a player.
--- profiles/audio/avrcp.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-)profiles/audio/avrcp.c +5
-7@@ -3843,12 +3843,11 @@ static void controller_init(struct avrcp *session)btd_service_connecting_complete (service,0 );/* Only create player if category 1 is supported */ -if (!(controller->features &AVRCP_FEATURE_CATEGORY_1 )) -return ; - - player =create_ct_player (session,0 ); -if (player ==NULL ) -return ; +if (controller->features &AVRCP_FEATURE_CATEGORY_1 ) { + player =create_ct_player (session,0 ); +if (player ==NULL ) +return ; + }if (controller->version <0x0103 )return ; --
Quoted 1 line
2.5.0
Pushed.
Signature · 1 line
Luiz Augusto von Dentz