Hi, On Fri, Aug 24, 2018 at 4:58 AM, Проклов Александр Валерьевич <ProklovAV@xxxxxxxxxxxxxxxx> wrote: > Hello All, > > Thanks for your work. Since version bluez-5.50 start-stop discovery work > from command line and scripts: > #bluetoothctl scan on > #bluetoothctl scan off > (see mail-list "Problem with StopDiscovery() via dbus-send") > > -------------------------------------------- > > My next task is to do pair with device from bash script. I tried several > ways: > 1. #bluetoothctl pair 11:22:33:44:55:66 does not work because the agent is > not created. > 2. Make agent via Dbus: > #dbus-send --system --print-reply --type=method_call --dest=org.bluez > /org/bluez org.bluez.AgentManager1.RegisterAgent objpath:/org/bluez/agent1 > string:KeyboardOnly > the command works, but I do not see in Dbus /org/bluez/agent1 created. > 3. Make agent via bluetoothctl: > [bluetooth]#agent on > the command works, but I do not see in Dbus agent path!. Im not sure Im following, you would like to have non-interactive mode working for bluetoothctl pair? The point number 2 don't make much sense since dbus-send normally disconnected after the reply that means the agent would be gone, also regarding 3 if you use a more recent version of bluetootctl it registers and agent automatically nowadays. > May be possible to set a default pin code via /etc/bluetooth/main.conf > if it is available, do not make a request for a pin from the command line? I > think that then #bluetoothctl pair 11:22:33:44:55:66 will be able to work > fine. That is something I had in mind, lets see if I can come up with something. > --------------------- > Best regards, > Aleksandr Proklov -- Luiz Augusto von Dentz