2016-09-19 15:19:30

by Wilson Perez

[permalink] [raw]
Subject: hciconfig piscan timeout issue

I'm having an issue with hciconfig in Bluez 5.41 when making my
bluetooth device discoverable by means of the piscan command. By
executing the following:
hciconfig hci0 piscan
the bluetooth device is configured as discoverable but it remains
discoverable until the system is rebooted or the noscan command is
executed.

I have set:
DiscoverableTimeout = 30
in /etc/bluetooth/main.conf and verified the setting is read and the
timer configured accordingly by running bluetoothd in debug mode but
it does not appear like the timer is executed. I have also tried
unsuccessfully several other settings including commenting out the
line to use the default value of 180.

If I run:
dbus-send --system --dest=org.bluez --print-reply /org/bluez/hci0
org.freedesktop.DBus.Properties.Set string:org.bluez.Adapter1
string:Discoverable variant:boolean:true
to make the bluetooth device discoverable, the DiscoverableTimeout
timer works as expected.

Is there anything I'm missing that is causing this unexpected behavior
in Bluez 5.41?

Thanks in advance.

Wilson


2016-09-19 15:27:51

by Luiz Augusto von Dentz

[permalink] [raw]
Subject: Re: hciconfig piscan timeout issue

Hi Wilson,

On Mon, Sep 19, 2016 at 6:19 PM, Wilson Perez <[email protected]> wrote:
> I'm having an issue with hciconfig in Bluez 5.41 when making my
> bluetooth device discoverable by means of the piscan command. By
> executing the following:
> hciconfig hci0 piscan
> the bluetooth device is configured as discoverable but it remains
> discoverable until the system is rebooted or the noscan command is
> executed.

hciconfig does not honor the setting for bluetoothd as it uses the HCI
raw socket to send commands directly to the controller, what you
probably want to use is bluetoothctl discoverable command.

> I have set:
> DiscoverableTimeout = 30
> in /etc/bluetooth/main.conf and verified the setting is read and the
> timer configured accordingly by running bluetoothd in debug mode but
> it does not appear like the timer is executed. I have also tried
> unsuccessfully several other settings including commenting out the
> line to use the default value of 180.
>
> If I run:
> dbus-send --system --dest=org.bluez --print-reply /org/bluez/hci0
> org.freedesktop.DBus.Properties.Set string:org.bluez.Adapter1
> string:Discoverable variant:boolean:true
> to make the bluetooth device discoverable, the DiscoverableTimeout
> timer works as expected.
>
> Is there anything I'm missing that is causing this unexpected behavior
> in Bluez 5.41?

Don't mix hci* tools with bluetoothd.


--
Luiz Augusto von Dentz