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

int K3bDevice::Device::determineMaximalWriteSpeed (  )  const

the speed in kb/s or 0 on failure.

Definition at line 2709 of file k3bdevice.cpp.

References determineSupportedWriteSpeeds(), K3bDevice::mm_cap_page_2A::max_write_speed, and modeSense().

Referenced by init().

{
  int ret = 0;
  unsigned char* data = 0;
  int dataLen = 0;

  QValueList<int> list = determineSupportedWriteSpeeds();
  if( !list.isEmpty() ) {
    for( QValueList<int>::iterator it = list.begin(); it != list.end(); ++it )
      ret = QMAX( ret, *it );
  }
  else if( modeSense( &data, dataLen, 0x2A ) ) {
    mm_cap_page_2A* mm = (mm_cap_page_2A*)&data[8];

    // MMC1 used byte 18 and 19 for the max write speed
    if( dataLen > 19 )
      ret = from2Byte( mm->max_write_speed );

    delete [] data;
  }

  if( ret > 0 )
    return ret;
  else
    return m_maxWriteSpeed;
}


Generated by  Doxygen 1.6.0   Back to index