Esempio n. 1
0
        protected override async Task DoExecuteAsync()
        {
            var result = await Characteristic.WriteValueAsync(Bytes.AsBuffer(), WithoutResponse?GattWriteOption.WriteWithoutResponse : GattWriteOption.WriteWithResponse)
                         .AsTask().ConfigureAwait(false);

            if (result == GattCommunicationStatus.Unreachable)
            {
                Status = CommandStatus.Unreachable;
            }
        }
Esempio n. 2
0
        protected override async Task DoExecuteAsync()
        {
            var result = await WindowsRuntimeSystemExtensions.AsTask(Characteristic.WriteValueAsync(Bytes.AsBuffer(), WithoutResponse ? GattWriteOption.WriteWithoutResponse : GattWriteOption.WriteWithResponse)).ConfigureAwait(false);

            if (result == GattCommunicationStatus.Unreachable)
            {
                throw new DeviceUnreachableException();
            }
        }