Home > Mobile >  MacOS USB question.
MacOS USB question.

Time:11-21

,, can you tell me how to send USB devices on MacOS SCSI custom command? Under Linux, for example, is to do so:
Sg_io_hdr_t the p_io_hdr;
Memset (& amp; The p_io_hdr, 0 x00, sizeof (sg_io_hdr_t));

The p_io_hdr. Interface_id='S'.
The p_io_hdr. Flags=SG_FLAG_LUN_INHIBIT;

If (aDataIn==DATA_USB_TO_HOST)
The p_io_hdr. Dxfer_direction=SG_DXFER_FROM_DEV;
The else
The p_io_hdr. Dxfer_direction=SG_DXFER_TO_DEV;

The p_io_hdr. Cmd_len=aCBDLen;
The p_io_hdr. CMDP=aCBD (unsigned char *);
The p_io_hdr. Dxfer_len=aDataLen;
The p_io_hdr. Dxferp=aData;


Int ret=ioctl (aHandle, SG_IO, & amp; The p_io_hdr);
If (ret<0 | | the p_io_hdr driver_status!=0)
return -1;

  •  Tags:  
  • iOS
  • Related