Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

MrFusion

macrumors 6502a
Original poster
Jun 8, 2005
613
0
West-Europe
I am slowing going through a USB-driver development phase.

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?
 

unknown.exe

macrumors member
Sep 22, 2007
67
0
Somewhere on Earth
I am slowing going through a USB-driver development phase.

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

macrumors 6502a
Original poster
Jun 8, 2005
613
0
West-Europe
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.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.