コード例 #1
0
        public YModem(TransmitMode transType, YModemType ymodemType, int reTryCount)
        {
            RetryMax = reTryCount;

            ymodemInfo.Type      = ymodemType;
            ymodemInfo.TransMode = transType;
        }
コード例 #2
0
ファイル: XModem.cs プロジェクト: yxddxs/SerialDebug
        public XModem(TransmitMode transType, XModemType xmodemType, int reTryCount)
        {
            RetryMax = reTryCount;

            xmodemInfo.CheckMode = XModemCheckMode.CheckSum;
            xmodemInfo.Type      = xmodemType;
            xmodemInfo.TransMode = transType;
        }
コード例 #3
0
 public YModemInfo(YModemType type, TransmitMode transType)
 {
     _YModemType = type;
     _TransType  = transType;
 }
コード例 #4
0
ファイル: VirtualComPort.cs プロジェクト: fhoner/Kasse
        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);
            }

        }
コード例 #5
0
ファイル: XModem.cs プロジェクト: yxddxs/SerialDebug
 public XModemInfo(XModemType type, TransmitMode transType, XModemCheckMode checkType)
 {
     _XModemType = type;
     _TransType  = transType;
     _CheckMode  = checkType;
 }