Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp125558ybd; Fri, 28 Jun 2019 16:02:37 -0700 (PDT) X-Google-Smtp-Source: APXvYqwz6u0hW3YOmPsTLSnxf34B19a0F8b9gO/Y1Mr+8OObD19v/5sSbrz3LnCCanMRqISEKkWM X-Received: by 2002:a17:90a:cf0d:: with SMTP id h13mr16021643pju.63.1561762957357; Fri, 28 Jun 2019 16:02:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561762957; cv=none; d=google.com; s=arc-20160816; b=PcJIuYSoV49jb1z07PBP5daMaDMSIIGC1aEzqg6e3I4IxeEMSbjQ89ubdJ5FYSMcbX 93QP4N4+wO1lqwlG7CuYPeuBC2niVf4tiSmvh4ZYRMYu0DQ2v3SXDn3cCpi2j9YpMPbE 8BVDJ5/RS0HZCNse0dtYyJa93gRePbEzYQ4Fn/nSiPb2sYyxl4IhT5JtZkGmE/lQ59JO yuiNul67JvqdAoBPuWSljdTnL1ZM6k5E+t9KR6uCKGTee96l1J6B38CW/dmaXKVur499 aq1BmEZnd0Tc7xMBkE2Enpg22qN5ut3B497/52ifGQWDMytLGYCW0Qml8jDaP2x1+x/g +HHg== 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=xvJLamV8xsSgG8T+ju0xYTyJLuaLzFusVocnXuL7YXY=; b=pKznLjiVa3lQC/nb+67Z64FVszGkmbtURIO3vFefaQGkbrZ4P77w3iSKaowOP7WwDd kkRQ0YIbFMifWZOQ4KtInDG6C2SKEjTKDU5koDueW2FedHeuPn6Era9LfvNMClfVLJGe lNGQqJgAReTUocQUV5yHZkpAdE1DsCOvyXvfqQBBa+ubSQz3n5MJPtImhqhAF7fEa3yR EvG2MdnsdD2uPvPk1nKFyUeDq+yVsRQL8GIFLNa0In/bhMKWSa3Xjc0aEfOznISGKJVi q6b4AOppWaWrvG5clEvzkZIbgE3ghUZDKVXU9zoAFxxiAg/36+ypt97Rq4QaZgeQkCuQ QVGg== 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 d5si3126094pgk.346.2019.06.28.16.02.22; Fri, 28 Jun 2019 16:02:37 -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 S1726867AbfF1XBt (ORCPT + 99 others); Fri, 28 Jun 2019 19:01:49 -0400 Received: from mga06.intel.com ([134.134.136.31]:53757 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727033AbfF1XBr (ORCPT ); Fri, 28 Jun 2019 19:01:47 -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 orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 28 Jun 2019 16:01:47 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.63,429,1557212400"; d="scan'208";a="314271666" Received: from ingas-nuc1.sea.intel.com ([10.252.196.161]) by orsmga004.jf.intel.com with ESMTP; 28 Jun 2019 16:01:46 -0700 From: Inga Stotland To: linux-bluetooth@vger.kernel.org Cc: brian.gix@intel.com, Inga Stotland Subject: [PATCH BlueZ 4/4 v3] test: test-mesh - Correctly stop periodic publication Date: Fri, 28 Jun 2019 16:01:42 -0700 Message-Id: <20190628230142.16367-5-inga.stotland@intel.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190628230142.16367-1-inga.stotland@intel.com> References: <20190628230142.16367-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