public void Write(string line1, string line2 = "")
        {
            if (line1 == _previousLine1 && line2 == _previousLine2)
            {
                return;
            }

            _cd.Clear();
            _cd.SetCursorPosition(0, 0);
            _cd.Print(line1);
            _cd.SetCursorPosition(1, 0);
            _cd.Print(line2);

            _previousLine1 = line1;
            _previousLine2 = line2;
        }
Exemple #2
0
        private INetwork SetupEthernet()
        {
            try
            {
                _characterDisplay.Clear();
                _characterDisplay.SetCursorPosition(0, 0);
                _characterDisplay.Print("Getting IP address...");

                //NetworkChange.NetworkAddressChanged += OnNetworkAddressChanged;
                //NetworkChange.NetworkAvailabilityChanged += OnNetworkAvailabilityChanged;

                // Try mIP? http://mip.codeplex.com/
                _ethernet.Open();
                _ethernet.EnableDhcp();
                _ethernet.EnableDynamicDns();
                while (_ethernet.IPAddress == "0.0.0.0")
                {
                    Debug.Print("Waiting for DHCP");
                    Thread.Sleep(250);
                }
                return(new NetworkWrapper(_ethernet));
            }
            catch (Exception ex)
            {
                Debug.Print("Could not set up Ethernet - " + ex);
                throw;
            }
        }