Exemplo n.º 1
0
        /// <summary>
        /// Gets the USB devices active configuration value.
        /// </summary>
        /// <param name="config">The active configuration value. A zero value means the device is not configured and a non-zero value indicates the device is configured.</param>
        /// <returns>True on success.</returns>
        public override bool GetConfiguration(out byte config)
        {
            config = 0;
            int iconfig = 0;
            int ret     = MonoUsbApi.GetConfiguration((MonoUsbDeviceHandle)mUsbHandle, ref iconfig);

            if (ret != 0)
            {
                UsbError.Error(ErrorCode.MonoApiError, ret, "GetConfiguration Failed", this);
                return(false);
            }
            config = (byte)iconfig;
            mCurrentConfigValue = config;

            return(true);
        }