All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH BlueZ] monitor/avctp: Decode player features
@ 2015-10-12 14:24 Luiz Augusto von Dentz
  2015-10-12 14:44 ` Johan Hedberg
  0 siblings, 1 reply; 2+ messages in thread
From: Luiz Augusto von Dentz @ 2015-10-12 14:24 UTC (permalink / raw)
  To: linux-bluetooth

From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

This decodes the bits related to browsing channel which is useful to
debug:

> ACL Data RX: Handle 256 flags 0x02 dlen 68
      Channel: 69 len 64 ctrl 0x0100 [PSM 27 mode 3] {chan 5}
      I-frame: Unsegmented TxSeq 0 ReqSeq 1
      AVCTP Browsing: Response: type 0x00 label 0 PID 0x110e
        AVRCP: GetFolderItems: len 0x0036
          Status: 0x04 (Success)
          UIDCounter: 0x0000 (0)
          NumOfItems: 0x0001 (1)
          Item: 0x01 (Media Player)
          Length: 0x002e (46)
          PlayerID: 0x0001 (1)
          PlayerType: 0x0001 (Audio)
          PlayerSubType: 0x00000000 (None)
          PlayStatus: 0x01 (PLAYING)
          Features: 0x00000000003700050000000000000000
            Advanced Control Player: yes
            Browsing: no
            Searching: no
            AddToNowPlaying: no
            Unique UIDs: no
            OnlyBrowsableWhenAddressed: no
            OnlySearchableWhenAddressed: no
            NowPlaying: no
            UIDPersistency: no
---
 monitor/avctp.c | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/monitor/avctp.c b/monitor/avctp.c
index d06640e..ccbfa66 100644
--- a/monitor/avctp.c
+++ b/monitor/avctp.c
@@ -1813,6 +1813,29 @@ response:
 	return true;
 }
 
+
+static void print_features(uint8_t features[16], uint8_t indent)
+{
+	print_field("%*cAdvanced Control Player: %s", indent, ' ',
+				features[7] & (1 << 2) ? "yes" : "no");
+	print_field("%*cBrowsing: %s", indent, ' ',
+				features[7] & (1 << 3) ? "yes" : "no");
+	print_field("%*cSearching: %s", indent, ' ',
+				features[7] & (1 << 4) ? "yes" : "no");
+	print_field("%*cAddToNowPlaying: %s", indent, ' ',
+				features[7] & (1 << 5) ? "yes" : "no");
+	print_field("%*cUnique UIDs: %s", indent, ' ',
+				features[7] & (1 << 6) ? "yes" : "no");
+	print_field("%*cOnlyBrowsableWhenAddressed: %s", indent, ' ',
+				features[7] & (1 << 7) ? "yes" : "no");
+	print_field("%*cOnlySearchableWhenAddressed: %s", indent, ' ',
+				features[8] & (1 << 0) ? "yes" : "no");
+	print_field("%*cNowPlaying: %s", indent, ' ',
+				features[8] & (1 << 1) ? "yes" : "no");
+	print_field("%*cUIDPersistency: %s", indent, ' ',
+				features[8] & (1 << 2) ? "yes" : "no");
+}
+
 static bool avrcp_media_player_item(struct avctp_frame *avctp_frame,
 							uint8_t indent)
 {
@@ -1856,6 +1879,8 @@ static bool avrcp_media_player_item(struct avctp_frame *avctp_frame,
 
 	printf("\n");
 
+	print_features(features, indent + 2);
+
 	if (!l2cap_frame_get_be16(frame, &charset))
 		return false;
 
-- 
2.4.3


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH BlueZ] monitor/avctp: Decode player features
  2015-10-12 14:24 [PATCH BlueZ] monitor/avctp: Decode player features Luiz Augusto von Dentz
@ 2015-10-12 14:44 ` Johan Hedberg
  0 siblings, 0 replies; 2+ messages in thread
From: Johan Hedberg @ 2015-10-12 14:44 UTC (permalink / raw)
  To: Luiz Augusto von Dentz; +Cc: linux-bluetooth

Hi Luiz,

On Mon, Oct 12, 2015, Luiz Augusto von Dentz wrote:
> This decodes the bits related to browsing channel which is useful to
> debug:
> 
> > ACL Data RX: Handle 256 flags 0x02 dlen 68
>       Channel: 69 len 64 ctrl 0x0100 [PSM 27 mode 3] {chan 5}
>       I-frame: Unsegmented TxSeq 0 ReqSeq 1
>       AVCTP Browsing: Response: type 0x00 label 0 PID 0x110e
>         AVRCP: GetFolderItems: len 0x0036
>           Status: 0x04 (Success)
>           UIDCounter: 0x0000 (0)
>           NumOfItems: 0x0001 (1)
>           Item: 0x01 (Media Player)
>           Length: 0x002e (46)
>           PlayerID: 0x0001 (1)
>           PlayerType: 0x0001 (Audio)
>           PlayerSubType: 0x00000000 (None)
>           PlayStatus: 0x01 (PLAYING)
>           Features: 0x00000000003700050000000000000000
>             Advanced Control Player: yes
>             Browsing: no
>             Searching: no
>             AddToNowPlaying: no
>             Unique UIDs: no
>             OnlyBrowsableWhenAddressed: no
>             OnlySearchableWhenAddressed: no
>             NowPlaying: no
>             UIDPersistency: no

I think we want to have this consistent with how it's represented for
other similar supported bits in btmon (e.g. HCI-level features), i.e.
only list the ones supported and print in red any unknown bits.

Johan

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-10-12 14:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-12 14:24 [PATCH BlueZ] monitor/avctp: Decode player features Luiz Augusto von Dentz
2015-10-12 14:44 ` Johan Hedberg

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.