static void RunModule2() { using (XBee xbee = new XBee("COM4", 9600, ApiType.Enabled)) { xbee.FrameReceived += new FrameReceivedEventHandler(xbee_FrameReceived); xbee.Open(); Thread.Sleep(30 * 1000); xbee.StopReceiveData(); Console.WriteLine("stopped slave"); } }
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"); } }