Commit Graph

356 Commits

Author SHA1 Message Date
Michał Narajowski
2c2164f557 monitor: Refactor print_enable function 2017-08-08 14:18:10 +03:00
Michał Narajowski
68a6da9966 monitor: Rename Directed Advertising Timeout
In Bluetooth 5.0 spec this error code is named "Advertising Timeout"
2017-08-08 14:18:10 +03:00
Michał Narajowski
cd851d6dd4 monitor: Add support for missing error codes
These codes were added in Bluetooth 5
2017-08-08 14:18:10 +03:00
Michał Narajowski
fc4b7be18f monitor: Fix connection latency decoding
Connection Latency is a number, not time
2017-08-08 14:18:10 +03:00
Michał Narajowski
7c3d284503 monitor: Add LE Set Privacy Mode decoding
< HCI Command: LE Set Privacy Mode (0x08|0x004e) plen 8
        Peer Identity address type: Random (0x01)
        Peer Identity address: 01:01:01:01:01:01 (Non-Resolvable)
        Privacy Mode: Use Device Privacy (0x01)
2017-08-08 14:18:10 +03:00
Michał Narajowski
fb681b2fc5 monitor: Add LE RF commands decoding
This patch adds decoding for following commands:

LE Read Transmit Power
LE Read RF Path Compensation
LE Write RF Path Compensation

< HCI Command: LE Write RF Path Compensation (0x08|0x004d) plen 4
        RF Tx Path Compensation Value: 0x0201
        RF Rx Path Compensation Value: 0x0403
2017-08-08 14:18:10 +03:00
Michał Narajowski
3074b371c5 monitor: Add LE Periodic Advertising commands decoding
This patch adds decoding for following commands:

LE Periodic Advertising Create Sync
LE Periodic Advertising Create Sync Cancel
LE Periodic Advertising Terminate Sync
LE Add Device To Periodic Advertiser List
LE Remove Device From Periodic Advertiser List
LE Clear Periodic Advertiser List
LE Read Periodic Advertiser List Size

< HCI Command: LE Periodic Advertising Create Sync (0x08|0x0044) plen 14
        Filter policy: Use Periodic Advertiser List (0x01)
        SID: 0x02
        Adv address type: Random (0x01)
        Adv address: 00:00:00:00:00:00 (Non-Resolvable)
        Skip: 0x0201
        Sync timeout: 30 msec (0x0003)
        Unused: 0x0a

< HCI Command: LE Periodic Advertising Terminate Sync (0x08|0x0046) plen 2
        Sync handle: 0x0201

< HCI Command: LE Add Device To Periodic Advertiser List (0x08|0x0047) plen 8
        Adv address type: Random (0x01)
        Adv address: 07:06:05:04:03:02 (Non-Resolvable)
        SID: 0x08

< HCI Command: LE Add Device To Periodic Advertiser List (0x08|0x0047) plen 8
        Adv address type: Random (0x01)
        Adv address: 07:06:05:04:03:02 (Non-Resolvable)
        SID: 0x08
2017-08-08 14:18:10 +03:00
Michał Narajowski
e29ef3b851 monitor: Add LE Extended Scan commands decoding
This patch adds decoding for following commands:

LE Set Extended Scan Parameters
LE Set Extended Scan Enable
LE Extended Create Connection
LE Extended Advertising Report Event

< HCI Command: LE Set Extended Scan Parameters (0x08|0x0041) plen 13
        Own address type: Public (0x00)
        Filter policy: Accept all advertisement (0x00)
        PHYs: 0x05
        Entry 0: LE 1M
          Type: Active (0x01)
          Interval: 30.000 msec (0x0030)
          Window: 30.000 msec (0x0030)
        Entry 1: LE Coded
          Type: Active (0x01)
          Interval: 30.000 msec (0x0030)
          Window: 30.000 msec (0x0030)

< HCI Command: LE Set Extended Scan Enable (0x08|0x0042) plen 6
        Extended scan: Enabled (0x01)
        Filter duplicates: Disabled (0x00)
        Duration: 0 msec (0x0000)
        Period: 0.00 sec (0x0000)

< HCI Command: LE Extended Create Connection (0x08|0x0043) plen 29
        Filter policy: White list is not used (0x00)
        Own address type: Public (0x00)
        Peer address type: Public (0x00)
        Peer address: 11:22:33:C0:DE:C0 (OUI 11-22-33)
        Initiating PHYs: 0x04
        Entry 0: LE Coded
          Scan interval: 10.000 msec (0x0010)
          Scan window: 10.000 msec (0x0010)
          Min connection interval: 30.00 msec (0x0018)
          Max connection interval: 50.00 msec (0x0028)
          Connection latency: 0 (0x0000)
          Supervision timeout: 2560 msec (0x0100)
          Min connection length: 10.000 msec (0x0010)
          Max connection length: 480.000 msec (0x0300)
2017-08-08 14:18:10 +03:00
Michał Narajowski
61563bd7b4 monitor: Add LE Set Periodic Advertising commands decoding
This patch adds decoding for following commands:

LE Set Periodic Advertising Parameters
LE Set Periodic Advertising Data
LE Set Periodic Advertising Enable

< HCI Command: LE Set Periodic Advertising Parameters (0x08|0x003e) plen 7
        Handle: 1
        Min interval: 2.50 msec (0x0002)
        Max interval: 318.75 msec (0x00ff)
        Properties: 0x00ff
          Include TxPower
          Unknown advertising properties (0x00bf)

< HCI Command: LE Set Periodic Advertising Data (0x08|0x003f) plen 7
        Handle: 1
        Operation: Last fragment (0x02)
        Data length: 0x04
        ff 00 ff 00                                      ....

< HCI Command: LE Set Periodic Advertising Enable (0x08|0x0040) plen 2
        Periodic advertising: Enabled (0x01)
        Handle: 2
2017-08-08 14:18:10 +03:00
Michał Narajowski
3e472a0892 monitor: Add LE Extended Advertising commands decoding
This patch adds decoding for following commands:

LE Set Advertising Set Random Address
LE Set Extended Advertising Parameters
LE Set Extended Advertising Data
LE Set Extended Scan Response Data
LE Set Extended Advertising Enable
LE Read Maximum Advertising Data Length
LE Read Number of Supported Advertising Sets
LE Remove Advertising Set
LE Clear Advertising Sets
LE Advertising Set Terminated Event
LE Scan Request Received Event

< HCI Command: LE Set Advertising Set Random Address (0x08|0x0035) plen 7
        Advertising handle: 0x00
        Advertising random address: 0A:0B:0C:0D:0E:0F (OUI 0A-0B-0C)

< HCI Command: LE Set Extended Advertising Parameters (0x08|0x0036) plen 25
        Handle: 0x00
        Properties: 0x0005
          Connectable
          Directed
        Min advertising interval: 30.000 msec (0x0030)
        Max advertising interval: 60.000 msec (0x0060)
        Channel map: 37, 38, 39 (0x07)
        Own address type: Public (0x00)
        Peer address type: Public (0x00)
        Peer address: 00:11:22:33:44:55 (CIMSYS Inc)
        Filter policy: Allow Scan Request from Any, Allow Connect Request from Any (0x00)
        TX power: 127 dbm (0x7f)
        Primary PHY: LE Coded (0x03)
        Secondary max skip: 0x00
        Secondary PHY: LE Coded (0x03)
        SID: 0x00
        Scan request notifications: Disabled (0x00)

< HCI Command: LE Set Extended Advertising Data (0x08|0x0037) plen 39
        Handle: 0x00
        Operation: Complete extended advertising data (0x03)
        Fragment preference: Fragment all (0x00)
        Data length: 0x23
        16-bit Service UUIDs (partial): 1 entry
          Unknown (0x1234)
        128-bit Service UUIDs (partial): 1 entry
          Vendor specific (0f0e0d0c-0b0a-0908-0706-050403020100)
        Name (short): device-name

< HCI Command: LE Set Extended Scan Response Data (0x08|0x0037) plen 39
        Handle: 0x00
        Operation: Complete extended advertising data (0x03)
        Fragment preference: Fragment all (0x00)
        Data length: 0x23
        16-bit Service UUIDs (partial): 1 entry
          Unknown (0x1234)
        128-bit Service UUIDs (partial): 1 entry
          Vendor specific (0f0e0d0c-0b0a-0908-0706-050403020100)
        Name (short): device-name

< HCI Command: LE Set Extended Advertising Enable (0x08|0x0039) plen 24
        Extended advertising: Enabled (0x01)
        Number of sets: 2 (0x02)
        Entry 0
          Handle: 0xff
          Duration: 0 ms (0x00)
          Max ext adv events: 0
        Entry 1
          Handle: 0x00
          Duration: 0 ms (0x00)
          Max ext adv events: 1

< HCI Command: LE Remove Advertising Set (0x08|0x003c) plen 1
        Handle: 1
2017-08-08 14:18:10 +03:00
Michał Narajowski
dba3ac80d1 monitor: Add LE Enhanced Test commands decoding
This patch adds decoding for following commands:

LE Enhanced Receiver Test
LE Enhanced Transmitter Test

< HCI Command: LE Enhanced Receiver Test (0x08|0x0033) plen 3
        RX channel: 0x01
        PHY: LE 1M (0x01)
        Modulation index: Stable (0x01)

< HCI Command: LE Enhanced Transmitter Test (0x08|0x0034) plen 4
        TX channel frequency: 2402 MHz (0x00)
        Test data length: 255 bytes
        Packet payload: 0x01
        PHY: LE Coded with S=8 (0x03)
2017-08-08 14:18:10 +03:00
Frédéric Dalleau
eebb86a32c monitor: Format URI hash using 8 hex digits
URI hash is a 32 bits value.
2017-07-27 16:02:54 +03:00
Frédéric Dalleau
b8c3fcd3d7 monitor: Fix OOB information bit in mesh oob table
The bit 15 should be used for 'On device'.
2017-07-27 16:02:54 +03:00
Luiz Augusto von Dentz
23f7d0f12e monitor: Add basic decoding for Mesh Data
This adds basic decoding for Mesh Data packets such as:

> HCI Event: LE Meta Event (0x3e) plen 43
      LE Advertising Report (0x02)
        Num reports: 1
        Event type: Non connectable undirected - ADV_NONCONN_IND (0x03)
        Address type: Random (0x01)
        Address: 29:3C:CE:85:C7:3D (Non-Resolvable)
        Data length: 31
        Mesh Data: 37cb3a2bdfca0783b10833cfbdc9e691b0d58b2dada00269181477c901
          IV: 1
          NID: 0x1b
        RSSI: -28 dBm (0xe4)
2017-07-21 14:31:59 +03:00
Luiz Augusto von Dentz
ad0cdbc1e9 monitor: Add basic decoding for Mesh Provisioning
This adds basic decoding for Mesh Provisioning packets such as:

< HCI Command: LE Set Advertising Data (0x08|0x0008) plen 32
        Length: 24
        Mesh Provision: 024874cb0003dddd0000000000000000000000000000
          Link ID: 0x024874cb
          Transaction Number: 0
          Provisioning Bearer Control (0x03)
          Link Open (0x00)
          Device UUID: 03dddd00000000000000000000000000

> HCI Event: LE Meta Event (0x3e) plen 20
      LE Advertising Report (0x02)
        Num reports: 1
        Event type: Non connectable undirected - ADV_NONCONN_IND (0x03)
        Address type: Random (0x01)
        Address: 34:11:85:DC:41:39 (Non-Resolvable)
        Data length: 8
        Mesh Provision: 024874cb0007
          Link ID: 0x024874cb
          Transaction Number: 0
          Provisioning Bearer Control (0x03)
          Link Ack (0x01)
        RSSI: -28 dBm (0xe4)
2017-07-21 14:31:59 +03:00
Luiz Augusto von Dentz
0ba12681f3 monitor: Add basic decoding for Mesh Beacon
This adds basic decoding for Mesh Beacon packets such as:

> HCI Event: LE Meta Event (0x3e) plen 37
      LE Advertising Report (0x02)
        Num reports: 1
        Event type: Non connectable undirected - ADV_NONCONN_IND (0x03)
        Address type: Random (0x01)
        Address: 36:47:34:FC:63:DA (Non-Resolvable)
        Data length: 25
        Mesh Beacon: 00dddd0000000000000000000000000000000000000000
          Unprovisioned Device Beacon (0x00)
          Device UUID: dddd00000000000000000000000000
          OOB Information: 0x0000
          URI Hash: 0x0000
        RSSI: -28 dBm (0xe4)

< HCI Command: LE Set Advertising Data (0x08|0x0008) plen 32
        Length: 24
        Mesh Beacon: 0100c7005d732329eadf000000003e60e50797ef6d5c
          Secure Network Beacon (0x01)
          Flags: 0x01
          Network Id: 00c7005d732329ea
          IV Index: 0xdf000000
          Authentication Value: 003e60e50797ef6d
2017-07-21 14:31:59 +03:00
Luiz Augusto von Dentz
092f75d83d monitor: Add AD/EIR types for mesh
Print out mesh type and payload:

> HCI Event: LE Meta Event (0x3e) plen 33
      LE Advertising Report (0x02)
        Num reports: 1
        Event type: Non connectable undirected - ADV_NONCONN_IND (0x03)
        Address type: Random (0x01)
        Address: 29:D0:F2:61:17:B0 (Non-Resolvable)
        Data length: 21
        Mesh Data: 59a7ddee2e1f580463521b98c40c2a3b5086c6
        RSSI: -72 dBm (0xb8)
2017-07-21 14:31:59 +03:00
Marcel Holtmann
7e19bfdbb6 monitor: Add missing UUID and EIR definitions 2017-06-22 23:48:28 +02: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
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
Marcel Holtmann
028a319166 monitor: Add HCI commands and events for Bluetooth 5.0 2017-01-30 01:30:41 -08:00
Marcel Holtmann
d71b2618df monitor: Add Bluetooth 5.0 features and version information 2017-01-29 21:34:25 -08: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