How to debug bluetooth stack on windows, what tools to use

0

Question: How to debug Windows10 Bluetooth stack? what tools to use?

Setup: embedded Linux board connected via bluetooth to Windows10 machine

Connection: The Linux board is connecting to Windows10 machine using bluetooth bnep service, it works well.

Issue: It works well until Linux board is rebooted, then when Linux board is trying to connect to Windows machine, windows is always refusing to connect to bnep service as if it does not supported it.

(this is my understanding from Linux logs, and I do not know how to get any logs form windows side)

Question 2: Why is windows refusing the connection?

Windows10 machine Bluetooth:

Manufacturer: Cambridge Silicon Radio Ltd.     Hardware Ids: USB\VID_0A12&PID_0001&REV_8891

Driver version: 10.0.17134.1067 

Linux board log created with btmon: complete log wireshark version , syslog:bluetoothd syslog


    Bluetooth monitor ver 5.48
    = New Index: 00:04:F3:0E:1C:61 (Primary,UART,hci0)              [hci0] 0.964086
     HCI Event: Command Status (0x0f) plen 4                    #2 [hci0] 6.047900
          Create Connection (0x01|0x0005) ncmd 1
            Status: Success (0x00)
    > HCI Event: Connect Complete (0x03) plen 11                #3 [hci0] 11.174878
            Status: Page Timeout (0x04)
            Handle: 3839
            Address: 00:1A:7D:DA:71:11 (OUI 00-1A-7D)
            Link type: ACL (0x01)
            Encryption: Disabled (0x00)
    @ Connect Failed: 00:1A:7D:DA:71:11 (0) status 0x04
     HCI Event: Command Status (0x0f) plen 4                   #5 [hci0] 21.943722
          Create Connection (0x01|0x0005) ncmd 1
            Status: Success (0x00)
    > HCI Event: Role Change (0x12) plen 8                      #6 [hci0] 22.302343
            Status: Success (0x00)
            Address: 00:1A:7D:DA:71:11 (OUI 00-1A-7D)
            Role: Slave (0x01)
    > HCI Event: Connect Complete (0x03) plen 11                #7 [hci0] 22.336363
            Status: Success (0x00)
            Handle: 21
            Address: 00:1A:7D:DA:71:11 (OUI 00-1A-7D)
            Link type: ACL (0x01)
            Encryption: Disabled (0x00)
     HCI Event: Command Status (0x0f) plen 4                   #9 [hci0] 22.337862
          Read Remote Supported Features (0x01|0x001b) ncmd 1
            Status: Success (0x00)
    > HCI Event: Read Remote Supported Featu.. (0x0b) plen 11  #10 [hci0] 22.352464
            Status: Success (0x00)
            Handle: 21
            Features: 0xff 0xff 0x8f 0xfe 0xdb 0xff 0x5b 0x87
              3 slot packets
              5 slot packets
              Encryption
              Slot offset
              Timing accuracy
              Role switch
              Hold mode
              Sniff mode
              Park state
              Power control requests
              Channel quality driven data rate (CQDDR)
              SCO link
              HV2 packets
              HV3 packets
              u-law log synchronous data
              A-law log synchronous data
              CVSD synchronous data
              Paging parameter negotiation
              Power control
              Transparent synchronous data
              Broadcast Encryption
              Enhanced Data Rate ACL 2 Mbps mode
              Enhanced Data Rate ACL 3 Mbps mode
              Enhanced inquiry scan
              Interlaced inquiry scan
              Interlaced page scan
              RSSI with inquiry results
              Extended SCO link (EV3 packets)
              EV4 packets
              EV5 packets
              AFH capable slave
              AFH classification slave
              LE Supported (Controller)
              3-slot Enhanced Data Rate ACL packets
              5-slot Enhanced Data Rate ACL packets
              Sniff subrating
              Pause encryption
              AFH capable master
              AFH classification master
              Enhanced Data Rate eSCO 2 Mbps mode
              Enhanced Data Rate eSCO 3 Mbps mode
              3-slot Enhanced Data Rate eSCO packets
              Extended Inquiry Response
              Simultaneous LE and BR/EDR (Controller)
              Secure Simple Pairing
              Encapsulated PDU
              Non-flushable Packet Boundary Flag
              Link Supervision Timeout Changed Event
              Inquiry TX Power Level
              Enhanced Power Control
              Extended features
     HCI Event: Command Status (0x0f) plen 4                  #12 [hci0] 22.353738
          Read Remote Extended Features (0x01|0x001c) ncmd 1
            Status: Success (0x00)
    > HCI Event: Read Remote Extended Features (0x23) plen 13  #13 [hci0] 22.359895
            Status: Success (0x00)
            Handle: 21
            Page: 1/1
            Features: 0x07 0x00 0x00 0x00 0x00 0x00 0x00 0x00
              Secure Simple Pairing (Host Support)
              LE Supported (Host)
              Simultaneous LE and BR/EDR (Host)
     HCI Event: Command Status (0x0f) plen 4                  #15 [hci0] 22.360591
          Remote Name Request (0x01|0x0019) ncmd 1
            Status: Success (0x00)
    > HCI Event: Remote Name Req Complete (0x07) plen 255      #16 [hci0] 22.369271
            Status: Success (0x00)
            Address: 00:1A:7D:DA:71:11 (OUI 00-1A-7D)
            Name: PC0184691
     HCI Event: Command Status (0x0f) plen 4                  #18 [hci0] 22.371420
          Authentication Requested (0x01|0x0011) ncmd 1
            Status: Success (0x00)
    > HCI Event: Link Key Request (0x17) plen 6                #19 [hci0] 22.371517
            Address: 00:1A:7D:DA:71:11 (OUI 00-1A-7D)
     HCI Event: Command Complete (0x0e) plen 10               #21 [hci0] 22.372259
          Link Key Request Reply (0x01|0x000b) ncmd 1
            Status: Success (0x00)
            Address: 00:1A:7D:DA:71:11 (OUI 00-1A-7D)
    @ Device Connected: 00:1A:7D:DA:71:11 (0) flags 0x0000
            0a 09 50 43 30 31 38 34 36 39 31                 ..PC0184691     
    > HCI Event: Auth Complete (0x06) plen 3                   #22 [hci0] 22.492450
            Status: Success (0x00)
            Handle: 21
     HCI Event: Command Status (0x0f) plen 4                  #24 [hci0] 22.493058
          Set Connection Encryption (0x01|0x0013) ncmd 1
            Status: Success (0x00)
    > HCI Event: Encryption Change (0x08) plen 4               #25 [hci0] 22.527926
            Status: Success (0x00)
            Handle: 21
            Encryption: Enabled with E0 (0x01)
     HCI Event: Number of Completed Packets (0x13) plen 5     #27 [hci0] 22.536970
            Num handles: 1
            Handle: 21
            Count: 1
    > ACL Data RX: Handle 21 flags 0x02 dlen 16                #28 [hci0] 22.537208
          L2CAP: Information Response (0x0b) ident 1 len 8
            Type: Extended features supported (0x0002)
            Result: Success (0x0000)
            Features: 0x000000b8
              Enhanced Retransmission Mode
              Streaming Mode
              FCS Option
              Fixed Channels
     HCI Event: Number of Completed Packets (0x13) plen 5     #30 [hci0] 22.543231
            Num handles: 1
            Handle: 21
            Count: 1
    > ACL Data RX: Handle 21 flags 0x02 dlen 20                #31 [hci0] 22.543692
          L2CAP: Information Response (0x0b) ident 2 len 12
            Type: Fixed channels supported (0x0003)
            Result: Success (0x0000)
            Channels: 0x00000000000000f2
              L2CAP Signaling (BR/EDR)
              Attribute Protocol
              L2CAP Signaling (LE)
              Security Manager (LE)
              Security Manager (BR/EDR)
     HCI Event: Number of Completed Packets (0x13) plen 5     #33 [hci0] 22.549461
            Num handles: 1
            Handle: 21
            Count: 1
    > ACL Data RX: Handle 21 flags 0x02 dlen 16                #34 [hci0] 22.549800
          L2CAP: Connection Response (0x03) ident 3 len 8
            Destination CID: 64
            Source CID: 64
            Result: Connection pending (0x0001)
            Status: No further information available (0x0000)
    > ACL Data RX: Handle 21 flags 0x02 dlen 16                #35 [hci0] 37.590680
          L2CAP: Connection Response (0x03) ident 3 len 8
            Destination CID: 0
            Source CID: 0
            Result: Connection refused - PSM not supported (0x0002)
            Status: No further information available (0x0000)
     HCI Event: Command Status (0x0f) plen 4                  #37 [hci0] 39.591886
          Disconnect (0x01|0x0006) ncmd 1
            Status: Success (0x00)
    > HCI Event: Disconnect Complete (0x05) plen 4             #38 [hci0] 39.782849
            Status: Success (0x00)
            Handle: 21
            Reason: Connection Terminated By Local Host (0x16)
    @ Device Disconnected: 00:1A:7D:DA:71:11 (0) reason 2
linux
bluetooth
windows-10
bluez
asked on Stack Overflow Nov 12, 2020 by Peter Soltys • edited Nov 12, 2020 by Peter Soltys

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0