How can I get USB device manufacturer name through Win32 API.
I am looking for an example in Win32 API, not in .Net.
USB Device manufacturer name is embedded in USB descriptor.
Thanks
hi I think WMI can give the all information which u need from the windows
just fire query against the API
it return all info available in the machine to you
http://msdn.microsoft.com/en-us/library/ms186146%28VS.80%29.aspx
You can obtain manufacturer name of the device by using "SetupDiGetDeviceRegistryProperty" winapi.
Please refer the MSDN link for more details.
Example code :
if ( SetupDiGetDeviceRegistryProperty(hDevInfo, &spDevInfoData,SPDRP_MFG, &DataT, (PBYTE)bufManufact, sizeof(bufManufact), &nSize) )
{
}
else
{
_tcscpy_s(bufManufact,sizeof(bufManufact)/sizeof(TCHAR),_T("Unknown"));
}
Run the USBView sample which comes with the WDK to get the manufacturer name and other information about the USB devices.
Related
I use latest LibUsbDotNet nuget package in Visual Studio 2017 on Win 10. For my full speed USB device with 2 interrupt endpoints and 1 bulk IN endpoint I installed WinUSB driver using zadiq 2.4 utility.
LibUsbDotNet can see my device when UsbDevice.AllDevices is called.
However, it can't open my device using:
UsbDeviceFinder MyUsbFinder = new UsbDeviceFinder(VID, PID);
UsbDevice MyUsbDevice = UsbDevice.OpenUsbDevice(MyUsbFinder);
MyUsbDevice is null, no exception thrown.
I also tried to install different drivers (libusbk and libusb-win32), with no success.
Some time ago I coded an C++ app to communicate with my USB device using libusb library - and it works since then without any issue.
Is there anyone who can confirm that libusbdotnet is working product? I welcome any advice how to find what is wrong. Thanks.
This is a bug in UsbDeviceFinder, where int.MaxValue is used instead of null to ignore a value. This makes UsbDeviceFinder unusable and all examples that use it don't work.
The workaround is to use
MyUsbDevice = context.Find(device => device.ProductId == ProductId && device.VendorId == VendorId);
instead of
MyUsbDevice = context.Find(MyUsbFinder);
First find your vendor id & product id by using device manager, input device , details then Hardware ID.
Next, You need to download LibUsbDotNet_Setup.2.2.8.exe and run setup. During setup you should enable filter and choose your input device per your vendor id. Then your code will find the device afterwards
I can't find information about this nor "Windows IOT" category.
Is there any way to install new languages to the speech system in Windows IOT for Raspberry Pi ?
I'm writing an app that should speek french but there is no built-in french speech language
This should help give you multiple languages on Windows 10 IoT Core:
In summary,
Install languages on your Win 7/8/10 machine.
Copy from: C:\Windows\Speech_OneCore\Engines\SR\(lang)
To Windows IoT: \\minwinpc\C$\Windows\Speech_OneCore\Engines\SR\(lang)
Then you can use:
var speechRecognizer = new SpeechRecognizer(new Language("(lang)"))
Details here:
(original link (died)): http://paulfasola.fr/en/add-voices-windows-10-iot-core-tts/
(wayback machine link): https://web.archive.org/web/20160908171653/https://paulfasola.fr/en/add-voices-windows-10-iot-core-tts/
FYI, there is an excellent SpeechTranslator project in the ms-iot samples github repo which shows how to use the SpeechRecongnizer and SpeechSynthesizer in great detail. After you follow the steps in Jim's answer, you should be able to set the voice on your Speech Synthesizer using:
public static string voiceMatchLanguageCode = "fr";
// select the language
var voices = SpeechSynthesizer.AllVoices;
foreach (VoiceInformation voice in voices)
{
if (voice.Language.Contains(voiceMatchLanguageCode))
{
synthesizer.Voice = voice;
break;
}
}
I am developing a Windows 8 Store app in xaml and it uses user's GPS location.IS there any way I can know programmatically if the device user is using has GPS capability ?
Unlike Windows phone it only works when there is internet connection ?
You need to check the status of the location sensor
var location = new Geolocator();
if(location.LocationStatus == PositionStatus.NotAvailable)
{
//Do Something
}
else
{
//Do Something else
}
Following article covers Geolocation topic really nicely
http://www.jeffblankenburg.com/2012/11/14/31-days-of-windows-8-day-14-geolocation/
You should be able to check the sensor state.
NotSupported The sensor hardware is unavailable.
Ready The sensor is available and resolving data.
Initializing The sensor is available and initializing.
NoData The sensor is unable to obtain data.
NoPermissions The caller does not have permission to access the
sensor’s data.
Disabled The sensor is disabled.
I try to implement an application in snow Leopard, Reading Data from USB/HID device.In my application i tried following steps:
IOHIDManagerCreate()
CreateDeviceMatchingDictionary()
IOHIDManagerSetDeviceMatching()
IOHIDManagerOpen()
IOHIDManagerCopyDevices()
Create a Reference for device(IOHIDDeviceRef)
Based On the IOHIDDeviceRef i Fetch device details such as(Device ProductIDKey, Device VendorIDKey,Device ProductKey,Device Serial NumberKey,Device VersionNumberKey ect.)
IOHIDDeviceOpen(),ie :Using IOHIDDeviceRef i opened Device;
IOHIDDeviceCopyMatchingElements(); Ie Copy Matching Elements from the Device;
Create a Reference element(ie IOHIDElementRef);
Using IOHIDElementRef i retrieved Device Usage,Device Cocookie,Device UsagePage etc.
Up to this My application working Fine.
My doubts are
How can read data From Endpoint 1, My device is special purpose device having only one End point(Interrupt no synchronization data end point)?
Is their any Pipe associated with end point 1(HID Device)?;
Is their any ReadPipe and WritePipe functions in HIDManager Based Application?
Is it possible to retrieve data from USB/HID using IOHIDDeviceSetReoprtWithCallback()?
Every thing Did based on this Link:
http://developer.apple.com/library/mac/#documentation/DeviceDrivers/Conceptual/HID/new_api_10_5/tn2187.html#//apple_ref/doc/uid/TP40000970-CH214-SW7 ...
Thank you so much for your help ..
You are trying to use HID functions with non-HID device.
HID is Human Interface Device. Any HID device must conform "Device Class Definition for HID".
I suspect, your device does not conforms this specification.
So you should use other OS interface to work with your device. I suggest to use libusb. This is cross-platform library for working with USB devices on low level. It will allow you to read/write your endpoint directly.
I need to configure USB OTG on iMX31 for device mode. We need a raw channel between the host and target and usb seems to be the best suited. However I haven't been able to correctly configure the OTG controller. I dont know what I am missing. I have performed the steps mentioned in section 32.14.1 of iMX31 Reference Manual. I have also configured PORTSC1 register for ULPI.
Can any one help me out here? any poineters/code/any thing that can help me is welcome.
Thanks
The litekit is supported by the vanilla Linux kernel.
It's pretty easy to declare the OTG for device mode. You just need to declare it as device when you register your device:
static struct fsl_usb2_platform_data usb_pdata = {
.operating_mode = FSL_USB2_DR_DEVICE,
.phy_mode = FSL_USB2_PHY_ULPI,
};
Register code:
mxc_register_device(&mxc_otg_udc_device, &usb_pdata);
Don't forget to configure the pads for the physical ULPI lines, and eventually make the initial transactions for your transceiver.
You can find all the necessary code as I did it for the moboard platform and the marxbot board file.