Beispiel #1
0
 public IActionResult OnPost()
 {
     client = new MqttLib();
     client.StartConnection();
     client.Subscribe(topic);
     client.Publish(topic, Input.Color, 1, true);
     //client.CloseConnection();
     return(RedirectToPage("/Sent"));
 }
Beispiel #2
0
        static void Main(string[] args)
        {
            string  topic  = "lamp123456789";
            MqttLib client = new MqttLib();

            client.StartConnection();
            Console.WriteLine("subscribing to: " + topic);
            client.Subscribe(topic);

            Console.ReadKey();
        }