Logo Search packages:      
Sourcecode: k9copy version File versions  Download package

bool K3bDevice::Device::readCd ( unsigned char *  data,
int  dataLen,
int  sectorType,
bool  dap,
unsigned long  startAdress,
unsigned long  length,
bool  sync,
bool  header,
bool  subHeader,
bool  userData,
bool  edcEcc,
int  c2,
int  subChannel 
) const

Parameters:
sectorType,: 
  • 000b - all types
  • 001b - CD-DA
  • 010b - Mode 1
  • 011b - Mode 2 formless
  • 100b - Mode 2 form 1
  • 101b - Mode 2 form 2
c2,: 
  • 00b - No error info
  • 01b - 294 bytes, one bit for every byte of the 2352 bytes
  • 10b - 296 bytes, xor of all c2 bits, zero pad bit, 294 c2 bits
subChannel,: 
  • 000b - No Sub-channel data
  • 001b - RAW P-W Sub-channel (96 bytes)
  • 010b - Formatted Q Sub-channel (16 bytes)
  • 100b - Corrected and de-interleaved R-W Sub-channel (96 bytes)

Definition at line 370 of file k3bdevice_mmc.cpp.

References blockDeviceName().

Referenced by getIndex().

{
  ::memset( data, 0, dataLen );

  ScsiCommand cmd( this );
  cmd[0] = MMC_READ_CD;
  cmd[1] = (sectorType<<2 & 0x1c) | ( dap ? 0x2 : 0x0 );
  cmd[2] = startAdress>>24;
  cmd[3] = startAdress>>16;
  cmd[4] = startAdress>>8;
  cmd[5] = startAdress;
  cmd[6] = length>>16;
  cmd[7] = length>>8;
  cmd[8] = length;
  cmd[9] = ( ( sync      ? 0x80 : 0x0 ) |
           ( subHeader ? 0x40 : 0x0 ) |
           ( header    ? 0x20 : 0x0 ) |
           ( userData  ? 0x10 : 0x0 ) |
           ( edcEcc    ? 0x8  : 0x0 ) |
           ( c2<<1 & 0x6 ) );
  cmd[10] = subChannel & 0x7;

  if( cmd.transport( TR_DIR_READ, data, dataLen ) ) {
    kdDebug() << "(K3bDevice::Device) " << blockDeviceName() << ": READ CD failed!" << endl;
    return false;
  }
  else {
    return true;
  }
}


Generated by  Doxygen 1.6.0   Back to index