Linux-Bluetooth Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH BlueZ] test/example-advertisement: Fix include_tx_power
@ 2020-05-20 20:44 Alvar Penning
  2020-05-21 16:23 ` Luiz Augusto von Dentz
  0 siblings, 1 reply; 2+ messages in thread
From: Alvar Penning @ 2020-05-20 20:44 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Alvar Penning

Adding the Tx Power Level is no longer done via IncludeTxPower, but via
the tx-power value in the Includes array. The previous code did not
throw an error, but neither led to the insertion of the value. As a
result of this change, include_tx_power now adds the Tx Power Level
again.
---
 test/example-advertisement | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/test/example-advertisement b/test/example-advertisement
index f116893b6..96e410683 100755
--- a/test/example-advertisement
+++ b/test/example-advertisement
@@ -57,7 +57,7 @@ class Advertisement(dbus.service.Object):
         self.solicit_uuids = None
         self.service_data = None
         self.local_name = None
-        self.include_tx_power = None
+        self.include_tx_power = False
         self.data = None
         dbus.service.Object.__init__(self, bus, self.path)
 
@@ -78,8 +78,8 @@ class Advertisement(dbus.service.Object):
                                                         signature='sv')
         if self.local_name is not None:
             properties['LocalName'] = dbus.String(self.local_name)
-        if self.include_tx_power is not None:
-            properties['IncludeTxPower'] = dbus.Boolean(self.include_tx_power)
+        if self.include_tx_power:
+            properties['Includes'] = dbus.Array(["tx-power"], signature='s')
 
         if self.data is not None:
             properties['Data'] = dbus.Dictionary(
-- 
2.25.4


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

* Re: [PATCH BlueZ] test/example-advertisement: Fix include_tx_power
  2020-05-20 20:44 [PATCH BlueZ] test/example-advertisement: Fix include_tx_power Alvar Penning
@ 2020-05-21 16:23 ` Luiz Augusto von Dentz
  0 siblings, 0 replies; 2+ messages in thread
From: Luiz Augusto von Dentz @ 2020-05-21 16:23 UTC (permalink / raw)
  To: Alvar Penning; +Cc: linux-bluetooth

Hi Alvar,

On Wed, May 20, 2020 at 1:54 PM Alvar Penning <post@0x21.biz> wrote:
>
> Adding the Tx Power Level is no longer done via IncludeTxPower, but via
> the tx-power value in the Includes array. The previous code did not
> throw an error, but neither led to the insertion of the value. As a
> result of this change, include_tx_power now adds the Tx Power Level
> again.
> ---
>  test/example-advertisement | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/test/example-advertisement b/test/example-advertisement
> index f116893b6..96e410683 100755
> --- a/test/example-advertisement
> +++ b/test/example-advertisement
> @@ -57,7 +57,7 @@ class Advertisement(dbus.service.Object):
>          self.solicit_uuids = None
>          self.service_data = None
>          self.local_name = None
> -        self.include_tx_power = None
> +        self.include_tx_power = False
>          self.data = None
>          dbus.service.Object.__init__(self, bus, self.path)
>
> @@ -78,8 +78,8 @@ class Advertisement(dbus.service.Object):
>                                                          signature='sv')
>          if self.local_name is not None:
>              properties['LocalName'] = dbus.String(self.local_name)
> -        if self.include_tx_power is not None:
> -            properties['IncludeTxPower'] = dbus.Boolean(self.include_tx_power)
> +        if self.include_tx_power:
> +            properties['Includes'] = dbus.Array(["tx-power"], signature='s')
>
>          if self.data is not None:
>              properties['Data'] = dbus.Dictionary(
> --
> 2.25.4

Applied, thanks.

-- 
Luiz Augusto von Dentz

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

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-20 20:44 [PATCH BlueZ] test/example-advertisement: Fix include_tx_power Alvar Penning
2020-05-21 16:23 ` Luiz Augusto von Dentz

Linux-Bluetooth Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-bluetooth/0 linux-bluetooth/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-bluetooth linux-bluetooth/ https://lore.kernel.org/linux-bluetooth \
		linux-bluetooth@vger.kernel.org
	public-inbox-index linux-bluetooth

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-bluetooth


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git