コード例 #1
0
 protected override void Dispose(bool disposing)
 {
     lock (_lockObj)
     {
         _tlAutoDeviceSerialPort.DataReceived -= TLAutoDeviceSerialPortDataReceived;
         _tlAutoDeviceSerialPort = null;
         _deviceCommand          = null;
     }
 }
コード例 #2
0
 public TLAutoDeviceSerialPortAsync
 (
     TLAutoDeviceSerialPort tlAutoDeviceSerialPort,
     DeviceCommand <T> deviceCommand,
     CancellationToken?cancelToken,
     string logModuleName = null,
     int timeOutMs        = 4000)
     : base(cancelToken, timeOutMs)
 {
     _tlAutoDeviceSerialPort = tlAutoDeviceSerialPort;
     _tlAutoDeviceSerialPort.DataReceived += TLAutoDeviceSerialPortDataReceived;
     _deviceCommand = deviceCommand;
     _log           = new LogWraper(logModuleName.IsNullOrEmpty() ? "TLAutoDeviceSerialPortAsync" : logModuleName);
 }