Ejemplo n.º 1
0
        /// <summary>
        /// Pings the device to make sure it's alive and responding
        /// </summary>
        private static void PingDevice()
        {
            if (args.verbose)
            {
                Console.WriteLine("Pinging device...");
            }

            zeitgeber.Ping();

            if (args.verbose)
            {
                Console.WriteLine("Ping Success");
            }
        }
Ejemplo n.º 2
0
        private void timerUpdate_Tick(object sender, EventArgs e)
        {
            // Automatic connection/disconnection
            if (zeitgeber.isConnected)
            {
                try
                {
                    zeitgeber.Ping();
                    UpdateDiagnostics();
                }
                catch (Exception ex)
                {
                    zeitgeber.isConnected = false;
                    lblConnected.Text     = "Not Connected";
                    listViewInfo.Enabled  = false;
                    groupBox1.Enabled     = false;
                }
            }
            else
            {
                try
                {
                    zeitgeber.Connect();

                    zeitgeber.Ping();

                    OnDeviceConnect();

                    lblConnected.Text    = "Connected";
                    listViewInfo.Enabled = true;
                    groupBox1.Enabled    = true;
                }
                catch (Exception ex)
                {
                    zeitgeber.isConnected = false;
                    // Couldn't connect
                }
            }
        }