Skip to contentSkip to conversation

LE device automatic pairing

DISCUSSION Tom Harada 2 participants 6 messages May 8, 2015 – May 11, 2015 Bluetooth drivers

lore
Share & tools
lore

Tom Harada

author
#0 lore raw

Hi all,

On a system with kernel 4.0.1 and BlueZ 5.22 or newer, I've noticed that BlueZ seems to be automatically pairing with LE devices as soon as it detects their advertisements. Is this an intended feature? If so, how can I prevent it from happening?

Thanks,
Tom

#1 lore raw

Hi Tom,

Quoted 6 lines · Tom Harada

Hi all,

On a system with kernel 4.0.1 and BlueZ 5.22 or newer, I've noticed that BlueZ seems to be automatically pairing with LE devices as soon as it detects their advertisements. Is this an intended feature? If so, how can I prevent it from happening?

It should be pairing, bluetoothd will create objects for devices found during the scan but they are considered temporary as long as you don't request to connect or pair, if you connect to it will still not be paired but it will be stored persistently in the storage so you can access after restarting bluetoothd.

With this in mind, what had made you believe we were performing pairing during scanning?

Signature · 1 line
Luiz Augusto von Dentz
#2 lore raw

Hi Tom,

Quoted 11 lines · Luiz Augusto von Dentz

Hi Tom,

Quoted 6 lines · Tom Harada

Hi all,

On a system with kernel 4.0.1 and BlueZ 5.22 or newer, I've noticed that BlueZ seems to be automatically pairing with LE devices as soon as it detects their advertisements. Is this an intended feature? If so, how can I prevent it from happening?

It should be pairing, bluetoothd will create objects for devices found

I meant it should not be pairing...

Quoted 11 lines

during the scan but they are considered temporary as long as you don't request to connect or pair, if you connect to it will still not be paired but it will be stored persistently in the storage so you can access after restarting bluetoothd.

With this in mind, what had made you believe we were performing pairing during scanning?

--
Luiz Augusto von Dentz

Signature · 1 line
Luiz Augusto von Dentz
author
#3 lore raw

Hi Luiz,

Quoted 7 lines · Luiz Augusto von Dentz

Hi Tom,

Quoted 3 lines · Luiz Augusto von Dentz

Hi Tom,

On Fri, May 8, 2015 at 5:31 PM, Tom Harada <[email protected]> wrote:

Quoted 16 lines
Quoted 7 lines
Quoted 6 lines

Hi all,

On a system with kernel 4.0.1 and BlueZ 5.22 or newer, I've noticed that BlueZ seems to be automatically pairing with LE devices as soon as it detects their advertisements. Is this an intended feature? If so, how can I prevent it from happening?

It should be pairing, bluetoothd will create objects for devices found

I meant it should not be pairing...

Quoted 7 lines

during the scan but they are considered temporary as long as you don't request to connect or pair, if you connect to it will still not be paired but it will be stored persistently in the storage so you can access after restarting bluetoothd.

With this in mind, what had made you believe we were performing pairing during scanning?

bluetoothctl prints a line like "[CHG] Device 90:59:AF:1D:F4:66 Paired: yes" and reports the device as paired. In other words, it behaves exactly as if I had explicitly requested to pair with the device, except I did no such thing. In btmon, I can see the pairing request taking place, followed by a GATT service discovery. I've attached an example to show what I mean.

Thanks,
Tom

Bluetooth monitor ver 5.30
= New Index: 00:02:72:D9:F9:B6 (BR/EDR,USB,hci0) [hci0] 0.694797
@ Device Unpaired: 90:59:AF:1D:F4:66 (1)
< HCI Command: LE Set Scan Enable (0x08|0x000c) plen 2 [hci0] 4.795343

        Scanning: Disabled (0x00)
        Filter duplicates: Disabled (0x00)
Quoted 1 line

HCI Event: Command Complete (0x0e) plen 4 [hci0] 4.799424

      LE Set Scan Enable (0x08|0x000c) ncmd 1
        Status: Success (0x00)
< HCI Command: LE Set Random Address (0x08|0x0005) plen 6                                           [hci0] 4.799508
        Address: 30:D2:F2:A5:5E:03 (Non-Resolvable)
Quoted 1 line

HCI Event: Command Complete (0x0e) plen 4 [hci0] 4.802328

      LE Set Random Address (0x08|0x0005) ncmd 1
        Status: Success (0x00)
< HCI Command: LE Set Scan Parameters (0x08|0x000b) plen 7                                          [hci0] 4.802431
        Type: Active (0x01)
        Interval: 11.250 msec (0x0012)
        Window: 11.250 msec (0x0012)
        Own address type: Random (0x01)
        Filter policy: Accept all advertisement (0x00)
Quoted 1 line

HCI Event: Command Complete (0x0e) plen 4 [hci0] 4.805323

      LE Set Scan Parameters (0x08|0x000b) ncmd 1
        Status: Success (0x00)
< HCI Command: LE Set Scan Enable (0x08|0x000c) plen 2                                              [hci0] 4.805396
        Scanning: Enabled (0x01)
        Filter duplicates: Enabled (0x01)
Quoted 1 line

HCI Event: Command Complete (0x0e) plen 4 [hci0] 4.808324

      LE Set Scan Enable (0x08|0x000c) ncmd 1
        Status: Success (0x00)

@ Discovering: 0x01 (7)

Quoted 1 line

HCI Event: LE Meta Event (0x3e) plen 19 [hci0] 5.257453

      LE Advertising Report (0x02)
        Num reports: 1
        Event type: Connectable undirected - ADV_IND (0x00)
        Address type: Random (0x01)
        Address: CA:BD:82:82:E1:27 (Static)
        Data length: 7
        Flags: 0x06
          LE General Discoverable Mode
          BR/EDR Not Supported
        16-bit Service UUIDs (complete): 1 entry
          Unknown (0xfeed)
        RSSI: -94 dBm (0xa2)
Quoted 1 line

HCI Event: LE Meta Event (0x3e) plen 12 [hci0] 5.258334

      LE Advertising Report (0x02)
        Num reports: 1
        Event type: Scan response - SCAN_RSP (0x04)
        Address type: Random (0x01)
        Address: CA:BD:82:82:E1:27 (Static)
        Data length: 0
        RSSI: -92 dBm (0xa4)
@ Device Found: CA:BD:82:82:E1:27 (2) rssi -92 flags 0x0000
        02 01 06 03 03 ed fe                             .......         
Quoted 1 line

HCI Event: LE Meta Event (0x3e) plen 25 [hci0] 8.895454

      LE Advertising Report (0x02)
        Num reports: 1
        Event type: Connectable undirected - ADV_IND (0x00)
        Address type: Public (0x00)
        Address: 90:59:AF:1D:F4:66 (Texas Instruments)
        Data length: 13
        Flags: 0x05
          LE Limited Discoverable Mode
          BR/EDR Not Supported
        16-bit Service UUIDs (partial): 1 entry
          Blood Pressure (0x1810)
        Slave Conn. Interval: 0x0050 - 0x00a0
        RSSI: -68 dBm (0xbc)
< HCI Command: LE Set Scan Enable (0x08|0x000c) plen 2                                              [hci0] 8.895547
        Scanning: Disabled (0x00)
        Filter duplicates: Disabled (0x00)
Quoted 1 line

HCI Event: LE Meta Event (0x3e) plen 37 [hci0] 8.898316

      LE Advertising Report (0x02)
        Num reports: 1
        Event type: Scan response - SCAN_RSP (0x04)
        Address type: Public (0x00)
        Address: 90:59:AF:1D:F4:66 (Texas Instruments)
        Data length: 25
        TX power: 0 dBm
        Name (complete): A&D_UA-651BLE_1DF466
        RSSI: -59 dBm (0xc5)
@ Device Found: 90:59:AF:1D:F4:66 (1) rssi -59 flags 0x0000
        02 01 05 03 02 10 18 05 12 50 00 a0 00 02 0a 00  .........P......
        15 09 41 26 44 5f 55 41 2d 36 35 31 42 4c 45 5f  ..A&D_UA-651BLE_
        31 44 46 34 36 36                                1DF466          
Quoted 1 line

HCI Event: Command Complete (0x0e) plen 4 [hci0] 8.899327

      LE Set Scan Enable (0x08|0x000c) ncmd 1
        Status: Success (0x00)
< HCI Command: LE Create Connection (0x08|0x000d) plen 25                                           [hci0] 8.899417
        Scan interval: 60.000 msec (0x0060)
        Scan window: 30.000 msec (0x0030)
        Filter policy: White list is not used (0x00)
        Peer address type: Public (0x00)
        Peer address: 90:59:AF:1D:F4:66 (Texas Instruments)
        Own address type: Public (0x00)
        Min connection interval: 100.00 msec (0x0050)
        Max connection interval: 200.00 msec (0x00a0)
        Connection latency: 0x0000
        Supervision timeout: 6000 msec (0x0258)
        Min connection length: 0.000 msec (0x0000)
        Max connection length: 0.000 msec (0x0000)

@ Discovering: 0x00 (7)

Quoted 1 line

HCI Event: Command Status (0x0f) plen 4 [hci0] 8.902318

      LE Create Connection (0x08|0x000d) ncmd 1
        Status: Success (0x00)
Quoted 1 line

HCI Event: LE Meta Event (0x3e) plen 19 [hci0] 8.920426

      LE Connection Complete (0x01)
        Status: Success (0x00)
        Handle: 64
        Role: Master (0x00)
        Peer address type: Public (0x00)
        Peer address: 90:59:AF:1D:F4:66 (Texas Instruments)
        Connection interval: 198.75 msec (0x009f)
        Connection latency: 0.00 msec (0x0000)
        Supervision timeout: 6000 msec (0x0258)
        Master clock accuracy: 0x05
@ Device Connected: 90:59:AF:1D:F4:66 (1) flags 0x0000
        02 01 05 03 02 10 18 05 12 50 00 a0 00           .........P...   

< ACL Data TX: Handle 64 flags 0x00 dlen 7 [hci0] 8.953603
ATT: Exchange MTU Request (0x02) len 2
Client RX MTU: 517

Quoted 1 line

ACL Data RX: Handle 64 flags 0x02 dlen 6 [hci0] 8.994441

      SMP: Security Request (0x0b) len 1
        Authentication requirement: Bonding, No MITM, Legacy, No Keypresses (0x01)
< ACL Data TX: Handle 64 flags 0x00 dlen 11                                                         [hci0] 8.994535
      SMP: Pairing Request (0x01) len 6
        IO capability: NoInputNoOutput (0x03)
        OOB data: Authentication data not present (0x00)
        Authentication requirement: Bonding, No MITM, Legacy, No Keypresses (0x01)
        Max encryption key size: 16
        Initiator key distribution: EncKey Sign (0x05)
        Responder key distribution: EncKey IdKey Sign (0x07)
Quoted 1 line

HCI Event: Number of Completed Packets (0x13) plen 5 [hci0] 9.173429

Num handles: 1
Handle: 64
Count: 1

Quoted 1 line

ACL Data RX: Handle 64 flags 0x02 dlen 7 [hci0] 9.193265

ATT: Exchange MTU Response (0x03) len 2
Server RX MTU: 23
< ACL Data TX: Handle 64 flags 0x00 dlen 11 [hci0] 9.193603

      ATT: Read By Group Type Request (0x10) len 6
        Handle range: 0x0001-0xffff
        Attribute group type: Primary Service (0x2800)
Quoted 1 line

ACL Data RX: Handle 64 flags 0x02 dlen 11 [hci0] 9.392076

      SMP: Pairing Response (0x02) len 6
        IO capability: NoInputNoOutput (0x03)
        OOB data: Authentication data not present (0x00)
        Authentication requirement: Bonding, No MITM, Legacy, No Keypresses (0x01)
        Max encryption key size: 16
        Initiator key distribution: EncKey Sign (0x05)
        Responder key distribution: EncKey IdKey Sign (0x07)
< ACL Data TX: Handle 64 flags 0x00 dlen 21                                                         [hci0] 9.392167
      SMP: Pairing Confirm (0x03) len 16
        Confim value: 1c07d71586a060f6b3ecbd1f7cd34a1d
Quoted 1 line

HCI Event: Number of Completed Packets (0x13) plen 5 [hci0] 9.393318

Num handles: 1
Handle: 64
Count: 2

Quoted 1 line

ACL Data RX: Handle 64 flags 0x02 dlen 24 [hci0] 9.590958

      ATT: Read By Group Type Response (0x11) len 19
        Attribute data length: 6
        Attribute data list: 3 entries
        Handle: 0x0001
        Value: 0b000018
        Handle: 0x000c
        Value: 0f000118
        Handle: 0x0010
        Value: 17001018
< ACL Data TX: Handle 64 flags 0x00 dlen 11                                                         [hci0] 9.591167
      ATT: Read By Group Type Request (0x10) len 6
        Handle range: 0x0018-0xffff
        Attribute group type: Primary Service (0x2800)
Quoted 1 line

ACL Data RX: Handle 64 flags 0x02 dlen 21 [hci0] 9.789679

      SMP: Pairing Confirm (0x03) len 16
        Confim value: bf417ab96e31ffe86ed12a1b5b8b90e3
< ACL Data TX: Handle 64 flags 0x00 dlen 21                                                         [hci0] 9.789794
      SMP: Pairing Random (0x04) len 16
        Random value: efc135031490c5b84b0a6d483e17678f
Quoted 1 line

HCI Event: Number of Completed Packets (0x13) plen 5 [hci0] 9.790383

Num handles: 1
Handle: 64
Count: 2

Quoted 1 line

ACL Data RX: Handle 64 flags 0x02 dlen 18 [hci0] 9.988394

      ATT: Read By Group Type Response (0x11) len 13
        Attribute data length: 6
        Attribute data list: 2 entries
        Handle: 0x0018
        Value: 28000a18
        Handle: 0x0029
        Value: 2b000f18
< ACL Data TX: Handle 64 flags 0x00 dlen 11                                                         [hci0] 9.988611
      ATT: Read By Group Type Request (0x10) len 6
        Handle range: 0x002c-0xffff
        Attribute group type: Primary Service (0x2800)
Quoted 1 line

HCI Event: Number of Completed Packets (0x13) plen 5 [hci0] 10.173454

Num handles: 1
Handle: 64
Count: 1

Quoted 1 line

ACL Data RX: Handle 64 flags 0x02 dlen 21 [hci0] 10.187125

      SMP: Pairing Random (0x04) len 16
        Random value: 16ca56cf627f7da808e153c502ff93c0
< HCI Command: LE Start Encryption (0x08|0x0019) plen 28                                           [hci0] 10.187232
        Handle: 64
        Random number: 0x0000000000000000
        Encrypted diversifier: 0x0000
        Long term key: f61d9a2927a0fd2bd7d686cb275d9787
Quoted 1 line

HCI Event: Command Status (0x0f) plen 4 [hci0] 10.189323

      LE Start Encryption (0x08|0x0019) ncmd 1
        Status: Success (0x00)
Quoted 1 line

ACL Data RX: Handle 64 flags 0x02 dlen 26 [hci0] 10.386010

      ATT: Read By Group Type Response (0x11) len 21
        Attribute data length: 20
        Attribute data list: 1 entry
        Handle: 0x002c
        Value: ffffe4ab90560d005c976d1b345a00f03b23
< ACL Data TX: Handle 64 flags 0x00 dlen 11                                                        [hci0] 10.386396
      ATT: Read By Group Type Request (0x10) len 6
        Handle range: 0x0001-0xffff
        Attribute group type: Secondary Service (0x2801)
Quoted 1 line

HCI Event: Number of Completed Packets (0x13) plen 5 [hci0] 10.423366

Num handles: 1
Handle: 64
Count: 1

Quoted 1 line

HCI Event: Encryption Change (0x08) plen 4 [hci0] 11.578371

        Status: Success (0x00)
        Handle: 64
        Encryption: Enabled with AES-CCM (0x01)
Quoted 1 line

ACL Data RX: Handle 64 flags 0x02 dlen 21 [hci0] 11.777256

      SMP: Encryption Information (0x06) len 16
        Long term key: a68b1238a58f6278ee6b460e94301d2f
Quoted 1 line

HCI Event: Number of Completed Packets (0x13) plen 5 [hci0] 11.923438

Num handles: 1
Handle: 64
Count: 1

Quoted 1 line

ACL Data RX: Handle 64 flags 0x02 dlen 9 [hci0] 11.975720

      ATT: Error Response (0x01) len 4
        Read By Group Type Request (0x10)
        Handle: 0x0001
        Error: Unsupported Group Type (0x10)
< ACL Data TX: Handle 64 flags 0x00 dlen 11                                                        [hci0] 11.976128
      ATT: Read By Type Request (0x08) len 6
        Handle range: 0x0001-0x000b
        Attribute type: Include (0x2802)
Quoted 1 line

ACL Data RX: Handle 64 flags 0x02 dlen 15 [hci0] 11.976375

      SMP: Master Identification (0x07) len 10
        EDIV: 0x850a
        Rand: 0x816352ffa23ba078
Quoted 1 line

ACL Data RX: Handle 64 flags 0x02 dlen 21 [hci0] 12.174757

      SMP: Identity Information (0x08) len 16
        Identity resolving key: 491b2776b95894322e6c699d1d2ea689
Quoted 1 line

ACL Data RX: Handle 64 flags 0x02 dlen 9 [hci0] 12.373226

      ATT: Error Response (0x01) len 4
        Read By Type Request (0x08)
        Handle: 0x0001
        Error: Attribute Not Found (0x0a)
< ACL Data TX: Handle 64 flags 0x00 dlen 11                                                        [hci0] 12.373598
      ATT: Read By Type Request (0x08) len 6
        Handle range: 0x000c-0x000f
        Attribute type: Include (0x2802)
Quoted 1 line

ACL Data RX: Handle 64 flags 0x02 dlen 12 [hci0] 12.373846

      SMP: Identity Address Information (0x09) len 7
        Address type: Public (0x00)
        Address: 90:59:AF:1D:F4:66
Quoted 1 line

HCI Event: Number of Completed Packets (0x13) plen 5 [hci0] 12.423444

Num handles: 1
Handle: 64
Count: 1

Quoted 1 line

ACL Data RX: Handle 64 flags 0x02 dlen 21 [hci0] 12.572216

      SMP: Signing Information (0x0a) len 16
        Signature key: 3042fc577042d827ca19bf56e4722588
< ACL Data TX: Handle 64 flags 0x00 dlen 21                                                        [hci0] 12.572372
      SMP: Encryption Information (0x06) len 16
        Long term key: 3593dd4b8e4c4e3a986849f04c02b579
< ACL Data TX: Handle 64 flags 0x00 dlen 15                                                        [hci0] 12.572390
      SMP: Master Identification (0x07) len 10
        EDIV: 0x7f39
        Rand: 0x4817fa37512d429f
< ACL Data TX: Handle 64 flags 0x00 dlen 21                                                        [hci0] 12.572393
      SMP: Signing Information (0x0a) len 16
        Signature key: 5d3dbe128926cd44864672369cd6c4e7

@ New IRK: 90:59:AF:1D:F4:66 (1) 00:00:00:00:00:00
@ New CSRK: 90:59:AF:1D:F4:66 (1) Remote Unauthenticated (1) @ New CSRK: 90:59:AF:1D:F4:66 (1) Local Unauthenticated (0) @ New Long Term Key: 90:59:AF:1D:F4:66 (1) Master (Unauthenticated) 0x00 @ New Long Term Key: 90:59:AF:1D:F4:66 (1) Slave (Unauthenticated) 0x00

Quoted 1 line

ACL Data RX: Handle 64 flags 0x02 dlen 9 [hci0] 12.770843

      ATT: Error Response (0x01) len 4
        Read By Type Request (0x08)
        Handle: 0x000c
        Error: Attribute Not Found (0x0a)
< ACL Data TX: Handle 64 flags 0x00 dlen 11                                                        [hci0] 12.771110
      ATT: Read By Type Request (0x08) len 6
        Handle range: 0x0010-0x0017
        Attribute type: Include (0x2802)
Quoted 1 line

HCI Event: Number of Completed Packets (0x13) plen 5 [hci0] 12.771365

Num handles: 1
Handle: 64
Count: 2

Quoted 1 line

HCI Event: Number of Completed Packets (0x13) plen 5 [hci0] 12.772407

Num handles: 1
Handle: 64
Count: 2

Quoted 1 line

ACL Data RX: Handle 64 flags 0x02 dlen 9 [hci0] 13.168327

      ATT: Error Response (0x01) len 4
        Read By Type Request (0x08)
        Handle: 0x0010
        Error: Attribute Not Found (0x0a)
< ACL Data TX: Handle 64 flags 0x00 dlen 11                                                        [hci0] 13.168691
      ATT: Read By Type Request (0x08) len 6
        Handle range: 0x0018-0x0028
        Attribute type: Include (0x2802)
Quoted 1 line

HCI Event: Number of Completed Packets (0x13) plen 5 [hci0] 13.173356

Num handles: 1
Handle: 64
Count: 1

Quoted 1 line

HCI Event: Number of Completed Packets (0x13) plen 5 [hci0] 13.548416

Num handles: 1
Handle: 64
Count: 1

Quoted 1 line

ACL Data RX: Handle 64 flags 0x02 dlen 9 [hci0] 13.565770

      ATT: Error Response (0x01) len 4
        Read By Type Request (0x08)
        Handle: 0x0018
        Error: Attribute Not Found (0x0a)
< ACL Data TX: Handle 64 flags 0x00 dlen 11                                                        [hci0] 13.566115
      ATT: Read By Type Request (0x08) len 6
        Handle range: 0x0029-0x002b
        Attribute type: Include (0x2802)
Quoted 1 line

HCI Event: Number of Completed Packets (0x13) plen 5 [hci0] 13.923450

Num handles: 1
Handle: 64
Count: 1

Quoted 1 line

ACL Data RX: Handle 64 flags 0x02 dlen 9 [hci0] 13.963249

      ATT: Error Response (0x01) len 4
        Read By Type Request (0x08)
        Handle: 0x0029
        Error: Attribute Not Found (0x0a)
< ACL Data TX: Handle 64 flags 0x00 dlen 11                                                        [hci0] 13.963510
      ATT: Read By Type Request (0x08) len 6
        Handle range: 0x002c-0xffff
        Attribute type: Include (0x2802)
Quoted 1 line

HCI Event: Number of Completed Packets (0x13) plen 5 [hci0] 14.299455

Num handles: 1
Handle: 64
Count: 1

Quoted 1 line

ACL Data RX: Handle 64 flags 0x02 dlen 9 [hci0] 14.360804

      ATT: Error Response (0x01) len 4
        Read By Type Request (0x08)
        Handle: 0x002c
        Error: Attribute Not Found (0x0a)
< ACL Data TX: Handle 64 flags 0x00 dlen 11                                                        [hci0] 14.361156
      ATT: Read By Type Request (0x08) len 6
        Handle range: 0x0001-0x000b
        Attribute type: Characteristic (0x2803)
Quoted 1 line

ACL Data RX: Handle 64 flags 0x02 dlen 27 [hci0] 14.758479

      ATT: Read By Type Response (0x09) len 22
        Attribute data length: 7
        Attribute data list: 3 entries
        Handle: 0x0002
        Value: 020300002a
        Handle: 0x0004
        Value: 020500012a
        Handle: 0x0006
        Value: 0a0700022a
< ACL Data TX: Handle 64 flags 0x00 dlen 11                                                        [hci0] 14.758772
      ATT: Read By Type Request (0x08) len 6
        Handle range: 0x0007-0x000b
        Attribute type: Characteristic (0x2803)
Quoted 1 line

HCI Event: Number of Completed Packets (0x13) plen 5 [hci0] 14.799456

Num handles: 1
Handle: 64
Count: 1

Quoted 1 line

ACL Data RX: Handle 64 flags 0x02 dlen 20 [hci0] 15.155844

      ATT: Read By Type Response (0x09) len 15
        Attribute data length: 7
        Attribute data list: 2 entries
        Handle: 0x0008
        Value: 0a0900032a
        Handle: 0x000a
        Value: 020b00042a
< ACL Data TX: Handle 64 flags 0x00 dlen 11                                                        [hci0] 15.156226
      ATT: Read By Type Request (0x08) len 6
        Handle range: 0x000b-0x000b
        Attribute type: Characteristic (0x2803)
Quoted 1 line

HCI Event: Number of Completed Packets (0x13) plen 5 [hci0] 15.174439

Num handles: 1
Handle: 64
Count: 1

Quoted 1 line

HCI Event: Number of Completed Packets (0x13) plen 5 [hci0] 15.549420

Num handles: 1
Handle: 64
Count: 1

Quoted 1 line

ACL Data RX: Handle 64 flags 0x02 dlen 9 [hci0] 15.553286

      ATT: Error Response (0x01) len 4
        Read By Type Request (0x08)
        Handle: 0x000b
        Error: Attribute Not Found (0x0a)
< ACL Data TX: Handle 64 flags 0x00 dlen 11                                                        [hci0] 15.553616
      ATT: Read By Type Request (0x08) len 6
        Handle range: 0x000c-0x000f
        Attribute type: Characteristic (0x2803)
Quoted 1 line

HCI Event: Number of Completed Packets (0x13) plen 5 [hci0] 15.924498

Num handles: 1
Handle: 64
Count: 1

Quoted 1 line

ACL Data RX: Handle 64 flags 0x02 dlen 13 [hci0] 15.950835

      ATT: Read By Type Response (0x09) len 8
        Attribute data length: 7
        Attribute data list: 1 entry
        Handle: 0x000d
        Value: 200e00052a
< ACL Data TX: Handle 64 flags 0x00 dlen 11                                                        [hci0] 15.951199
      ATT: Read By Type Request (0x08) len 6
        Handle range: 0x000e-0x000f
        Attribute type: Characteristic (0x2803)
Quoted 1 line

HCI Event: Number of Completed Packets (0x13) plen 5 [hci0] 16.299444

Num handles: 1
Handle: 64
Count: 1

Quoted 1 line

ACL Data RX: Handle 64 flags 0x02 dlen 9 [hci0] 16.348511

      ATT: Error Response (0x01) len 4
        Read By Type Request (0x08)
        Handle: 0x000e
        Error: Attribute Not Found (0x0a)
< ACL Data TX: Handle 64 flags 0x00 dlen 9                                                         [hci0] 16.348828
      ATT: Find Information Request (0x04) len 4
        Handle range: 0x000f-0x000f
Quoted 1 line

HCI Event: Number of Completed Packets (0x13) plen 5 [hci0] 16.674447

Num handles: 1
Handle: 64
Count: 1

Quoted 1 line

ACL Data RX: Handle 64 flags 0x02 dlen 10 [hci0] 16.745862

      ATT: Find Information Response (0x05) len 5
        Format: UUID-16 (0x01)
        Handle: 0x000f
        UUID: Client Characteristic Configuration (0x2902)
< ACL Data TX: Handle 64 flags 0x00 dlen 11                                                        [hci0] 16.746221
      ATT: Read By Type Request (0x08) len 6
        Handle range: 0x0010-0x0017
        Attribute type: Characteristic (0x2803)
Quoted 1 line

ACL Data RX: Handle 64 flags 0x02 dlen 27 [hci0] 17.143495

      ATT: Read By Type Response (0x09) len 22
        Attribute data length: 7
        Attribute data list: 3 entries
        Handle: 0x0011
        Value: 201200352a
        Handle: 0x0014
        Value: 021500492a
        Handle: 0x0016
        Value: 0a1700082a
< ACL Data TX: Handle 64 flags 0x00 dlen 11                                                        [hci0] 17.143773
      ATT: Read By Type Request (0x08) len 6
        Handle range: 0x0017-0x0017
        Attribute type: Characteristic (0x2803)
Quoted 1 line

HCI Event: Number of Completed Packets (0x13) plen 5 [hci0] 17.174456

Num handles: 1
Handle: 64
Count: 1

Quoted 1 line

ACL Data RX: Handle 64 flags 0x02 dlen 9 [hci0] 17.540829

      ATT: Error Response (0x01) len 4
        Read By Type Request (0x08)
        Handle: 0x0017
        Error: Attribute Not Found (0x0a)
< ACL Data TX: Handle 64 flags 0x00 dlen 9                                                         [hci0] 17.541168
      ATT: Find Information Request (0x04) len 4
        Handle range: 0x0013-0x0013
Quoted 1 line

HCI Event: Number of Completed Packets (0x13) plen 5 [hci0] 17.549345

Num handles: 1
Handle: 64
Count: 1
< HCI Command: LE Set Random Address (0x08|0x0005) plen 6 [hci0] 17.793588

        Address: 02:8A:89:B3:89:B1 (Non-Resolvable)
Quoted 1 line

HCI Event: Command Complete (0x0e) plen 4 [hci0] 17.796358

      LE Set Random Address (0x08|0x0005) ncmd 1
        Status: Success (0x00)
< HCI Command: LE Set Scan Parameters (0x08|0x000b) plen 7                                         [hci0] 17.796436
        Type: Active (0x01)
        Interval: 11.250 msec (0x0012)
        Window: 11.250 msec (0x0012)
        Own address type: Random (0x01)
        Filter policy: Accept all advertisement (0x00)
Quoted 1 line

HCI Event: Command Complete (0x0e) plen 4 [hci0] 17.799309

      LE Set Scan Parameters (0x08|0x000b) ncmd 1
        Status: Success (0x00)
< HCI Command: LE Set Scan Enable (0x08|0x000c) plen 2                                             [hci0] 17.799377
        Scanning: Enabled (0x01)
        Filter duplicates: Enabled (0x01)
Quoted 1 line

HCI Event: Command Complete (0x0e) plen 4 [hci0] 17.802316

      LE Set Scan Enable (0x08|0x000c) ncmd 1
        Status: Success (0x00)

@ Discovering: 0x01 (7)

Quoted 1 line

HCI Event: Number of Completed Packets (0x13) plen 5 [hci0] 17.924484

Num handles: 1
Handle: 64
Count: 1

Quoted 1 line

ACL Data RX: Handle 64 flags 0x02 dlen 10 [hci0] 17.938501

      ATT: Find Information Response (0x05) len 5
        Format: UUID-16 (0x01)
        Handle: 0x0013
        UUID: Client Characteristic Configuration (0x2902)
< ACL Data TX: Handle 64 flags 0x00 dlen 11                                                        [hci0] 17.938830
      ATT: Read By Type Request (0x08) len 6
        Handle range: 0x0018-0x0028
        Attribute type: Characteristic (0x2803)
Quoted 1 line

HCI Event: Number of Completed Packets (0x13) plen 5 [hci0] 18.299396

Num handles: 1
Handle: 64
Count: 1

Quoted 1 line

ACL Data RX: Handle 64 flags 0x02 dlen 27 [hci0] 18.336031

      ATT: Read By Type Response (0x09) len 22
        Attribute data length: 7
        Attribute data list: 3 entries
        Handle: 0x0019
        Value: 021a00292a
        Handle: 0x001b
        Value: 021c00242a
        Handle: 0x001d
        Value: 021e00252a
< ACL Data TX: Handle 64 flags 0x00 dlen 11                                                        [hci0] 18.336193
      ATT: Read By Type Request (0x08) len 6
        Handle range: 0x001e-0x0028
        Attribute type: Characteristic (0x2803)
Quoted 1 line

HCI Event: Number of Completed Packets (0x13) plen 5 [hci0] 18.674441

Num handles: 1
Handle: 64
Count: 1

Quoted 1 line

ACL Data RX: Handle 64 flags 0x02 dlen 27 [hci0] 18.733547

      ATT: Read By Type Response (0x09) len 22
        Attribute data length: 7
        Attribute data list: 3 entries
        Handle: 0x001f
        Value: 022000272a
        Handle: 0x0021
        Value: 022200262a
        Handle: 0x0023
        Value: 022400282a
< ACL Data TX: Handle 64 flags 0x00 dlen 11                                                        [hci0] 18.733817
      ATT: Read By Type Request (0x08) len 6
        Handle range: 0x0024-0x0028
        Attribute type: Characteristic (0x2803)
Quoted 1 line

ACL Data RX: Handle 64 flags 0x02 dlen 20 [hci0] 19.130757

      ATT: Read By Type Response (0x09) len 15
        Attribute data length: 7
        Attribute data list: 2 entries
        Handle: 0x0025
        Value: 022600232a
        Handle: 0x0027
        Value: 0228002a2a
< ACL Data TX: Handle 64 flags 0x00 dlen 11                                                        [hci0] 19.130922
      ATT: Read By Type Request (0x08) len 6
        Handle range: 0x0028-0x0028
        Attribute type: Characteristic (0x2803)
Quoted 1 line

ACL Data RX: Handle 64 flags 0x02 dlen 16 [hci0] 19.131551

LE L2CAP: Connection Parameter Update Request (0x12) ident 1 len 8
Min interval: 80
Max interval: 160
Slave latency: 0
Timeout multiplier: 600
< ACL Data TX: Handle 64 flags 0x00 dlen 10 [hci0] 19.131590

      LE L2CAP: Connection Parameter Update Response (0x13) ident 1 len 2
        Result: Connection Parameters accepted (0x0000)
< HCI Command: LE Connection Update (0x08|0x0013) plen 14                                          [hci0] 19.131600
        Handle: 64
        Min connection interval: 100.00 msec (0x0050)
        Max connection interval: 200.00 msec (0x00a0)
        Connection latency: 0x0000
        Supervision timeout: 6000 msec (0x0258)
        Min connection length: 0.000 msec (0x0000)
        Max connection length: 0.000 msec (0x0000)

@ New Conn Param: 90:59:AF:1D:F4:66 (1) hint 1 min 0x0050 max 0x00a0 latency 0x0000 timeout 0x0258

Quoted 1 line

HCI Event: Command Status (0x0f) plen 4 [hci0] 19.135306

      LE Connection Update (0x08|0x0013) ncmd 1
        Status: Success (0x00)
Quoted 1 line

HCI Event: Number of Completed Packets (0x13) plen 5 [hci0] 19.174443

Num handles: 1
Handle: 64
Count: 1

Quoted 1 line

HCI Event: Number of Completed Packets (0x13) plen 5 [hci0] 19.529395

Num handles: 1
Handle: 64
Count: 2

Quoted 1 line

ACL Data RX: Handle 64 flags 0x02 dlen 9 [hci0] 19.727341

      ATT: Error Response (0x01) len 4
        Read By Type Request (0x08)
        Handle: 0x0028
        Error: Attribute Not Found (0x0a)
< ACL Data TX: Handle 64 flags 0x00 dlen 11                                                        [hci0] 19.727711
      ATT: Read By Type Request (0x08) len 6
        Handle range: 0x0029-0x002b
        Attribute type: Characteristic (0x2803)
Quoted 1 line

ACL Data RX: Handle 64 flags 0x02 dlen 13 [hci0] 20.124737

      ATT: Read By Type Response (0x09) len 8
        Attribute data length: 7
        Attribute data list: 1 entry
        Handle: 0x002a
        Value: 022b00192a
< ACL Data TX: Handle 64 flags 0x00 dlen 11                                                        [hci0] 20.125002
      ATT: Read By Type Request (0x08) len 6
        Handle range: 0x002b-0x002b
        Attribute type: Characteristic (0x2803)
Quoted 1 line

HCI Event: Number of Completed Packets (0x13) plen 5 [hci0] 20.174432

Num handles: 1
Handle: 64
Count: 1

Quoted 1 line

HCI Event: Number of Completed Packets (0x13) plen 5 [hci0] 20.549446

Num handles: 1
Handle: 64
Count: 1

Quoted 1 line

ACL Data RX: Handle 64 flags 0x02 dlen 9 [hci0] 20.721075

      ATT: Error Response (0x01) len 4
        Read By Type Request (0x08)
        Handle: 0x002b
        Error: Attribute Not Found (0x0a)
< ACL Data TX: Handle 64 flags 0x00 dlen 11                                                        [hci0] 20.721281
      ATT: Read By Type Request (0x08) len 6
        Handle range: 0x002c-0xffff
        Attribute type: Characteristic (0x2803)
Quoted 1 line

HCI Event: LE Meta Event (0x3e) plen 10 [hci0] 20.721311

      LE Connection Update Complete (0x03)
        Status: Success (0x00)
        Handle: 64
        Connection interval: 198.75 msec (0x009f)
        Connection latency: 0.00 msec (0x0000)
        Supervision timeout: 6000 msec (0x0258)
Quoted 1 line

HCI Event: Number of Completed Packets (0x13) plen 5 [hci0] 21.049411

Num handles: 1
Handle: 64
Count: 1

Quoted 1 line

ACL Data RX: Handle 64 flags 0x02 dlen 27 [hci0] 21.118599

      ATT: Read By Type Response (0x09) len 22
        Attribute data length: 21
        Attribute data list: 1 entry
        Handle: 0x002d
        Value: 0a2e00e4ab90560d005c976d1b345a01f03b23
< ACL Data TX: Handle 64 flags 0x00 dlen 11                                                        [hci0] 21.118876
      ATT: Read By Type Request (0x08) len 6
        Handle range: 0x002e-0xffff
        Attribute type: Characteristic (0x2803)
Quoted 1 line

ACL Data RX: Handle 64 flags 0x02 dlen 9 [hci0] 21.516111

      ATT: Error Response (0x01) len 4
        Read By Type Request (0x08)
        Handle: 0x002e
        Error: Attribute Not Found (0x0a)
< ACL Data TX: Handle 64 flags 0x00 dlen 9                                                         [hci0] 21.516544
      ATT: Find Information Request (0x04) len 4
        Handle range: 0x002f-0xffff
Quoted 1 line

HCI Event: Number of Completed Packets (0x13) plen 5 [hci0] 21.549419

Num handles: 1
Handle: 64
Count: 1

Quoted 1 line

ACL Data RX: Handle 64 flags 0x02 dlen 9 [hci0] 21.913597

      ATT: Error Response (0x01) len 4
        Find Information Request (0x04)
        Handle: 0x002f
        Error: Attribute Not Found (0x0a)
< ACL Data TX: Handle 64 flags 0x00 dlen 9                                                         [hci0] 21.914086
      ATT: Write Request (0x12) len 4
        Handle: 0x000f
          Data: 0200
Quoted 1 line

HCI Event: Number of Completed Packets (0x13) plen 5 [hci0] 21.924449

Num handles: 1
Handle: 64
Count: 1

Quoted 1 line

HCI Event: Number of Completed Packets (0x13) plen 5 [hci0] 22.299409

Num handles: 1
Handle: 64
Count: 1

Quoted 1 line

ACL Data RX: Handle 64 flags 0x02 dlen 5 [hci0] 22.310999

      ATT: Write Response (0x13) len 0
@ Device Added: 90:59:AF:1D:F4:66 (1) 2
< ACL Data TX: Handle 64 flags 0x00 dlen 9                                                         [hci0] 22.311874
      ATT: Read Blob Request (0x0c) len 4
        Handle: 0x0003
        Offset: 0x0000
Quoted 1 line

HCI Event: Number of Completed Packets (0x13) plen 5 [hci0] 22.674364

Num handles: 1
Handle: 64
Count: 1

Quoted 1 line

ACL Data RX: Handle 64 flags 0x02 dlen 25 [hci0] 22.708640

      ATT: Read Blob Response (0x0d) len 20
        41 26 44 5f 55 41 2d 36 35 31 42 4c 45 5f 31 44  A&D_UA-651BLE_1D
        46 34 36 36                                      F466            
< ACL Data TX: Handle 64 flags 0x00 dlen 7                                                         [hci0] 22.708945
      ATT: Read Request (0x0a) len 2
        Handle: 0x0005
< HCI Command: LE Set Scan Enable (0x08|0x000c) plen 2                                             [hci0] 22.936030
        Scanning: Disabled (0x00)
        Filter duplicates: Disabled (0x00)
Quoted 1 line

HCI Event: Command Complete (0x0e) plen 4 [hci0] 22.939301

      LE Set Scan Enable (0x08|0x000c) ncmd 1
        Status: Success (0x00)
< HCI Command: Inquiry (0x01|0x0001) plen 5                                                        [hci0] 22.939391
        Access code: 0x9e8b33 (General Inquiry)
        Length: 5.12s (0x04)
        Num responses: 0
Quoted 1 line

HCI Event: Command Status (0x0f) plen 4 [hci0] 22.942306

      Inquiry (0x01|0x0001) ncmd 1
        Status: Success (0x00)
Quoted 1 line

HCI Event: Number of Completed Packets (0x13) plen 5 [hci0] 23.049416

Num handles: 1
Handle: 64
Count: 1

Quoted 1 line

ACL Data RX: Handle 64 flags 0x02 dlen 7 [hci0] 23.106130

      ATT: Read Response (0x0b) len 2
        Value: 0000
< ACL Data TX: Handle 64 flags 0x00 dlen 11                                                        [hci0] 23.106390
      ATT: Read By Type Request (0x08) len 6
        Handle range: 0x0018-0x0028
        Attribute type: Characteristic (0x2803)
Quoted 1 line

ACL Data RX: Handle 64 flags 0x02 dlen 27 [hci0] 23.503841

      ATT: Read By Type Response (0x09) len 22
        Attribute data length: 7
        Attribute data list: 3 entries
        Handle: 0x0019
        Value: 021a00292a
        Handle: 0x001b
        Value: 021c00242a
        Handle: 0x001d
        Value: 021e00252a
< ACL Data TX: Handle 64 flags 0x00 dlen 11                                                        [hci0] 23.504248
      ATT: Read By Type Request (0x08) len 6
        Handle range: 0x001e-0x0028
        Attribute type: Characteristic (0x2803)
Quoted 1 line

HCI Event: Number of Completed Packets (0x13) plen 5 [hci0] 23.549384

Num handles: 1
Handle: 64
Count: 1

Quoted 1 line

ACL Data RX: Handle 64 flags 0x02 dlen 27 [hci0] 23.901327

      ATT: Read By Type Response (0x09) len 22
        Attribute data length: 7
        Attribute data list: 3 entries
        Handle: 0x001f
        Value: 022000272a
        Handle: 0x0021
        Value: 022200262a
        Handle: 0x0023
        Value: 022400282a
< ACL Data TX: Handle 64 flags 0x00 dlen 11                                                        [hci0] 23.901681
      ATT: Read By Type Request (0x08) len 6
        Handle range: 0x0024-0x0028
        Attribute type: Characteristic (0x2803)
Quoted 1 line

HCI Event: Number of Completed Packets (0x13) plen 5 [hci0] 23.924453

Num handles: 1
Handle: 64
Count: 1

Quoted 1 line

ACL Data RX: Handle 64 flags 0x02 dlen 20 [hci0] 24.298853

      ATT: Read By Type Response (0x09) len 15
        Attribute data length: 7
        Attribute data list: 2 entries
        Handle: 0x0025
        Value: 022600232a
        Handle: 0x0027
        Value: 0228002a2a
Quoted 1 line

HCI Event: Number of Completed Packets (0x13) plen 5 [hci0] 24.300344

Num handles: 1
Handle: 64
Count: 1

#4 lore raw

Hi Tom,

Quoted 32 lines · Tom Harada

Hi Luiz,

Quoted 28 lines · Luiz Augusto von Dentz

Hi Tom,

Quoted 8 lines · Luiz Augusto von Dentz

Hi Tom,

Quoted 3 lines · Tom Harada

Hi all,

Quoted 7 lines
Quoted 5 lines

On a system with kernel 4.0.1 and BlueZ 5.22 or newer, I've noticed that BlueZ seems to be automatically pairing with LE devices as soon as it detects their advertisements. Is this an intended feature? If so, how can I
prevent it from happening?

It should be pairing, bluetoothd will create objects for devices found

I meant it should not be pairing...

Quoted 5 lines

during the scan but they are considered temporary as long as you don't request to connect or pair, if you connect to it will still not be paired but it will be stored persistently in the storage so you can access after restarting bluetoothd.

Quoted 8 lines
Quoted 2 lines
Quoted 2 lines

With this in mind, what had made you believe we were performing pairing during scanning?

bluetoothctl prints a line like "[CHG] Device 90:59:AF:1D:F4:66 Paired: yes" and reports the device as paired. In other words, it behaves exactly as if I had explicitly requested to pair with the device, except I did no such thing. In btmon, I can see the pairing request taking place, followed by a GATT service discovery. I've attached an example to show what I mean.

This sounds like the device was programmed for auto connect, did you connected to it before? It would explain why it is connecting but not why it is paring but perhaps it is because the service connecting does require encryption e.g. HoG. Try removing the device, it should stop reconnecting every time the device advertises.

Signature · 1 line
Luiz Augusto von Dentz
author
#5 lore raw

Hi Luiz,

Quoted 37 lines · Luiz Augusto von Dentz

Hi Tom,

Quoted 27 lines · Tom Harada

Hi Luiz,

Quoted 23 lines · Luiz Augusto von Dentz

Hi Tom,

Quoted 4 lines · Luiz Augusto von Dentz

Hi Tom,

On Fri, May 8, 2015 at 5:31 PM, Tom Harada <[email protected]> wrote:

Quoted 8 lines
Quoted 7 lines

Hi all,

On a system with kernel 4.0.1 and BlueZ 5.22 or newer, I've noticed that BlueZ seems to be automatically pairing with LE devices as soon as it detects their advertisements. Is this an intended feature? If so, how can I
prevent it from happening?

It should be pairing, bluetoothd will create objects for devices found

I meant it should not be pairing...

Quoted 5 lines

during the scan but they are considered temporary as long as you don't request to connect or pair, if you connect to it will still not be paired but it will be stored persistently in the storage so you can access after restarting bluetoothd.

Quoted 7 lines
Quoted 2 lines
Quoted 2 lines

With this in mind, what had made you believe we were performing pairing during scanning?

bluetoothctl prints a line like "[CHG] Device 90:59:AF:1D:F4:66 Paired: yes" and reports the device as paired. In other words, it behaves exactly as if I had explicitly requested to pair with the device, except I did no such thing. In btmon, I can see the pairing request taking place, followed by a GATT service discovery. I've attached an example to show what I mean.

Quoted 7 lines

This sounds like the device was programmed for auto connect, did you connected to it before? It would explain why it is connecting but not why it is paring but perhaps it is because the service connecting does require encryption e.g. HoG. Try removing the device, it should stop reconnecting every time the device advertises.

To clarify, BlueZ does not automatically connect to the device when it is already paired; it only connects (and pairs) when the device is not already paired. So it is only after removing the device that this behavior occurs.

Thanks,
Tom Harada