All of lore.kernel.org
 help / color / mirror / Atom feed
* Incorrect advertise flags in bluetooth beacon using BlueZ
@ 2020-05-07 10:25 Karim, Hafiz Abdul
  2020-05-07 12:20 ` Ryll, Jan (GED-SDD2)
  2020-05-07 20:24 ` Luiz Augusto von Dentz
  0 siblings, 2 replies; 5+ messages in thread
From: Karim, Hafiz Abdul @ 2020-05-07 10:25 UTC (permalink / raw)
  To: linux-bluetooth


Using nRF Connect android application, I'm getting incorrect advertise flags in bluetooth beacon using BlueZ
I have tried on two bluez versions i.e 5.48 and 5.52.

I have set ControllerMode to "le" in main.conf. Using bluetootctl, when I turn on the advertisement using command "advertise on", I get 0x02 advertisement flag. Which means "BR/EDR Not Supported" (Bit 2) is not set.
Now, if i restart the bluetooth service, and turn on the advertisement again, I get 0x06 advertisement flags.

Here is my main.conf

[General]# Default adaper name
# Defaults to 'BlueZ X.YZ'
#Name = BlueZ# Default device class. Only the major and minor device class bits are
# considered. Defaults to '0x000000'.
Class = 0x000100# How long to stay in discoverable mode before going back to non-discoverable
# The value is in seconds. Default is 180, i.e. 3 minutes.
# 0 = disable timer, i.e. stay discoverable forever
DiscoverableTimeout = 0# How long to stay in pairable mode before going back to non-discoverable
# The value is in seconds. Default is 0.
# 0 = disable timer, i.e. stay pairable forever
#PairableTimeout = 0# Automatic connection for bonded devices driven by platform/user events.
# If a platform plugin uses this mechanism, automatic connections will be
# enabled during the interval defined below. Initially, this feature
# intends to be used to establish connections to ATT channels. Default is 60.
#AutoConnectTimeout = 60# Use vendor id source (assigner), vendor, product and version information for
# DID profile support. The values are separated by ":" and assigner, VID, PID
# and version.
# Possible vendor id source values: bluetooth, usb (defaults to usb)
#DeviceID = bluetooth:1234:5678:abcd# Do reverse service discovery for previously unknown devices that connect to
# us. This option is really only needed for qualification since the BITE tester
# doesn't like us doing reverse SDP for some test cases (though there could in
# theory be other useful purposes for this too). Defaults to 'true'.
#ReverseServiceDiscovery = true# Enable name resolving after inquiry. Set it to 'false' if you don't need
# remote devices name and want shorter discovery cycle. Defaults to 'true'.
#NameResolving = true# Enable runtime persistency of debug link keys. Default is false which
# makes debug link keys valid only for the duration of the connection
# that they were created for.
#DebugKeys = false# Restricts all controllers to the specified transport. Default value
# is "dual", i.e. both BR/EDR and LE enabled (when supported by the HW).
# Possible values: "dual", "bredr", "le"
ControllerMode = le# Enables Multi Profile Specification support. This allows to specify if
# system supports only Multiple Profiles Single Device (MPSD) configuration
# or both Multiple Profiles Single Device (MPSD) and Multiple Profiles Multiple
# Devices (MPMD) configurations.
# Possible values: "off", "single", "multiple"
#MultiProfile = off# Permanently enables the Fast Connectable setting for adapters that
# support it. When enabled other devices can connect faster to us,
# however the tradeoff is increased power consumptions. This feature
# will fully work only on kernel version 4.1 and newer. Defaults to
# 'false'.
#FastConnectable = false[Policy]# The ReconnectUUIDs defines the set of remote services that should try
# to be reconnected to in case of a link loss (link supervision
# timeout). The policy plugin should contain a sane set of values by
# default, but this list can be overridden here. By setting the list to
# empty the reconnection feature gets disabled.
#ReconnectUUIDs=00001112-0000-1000-8000-00805f9b34fb, 0000111f-0000-1000-8000-00805f9b34fb, 0000110a-0000-1000-8000-00805f9b34fb# ReconnectAttempts define the number of attempts to reconnect after a link
# lost. Setting the value to 0 disables reconnecting feature.
#ReconnectAttempts=7# ReconnectIntervals define the set of intervals in seconds to use in between
# attempts.
# If the number of attempts defined in ReconnectAttempts is bigger than the
# set of intervals the last interval is repeated until the last attempt.
#ReconnectIntervals=1, 2, 4, 8, 16, 32, 64# AutoEnable defines option to enable all controllers when they are found.
# This includes adapters present on start as well as adapters that are plugged
# in later on. Defaults to 'false'.
AutoEnable=true


And bluetooth.service


[Unit]
Description=Bluetooth service
Documentation=man:bluetoothd(8)
ConditionPathIsDirectory=/sys/class/bluetooth[Service]
Type=dbus
BusName=org.bluez
ExecStart=/usr/libexec/bluetooth/bluetoothd -d -n --configfile /etc/bluetooth/main.conf
NotifyAccess=main
#WatchdogSec=10
#Restart=on-failure
CapabilityBoundingSet=CAP_NET_ADMIN CAP_NET_BIND_SERVICE
LimitNPROC=1
ProtectHome=true
ProtectSystem=full[Install]
WantedBy=bluetooth.target
Alias=dbus-org.bluez.service

Any guidance/pointers?


Thanks,
Abdul Karim


  
  
 
  

^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: Incorrect advertise flags in bluetooth beacon using BlueZ
  2020-05-07 10:25 Incorrect advertise flags in bluetooth beacon using BlueZ Karim, Hafiz Abdul
@ 2020-05-07 12:20 ` Ryll, Jan (GED-SDD2)
  2020-05-07 20:24 ` Luiz Augusto von Dentz
  1 sibling, 0 replies; 5+ messages in thread
From: Ryll, Jan (GED-SDD2) @ 2020-05-07 12:20 UTC (permalink / raw)
  To: Karim, Hafiz Abdul, linux-bluetooth

Hi Abdul,

we did also see this bug.

Following was observed:
5.48 	ControllerMode = le 	We never get Advertising Flags = 0x06 running
5.52 	ControllerMode = le 	After reboot: Advertising Flags = 0x02 -> systemctl restart bluetooth -> Advertising Flags = 0x06

It seems to be that during first startup something goes wrong. We did not investigate further but also need to have this fixed.

@Community: Is there a fix available or planned?

Best Regards
Jan


-----Original Message-----
From: linux-bluetooth-owner@vger.kernel.org <linux-bluetooth-owner@vger.kernel.org> On Behalf Of Karim, Hafiz Abdul
Sent: Thursday, May 7, 2020 12:25 PM
To: linux-bluetooth@vger.kernel.org
Subject: Incorrect advertise flags in bluetooth beacon using BlueZ


Using nRF Connect android application, I'm getting incorrect advertise flags in bluetooth beacon using BlueZ I have tried on two bluez versions i.e 5.48 and 5.52.

I have set ControllerMode to "le" in main.conf. Using bluetootctl, when I turn on the advertisement using command "advertise on", I get 0x02 advertisement flag. Which means "BR/EDR Not Supported" (Bit 2) is not set.
Now, if i restart the bluetooth service, and turn on the advertisement again, I get 0x06 advertisement flags.

Here is my main.conf

[General]# Default adaper name
# Defaults to 'BlueZ X.YZ'
#Name = BlueZ# Default device class. Only the major and minor device class bits are # considered. Defaults to '0x000000'.
Class = 0x000100# How long to stay in discoverable mode before going back to non-discoverable # The value is in seconds. Default is 180, i.e. 3 minutes.
# 0 = disable timer, i.e. stay discoverable forever DiscoverableTimeout = 0# How long to stay in pairable mode before going back to non-discoverable # The value is in seconds. Default is 0.
# 0 = disable timer, i.e. stay pairable forever #PairableTimeout = 0# Automatic connection for bonded devices driven by platform/user events.
# If a platform plugin uses this mechanism, automatic connections will be # enabled during the interval defined below. Initially, this feature # intends to be used to establish connections to ATT channels. Default is 60.
#AutoConnectTimeout = 60# Use vendor id source (assigner), vendor, product and version information for # DID profile support. The values are separated by ":" and assigner, VID, PID # and version.
# Possible vendor id source values: bluetooth, usb (defaults to usb) #DeviceID = bluetooth:1234:5678:abcd# Do reverse service discovery for previously unknown devices that connect to # us. This option is really only needed for qualification since the BITE tester # doesn't like us doing reverse SDP for some test cases (though there could in # theory be other useful purposes for this too). Defaults to 'true'.
#ReverseServiceDiscovery = true# Enable name resolving after inquiry. Set it to 'false' if you don't need # remote devices name and want shorter discovery cycle. Defaults to 'true'.
#NameResolving = true# Enable runtime persistency of debug link keys. Default is false which # makes debug link keys valid only for the duration of the connection # that they were created for.
#DebugKeys = false# Restricts all controllers to the specified transport. Default value # is "dual", i.e. both BR/EDR and LE enabled (when supported by the HW).
# Possible values: "dual", "bredr", "le"
ControllerMode = le# Enables Multi Profile Specification support. This allows to specify if # system supports only Multiple Profiles Single Device (MPSD) configuration # or both Multiple Profiles Single Device (MPSD) and Multiple Profiles Multiple # Devices (MPMD) configurations.
# Possible values: "off", "single", "multiple"
#MultiProfile = off# Permanently enables the Fast Connectable setting for adapters that # support it. When enabled other devices can connect faster to us, # however the tradeoff is increased power consumptions. This feature # will fully work only on kernel version 4.1 and newer. Defaults to # 'false'.
#FastConnectable = false[Policy]# The ReconnectUUIDs defines the set of remote services that should try # to be reconnected to in case of a link loss (link supervision # timeout). The policy plugin should contain a sane set of values by # default, but this list can be overridden here. By setting the list to # empty the reconnection feature gets disabled.
#ReconnectUUIDs=00001112-0000-1000-8000-00805f9b34fb, 0000111f-0000-1000-8000-00805f9b34fb, 0000110a-0000-1000-8000-00805f9b34fb# ReconnectAttempts define the number of attempts to reconnect after a link # lost. Setting the value to 0 disables reconnecting feature.
#ReconnectAttempts=7# ReconnectIntervals define the set of intervals in seconds to use in between # attempts.
# If the number of attempts defined in ReconnectAttempts is bigger than the # set of intervals the last interval is repeated until the last attempt.
#ReconnectIntervals=1, 2, 4, 8, 16, 32, 64# AutoEnable defines option to enable all controllers when they are found.
# This includes adapters present on start as well as adapters that are plugged # in later on. Defaults to 'false'.
AutoEnable=true


And bluetooth.service


[Unit]
Description=Bluetooth service
Documentation=man:bluetoothd(8)
ConditionPathIsDirectory=/sys/class/bluetooth[Service]
Type=dbus
BusName=org.bluez
ExecStart=/usr/libexec/bluetooth/bluetoothd -d -n --configfile /etc/bluetooth/main.conf NotifyAccess=main
#WatchdogSec=10
#Restart=on-failure
CapabilityBoundingSet=CAP_NET_ADMIN CAP_NET_BIND_SERVICE
LimitNPROC=1
ProtectHome=true
ProtectSystem=full[Install]
WantedBy=bluetooth.target
Alias=dbus-org.bluez.service

Any guidance/pointers?


Thanks,
Abdul Karim


  
  
 
  

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Incorrect advertise flags in bluetooth beacon using BlueZ
  2020-05-07 10:25 Incorrect advertise flags in bluetooth beacon using BlueZ Karim, Hafiz Abdul
  2020-05-07 12:20 ` Ryll, Jan (GED-SDD2)
@ 2020-05-07 20:24 ` Luiz Augusto von Dentz
  2020-05-08  7:59   ` Ryll, Jan (GED-SDD2)
  1 sibling, 1 reply; 5+ messages in thread
From: Luiz Augusto von Dentz @ 2020-05-07 20:24 UTC (permalink / raw)
  To: Karim, Hafiz Abdul; +Cc: linux-bluetooth

Hi Hafiz Abdul,


On Thu, May 7, 2020 at 3:36 AM Karim, Hafiz Abdul
<HafizAbdul_Karim@mentor.com> wrote:
>
>
> Using nRF Connect android application, I'm getting incorrect advertise flags in bluetooth beacon using BlueZ
> I have tried on two bluez versions i.e 5.48 and 5.52.
>
> I have set ControllerMode to "le" in main.conf. Using bluetootctl, when I turn on the advertisement using command "advertise on", I get 0x02 advertisement flag. Which means "BR/EDR Not Supported" (Bit 2) is not set.
> Now, if i restart the bluetooth service, and turn on the advertisement again, I get 0x06 advertisement flags.

Are you saying we are not updating the service once main.conf has
changed? We don't do that automatically if that is what you are
referring to, also if you want to advertise as a beacon/broadcaster
and not as peripheral thean us you should use advertise broadcast.

> Here is my main.conf
>
> [General]# Default adaper name
> # Defaults to 'BlueZ X.YZ'
> #Name = BlueZ# Default device class. Only the major and minor device class bits are
> # considered. Defaults to '0x000000'.
> Class = 0x000100# How long to stay in discoverable mode before going back to non-discoverable
> # The value is in seconds. Default is 180, i.e. 3 minutes.
> # 0 = disable timer, i.e. stay discoverable forever
> DiscoverableTimeout = 0# How long to stay in pairable mode before going back to non-discoverable
> # The value is in seconds. Default is 0.
> # 0 = disable timer, i.e. stay pairable forever
> #PairableTimeout = 0# Automatic connection for bonded devices driven by platform/user events.
> # If a platform plugin uses this mechanism, automatic connections will be
> # enabled during the interval defined below. Initially, this feature
> # intends to be used to establish connections to ATT channels. Default is 60.
> #AutoConnectTimeout = 60# Use vendor id source (assigner), vendor, product and version information for
> # DID profile support. The values are separated by ":" and assigner, VID, PID
> # and version.
> # Possible vendor id source values: bluetooth, usb (defaults to usb)
> #DeviceID = bluetooth:1234:5678:abcd# Do reverse service discovery for previously unknown devices that connect to
> # us. This option is really only needed for qualification since the BITE tester
> # doesn't like us doing reverse SDP for some test cases (though there could in
> # theory be other useful purposes for this too). Defaults to 'true'.
> #ReverseServiceDiscovery = true# Enable name resolving after inquiry. Set it to 'false' if you don't need
> # remote devices name and want shorter discovery cycle. Defaults to 'true'.
> #NameResolving = true# Enable runtime persistency of debug link keys. Default is false which
> # makes debug link keys valid only for the duration of the connection
> # that they were created for.
> #DebugKeys = false# Restricts all controllers to the specified transport. Default value
> # is "dual", i.e. both BR/EDR and LE enabled (when supported by the HW).
> # Possible values: "dual", "bredr", "le"
> ControllerMode = le# Enables Multi Profile Specification support. This allows to specify if
> # system supports only Multiple Profiles Single Device (MPSD) configuration
> # or both Multiple Profiles Single Device (MPSD) and Multiple Profiles Multiple
> # Devices (MPMD) configurations.
> # Possible values: "off", "single", "multiple"
> #MultiProfile = off# Permanently enables the Fast Connectable setting for adapters that
> # support it. When enabled other devices can connect faster to us,
> # however the tradeoff is increased power consumptions. This feature
> # will fully work only on kernel version 4.1 and newer. Defaults to
> # 'false'.
> #FastConnectable = false[Policy]# The ReconnectUUIDs defines the set of remote services that should try
> # to be reconnected to in case of a link loss (link supervision
> # timeout). The policy plugin should contain a sane set of values by
> # default, but this list can be overridden here. By setting the list to
> # empty the reconnection feature gets disabled.
> #ReconnectUUIDs=00001112-0000-1000-8000-00805f9b34fb, 0000111f-0000-1000-8000-00805f9b34fb, 0000110a-0000-1000-8000-00805f9b34fb# ReconnectAttempts define the number of attempts to reconnect after a link
> # lost. Setting the value to 0 disables reconnecting feature.
> #ReconnectAttempts=7# ReconnectIntervals define the set of intervals in seconds to use in between
> # attempts.
> # If the number of attempts defined in ReconnectAttempts is bigger than the
> # set of intervals the last interval is repeated until the last attempt.
> #ReconnectIntervals=1, 2, 4, 8, 16, 32, 64# AutoEnable defines option to enable all controllers when they are found.
> # This includes adapters present on start as well as adapters that are plugged
> # in later on. Defaults to 'false'.
> AutoEnable=true
>
>
> And bluetooth.service
>
>
> [Unit]
> Description=Bluetooth service
> Documentation=man:bluetoothd(8)
> ConditionPathIsDirectory=/sys/class/bluetooth[Service]
> Type=dbus
> BusName=org.bluez
> ExecStart=/usr/libexec/bluetooth/bluetoothd -d -n --configfile /etc/bluetooth/main.conf
> NotifyAccess=main
> #WatchdogSec=10
> #Restart=on-failure
> CapabilityBoundingSet=CAP_NET_ADMIN CAP_NET_BIND_SERVICE
> LimitNPROC=1
> ProtectHome=true
> ProtectSystem=full[Install]
> WantedBy=bluetooth.target
> Alias=dbus-org.bluez.service
>
> Any guidance/pointers?
>
>
> Thanks,
> Abdul Karim
>
>
>
>
>
>


-- 
Luiz Augusto von Dentz

^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: Incorrect advertise flags in bluetooth beacon using BlueZ
  2020-05-07 20:24 ` Luiz Augusto von Dentz
@ 2020-05-08  7:59   ` Ryll, Jan (GED-SDD2)
  2020-05-08  8:40     ` Karim, Hafiz Abdul
  0 siblings, 1 reply; 5+ messages in thread
From: Ryll, Jan (GED-SDD2) @ 2020-05-08  7:59 UTC (permalink / raw)
  To: Luiz Augusto von Dentz, Karim, Hafiz Abdul; +Cc: linux-bluetooth

Hi Luiz,

what I understood is that at first start of bluez bluetooth service the advertisement flags for "mode" are not set to the correct value, as defined (ControllerMode = le) in main.conf.
If you start the service a second time this flag is correct. For the first time it is always wrong.
This is the same we did see here with our equipment.

Regards
Jan


-----Original Message-----
From: linux-bluetooth-owner@vger.kernel.org <linux-bluetooth-owner@vger.kernel.org> On Behalf Of Luiz Augusto von Dentz
Sent: Thursday, May 7, 2020 10:24 PM
To: Karim, Hafiz Abdul <HafizAbdul_Karim@mentor.com>
Cc: linux-bluetooth@vger.kernel.org
Subject: Re: Incorrect advertise flags in bluetooth beacon using BlueZ

Hi Hafiz Abdul,


On Thu, May 7, 2020 at 3:36 AM Karim, Hafiz Abdul <HafizAbdul_Karim@mentor.com> wrote:
>
>
> Using nRF Connect android application, I'm getting incorrect advertise 
> flags in bluetooth beacon using BlueZ I have tried on two bluez versions i.e 5.48 and 5.52.
>
> I have set ControllerMode to "le" in main.conf. Using bluetootctl, when I turn on the advertisement using command "advertise on", I get 0x02 advertisement flag. Which means "BR/EDR Not Supported" (Bit 2) is not set.
> Now, if i restart the bluetooth service, and turn on the advertisement again, I get 0x06 advertisement flags.

Are you saying we are not updating the service once main.conf has changed? We don't do that automatically if that is what you are referring to, also if you want to advertise as a beacon/broadcaster and not as peripheral thean us you should use advertise broadcast.

> Here is my main.conf
>
> [General]# Default adaper name
> # Defaults to 'BlueZ X.YZ'
> #Name = BlueZ# Default device class. Only the major and minor device 
> class bits are # considered. Defaults to '0x000000'.
> Class = 0x000100# How long to stay in discoverable mode before going 
> back to non-discoverable # The value is in seconds. Default is 180, i.e. 3 minutes.
> # 0 = disable timer, i.e. stay discoverable forever 
> DiscoverableTimeout = 0# How long to stay in pairable mode before 
> going back to non-discoverable # The value is in seconds. Default is 0.
> # 0 = disable timer, i.e. stay pairable forever #PairableTimeout = 0# 
> Automatic connection for bonded devices driven by platform/user events.
> # If a platform plugin uses this mechanism, automatic connections will 
> be # enabled during the interval defined below. Initially, this 
> feature # intends to be used to establish connections to ATT channels. Default is 60.
> #AutoConnectTimeout = 60# Use vendor id source (assigner), vendor, 
> product and version information for # DID profile support. The values 
> are separated by ":" and assigner, VID, PID # and version.
> # Possible vendor id source values: bluetooth, usb (defaults to usb) 
> #DeviceID = bluetooth:1234:5678:abcd# Do reverse service discovery for 
> previously unknown devices that connect to # us. This option is really 
> only needed for qualification since the BITE tester # doesn't like us 
> doing reverse SDP for some test cases (though there could in # theory be other useful purposes for this too). Defaults to 'true'.
> #ReverseServiceDiscovery = true# Enable name resolving after inquiry. 
> Set it to 'false' if you don't need # remote devices name and want shorter discovery cycle. Defaults to 'true'.
> #NameResolving = true# Enable runtime persistency of debug link keys. 
> Default is false which # makes debug link keys valid only for the 
> duration of the connection # that they were created for.
> #DebugKeys = false# Restricts all controllers to the specified 
> transport. Default value # is "dual", i.e. both BR/EDR and LE enabled (when supported by the HW).
> # Possible values: "dual", "bredr", "le"
> ControllerMode = le# Enables Multi Profile Specification support. This 
> allows to specify if # system supports only Multiple Profiles Single 
> Device (MPSD) configuration # or both Multiple Profiles Single Device 
> (MPSD) and Multiple Profiles Multiple # Devices (MPMD) configurations.
> # Possible values: "off", "single", "multiple"
> #MultiProfile = off# Permanently enables the Fast Connectable setting 
> for adapters that # support it. When enabled other devices can connect 
> faster to us, # however the tradeoff is increased power consumptions. 
> This feature # will fully work only on kernel version 4.1 and newer. 
> Defaults to # 'false'.
> #FastConnectable = false[Policy]# The ReconnectUUIDs defines the set 
> of remote services that should try # to be reconnected to in case of a 
> link loss (link supervision # timeout). The policy plugin should 
> contain a sane set of values by # default, but this list can be 
> overridden here. By setting the list to # empty the reconnection feature gets disabled.
> #ReconnectUUIDs=00001112-0000-1000-8000-00805f9b34fb, 
> 0000111f-0000-1000-8000-00805f9b34fb, 0000110a-0000-1000-8000-00805f9b34fb# ReconnectAttempts define the number of attempts to reconnect after a link # lost. Setting the value to 0 disables reconnecting feature.
> #ReconnectAttempts=7# ReconnectIntervals define the set of intervals 
> in seconds to use in between # attempts.
> # If the number of attempts defined in ReconnectAttempts is bigger 
> than the # set of intervals the last interval is repeated until the last attempt.
> #ReconnectIntervals=1, 2, 4, 8, 16, 32, 64# AutoEnable defines option to enable all controllers when they are found.
> # This includes adapters present on start as well as adapters that are 
> plugged # in later on. Defaults to 'false'.
> AutoEnable=true
>
>
> And bluetooth.service
>
>
> [Unit]
> Description=Bluetooth service
> Documentation=man:bluetoothd(8)
> ConditionPathIsDirectory=/sys/class/bluetooth[Service]
> Type=dbus
> BusName=org.bluez
> ExecStart=/usr/libexec/bluetooth/bluetoothd -d -n --configfile 
> /etc/bluetooth/main.conf NotifyAccess=main
> #WatchdogSec=10
> #Restart=on-failure
> CapabilityBoundingSet=CAP_NET_ADMIN CAP_NET_BIND_SERVICE
> LimitNPROC=1
> ProtectHome=true
> ProtectSystem=full[Install]
> WantedBy=bluetooth.target
> Alias=dbus-org.bluez.service
>
> Any guidance/pointers?
>
>
> Thanks,
> Abdul Karim
>
>
>
>
>
>


--
Luiz Augusto von Dentz

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Incorrect advertise flags in bluetooth beacon using BlueZ
  2020-05-08  7:59   ` Ryll, Jan (GED-SDD2)
@ 2020-05-08  8:40     ` Karim, Hafiz Abdul
  0 siblings, 0 replies; 5+ messages in thread
From: Karim, Hafiz Abdul @ 2020-05-08  8:40 UTC (permalink / raw)
  To: Ryll, Jan (GED-SDD2), Luiz Augusto von Dentz; +Cc: linux-bluetooth

Hi Luiz,

We do update the service after main.conf is changed. 
I agree with Jan's understanding of problem statement here. 

Regards,
Hafiz Abdul Karim,
Senior Software Development Engineer | Mentor Embedded Linux
Mentor, A Siemens Business
6th Floor Ali Tower M. M. Alam Road Gulberg III Lahore Pakistan, 54660
HafizAbdul_karim@mentor.com  | office: +92-42-3609-9202 | cell: +92-334-5099746

________________________________________
From: Ryll, Jan (GED-SDD2) <Jan.Ryll@bshg.com>
Sent: Friday, May 8, 2020 12:59 PM
To: Luiz Augusto von Dentz; Karim, Hafiz Abdul
Cc: linux-bluetooth@vger.kernel.org
Subject: RE: Incorrect advertise flags in bluetooth beacon using BlueZ

Hi Luiz,

what I understood is that at first start of bluez bluetooth service the advertisement flags for "mode" are not set to the correct value, as defined (ControllerMode = le) in main.conf.
If you start the service a second time this flag is correct. For the first time it is always wrong.
This is the same we did see here with our equipment.

Regards
Jan


-----Original Message-----
From: linux-bluetooth-owner@vger.kernel.org <linux-bluetooth-owner@vger.kernel.org> On Behalf Of Luiz Augusto von Dentz
Sent: Thursday, May 7, 2020 10:24 PM
To: Karim, Hafiz Abdul <HafizAbdul_Karim@mentor.com>
Cc: linux-bluetooth@vger.kernel.org
Subject: Re: Incorrect advertise flags in bluetooth beacon using BlueZ

Hi Hafiz Abdul,


On Thu, May 7, 2020 at 3:36 AM Karim, Hafiz Abdul <HafizAbdul_Karim@mentor.com> wrote:
>
>
> Using nRF Connect android application, I'm getting incorrect advertise
> flags in bluetooth beacon using BlueZ I have tried on two bluez versions i.e 5.48 and 5.52.
>
> I have set ControllerMode to "le" in main.conf. Using bluetootctl, when I turn on the advertisement using command "advertise on", I get 0x02 advertisement flag. Which means "BR/EDR Not Supported" (Bit 2) is not set.
> Now, if i restart the bluetooth service, and turn on the advertisement again, I get 0x06 advertisement flags.

Are you saying we are not updating the service once main.conf has changed? We don't do that automatically if that is what you are referring to, also if you want to advertise as a beacon/broadcaster and not as peripheral thean us you should use advertise broadcast.

> Here is my main.conf
>
> [General]# Default adaper name
> # Defaults to 'BlueZ X.YZ'
> #Name = BlueZ# Default device class. Only the major and minor device
> class bits are # considered. Defaults to '0x000000'.
> Class = 0x000100# How long to stay in discoverable mode before going
> back to non-discoverable # The value is in seconds. Default is 180, i.e. 3 minutes.
> # 0 = disable timer, i.e. stay discoverable forever
> DiscoverableTimeout = 0# How long to stay in pairable mode before
> going back to non-discoverable # The value is in seconds. Default is 0.
> # 0 = disable timer, i.e. stay pairable forever #PairableTimeout = 0#
> Automatic connection for bonded devices driven by platform/user events.
> # If a platform plugin uses this mechanism, automatic connections will
> be # enabled during the interval defined below. Initially, this
> feature # intends to be used to establish connections to ATT channels. Default is 60.
> #AutoConnectTimeout = 60# Use vendor id source (assigner), vendor,
> product and version information for # DID profile support. The values
> are separated by ":" and assigner, VID, PID # and version.
> # Possible vendor id source values: bluetooth, usb (defaults to usb)
> #DeviceID = bluetooth:1234:5678:abcd# Do reverse service discovery for
> previously unknown devices that connect to # us. This option is really
> only needed for qualification since the BITE tester # doesn't like us
> doing reverse SDP for some test cases (though there could in # theory be other useful purposes for this too). Defaults to 'true'.
> #ReverseServiceDiscovery = true# Enable name resolving after inquiry.
> Set it to 'false' if you don't need # remote devices name and want shorter discovery cycle. Defaults to 'true'.
> #NameResolving = true# Enable runtime persistency of debug link keys.
> Default is false which # makes debug link keys valid only for the
> duration of the connection # that they were created for.
> #DebugKeys = false# Restricts all controllers to the specified
> transport. Default value # is "dual", i.e. both BR/EDR and LE enabled (when supported by the HW).
> # Possible values: "dual", "bredr", "le"
> ControllerMode = le# Enables Multi Profile Specification support. This
> allows to specify if # system supports only Multiple Profiles Single
> Device (MPSD) configuration # or both Multiple Profiles Single Device
> (MPSD) and Multiple Profiles Multiple # Devices (MPMD) configurations.
> # Possible values: "off", "single", "multiple"
> #MultiProfile = off# Permanently enables the Fast Connectable setting
> for adapters that # support it. When enabled other devices can connect
> faster to us, # however the tradeoff is increased power consumptions.
> This feature # will fully work only on kernel version 4.1 and newer.
> Defaults to # 'false'.
> #FastConnectable = false[Policy]# The ReconnectUUIDs defines the set
> of remote services that should try # to be reconnected to in case of a
> link loss (link supervision # timeout). The policy plugin should
> contain a sane set of values by # default, but this list can be
> overridden here. By setting the list to # empty the reconnection feature gets disabled.
> #ReconnectUUIDs=00001112-0000-1000-8000-00805f9b34fb,
> 0000111f-0000-1000-8000-00805f9b34fb, 0000110a-0000-1000-8000-00805f9b34fb# ReconnectAttempts define the number of attempts to reconnect after a link # lost. Setting the value to 0 disables reconnecting feature.
> #ReconnectAttempts=7# ReconnectIntervals define the set of intervals
> in seconds to use in between # attempts.
> # If the number of attempts defined in ReconnectAttempts is bigger
> than the # set of intervals the last interval is repeated until the last attempt.
> #ReconnectIntervals=1, 2, 4, 8, 16, 32, 64# AutoEnable defines option to enable all controllers when they are found.
> # This includes adapters present on start as well as adapters that are
> plugged # in later on. Defaults to 'false'.
> AutoEnable=true
>
>
> And bluetooth.service
>
>
> [Unit]
> Description=Bluetooth service
> Documentation=man:bluetoothd(8)
> ConditionPathIsDirectory=/sys/class/bluetooth[Service]
> Type=dbus
> BusName=org.bluez
> ExecStart=/usr/libexec/bluetooth/bluetoothd -d -n --configfile
> /etc/bluetooth/main.conf NotifyAccess=main
> #WatchdogSec=10
> #Restart=on-failure
> CapabilityBoundingSet=CAP_NET_ADMIN CAP_NET_BIND_SERVICE
> LimitNPROC=1
> ProtectHome=true
> ProtectSystem=full[Install]
> WantedBy=bluetooth.target
> Alias=dbus-org.bluez.service
>
> Any guidance/pointers?
>
>
> Thanks,
> Abdul Karim
>
>
>
>
>
>


--
Luiz Augusto von Dentz

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-05-08  8:40 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-07 10:25 Incorrect advertise flags in bluetooth beacon using BlueZ Karim, Hafiz Abdul
2020-05-07 12:20 ` Ryll, Jan (GED-SDD2)
2020-05-07 20:24 ` Luiz Augusto von Dentz
2020-05-08  7:59   ` Ryll, Jan (GED-SDD2)
2020-05-08  8:40     ` Karim, Hafiz Abdul

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.