Commit Graph

771 Commits

Author SHA1 Message Date
Grzegorz Kolodziejczyk
ffc0888857 monitor/avdtp: Correct bit mask for TSEP
According to AVDP specification 1.3 (8.6.2 Stream End Point Discovery
Response), TSEP bit is on 3rd position of 3rd frame byte.
2017-06-10 21:18:52 +02:00
Marcel Holtmann
0f791b0cc6 monitor: Add Broadcom controller features decoding 2017-06-10 05:23:45 -07:00
Marcel Holtmann
c2713b607e monitor: Change decoding for channel selection algorithm event 2017-05-02 00:45:54 -07:00
Marcel Holtmann
eb129aaf50 monitor: Fix handling of Set Default PHY command complete event 2017-05-01 22:53:27 -07:00
Marcel Holtmann
fbf4a060e8 monitor: Fix parameter indentation for PHY commands 2017-05-01 22:19:28 -07:00
Luiz Augusto von Dentz
008093fc1c monitor: Add option -A/--a2dp to dump A2DP stream data
This is similar to SCO which disable audio dumping by default so only
signalling data is shown:

< ACL Data TX: Handle 256 flags 0x02 dlen 850      #6041 11:32:29.299212
      Channel: 451 len 846 [PSM 25 mode 0] {chan 2}
2017-04-26 11:33:16 +03:00
Luiz Augusto von Dentz
657ca31b90 monitor: Fix not decoding control frames
In order to enable decoding control frames packet_monitor needs to check
if the index is set to HCI_DEV_NONE since that will call packet_ctrl_open
which setups the ctrl and assign it a cookie.
2017-04-23 23:14:24 +03:00
Luiz Augusto von Dentz
9425f19364 monitor: Add frame counter support
This adds frame counter support for io frames:

> HCI Event: Command Complete (0x0e) plen 4         	#86 [hci1] 13:00:02.639412
      LE Set Scan Parameters (0x08|0x000b) ncmd 1
        Status: Success (0x00)
< HCI Command: LE Set Scan Enable (0x08|0x000c) plen 2  #87 [hci1] 13:00:02.639663
        Scanning: Enabled (0x01)
        Filter duplicates: Enabled (0x01)
> HCI Event: Command Complete (0x0e) plen 4             #88 [hci1] 13:00:02.640420
      LE Set Scan Enable (0x08|0x000c) ncmd 2
        Status: Success (0x00)
2017-04-23 23:14:23 +03:00
Łukasz Rymanowski
677a3456af monitor: Add LE PHY update complete event decoding 2017-04-19 16:05:19 +02:00
Łukasz Rymanowski
c71c36f036 monitor: Add LE Set PHY decoding
< HCI Command: LE Set PHY (0x08|0x0032) plen 7
        Handle: 1
        All PHYs preference: 0x00
        TX PHYs preference: 0x07
          LE 1M
          LE 2M
          LE Coded
        RX PHYs preference: 0x07
          LE 1M
          LE 2M
          LE Coded
        PHY options preference: S8 coding (0x0002)
2017-04-19 16:05:19 +02:00
Łukasz Rymanowski
c7bd4f9ee6 monitor: Add LE Set default PHY decoding
< HCI Command: LE Set Default PHY (0x08|0x0031) plen 3
        All PHYs preference: 0x00
        TX PHYs preference: 0x07
          LE 1M
          LE 2M
          LE Coded
        RX PHYs preference: 0x0e
          LE 2M
          LE Coded
          Reserved (0x08)

< HCI Command: LE Set Default PHY (0x08|0x0031) plen 3
        All PHYs preference: 0x03
          No TX PHY preference
          No RX PHY preference
        TX PHYs preference: 0x00
        RX PHYs preference: 0x00
2017-04-19 16:05:19 +02:00
Łukasz Rymanowski
1cec19a5e1 monitor: Add LE Read PHY decoding 2017-04-19 16:05:19 +02:00
Łukasz Rymanowski
146756f8a8 monitor: Add description for filter in scan parameters
< HCI Command: LE Set Scan Parameters (0x08|0x000b) plen 7
        Type: Active (0x01)
        Interval: 30.000 msec (0x0030)
        Window: 30.000 msec (0x0030)
        Own address type: Public (0x00)
        Filter policy: Accept all advertisement, inc. directed unresolved RPA (0x02)
2017-04-19 16:05:19 +02:00
Szymon Janc
94eda76033 monitor: Add support for decoding LE Channel Selection Algorithm Event
> HCI Event: LE Meta Event (0x3e) plen 4                     44.589780
      LE Channel Selection Algorithm (0x14)
        Handle: 1
        LE Channel Selection Algorithm #2 (0x01)
2017-04-09 21:36:12 +02:00
Szymon Janc
237e1e52b5 monitor: Add missing error code for LE Connection Response
This adds missing decoding for 0x000b result code.
2017-02-21 14:28:59 +01:00
Szymon Janc
8673a556e9 monitor: Fix LE Connection Response error decoding
"Connection refused - Source CID already allocated" is 0x000a not 0x0010

> ACL Data RX: Handle 76 flags 0x02 dlen 18
      LE L2CAP: LE Connection Response (0x15) ident 7 len 10
        Destination CID: 0
        MTU: 0
        MPS: 0
        Credits: 0
        Result: Connection refused - Source CID already allocated (0x000a)
2017-02-21 14:28:59 +01:00
Marcel Holtmann
028a319166 monitor: Add HCI commands and events for Bluetooth 5.0 2017-01-30 01:30:41 -08:00
Marcel Holtmann
e2a7659cc8 monitor: Add LMP PDUs for Bluetooth 5.0 2017-01-30 01:30:15 -08:00
Marcel Holtmann
4bbda01455 monitor: Add link layer control PDUs for Bluetooth 5.0 2017-01-29 22:23:34 -08:00
Marcel Holtmann
d71b2618df monitor: Add Bluetooth 5.0 features and version information 2017-01-29 21:34:25 -08:00
Luiz Augusto von Dentz
a9c5bb9ff1 monitor: Add UUIDs of BBC micro:bit services
This add the UUID of GATT attributes used in BBC micro:bit services as
specified bellow:

https://lancaster-university.github.io/microbit-docs/resources/bluetooth/bluetooth_profile.html
2017-01-03 15:03:04 +02:00
Miao-chen Chou
32641ce15e monitor/rfcomm: Fix a potential memory access issue for compatibility with LLVM
This patch removes "packed" attribute from the definition of struct rfcomm_rpn
to prevent the access to an unaligned struct member in mmc_rpn(). This patch
also introduces a temp variable in mcc_pn() to prevent unaligned access without
touching the definition of struct rfcomm_pn, since struct rfcomm_pn is used as
a PDU.

error messages from LLVM build:

monitor/rfcomm.c:238:36: error: taking address of packed member 'pm' of class
or structure 'rfcomm_rpn' may result in an unaligned pointer value
[-Werror,-Waddress-of-packed-member]
        if (!l2cap_frame_get_le16(frame, &rpn.pm))
monitor/rfcomm.c:287:36: error: taking address of packed member 'mtu' of class
or structure 'rfcomm_pn' may result in an unaligned pointer value
[-Werror,-Waddress-of-packed-member]
        if (!l2cap_frame_get_le16(frame, &pn.mtu))

Currently there is no corresponding flag in GCC to generate the same error
messages. See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=51628.
2016-12-22 12:42:16 +02:00
Luiz Augusto von Dentz
d884d778d3 monitor/rfcomm: Fix left over packed struct 2016-12-20 11:52:00 +02:00
Johan Hedberg
dbe5c40981 monitor: Remove redundant parentheses 2016-12-17 11:43:10 +02:00
Luiz Augusto von Dentz
452024ba83 monitor/rfcomm: Remove packed attribute from structs
These structs do not represent the raw PDU format thus they don't need
to be the exact same size.
2016-12-16 14:10:11 +02:00
Luiz Augusto von Dentz
c64b4d9e8d monitor/avctp: Fix reading attribute length as 1 octet
Attribute length is actually 2 octets long.
2016-12-09 16:23:04 +02:00
Luiz Augusto von Dentz
1aea87bb34 monitor/avctp: Fix printing variable length names/values
Print variable names/values in a single line.
2016-12-09 16:23:04 +02:00
Johan Hedberg
673c58ff65 monitor: Add decoding of SMP CT2 authentication flag 2016-12-07 22:12:55 +02:00
Szymon Janc
21cfa2e02a monitor: Add support for Set Appearance mgmt command
@ MGMT Command: Set Appearance (0x0043) plen 2        {0x0002}
        Appearance: Blood Pressure (0x0380)
@ MGMT Event: Command Complete (0x0001) plen 3        {0x0002}
      Set Appearance (0x0043) plen 0
        Status: Success (0x00)
2016-09-18 16:11:52 +02:00
Luiz Augusto von Dentz
3aa056ca20 monitor: Print friendly name of UUID 128 bits
This makes btmon print friendly names for UUID 128 bits if they exists:

> HCI Event: LE Meta Event (0x3e) plen 33
      LE Advertising Report (0x02)
        Num reports: 1
        Event type: Connectable undirected - ADV_IND (0x00)
        Address type: Public (0x00)
        Address: 00:1B:DC:07:31:88 (Vencer Co., Ltd.)
        Data length: 21
        Flags: 0x06
          LE General Discoverable Mode
          BR/EDR Not Supported
        128-bit Service UUIDs (complete): 1 entry
          Eddystone Configuration Service (a3c87500-8ed3-4bdf-8a39-a01bebede295)
        RSSI: -30 dBm (0xe2)
2016-09-15 15:52:49 +03:00
Marcel Holtmann
6f8512b8e6 monitor: Deal with user channel open/close notifications 2016-09-01 18:53:27 +02:00
Marcel Holtmann
5599bf01f4 monitor: Disable decoding of control channel and not close it 2016-09-01 18:14:33 +02:00
Marcel Holtmann
4a80373beb monitor: Decode extended controller type information 2016-09-01 18:08:38 +02:00
Marcel Holtmann
92a1173577 monitor: Add support for RAW Open and RAW Close control messages 2016-08-30 04:43:27 +02:00
Marcel Holtmann
ad34a2913c monitor: Remove todo support for management commands and events 2016-08-29 22:18:33 +02:00
Marcel Holtmann
d972ca4a65 monitor: Add support for pairing interaction management commands 2016-08-29 22:18:33 +02:00
Marcel Holtmann
9f2164cf85 monitor: Add support for connection parameter mmanagement commands 2016-08-29 21:50:06 +02:00
Marcel Holtmann
668e9d1528 monitor: Add support for extended controller information feature 2016-08-29 18:55:20 +02:00
Marcel Holtmann
d4977305f7 monitor: Fix Set Privacy management command and missing key field 2016-08-29 18:34:01 +02:00
Marcel Holtmann
1ec263802f monitor: Add support for out-of-band data management commands 2016-08-29 18:31:00 +02:00
Marcel Holtmann
05f16a6010 monitor: Add support static address and other management commands 2016-08-29 06:21:55 +02:00
Marcel Holtmann
5193f335ef monitor: Add support key handling management commands 2016-08-28 18:01:37 +02:00
Marcel Holtmann
3f577b4ed5 monitor: Add support advertising management commands 2016-08-28 16:51:04 +02:00
Marcel Holtmann
2032ce5b0e monitor: Add support UUID and device handling management commands 2016-08-28 05:23:40 +02:00
Marcel Holtmann
be12b1c062 monitor: Add support for handling more management messages 2016-08-28 04:43:29 +02:00
Marcel Holtmann
9910167d1c monitor: Close the mgmt channel if control tracing is available 2016-08-28 04:11:24 +02:00
Marcel Holtmann
eb402d7afa monitor: Handle mgmt address types and unknown responses 2016-08-27 20:51:11 +02:00
Marcel Holtmann
ba176c5e49 monitor: Add initial support for parsing new control messages 2016-08-27 20:25:23 +02:00
Michał Narajowski
c318b332b8 monitor/l2cap: Fix buffer overflow when printing UUIDs
> ACL Data RX: Handle 76 flags 0x02 dlen 18                                                                                                                                                                          [hci0] 22.985107
      ATT: Read By Group Type Response (0x11) len 13
        Attribute data length: 6
        Attribute group list: 2 entries
        Handle range: 0x0001-0x0007
        UUID: Generic Access Profile (0x1800)
        Handle range: 0x0008-0x000b
        UUID: Generic Attribute Profile (0x1801)
< ACL Data TX: Handle 76 flags 0x00 dlen 11                                                                                                                                                                          [hci0] 22.985304
      ATT: Read By Group Type Request (0x10) len 6
        Handle range: 0x000c-0xffff
        Attribute group type: Primary Service (0x2800)
> HCI Event: Number of Completed Packets (0x13) plen 5                                                                                                                                                               [hci0] 23.051113
        Num handles: 1
        Handle: 76
        Count: 1
> ACL Data RX: Handle 76 flags 0x02 dlen 26                                                                                                                                                                          [hci0] 23.115103
      ATT: Read By Group Type Response (0x11) len 21
        Attribute data length: 20
        Attribute group list: 1 entry
        Handle range: 0x000c-0x0010
*** buffer overflow detected ***: monitor/btmon terminated

==14384== Process terminating with default action of signal 6 (SIGABRT)
==14384==    at 0x4E6F418: raise (raise.c:54)
==14384==    by 0x4E71019: abort (abort.c:89)
==14384==    by 0x4EB1729: __libc_message (libc_fatal.c:175)
==14384==    by 0x4F5289B: __fortify_fail (fortify_fail.c:37)
==14384==    by 0x4F5089F: __chk_fail (chk_fail.c:28)
==14384==    by 0x4F4FE08: _IO_str_chk_overflow (vsprintf_chk.c:31)
==14384==    by 0x4EB55DF: _IO_default_xsputn (genops.c:455)
==14384==    by 0x4E87DBF: vfprintf (vfprintf.c:1631)
==14384==    by 0x4F4FE93: __vsprintf_chk (vsprintf_chk.c:82)
==14384==    by 0x4F4FDEC: __sprintf_chk (sprintf_chk.c:31)
==14384==    by 0x422826: sprintf (stdio2.h:33)
==14384==    by 0x422826: print_uuid (l2cap.c:2014)
==14384==    by 0x423373: print_group_list (l2cap.c:2334)
==14384==    by 0x423373: att_read_group_type_rsp (l2cap.c:2348)
2016-08-12 22:48:10 +03:00
Luiz Augusto von Dentz
1040ee7f37 monitor: Remove uuid128_to_str
uuid128_to_str is no longer necessary since all the user have been
converted to use uuidstr_to_str.
2016-07-14 13:08:13 +03:00