11

Right now I can successfully pair and connect a phone to my machine without any user interaction in this way:

$bluetoothctl
#power on
#discoverable on
#pairable on
#agent NoInputNoOutput
#default-agent

from my phone I search for the BT device and it pairs and connectly automatically. Now I have two problems:

  1. it still asks to authorize services:

    Authorize service

    [agent] Authorize service 0000110e-0000-1000-8000-00805f9b34fb (yes/no):

but this is not good because I've specified NoInputNoOutput!

  1. how to trust a device? It's enough to type trust but I need to do this automatically for the same reason.

In general, is there any reliable C++ library to handle bluetooth connections and common profiles like A2DP and HFP?

Mark
  • 4,338
  • 7
  • 58
  • 120

1 Answers1

2

I used bt-agent with NoInputNoOutput capabilities and that didn't ask for any permissions for A2DP and HFPprofiles.

bt-agent --capability=NoInputNoOutput

check the link for more details. https://www.kynetics.com/docs/2018/pairing_agents_bluez/