Skip to content
Snippets Groups Projects
Verified Commit fdb38a7b authored by Nik | Klampfradler's avatar Nik | Klampfradler
Browse files

Implement handling of remote data

parent 2912cdd1
No related branches found
No related tags found
No related merge requests found
Pipeline #76963 failed
......@@ -61,6 +61,9 @@ class MynitCompanionApp(App):
self.widget.update_device_buttons(buttons_map)
def handle_data(self, data):
Logger.info("Handling received data: %s" % data)
def build(self):
self.widget = DeviceListWidget()
return self.widget
......@@ -57,3 +57,9 @@ class MynitBluetooth(BluetoothDispatcher):
def on_services(self, status, services):
Logger.info("Services discovered")
self._characteristics = (services.search(_UART_SERVICE_TX_UUID), services.search(_UART_SERVICE_RX_UUID))
self.enable_notifications(self._characteristics[1])
def on_characteristic_changed(self, characteristic):
Logger.info("Data received")
data = characteristic.getStringValue(0)
self._app.handle_data(data)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment