Exemplo n.º 1
0
        /// <summary>
        /// Writes the ports values
        /// returns zero on sucess, else non-zero erro
        /// </summary>
        public UInt32 SendCommand(HidTxPacketStruct txCmd)
        {

            try
            {
                int length = txCmd.MajorCmd == 102 ? 16 : 8;
                return Hid.HidD_SetFeature(deviceHandle, StructureToByteArray(txCmd), length) ? 0 : 1u;
            }

            catch (Exception)
            {
                //throw;
                return (2);
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Writes the ports values
        /// returns zero on sucess, else non-zero erro
        /// </summary>
        public UInt32 SendCommand( HidTxPacketStruct TxCmd)
        {
            try
            {
                int Length;
                if (TxCmd.MajorCmd == 102) Length = 16;
                else Length = 8;
                if (Hid.HidD_SetFeature(myDeviceHandle, StructureToByteArray(TxCmd), Length) == false) return (1);
                else return (0);
            }

            catch (Exception ex)
            {
                DisplayException(MODULE_NAME, ex);
                //throw;
                return (2);
            }
        }