I am slowing going through a USB-driver development phase.
gives the following output
Any idea how to proceed from here on?
Code:
char outBuf[9];
outBuf[0] = 0x10; //start message
outBuf[1] = 0x02; //start message
outBuf[2] = 0x01; //command number issued
outBuf[3] = 0x01; //node
outBuf[4] = 0x01; //length of message
outBuf[5] = 0x00; //length of message
outBuf[6] = 0x0F; //data or command
outBuf[7] = 0x10; //end of message
outBuf[8] = 0x03; //end of message
int j;printf("\nmessage: ");
for (j=0; j<strlen(outBuf); j++) {
printf("%x-",outBuf[j]);
}
err = (*intf)->WritePipe(intf, outPipeRef, outBuf,9);
if (err != kIOReturnSuccess) {
printf("Unable to perform bulk write (%08x)\n", err);
} else {
printf("write ok\n");
}
//return message?
char inBuf[640000];//100*max packetsize
UInt32 bufssize = 640000;
err = (*intf)->ReadPipe(intf, inPipeRef, inBuf,(void*)(UInt32)bufssize);
if (err != kIOReturnSuccess) {
printf("Unable to perform bulk read (%08x), buf-size: %i \n", err,bufssize);
} else {
printf("\nreturn message: ");
for (j=0; j<strlen(inBuf); j++) {
printf("%x",inBuf[j]);
}
}
gives the following output
Code:
...
START COMM
message: 10-2-1-1-1-write ok
Unable to perform bulk read (e00002e8)
640000
END COMM
...
Any idea how to proceed from here on?