Beispiel #1
0
 static void Main(string[] args)
 {
     //INICIALIZE DLL FILE
     //RECIEVE INFORMATION FROM DLL FILE
     AirSensorNodeDll.AirSensorNodeDll dll = new AirSensorNodeDll.AirSensorNodeDll();
     dll.Initialize(serviceHandler, 1000);
 }
        public Boolean Stop()
        {
            if (dll != null)
            {
                dll.Stop();
                dll = null;
                return(true);
            }

            return(false);
        }
Beispiel #3
0
 static void Main(string[] args)
 {
     mClient = new MqttClient("127.0.0.1");
     mClient.Connect(Guid.NewGuid().ToString());
     if (!mClient.IsConnected)
     {
         Console.WriteLine("Error connecting to message broker...");
         return;
     }
     else
     {
         AirSensorNodeDll.AirSensorNodeDll dll = new AirSensorNodeDll.AirSensorNodeDll();
         dll.Initialize(GenerataSensorData, 2500);
     }
 }
        public Boolean Init(int delay, IPAddress ip)
        {
            mClient = new MqttClient(ip.ToString());

            mClient.Connect(Guid.NewGuid().ToString());

            if (!mClient.IsConnected)
            {
                Debug.WriteLine("Error connecting to message broker...");
                return(false);
            }

            if (dll == null)
            {
                dll = new AirSensorNodeDll.AirSensorNodeDll();
                dll.Initialize(TransformData, delay);
                return(true);
            }

            return(false);
        }