site  contact  subhomenews

What is a Bluetooth agent?

October 29, 2020 — BarryK

I want to post a link here, as it somewhat improved my understanding of what a Bluetooth agent is...

As posted a couple of days ago, I have been working on a new BluePup:

https://bkhome.org/news/202010/bluepup-bluetooth-manager-has-returned.html

The main problem I had with it at that time, was it ran 'bluetoothctl' interactively, and parsed the log of response strings to detect success or otherwise of each operation, and to wait on completion of each operation. This is English-centric, but I wanted 'bluetoothctl' to output non-English messages -- hence Iinternationalized bluetoothctl:

https://bkhome.org/news/202010/bluetoothctl-utility-internationalized.html

And I rewrote BluePup to use 'bluetoothctl' non-interactively, so don't have to parse response-strings. That is, a command is entered on the commandline when invoke 'bluetoothctl' and it exits immediately after executing the command.

However, I didn't understand what an "agent" is, and in particular, didn't understand that 'bluetoothctl' running in interactive-mode is the agent. So, in non-interactive mode, as soon as 'bluetoothctl' exits, so does the agent.

The light came on when I read this page:

https://www.kynetics.com/docs/2018/pairing_agents_bluez/

...it has given me a clue how to proceed, running 'bluetoothctl' non-interactively. 

Tags: easy