Central HIDS example can't connect with BLE HOGP mouse

Hi, I tested Central HIDS example in nRF Connect SDK 2.1.0 with NRF52840DK. The example works with my BLE keyboard, but does not work with my BLE mice. The followings are messages for the BLE mice. How can I modify the example to connect them? The first mouse can connect with nRF Connect for Desktop, and the other can't. I have attached the connection information.

# ELECOM M-BY10BR

Filters matched on UUID 0x1812.
Address: F1:C9:30:38:03:00 (random) connectable: yes
Connected: F1:C9:30:38:03:00 (random)
Security changed: F1:C9:30:38:03:00 (random) level 2
The discovery procedure failed with -3
Disconnected: F1:C9:30:38:03:00 (random) (reason 8)

# SANWA SUPPLY MA-BTBL155R

Filters matched on UUID 0x1812.
Address: CB:D4:5B:20:AA:57 (random) connectable: yes
Connected: CB:D4:5B:20:AA:57 (random)
Failed to set security: -12
The service could not be found during the discovery
Disconnected: CB:D4:5B:20:AA:57 (random) (reason 62)

Parents
  • Hi,

    With the first mouse you get "The discovery procedure failed with -3". 3 is -ESRCH, and lookin gat the implementation of gatt_dm.c this is only used in one case:

    	cur_attr = attr_find_by_handle(dm, attr->handle);
    	if (!cur_attr) {
    		/* We should never be here is the server is working properly */
    		discovery_complete_error(dm, -ESRCH);
    		return BT_GATT_ITER_STOP;
    	}

    which is when the attribute handle is not found. I cannot see from the log which attribute this is though, but it would seem that the mouse GATT server does not have it.

    With the second mouse you get "Failed to set security: -12" (BT_HCI_ERR_CMD_DISALLOWED), which is the same as in this thread. We cannot say more about the cause from the error, so a sniffer trace would be the natural next step.

  • Hi, thanks for the replay. I have attached a sniffer capture data for another mouse (Logitech M650). It seems not much information. Is this the data for the next step? I used nrf_sniffer_for_bluetooth_le_4.1.0 with nrf52840 dongle and Wireshark 3.6.8. The connection information is as follows:

    # Logitech M650

    Filters matched on UUID 0x1812.
    Address: D7:A8:39:0D:F2:C8 (random) connectable: yes
    Connected: D7:A8:39:0D:F2:C8 (random)
    Failed to set security: -12
    The discovery procedure succeeded
    E: HID information read error
    ERROR: HIDS client preparation failed!
    Disconnected: D7:A8:39:0D:F2:C8 (random) (reason 19)
    HIDS client active - releasing

    No.     Time     Source                PHY        Protocol Length     Delta time (µs end to start) SN         NESN       More Data  Event counter Info
      15632 23.153   d7:a8:39:0d:f2:c8     LE 1M      LE LL    37         14019µs                                                       0             ADV_IND
    
    Frame 15632: 63 bytes on wire (504 bits), 63 bytes captured (504 bits) on interface COM16-3.6, id 0
        Interface id: 0 (COM16-3.6)
            Interface name: COM16-3.6
            Interface description: nRF Sniffer for Bluetooth LE COM16
        Encapsulation type: nRF Sniffer for Bluetooth LE (186)
        Arrival Time: Sep 21, 2022 23:16:55.022617000 東京 (標準時)
        [Time shift for this packet: 0.000000000 seconds]
        Epoch Time: 1663769815.022617000 seconds
        [Time delta from previous captured frame: 0.014195000 seconds]
        [Time delta from previous displayed frame: 0.000000000 seconds]
        [Time since reference or first frame: 23.153121000 seconds]
        Frame Number: 15632
        Frame Length: 63 bytes (504 bits)
        Capture Length: 63 bytes (504 bits)
        [Frame is marked: False]
        [Frame is ignored: False]
        [Protocols in frame: nordic_ble:btle:btcommon]
    nRF Sniffer for Bluetooth LE
        Board: 16
        Header Version: 3, Packet counter: 20707
            Length of payload: 56
            Protocol version: 3
            Packet counter: 20707
            Packet ID: 2
        Length of packet: 10
        Flags: 0x01
            .... ...1 = CRC: Ok
            .... ..0. = Reserved: 0
            .... .0.. = Reserved: 0
            .... 0... = Address Resolved: No
            .000 .... = PHY: LE 1M (0)
            0... .... = Reserved: 0
        Channel Index: 37
        RSSI: -46 dBm
        Event counter: 0
        Timestamp: 259541958µs
        [Packet time (start to end): 376µs]
        [Delta time (end to start): 14019µs]
        [Delta time (start to start): 14195µs]
    Bluetooth Low Energy Link Layer
        Access Address: 0x8e89bed6
        Packet Header: 0x2560 (PDU Type: ADV_IND, ChSel: #2, TxAdd: Random)
            .... 0000 = PDU Type: 0x0 ADV_IND
            ...0 .... = Reserved: 0
            ..1. .... = Channel Selection Algorithm: #2
            .1.. .... = Tx Address: Random
            0... .... = Reserved: 0
            Length: 37
        Advertising Address: d7:a8:39:0d:f2:c8 (d7:a8:39:0d:f2:c8)
        Advertising Data
            Flags
                Length: 2
                Type: Flags (0x01)
                000. .... = Reserved: 0x0
                ...0 .... = Simultaneous LE and BR/EDR to Same Device Capable (Host): false (0x0)
                .... 0... = Simultaneous LE and BR/EDR to Same Device Capable (Controller): false (0x0)
                .... .1.. = BR/EDR Not Supported: true (0x1)
                .... ..0. = LE General Discoverable Mode: false (0x0)
                .... ...1 = LE Limited Discoverable Mode: true (0x1)
            Appearance: Mouse
                Length: 3
                Type: Appearance (0x19)
                Appearance: Mouse (0x03c2)
            16-bit Service Class UUIDs
                Length: 5
                Type: 16-bit Service Class UUIDs (0x03)
                UUID 16: Human Interface Device (0x1812)
                UUID 16: Logitech International SA (0xfd72)
            Device Name (shortened): Logi M650
                Length: 10
                Type: Device Name (shortened) (0x08)
                Device Name: Logi M650
            Manufacturer Specific
                Length: 6
                Type: Manufacturer Specific (0xff)
                Company ID: Microsoft (0x0006)
                Data: 030080
                    [Expert Info (Note/Undecoded): Undecoded]
                        [Undecoded]
                        [Severity level: Note]
                        [Group: Undecoded]
        CRC: 0x75b30e
    
    0000  10 38 00 03 e3 50 02 0a 01 25 2e 00 00 c6 4b 78   .8...P...%....Kx
    0010  0f d6 be 89 8e 60 25 c8 f2 0d 39 a8 d7 02 01 05   .....`%...9.....
    0020  03 19 c2 03 05 03 12 18 72 fd 0a 08 4c 6f 67 69   ........r...Logi
    0030  20 4d 36 35 30 06 ff 06 00 03 00 80 ae cd 70       M650.........p
    No.     Time     Source                PHY        Protocol Length     Delta time (µs end to start) SN         NESN       More Data  Event counter Info
      15633 23.153   d7:a8:39:0d:f2:c8     LE 1M      LE LL    37         498µs                                                         0             ADV_IND
    
    Frame 15633: 63 bytes on wire (504 bits), 63 bytes captured (504 bits) on interface COM16-3.6, id 0
        Interface id: 0 (COM16-3.6)
            Interface name: COM16-3.6
            Interface description: nRF Sniffer for Bluetooth LE COM16
        Encapsulation type: nRF Sniffer for Bluetooth LE (186)
        Arrival Time: Sep 21, 2022 23:16:55.023491000 東京 (標準時)
        [Time shift for this packet: 0.000000000 seconds]
        Epoch Time: 1663769815.023491000 seconds
        [Time delta from previous captured frame: 0.000874000 seconds]
        [Time delta from previous displayed frame: 0.000874000 seconds]
        [Time since reference or first frame: 23.153995000 seconds]
        Frame Number: 15633
        Frame Length: 63 bytes (504 bits)
        Capture Length: 63 bytes (504 bits)
        [Frame is marked: False]
        [Frame is ignored: False]
        [Protocols in frame: nordic_ble:btle:btcommon]
    nRF Sniffer for Bluetooth LE
        Board: 16
        Header Version: 3, Packet counter: 20708
            Length of payload: 56
            Protocol version: 3
            Packet counter: 20708
            Packet ID: 2
        Length of packet: 10
        Flags: 0x01
            .... ...1 = CRC: Ok
            .... ..0. = Reserved: 0
            .... .0.. = Reserved: 0
            .... 0... = Address Resolved: No
            .000 .... = PHY: LE 1M (0)
            0... .... = Reserved: 0
        Channel Index: 38
        RSSI: -46 dBm
        Event counter: 0
        Timestamp: 259542832µs
        [Packet time (start to end): 376µs]
        [Delta time (end to start): 498µs]
        [Delta time (start to start): 874µs]
    Bluetooth Low Energy Link Layer
        Access Address: 0x8e89bed6
        Packet Header: 0x2560 (PDU Type: ADV_IND, ChSel: #2, TxAdd: Random)
            .... 0000 = PDU Type: 0x0 ADV_IND
            ...0 .... = Reserved: 0
            ..1. .... = Channel Selection Algorithm: #2
            .1.. .... = Tx Address: Random
            0... .... = Reserved: 0
            Length: 37
        Advertising Address: d7:a8:39:0d:f2:c8 (d7:a8:39:0d:f2:c8)
        Advertising Data
            Flags
                Length: 2
                Type: Flags (0x01)
                000. .... = Reserved: 0x0
                ...0 .... = Simultaneous LE and BR/EDR to Same Device Capable (Host): false (0x0)
                .... 0... = Simultaneous LE and BR/EDR to Same Device Capable (Controller): false (0x0)
                .... .1.. = BR/EDR Not Supported: true (0x1)
                .... ..0. = LE General Discoverable Mode: false (0x0)
                .... ...1 = LE Limited Discoverable Mode: true (0x1)
            Appearance: Mouse
                Length: 3
                Type: Appearance (0x19)
                Appearance: Mouse (0x03c2)
            16-bit Service Class UUIDs
                Length: 5
                Type: 16-bit Service Class UUIDs (0x03)
                UUID 16: Human Interface Device (0x1812)
                UUID 16: Logitech International SA (0xfd72)
            Device Name (shortened): Logi M650
                Length: 10
                Type: Device Name (shortened) (0x08)
                Device Name: Logi M650
            Manufacturer Specific
                Length: 6
                Type: Manufacturer Specific (0xff)
                Company ID: Microsoft (0x0006)
                Data: 030080
                    [Expert Info (Note/Undecoded): Undecoded]
                        [Undecoded]
                        [Severity level: Note]
                        [Group: Undecoded]
        CRC: 0x75b30e
    
    0000  10 38 00 03 e4 50 02 0a 01 26 2e 00 00 30 4f 78   .8...P...&...0Ox
    0010  0f d6 be 89 8e 60 25 c8 f2 0d 39 a8 d7 02 01 05   .....`%...9.....
    0020  03 19 c2 03 05 03 12 18 72 fd 0a 08 4c 6f 67 69   ........r...Logi
    0030  20 4d 36 35 30 06 ff 06 00 03 00 80 ae cd 70       M650.........p
    No.     Time     Source                PHY        Protocol Length     Delta time (µs end to start) SN         NESN       More Data  Event counter Info
      15634 23.154   d7:a8:39:0d:f2:c8     LE 1M      LE LL    37         498µs                                                         0             ADV_IND
    
    Frame 15634: 63 bytes on wire (504 bits), 63 bytes captured (504 bits) on interface COM16-3.6, id 0
        Interface id: 0 (COM16-3.6)
            Interface name: COM16-3.6
            Interface description: nRF Sniffer for Bluetooth LE COM16
        Encapsulation type: nRF Sniffer for Bluetooth LE (186)
        Arrival Time: Sep 21, 2022 23:16:55.024365000 東京 (標準時)
        [Time shift for this packet: 0.000000000 seconds]
        Epoch Time: 1663769815.024365000 seconds
        [Time delta from previous captured frame: 0.000874000 seconds]
        [Time delta from previous displayed frame: 0.000874000 seconds]
        [Time since reference or first frame: 23.154869000 seconds]
        Frame Number: 15634
        Frame Length: 63 bytes (504 bits)
        Capture Length: 63 bytes (504 bits)
        [Frame is marked: False]
        [Frame is ignored: False]
        [Protocols in frame: nordic_ble:btle:btcommon]
    nRF Sniffer for Bluetooth LE
        Board: 16
        Header Version: 3, Packet counter: 20709
            Length of payload: 56
            Protocol version: 3
            Packet counter: 20709
            Packet ID: 2
        Length of packet: 10
        Flags: 0x01
            .... ...1 = CRC: Ok
            .... ..0. = Reserved: 0
            .... .0.. = Reserved: 0
            .... 0... = Address Resolved: No
            .000 .... = PHY: LE 1M (0)
            0... .... = Reserved: 0
        Channel Index: 39
        RSSI: -43 dBm
        Event counter: 0
        Timestamp: 259543706µs
        [Packet time (start to end): 376µs]
        [Delta time (end to start): 498µs]
        [Delta time (start to start): 874µs]
    Bluetooth Low Energy Link Layer
        Access Address: 0x8e89bed6
        Packet Header: 0x2560 (PDU Type: ADV_IND, ChSel: #2, TxAdd: Random)
            .... 0000 = PDU Type: 0x0 ADV_IND
            ...0 .... = Reserved: 0
            ..1. .... = Channel Selection Algorithm: #2
            .1.. .... = Tx Address: Random
            0... .... = Reserved: 0
            Length: 37
        Advertising Address: d7:a8:39:0d:f2:c8 (d7:a8:39:0d:f2:c8)
        Advertising Data
            Flags
                Length: 2
                Type: Flags (0x01)
                000. .... = Reserved: 0x0
                ...0 .... = Simultaneous LE and BR/EDR to Same Device Capable (Host): false (0x0)
                .... 0... = Simultaneous LE and BR/EDR to Same Device Capable (Controller): false (0x0)
                .... .1.. = BR/EDR Not Supported: true (0x1)
                .... ..0. = LE General Discoverable Mode: false (0x0)
                .... ...1 = LE Limited Discoverable Mode: true (0x1)
            Appearance: Mouse
                Length: 3
                Type: Appearance (0x19)
                Appearance: Mouse (0x03c2)
            16-bit Service Class UUIDs
                Length: 5
                Type: 16-bit Service Class UUIDs (0x03)
                UUID 16: Human Interface Device (0x1812)
                UUID 16: Logitech International SA (0xfd72)
            Device Name (shortened): Logi M650
                Length: 10
                Type: Device Name (shortened) (0x08)
                Device Name: Logi M650
            Manufacturer Specific
                Length: 6
                Type: Manufacturer Specific (0xff)
                Company ID: Microsoft (0x0006)
                Data: 030080
                    [Expert Info (Note/Undecoded): Undecoded]
                        [Undecoded]
                        [Severity level: Note]
                        [Group: Undecoded]
        CRC: 0x75b30e
    
    0000  10 38 00 03 e5 50 02 0a 01 27 2b 00 00 9a 52 78   .8...P...'+...Rx
    0010  0f d6 be 89 8e 60 25 c8 f2 0d 39 a8 d7 02 01 05   .....`%...9.....
    0020  03 19 c2 03 05 03 12 18 72 fd 0a 08 4c 6f 67 69   ........r...Logi
    0030  20 4d 36 35 30 06 ff 06 00 03 00 80 ae cd 70       M650.........p
    No.     Time     Source                PHY        Protocol Length     Delta time (µs end to start) SN         NESN       More Data  Event counter Info
      15635 23.155   55:21:2f:2a:12:8c     LE 1M      LE LL    12         149µs                                                         0             SCAN_REQ
    
    Frame 15635: 38 bytes on wire (304 bits), 38 bytes captured (304 bits) on interface COM16-3.6, id 0
        Interface id: 0 (COM16-3.6)
            Interface name: COM16-3.6
            Interface description: nRF Sniffer for Bluetooth LE COM16
        Encapsulation type: nRF Sniffer for Bluetooth LE (186)
        Arrival Time: Sep 21, 2022 23:16:55.024890000 東京 (標準時)
        [Time shift for this packet: 0.000000000 seconds]
        Epoch Time: 1663769815.024890000 seconds
        [Time delta from previous captured frame: 0.000525000 seconds]
        [Time delta from previous displayed frame: 0.000525000 seconds]
        [Time since reference or first frame: 23.155394000 seconds]
        Frame Number: 15635
        Frame Length: 38 bytes (304 bits)
        Capture Length: 38 bytes (304 bits)
        [Frame is marked: False]
        [Frame is ignored: False]
        [Protocols in frame: nordic_ble:btle]
    nRF Sniffer for Bluetooth LE
        Board: 16
        Header Version: 3, Packet counter: 20710
            Length of payload: 31
            Protocol version: 3
            Packet counter: 20710
            Packet ID: 2
        Length of packet: 10
        Flags: 0x01
            .... ...1 = CRC: Ok
            .... ..0. = Reserved: 0
            .... .0.. = Reserved: 0
            .... 0... = Address Resolved: No
            .000 .... = PHY: LE 1M (0)
            0... .... = Reserved: 0
        Channel Index: 39
        RSSI: -48 dBm
        Event counter: 0
        Timestamp: 259544231µs
        [Packet time (start to end): 176µs]
        [Delta time (end to start): 149µs]
        [Delta time (start to start): 525µs]
    Bluetooth Low Energy Link Layer
        Access Address: 0x8e89bed6
        Packet Header: 0x0cc3 (PDU Type: SCAN_REQ, TxAdd: Random, RxAdd: Random)
            .... 0011 = PDU Type: 0x3 SCAN_REQ
            ...0 .... = Reserved: 0
            ..0. .... = Reserved: 0
            .1.. .... = Tx Address: Random
            1... .... = Rx Address: Random
            Length: 12
        Scanning Address: 55:21:2f:2a:12:8c (55:21:2f:2a:12:8c)
        Advertising Address: d7:a8:39:0d:f2:c8 (d7:a8:39:0d:f2:c8)
        CRC: 0x16b5c8
    
    0000  10 1f 00 03 e6 50 02 0a 01 27 30 00 00 a7 54 78   .....P...'0...Tx
    0010  0f d6 be 89 8e c3 0c 8c 12 2a 2f 21 55 c8 f2 0d   .........*/!U...
    0020  39 a8 d7 68 ad 13                                 9..h..
    No.     Time     Source                PHY        Protocol Length     Delta time (µs end to start) SN         NESN       More Data  Event counter Info
      15636 23.155   d7:a8:39:0d:f2:c8     LE 1M      LE LL    32         150µs                                                         0             SCAN_RSP
    
    Frame 15636: 58 bytes on wire (464 bits), 58 bytes captured (464 bits) on interface COM16-3.6, id 0
        Interface id: 0 (COM16-3.6)
            Interface name: COM16-3.6
            Interface description: nRF Sniffer for Bluetooth LE COM16
        Encapsulation type: nRF Sniffer for Bluetooth LE (186)
        Arrival Time: Sep 21, 2022 23:16:55.025216000 東京 (標準時)
        [Time shift for this packet: 0.000000000 seconds]
        Epoch Time: 1663769815.025216000 seconds
        [Time delta from previous captured frame: 0.000326000 seconds]
        [Time delta from previous displayed frame: 0.000326000 seconds]
        [Time since reference or first frame: 23.155720000 seconds]
        Frame Number: 15636
        Frame Length: 58 bytes (464 bits)
        Capture Length: 58 bytes (464 bits)
        [Frame is marked: False]
        [Frame is ignored: False]
        [Protocols in frame: nordic_ble:btle:btcommon]
    nRF Sniffer for Bluetooth LE
        Board: 16
        Header Version: 3, Packet counter: 20711
            Length of payload: 51
            Protocol version: 3
            Packet counter: 20711
            Packet ID: 2
        Length of packet: 10
        Flags: 0x01
            .... ...1 = CRC: Ok
            .... ..0. = Reserved: 0
            .... .0.. = Reserved: 0
            .... 0... = Address Resolved: No
            .000 .... = PHY: LE 1M (0)
            0... .... = Reserved: 0
        Channel Index: 39
        RSSI: -42 dBm
        Event counter: 0
        Timestamp: 259544557µs
        [Packet time (start to end): 336µs]
        [Delta time (end to start): 150µs]
        [Delta time (start to start): 326µs]
    Bluetooth Low Energy Link Layer
        Access Address: 0x8e89bed6
        Packet Header: 0x2044 (PDU Type: SCAN_RSP, TxAdd: Random)
            .... 0100 = PDU Type: 0x4 SCAN_RSP
            ...0 .... = Reserved: 0
            ..0. .... = Reserved: 0
            .1.. .... = Tx Address: Random
            0... .... = Reserved: 0
            Length: 32
        Advertising Address: d7:a8:39:0d:f2:c8 (d7:a8:39:0d:f2:c8)
        Scan Response Data: 0a094c6f6769204d3635300b1672fd1001012ab0020208020a08
            Advertising Data
                Device Name: Logi M650
                    Length: 10
                    Type: Device Name (0x09)
                    Device Name: Logi M650
                Service Data - 16 bit UUID
                    Length: 11
                    Type: Service Data - 16 bit UUID (0x16)
                    UUID 16: Logitech International SA (0xfd72)
                    Service Data: 1001012ab0020208
                Tx Power Level
                    Length: 2
                    Type: Tx Power Level (0x0a)
                    Power Level (dBm): 8
        CRC: 0x1919e0
    
    0000  10 33 00 03 e7 50 02 0a 01 27 2a 00 00 ed 55 78   .3...P...'*...Ux
    0010  0f d6 be 89 8e 44 20 c8 f2 0d 39 a8 d7 0a 09 4c   .....D ...9....L
    0020  6f 67 69 20 4d 36 35 30 0b 16 72 fd 10 01 01 2a   ogi M650..r....*
    0030  b0 02 02 08 02 0a 08 98 98 07                     ..........
    No.     Time     Source                PHY        Protocol Length     Delta time (µs end to start) SN         NESN       More Data  Event counter Info
      15640 23.190   d7:a8:39:0d:f2:c8     LE 1M      LE LL    37         10154µs                                                       0             ADV_IND
    
    Frame 15640: 63 bytes on wire (504 bits), 63 bytes captured (504 bits) on interface COM16-3.6, id 0
        Interface id: 0 (COM16-3.6)
            Interface name: COM16-3.6
            Interface description: nRF Sniffer for Bluetooth LE COM16
        Encapsulation type: nRF Sniffer for Bluetooth LE (186)
        Arrival Time: Sep 21, 2022 23:16:55.060010000 東京 (標準時)
        [Time shift for this packet: 0.000000000 seconds]
        Epoch Time: 1663769815.060010000 seconds
        [Time delta from previous captured frame: 0.010434000 seconds]
        [Time delta from previous displayed frame: 0.034794000 seconds]
        [Time since reference or first frame: 23.190514000 seconds]
        Frame Number: 15640
        Frame Length: 63 bytes (504 bits)
        Capture Length: 63 bytes (504 bits)
        [Frame is marked: False]
        [Frame is ignored: False]
        [Protocols in frame: nordic_ble:btle:btcommon]
    nRF Sniffer for Bluetooth LE
        Board: 16
        Header Version: 3, Packet counter: 20715
            Length of payload: 56
            Protocol version: 3
            Packet counter: 20715
            Packet ID: 2
        Length of packet: 10
        Flags: 0x01
            .... ...1 = CRC: Ok
            .... ..0. = Reserved: 0
            .... .0.. = Reserved: 0
            .... 0... = Address Resolved: No
            .000 .... = PHY: LE 1M (0)
            0... .... = Reserved: 0
        Channel Index: 37
        RSSI: -44 dBm
        Event counter: 0
        Timestamp: 259579351µs
        [Packet time (start to end): 376µs]
        [Delta time (end to start): 10154µs]
        [Delta time (start to start): 10434µs]
    Bluetooth Low Energy Link Layer
        Access Address: 0x8e89bed6
        Packet Header: 0x2560 (PDU Type: ADV_IND, ChSel: #2, TxAdd: Random)
            .... 0000 = PDU Type: 0x0 ADV_IND
            ...0 .... = Reserved: 0
            ..1. .... = Channel Selection Algorithm: #2
            .1.. .... = Tx Address: Random
            0... .... = Reserved: 0
            Length: 37
        Advertising Address: d7:a8:39:0d:f2:c8 (d7:a8:39:0d:f2:c8)
        Advertising Data
            Flags
                Length: 2
                Type: Flags (0x01)
                000. .... = Reserved: 0x0
                ...0 .... = Simultaneous LE and BR/EDR to Same Device Capable (Host): false (0x0)
                .... 0... = Simultaneous LE and BR/EDR to Same Device Capable (Controller): false (0x0)
                .... .1.. = BR/EDR Not Supported: true (0x1)
                .... ..0. = LE General Discoverable Mode: false (0x0)
                .... ...1 = LE Limited Discoverable Mode: true (0x1)
            Appearance: Mouse
                Length: 3
                Type: Appearance (0x19)
                Appearance: Mouse (0x03c2)
            16-bit Service Class UUIDs
                Length: 5
                Type: 16-bit Service Class UUIDs (0x03)
                UUID 16: Human Interface Device (0x1812)
                UUID 16: Logitech International SA (0xfd72)
            Device Name (shortened): Logi M650
                Length: 10
                Type: Device Name (shortened) (0x08)
                Device Name: Logi M650
            Manufacturer Specific
                Length: 6
                Type: Manufacturer Specific (0xff)
                Company ID: Microsoft (0x0006)
                Data: 030080
                    [Expert Info (Note/Undecoded): Undecoded]
                        [Undecoded]
                        [Severity level: Note]
                        [Group: Undecoded]
        CRC: 0x75b30e
    
    0000  10 38 00 03 eb 50 02 0a 01 25 2c 00 00 d7 dd 78   .8...P...%,....x
    0010  0f d6 be 89 8e 60 25 c8 f2 0d 39 a8 d7 02 01 05   .....`%...9.....
    0020  03 19 c2 03 05 03 12 18 72 fd 0a 08 4c 6f 67 69   ........r...Logi
    0030  20 4d 36 35 30 06 ff 06 00 03 00 80 ae cd 70       M650.........p
    No.     Time     Source                PHY        Protocol Length     Delta time (µs end to start) SN         NESN       More Data  Event counter Info
      15641 23.191   55:21:2f:2a:12:8c     LE 1M      LE LL    34         150µs                                                         0             CONNECT_IND
    
    Frame 15641: 60 bytes on wire (480 bits), 60 bytes captured (480 bits) on interface COM16-3.6, id 0
        Interface id: 0 (COM16-3.6)
            Interface name: COM16-3.6
            Interface description: nRF Sniffer for Bluetooth LE COM16
        Encapsulation type: nRF Sniffer for Bluetooth LE (186)
        Arrival Time: Sep 21, 2022 23:16:55.060536000 東京 (標準時)
        [Time shift for this packet: 0.000000000 seconds]
        Epoch Time: 1663769815.060536000 seconds
        [Time delta from previous captured frame: 0.000526000 seconds]
        [Time delta from previous displayed frame: 0.000526000 seconds]
        [Time since reference or first frame: 23.191040000 seconds]
        Frame Number: 15641
        Frame Length: 60 bytes (480 bits)
        Capture Length: 60 bytes (480 bits)
        [Frame is marked: False]
        [Frame is ignored: False]
        [Protocols in frame: nordic_ble:btle:btcommon]
    nRF Sniffer for Bluetooth LE
        Board: 16
        Header Version: 3, Packet counter: 20716
            Length of payload: 53
            Protocol version: 3
            Packet counter: 20716
            Packet ID: 2
        Length of packet: 10
        Flags: 0x01
            .... ...1 = CRC: Ok
            .... ..0. = Reserved: 0
            .... .0.. = Reserved: 0
            .... 0... = Address Resolved: No
            .000 .... = PHY: LE 1M (0)
            0... .... = Reserved: 0
        Channel Index: 37
        RSSI: -47 dBm
        Event counter: 0
        Timestamp: 259579877µs
        [Packet time (start to end): 352µs]
        [Delta time (end to start): 150µs]
        [Delta time (start to start): 526µs]
    Bluetooth Low Energy Link Layer
        Access Address: 0x8e89bed6
        Packet Header: 0x22e5 (PDU Type: CONNECT_IND, ChSel: #2, TxAdd: Random, RxAdd: Random)
            .... 0101 = PDU Type: 0x5 CONNECT_IND
            ...0 .... = Reserved: 0
            ..1. .... = Channel Selection Algorithm: #2
            .1.. .... = Tx Address: Random
            1... .... = Rx Address: Random
            Length: 34
        Initiator Address: 55:21:2f:2a:12:8c (55:21:2f:2a:12:8c)
        Advertising Address: d7:a8:39:0d:f2:c8 (d7:a8:39:0d:f2:c8)
        Link Layer Data
            Access Address: 0xab3f152f
            CRC Init: 0xe6a69e
            Window Size: 5 (6.25 msec)
            Window Offset: 0 (0 msec)
            Interval: 40 (50 msec)
            Latency: 0
            Timeout: 400 (4000 msec)
            Channel Map: ffffffff1f
                .... ...1 = RF Channel 1 (2404 MHz - Data - 0): True
                .... ..1. = RF Channel 2 (2406 MHz - Data - 1): True
                .... .1.. = RF Channel 3 (2408 MHz - Data - 2): True
                .... 1... = RF Channel 4 (2410 MHz - Data - 3): True
                ...1 .... = RF Channel 5 (2412 MHz - Data - 4): True
                ..1. .... = RF Channel 6 (2414 MHz - Data - 5): True
                .1.. .... = RF Channel 7 (2416 MHz - Data - 6): True
                1... .... = RF Channel 8 (2418 MHz - Data - 7): True
                .... ...1 = RF Channel 9 (2420 MHz - Data - 8): True
                .... ..1. = RF Channel 10 (2422 MHz - Data - 9): True
                .... .1.. = RF Channel 11 (2424 MHz - Data - 10): True
                .... 1... = RF Channel 13 (2428 MHz - Data - 11): True
                ...1 .... = RF Channel 14 (2430 MHz - Data - 12): True
                ..1. .... = RF Channel 15 (2432 MHz - Data - 13): True
                .1.. .... = RF Channel 16 (2434 MHz - Data - 14): True
                1... .... = RF Channel 17 (2436 MHz - Data - 15): True
                .... ...1 = RF Channel 18 (2438 MHz - Data - 16): True
                .... ..1. = RF Channel 19 (2440 MHz - Data - 17): True
                .... .1.. = RF Channel 20 (2442 MHz - Data - 18): True
                .... 1... = RF Channel 21 (2444 MHz - Data - 19): True
                ...1 .... = RF Channel 22 (2446 MHz - Data - 20): True
                ..1. .... = RF Channel 23 (2448 MHz - Data - 21): True
                .1.. .... = RF Channel 24 (2450 MHz - Data - 22): True
                1... .... = RF Channel 25 (2452 MHz - Data - 23): True
                .... ...1 = RF Channel 26 (2454 MHz - Data - 24): True
                .... ..1. = RF Channel 27 (2456 MHz - Data - 25): True
                .... .1.. = RF Channel 28 (2458 MHz - Data - 26): True
                .... 1... = RF Channel 29 (2460 MHz - Data - 27): True
                ...1 .... = RF Channel 30 (2462 MHz - Data - 28): True
                ..1. .... = RF Channel 31 (2464 MHz - Data - 29): True
                .1.. .... = RF Channel 32 (2466 MHz - Data - 30): True
                1... .... = RF Channel 33 (2468 MHz - Data - 31): True
                .... ...1 = RF Channel 34 (2470 MHz - Data - 32): True
                .... ..1. = RF Channel 35 (2472 MHz - Data - 33): True
                .... .1.. = RF Channel 36 (2474 MHz - Data - 34): True
                .... 1... = RF Channel 37 (2476 MHz - Data - 35): True
                ...1 .... = RF Channel 38 (2478 MHz - Data - 36): True
                ..0. .... = Reserved: False
                .0.. .... = Reserved: False
                0... .... = Reserved: False
            ...0 1001 = Hop: 9
            101. .... = Sleep Clock Accuracy: 31 ppm to 50 ppm (5)
        CRC: 0x502dc4
    
    0000  10 35 00 03 ec 50 02 0a 01 25 2f 00 00 e5 df 78   .5...P...%/....x
    0010  0f d6 be 89 8e e5 22 8c 12 2a 2f 21 55 c8 f2 0d   ......"..*/!U...
    0020  39 a8 d7 2f 15 3f ab 9e a6 e6 05 00 00 28 00 00   9../.?.......(..
    0030  00 90 01 ff ff ff ff 1f a9 0a b4 23               ...........#
    

  • Can you upload the full sniffer trace instead (the pcap file)?

    Also, it could be interesting to see a trace with both the working and failing mouse to compare. And just to be sure, the problem here is different behavior with the two mouses right? And not the order of which mouse you try to connect? (Reading the initial question again I was a bit unsure). If you can elaborate that would be good.

  • Now, Logitech M650 works with the Central HIDS example! I just recompile it with the default settings, and it works.

    I have attached the files for Logitech (success), Elecom (fail) and SANWA (fail). Below are the outputs from the console.

    # Logitech => Success
    
    Filters matched on UUID 0x1812.
    Address: D7:A8:39:0D:F2:C8 (random) connectable: yes
    Connected: D7:A8:39:0D:F2:C8 (random)
    Security changed: D7:A8:39:0D:F2:C8 (random) level 2
    The discovery procedure succeeded
    HIDS is ready to work
    Subscribe to report id: 2
    Subscribe to report id: 17
    Subscribe to boot mouse report
    Notification, id: 2, size: 7, data: 0x0 0x0 0x0 0xf0 0xff 0x0 0x0
    Notification, id: 2, size: 7, data: 0x0 0x0 0x3 0xe0 0xff 0x0 0x0
    Notification, id: 2, size: 7, data: 0x0 0x0 0x8 0xa0 0xff 0x0 0x0
    Notification, id: 2, size: 7, data: 0x0 0x0 0x8 0xa0 0xff 0x0 0x0
    Disconnected: D7:A8:39:0D:F2:C8 (random) (reason 19)
    HIDS client active - releasing
    
    # Elecom => Fail
    
    Filters matched on UUID 0x1812.
    Address: F1:C9:30:38:03:00 (random) connectable: yes
    Connected: F1:C9:30:38:03:00 (random)
    Failed to set security: -12
    The discovery procedure failed with -3
    
    # SANWA => Fail
    
    Filters matched on UUID 0x1812.
    Address: D0:F0:C8:CA:EF:30 (random) connectable: yes
    Connected: D0:F0:C8:CA:EF:30 (random)
    Failed to set security: -12
    The service could not be found during the discovery
    Disconnected: D0:F0:C8:CA:EF:30 (random) (reason 62)

    I want to connect keyboard and mouse to nRF52. My problem is that some mice can't connect with the Central HIDS example. I want to support various BLE mice to connect. (I can use Logitech but I want to use other mouse.)

    logitech.pcapngelecom.pcapngsanwa.pcapng

  • Hi,

    The sniffer traces only shows advertising and nothing of the connection, so there is not much that can be seen from those.

    Without sniffer traces we can still look at the errors though, and the first error for both devices is "Failed to set security: -12", which is -ENOMEM. As this happens for peripheral 2 and 3 this makes me wonder if the issue here is that you have a configuration issue where you do not support enough bonds. Can you try to add CONFIG_BT_MAX_PAIRED=4 to your prj.conf (or another number, which is at least as high as the number of bonds you need)? The default value here is 1.

Reply
  • Hi,

    The sniffer traces only shows advertising and nothing of the connection, so there is not much that can be seen from those.

    Without sniffer traces we can still look at the errors though, and the first error for both devices is "Failed to set security: -12", which is -ENOMEM. As this happens for peripheral 2 and 3 this makes me wonder if the issue here is that you have a configuration issue where you do not support enough bonds. Can you try to add CONFIG_BT_MAX_PAIRED=4 to your prj.conf (or another number, which is at least as high as the number of bonds you need)? The default value here is 1.

Children
  • Hi,

    The sniffer traces with data PDU are attached. Sorry for incomplete data in the previous post.

    Also, below is the logs for different BT_MAX_PAIRED settings.

    ### CONFIG_BT_MAX_PAIRED=1
    
    # Elecom
    
    Filters matched on UUID 0x1812.
    Address: F1:C9:30:38:04:00 (random) connectable: yes
    Connected: F1:C9:30:38:04:00 (random)
    Failed to set security: -12
    The discovery procedure failed with -3
    Disconnected: F1:C9:30:38:04:00 (random) (reason 8)
    
    # SANWA
    
    Filters matched on UUID 0x1812.
    Address: D0:F0:C8:CA:EF:30 (random) connectable: yes
    Connected: D0:F0:C8:CA:EF:30 (random)
    Failed to set security: -12
    The service could not be found during the discovery
    Disconnected: D0:F0:C8:CA:EF:30 (random) (reason 62)
    
    # CONFIG_BT_MAX_PAIRED=2
    
    # Elecom
    
    Filters matched on UUID 0x1812.
    Address: F1:C9:30:38:03:00 (random) connectable: yes
    Connected: F1:C9:30:38:03:00 (random)
    Security changed: F1:C9:30:38:03:00 (random) level 2
    Pairing completed: F1:C9:30:38:03:00 (random), bonded: 1
    The discovery procedure failed with -3
    Disconnected: F1:C9:30:38:03:00 (random) (reason 8)
    
    # SANWA
    
    Filters matched on UUID 0x1812.
    Address: D0:F0:C8:CA:EF:30 (random) connectable: yes
    Connected: D0:F0:C8:CA:EF:30 (random)
    Security failed: D0:F0:C8:CA:EF:30 (random) level 1 err 9
    E: Discover failed, error: -128.
    could not start the discovery procedure, error code: -128
    Pairing failed conn: D0:F0:C8:CA:EF:30 (random), reason 9
    Disconnected: D0:F0:C8:CA:EF:30 (random) (reason 62)
    
    # CONFIG_BT_MAX_PAIRED=8
    
    # Elecom
    
    Filters matched on UUID 0x1812.
    Address: F1:C9:30:38:03:00 (random) connectable: yes
    Connected: F1:C9:30:38:03:00 (random)
    Security changed: F1:C9:30:38:03:00 (random) level 2
    Pairing completed: F1:C9:30:38:03:00 (random), bonded: 1
    The discovery procedure failed with -3
    Disconnected: F1:C9:30:38:03:00 (random) (reason 8)
    
    # SANWA
    
    Filters matched on UUID 0x1812.
    Address: D0:F0:C8:CA:EF:30 (random) connectable: yes
    Connected: D0:F0:C8:CA:EF:30 (random)
    Security failed: D0:F0:C8:CA:EF:30 (random) level 1 err 9
    E: Discover failed, error: -128.
    could not start the discovery procedure, error code: -128
    Pairing failed conn: D0:F0:C8:CA:EF:30 (random), reason 9
    Disconnected: D0:F0:C8:CA:EF:30 (random) (reason 62)
    logitech_2.pcapngsanwa_2.pcapngelecom_2.pcapng

  • Hi,

    The sniffer can both get packets in a connection and decrypt encrypted packets (see nRF Sniffer documentation for details). That is needed for it to tell us anything useful, but it may not be relevant in this case.

    I suggest focusing on that bt_conn_set_security() returns -ENOMEM. Did you try to increase CONFIG_BT_MAX_PAIRED? Or can you try to dig deeper with a debugger to pinpoint  more closely where the error originates?

  • Hi,

    This might be more detailed information for ELECOM mouse errors.

    (1) Sniffer trace (decrypted) (2) Call stack (3) Debug log

    I guess I need to set a larger buffer size somewhere as the last part of the log below says 

    (BT_MAX_PAIRED, BT_GATT_DM_MAX_ATTRS, BT_HOGP_REPORTS_MAX are not the answer to resolve the problem)

    D: Getting net_buf from queue
    D: buf 0x2000ca54 type 3 len 31
    D: buf 0x2000ca54
    D: handle 0 len 27 flags 2
    D: handle 0 ref 2 -> 3
    D: conn 0x20001b58
    D: tx 0x20003438 cb 0x1aba9 user_data 0x20003720
    D: conn 0x20001b58 chan 0x20009cac
    D: chan 0x20009ca8
    D: chan 0x20009ca8 chan->req 0x2000cd30
    D: handle 0 len 27 flags 02
    D: First, len 27 final 23
    D: Successfully parsed 27 byte L2CAP packet
    D: Packet for CID 4 len 23
    D: chan 0x20009cac len 23
    D: Received ATT chan 0x20009ca8 code 0x09 len 22
    D:
    D: chan 0x20009ca8 err 0x00 len 22: 0718000619004e2a1a00121b004d2a1e000a1f004d2a
    D: req 0x2000cd30
    D: err 0x00
    D: handle 0x0018 uuid 2a4e properties 0x06
    The discovery procedure failed with -3

    2656.elecom.pcapng

    D: Getting net_buf from queue
    D: buf 0x2000c9c8 type 1 len 45
    D: event 0x3e
    D: subevent 0x02
    D: Adv number of reports 1
    D: F1:C9:30:38:0D:00 (random) event 0, len 31, rssi -43 dBm
    D: F1:C9:30:38:0D:00 (random)
    Filters matched on UUID 0x1812.
    Address: F1:C9:30:38:0D:00 (random) connectable: yes
    D: opcode 0x200c param_len 2
    D: buf 0x2000cb18
    D: buf 0x2000cb18 opcode 0x200c len 5
    D: LE Meta Event (0x02), len (30)
    D: buf 0x2000c9ac len 32
    D: LE Meta Event (0x02), len (31)
    D: Discarding event
    D: count 2
    D: ev->state 4
    D: calling net_buf_get
    D: calling sem_take_wait
    D: Sending command 0x200c (buf 0x2000cb18) to driver
    D: buf 0x2000cb18 len 5 type 0
    D:
    D:
    D: Exit: 0
    D: ev->state 0
    D: Command Complete (0x200c) status: 0x00, ncmd: 1, len 4
    D: buf 0x2000cb18 len 6
    D: opcode 0x200c
    D: opcode 0x200c status 0x00 buf 0x2000cb18
    D:
    D: Calling k_poll with 2 events
    D: rsp 0x2000cb18 opcode 0x200c len 1
    D: F1:C9:30:38:0D:00 (random)
    D: disconnected -> connecting
    D: handle 0 ref 1 -> 2
    D: opcode 0x200d param_len 25
    D: buf 0x2000cb18
    D: buf 0x2000cb18 opcode 0x200d len 28
    D: count 2
    D: ev->state 4
    D: calling net_buf_get
    D: calling sem_take_wait
    D: Sending command 0x200d (buf 0x2000cb18) to driver
    D: buf 0x2000cb18 len 28 type 0
    D:
    D:
    D: Exit: 0
    D: ev->state 0
    D: Command Status (0x200d) status: 0x00
    D: buf 0x2000cb18 len 6
    D: opcode 0x200d
    D: opcode 0x200d status 0x00 buf 0x2000cb18
    D:
    D: Calling k_poll with 2 events
    D: rsp 0x2000cb18 opcode 0x200d len 0
    D: handle 0 ref 2 -> 3
    D: handle 0 ref 3 -> 2
    D: handle 0 ref 2 -> 3
    D: handle 0 ref 3 -> 2
    D: Getting net_buf from queue
    D: buf 0x2000c9e4 type 1 len 17
    D: event 0x3e
    D: subevent 0x02
    D: Adv number of reports 1
    D: F1:C9:30:38:0D:00 (random) event 4, len 3, rssi -42 dBm
    D: F1:C9:30:38:0D:00 (random)
    D: LE Meta Event (0x0a), len (31)
    D: buf 0x2000ca00 len 33
    D: Getting net_buf from queue
    D: buf 0x2000c9ac type 1 len 32
    D: event 0x3e
    D: subevent 0x02
    D: Adv number of reports 1
    D: 26:07:28:10:17:E1 (random) event 3, len 18, rssi -25 dBm
    D: 26:07:28:10:17:E1 (random)
    D: Getting net_buf from queue
    D: buf 0x2000ca00 type 1 len 33
    D: event 0x3e
    D: subevent 0x0a
    D: status 0x00 handle 0 role 0 peer F1:C9:30:38:0D:00 (random) peer RPA 00:00:00:00:00:00
    D: local RPA 66:7B:0A:CA:1B:F6
    D: F1:C9:30:38:0D:00 (random)
    D: handle 0 ref 2 -> 3
    D: connecting -> connected
    D: conn 0x20001b58 handle 0
    D: conn 0x20001b58 chan 0x20003488
    D: ch 0x20003488 cid 0x0005
    D: conn 0x20001b58 handle 0
    D: conn 0x20001b58 chan 0x20002074
    D: chan 0x20002074 cid 0x0006
    D: conn 0x20001b58 handle 0
    D: att 0x2000cc90 chan 0x20009ca8 flags 0
    D: conn 0x20001b58 chan 0x20009cac
    D: chan 0x20009cac cid 0x0004
    D: conn 0x20001b58
    D: F1:C9:30:38:0D:00 (random)
    D: chan 0x20009cac status 0x20009cbc
    Connected: F1:C9:30:38:0D:00 (random)
    D: type 32 F1:C9:30:38:0D:00 (random)
    D: type 4 F1:C9:30:38:0D:00 (random)
    D:
    D: F1:C9:30:38:0D:00 (random)
    D: created 0x200038d0 for F1:C9:30:38:0D:00 (random)
    D: count 2
    D: ev->state 0
    D: ev->state 1
    D:
    D: Adding conn 0x20001b58 to poll list
    D: Calling k_poll with 3 events
    D: prnd a2be4df1b23546795956f1f1b003fc7a
    D: conn 0x20001b58 cid 6 len 7
    D: conn handle 0 buf len 11 cb (nil) user_data (nil)
    D: opcode 0x2016 param_len 2
    D: buf 0x2000cb18
    D: buf 0x2000cb18 opcode 0x2016 len 5
    D: count 3
    D: ev->state 4
    D: calling net_buf_get
    D: calling sem_take_wait
    D: Sending command 0x2016 (buf 0x2000cb18) to driver
    D: buf 0x2000cb18 len 5 type 0
    D:
    D:
    D: Exit: 0
    D: ev->state 0
    D: ev->state 4
    D: conn 0x20001b58
    D: conn 0x20001b58 buf 0x2000cb50 len 11
    D: conn 0x20001b58 buf 0x2000cb50 len 11 flags 0x02
    D: buf 0x2000cb50 len 15 type 2
    D:
    D:
    D: Exit: 0
    D: Command Status (0x2016) status: 0x00
    D: buf 0x2000cb18 len 6
    D: opcode 0x2016
    D: opcode 0x2016 status 0x00 buf 0x2000cb18
    D:
    D: Adding conn 0x20001b58 to poll list
    D: Calling k_poll with 3 events
    D: Event (0x13) len 5
    D: buf 0x2000c990 len 7
    D: num_handles 1
    D: handle 0 count 1
    D: handle 0 ref 3 -> 4
    D: handle 0 ref 4 -> 3
    D: Data: handle (0x00), PB(2), BC(0), len(11)
    D: buf 0x2000ca1c len 15
    D: rsp 0x2000cb18 opcode 0x2016 len 0
    D: opcode 0x2032 param_len 7
    D: buf 0x2000cb18
    D: buf 0x2000cb18 opcode 0x2032 len 10
    D: count 3
    D: ev->state 4
    D: calling net_buf_get
    D: calling sem_take_wait
    D: Sending command 0x2032 (buf 0x2000cb18) to driver
    D: buf 0x2000cb18 len 10 type 0
    D:
    D:
    D: Exit: 0
    D: ev->state 0
    D: ev->state 0
    D: Command Status (0x2032) status: 0x00
    D: buf 0x2000cb18 len 6
    D: opcode 0x2032
    D: opcode 0x2032 status 0x00 buf 0x2000cb18
    D: LE Meta Event (0x04), len (12)
    D: buf 0x2000ca38 len 14
    D:
    D: Adding conn 0x20001b58 to poll list
    D: Calling k_poll with 3 events
    D: rsp 0x2000cb18 opcode 0x2032 len 0
    D: handle 0 ref 3 -> 2
    D: handle 0 ref 2 -> 3
    D: handle 0 ref 3 -> 2
    D: handle 0 ref 2 -> 3
    D: handle 0 ref 3 -> 2
    D: Getting net_buf from queue
    D: buf 0x2000ca1c type 3 len 15
    D: buf 0x2000ca1c
    D: handle 0 len 11 flags 2
    D: handle 0 ref 2 -> 3
    D: conn 0x20001b58
    D: handle 0 len 11 flags 02
    D: First, len 11 final 7
    D: Successfully parsed 11 byte L2CAP packet
    D: Packet for CID 6 len 7
    D: chan 0x20002074 len 7
    D: Received SMP code 0x02 len 6
    D:
    D:
    D: F1:C9:30:38:0D:00 (random)
    D: k 00000000000000000000000000000000
    D: r a2be4df1b23546795956f1f1b003fc7a
    D: ia 66:7B:0A:CA:1B:F6 (random)
    D: ra F1:C9:30:38:0D:00 (random)
    D: preq 0101000d100303
    D: pres 02030001100001
    D: p1 01010101000d10030302030001100001
    D: key
    D: 00 00 00 00 00 00 00 00 |........
    D: 00 00 00 00 00 00 00 00 |........
    D: plaintext
    D: a3 bf 4c f0 b2 38 56 7a |..L..8Vz
    D: 5a 54 f2 f1 b1 13 fc 7b |ZT.....{
    D: enc_data
    D: 29 36 78 2c e1 7a d4 b5 |)6x,.z..
    D: 80 79 2d cb 55 8d bf 31 |.y-.U..1
    D: p2 000d3830c9f1f61bca0a7b6600000000
    D: key
    D: 00 00 00 00 00 00 00 00 |........
    D: 00 00 00 00 00 00 00 00 |........
    D: plaintext
    D: 29 3b 40 1c 28 8b 22 ae |);@.(.".
    D: 4a 73 56 ad 55 8d bf 31 |JsV.U..1
    D: enc_data
    D: fe ad a8 ac 83 3b 94 05 |.....;..
    D: a1 6b e0 34 e5 64 6a 38 |.k.4.dj8
    D: conn 0x20001b58 cid 6 len 17
    D: conn handle 0 buf len 21 cb (nil) user_data (nil)
    D: handle 0 ref 3 -> 2
    D: LE Meta Event (0x0c), len (6)
    D: buf 0x2000ca1c len 8
    D: count 3
    D: ev->state 0
    D: ev->state 0
    D: ev->state 4
    D: conn 0x20001b58
    D: conn 0x20001b58 buf 0x2000cb50 len 21
    D: conn 0x20001b58 buf 0x2000cb50 len 21 flags 0x02
    D: buf 0x2000cb50 len 25 type 2
    D:
    D:
    D: Exit: 0
    D:
    D: Adding conn 0x20001b58 to poll list
    D: Calling k_poll with 3 events
    D: Getting net_buf from queue
    D: buf 0x2000ca38 type 1 len 14
    D: event 0x3e
    D: subevent 0x04
    D: handle 0 ref 2 -> 3
    D: handle 0 ref 3 -> 2
    D: Getting net_buf from queue
    D: buf 0x2000ca1c type 1 len 8
    D: event 0x3e
    D: subevent 0x0c
    D: handle 0 ref 2 -> 3
    D: PHY updated: status: 0x1a, tx: 1, rx: 1
    D: handle 0 ref 3 -> 2
    D: Database Hash stored
    D: Event (0x13) len 5
    D: buf 0x2000c990 len 7
    D: num_handles 1
    D: handle 0 count 1
    D: handle 0 ref 2 -> 3
    D: handle 0 ref 3 -> 2
    D: Data: handle (0x00), PB(2), BC(0), len(21)
    D: buf 0x2000ca1c len 25
    D: Getting net_buf from queue
    D: buf 0x2000ca1c type 3 len 25
    D: buf 0x2000ca1c
    D: handle 0 len 21 flags 2
    D: handle 0 ref 2 -> 3
    D: conn 0x20001b58
    D: handle 0 len 21 flags 02
    D: First, len 21 final 17
    D: Successfully parsed 21 byte L2CAP packet
    D: Packet for CID 6 len 17
    D: chan 0x20002074 len 17
    D: Received SMP code 0x03 len 16
    D:
    D: conn 0x20001b58 cid 6 len 17
    D: conn handle 0 buf len 21 cb (nil) user_data (nil)
    D: handle 0 ref 3 -> 2
    D: count 3
    D: ev->state 0
    D: ev->state 0
    D: ev->state 4
    D: conn 0x20001b58
    D: conn 0x20001b58 buf 0x2000cb50 len 21
    D: conn 0x20001b58 buf 0x2000cb50 len 21 flags 0x02
    D: buf 0x2000cb50 len 25 type 2
    D:
    D:
    D: Exit: 0
    D:
    D: Adding conn 0x20001b58 to poll list
    D: Calling k_poll with 3 events
    D: Event (0x13) len 5
    D: buf 0x2000c990 len 7
    D: num_handles 1
    D: handle 0 count 1
    D: handle 0 ref 2 -> 3
    D: handle 0 ref 3 -> 2
    D: Data: handle (0x00), PB(2), BC(0), len(21)
    D: buf 0x2000ca1c len 25
    D: Getting net_buf from queue
    D: buf 0x2000ca1c type 3 len 25
    D: buf 0x2000ca1c
    D: handle 0 len 21 flags 2
    D: handle 0 ref 2 -> 3
    D: conn 0x20001b58
    D: handle 0 len 21 flags 02
    D: First, len 21 final 17
    D: Successfully parsed 21 byte L2CAP packet
    D: Packet for CID 6 len 17
    D: chan 0x20002074 len 17
    D: Received SMP code 0x04 len 16
    D:
    D:
    D: k 00000000000000000000000000000000
    D: r eb960f9696ec8272eefa8856b9985ee3
    D: ia 66:7B:0A:CA:1B:F6 (random)
    D: ra F1:C9:30:38:0D:00 (random)
    D: preq 0101000d100303
    D: pres 02030001100001
    D: p1 01010101000d10030302030001100001
    D: key
    D: 00 00 00 00 00 00 00 00 |........
    D: 00 00 00 00 00 00 00 00 |........
    D: plaintext
    D: ea 97 0e 97 96 e1 92 71 |.......q
    D: ed f8 8b 56 b8 88 5e e2 |...V..^.
    D: enc_data
    D: 56 dc ee 59 34 2b ed bb |V..Y4+..
    D: 9d 5b 37 47 cf 9d 06 38 |.[7G...8
    D: p2 000d3830c9f1f61bca0a7b6600000000
    D: key
    D: 00 00 00 00 00 00 00 00 |........
    D: 00 00 00 00 00 00 00 00 |........
    D: plaintext
    D: 56 d1 d6 69 fd da 1b a0 |V..i....
    D: 57 51 4c 21 cf 9d 06 38 |WQL!...8
    D: enc_data
    D: 99 cf 0a f6 47 a1 a9 e1 |....G...
    D: 8a 38 8f 44 09 88 bf 8c |.8.D....
    D: pcnf 99cf0af647a1a9e18a388f440988bf8c
    D: cfm 99cf0af647a1a9e18a388f440988bf8c
    D: key
    D: 00 00 00 00 00 00 00 00 |........
    D: 00 00 00 00 00 00 00 00 |........
    D: plaintext
    D: a2 be 4d f1 b2 35 46 79 |..M..5Fy
    D: eb 96 0f 96 96 ec 82 72 |.......r
    D: enc_data
    D: 56 82 bb 75 30 cd 38 03 |V..u0.8.
    D: ad 7a 74 59 2d 14 fe bb |.ztY-...
    D: opcode 0x2019 param_len 28
    D: buf 0x2000cb18
    D: buf 0x2000cb18 opcode 0x2019 len 31
    D: count 3
    D: ev->state 4
    D: calling net_buf_get
    D: calling sem_take_wait
    D: Sending command 0x2019 (buf 0x2000cb18) to driver
    D: buf 0x2000cb18 len 31 type 0
    D:
    D:
    D: Exit: 0
    D: ev->state 0
    D: ev->state 0
    D: Command Status (0x2019) status: 0x00
    D: buf 0x2000cb18 len 6
    D: opcode 0x2019
    D: opcode 0x2019 status 0x00 buf 0x2000cb18
    D:
    D: Adding conn 0x20001b58 to poll list
    D: Calling k_poll with 3 events
    D: rsp 0x2000cb18 opcode 0x2019 len 0
    D: handle 0 ref 3 -> 2
    D: Event (0x08) len 4
    D: buf 0x2000ca1c len 6
    D: Getting net_buf from queue
    D: buf 0x2000ca1c type 1 len 6
    D: event 0x08
    D: status 0x00 handle 0 encrypt 0x01
    D: handle 0 ref 2 -> 3
    D: F1:C9:30:38:0D:00 (random) (keys 0x0000)
    D: Encoded path bt/keys/f1c930380d001
    D: Deleting key bt/keys/f1c930380d001
    D: F1:C9:30:38:0D:00 (random)
    D: created 0x200038d0 for F1:C9:30:38:0D:00 (random)
    D: chan 0x20002074 conn 0x20001b58 handle 0 encrypt 0x01 hci status 0x00
    D: addr F1:C9:30:38:0D:00 (random)
    D: handle 0 ref 3 -> 4
    D: handle 0 ref 4 -> 3
    D: addr F1:C9:30:38:0D:00 (random)
    D: opcode 0x2027 param_len 39
    D: buf 0x2000cb18
    D: buf 0x2000cb18 opcode 0x2027 len 42
    D: Data: handle (0x00), PB(2), BC(0), len(16)
    D: buf 0x2000ca38 len 20
    D: count 3
    D: ev->state 4
    D: calling net_buf_get
    D: calling sem_take_wait
    D: Sending command 0x2027 (buf 0x2000cb18) to driver
    D: buf 0x2000cb18 len 42 type 0
    D:
    D:
    D: Exit: 0
    D: ev->state 0
    D: ev->state 0
    D: Command Complete (0x2027) status: 0x00, ncmd: 1, len 4
    D: buf 0x2000cb18 len 6
    D: opcode 0x2027
    D: opcode 0x2027 status 0x00 buf 0x2000cb18
    D:
    D: Adding conn 0x20001b58 to poll list
    D: Calling k_poll with 3 events
    D: Data: handle (0x00), PB(2), BC(0), len(21)
    D: buf 0x2000ca00 len 25
    D: rsp 0x2000cb18 opcode 0x2027 len 1
    D: addr F1:C9:30:38:0D:00 (random) mode 0x01
    D: opcode 0x204e param_len 8
    D: buf 0x2000cb18
    D: buf 0x2000cb18 opcode 0x204e len 11
    D: count 3
    D: ev->state 4
    D: calling net_buf_get
    D: calling sem_take_wait
    D: Sending command 0x204e (buf 0x2000cb18) to driver
    D: buf 0x2000cb18 len 11 type 0
    D:
    D:
    D: Exit: 0
    D: ev->state 0
    D: ev->state 0
    D: Command Complete (0x204e) status: 0x00, ncmd: 1, len 4
    D: buf 0x2000cb18 len 6
    D: opcode 0x204e
    D: opcode 0x204e status 0x00 buf 0x2000cb18
    D: Data: handle (0x00), PB(2), BC(0), len(15)
    D: buf 0x2000ca54 len 19
    D:
    D: Adding conn 0x20001b58 to poll list
    D: Calling k_poll with 3 events
    D: rsp 0x2000cb18 opcode 0x204e len 1
    D: enabled
    D: opcode 0x202d param_len 1
    D: buf 0x2000cb18
    D: buf 0x2000cb18 opcode 0x202d len 4
    D: count 3
    D: ev->state 4
    D: calling net_buf_get
    D: calling sem_take_wait
    D: Sending command 0x202d (buf 0x2000cb18) to driver
    D: buf 0x2000cb18 len 4 type 0
    D:
    D:
    D: Exit: 0
    D: ev->state 0
    D: ev->state 0
    D: Command Complete (0x202d) status: 0x00, ncmd: 1, len 4
    D: buf 0x2000cb18 len 6
    D: opcode 0x202d
    D: opcode 0x202d status 0x00 buf 0x2000cb18
    D:
    D: Adding conn 0x20001b58 to poll list
    D: Calling k_poll with 3 events
    D: rsp 0x2000cb18 opcode 0x202d len 1
    D: chan 0x20009cac conn 0x20001b58 handle 0 sec_level 0x02 status 0x00
    D: conn 0x20001b58
    Security changed: F1:C9:30:38:0D:00 (random) level 2
    D: req 0x2000cd30
    D: uuid 1812 start_handle 0x0001 end_handle 0xffff
    D: conn 0x20001b58 req 0x2000cd30
    D: req 0x2000cd30
    D: chan 0x20009ca8 req 0x2000cd30 len 9
    D: chan 0x20009ca8 flags 4 code 0x06
    D: code 0x06
    D: conn 0x20001b58 cid 4 len 9
    D: conn handle 0 buf len 13 cb 0x1aba9 user_data 0x200036f8
    D: handle 0 ref 3 -> 2
    D: count 3
    D: ev->state 0
    D: ev->state 0
    D: ev->state 4
    D: conn 0x20001b58
    D: conn 0x20001b58 buf 0x2000cb50 len 13
    D: conn 0x20001b58 buf 0x2000cb50 len 13 flags 0x02
    D: buf 0x2000cb50 len 17 type 2
    D:
    D:
    D: Exit: 0
    D:
    D: Adding conn 0x20001b58 to poll list
    D: Calling k_poll with 3 events
    D: Getting net_buf from queue
    D: buf 0x2000ca38 type 3 len 20
    D: buf 0x2000ca38
    D: handle 0 len 16 flags 2
    D: handle 0 ref 2 -> 3
    D: conn 0x20001b58
    D: handle 0 len 16 flags 02
    D: First, len 16 final 12
    D: Successfully parsed 16 byte L2CAP packet
    D: Packet for CID 5 len 12
    D: chan 0x20003488 len 12
    D: Signaling code 0x12 ident 1 len 8
    D: min 0x0006 max 0x0006 latency: 0x0022 timeout: 0x00d8
    D: conn 0x20001b58 cid 5 len 6
    D: conn handle 0 buf len 10 cb (nil) user_data (nil)
    D: opcode 0x2013 param_len 14
    D: buf 0x2000cb18
    D: buf 0x2000cb18 opcode 0x2013 len 17
    D: Event (0x13) len 5
    D: buf 0x2000c990 len 7
    D: num_handles 1
    D: handle 0 count 1
    D: handle 0 ref 3 -> 4
    D: handle 0 ref 4 -> 3
    D: Data: handle (0x00), PB(2), BC(0), len(27)
    D: buf 0x2000ca1c len 31
    D: count 3
    D: ev->state 4
    D: calling net_buf_get
    D: calling sem_take_wait
    D: Sending command 0x2013 (buf 0x2000cb18) to driver
    D: buf 0x2000cb18 len 17 type 0
    D:
    D:
    D: Exit: 0
    D: ev->state 0
    D: ev->state 4
    D: conn 0x20001b58
    D: conn 0x20001b58 buf 0x2000cb50 len 10
    D: conn 0x20001b58 buf 0x2000cb50 len 10 flags 0x02
    D: buf 0x2000cb50 len 14 type 2
    D:
    D:
    D: Exit: 0
    D: Command Status (0x2013) status: 0x00
    D: buf 0x2000cb18 len 6
    D: opcode 0x2013
    D: opcode 0x2013 status 0x00 buf 0x2000cb18
    D: Data: handle (0x00), PB(2), BC(0), len(9)
    D: buf 0x2000ca70 len 13
    D: Event (0x13) len 5
    D: buf 0x2000c990 len 7
    D: num_handles 1
    D: handle 0 count 1
    D: handle 0 ref 3 -> 4
    D: handle 0 ref 4 -> 3
    D:
    D: Adding conn 0x20001b58 to poll list
    D: Calling k_poll with 3 events
    D: rsp 0x2000cb18 opcode 0x2013 len 0
    D: handle 0 ref 3 -> 2
    D: Getting net_buf from queue
    D: buf 0x2000ca00 type 3 len 25
    D: buf 0x2000ca00
    D: handle 0 len 21 flags 2
    D: handle 0 ref 2 -> 3
    D: conn 0x20001b58
    D: tx 0x20003438 cb 0x1aba9 user_data 0x200036f8
    D: conn 0x20001b58 chan 0x20009cac
    D: chan 0x20009ca8
    D: chan 0x20009ca8 chan->req 0x2000cd30
    D: handle 0 len 21 flags 02
    D: First, len 21 final 17
    D: Successfully parsed 21 byte L2CAP packet
    D: Packet for CID 6 len 17
    D: chan 0x20002074 len 17
    D: Received SMP code 0x06 len 16
    D:
    D: type 4 F1:C9:30:38:0D:00 (random)
    D: type 4 F1:C9:30:38:0D:00 (random)
    D: F1:C9:30:38:0D:00 (random)
    D: handle 0 ref 3 -> 2
    D: Getting net_buf from queue
    D: buf 0x2000ca54 type 3 len 19
    D: buf 0x2000ca54
    D: handle 0 len 15 flags 2
    D: handle 0 ref 2 -> 3
    D: conn 0x20001b58
    D: handle 0 len 15 flags 02
    D: First, len 15 final 11
    D: Successfully parsed 15 byte L2CAP packet
    D: Packet for CID 6 len 11
    D: chan 0x20002074 len 11
    D: Received SMP code 0x07 len 10
    D:
    D: type 4 F1:C9:30:38:0D:00 (random)
    D: type 4 F1:C9:30:38:0D:00 (random)
    D: status 0x0
    D: Encoded path bt/keys/f1c930380d001
    D: conn 0x20001b58
    D: conn 0x20001b58
    D: Stored keys for F1:C9:30:38:0D:00 (random) (bt/keys/f1c930380d001)
    Pairing completed: F1:C9:30:38:0D:00 (random), bonded: 1
    D: handle 0 ref 3 -> 2
    D: Getting net_buf from queue
    D: buf 0x2000ca1c type 3 len 31
    D: buf 0x2000ca1c
    D: handle 0 len 27 flags 2
    D: handle 0 ref 2 -> 3
    D: conn 0x20001b58
    D: handle 0 len 27 flags 02
    D: First, len 27 final 23
    D: Successfully parsed 27 byte L2CAP packet
    D: Packet for CID 4 len 23
    D: chan 0x20009cac len 23
    D: Received ATT chan 0x20009ca8 code 0x06 len 22
    D: start_handle 0x0001 end_handle 0xffff type 10240
    D: handle 0x0001
    D: handle 0x0000 offset 0 length 2
    D: handle 0x0009
    D: handle 0x0000 offset 0 length 2
    D: code 0x01
    D: conn 0x20001b58 cid 4 len 5
    D: conn handle 0 buf len 9 cb 0x1ac25 user_data 0x20003720
    D: handle 0 ref 3 -> 2
    D: count 3
    D: ev->state 0
    D: ev->state 0
    D: ev->state 4
    D: conn 0x20001b58
    D: conn 0x20001b58 buf 0x2000cb50 len 9
    D: conn 0x20001b58 buf 0x2000cb50 len 9 flags 0x02
    D: buf 0x2000cb50 len 13 type 2
    D:
    D:
    D: Exit: 0
    D:
    D: Adding conn 0x20001b58 to poll list
    D: Calling k_poll with 3 events
    D: Getting net_buf from queue
    D: buf 0x2000ca70 type 3 len 13
    D: buf 0x2000ca70
    D: handle 0 len 9 flags 2
    D: handle 0 ref 2 -> 3
    D: conn 0x20001b58
    D: handle 0 len 9 flags 02
    D: First, len 9 final 5
    D: Successfully parsed 9 byte L2CAP packet
    D: Packet for CID 4 len 5
    D: chan 0x20009cac len 5
    D: Received ATT chan 0x20009ca8 code 0x07 len 4
    D:
    D: chan 0x20009ca8 err 0x00 len 4: 17002900
    D: req 0x2000cd30
    D: err 0x00
    D: start_handle 0x0017 end_handle 0x0029
    D: start_handle 0x0018 end_handle 0x0029
    D: req 0x2000cd30
    D: conn 0x20001b58 req 0x2000cd30
    D: req 0x2000cd30
    D: chan 0x20009ca8 req 0x2000cd30 len 5
    D: chan 0x20009ca8 flags 5 code 0x04
    D: code 0x04
    D: conn 0x20001b58 cid 4 len 5
    D: conn handle 0 buf len 9 cb 0x1aba9 user_data 0x20003734
    D: handle 0 ref 3 -> 2
    D: Event (0x13) len 5
    D: buf 0x2000c990 len 7
    D: num_handles 1
    D: handle 0 count 1
    D: handle 0 ref 2 -> 3
    D: handle 0 ref 3 -> 2
    D: Data: handle (0x00), PB(2), BC(0), len(27)
    D: buf 0x2000ca70 len 31
    D: LE Meta Event (0x03), len (10)
    D: buf 0x2000ca1c len 12
    D: count 3
    D: ev->state 0
    D: ev->state 0
    D: ev->state 4
    D: conn 0x20001b58
    D: conn 0x20001b58 buf 0x2000cb50 len 9
    D: conn 0x20001b58 buf 0x2000cb50 len 9 flags 0x02
    D: buf 0x2000cb50 len 13 type 2
    D:
    D:
    D: Exit: 0
    D:
    D: Adding conn 0x20001b58 to poll list
    D: Calling k_poll with 3 events
    D: Getting net_buf from queue
    D: buf 0x2000ca70 type 3 len 31
    D: buf 0x2000ca70
    D: handle 0 len 27 flags 2
    D: handle 0 ref 2 -> 3
    D: conn 0x20001b58
    D: tx 0x20003448 cb 0x1ac25 user_data 0x20003720
    D: conn 0x20001b58 chan 0x20009cac
    D: chan 0x20009ca8
    D: chan 0x20009ca8
    D: handle 0 len 27 flags 02
    D: First, len 27 final 23
    D: Successfully parsed 27 byte L2CAP packet
    D: Packet for CID 4 len 23
    D: chan 0x20009cac len 23
    D: Received ATT chan 0x20009ca8 code 0x06 len 22
    D: start_handle 0x0001 end_handle 0xffff type 10240
    D: handle 0x0001
    D: handle 0x0000 offset 0 length 2
    D: handle 0x0009
    D: handle 0x0000 offset 0 length 2
    D: code 0x01
    D: conn 0x20001b58 cid 4 len 5
    D: conn handle 0 buf len 9 cb 0x1ac25 user_data 0x200036f8
    D: handle 0 ref 3 -> 2
    D: Event (0x13) len 5
    D: buf 0x2000c990 len 7
    D: num_handles 1
    D: handle 0 count 1
    D: handle 0 ref 2 -> 3
    D: handle 0 ref 3 -> 2
    D: Data: handle (0x00), PB(2), BC(0), len(18)
    D: buf 0x2000ca70 len 22
    D: count 3
    D: ev->state 0
    D: ev->state 0
    D: ev->state 4
    D: conn 0x20001b58
    D: conn 0x20001b58 buf 0x2000cb50 len 9
    D: conn 0x20001b58 buf 0x2000cb50 len 9 flags 0x02
    D: buf 0x2000cb50 len 13 type 2
    D:
    D:
    D: Exit: 0
    D:
    D: Adding conn 0x20001b58 to poll list
    D: Calling k_poll with 3 events
    D: Event (0x13) len 5
    D: buf 0x2000c990 len 7
    D: num_handles 1
    D: handle 0 count 1
    D: handle 0 ref 2 -> 3
    D: handle 0 ref 3 -> 2
    D: Data: handle (0x00), PB(2), BC(0), len(11)
    D: buf 0x2000ca54 len 15
    D: Getting net_buf from queue
    D: buf 0x2000ca1c type 1 len 12
    D: event 0x3e
    D: subevent 0x03
    D: status 0x00, handle 0
    D: handle 0 ref 2 -> 3
    D: handle 0 ref 3 -> 2
    D: Getting net_buf from queue
    D: buf 0x2000ca70 type 3 len 22
    D: buf 0x2000ca70
    D: handle 0 len 18 flags 2
    D: handle 0 ref 2 -> 3
    D: conn 0x20001b58
    D: tx 0x20003458 cb 0x1aba9 user_data 0x20003734
    D: conn 0x20001b58 chan 0x20009cac
    D: chan 0x20009ca8
    D: chan 0x20009ca8 chan->req 0x2000cd30
    D: tx 0x20003468 cb 0x1ac25 user_data 0x200036f8
    D: conn 0x20001b58 chan 0x20009cac
    D: chan 0x20009ca8
    D: chan 0x20009ca8
    D: handle 0 len 18 flags 02
    D: First, len 18 final 14
    D: Successfully parsed 18 byte L2CAP packet
    D: Packet for CID 4 len 14
    D: chan 0x20009cac len 14
    D: Received ATT chan 0x20009ca8 code 0x05 len 13
    D:
    D: chan 0x20009ca8 err 0x00 len 13: 0119004e2a1b004d2a1c000229
    D: req 0x2000cd30
    D: err 0x00
    D: handle 0x0019 uuid 2a4e
    D: handle 0x001b uuid 2a4d
    D: handle 0x001c uuid 2902
    D: start_handle 0x001d end_handle 0x0029
    D: req 0x2000cd30
    D: conn 0x20001b58 req 0x2000cd30
    D: req 0x2000cd30
    D: chan 0x20009ca8 req 0x2000cd30 len 5
    D: chan 0x20009ca8 flags 4 code 0x04
    D: code 0x04
    D: conn 0x20001b58 cid 4 len 5
    D: conn handle 0 buf len 9 cb 0x1aba9 user_data 0x2000370c
    D: handle 0 ref 3 -> 2
    D: count 3
    D: ev->state 0
    D: ev->state 0
    D: ev->state 4
    D: conn 0x20001b58
    D: conn 0x20001b58 buf 0x2000cb50 len 9
    D: conn 0x20001b58 buf 0x2000cb50 len 9 flags 0x02
    D: buf 0x2000cb50 len 13 type 2
    D:
    D:
    D: Exit: 0
    D:
    D: Adding conn 0x20001b58 to poll list
    D: Calling k_poll with 3 events
    D: Getting net_buf from queue
    D: buf 0x2000ca54 type 3 len 15
    D: buf 0x2000ca54
    D: handle 0 len 11 flags 2
    D: handle 0 ref 2 -> 3
    D: conn 0x20001b58
    D: handle 0 len 11 flags 02
    D: First, len 11 final 7
    D: Successfully parsed 11 byte L2CAP packet
    D: Packet for CID 4 len 7
    D: chan 0x20009cac len 7
    D: Received ATT chan 0x20009ca8 code 0x08 len 6
    D: start_handle 0x0001 end_handle 0xffff type 2803
    D: handle 0x0002
    D: handle 0x0000 offset 0 length 5
    D: handle 0x0005
    D: handle 0x0000 offset 0 length 5
    D: code 0x09
    D: conn 0x20001b58 cid 4 len 16
    D: conn handle 0 buf len 20 cb 0x1ac25 user_data 0x20003720
    D: handle 0 ref 3 -> 2
    D: Event (0x13) len 5
    D: buf 0x2000c990 len 7
    D: num_handles 1
    D: handle 0 count 1
    D: handle 0 ref 2 -> 3
    D: handle 0 ref 3 -> 2
    D: Data: handle (0x00), PB(2), BC(0), len(18)
    D: buf 0x2000ca54 len 22
    D: count 3
    D: ev->state 0
    D: ev->state 0
    D: ev->state 4
    D: conn 0x20001b58
    D: conn 0x20001b58 buf 0x2000cb50 len 20
    D: conn 0x20001b58 buf 0x2000cb50 len 20 flags 0x02
    D: buf 0x2000cb50 len 24 type 2
    D:
    D:
    D: Exit: 0
    D:
    D: Adding conn 0x20001b58 to poll list
    D: Calling k_poll with 3 events
    D: Event (0x13) len 5
    D: buf 0x2000c990 len 7
    D: num_handles 1
    D: handle 0 count 1
    D: handle 0 ref 2 -> 3
    D: handle 0 ref 3 -> 2
    D: Data: handle (0x00), PB(2), BC(0), len(11)
    D: buf 0x2000ca70 len 15
    D: Getting net_buf from queue
    D: buf 0x2000ca54 type 3 len 22
    D: buf 0x2000ca54
    D: handle 0 len 18 flags 2
    D: handle 0 ref 2 -> 3
    D: conn 0x20001b58
    D: tx 0x20003478 cb 0x1aba9 user_data 0x2000370c
    D: conn 0x20001b58 chan 0x20009cac
    D: chan 0x20009ca8
    D: chan 0x20009ca8 chan->req 0x2000cd30
    D: tx 0x20003438 cb 0x1ac25 user_data 0x20003720
    D: conn 0x20001b58 chan 0x20009cac
    D: chan 0x20009ca8
    D: chan 0x20009ca8
    D: handle 0 len 18 flags 02
    D: First, len 18 final 14
    D: Successfully parsed 18 byte L2CAP packet
    D: Packet for CID 4 len 14
    D: chan 0x20009cac len 14
    D: Received ATT chan 0x20009ca8 code 0x05 len 13
    D:
    D: chan 0x20009ca8 err 0x00 len 13: 011d0008291f004d2a20000829
    D: req 0x2000cd30
    D: err 0x00
    D: handle 0x001d uuid 2908
    D: handle 0x001f uuid 2a4d
    D: handle 0x0020 uuid 2908
    D: start_handle 0x0021 end_handle 0x0029
    D: req 0x2000cd30
    D: conn 0x20001b58 req 0x2000cd30
    D: req 0x2000cd30
    D: chan 0x20009ca8 req 0x2000cd30 len 5
    D: chan 0x20009ca8 flags 4 code 0x04
    D: code 0x04
    D: conn 0x20001b58 cid 4 len 5
    D: conn handle 0 buf len 9 cb 0x1aba9 user_data 0x20003748
    D: handle 0 ref 3 -> 2
    D: count 3
    D: ev->state 0
    D: ev->state 0
    D: ev->state 4
    D: conn 0x20001b58
    D: conn 0x20001b58 buf 0x2000cb50 len 9
    D: conn 0x20001b58 buf 0x2000cb50 len 9 flags 0x02
    D: buf 0x2000cb50 len 13 type 2
    D:
    D:
    D: Exit: 0
    D:
    D: Adding conn 0x20001b58 to poll list
    D: Calling k_poll with 3 events
    D: Event (0x13) len 5
    D: buf 0x2000c990 len 7
    D: num_handles 1
    D: handle 0 count 1
    D: handle 0 ref 2 -> 3
    D: handle 0 ref 3 -> 2
    D: Data: handle (0x00), PB(2), BC(0), len(18)
    D: buf 0x2000ca54 len 22
    D: Getting net_buf from queue
    D: buf 0x2000ca70 type 3 len 15
    D: buf 0x2000ca70
    D: handle 0 len 11 flags 2
    D: handle 0 ref 2 -> 3
    D: conn 0x20001b58
    D: tx 0x20003448 cb 0x1aba9 user_data 0x20003748
    D: conn 0x20001b58 chan 0x20009cac
    D: chan 0x20009ca8
    D: chan 0x20009ca8 chan->req 0x2000cd30
    D: handle 0 len 11 flags 02
    D: First, len 11 final 7
    D: Successfully parsed 11 byte L2CAP packet
    D: Packet for CID 4 len 7
    D: chan 0x20009cac len 7
    D: Received ATT chan 0x20009ca8 code 0x08 len 6
    D: start_handle 0x0007 end_handle 0xffff type 2803
    D: handle 0x0007
    D: handle 0x0000 offset 0 length 5
    D: handle 0x000a
    D: handle 0x0000 offset 0 length 5
    D: code 0x09
    D: conn 0x20001b58 cid 4 len 16
    D: conn handle 0 buf len 20 cb 0x1ac25 user_data 0x20003734
    D: handle 0 ref 3 -> 2
    D: count 3
    D: ev->state 0
    D: ev->state 0
    D: ev->state 4
    D: conn 0x20001b58
    D: conn 0x20001b58 buf 0x2000cb50 len 20
    D: conn 0x20001b58 buf 0x2000cb50 len 20 flags 0x02
    D: buf 0x2000cb50 len 24 type 2
    D:
    D:
    D: Exit: 0
    D:
    D: Adding conn 0x20001b58 to poll list
    D: Calling k_poll with 3 events
    D: Event (0x13) len 5
    D: buf 0x2000c990 len 7
    D: num_handles 1
    D: handle 0 count 1
    D: handle 0 ref 2 -> 3
    D: handle 0 ref 3 -> 2
    D: Data: handle (0x00), PB(2), BC(0), len(11)
    D: buf 0x2000ca70 len 15
    D: Getting net_buf from queue
    D: buf 0x2000ca54 type 3 len 22
    D: buf 0x2000ca54
    D: handle 0 len 18 flags 2
    D: handle 0 ref 2 -> 3
    D: conn 0x20001b58
    D: tx 0x20003458 cb 0x1ac25 user_data 0x20003734
    D: conn 0x20001b58 chan 0x20009cac
    D: chan 0x20009ca8
    D: chan 0x20009ca8
    D: handle 0 len 18 flags 02
    D: First, len 18 final 14
    D: Successfully parsed 18 byte L2CAP packet
    D: Packet for CID 4 len 14
    D: chan 0x20009cac len 14
    D: Received ATT chan 0x20009ca8 code 0x05 len 13
    D:
    D: chan 0x20009ca8 err 0x00 len 13: 0122004b2a2400332a25000229
    D: req 0x2000cd30
    D: err 0x00
    D: handle 0x0022 uuid 2a4b
    D: handle 0x0024 uuid 2a33
    D: handle 0x0025 uuid 2902
    D: start_handle 0x0026 end_handle 0x0029
    D: req 0x2000cd30
    D: conn 0x20001b58 req 0x2000cd30
    D: req 0x2000cd30
    D: chan 0x20009ca8 req 0x2000cd30 len 5
    D: chan 0x20009ca8 flags 4 code 0x04
    D: code 0x04
    D: conn 0x20001b58 cid 4 len 5
    D: conn handle 0 buf len 9 cb 0x1aba9 user_data 0x200036f8
    D: handle 0 ref 3 -> 2
    D: count 3
    D: ev->state 0
    D: ev->state 0
    D: ev->state 4
    D: conn 0x20001b58
    D: conn 0x20001b58 buf 0x2000cb50 len 9
    D: conn 0x20001b58 buf 0x2000cb50 len 9 flags 0x02
    D: buf 0x2000cb50 len 13 type 2
    D:
    D:
    D: Exit: 0
    D:
    D: Adding conn 0x20001b58 to poll list
    D: Calling k_poll with 3 events
    D: Event (0x13) len 5
    D: buf 0x2000c990 len 7
    D: num_handles 1
    D: handle 0 count 1
    D: handle 0 ref 2 -> 3
    D: handle 0 ref 3 -> 2
    D: Data: handle (0x00), PB(2), BC(0), len(14)
    D: buf 0x2000ca54 len 18
    D: Getting net_buf from queue
    D: buf 0x2000ca70 type 3 len 15
    D: buf 0x2000ca70
    D: handle 0 len 11 flags 2
    D: handle 0 ref 2 -> 3
    D: conn 0x20001b58
    D: tx 0x20003468 cb 0x1aba9 user_data 0x200036f8
    D: conn 0x20001b58 chan 0x20009cac
    D: chan 0x20009ca8
    D: chan 0x20009ca8 chan->req 0x2000cd30
    D: handle 0 len 11 flags 02
    D: First, len 11 final 7
    D: Successfully parsed 11 byte L2CAP packet
    D: Packet for CID 4 len 7
    D: chan 0x20009cac len 7
    D: Received ATT chan 0x20009ca8 code 0x08 len 6
    D: start_handle 0x000c end_handle 0xffff type 2803
    D: handle 0x000c
    D: handle 0x0000 offset 0 length 5
    D: handle 0x000e
    D: handle 0x0000 offset 0 length 5
    D: code 0x09
    D: conn 0x20001b58 cid 4 len 16
    D: conn handle 0 buf len 20 cb 0x1ac25 user_data 0x2000370c
    D: handle 0 ref 3 -> 2
    D: count 3
    D: ev->state 0
    D: ev->state 0
    D: ev->state 4
    D: conn 0x20001b58
    D: conn 0x20001b58 buf 0x2000cb50 len 20
    D: conn 0x20001b58 buf 0x2000cb50 len 20 flags 0x02
    D: buf 0x2000cb50 len 24 type 2
    D:
    D:
    D: Exit: 0
    D:
    D: Adding conn 0x20001b58 to poll list
    D: Calling k_poll with 3 events
    D: Event (0x13) len 5
    D: buf 0x2000c990 len 7
    D: num_handles 1
    D: handle 0 count 1
    D: handle 0 ref 2 -> 3
    D: handle 0 ref 3 -> 2
    D: Getting net_buf from queue
    D: buf 0x2000ca54 type 3 len 18
    D: buf 0x2000ca54
    D: handle 0 len 14 flags 2
    D: handle 0 ref 2 -> 3
    D: conn 0x20001b58
    D: tx 0x20003478 cb 0x1ac25 user_data 0x2000370c
    D: conn 0x20001b58 chan 0x20009cac
    D: chan 0x20009ca8
    D: chan 0x20009ca8
    D: handle 0 len 14 flags 02
    D: First, len 14 final 10
    D: Successfully parsed 14 byte L2CAP packet
    D: Packet for CID 4 len 10
    D: chan 0x20009cac len 10
    D: Received ATT chan 0x20009ca8 code 0x05 len 9
    D:
    D: chan 0x20009ca8 err 0x00 len 9: 0127004a2a29004c2a
    D: req 0x2000cd30
    D: err 0x00
    D: handle 0x0027 uuid 2a4a
    D: handle 0x0029 uuid 2a4c
    D: start_handle 0x0018 end_handle 0x0029
    D: req 0x2000cd30
    D: conn 0x20001b58 req 0x2000cd30
    D: req 0x2000cd30
    D: chan 0x20009ca8 req 0x2000cd30 len 7
    D: chan 0x20009ca8 flags 4 code 0x08
    D: code 0x08
    D: conn 0x20001b58 cid 4 len 7
    D: conn handle 0 buf len 11 cb 0x1aba9 user_data 0x20003720
    D: handle 0 ref 3 -> 2
    D: count 3
    D: ev->state 0
    D: ev->state 0
    D: ev->state 4
    D: conn 0x20001b58
    D: conn 0x20001b58 buf 0x2000cb50 len 11
    D: conn 0x20001b58 buf 0x2000cb50 len 11 flags 0x02
    D: buf 0x2000cb50 len 15 type 2
    D:
    D:
    D: Exit: 0
    D:
    D: Adding conn 0x20001b58 to poll list
    D: Calling k_poll with 3 events
    D: Event (0x13) len 5
    D: buf 0x2000c990 len 7
    D: num_handles 1
    D: handle 0 count 1
    D: handle 0 ref 2 -> 3
    D: handle 0 ref 3 -> 2
    D: Data: handle (0x00), PB(2), BC(0), len(27)
    D: buf 0x2000ca54 len 31
    D: Getting net_buf from queue
    D: buf 0x2000ca54 type 3 len 31
    D: buf 0x2000ca54
    D: handle 0 len 27 flags 2
    D: handle 0 ref 2 -> 3
    D: conn 0x20001b58
    D: tx 0x20003438 cb 0x1aba9 user_data 0x20003720
    D: conn 0x20001b58 chan 0x20009cac
    D: chan 0x20009ca8
    D: chan 0x20009ca8 chan->req 0x2000cd30
    D: handle 0 len 27 flags 02
    D: First, len 27 final 23
    D: Successfully parsed 27 byte L2CAP packet
    D: Packet for CID 4 len 23
    D: chan 0x20009cac len 23
    D: Received ATT chan 0x20009ca8 code 0x09 len 22
    D:
    D: chan 0x20009ca8 err 0x00 len 22: 0718000619004e2a1a00121b004d2a1e000a1f004d2a
    D: req 0x2000cd30
    D: err 0x00
    D: handle 0x0018 uuid 2a4e properties 0x06
    The discovery procedure failed with -3
    D: handle 0 ref 3 -> 2
    D: conn 0x20001b58
    D: conn 0x20001b58
    

  • I am not able to pinpoint the exact issue from here. Have you attempted to debug to see exactly where the error comes from? Which API call returns -ENOMEM, and how far down can you track it? That should give a good indication on what needs to be adjusted.

  • I found that the error comes from L417 "discovery_process_characteristic" in gatt_dm.c https://github.com/nrfconnect/sdk-nrf/blob/v2.1.0/subsys/bluetooth/gatt_dm.c#L417

    However, this is not the reason why the Central HIDS example does not work with ELECOM mouse. Below is a list of attributes stored during the connection. In Logitech, all handles are stored sequentially, while ELECOM lacks some handles. This is a variation of behavior among BLE peripherals.

    Logitech

    ### (bt_gatt_dm_attr) Attr store, pos: 0, handle: 0x001f, uuid: 0x2800, uuid_size: 4
    ### (bt_gatt_dm_attr) Attr store, pos: 1, handle: 0x0020, uuid: 0x2803, uuid_size: 4
    ### (bt_gatt_dm_attr) Attr store, pos: 2, handle: 0x0021, uuid: 0x2a4a, uuid_size: 4
    ### (bt_gatt_dm_attr) Attr store, pos: 3, handle: 0x0022, uuid: 0x2803, uuid_size: 4
    ### (bt_gatt_dm_attr) Attr store, pos: 4, handle: 0x0023, uuid: 0x2a33, uuid_size: 4
    ### (bt_gatt_dm_attr) Attr store, pos: 5, handle: 0x0024, uuid: 0x2902, uuid_size: 4
    ### (bt_gatt_dm_attr) Attr store, pos: 6, handle: 0x0025, uuid: 0x2803, uuid_size: 4
    ### (bt_gatt_dm_attr) Attr store, pos: 7, handle: 0x0026, uuid: 0x2a4b, uuid_size: 4
    ### (bt_gatt_dm_attr) Attr store, pos: 8, handle: 0x0027, uuid: 0x2803, uuid_size: 4
    ### (bt_gatt_dm_attr) Attr store, pos: 9, handle: 0x0028, uuid: 0x2a4d, uuid_size: 4
    ### (bt_gatt_dm_attr) Attr store, pos: 10, handle: 0x0029, uuid: 0x2902, uuid_size: 4
    ### (bt_gatt_dm_attr) Attr store, pos: 11, handle: 0x002a, uuid: 0x2908, uuid_size: 4
    ### (bt_gatt_dm_attr) Attr store, pos: 12, handle: 0x002b, uuid: 0x2803, uuid_size: 4
    ### (bt_gatt_dm_attr) Attr store, pos: 13, handle: 0x002c, uuid: 0x2a4d, uuid_size: 4
    ### (bt_gatt_dm_attr) Attr store, pos: 14, handle: 0x002d, uuid: 0x2902, uuid_size: 4
    ### (bt_gatt_dm_attr) Attr store, pos: 15, handle: 0x002e, uuid: 0x2908, uuid_size: 4
    ### (bt_gatt_dm_attr) Attr store, pos: 16, handle: 0x002f, uuid: 0x2803, uuid_size: 4
    ### (bt_gatt_dm_attr) Attr store, pos: 17, handle: 0x0030, uuid: 0x2a4d, uuid_size: 4
    ### (bt_gatt_dm_attr) Attr store, pos: 18, handle: 0x0031, uuid: 0x2908, uuid_size: 4
    ### (bt_gatt_dm_attr) Attr store, pos: 19, handle: 0x0032, uuid: 0x2803, uuid_size: 4
    ### (bt_gatt_dm_attr) Attr store, pos: 20, handle: 0x0033, uuid: 0x2a4c, uuid_size: 4
    ### (bt_gatt_dm_attr) Attr store, pos: 21, handle: 0x0034, uuid: 0x2803, uuid_size: 4
    ### (bt_gatt_dm_attr) Attr store, pos: 22, handle: 0x0035, uuid: 0x2a4e, uuid_size: 4
    
    ### (parse_characteristic) handle: 0x0020, uuid: 2a4a, properties: 0x02
    ### (bt_gatt_dm_attr) look for an attr with handle: 0x0020
    ### return: 1, handle:0x0020
    ===> It find the DM ently
    

    ELECOM

    ### (bt_gatt_dm_attr) Attr store, pos: 0, handle: 0x0017, uuid: 0x2800, uuid_size: 4
    ### (bt_gatt_dm_attr) Attr store, pos: 1, handle: 0x0019, uuid: 0x2a4e, uuid_size: 4
    ### (bt_gatt_dm_attr) Attr store, pos: 2, handle: 0x001b, uuid: 0x2a4d, uuid_size: 4
    ### (bt_gatt_dm_attr) Attr store, pos: 3, handle: 0x001c, uuid: 0x2902, uuid_size: 4
    ### (bt_gatt_dm_attr) Attr store, pos: 4, handle: 0x001d, uuid: 0x2908, uuid_size: 4
    ### (bt_gatt_dm_attr) Attr store, pos: 5, handle: 0x001f, uuid: 0x2a4d, uuid_size: 4
    ### (bt_gatt_dm_attr) Attr store, pos: 6, handle: 0x0020, uuid: 0x2908, uuid_size: 4
    ### (bt_gatt_dm_attr) Attr store, pos: 7, handle: 0x0022, uuid: 0x2a4b, uuid_size: 4
    ### (bt_gatt_dm_attr) Attr store, pos: 8, handle: 0x0024, uuid: 0x2a33, uuid_size: 4
    ### (bt_gatt_dm_attr) Attr store, pos: 9, handle: 0x0025, uuid: 0x2902, uuid_size: 4
    ### (bt_gatt_dm_attr) Attr store, pos: 10, handle: 0x0027, uuid: 0x2a4a, uuid_size: 4
    ### (bt_gatt_dm_attr) Attr store, pos: 11, handle: 0x0029, uuid: 0x2a4c, uuid_size: 4
    
    ### (parse_characteristic) handle: 0x0018, uuid: 2a4e, properties: 0x06
    ### (bt_gatt_dm_attr) look for an attr with handle: 0x0018
    ===> It fails as handle 0x0018 does not exist.
    

    Why, this happens? I capture BLE packets (1) ELECOM + Central HIDS example (2) ELECOM + iPad. The example reads GATT database by "Find Information 0x04", while iPad does by "Read by Type 0x08". (See details in the attached files. You need filter ATT packets by "btatt".) I also found that Windows 10 also use "Read by Type". This causes the lack of information in the Central HIDS example.

    So, I wan to change the method to read GATT database by not "Find Information" but "Read by Type" like iPad does. How can I do this?

    elecom2.pcapngipad_elecom.pcapng

Related