c++cbluezsdp

How to check that SDP service record was registered correctly in C++/Linux


I am trying to register my bluetooth SDP service in C++ linux as shown here: Example 4-9. Describing a service

Where or how can I check exactly that the service is registered? I've tried viewing all services while running bluetoothctl or sdptool browse commands but service with my UUID is not shown there.

I've also tried changing the service group (not sure how it is called) in sdp_uuid16_create(&rootUuid, PUBLIC_BROWSE_GROUP) call to, for example, sdp_uuid16_create(&rootUuid, SERIAL_PORT_SVCLASS_ID) and searching with sdptool search SP as it is shown here Bluetooth Profiles but it does not take any effect.

When I run discovering services program (first paragraph on the site) on my other PC, it finds the service pretty fine.


Solution

  • The document you linked to is refering to a version of BlueZ that most systems don't run anymore.

    Many of the tools it refers to (such as hciattach, hciconfig, hcitool, hcidump, rfcomm, sdptool, ciptool, and gatttool) were deprecated by the BlueZ project in 2017.

    There is also the following SO question talking about the changes that have happened to BlueZ: Bluetooth SDP - where is sdpd?

    Libraries such as https://github.com/nettlep/gobbledegook are examples of using the new D-Bus API in C.

    The BlueZ documentation for the APIs are available at: https://git.kernel.org/pub/scm/bluetooth/bluez.git/tree/doc