Ivan
2006-07-07 23:42:09 UTC
I am working on a project trying to setup a telemetry system on a Mac
OS X. What I am currently trying to accomplish is reading a continuous
stream of data from the USB port and have it display on the console. I
am currently using Apple's sample code in order to access a USB serial
adapter controller.
http://developer.apple.com/samplecode/USBPrivateDataSample/index.html
After modifying the vendor and product ID to that of the controller I
have gotten it to work like it should. However, the current problem I
am having is that I am not familiar on how to read the USB port once it
has been detected. I have tried creating methods to read the USB port
using ReadPipe but I get an error once its executed and Xcode opens a
debugger window with assembly code. The type of code method I tried
implementing was like the section of "Working With Interfaces" from
Apple's USB Device Interface Guide. Like this:
kr = (*interface)->ReadPipe(interface, 9, gBuffer, &numBytesRead);
Can anybody help me out with some pseudo code or a sample method I
could use as reference?
Ivan
OS X. What I am currently trying to accomplish is reading a continuous
stream of data from the USB port and have it display on the console. I
am currently using Apple's sample code in order to access a USB serial
adapter controller.
http://developer.apple.com/samplecode/USBPrivateDataSample/index.html
After modifying the vendor and product ID to that of the controller I
have gotten it to work like it should. However, the current problem I
am having is that I am not familiar on how to read the USB port once it
has been detected. I have tried creating methods to read the USB port
using ReadPipe but I get an error once its executed and Xcode opens a
debugger window with assembly code. The type of code method I tried
implementing was like the section of "Working With Interfaces" from
Apple's USB Device Interface Guide. Like this:
kr = (*interface)->ReadPipe(interface, 9, gBuffer, &numBytesRead);
Can anybody help me out with some pseudo code or a sample method I
could use as reference?
Ivan