Esempio n. 1
0
 public static byte[] ReadCapacity(IntPtr handle)
 {
     byte[] data = new byte[8];
     byte[] cdb  = new byte[16];
     cdb[0] = 0x25;
     SCSI.Cmd(handle, 16, cdb, data.Length, ref data, SCSI.SCSI_IOCTL_DATA_IN);
     return(data);
 }
Esempio n. 2
0
 public static byte[] StartStopUint(IntPtr handle)
 {
     byte[] data = new byte[8];
     byte[] cdb  = new byte[16];
     cdb[0] = 0x1B;
     cdb[4] = 0x02;
     SCSI.Cmd(handle, 16, cdb, data.Length, ref data, SCSI.SCSI_IOCTL_DATA_IN);
     return(data);
 }
Esempio n. 3
0
 public static byte[] Inquiry(IntPtr handle)
 {
     byte[] data = new byte[64];
     byte[] cdb  = new byte[16];
     cdb[0] = 0x12;
     cdb[4] = 0x40;
     SCSI.Cmd(handle, 16, cdb, data.Length, ref data, SCSI.SCSI_IOCTL_DATA_IN);
     return(data);
 }
Esempio n. 4
0
 public static void send_CMD_2(IntPtr handle)
 {
     //讓reader回到stand-by state
     byte[] resp = new byte[5];
     byte[] cdb  = new byte[16];
     cdb[0]  = 0xD1;
     cdb[2]  = 0x07;
     cdb[9]  = 0x10;
     cdb[10] = 0x1A;
     SCSI.Cmd(handle, 16, cdb, resp.Length, ref resp, SCSI.SCSI_IOCTL_DATA_IN);
 }
Esempio n. 5
0
        public static byte[] send_CMD_1(IntPtr handle)
        {
            //cmd7
            byte[] resp = new byte[3];
            byte[] cdb  = new byte[16];
            cdb[0] = 0xD0;


            SCSI.Cmd(handle, 16, cdb, resp.Length, ref resp, SCSI.SCSI_IOCTL_DATA_IN);
            return(resp);
        }
Esempio n. 6
0
        public static byte[] send_CMD_3(IntPtr handle, byte[] RCA)
        {
            //get CID
            byte[] resp = new byte[16];
            byte[] cdb  = new byte[16];
            cdb[0]  = 0xD1;
            cdb[2]  = 0x0A;
            cdb[3]  = RCA[1];
            cdb[4]  = RCA[2];
            cdb[9]  = 0x10;
            cdb[10] = 0x2A;
            SCSI.Cmd(handle, 16, cdb, resp.Length, ref resp, SCSI.SCSI_IOCTL_DATA_IN);

            byte[] cid = new byte[15];
            Array.Copy(resp, 1, cid, 0, cid.Length);
            return(cid);
        }