예제 #1
0
        //private static Devices.LCD_HD44780 = new Devices.LCD_HD44780(
        //);
        public static void Main()
        {
            Server server = new Server(12001);
            Client client = new Client("192.168.1.147", 12000);

            server.serverDel = new Server.externThread(updatePinOutputs);

            server.Start();

            while (true)
            {
                Debug.Print(DateTime.Now.ToLocalTime().ToString() + "   Netduino running... " + server.IPaddress);
                if (client.Send(DateTime.Now.ToLocalTime().ToString() + "- Netduino running(" + server.IPaddress + ")"))
                    Debug.Print("Message Sent and Acknowledged!");
                Thread.Sleep(2500);
            }
        }
예제 #2
0
        //private static Devices.LCD_HD44780 = new Devices.LCD_HD44780(
        //);
        public static void Main()
        {
            devService.deviceList[0] = led;

            Server server = new Server(servListenPort);
            Client client = new Client("192.168.1.147", 12000);

            //server.serverDel = new Server.externThread(updatePinOutputs);
            //server.serverDel = new Server.externThread(devService.cmd);         // set commands recieved by the server to be handled by devService
            server.serverDel = new Server.externThread(DevService.serviceCmd);

            devService.Start();                                   // start the thread that handles commands.
            Debug.Print("Started serviceDevicesThread");

            server.Start();                                                     // start the thread that recieves commands
            Debug.Print("Server started. Listening on Port: " + servListenPort.ToString());

            //char aChar = 'A';
            //byte test = (byte)aChar;
            //byte addr1 = 1;
            //byte addr2 = 4;
            //byte addr3 = 8;
            //byte addr4 = 16;

            //bool debug0 = ((test & addr1) > 0);
            //bool debug1 = ((test & addr2) > 0);

            while (true)
            {
                Debug.Print(DateTime.Now.ToLocalTime().ToString() + "   Netduino running... " + server.IPaddress);
                if (client.Send(DateTime.Now.ToLocalTime().ToString() + "- Netduino running(" + server.IPaddress + ")"))
                {
                    Debug.Print("Message Sent and Acknowledged!");
                    //led.Amber();
                    Thread.Sleep(2500);
                }
                //led.Green();
                //Thread.Sleep(2500);
            }
        }