コード例 #1
0
 public csjSerialPort(csjSerialPortDataReceivedBuf _DataReceived, string _com = "com5", int _maxLen = 500000, int _rate = 9600, Parity _parity = Parity.None, int _bit = 8, StopBits _sb = StopBits.One)
     : base(_com, _rate, _parity, _bit, _sb)
 {
     if (_DataReceived != null)
     {
         DataReceivedBuf += _DataReceived;
     }
     ReadTimeout  = 500;
     WriteTimeout = -1;
     thread       = null;
     _keepReading = false;
     readBuffer   = new byte[_maxLen];
     //不知道起点在哪里
     dataStart = -1;
     //数据结尾
     dataEnd   = 0;
     bufferLen = _maxLen;
 }
コード例 #2
0
 public csjSerialPort(csjSerialPortDataReceivedBuf _DataReceived, string _com = "com5", int _maxLen = 500000, int _rate = 9600, Parity _parity = Parity.None, int _bit = 8, StopBits _sb = StopBits.One)
     : base(_com, _rate, _parity, _bit, _sb)
 {
     if (_DataReceived != null)
     {
         DataReceivedBuf += _DataReceived;
     }
     ReadTimeout = 500;
     WriteTimeout = -1;
     thread = null;
     _keepReading = false;
     readBuffer = new byte[_maxLen];
     //不知道起点在哪里
     dataStart = -1;
     //数据结尾
     dataEnd = 0;
     bufferLen = _maxLen;
 }