diff options
author | Inga Stotland <inga.stotland@intel.com> | 2019-06-29 23:43:56 -0700 |
---|---|---|
committer | Brian Gix <brian.gix@intel.com> | 2019-07-01 09:17:43 -0700 |
commit | 9acc66c6f10eed58da1da70d05923e25f8b00d32 (patch) | |
tree | efbbc972497fb0f464369c4d98e220e6b5abc0d0 /test | |
parent | 5a37a85fbc4c2801811dd9c2760e38cb5a01d687 (diff) | |
download | bluez-9acc66c6f10eed58da1da70d05923e25f8b00d32.tar.gz |
test: test-mesh - Correctly stop periodic publication
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.
Diffstat (limited to 'test')
-rwxr-xr-x | test/test-mesh | 8 |
1 files 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): |