public YModem(TransmitMode transType, YModemType ymodemType, int reTryCount) { RetryMax = reTryCount; ymodemInfo.Type = ymodemType; ymodemInfo.TransMode = transType; }
public XModem(TransmitMode transType, XModemType xmodemType, int reTryCount) { RetryMax = reTryCount; xmodemInfo.CheckMode = XModemCheckMode.CheckSum; xmodemInfo.Type = xmodemType; xmodemInfo.TransMode = transType; }
public YModemInfo(YModemType type, TransmitMode transType) { _YModemType = type; _TransType = transType; }
private void PollingModeReading(TransmitMode enq) { try { switch (enq) { case TransmitMode.Polling_ENQ1: gComPort.Write("1"); break; case TransmitMode.Polling_ENQ9: gComPort.Write("9"); break; default: // Should never occur. return; } System.Threading.Thread.Sleep(200); string result = ""; int count = gComPort.BytesToRead; if ((count > 0)) { byte[] buffer = new byte[count]; string tmp; gComPort.Read(buffer, 0, count); for (int n = 0; n <= count - 1; n++) { tmp = buffer[n].ToString("X"); if (tmp.Length == 1) { result += "0" + tmp + " "; } else { result += tmp + " "; } } } if (PortReadEvent != null) { PortReadEvent(enq, result); } } catch (Exception ex) { LogWriter.Write(ex, LOG_FILENAME); throw new Exception("VirtualComPort Polling Mode Exception: " + ex.Message); } }
public XModemInfo(XModemType type, TransmitMode transType, XModemCheckMode checkType) { _XModemType = type; _TransType = transType; _CheckMode = checkType; }