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,

    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