0

Environment


  • Ubuntu 16.04
  • Standard USB BlueTooth dongle
  • C++
  • BlueZ
  • Running as root


Problem description


While hcitool & sdptool properly operate, my code fail connecting to SDP with errno == 2 ( ENOENT ), the following is the failing code:

m_pSDPSession = sdp_connect(BDADDR_ANY, BDADDR_LOCAL, SDP_RETRY_IF_BUSY | SDP_WAIT_ON_CLOSE);

Why do I get 'sdp_connect' failing? how can I have that resolved ?

NadavRub
  • 2,520
  • 27
  • 63

2 Answers2

1

Edit /usr/lib/systemd/system/bluetooth.service and includ the flag in the ExecStart option.

ExecStart=/usr/libexec/bluetooth/bluetoothd --compat

Then

$ systemctl daemon-reload

$ systemctl restart bluetooth.service

Shravan40
  • 8,922
  • 6
  • 28
  • 48
0

As Shravan40 has indicated, adding '--compat' @ 'bluetooth.service' resolved the problem

NadavRub
  • 2,520
  • 27
  • 63