private static Task CreateNewTask(CancellationTokenSource cts, KnxConnection connection) { return(new Task(async() => { try { while (true) { connection.Write("7/2/0", DptTranslator.Instance.ToDataPoint("16.001", "7141.61$")); await Task.Delay(1000); } } catch (OperationCanceledException) { return; } }, cts.Token));; }
public Task <bool> Write(string address, ReadOnlyMemory <byte> data) { _tunneling.Write(address, data.ToArray()); return(Task.FromResult(true)); }