コード例 #1
0
        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));;
        }
コード例 #2
0
        public Task <bool> Write(string address, ReadOnlyMemory <byte> data)
        {
            _tunneling.Write(address, data.ToArray());

            return(Task.FromResult(true));
        }