Ejemplo n.º 1
0
 public void SubmitNotificationColor([FromBody] NotificationViewModel notification)
 {
     Console.WriteLine($"{notification.R} {notification.G} {notification.B}");
     SerialCommunication.Inicialize();
     SerialCommunication.Write($"#SETCR{notification.R}G{notification.G}B{notification.B}#\n");
     SerialCommunication.Close();
 }
Ejemplo n.º 2
0
 public void SubmitNotificationRele([FromBody] NotificationViewModel notification)
 {
     Console.WriteLine($"{notification.Id}");
     SerialCommunication.Inicialize();
     SerialCommunication.Write($"#RELEI{notification.Id}#\n");
     SerialCommunication.Close();
 }
Ejemplo n.º 3
0
        public string SubmitNotificationHumedad([FromBody] NotificationViewModel notification)
        {
            Console.WriteLine($"{notification.Id}");
            SerialCommunication.Inicialize();
            SerialCommunication.Write($"#HUMEI{notification.Id}#\n");
            var lectura = SerialCommunication.ReadLine();

            SerialCommunication.Close();

            var value = lectura.Substring(0, lectura.Length - 1);

            return(value);
        }
Ejemplo n.º 4
0
 public void Initialize()
 {
     SerialCommunication.Inicialize();
 }