Received: by 2002:a05:6500:2018:b0:1fb:9675:f89d with SMTP id t24csp670201lqh; Fri, 31 May 2024 12:37:22 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVwCyb7Zn0LtbQba5/hX6m/R163sAeMy/PhnNXIOV1TG41p2NMAYrSo92VseUw2fiDOwg3Tl5bUoiVB3bllqMQs17XGSQK0XyfkohJ4ew== X-Google-Smtp-Source: AGHT+IHLZD6FS3OubGtuNKl6G0eNMipfEZgy4PN+A6UXcP7+tAkCZI2rIUsE04uMf0+Ok9CGfCjb X-Received: by 2002:a05:6a00:1906:b0:6ea:df65:ff7d with SMTP id d2e1a72fcca58-702477e8ef2mr3099021b3a.10.1717184242377; Fri, 31 May 2024 12:37:22 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717184242; cv=pass; d=google.com; s=arc-20160816; b=Ogu7qk3sJnZIU21YRBP/MFRt7Nu9WgKoommOUvHPxRhNpuoQbprnNGClln9bxpLVT2 30ygspn5MRldX0xaP73ONUtT+uN0ASAM7Boycy8ne2qFz+Y6fh1lV+iDBPy3SY3+dqHF DqtqN6Vbtjmh9N5nhRT4VAUGWYDHDxn7gORUT+lmgAZAoag6LGCXnh/95sIaiYD+/VPo ixsWG9igylXkvHu3tQdO+PQM2q1KzLDvwZMW5lBysRvlyb9615OhL6logtCxHvmgwpKn 4GIfuOyHn1ICy6gudts9pLTZxpdVuyRMclhMiLNpZivq0LBaGLclNr+4L9O4IuLXSCXE Hwaw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=/khTKtDM/gFR4Uw3Z/yqR3LBStGnIH/5qw8Lv0s5ZU8=; fh=+sk3YQvRMDfsYPDNvoJ+nteMVyPx8AoFXbd6EQrPjNs=; b=xKDSb22t0raTgmLxBXqDaj0Dxwuc56hlkmaaUQ8Tfj5H5RM9C4G56b2QLydgq3X/2H e+ATsUk7Kgh1B7vDoiQa1SPs/8J1Om+IxEMjajpuliNc1KlNNRhPtUJx42EXnTRvo5Lp P/h7PZrIFz77YQrOnpztshNbiJq7wU2ulHCvxDjhi9MX4gJnIKbd47Zsu3101qfJCiTG s6rItJC9XYtQoycljdxJVoPSeebRS79OEQqUMYp5x02/cbdx1xYm6lZ5i6gPjAq+HeAW VjYLGBw3hxuErirVoT4HSebIUR9RWLyM/hzjHNvcaJ2/mBrrusb7/mcFFVv4nnjUWw05 vKfg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@prestonhunt-com.20230601.gappssmtp.com header.s=20230601 header.b="xw/raM+D"; arc=pass (i=1 spf=pass spfdomain=prestonhunt.com dkim=pass dkdomain=prestonhunt-com.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-bluetooth+bounces-5055-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-bluetooth+bounces-5055-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id d2e1a72fcca58-70249f77be2si1561908b3a.121.2024.05.31.12.37.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 31 May 2024 12:37:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth+bounces-5055-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@prestonhunt-com.20230601.gappssmtp.com header.s=20230601 header.b="xw/raM+D"; arc=pass (i=1 spf=pass spfdomain=prestonhunt.com dkim=pass dkdomain=prestonhunt-com.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-bluetooth+bounces-5055-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-bluetooth+bounces-5055-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 29AE0285EE4 for ; Fri, 31 May 2024 19:37:16 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 11C9E158D9E; Fri, 31 May 2024 19:37:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=prestonhunt-com.20230601.gappssmtp.com header.i=@prestonhunt-com.20230601.gappssmtp.com header.b="xw/raM+D" X-Original-To: linux-bluetooth@vger.kernel.org Received: from mail-pf1-f180.google.com (mail-pf1-f180.google.com [209.85.210.180]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 10B271C6BD for ; Fri, 31 May 2024 19:37:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.180 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717184233; cv=none; b=HHAjXkdt0fVYiORfhSh8UXKCkhcvrQr3YY9DiymkQVir5n9HO7BRRRV7EXQSmpLlhhKNbtFCpu8UQvfCRYO5wHpKDi5jYkLAIDNHcA9NOO320/5zya2iy6ihgEohijmE70ZijuLiXv638KL+0I0GlyiROeeQNcwjSIX5+q4L2GA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717184233; c=relaxed/simple; bh=Yze7wy3biolSt3rBVbeJjaEPIGzudfSTbxZVhLvwY0w=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=rGUQSVROun8z1KLXKj/OFbflAiV5zB8v3XDjl732JRYSHaEQHD5yyb9BYFnRIK2MNLgGH1AT6Xb+DTs+dCEZ9PihHNzKVuWSo+cL19//HyOE+hcCNnkfybbW+3hUzSx+Y+sf/gOx09YkF5pOGe6/gpeoWRdjAkbf7V3sOgfG2d4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=prestonhunt.com; spf=pass smtp.mailfrom=prestonhunt.com; dkim=pass (2048-bit key) header.d=prestonhunt-com.20230601.gappssmtp.com header.i=@prestonhunt-com.20230601.gappssmtp.com header.b=xw/raM+D; arc=none smtp.client-ip=209.85.210.180 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=prestonhunt.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=prestonhunt.com Received: by mail-pf1-f180.google.com with SMTP id d2e1a72fcca58-702536f4fc9so220881b3a.2 for ; Fri, 31 May 2024 12:37:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=prestonhunt-com.20230601.gappssmtp.com; s=20230601; t=1717184231; x=1717789031; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=/khTKtDM/gFR4Uw3Z/yqR3LBStGnIH/5qw8Lv0s5ZU8=; b=xw/raM+D5MkfoofUaDi8sBHEc4MujtKXaMeFwU4fmwe5zxT7qXaa1wXwtWPqOnFAw1 AHNdpeJFLL+ydEkhVjdIZYdrYGi+fZg7kWIK6APbU4YSHnjhTdiZ7jteoHX8h5vnf5cK OOuX5ejmOrI8SR8kXdETKPIm2NHr2V0MTJopEiotsL5kjC0VblonVJ92mwTK2XWprw5T 1RS4mHnpfxVXgMktkr3wAfxskNs6+1/C49qmlvD5SYr5y0YdWYsK2XpFUxvCbHeK2C4S ePg4GN2Bd9ItyOPp7/FUXpe/d/6rcqm1yKFzVyJL/Z8vWrmZtpTd0iRYyVXHQE5/DvfY Cchw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717184231; x=1717789031; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=/khTKtDM/gFR4Uw3Z/yqR3LBStGnIH/5qw8Lv0s5ZU8=; b=LaGYd2hU96zHW4EcwEZHnQMtbmyAMm6C4wCVKUJYtkt9J/F4XDBEOkhOKdd00UaD2n ljvXYbEbcHy7ZkGFmN+fTprvTqVva4pm7hJUq1IrO07GkmPGp8vCbXBgdIXZXWLOce8D 3RaIQeX2Fi5W1k3Tv0qKztrsxrCwcCsWi7G1iYSAchGrJajNGoGaGGN/1Bvkk99sTk2l oOy6ZIlSf68wzCVF3MstrwigLECdcdDtHYgOMGTpydkwmVIXcc9ClR4Y1EIlJfLRCE9s BAmUDBZrtgOKybO/9G6BkMmo1qLNwzV7QkJ7hpkPCCmEcuFoyq62uc/CLA3gJys/9ivg a31Q== X-Gm-Message-State: AOJu0Yz6nE9bcwhaGSeiZ/Rj3o6ZzxGjahCznJOwLLjc1B3liJvFXQKi 07ASHaIjt5btCQoR7rMenf3Xfrnezu4wARRC31y/Fh2ITl/kwvLpJPw6HT1HvvcRbzyHlitaogu p X-Received: by 2002:a05:6a21:6d85:b0:1af:cc48:3e25 with SMTP id adf61e73a8af0-1b26f0f029cmr3231405637.10.1717184230813; Fri, 31 May 2024 12:37:10 -0700 (PDT) Received: from localhost.localdomain ([97.115.143.6]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-70242b2c262sm1720956b3a.190.2024.05.31.12.37.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 31 May 2024 12:37:10 -0700 (PDT) From: Preston Hunt To: linux-bluetooth@vger.kernel.org Cc: Preston Hunt Subject: [PATCH BlueZ 1/1] test/example-gatt: fix deprecation warning Date: Fri, 31 May 2024 12:36:22 -0700 Message-ID: <20240531193622.1696328-2-me@prestonhunt.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20240531193622.1696328-1-me@prestonhunt.com> References: <20240531193622.1696328-1-me@prestonhunt.com> Precedence: bulk X-Mailing-List: linux-bluetooth@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Use GLib instead of GObject to fix deprecation warning. Remove python2 gobject import. --- test/example-gatt-client | 7 ++----- test/example-gatt-server | 11 ++++------- 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/test/example-gatt-client b/test/example-gatt-client index 5e6bef9d7..38ca97eae 100755 --- a/test/example-gatt-client +++ b/test/example-gatt-client @@ -2,10 +2,7 @@ # SPDX-License-Identifier: LGPL-2.1-or-later import dbus -try: - from gi.repository import GObject -except ImportError: - import gobject as GObject +from gi.repository import GLib import sys from dbus.mainloop.glib import DBusGMainLoop @@ -189,7 +186,7 @@ def main(): global bus bus = dbus.SystemBus() global mainloop - mainloop = GObject.MainLoop() + mainloop = GLib.MainLoop() om = dbus.Interface(bus.get_object(BLUEZ_SERVICE_NAME, '/'), DBUS_OM_IFACE) om.connect_to_signal('InterfacesRemoved', interfaces_removed_cb) diff --git a/test/example-gatt-server b/test/example-gatt-server index 77231c3ad..83b700901 100755 --- a/test/example-gatt-server +++ b/test/example-gatt-server @@ -7,10 +7,7 @@ import dbus.mainloop.glib import dbus.service import array -try: - from gi.repository import GObject -except ImportError: - import gobject as GObject +from gi.repository import GLib import sys from random import randint @@ -305,7 +302,7 @@ class HeartRateMeasurementChrc(Characteristic): if not self.notifying: return - GObject.timeout_add(1000, self.hr_msrmt_cb) + GLib.timeout_add(1000, self.hr_msrmt_cb) def StartNotify(self): if self.notifying: @@ -392,7 +389,7 @@ class BatteryLevelCharacteristic(Characteristic): service) self.notifying = False self.battery_lvl = 100 - GObject.timeout_add(5000, self.drain_battery) + GLib.timeout_add(5000, self.drain_battery) def notify_battery_level(self): if not self.notifying: @@ -649,7 +646,7 @@ def main(): app = Application(bus) - mainloop = GObject.MainLoop() + mainloop = GLib.MainLoop() print('Registering GATT application...') -- 2.42.0