6

I've read this: https://stackoverflow.com/questions/1176053/, which was an insightful article.

However, I have no great background in WMI, and I found the large amount of documentation to be overwhelming. I can't find what I'm looking for.

The situation is that I have a device that will send data over the USB port, to the soundcard of the PC in question.

Consider camera-software. You connect your camera, start the program, and you can control the program with the camera, and vica versa. For instance, you can press a button on the camera and it'll start transmitting to the program. Or you can click a button in the program and it will start querying for data.

I need to find a way to query and catch this data, safely and correct. It's probably a Stream of bytes, but searching for that doesn't produce any results.

I'm thinking I first need to somehow connect. Then send the query. Then receive.

However, connecting and querying both is something that I can't find in the example code, or the System.Management documentation on MSDN.

asked Apr 22, 2010 at 21:54

2 Answers 2

2

I don't think that WMI code would be relevant for you, I think that's just able to get out basic information about the device. If you want to actually read and send data to it you'll have to use different APIs.
When I've done any USB develoment it's been mostly using HID which is fairly straightforward, but I don't think you can transfer audio streams using HID, you'll need to use the Audio class driver. Though you might need to use HID to find out information about the soundcard.

Some useful links to get you started are:

Jan Axelson's website (author of USB Complete) - http://janaxelson.com/usbc.htm

A USB HID Component for C# - http://www.codeproject.com/KB/cs/USB_HID.aspx?msg=2004501

A USB library for .Net - http://www.icsharpcode.net/OpenSource/SharpUSBLib/

A Java sample for a webcam app - http://www.mutong.com/fischer/java/usbcam/

answered Apr 23, 2010 at 7:46
Sign up to request clarification or add additional context in comments.

Comments

0

Here is another great one for reading and writing to USB devices:

http://winusbnet.codeplex.com/

answered Oct 24, 2013 at 16:05

1 Comment

Note that link-only answers are discouraged, SO answers should be the end-point of a search for a solution (vs. yet another stopover of references, which tend to get stale over time). Please consider adding a stand-alone synopsis here, keeping the link as a reference.

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.