Ejemplo n.º 1
0
        public bool ReadInput()
        {
            if (_Inputs.RptByteLen == 0)
            {
                return(false);
            }
            if (!RwAccessible)
            {
                return(false);
            }

            if (CyConst.Hibernate_first_call == true)
            {
                CyConst.Hibernate_first_call = false;
                return(false);
            }

            _Inputs.Clear();

            // ReadFile will hang if the device does not have an input report ready.
            int bytesRead = 0;

            fixed(byte *buf = _Inputs.DataBuf)
            {
                return(PInvoke.ReadFile(_hDevice, _Inputs.DataBuf, _Inputs.RptByteLen, ref bytesRead, IntPtr.Zero));
            }

            //return PInvoke.ReadFile(_hDevice, ref _Inputs.DataBuf[0], _Inputs.RptByteLen, ref bytesRead, IntPtr.Zero);
        }