Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp1324358pxb; Thu, 14 Apr 2022 03:45:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzypIW/MbOyZN8lQrCcxpt9xTdGBFxCnBHp6B9HLVT/fUPXuR7ZzzF4UAxyxOT+l235dPwi X-Received: by 2002:a17:903:32c4:b0:158:ac00:cc95 with SMTP id i4-20020a17090332c400b00158ac00cc95mr5561119plr.148.1649933109108; Thu, 14 Apr 2022 03:45:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649933109; cv=none; d=google.com; s=arc-20160816; b=ahom7WwMgxj1ZUCql3u6Yx9BELzPey+azhncE4HXhWtwVAfNPGTQTiSyLrjgGUOEEh RC+ObcBRJCZWXYvbwS79QFXm1FqEKlJASH2sRVuBgN97PalpQ0501iJ0NmVB2mdy1633 vsIRG49LY7qhn8Slfe5Vv4+2hJyDmwq8Lu1yshlD/zR8KW+FY0AJbYjYJYsNBk4arXIE J036d1C8rtehX8ko6JCFDLiMxuUcFVtbdTVPP0z1TfQvUuyRd7i+2c7GqPyIHKZaF6+F revsq/87Fsqf7GH4Y4qAr45wfBujAO7nu0hmNRx57RPupreYXft4V2vI7j9Vdgq0tje2 YJCA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:references:mime-version :message-id:in-reply-to:date:dkim-signature; bh=uTiLus5wZpzBdaNIG2x/m/7MW6CIV6AQUuw8YBGtDQw=; b=Wsz2lKnpLUXmxtg4Oa6WXCU9SNg8tqLTauwMf1pYA/mw46RduWJid4qiV+0H7L2FFF B7gwZHhYP81CeCWjqs8lGAeItSGbvnEigNxeViw4Jq3NIFF+cdtF6a6GbVZcb9TeB+0i dL3xDtlgMfV+2IfrgwoPTlUEEXA6Y0OyfvUbasuFMl3I6/jCikBj85kMv5sw5qibFkMx tnG5ySWa1GFU7EVVWerGVjP/UlEwV0fUx8O6N0CDxmNLtmFPNDwHdFhihuKs/NFCQ4h3 SrCHkkjDCfs0dJrL5s8rpTYK9jtqAmmKy7nNHeW6dvxOOCx8qCl2mJkfr+GNzNJID6cr N/eA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=FWPkBjV2; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 13-20020a63020d000000b00381facb2ec6si7889905pgc.728.2022.04.14.03.44.18; Thu, 14 Apr 2022 03:45:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=FWPkBjV2; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238740AbiDMU5w (ORCPT + 99 others); Wed, 13 Apr 2022 16:57:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40624 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238768AbiDMU5i (ORCPT ); Wed, 13 Apr 2022 16:57:38 -0400 Received: from mail-yb1-xb4a.google.com (mail-yb1-xb4a.google.com [IPv6:2607:f8b0:4864:20::b4a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B82DE53718 for ; Wed, 13 Apr 2022 13:55:16 -0700 (PDT) Received: by mail-yb1-xb4a.google.com with SMTP id h82-20020a25d055000000b00641d2fd5f3fso2311807ybg.11 for ; Wed, 13 Apr 2022 13:55:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=uTiLus5wZpzBdaNIG2x/m/7MW6CIV6AQUuw8YBGtDQw=; b=FWPkBjV2Hd8Ey8qh9GRVLYp2U2G8Sc0AmfQjJjbmMOIYanak+NWYR08ZZYEP6yevg6 g1QNI/BYuGlZtRiNuhfe4Z3s/WqwpuTxdLI0TzC4KUE7N03hwulMzBJP0nsV9Ofhjl6Q h/DyPkD1BuDHz2ImZejzZ4kUYtDYwVM5I4toS44qGlbSVeiwBj/AdC41n1ixDgzzsj7N p8+pjZXAfU16kaZi+9CZH7IvvDhLdMvq8Z6ueMJWGxlG8bH8obF1potE6Nbv56Hzs8yT JEZtMZ74TAllbgUfHbNV4J8RtztTGUjm8sL4VSXuisX5dTTRb44CbTs6yh7VtIIVMXks vMqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=uTiLus5wZpzBdaNIG2x/m/7MW6CIV6AQUuw8YBGtDQw=; b=Q8AEttG8k5RLW8f/Akr34UYtO8xMzXZE2JT62irbOCjXC1MzKx2yhxPJGIY6orfpzw GsbkQgLmavIe3nOljMKnLkrHWr7w7sejcsYPR9b6dYp4E82WS0tLX+fAgRqPJV63mRt7 PEBiuYbYI5mM5tNbi9UNSyzPcvJHwp88EKZ+7NeISUjaMrMNfVhEh7/Oj9ctm8QOCmr9 vsHL5avLATqYb5SDaEvWPKkugK1Z0tZQXC5XgX47+3VC+HkdR75vVCglXb9rGM9YN4Hq rG+xQPTdZlmFGC3CKvyotANLUdliqF2prydywDltwBpJMDMvPN6sxiOsmsNlT0iooRsN 8qIA== X-Gm-Message-State: AOAM532u48a3fnv0DLY2PvKwnpJhd5n9giz8HcEsnGscwNjvyqjEPjJU 3mwIxkVB37ddrWO7qZKAELZVpDR3mQOVow== X-Received: from mmandlik.mtv.corp.google.com ([2620:15c:202:201:2620:46aa:79ff:778d]) (user=mmandlik job=sendgmr) by 2002:a25:fd5:0:b0:641:185f:1d14 with SMTP id 204-20020a250fd5000000b00641185f1d14mr716720ybp.568.1649883315981; Wed, 13 Apr 2022 13:55:15 -0700 (PDT) Date: Wed, 13 Apr 2022 13:54:49 -0700 In-Reply-To: <20220413135223.BlueZ.v2.1.I21d5ed25e9a0a2427bddbd6d4ec04d80d735fc53@changeid> Message-Id: <20220413135223.BlueZ.v2.9.I6c034497f366eccbb78925ad107ce957f81d97b1@changeid> Mime-Version: 1.0 References: <20220413135223.BlueZ.v2.1.I21d5ed25e9a0a2427bddbd6d4ec04d80d735fc53@changeid> X-Mailer: git-send-email 2.36.0.rc0.470.gd361397f0d-goog Subject: [BlueZ PATCH v2 9/9] test: Display the AdvMonitor Release reason From: Manish Mandlik To: marcel@holtmann.org, luiz.dentz@gmail.com Cc: chromeos-bluetooth-upstreaming@chromium.org, linux-bluetooth@vger.kernel.org, Manish Mandlik , Miao-chen Chou Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-9.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Bluetoothd returns the release reason when a monitor is released. Read the release reason received as part of the Release event and print it using the example python app. Reviewed-by: Miao-chen Chou --- (no changes since v1) test/example-adv-monitor | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/test/example-adv-monitor b/test/example-adv-monitor index a405fc7b0..b01114c6b 100644 --- a/test/example-adv-monitor +++ b/test/example-adv-monitor @@ -117,10 +117,11 @@ class AdvMonitor(dbus.service.Object): @dbus.service.method(ADV_MONITOR_IFACE, - in_signature='', + in_signature='y', out_signature='') - def Release(self): - print('{}: Monitor Released'.format(self.path)) + def Release(self, reason): + print('{}: Monitor Released (reason: {})'.format(self.path, + format(reason, 'd'))) @dbus.service.method(ADV_MONITOR_IFACE, @@ -352,7 +353,10 @@ def test(bus, mainloop, advmon_mgr, app_id): # Run until user hits the 'Enter' key. If any peer device is advertising # during this time, DeviceFound() should get triggered for monitors # matching the advertisements. - raw_input('Press "Enter" key to quit...\n') + try: + raw_input('Press "Enter" key to quit...\n') # python2 + except: + input('Press "Enter" key to quit...\n') # python3 # Remove a monitor. DeviceFound() for this monitor should not get # triggered any more. -- 2.36.0.rc0.470.gd361397f0d-goog