Пример #1
0
 def _handle_task(self, notification: _Notification):
     if not notification.char.client_subscribed:
         notification.notify_complete(
             NotificationCompleteEventArgs.Reason.CLIENT_UNSUBSCRIBED)
         return True
     hvx_params = nrf_types.BLEGattsHvx(notification.handle, self.hvx_type,
                                        notification.data)
     self.ble_device.ble_driver.ble_gatts_hvx(self.peer.conn_handle,
                                              hvx_params)
Пример #2
0
 def _handle_task(self, notification):
     """
     :type notification: _Notification
     """
     if not notification.char.client_subscribed:
         return True
     hvx_params = nrf_types.BLEGattsHvx(notification.handle, notification.type, notification.data)
     self._cur_notification = notification
     self.ble_device.ble_driver.ble_gatts_hvx(self.peer.conn_handle, hvx_params)