473,395 Members | 1,937 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Scanning USB devices and reading USB descriptors

Hi,

I'm wondering how I can scan the system for USB devices and read off
the USB descriptors such as VID/PID/serial number in C? I have an
external USB HDD that I wish to access, and I'm currently able to do
so with DeviceIoControl by addressing it as PhysicalDriveX, which will
return me information about the device, except it only does it for the
attached fixed disk, rather than the USB device.

Thanks!

May 10 '07 #1
5 10554
galapogos wrote:
Hi,
Hi,
>
I'm wondering how I can scan the system for USB devices and read off
the USB descriptors such as VID/PID/serial number in C? I have an
external USB HDD that I wish to access, and I'm currently able to do
so with DeviceIoControl by addressing it as PhysicalDriveX, which will
return me information about the device, except it only does it for the
attached fixed disk, rather than the USB device.
While this is not possible in plain standard C, there are certainly a
few libraries that you can use to access USB devices.
One of those is libusb [1], which is available on quite a few Unix-like
operating system.

[1] http://libusb.sourceforge.net/
>
Thanks!

--
Pietro Cerutti

PGP Public Key ID:
http://gahr.ch/pgp
May 10 '07 #2
On May 10, 5:55 pm, Pietro Cerutti <g...@gahr.chwrote:
galapogos wrote:
Hi,

Hi,
I'm wondering how I can scan the system for USB devices and read off
the USB descriptors such as VID/PID/serial number in C? I have an
external USB HDD that I wish to access, and I'm currently able to do
so with DeviceIoControl by addressing it as PhysicalDriveX, which will
return me information about the device, except it only does it for the
attached fixed disk, rather than the USB device.

While this is not possible in plain standard C, there are certainly a
few libraries that you can use to access USB devices.
One of those is libusb [1], which is available on quite a few Unix-like
operating system.

[1]http://libusb.sourceforge.net/
Thanks!

--
Pietro Cerutti

PGP Public Key ID:http://gahr.ch/pgp
Thanks. I actually have libusb-win32. I wasn't aware the source code
was included. I'll check it out.

I also checked out MSDN, specifically the "USB Structures and
Enumerations", and several of the functions all depend on usbdlib.h,
but despite copying the file over to my project from libusb I can't
seem to use the functions. How exactly do I use the libusb source
files?

May 10 '07 #3
galapogos wrote:
On May 10, 5:55 pm, Pietro Cerutti <g...@gahr.chwrote:
>galapogos wrote:
>>Hi,
Hi,
>>I'm wondering how I can scan the system for USB devices and read off
the USB descriptors such as VID/PID/serial number in C? I have an
external USB HDD that I wish to access, and I'm currently able to do
so with DeviceIoControl by addressing it as PhysicalDriveX, which will
return me information about the device, except it only does it for the
attached fixed disk, rather than the USB device.
While this is not possible in plain standard C, there are certainly a
few libraries that you can use to access USB devices.
One of those is libusb [1], which is available on quite a few Unix-like
operating system.

[1]http://libusb.sourceforge.net/
>>Thanks!
--
Pietro Cerutti

PGP Public Key ID:http://gahr.ch/pgp

Thanks. I actually have libusb-win32. I wasn't aware the source code
was included. I'll check it out.

I also checked out MSDN, specifically the "USB Structures and
Enumerations", and several of the functions all depend on usbdlib.h,
but despite copying the file over to my project from libusb I can't
seem to use the functions. How exactly do I use the libusb source
files?
No clue. You better ask to a more specific newsgroup, since your issue
isn't related to the C programming language, but rather to the way you
access some third-party library function.

Please check the libusb website, they surely have documentation on their
product.
--
Pietro Cerutti

PGP Public Key ID:
http://gahr.ch/pgp
May 10 '07 #4
galapogos wrote:
>
I'm wondering how I can scan the system for USB devices and read
off the USB descriptors such as VID/PID/serial number in C? I
have an external USB HDD that I wish to access, and I'm currently
able to do so with DeviceIoControl by addressing it as
PhysicalDriveX, which will return me information about the device,
except it only does it for the attached fixed disk, rather than
the USB device.
I see no reference to USB in the C standard. So this is off-topic
in c.l.c. Follow-ups set.

--
<http://www.cs.auckland.ac.nz/~pgut001/pubs/vista_cost.txt>
<http://www.securityfocus.com/columnists/423>
<http://www.aaxnet.com/editor/edit043.html>
<http://kadaitcha.cx/vista/dogsbreakfast/index.html>
cbfalconer at maineline dot net

--
Posted via a free Usenet account from http://www.teranews.com

May 11 '07 #5
In article <46**************@yahoo.com>,
CBFalconer <cb********@maineline.netwrote:
>galapogos wrote:
>>
I'm wondering how I can scan the system for USB devices and read
off the USB descriptors such as VID/PID/serial number in C? I
have an external USB HDD that I wish to access, and I'm currently
able to do so with DeviceIoControl by addressing it as
PhysicalDriveX, which will return me information about the device,
except it only does it for the attached fixed disk, rather than
the USB device.

I see no reference to USB in the C standard. So this is off-topic
in c.l.c. Follow-ups set.
IOW, ...

(You know the drill)

May 11 '07 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

21
by: CHANGE username to westes | last post by:
What are the most popular, and well supported, libraries of drivers for bar code scanners that include a Visual Basic and C/C++ API? My requirements are: - Must allow an application to be...
2
by: Denis S. Otkidach | last post by:
I've noticed that the order of attribute lookup is inconsistent when descriptor is used. property instance takes precedence of instance attributes: >>> class A(object): .... def...
2
by: François Pinard | last post by:
This question is a bit technical, but hopefully, this list will offer me good hints or nice solutions. Happily enough for me, it often does! :-) I would need to recognise and play with...
14
by: Antoon Pardon | last post by:
Can anyone explain why descriptors only work when they are an attribute to an object or class. I think a lot of interesting things one can do with descriptors would be just as interesting if the...
42
by: Jim Smith | last post by:
Note the cross-posting - but no flame wars please. This question was prompted by a thread on the a postgres mailing list during which someone (Gregory Williamson) claimed <quote> raw devices,...
3
by: Ron | last post by:
I need a way to read the hex values of an old DBase3 data file. Can anyone give me some info regarding how to grab hex values out of a file? Not sure exactly how to do this. Thanks for your...
1
by: Bruce D | last post by:
I'm researching a VB .NET project that will have two functions: 1 - scan images using TWAIN drivers of scanner 2 - read barcode of that scanned image I've been researching many companies and was...
10
by: Samuel Shulman | last post by:
I assume that when I use a barcode reader (at least some of them) it will input the number as though it was entered in via the keyboard How can I then get the value without setting to focus to a...
1
by: Fine | last post by:
When any person enters any shop and buy some items then goes to where he pays the prices of his items, the person there make scanning to each item to know what's the price? I am asking how this is...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.