Skip to contentSkip to conversation

Problem with StopDiscovery() via dbus-send

DISCUSSION Проклов Александр Валерьевич 2 participants 4 messages Jul 25, 2017 – Jul 27, 2017 Bluetooth drivers

lore
Share & tools
lore
#0 lore raw

Hello All,

I'm trying to manage Bluetooth using dbus-send command,

I send command for start discovery:
dbus-send --system --reply-timeout=5000 --type=method_call --dest=org.bluez /org/bluez/hci0 org.bluez.Adapter1.StartDiscovery

I see that the scan started, the status is true:
dbus-send --system --print-reply --dest=org.bluez --type=method_call /org/bluez/hci0 org.freedesktop.DBus.Properties.Get string:org.bluez.Adapter1 string:Discovering

But I can not stop scanning by a command:
dbus-send --system --reply-timeout=5000 --type=method_call --dest=org.bluez /org/bluez/hci0 org.bluez.Adapter1.StopDiscovery

"Discovering" status true.

Bluez version 5.45

---------------------
Best regards,
Aleksandr Proklov

#1 lore raw

Hi Aleksandr,

On Wed, Jul 26, 2017 at 2:51 AM, =D0=9F=D1=80=D0=BE=D0=BA=D0=BB=D0=BE=D0=B2=
=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B0=D0=BD=D0=B4=D1=80 =D0=92=D0=B0=D0=BB=
=D0=B5=D1=80=D1=8C=D0=B5=D0=B2=D0=B8=D1=87

Quoted 6 lines · <[email protected]> wrote:

Hello All,

I'm trying to manage Bluetooth using dbus-send command,

I send command for start discovery:
dbus-send --system --reply-timeout=3D5000 --type=3Dmethod_call --dest=3Do=

rg.bluez

Quoted 1 line

/org/bluez/hci0 org.bluez.Adapter1.StartDiscovery

dbus-send exists so that would stop the discovery is there is no other process discovering.

Quoted 7 lines

I see that the scan started, the status is true:
dbus-send --system --print-reply --dest=3Dorg.bluez --type=3Dmethod_call /org/bluez/hci0 org.freedesktop.DBus.Properties.Get string:org.bluez.Adapter1 string:Discovering

But I can not stop scanning by a command:
dbus-send --system --reply-timeout=3D5000 --type=3Dmethod_call --dest=3Do=

rg.bluez

Quoted 1 line

/org/bluez/hci0 org.bluez.Adapter1.StopDiscovery

It probably has been stopped already since the connection used for StartDiscovery has been terminated. Btw, there are better tools to test this, for instance bluetoothctl> scan [on/off]

Quoted 9 lines

"Discovering" status true.

Bluez version 5.45

---------------------
Best regards,
Aleksandr Proklov
--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth=

"

Quoted 3 lines

in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

--=20
Luiz Augusto von Dentz

#2 lore raw
Quoted 4 lines · Luiz Augusto von Dentz

It probably has been stopped already since the connection used for StartDiscovery has been terminated. Btw, there are better tools to test this, for instance bluetoothctl> scan [on/off]

If the process "StartDiscovery" is stopped, why status "Discovering" not changed to "false"?

I need to start and stop scanning from the Bash script, bluetoothctl has the ability to manage from Bash scripts?

#3 lore raw

Hi,

On Thu, Jul 27, 2017 at 3:50 AM, =D0=9F=D1=80=D0=BE=D0=BA=D0=BB=D0=BE=D0=B2=
=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B0=D0=BD=D0=B4=D1=80 =D0=92=D0=B0=D0=BB=
=D0=B5=D1=80=D1=8C=D0=B5=D0=B2=D0=B8=D1=87

Quoted 9 lines · <[email protected]> wrote:
Quoted 4 lines · Luiz Augusto von Dentz

It probably has been stopped already since the connection used for StartDiscovery has been terminated. Btw, there are better tools to test this, for instance bluetoothctl> scan [on/off]

If the process "StartDiscovery" is stopped, why status "Discovering" not changed to "false"?

It may take some time until it has been stopped completely, but the sessions is already released, and even if you could in fact leave it running the next time you call dbus-sent it would create a new connection so calling StopDiscovery will fail nevertheless.

Quoted 1 line

I need to start and stop scanning from the Bash script, bluetoothctl has =

the

Quoted 1 line

ability to manage from Bash scripts?

Currently it only runs in interactive mode, but it would have the same result since the D-Bus connection would be lost in between runs of bluetoothctl.

Quoted 3 lines

--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth=

"

Quoted 3 lines

in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

--=20
Luiz Augusto von Dentz