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.
Hi,
The pc-ble-driver-py is a python wrapper for the pc-ble-driver, and the heart_rate_collector.py is the included example that demonstrate how to use it. In other words, heart_rate_collector.py is the example.
I did not understand the question other than that, though. What is it you are wondering about? As you mention on_notification, this is a function that is called whenever a notification is received, and it prints the connection handle, the UUID that got notified and the data that was notified (i.e. the received data).
How do I get notification from (uuid:0xfff6) and read data.
I think "on_notification" can only show the data what i gave it(hightlight).
on_notification(self, ble_adapter, conn_handle, uuid, data)
So my question is how to get the 'data'?
I have use "self.adapter.enable_notification(new_conn, self.nus_tx)"
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).
OK thank you for reply
OK thank you for reply