BTChat Example Server Does Not Appear on Raspberry Pi
-
When attempting to run the Bluetooth Chat example between a Windows 10 desktop (Qt 5.11) and a Raspberry Pi (Raspbian GNU/Linux 9 (stretch)) (Qt 5.7), it will connect and run properly when connecting from the RPi to the Windows (i.e. Windows in the server). When attempting to connect from Windows to the RPi, there is no service found.
Looking on the RPi with the command: sdptool records --raw local
I see the following output (reduced to two records) that indicates the program registered the service:
Sequence Attribute 0x0000 - ServiceRecordHandle UINT32 0x00010007 Attribute 0x0001 - ServiceClassIDList Sequence UUID16 0x111f - HandsfreeAudioGateway UUID16 0x1203 - GenericAudio Attribute 0x0004 - ProtocolDescriptorList Sequence Sequence UUID16 0x0100 - L2CAP Sequence UUID16 0x0003 - RFCOMM UINT8 0x0d Attribute 0x0005 - BrowseGroupList Sequence UUID16 0x1002 - PublicBrowseGroup Attribute 0x0009 - BluetoothProfileDescriptorList Sequence Sequence UUID16 0x111e - Handsfree UINT16 0x0107 Attribute 0x0100 String Hands-Free Voice gateway Attribute 0x0301 UINT8 0x01 Attribute 0x0311 UINT16 0x0000 Sequence Attribute 0x0000 - ServiceRecordHandle UINT32 0x00010008 Attribute 0x0001 - ServiceClassIDList Sequence UUID128 e8e10f95-1a70-4b27-9ccf-02010264e9c8 UUID16 0x1101 - SerialPort Attribute 0x0003 - ServiceID UUID128 e8e10f95-1a70-4b27-9ccf-02010264e9c8 Attribute 0x0004 - ProtocolDescriptorList Sequence Sequence UUID16 0x0100 - L2CAP Sequence UUID16 0x0003 - RFCOMM UINT8 0x01 Attribute 0x0005 - BrowseGroupList Sequence UUID16 0x1002 - PublicBrowseGroup Attribute 0x0009 - BluetoothProfileDescriptorList Sequence UUID16 0x1101 - SerialPort Attribute 0x0100 String Bt Chat Server Attribute 0x0101 String Example bluetooth chat server Attribute 0x0102 String qt-project.org
When inspecting the Bluetooth services from Windows I see the "Hands-Free Voice Gateway" but not the "Bt Chat Server":
C:\Program Files (x86)\Bluetooth Command Line Tools\bin>btdiscovery -s (XX:XX:XX:XX:XX:xx) raspberrypi Unknown 1800 0 Generic Access Profile 1801 0 Generic Attribute Profile 110E 0 AVRCP CT 110E 0 AVRCP TG 110D 0 Audio Source 1108 12 Headset Voice gateway 111E 13 Hands-Free Voice gateway 1134 17 Message Notification 1134 16 Message Access 1130 15 Phone Book Access 1104 14 Synchronization 1106 10 File Transfer 1105 9 Object Push 5005 24 Nokia OBEX PC Suite Services
What needs to be done such that the SDP record for the chat service is visible to remote clients?
-
had you check in your bt chat server ?
sdptool browse local
:
Service Name: Bt Chat Server
Service Description: Example bluetooth chat server
Service Provider: qt-project.org
Service RecHandle: 0x1000f
Service Class ID List:
UUID 128: e8e10f95-1a70-4b27-9ccf-02010264e9c8
"Serial Port" (0x1101)
Protocol Descriptor List:
"L2CAP" (0x0100)
"RFCOMM" (0x0003)
Channel: 1
Profile Descriptor List:
"Serial Port" (0x1101)
Version: 0x0100you can see apend the qt bt chat server code :
serviceInfo.setAttribute(QBluetoothServiceInfo::ServiceName, tr("Bt Chat Server"));when the bt chat client scan ,you should use uuid to find your bt chat server :
m_discoveryAgent->setUuidFilter(uuid); //very inprotant