private void GetConfigValue_Click(object sender, EventArgs e) { byte bCfgVal = 0; if (usb.GetConfiguration(ref bCfgVal) >= 0) { Debug.Print("Config Value:" + bCfgVal); } }
private void getConfigurationToolStripMenuItem_Click(object sender, EventArgs e) { byte bCfgValue; if (mUsbDevice.GetConfiguration(out bCfgValue)) { tsStatus.Text = "Configuration Value:" + bCfgValue; } else { tsStatus.Text = "Failed getting configuration value!"; } }
private void getConfigurationToolStripMenuItem_Click(object sender, EventArgs e) { byte bCgfValue = 0; int ret = mDev.GetConfiguration(ref bCgfValue); if (ret >= 0) { tsStatus.Text = "Configuration Value:" + bCgfValue; } else { tsStatus.Text = "Failed getting configuration value!"; } }
private void GetConfigValue_Click(object sender, EventArgs e) { byte bConfig; if (mUsbDevice.GetConfiguration(out bConfig)) { ReadOnlyCollection <UsbConfigInfo> configProfiles = mUsbDevice.Configs; if (bConfig == 0 || bConfig > configProfiles.Count) { tInfo.AppendText("[ERROR] Invalid configuration data received."); return; } UsbConfigInfo currentConfig = configProfiles[bConfig - 1]; SetStatus(string.Format("Config Value:{0} Size:{1}", bConfig, currentConfig.Descriptor.TotalLength), false); tInfo.AppendText(currentConfig.ToString()); } else { SetStatus("GetConfiguration Failed.", true); } }