How to use on_notification fuction to get notification

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 on_notification(self, ble_adapter, conn_handle, uuid, data):
data should be the thing i want to get,is that right?
 

Parents Reply
  •     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

Children
Related