Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp1559931ybd; Wed, 26 Jun 2019 20:36:16 -0700 (PDT) X-Google-Smtp-Source: APXvYqz6moKGxptmyjEXmYDppTb4IcWBhNTLxaU/x5siszFri1/KcNVnd7OA0oRuJd6tDR/Jy2dJ X-Received: by 2002:a17:902:54d:: with SMTP id 71mr1927778plf.140.1561606576585; Wed, 26 Jun 2019 20:36:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561606576; cv=none; d=google.com; s=arc-20160816; b=osCZX+Hkbphss92Lx55jC52bZkXHmNQhBjje922ApFdGl3QkShdn0vhOeCP2bQIE75 Pmum5e5g6weTh1HmyHLsmFlyeHVNlbM2K9ZoY0tOZCUQxoueDGk0QC2xwzFjSMU1EKNV 11rQL8xlnerwIS5sXGye5ixzWylNDXbnh4CkBeUsCWpHY94Tuu7D6qcbyIu3YLFgkVvv LBpqblSEFFvknq/k4kIbj8wY7FiG8lqDqBaf+XgE8GfGP4HdDnVsayM0LHoR3Ztpyo98 2CkLTAvjazG3DmqVo72e+TuMxckWED0pe7YtPu7CN/6KS7yIMgbr311xp+rDLUquW/OZ j2zw== 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=La9rQtgJ7q02oWNC4uELFdg9Fe6WO/nvV/8OdyTTBUNEMHE/ZH2iBglyPxhCKUw+W1 bPb70Yw+ZM0FEXHSP/0/xWHDQmGX5saCh2M8OixyeCY1whg6uBjFPE7pIwzS5JtPTQqE M5nXiPIe1h+Le51cvpBFBWS6iCtlgkAeen7jLkDfp+da+sMkSqMPlM+t8LZOmeT4OnwT L4rLam8JzvnrjSnCQJ79ZjG7XykI8R9+iXtC4ByevgPR7r1Ew0uO3TmYr63ybjdMClZ6 jchJhA0fFt2VowlI9UkvTyXL3Skn33L63WUxQCE1Ocdi88LnQUCJsrGsxmOj5X01cOf0 4hMQ== 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 w16si1052767plp.329.2019.06.26.20.36.01; Wed, 26 Jun 2019 20:36:16 -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 S1726928AbfF0Dd3 (ORCPT + 99 others); Wed, 26 Jun 2019 23:33:29 -0400 Received: from mga12.intel.com ([192.55.52.136]:10350 "EHLO mga12.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726447AbfF0Dd3 (ORCPT ); Wed, 26 Jun 2019 23:33:29 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 26 Jun 2019 20:33:29 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.63,422,1557212400"; d="scan'208";a="164586113" Received: from ingas-nuc1.sea.intel.com ([10.255.82.90]) by orsmga003.jf.intel.com with ESMTP; 26 Jun 2019 20:33:28 -0700 From: Inga Stotland To: linux-bluetooth@vger.kernel.org Cc: brian.gix@intel.com, johan.hedberg@gmail.com, luiz.dentz@gmail.com, Inga Stotland Subject: [PATCH BlueZ 4/4] test: test-mesh - Correctly stop periodic publication Date: Wed, 26 Jun 2019 20:33:20 -0700 Message-Id: <20190627033320.8898-5-inga.stotland@intel.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190627033320.8898-1-inga.stotland@intel.com> References: <20190627033320.8898-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