Esempio n. 1
0
 def _did_update_value(self, error: Foundation.NSError):
     future = self._read_value_future
     if future is not None:
         if error is not None:
             future.set_exception(util.NSErrorException(error))
         else:
             future.set_result(self._cbcharacteristic.value())
Esempio n. 2
0
 async def _did_discover_services(self, services, error):
     if error is not None:
         self._discover_services_future.set_exception(
             util.NSErrorException(error)
         )
     else:
         self._discover_services_future.set_result(services)
Esempio n. 3
0
 def _did_discover_characteristics(
     self,
     characteristics: List[CoreBluetooth.CBCharacteristic],
     error: Foundation.NSError,
 ):
     if error is not None:
         self._discover_characteristics_future.set_exception(
             util.NSErrorException(error))
     else:
         self._discover_characteristics_future.set_result(characteristics)