public void Connect(string port) { _connection = new SerialConnection(port, 9600); _api = new XBeeApi(_connection); _api.Open(); }
/// <summary> /// Configures this serial line. /// </summary> /// <remarks> /// This should be called at most once. /// </remarks> /// <param name="baudRate">The baud rate.</param> public void Configure(int baudRate = 9600) { if (_api != null) throw new Exception("XBee.Configure can only be called once"); Logger.Initialize(ErrorPrint, LogLevel.Error, LogLevel.Fatal); Logger.Initialize(DebugPrint, LogLevel.Warn, LogLevel.Info, LogLevel.Debug, LogLevel.LowDebug); _connection = new SerialConnection(_serialPortName, baudRate); _api = new XBeeApi(_connection); Enable(); _api.Open(); }