Ejemplo n.º 1
0
        public void Connect(string ComPort)
        {
            GC.Collect(); // avoid open connections
            if (IsConnected)
            {
                throw new Exception($"Already connected to device {SerialD.PortName}");
            }
            SerialD = ComPort == null?SerialDevice.getAvailable() : new SerialDevice(ComPort);

            PinCount = SerialD.RunCommand(SysExMsg.MSG_GET_PINCOUNT, CommandType.Get).Values[0];

            LoadSettings();
        }
Ejemplo n.º 2
0
 public List <byte> GetAllPinValues()
 {
     lock (_serialLock)
         return(SerialD.RunCommand(SysExMsg.GetPinValue, CommandType.Get, byte.MaxValue).Values.Skip(1)
                .ToList());
 }
Ejemplo n.º 3
0
 public byte GetPinValue(Pins pin)
 {
     lock (_serialLock)
         return(SerialD.RunCommand(SysExMsg.GetPinValue, CommandType.Get, (byte)pin).Values[1]);
 }