[英]How to repeat reading the value from the BLE device only when the value updated (python on MacOS)?
As title, now I can get values from the BLE device, as the following codes shown: 作为标题,现在我可以从BLE设备获取值,如以下代码所示:
class RobotDelegate(object):
...
def peripheral_didDiscoverCharacteristicsForService_error_(self, peripheral, service, error):
for characteristic in self.service.characteristics():
if characteristic.UUID() == blebee_characteristic:
self.characteristic = characteristic
print ("self.characteristic.value = ", self.characteristic.value())
...
delegate = RobotDelegate()
manager = CBCentralManager.alloc()
manager.initWithDelegate_queue_options_(delegate, None, None)
AppHelper.runConsoleEventLoop()
And I can read the value from my BLE device only one time... Actually, the BLE device can continuously update the value when someone touch, so I like to know how should I do to achieve this? 而且我只能一次从BLE设备读取值...实际上,当有人触摸时BLE设备可以连续更新值,所以我想知道应该怎么做才能做到这一点? Thanks. 谢谢。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.