Commit Graph

13393 Commits

Author SHA1 Message Date
Luiz Augusto von Dentz
03bdfd7e20 hcidump: Fix parsing SetBrowsedPlayer as AV/C pdu
As per AVRCP specification 1.4 page 32 the command type of
SetBrowsedPlayer is Browsing, so move it to browsing channel.

In addition to that pass the avctp header to avrcp_dump as it is
required to identify if the frame is a command or response.
2012-12-17 23:53:07 +01:00
Luiz Augusto von Dentz
43332c110c hcidump: Add initial support for browsing channel 2012-12-17 23:53:07 +01:00
Luiz Augusto von Dentz
5a3471312a hcidump: Fix parsing of SetAddressedPlayer PDU 2012-12-17 23:53:07 +01:00
Andrei Emeltchenko
0f73dfe2fa hcidump: clean l2cap chan create/move dump
Print psm as hex, add "chan" to create, move req/rsp.
2012-12-17 23:53:07 +01:00
Andrei Emeltchenko
517242fa2f hcidump: Fix printing link handle
Print logical link handle as 0x%4.4x and physical link handle
as 0x%2.2x
2012-12-17 23:53:07 +01:00
Luiz Augusto von Dentz
9570a4fd6f hcidump: Fix not printing new line when parsing AddressedPlayerChanged 2012-12-17 23:53:07 +01:00
Andrzej Kaczmarek
c0a3a46f52 hcidump: Fix EIR data parsing
Data passed to ext_inquiry_data_dump are expected to start with length
octet which was consumed by get_u8.
2012-12-17 23:53:07 +01:00
Andrei Emeltchenko
ab9e1b69b8 hcidump: Add decoding AMP Assoc data in write_remote_amp_assoc
Use amp_assoc_dump in write_remote_amp_assoc HCI command
2012-12-17 23:53:07 +01:00
Luiz Augusto von Dentz
f84bd3ecf9 hcidump: Add parsing for SetBrowsedPlayer PDU 2012-12-17 23:53:07 +01:00
Luiz Augusto von Dentz
da21424467 hcidump: Add support for Addressed Player Changed event 2012-12-17 23:53:07 +01:00
Luiz Augusto von Dentz
09caa6c815 hcidump: Add parsing for SetAddressedPlayer PDU 2012-12-17 23:53:07 +01:00
Andrei Emeltchenko
1935fd4bc0 hcidump: Add decoding AMP Assoc data in HCI parser 2012-12-17 23:53:07 +01:00
Andrei Emeltchenko
07f4c5a7c8 hcidump: Make assoc dump function available for HCI parser
AMP Assoc dump will be used also for HCI dump functions
2012-12-17 23:53:07 +01:00
Andrei Emeltchenko
87a9433519 hcidump: Fix number of triplet calculation
Country code is also included in the TLV size.
2012-12-17 23:53:07 +01:00
Andrei Emeltchenko
4ecc73e0a9 hcidump: Decode A2MP Get AMP Assoc rsp
Adds decoding Assoc data:

...
> ACL data: handle 11 flags 0x02 dlen 53
    A2MP: Get AMP Assoc rsp: id 1 status (0) Success
      Assoc data [len 39]:
        MAC: <address>
        Preferred Chan List number of triplets 4
          Country code: XXX
          Reg ext id 201 reg class 254 coverage class 0
          Channel 1 max power 20
          Channels 2 - 12 max power 20
          Channels 4 - 8 max power 0
        PAL CAP: 00 00 00 00
        PAL VER: 01 Comp ID: <id> SubVer: 0001
...
2012-12-17 23:53:06 +01:00
Andrei Emeltchenko
4fcd79e885 hcidump: Fix "length" name for A2MP Assoc log 2012-12-17 23:53:06 +01:00
Andrzej Kaczmarek
b16402549f hcidump: Add support for passing RFCOMM channel for SAP 2012-12-17 23:53:06 +01:00
Andrzej Kaczmarek
81f1cc278d hcidump: Add parameters parsing support for SAP PDU 2012-12-17 23:53:06 +01:00
Andrzej Kaczmarek
47e1e43d42 hcidump: Add basic SAP parsing 2012-12-17 23:53:06 +01:00
Luiz Augusto von Dentz
e6e209fa66 hcidump: Add parsing support for Volume Change notification 2012-12-17 23:53:06 +01:00
Luiz Augusto von Dentz
d8371526db hcidump: Add parsing for SetAbsoluteVolume PDU 2012-12-17 23:53:06 +01:00
Peter Krystad
4bab2a92fd hcidump: Minor indentation cleanup and fix display of physical link key 2012-12-17 23:53:06 +01:00
Peter Krystad
36aa01044c hcidump: Add parsing of A2MP signals 2012-12-17 23:53:06 +01:00
Peter Krystad
6d4724ad8f hcidump: Add parsing of L2CAP Create/Move Channel signals 2012-12-17 23:53:06 +01:00
Luiz Augusto von Dentz
2de2281d1c hcidump: Add support for passing PSM as OBEX port
As OBEX can now use L2CAP as transport, -O/--obex option should accept
values other than RFCOMM channel, so values over 31 are now interpreted
as PSM.
2012-12-17 23:53:06 +01:00
Luiz Augusto von Dentz
46b5e712d2 hcidump: add L2CAP OBEX support 2012-12-17 23:53:06 +01:00
Johan Hedberg
fa2a4934b1 hcidump: Fix UUID-128 parsing
ATT UUIDs are in little-endian format (in contrast to e.g. SDP).
2012-12-17 23:53:06 +01:00
Andrei Emeltchenko
6ad329e4d2 hcidump: Decode fixed channel list info rsp
Decode fixed channels in information response

< ACL data: handle 1 flags 0x00 dlen 10
    L2CAP(s): Info req: type 3
> ACL data: handle 1 flags 0x02 dlen 20
    L2CAP(s): Info rsp: type 3 result 0
      Fixed channel list 0x0000000a
        L2CAP Signalling Channel
        AMP Manager Protocol
2012-12-17 23:53:06 +01:00
Martin Xu
78df2696c7 hcidump: Fix HCI event string lookup table
According to Core_v4.0 LE Meta Event Event Code is 0x3E, While Physical
Link Complete Event Code is 0x40 So add Unknown after LE Meta Event.
2012-12-17 23:53:06 +01:00
Andre Guedes
6e58f66d30 hcidump: Fix EIR parsing in evt_le_advertising_report_dump
Only the first EIR data structure from the LE advertising report
event is dumped. This patch fix this, so all EIR data structure
present in that event is dumped.
2012-12-17 23:53:06 +01:00
Johan Hedberg
a48d9dedf2 hcidump: Fix crash with invalid L2CAP frame sizes
Reported by Jukka Taimisto <jukka.taimisto@codenomicon.com>
2012-12-17 23:53:05 +01:00
Johan Hedberg
4f44cff537 hcidump: fix format for 16-bit values 2012-12-17 23:53:05 +01:00
Andrei Emeltchenko
892832d5d9 hcidump: Parse extended control field in L2CAP
Adds support for parsing extended control field. Extended control field
may be used for ERTM and streaming mode (if EWS specified). ext_ctrl
flag resides in cid table. This also fixes P-bit decoding.
2012-12-17 23:53:05 +01:00
Andrei Emeltchenko
aa0bb7fbff hcidump: Remove magic numbers in L2CAP decoding 2012-12-17 23:53:05 +01:00
Andre Guedes
3595dbf2ea hcidump: LE Connection Complete Event dump
Print Peer Address and Peer Address Type parameters from LE
Connection Complete Event.
2012-12-17 23:53:05 +01:00
Lucas De Marchi
cb9780d051 hcidump: Fix parser of AVRCP continuing messages
If packet_type is not START or SINGLE, we have to continue where we
stopped from previous packet. Therefore we must store where we left on
previous packet due to packet size limit. We store both the number of
attributes missing and the lenght of the last attribute that is missing.

An example interaction for this implementation, obtained with PTS test
TC_TG_MDI_BV_04_C (I reduced the MTU in order to reproduce it here and
values between brackets I added now):

> AVCTP: Command : pt 0x00 transaction 2 pid 0x110e
    AV/C: Status: address 0x48 opcode 0x00
      Subunit: Panel
      Opcode: Vendor Dependent
      Company ID: 0x001958
      AVRCP: GetElementAttributes: pt Single len 0x0009
        Identifier: 0x0 (PLAYING)
        AttributeCount: 0x00
< AVCTP: Response : pt 0x00 transaction 2 pid 0x110e
    AV/C: Stable: address 0x48 opcode 0x00
      Subunit: Panel
      Opcode: Vendor Dependent
      Company ID: 0x001958
      AVRCP: GetElementAttributes: pt Start len 0x0118
        AttributeCount: 0x04
        Attribute: 0x00000001 (Title)
        CharsetID: 0x006a (UTF-8)
        AttributeValueLength: 0x001b
        AttributeValue: isso eh um titulo mei longo
        Attribute: 0x00000003 (Album)
        CharsetID: 0x006a (UTF-8)
        AttributeValueLength: 0x00fe
	AttributeValue: super-long-album-name super-long-album-name
	super-long-album-name super-long-album-name super-long-album
	super-long-album-name [... snip... ] super-long-album-name-1234
> AVCTP: Command : pt 0x00 transaction 2 pid 0x110e
    AV/C: Control: address 0x48 opcode 0x00
      Subunit: Panel
      Opcode: Vendor Dependent
      Company ID: 0x001958
      AVRCP: RequestContinuingResponse: pt Single len 0x0001
< AVCTP: Response : pt 0x00 transaction 2 pid 0x110e
    AV/C: Stable: address 0x48 opcode 0x00
      Subunit: Panel
      Opcode: Vendor Dependent
      Company ID: 0x001958
      AVRCP: GetElementAttributes: pt End len 0x002a
        ContinuingAttributeValue: 678900000000000000
        Attribute: 0x00000005 (Track Total)
        CharsetID: 0x006a (UTF-8)
        AttributeValueLength: 0x0002
        AttributeValue: 30
        Attribute: 0x00000006 (Genre)
        CharsetID: 0x006a (UTF-8)
        AttributeValueLength: 0x0006
        AttributeValue: Gospel
2012-12-17 23:53:05 +01:00
Lucas De Marchi
9af28350c1 hcidump: fix name of metadata field
Metadata field number 0x7 should be the track duration and not the
progress of the track playback. Thus rename it to a better description.
2012-12-17 23:53:05 +01:00
Andrei Emeltchenko
c248aae99d hcidump: Decode extended window size option 2012-12-17 23:53:05 +01:00
Marcel Holtmann
dc2bd913f7 hcidump: Change includes to use local copy of Bluetooth library 2012-12-17 23:53:05 +01:00
Johan Hedberg
e81819850c hcidump: Fix whitespace in l2cap.c 2012-12-17 23:53:05 +01:00
Peter Hurley
7183515196 hcidump: Fix L2CAP cid matching
If multiple ACL connections are using identical cid values, the L2CAP
parser will match the first avail cid found in the cid table. This
error often leads to incorrect psm determination, and thus incorrect
parsing of higher-layer frames.

When searching the cid table, a matching cid value must match by
ACL handle as well.
2012-12-17 23:53:05 +01:00
Syam Sidhardhan
69fd98a822 hcidump: Add support for parsing SRM headers 2012-12-17 23:53:05 +01:00
Lucas De Marchi
219b139e9a hcidump: Fix response for GetCurrentPlayerApplicationSettingValue
According to AVRCP spec there's no player id in response.
2012-12-17 23:53:05 +01:00
Luiz Augusto von Dentz
9a6cda25fa hcidump: Add parsing for AVRCP RegisterNotification PDU 2012-12-17 23:53:05 +01:00
Luiz Augusto von Dentz
930854c3ee hcidump: Add parsing for AVRCP GetPlayStatus PDU 2012-12-17 23:53:05 +01:00
Luiz Augusto von Dentz
1f095278b2 hcidump: Add parsing for AVRCP GetElementAttributes PDU 2012-12-17 23:53:05 +01:00
Luiz Augusto von Dentz
b8cb072358 hcidump: Add parsing for AVRCP InformBatteryStatusOfCT PDU 2012-12-17 23:53:04 +01:00
Luiz Augusto von Dentz
c8f6b6b2b7 hcidump: Add parsing for AVRCP InformDisplayableCharacterSet PDU 2012-12-17 23:53:04 +01:00
Luiz Augusto von Dentz
86eb8b3956 hcidump: Add parsing for AVRCP GetPlayerApplicationSettingValueText PDU 2012-12-17 23:53:04 +01:00
Luiz Augusto von Dentz
34d926d3bc hcidump: Add parsing for AVRCP GetPlayerApplicationSettingAttributeText PDU 2012-12-17 23:53:04 +01:00