Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp2609749ybd; Thu, 27 Jun 2019 15:49:21 -0700 (PDT) X-Google-Smtp-Source: APXvYqyvUvbgvf6A6Z/1kMzsyCccqv2ZYUJD/86BhIjnRO49NLbHlZzJRKceG3IK0yIaptvl4ZWV X-Received: by 2002:a17:902:1129:: with SMTP id d38mr7623696pla.220.1561675761912; Thu, 27 Jun 2019 15:49:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561675761; cv=none; d=google.com; s=arc-20160816; b=O0DYYow7VfrS9ruooVQ/7FfCtEpggHrnQCU/58iFrscI22zZgZ39jhEw1/1QccfxEv gCf1clf0Zwjk6izBKhoqP9PnmBkmqBCaRTnu5RG7PWADL+mno1fuZTNav9ICbeBibp3y J6hfUTAqXtkgw7NJlQhNbEEzdGxlGmCWpE9fPi1ki9X1jZrBUeMDZu2sM7iRnb4fJoRD 9gyJQ8/3e9Jk2FWVSwyeR+jrWu9hjPE8tVEbI79AqUURNUEfbunzBZeV/rxjZONDloze WTao4OT0zweinf744wsSvPkC1UI3pA1mfAHhpPPUOjzf4Fyxvg/Y6xr7vwYwn0UA0RhZ 2l1Q== 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=qk6OrXsA8ZgFCWadHy7VgC34Hg5/2N1eYgwdgYJeNBU=; b=Q7N6pwiP0isHKkAeO6kohSVBbSCpqKP3ThVYnaOFegMldpOoIX8pRaDXzqrnNIrqXj 4lnro5ZzOzx4f7hXCN6WFZd99mwrunSpzmK9quLGYf8jSq9MaUlzSH6gdEhnMWr0Pm7w q/MhWe/yLaGsnJwbJEUoUk4rzHp9bWJKP1t5z/zoNhi83MPpsmRO1V7gXicX+Bz/8jRH A40lJojtRL9j9FBFKha4wr7qN4RTNpdVy+N7L65PJMnpgRWKuj54QdCkIq4fdFMzMsoe +LGVD1GpDx68pdCiw1vDon50ozr1bPs6mICQNxOAocS2JGngUV+DPLjRMd5E1ZFSXrQM OPBw== 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 r73si385977pgr.553.2019.06.27.15.49.05; Thu, 27 Jun 2019 15:49:21 -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 S1726574AbfF0Wsu (ORCPT + 99 others); Thu, 27 Jun 2019 18:48:50 -0400 Received: from mga17.intel.com ([192.55.52.151]:6157 "EHLO mga17.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726633AbfF0Wsu (ORCPT ); Thu, 27 Jun 2019 18:48:50 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Jun 2019 15:48:50 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.63,425,1557212400"; d="scan'208";a="183556400" Received: from ingas-nuc1.sea.intel.com ([10.252.196.161]) by fmsmga001.fm.intel.com with ESMTP; 27 Jun 2019 15:48:50 -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 v2] test: test-mesh - Correctly stop periodic publication Date: Thu, 27 Jun 2019 15:48:45 -0700 Message-Id: <20190627224845.20762-5-inga.stotland@intel.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190627224845.20762-1-inga.stotland@intel.com> References: <20190627224845.20762-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 address 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