USB, interrupt pipes, and Siemens?
USB, interrupt pipes, and Siemens?
- Subject: USB, interrupt pipes, and Siemens?
- From: Ondra Cada <email@hidden>
- Date: Sat, 13 Oct 2001 22:04:10 +0100
Hallo,
I would need to access the Siemens Gigaset ISDN3070 phone via USB. In
principle it should work -- there is a windoze2000 (yik) software, which does
just that.
Well, I've written a simple tool (based on the sample code from Apple),
which snoops out the USB device, interface, and enpoint characteristics;
here's the result:
Selected device: Gigaset 3070 isdn (Siemens AG)
1 configurations, active #1
Interface #0:
class 255, subclass 255
6 endpoints
pipe 1: direction in, transfer type interrupt, maxPacketSize 3
pipe 2: direction out, transfer type interrupt, maxPacketSize 3
pipe 3: direction in, transfer type isoc, maxPacketSize 0
pipe 4: direction out, transfer type isoc, maxPacketSize 0
pipe 5: direction in, transfer type isoc, maxPacketSize 0
pipe 6: direction out, transfer type isoc, maxPacketSize 0
Now, firstly, I kinda supposed there would be a pair of bulk pipes, which
would work as a modem: say AT to the output pipe, got OK at the input one,
etc. Seems not...
Thus I guess Siemens decided to use the interrupt pipes for that (the
isochronous ones look like the telephone interface). So, I wanted to try...
and oops! The standard ReadPipeTO/WritePipeTO services keep returning
kIOReturnBadArgument...
So, is there any special trick how to access interrupt pipes? The test code
I use is extremely plain:
const char test[]="at\n";
int testlen=sizeof(test)-1;
#define RDBUFSIZE 3
static char rdbuf[RDBUFSIZE];
UInt32 nread=RDBUFSIZE-1; // legacy nonsense of keeping place for zero
terminator ;)
for (j=0;j<testlen;j++) {
printf("writing '%c' (x)\n",test[j],test[j]);
kr=(*interface)->WritePipeTO(interface,2,(void*)(test+j),1,1000,1000);
if (kr) printf("ERROR: %x\n",kr); // prints out e00002c2. ie.
kIOReturnBadArgument
kr=(*interface)->ReadPipeTO(interface,1,rdbuf,&nread,1000,1000);
if (kr) printf("ERROR: %x\n",kr); // prints out e00002c2. ie.
kIOReturnBadArgument
else ...write out the result ...
}
Any ideas what "Argument" can be "Bad" there?
Incidentally, with some other device (a 3rd party chipcard reader) I have
here to play with the very same code works properly; the chipcard though has
bulk pipes, not interrupt ones.
TIA,
---
Ondra Cada
OCSoftware: email@hidden
http://www.ocs.cz
2K Development: email@hidden
http://www.2kdevelopment.cz
private email@hidden
http://www.ocs.cz/oc