In the Advertising API, org.bluez.LEAdvertisement1 has Type field
which can be "broadcast" or "peripheral".
When I set it to be peripheral, the outgoing advertisement packets has
the advertisement flags:
0x02 (BLE_GAP_ADV_FLAG_LE_GENERAL_DISC_MODE) and I guess that is why
when I try to connect the peripheral from my Android, I get a pairing
request back.
Is there a way to set BLE_GAP_ADV_FLAG_BR_EDR_NOT_SUPPORTED on the
flags as well to show I only support LE and so I can also skip the
pairing requests.
On Fri, Jul 17, 2015 at 5:30 PM, Johan Hedberg <[email protected]> wrote:
> Hi dogan,
>
> On Fri, Jul 17, 2015, dogan yazar wrote:
>> Thanks! This worked well. Any hints for me to track down why
>> "ControllerMode=le in the [General] section of
>> /etc/bluetooth/main.conf" did not work fine? Running a shell command
>> from our software is not a very neat solution.
>
> Enable bluetoothd debug logs (-d command line switch) and check if
> there's anything suspicious when you start bluetoothd. Btw, which BlueZ
> version do you have? The ControllerMode option was first introduced in
> BlueZ 5.25.
Thanks! Apparently it was a cheap mistake on my side. Since I wanted
to test latest bluez, I have installed from the source files with
default configuration, the conf file I should have updated was under
/usr/local. So it works great now!
Hi dogan,
On Fri, Jul 17, 2015, dogan yazar wrote:
> Thanks! This worked well. Any hints for me to track down why
> "ControllerMode=le in the [General] section of
> /etc/bluetooth/main.conf" did not work fine? Running a shell command
> from our software is not a very neat solution.
Enable bluetoothd debug logs (-d command line switch) and check if
there's anything suspicious when you start bluetoothd. Btw, which BlueZ
version do you have? The ControllerMode option was first introduced in
BlueZ 5.25.
Johan
On Thu, Jul 16, 2015 at 10:39 PM, Marcel Holtmann <[email protected]> wrote:
> Hi Johan,
>
>>> Thanks a lot for the answer. That is exactly what I need. However
>>> putting in the main.conf did not really make any reference and trying
>>> the btmgmt returns "Rejected"
>>> [mgmt]# bredr off
>>> Set BR/EDR for hci0 failed with status 0x0b (Rejected)
>>>
>>> Any idea why? Is it controller related?
>>
>> First of all, please don't top-post on this list. I think you need to
>> power off the adapter before you can disable BR/EDR, i.e. "btmgmt power
>> off".
Thanks! This worked well. Any hints for me to track down why
"ControllerMode=le in the [General] section of
/etc/bluetooth/main.conf" did not work fine? Running a shell command
from our software is not a very neat solution.
>
> actually you need to power off the controller, enable LE and only then you can turn off BR/EDR. Of course you require a dual-mode BR/EDR + LE controller in the first place to do this.
This is also good to know. Thanks! LE was enabled by default so did
not need it this time.
>
> Regards
>
> Marcel
>
Hi Johan,
>> Thanks a lot for the answer. That is exactly what I need. However
>> putting in the main.conf did not really make any reference and trying
>> the btmgmt returns "Rejected"
>> [mgmt]# bredr off
>> Set BR/EDR for hci0 failed with status 0x0b (Rejected)
>>
>> Any idea why? Is it controller related?
>
> First of all, please don't top-post on this list. I think you need to
> power off the adapter before you can disable BR/EDR, i.e. "btmgmt power
> off".
actually you need to power off the controller, enable LE and only then you can turn off BR/EDR. Of course you require a dual-mode BR/EDR + LE controller in the first place to do this.
Regards
Marcel
Hi dogan,
On Thu, Jul 16, 2015, dogan yazar wrote:
> Thanks a lot for the answer. That is exactly what I need. However
> putting in the main.conf did not really make any reference and trying
> the btmgmt returns "Rejected"
> [mgmt]# bredr off
> Set BR/EDR for hci0 failed with status 0x0b (Rejected)
>
> Any idea why? Is it controller related?
First of all, please don't top-post on this list. I think you need to
power off the adapter before you can disable BR/EDR, i.e. "btmgmt power
off".
Johan
Thanks a lot for the answer. That is exactly what I need. However
putting in the main.conf did not really make any reference and trying
the btmgmt returns "Rejected"
[mgmt]# bredr off
Set BR/EDR for hci0 failed with status 0x0b (Rejected)
Any idea why? Is it controller related?
On Thu, Jul 16, 2015 at 12:59 PM, Johan Hedberg <[email protected]> wrote:
> Hi dogan,
>
> On Thu, Jul 16, 2015, dogan yazar wrote:
>> In the Advertising API, org.bluez.LEAdvertisement1 has Type field
>> which can be "broadcast" or "peripheral".
>> When I set it to be peripheral, the outgoing advertisement packets has
>> the advertisement flags:
>> 0x02 (BLE_GAP_ADV_FLAG_LE_GENERAL_DISC_MODE) and I guess that is why
>> when I try to connect the peripheral from my Android, I get a pairing
>> request back.
>>
>> Is there a way to set BLE_GAP_ADV_FLAG_BR_EDR_NOT_SUPPORTED on the
>> flags as well to show I only support LE and so I can also skip the
>> pairing requests.
>
> You could try setting ControllerMode=le in the [General] section of
> /etc/bluetooth/main.conf and restart bluetoothd. Another option is to
> disable BR/EDR manually with btmgmt ("btmgmt bredr off").
>
> Johan
Hi dogan,
On Thu, Jul 16, 2015, dogan yazar wrote:
> In the Advertising API, org.bluez.LEAdvertisement1 has Type field
> which can be "broadcast" or "peripheral".
> When I set it to be peripheral, the outgoing advertisement packets has
> the advertisement flags:
> 0x02 (BLE_GAP_ADV_FLAG_LE_GENERAL_DISC_MODE) and I guess that is why
> when I try to connect the peripheral from my Android, I get a pairing
> request back.
>
> Is there a way to set BLE_GAP_ADV_FLAG_BR_EDR_NOT_SUPPORTED on the
> flags as well to show I only support LE and so I can also skip the
> pairing requests.
You could try setting ControllerMode=le in the [General] section of
/etc/bluetooth/main.conf and restart bluetoothd. Another option is to
disable BR/EDR manually with btmgmt ("btmgmt bredr off").
Johan