USB driver e00002e8

Discussion in 'Mac Programming' started by MrFusion, Dec 3, 2007.

  1. MrFusion macrumors 6502a

    Joined:
    Jun 8, 2005
    Location:
    West-Europe
    #1
    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?
     
  2. unknown.exe macrumors member

    unknown.exe

    Joined:
    Sep 22, 2007
    Location:
    Somewhere on Earth
    #2
    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:
     
  3. MrFusion thread starter macrumors 6502a

    Joined:
    Jun 8, 2005
    Location:
    West-Europe
    #3
    Sandisk? Why Sandisk?
    I am looking through the examples provided by apple. That's why I got so far.
     

Share This Page