PDA

View Full Version : USB driver e00002e8




MrFusion
Dec 3, 2007, 12:47 PM
I am slowing going through a USB-driver development phase.

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

...
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?



unknown.exe
Dec 3, 2007, 09:31 PM
I am slowing going through a USB-driver development phase.

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

...
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?
HMMMMMMMMMMMMMMMMM...... This is not the easiest of tasks to perform. But i suggst that you analyze a basic USB driver file and use that to guide you along the way. Call up someone who works at SanDisk and talk to the IT peeps there:apple:

MrFusion
Dec 4, 2007, 03:26 AM
HMMMMMMMMMMMMMMMMM...... This is not the easiest of tasks to perform. But i suggst that you analyze a basic USB driver file and use that to guide you along the way. Call up someone who works at SanDisk and talk to the IT peeps there:apple:

Sandisk? Why Sandisk?
I am looking through the examples provided by apple. That's why I got so far.