Ejemplo n.º 1
0
 public override void setConfig(Common.CommunicationType tYPE, MmConfiguration mmConfiguration)
 {
     if (tYPE == Common.CommunicationType.SerialPort)
     {
         if (mmConfiguration.isAllCustom)
         {
             mmPort.PortName = mmConfiguration.portName;
             mmPort.BaudRate = mmConfiguration.baudRate;
             mmPort.Parity   = mmConfiguration.parity;
             mmPort.DataBits = mmConfiguration.dataBits;
             mmPort.StopBits = mmConfiguration.stopBits;
             mmPort.ReceivedBytesThreshold = mmConfiguration.ReceivedBytesThreshold;
         }
         else
         {
             mmPort.PortName = mmConfiguration.portName;
             mmPort.BaudRate = mmConfiguration.baudRate;
         }
         mmPort.DataReceived += spDataReceived;
     }
     else
     {
         throw new MmException("枚举类型不匹配");
     }
 }
Ejemplo n.º 2
0
 public abstract void setConfig(Common.CommunicationType tYPE, MmConfiguration mmConfiguration);