* Advertising API, possible to set LE only?
@ 2015-07-16 10:30 dogan yazar
2015-07-16 10:59 ` Johan Hedberg
0 siblings, 1 reply; 8+ messages in thread
From: dogan yazar @ 2015-07-16 10:30 UTC (permalink / raw
To: linux-bluetooth
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.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Advertising API, possible to set LE only?
2015-07-16 10:30 Advertising API, possible to set LE only? dogan yazar
@ 2015-07-16 10:59 ` Johan Hedberg
2015-07-16 12:49 ` dogan yazar
0 siblings, 1 reply; 8+ messages in thread
From: Johan Hedberg @ 2015-07-16 10:59 UTC (permalink / raw
To: dogan yazar; +Cc: linux-bluetooth
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
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Advertising API, possible to set LE only?
2015-07-16 10:59 ` Johan Hedberg
@ 2015-07-16 12:49 ` dogan yazar
2015-07-16 13:10 ` Johan Hedberg
0 siblings, 1 reply; 8+ messages in thread
From: dogan yazar @ 2015-07-16 12:49 UTC (permalink / raw
To: dogan yazar, linux-bluetooth
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 <johan.hedberg@gmail.com> 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
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Advertising API, possible to set LE only?
2015-07-16 12:49 ` dogan yazar
@ 2015-07-16 13:10 ` Johan Hedberg
2015-07-16 20:39 ` Marcel Holtmann
0 siblings, 1 reply; 8+ messages in thread
From: Johan Hedberg @ 2015-07-16 13:10 UTC (permalink / raw
To: dogan yazar; +Cc: linux-bluetooth
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
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Advertising API, possible to set LE only?
2015-07-16 13:10 ` Johan Hedberg
@ 2015-07-16 20:39 ` Marcel Holtmann
2015-07-17 15:03 ` dogan yazar
0 siblings, 1 reply; 8+ messages in thread
From: Marcel Holtmann @ 2015-07-16 20:39 UTC (permalink / raw
To: Johan Hedberg; +Cc: dogan yazar, linux-bluetooth
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
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Advertising API, possible to set LE only?
2015-07-16 20:39 ` Marcel Holtmann
@ 2015-07-17 15:03 ` dogan yazar
2015-07-17 15:30 ` Johan Hedberg
0 siblings, 1 reply; 8+ messages in thread
From: dogan yazar @ 2015-07-17 15:03 UTC (permalink / raw
To: Marcel Holtmann; +Cc: Johan Hedberg, linux-bluetooth
On Thu, Jul 16, 2015 at 10:39 PM, Marcel Holtmann <marcel@holtmann.org> 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
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Advertising API, possible to set LE only?
2015-07-17 15:03 ` dogan yazar
@ 2015-07-17 15:30 ` Johan Hedberg
2015-07-22 10:53 ` dogan yazar
0 siblings, 1 reply; 8+ messages in thread
From: Johan Hedberg @ 2015-07-17 15:30 UTC (permalink / raw
To: dogan yazar; +Cc: Marcel Holtmann, linux-bluetooth
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
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Advertising API, possible to set LE only?
2015-07-17 15:30 ` Johan Hedberg
@ 2015-07-22 10:53 ` dogan yazar
0 siblings, 0 replies; 8+ messages in thread
From: dogan yazar @ 2015-07-22 10:53 UTC (permalink / raw
To: dogan yazar, Marcel Holtmann, linux-bluetooth
On Fri, Jul 17, 2015 at 5:30 PM, Johan Hedberg <johan.hedberg@gmail.com> 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!
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2015-07-22 10:53 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-16 10:30 Advertising API, possible to set LE only? dogan yazar
2015-07-16 10:59 ` Johan Hedberg
2015-07-16 12:49 ` dogan yazar
2015-07-16 13:10 ` Johan Hedberg
2015-07-16 20:39 ` Marcel Holtmann
2015-07-17 15:03 ` dogan yazar
2015-07-17 15:30 ` Johan Hedberg
2015-07-22 10:53 ` dogan yazar
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.