I am a python beginner, I read a lot of related questions, but they all ask us to look heart_rate_collector.py , but heart_rate_collector.py did't not have any example, i really don't understand how to used it.
I am a python beginner, I read a lot of related questions, but they all ask us to look heart_rate_collector.py , but heart_rate_collector.py did't not have any example, i really don't understand how to used it.
def __init__(self, adapter): super(NusCollector, self).__init__() self.first = 1 self.adapter = adapter self.conn_q = Queue() self.adapter.observer_register(self) self.adapter.driver.observer_register(self) self.adapter.default_mtu = 247 self.nus_base = BLEUUIDBase([ 0x00, 0x00, 0xff, 0xf0, 0x00 ,0x00, 0x10, 0x00, 0x80, 0x00, 0x00, 0x80, 0x5f, 0x9b, 0x34, 0xfb ]) self.nus_tx = BLEUUID(0xfff6, self.nus_base)
self.nus_tx is the UUID of 0XFFF6 which is the notify one
Is the UUID Base right? In the screenshot it looks like you are using only 16 bit UUIDs, but here you are adding a base (which is probably what you should do as this is a custom service). But in any case, in order to work, this needs to match.
Hello is there anything I can do for it?
I don't immediately see an issue here. I suggest you take a look at this post, which includes a working script that use NUS, and enables notifications (obviously you need to change the UUID and UUID base for your custom service).