Commit Graph

13317 Commits

Author SHA1 Message Date
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
Luiz Augusto von Dentz
6ecede9260 hcidump: Add parsing for AVRCP SetPlayerApplicationSettingValue PDU 2012-12-17 23:53:04 +01:00
Luiz Augusto von Dentz
c6118e73ba hcidump: Add parsing for AVRCP GetCurrentPlayerApplicationSettingValue PDU 2012-12-17 23:53:04 +01:00
Luiz Augusto von Dentz
17fe76287f hcidump: Add parsing for AVRCP ListPlayerApplicationSettingValues PDU 2012-12-17 23:53:04 +01:00
Luiz Augusto von Dentz
e11dc9b16b hcidump: Add parsing for AVRCP ListPlayerApplicationSettingAttributes PDU 2012-12-17 23:53:04 +01:00
Luiz Augusto von Dentz
0d0c2f2b83 hcidump: Add parsing for command type rejected AVRCP responses 2012-12-17 23:53:04 +01:00
Luiz Augusto von Dentz
c3e614f867 hcidump: Don't parse response AVRCP PDU if ctype is NOT_IMPLETED 2012-12-17 23:53:04 +01:00
Andrei Emeltchenko
bb1f5a82df hcidump: Decode extended flow spec option
Decode EFS option in L2CAP configuration packets
2012-12-17 23:53:04 +01:00
Andrei Emeltchenko
c0877ee25e hcidump: Add parsing of L2CAP Info response
Adds parsing L2CAP extended feature mask.

before:
hcidump -r /tmp/info-rsp.cap
HCI sniffer - Bluetooth packet analyzer ver 2.1
btsnoop version: 1 datalink type: 1002
> ACL data: handle 11 flags 0x02 dlen 16
    L2CAP(s): Info rsp: type 2 result 0
      Extended feature mask 0x00b8

after:
src/hcidump -r /tmp/info-rsp.cap
HCI sniffer - Bluetooth packet analyzer ver 2.1
btsnoop version: 1 datalink type: 1002
> ACL data: handle 11 flags 0x02 dlen 16
    L2CAP(s): Info rsp: type 2 result 0
      Extended feature mask 0x00b8
        Enhanced Retransmission mode
        Streaming mode
        FCS Option
        Fixed Channels
2012-12-17 23:53:04 +01:00
Luiz Augusto von Dentz
ac230c6975 hcidump: Add parsing for AVRCP GetCapabilities 2012-12-17 23:53:04 +01:00
Luiz Augusto von Dentz
5f3f8f411e hcidump: Add check to verify AVRCP pdu length matches frame length 2012-12-17 23:53:04 +01:00
Luiz Augusto von Dentz
bbef3891a7 hcidump: Add basic parsing support for AVRCP PDU 2012-12-17 23:53:04 +01:00
Luiz Augusto von Dentz
adf5d953c9 hcidump: Add basic AVRCP parsing
This add support for AV/C Panel passthrough headers
2012-12-17 23:53:04 +01:00
Luiz Augusto von Dentz
34af2e79ad hcidump: Add basic AVCTP parsing 2012-12-17 23:53:03 +01:00
Luiz Augusto von Dentz
851b3fd5c7 hcidump: Add support for OBEX Action command
Add support for parsing OBEX Action command and related headers.
2012-12-17 23:53:03 +01:00
Johan Hedberg
da3149f318 hcidump: Add missing error code descriptions from Core spec. 4.0 2012-12-17 23:53:03 +01:00
Johan Hedberg
396d15b337 hcidump: Fix gcc 4.6 compiler warnings 2012-12-17 23:53:03 +01:00
Luiz Augusto von Dentz
3da0fb3a08 hcidump: Add basic parsing for SMP 2012-12-17 23:53:03 +01:00
Johan Hedberg
3a36ce57d3 hcidump: Fix infinite loop in read by group response parsing 2012-12-17 23:53:03 +01:00
Johan Hedberg
ea8fb0bc76 hcidump: Add ATT parsing for the ATT fixed CID 2012-12-17 23:53:03 +01:00
Iain Hibbert
b8c3c64af3 hcidump: use correct size to copy 'direction' value
frm.in is stored as an uint8_t, so we cannot copy an int there
directly.  use an intermediate variable so that it also works
on big-endian systems.
2012-12-17 23:53:03 +01:00
Andre Dieb Martins
1bf376e950 hcidump: Add parsing for ATT Execute Write command
BT's Core V4.0 document is buggy regarding Execute Write Response, so we'll
leave it out until a proper description is given.
2012-12-17 23:53:03 +01:00
Andre Dieb Martins
245bb41fd5 hcidump: Add parsing for ATT Prepare Write 2012-12-17 23:53:03 +01:00
Andre Dieb Martins
87420ada41 hcidump: Fix handle formatting for ATT Handle Notify 2012-12-17 23:53:03 +01:00
Andre Dieb Martins
c0720bef51 hcidump: Add parsing for ATT Signed Write 2012-12-17 23:53:03 +01:00
Andre Dieb Martins
8c6a10f527 hcidump: Add parsing for ATT Write Command 2012-12-17 23:53:03 +01:00
Andre Dieb Martins
32f993ef21 hcidump: Add parsing for ATT Write Request
Note we do not need extra parsing for ATT Write Response as it only has
one field (opcode).
2012-12-17 23:53:03 +01:00