예제 #1
0
파일: IOMode.cs 프로젝트: Edll/iow
        /// <summary>
        /// Set the ReadtimeOut to the Device
        /// </summary>
        /// <param name="readTimeout">timeout in ms</param>
        /// <returns>true on success</returns>
        public bool ReadTimeout(int readTimeout)
        {
            var result = IowKit.Timeout(_device.Handler, readTimeout);

            if (result)
            {
                return(true);
            }
            _device.AddDeviceError("Timeout konnte nicht gesetzt werden");
            return(false);
        }
예제 #2
0
파일: I2CMode.cs 프로젝트: Edll/iow
        /// <summary>
        /// Starten des Modus und setzt den IOW in den I2C Special Mode
        /// </summary>
        /// <returns></returns>
        public bool PortsInitialisation()
        {
            byte[] report = new byte[IowkitSpecialReportSize];

            // I2C Mode
            report[0] = 0X01;

            // enable
            report[1] = 0X01;

            // flags
            report[2] = 0X00;

            // timeout
            report[3] = 0X00;

            IowKit.Timeout(_device.Handler, 1000);
            return(IowKit.Write(_device.Handler, IowPipeSpecialMode, report, IowkitSpecialReportSize) ==
                   IowkitSpecialReportSize);
        }