Пример #1
0
        /// <summary>
        /// read input
        /// </summary>
        public bool ReadInput(out byte[] outBuffer)
        {
            outBuffer = new byte[9];
            const char numberOfBytes = (char)9;
            const char pipeNumber    = (char)2;

            if (HardwareFound)
            {
                SeriosMK1Wrapper.Read(outBuffer, numberOfBytes, pipeNumber, DEVICE_STRING);
            }
            return(HardwareFound);
        }
Пример #2
0
        /// <summary>
        /// Write output
        /// </summary>
        /// <param name="output">new output state</param>
        public void WriteOutput(byte output)
        {
            const char numberOfBytes = (char)6;
            const char pipeNumber    = (char)0;

            byte[] outBuffer = new byte[6] {
                0x07, output, 0x00, 0x00, 0x00, 0x00
            };

            if (HardwareFound)
            {
                SeriosMK1Wrapper.Write(outBuffer, numberOfBytes, pipeNumber, DEVICE_STRING);
            }
        }
Пример #3
0
        /// <summary>
        /// Looks up hardware
        /// </summary>
        protected bool CheckHardwareAvailable()
        {
            byte[] outBuffer = new byte[10];

            char numberOfBytes = (char)10;
            char pipeNumber    = (char)3;

            SeriosMK1Wrapper.Read(outBuffer, numberOfBytes, pipeNumber, DEVICE_STRING);

            foreach (byte b in outBuffer)
            {
                if (b == 0)
                {
                    return(false);
                }
            }

            return(true);
        }
Пример #4
0
 protected static int Read(byte[] abOutBuffer, char bNumberOfBytes, char bPipeNumber, string strDeviceString)
 {
     return(SeriosMK1Wrapper.ReadBulkData(abOutBuffer, bNumberOfBytes, bPipeNumber, strDeviceString));
 }
Пример #5
0
 protected static int Write(byte[] abInBuffer, char bNumberOfBytes, char bPipeNumber, string strDeviceString)
 {
     return(SeriosMK1Wrapper.WriteBulkData(abInBuffer, bNumberOfBytes, bPipeNumber, strDeviceString));
 }