summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2017-10-23 11:19:15 +0300
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2017-10-23 14:17:07 +0300
commit9e7c2416f4219bf5f817d13a6626fd6f649549c1 (patch)
tree962c6e45df0d12f7f145ce3f60208bb3d0a7f3b0 /test
parent1c66a3dbc169c323c0f7ced1bf6bc11553cdaad3 (diff)
downloadbluez-9e7c2416f4219bf5f817d13a6626fd6f649549c1.tar.gz
test/example-gatt-server: Don't change measuments if not notifying
This makes it clearer when notifications are actually in effect.
Diffstat (limited to 'test')
-rwxr-xr-xtest/example-gatt-server2
1 files changed, 2 insertions, 0 deletions
diff --git a/test/example-gatt-server b/test/example-gatt-server
index 24aaff973..689e86ff7 100755
--- a/test/example-gatt-server
+++ b/test/example-gatt-server
@@ -401,6 +401,8 @@ class BatteryLevelCharacteristic(Characteristic):
{ 'Value': [dbus.Byte(self.battery_lvl)] }, [])
def drain_battery(self):
+ if not self.notifying:
+ return True
if self.battery_lvl > 0:
self.battery_lvl -= 2
if self.battery_lvl < 0: