Пример #1
0
 public Device(DeviceType type, string id, USB2LCD.VersionInfo version)
 {
     this.type = type;
     this.id = id;
     this.serialnum = version.serialnumber;
     this.module = version.module;
     this.version = version.version;
 }
Пример #2
0
 // Send an entire character using cmd (DefineCustom or RememberCustom) and a character #0-7
 public void SendCharacter(USB2LCD.Command cmd, byte c, byte[] bytes)
 {
     if ((cmd != USB2LCD.Command.DefineCustom && cmd != USB2LCD.Command.RememberCustom) || c >= 8 || bytes.Length != 8)
         throw new ArgumentException();
     this.SendCmd(cmd, c);
     this.Stream.Write(bytes, 0, 8);
     this.Stream.Flush();
 }
Пример #3
0
 public ushort ReadShort(USB2LCD.Command cmd)
 {
     this.Port.DiscardInBuffer(); this.SendCmd(cmd); return (ushort)(CheckByte(this.Port.ReadByte()) | CheckByte(this.Port.ReadByte()) << 8);
 }
Пример #4
0
 public byte[] ReadBytes(USB2LCD.Command cmd, byte subCmd, int n)
 {
     this.Port.DiscardInBuffer(); this.SendCmd(cmd, subCmd); return ReadBytes(n);
 }
Пример #5
0
 public byte ReadByte(USB2LCD.Command cmd, byte subCmd)
 {
     this.Port.DiscardInBuffer(); this.SendCmd(cmd, subCmd); return CheckByte(this.Port.ReadByte());
 }
Пример #6
0
 public void SendCmd(USB2LCD.Command cmd, byte param1, byte param2)
 {
     this.Stream.WriteByte(254); this.Stream.WriteByte((byte)cmd); this.Stream.WriteByte(param1); this.Stream.WriteByte(param2); this.Stream.Flush();
 }
Пример #7
0
 public void SendCmd(USB2LCD.Command cmd, ushort subCmd)
 {
     this.SendCmd(USB2LCD.Command.SetSerialNum, (byte)(subCmd & 0xFF), (byte)((subCmd >> 8) & 0xFF));
 }
Пример #8
0
 public void SendCmd(USB2LCD.Command cmd, byte subCmd)
 {
     this.Stream.WriteByte(254); this.Stream.WriteByte((byte)cmd); this.Stream.WriteByte(subCmd); this.Stream.Flush();
 }