コード例 #1
0
ファイル: XBeeConnector.cs プロジェクト: johnnybegood/Minnox
 public void Connect(string port)
 {
     _connection = new SerialConnection(port, 9600);
     _api = new XBeeApi(_connection);
     _api.Open();
 }
コード例 #2
0
ファイル: XBee.cs プロジェクト: VerdantAutomation/GBee
        /// <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();
        }