Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp776090ybi; Sat, 29 Jun 2019 23:45:20 -0700 (PDT) X-Google-Smtp-Source: APXvYqyowi0y/iSv4epKvqFqDKqne4ClEHHHS3MDAAbIMhhQu+bqK1H4qHi+90EGnaGmemdIzfqW X-Received: by 2002:a17:90a:d80b:: with SMTP id a11mr22373654pjv.53.1561877120138; Sat, 29 Jun 2019 23:45:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561877120; cv=none; d=google.com; s=arc-20160816; b=aK4zcMN4OL9cPM8ifkQLzkCjmaBRU3pyd9HTpLxFsvNMfwhZKtLiLO5lmrHLW2HUnc 7JmEWpEHKonzvGB/YYoitBumt/gmn1s2RyPznI01kMUFy6NSh6qRXOxStd+CWoReGaF9 W7hP+q8occjvUM/bslXoMWSQ+xkjfqLOGYDQ3jw4Aou10K6V252Z52rrzte41I7jPpYW iEYLkoiY+Px638eSfgsOtTsa4cmprZ95LE8TI/oKf4RoARx5STwXmN5jHQEzlCaWkCRn j1tH4Y8lxae981BP/mCxfjP/g2AvYbxqwofeMlYzJ2kosdLda7B+MHAttTUQMxAQAmZA r2Xw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=DbT+Ie91z05M5sv2uNw34yXpT9e0ge4b3mpabKxU05k=; b=m489GTpd/r1nZNNmYa/DCb7zZmjtzPo7yn2sTa7Vp9l7Uwiwa75K8uwBbCuXayEev8 eK82QLR7iRMYBtQUG36W4WW1p74/cimijBP1AfR9DTIoXnwiNkj/l7AK3rcGy3tpK0/z Rj4kLK0grPCwllJxuLPHHBlNcPwdlwysjx8irleHreOjMh+nlAntwAiNaD8eDb+QD4kt Bp1OU26U4FpNTqfFBJ4u3JWE9CdyJ+FADHSRu7m2vtOGeEDvOUM1JHT02g17DYZdXtpk ggw9LMfdedbaeWj2kC53pSaLGx+1MHdVAkAOWS4TATQpUKFU18Zy3qYy77r/aYyqyite 2Qtg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j14si7751661pfe.183.2019.06.29.23.45.05; Sat, 29 Jun 2019 23:45:20 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726513AbfF3GoA (ORCPT + 99 others); Sun, 30 Jun 2019 02:44:00 -0400 Received: from mga07.intel.com ([134.134.136.100]:7277 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726500AbfF3GoA (ORCPT ); Sun, 30 Jun 2019 02:44:00 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 29 Jun 2019 23:44:00 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.63,434,1557212400"; d="scan'208";a="314543842" Received: from ingas-nuc1.sea.intel.com ([10.254.64.161]) by orsmga004.jf.intel.com with ESMTP; 29 Jun 2019 23:44:00 -0700 From: Inga Stotland To: linux-bluetooth@vger.kernel.org Cc: brian.gix@intel.com, michal.lowas-rzechonek@silvair.com, Inga Stotland Subject: [PATCH BlueZ 4/4 v4] test: test-mesh - Correctly stop periodic publication Date: Sat, 29 Jun 2019 23:43:56 -0700 Message-Id: <20190630064356.12660-5-inga.stotland@intel.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190630064356.12660-1-inga.stotland@intel.com> References: <20190630064356.12660-1-inga.stotland@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org This changes the order of checks for an updated publication period: check for zero period first, and if this is the case, stop sending the periodic model publications. --- test/test-mesh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/test-mesh b/test/test-mesh index c075a642b..4d515e186 100755 --- a/test/test-mesh +++ b/test/test-mesh @@ -606,15 +606,15 @@ class OnOffServer(Model): def set_publication(self, period): - # We do not handle ms in this example - if period < 1000: - return - self.pub_period = period if period == 0: self.timer.cancel() return + # We do not handle ms in this example + if period < 1000: + return + self.timer.start(period/1000, self.publish) def publish(self): -- 2.21.0