[英]How can I use BLE notifications in Python
I am working with sensorTags
and LightBlue Beans BLE
devices, but can not find a way to interact with them using notifications. 我正在使用
sensorTags
和sensorTags
LightBlue Beans BLE
设备,但是找不到使用通知与它们交互的方法。 I have tried several codes in python which implements read/writes but I need to speedup the access to the sensors data. 我在python中尝试了几种实现读/写的代码,但是我需要加快对传感器数据的访问。 Any suggestion?
有什么建议吗? I'm using a raspberry based platform and python.
我正在使用基于树莓派的平台和python。
You will have an easier time using Node.js, these are actively worked on. 使用Node.js将会使您的工作更加轻松,这些都已经投入使用。
For Central devices: https://github.com/sandeepmistry/noble 对于中央设备: https : //github.com/sandeepmistry/noble
For Peripheral devices: https://github.com/sandeepmistry/bleno 对于外围设备: https : //github.com/sandeepmistry/bleno
This Gist shows how to use python-dbus to read out scratch characteristics data: https://gist.github.com/jsiverskog/0afa43225bdbe8e803cb 该要点展示了如何使用python-dbus读取暂存特征数据: https : //gist.github.com/jsiverskog/0afa43225bdbe8e803cb
From my tests it seems to be quick to react on updates in the data (of course somewhat dependent on your actual implementation on the Bean). 从我的测试看来,对数据的更新做出反应似乎很快(当然,这在某种程度上取决于您在Bean上的实际实现)。 It should provide enough information to get you going.
它应该提供足够的信息来帮助您前进。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.