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("枚举类型不匹配"); } }
public abstract void setConfig(Common.CommunicationType tYPE, MmConfiguration mmConfiguration);