Ejemplo n.º 1
0
 public void DiscoverNodes()
 {
     //MainForm.ConsoleWriteLine("XBee: Discovering nodes...");
     AtCommand at = new NodeDiscoverCommand();
     m_Nodes.Clear();
     try
     {
         m_XBee.Execute(at);
     }
     catch (TimeoutException x)
     {
         MainForm.ConsoleErrorWriteLine("XB: Timeout error: " + x.Message);
     }
 }
Ejemplo n.º 2
0
        static void RunModule1()
        {
            using (XBee xbee = new XBee("COM3", 9600, ApiType.Enabled))
            {
                xbee.FrameReceived += new FrameReceivedEventHandler(xbee_FrameReceived);
                xbee.Open();

                // discovering the network
                AtCommand at = new NodeDiscoverCommand();

                xbee.Execute(at);
                Thread.Sleep(10 * 1000);

                xbee.Execute(at);
                Thread.Sleep(10 * 1000);


                xbee.StopReceiveData();
                Console.WriteLine("stopped master");
            }
        }