From patchwork Wed May 20 20:44:44 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alvar Penning X-Patchwork-Id: 11561561 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8FEDE138A for ; Wed, 20 May 2020 20:50:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7919E20849 for ; Wed, 20 May 2020 20:50:42 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=0x21.biz header.i=@0x21.biz header.b="D1jPBHCh" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727930AbgETUul (ORCPT ); Wed, 20 May 2020 16:50:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59622 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727018AbgETUul (ORCPT ); Wed, 20 May 2020 16:50:41 -0400 X-Greylist: delayed 309 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Wed, 20 May 2020 13:50:41 PDT Received: from sadachbia.lurk.space (sadachbia.lurk.space [IPv6:2a03:4000:6:d293::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 55E76C061A0E for ; Wed, 20 May 2020 13:50:41 -0700 (PDT) From: Alvar Penning DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=0x21.biz; s=mail; t=1590007531; bh=VHf2TM/HNVKvbgNgpMaHa8jJqNgwXMI57T4nzMA4GJo=; h=From:To:Cc:Subject:Date; b=D1jPBHChc6Masp2IzIVKQgpNs7cgdR+AKyFfUEqFhpmaKzOXjzQvnw8TyKFVaWp5z t2DmZZrLq9mMw79yKBzi7k8WSi0BroBX5574Z8zf0tWjAU0Jvf55GMKWM81buU13UG 2mmKnlyIbsuAEvOJnD8+WqTDzhawiWxB/gWhAqlo= To: linux-bluetooth@vger.kernel.org Cc: Alvar Penning Subject: [PATCH BlueZ] test/example-advertisement: Fix include_tx_power Date: Wed, 20 May 2020 22:44:44 +0200 Message-Id: <20200520204444.28994-1-post@0x21.biz> MIME-Version: 1.0 Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org 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(