Beispiel #1
0
 public static async Task <int> SetLightsAsync()
 {
     #region setlights
     using var TableCommunication = new Table.ImageProcessingCommunication(6002, "127.0.0.1").DoRun();
     if (!await TableCommunication.WaitConnectedAsync(TimeSpan.FromSeconds(2)))
     {
         Console.WriteLine("Not connected");
         return(0);
     }
     Console.WriteLine("Connected");
     if (await TableCommunication.SendAndWaitAsync <Table.Messages.SetLightsResponse>
             (new Table.Messages.SetLightsRequest
     {
         Top = true,
         Bottom = true,
         SideLeft = false,
         SideMiddle = false,
         SideRight = false
     }, TimeSpan.FromSeconds(1)) is var result && result.IsMessageOk())
     {
         Console.WriteLine("Message Ok");
     }