Beispiel #1
0
 public void ReadBytes(byte[] Bytes, int Start, int Count)
 {
     if (ReadSwitch == ReadWay.RS232)
     {
         RS232Obj.ReadBytes(Bytes, Start, Count);
     }
     else if (ReadSwitch == ReadWay.File)
     {
         FileObj.ReadBytes(Bytes, Start, Count);
     }
     if (ReadSwitch != ReadWay.None && IsLog == true && FileObj != null && FileObj.IsOpen == true)
     {
         FileObj.WriteBytes(Bytes, Start, Count);
     }
 }
Beispiel #2
0
        public byte ReadByte()
        {
            byte b = 0;

            if (ReadSwitch == ReadWay.RS232)
            {
                b = RS232Obj.ReadByte();
            }
            else if (ReadSwitch == ReadWay.File)
            {
                b = FileObj.ReadByte();
            }
            byte[] bs = { b };
            if (ReadSwitch != ReadWay.None && IsLog == true && FileObj != null && FileObj.IsOpen == true)
            {
                FileObj.WriteBytes(bs, 0, 1);
            }
            return(b);
        }