Пример #1
0
    def __init__(self, service : CoreBluetoothService, cbcharacteristic : CoreBluetooth.CBCharacteristic, queue, *args, **kwargs):
        super(CoreBluetoothCharacteristic, self).__init__(service, *args, **kwargs)
        self._cbcharacteristic = cbcharacteristic
        self._cbperipheral = cbcharacteristic.service().peripheral()
        self._queue = queue

        self._identifier = cbcharacteristic.UUID().UUIDString()

        self.read_value_future = None
Пример #2
0
    async def _did_update_value_for_characteristic(
            self, cbcharacteristic: CoreBluetooth.CBCharacteristic,
            error: Foundation.NSError):
        cbservice = cbcharacteristic.service()
        service = self._services_by_identifier.get(
            cbservice.UUID().UUIDString())
        if service is None:
            return

        char = await service.characteristic_with_identifier(
            cbcharacteristic.UUID().UUIDString())
        if char is None:
            return

        char._did_update_value(error)