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)

  • 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.

Related