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:
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
!
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?
To exit the bluetoothctl interactive mode, simply type exit in the prompt.
Bluetoothctl is a client tool to interact with bluetoothd from the command line. It can be used also to create Agent objects with a specific capability interactively or using command line options.
A set of tools to manage bluetooth devices for linux.
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/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With