# HG changeset patch # User Dremov Kirill (Nokia-D-MSW/Tampere) # Date 1272379289 -10800 # Node ID f6533aee8b2b261d307594abc06a5f82070bbae6 # Parent 1a297fa72b1eb0df574e1e0eb831662f692f88fc Revision: 201015 Kit: 201017 diff -r 1a297fa72b1e -r f6533aee8b2b usbclasses/usbphoneasmodem/classcontroller/conf/usbmanager_mscfile_2000fda8.crml Binary file usbclasses/usbphoneasmodem/classcontroller/conf/usbmanager_mscfile_2000fda8.crml has changed diff -r 1a297fa72b1e -r f6533aee8b2b usbclasses/usbphoneasmodem/classcontroller/conf/usbphoneasmodem_mscfile_classcontroller.confml Binary file usbclasses/usbphoneasmodem/classcontroller/conf/usbphoneasmodem_mscfile_classcontroller.confml has changed diff -r 1a297fa72b1e -r f6533aee8b2b usbclasses/usbphoneasmodem/classcontroller/data/usbmscfileresource.rss --- a/usbclasses/usbphoneasmodem/classcontroller/data/usbmscfileresource.rss Wed Apr 14 17:02:32 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,60 +0,0 @@ -// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -// All rights reserved. -// This component and the accompanying materials are made available -// under the terms of "Eclipse Public License v1.0" -// which accompanies this distribution, and is available -// at the URL "http://www.eclipse.org/legal/epl-v10.html". -// -// Initial Contributors: -// Nokia Corporation - initial contribution. -// -// Contributors: -// -// Description: -// -// - -// RESOURCE IDENTIFIER -NAME UMSC - -#include -#include "usbmscfileclasscontroller.rh" - -// CONSTANTS - -// MACROS - -// RESOURCE DEFINITIONS - -//----------------------------------------------------------------------------- -// -// - -// Resource signature -// -//----------------------------------------------------------------------------- -// -RESOURCE RSS_SIGNATURE {} - -//----------------------------------------------------------------------------- -// -// - -// Resource filename -// -//----------------------------------------------------------------------------- -// -RESOURCE TBUF - { - buf = "usbmscfileresource"; - } - -RESOURCE ARRAY r_usbmscfile_image_paths - { - items = - { - USBMSCFILE_FILESYSTEM_IMAGE - { - lun = 0; - path = "phone_as_modem.iso"; - } - }; - } diff -r 1a297fa72b1e -r f6533aee8b2b usbclasses/usbphoneasmodem/classcontroller/group/bld.inf --- a/usbclasses/usbphoneasmodem/classcontroller/group/bld.inf Wed Apr 14 17:02:32 2010 +0300 +++ b/usbclasses/usbphoneasmodem/classcontroller/group/bld.inf Tue Apr 27 17:41:29 2010 +0300 @@ -27,3 +27,5 @@ PRJ_EXPORTS ../rom/usbmscfileclasscontroller.iby CORE_MW_LAYER_IBY_EXPORT_PATH(usbmscfileclasscontroller.iby) +../conf/usbphoneasmodem_mscfile_classcontroller.confml MW_LAYER_CONFML(usbphoneasmodem_mscfile_classcontroller.confml) +../conf/usbmanager_mscfile_2000fda8.crml MW_LAYER_CRML(usbmanager_mscfile_2000fda8.crml) \ No newline at end of file diff -r 1a297fa72b1e -r f6533aee8b2b usbclasses/usbphoneasmodem/classcontroller/group/usbmscfileclasscontroller.mmp --- a/usbclasses/usbphoneasmodem/classcontroller/group/usbmscfileclasscontroller.mmp Wed Apr 14 17:02:32 2010 +0300 +++ b/usbclasses/usbphoneasmodem/classcontroller/group/usbmscfileclasscontroller.mmp Tue Apr 27 17:41:29 2010 +0300 @@ -42,13 +42,9 @@ TARGET usbmscfileclasscontroller.rsc END -START RESOURCE usbmscfileresource.rss -HEADER -TARGETPATH APP_RESOURCE_DIR -END - LIBRARY euser.lib LIBRARY usbclasscontroller.lib LIBRARY efsrv.lib LIBRARY bafl.lib +LIBRARY centralrepository.lib DEBUGLIBRARY flogger.lib diff -r 1a297fa72b1e -r f6533aee8b2b usbclasses/usbphoneasmodem/classcontroller/inc/usbmscfileclasscontroller.rh --- a/usbclasses/usbphoneasmodem/classcontroller/inc/usbmscfileclasscontroller.rh Wed Apr 14 17:02:32 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,27 +0,0 @@ -// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -// All rights reserved. -// This component and the accompanying materials are made available -// under the terms of "Eclipse Public License v1.0" -// which accompanies this distribution, and is available -// at the URL "http://www.eclipse.org/legal/epl-v10.html". -// -// Initial Contributors: -// Nokia Corporation - initial contribution. -// -// Contributors: -// -// Description: -// -// - - -#include - -STRUCT USBMSCFILE_FILESYSTEM_IMAGE - { - WORD protocol = 0; // protocol not used - WORD lun; // only LUN 0 supported currently - LTEXT path; // full path to file system image file - } - -// End Of File diff -r 1a297fa72b1e -r f6533aee8b2b usbclasses/usbphoneasmodem/classcontroller/inc/usbmscfileclasscontroller_crkeys.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/usbclasses/usbphoneasmodem/classcontroller/inc/usbmscfileclasscontroller_crkeys.h Tue Apr 27 17:41:29 2010 +0300 @@ -0,0 +1,42 @@ +// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +// All rights reserved. +// This component and the accompanying materials are made available +// under the terms of "Eclipse Public License v1.0" +// which accompanies this distribution, and is available +// at the URL "http://www.eclipse.org/legal/epl-v10.html". +// +// Initial Contributors: +// Nokia Corporation - initial contribution. +// +// Contributors: +// +// Description: Adheres to the UsbMan USB Class API and talks to mass storage file system +// +// +#ifndef USBMSCFILECLASSCONTROLLER_CRKEYS_H +#define USBMSCFILECLASSCONTROLLER_CRKEYS_H + +// CONSTANTS +const TUid KCRUidUsbPhoneAsModemMscFileClassController = { 0x2000FDA8 }; + +/* +the least significant four bits is used for columns(unit file attributes: unit number, full name), +the remains bit is used for rows(which unit file). + +for example, if two units is used, the following can be added for the second unit keys. + +const TUint32 KCRIdMscFileLogicalUnitNumber2 = 0x00000010; +const TUint32 KCRIdMscFileImageFullName2 = 0x00000011; + +refer to central repository how-to document section 5, Structured Data in the Central Repository + +*/ +const TUint32 KCRIdMscFileLogicalUnitNumber1 = 0x00000000; +const TUint32 KCRIdMscFileImageFullName1 = 0x00000001; + +const TUint32 KCRMscFileLogicalUnitNumberColumn = 0x00000000; +const TUint32 KCRMscFileImageFullNameColumn = 0x00000001; + +const TUint32 KCRMscFileColumnMask = 0x0000000F; +const TUint32 KCRMscFileRowMask = 0xFFFFFFF0; +#endif // USBMSCFILECLASSCONTROLLER_CRKEYS_H diff -r 1a297fa72b1e -r f6533aee8b2b usbclasses/usbphoneasmodem/classcontroller/rom/usbmscfileclasscontroller.iby --- a/usbclasses/usbphoneasmodem/classcontroller/rom/usbmscfileclasscontroller.iby Wed Apr 14 17:02:32 2010 +0300 +++ b/usbclasses/usbphoneasmodem/classcontroller/rom/usbmscfileclasscontroller.iby Tue Apr 27 17:41:29 2010 +0300 @@ -23,7 +23,6 @@ #ifdef FF_USB_MODEM ECOM_PLUGIN(usbmscfileclasscontroller.dll, usbmscfileclasscontroller.rsc) -S60_APP_RESOURCE(usbmscfileresource) #endif diff -r 1a297fa72b1e -r f6533aee8b2b usbclasses/usbphoneasmodem/classcontroller/src/usbmscfileclasscontroller.cpp --- a/usbclasses/usbphoneasmodem/classcontroller/src/usbmscfileclasscontroller.cpp Wed Apr 14 17:02:32 2010 +0300 +++ b/usbclasses/usbphoneasmodem/classcontroller/src/usbmscfileclasscontroller.cpp Tue Apr 27 17:41:29 2010 +0300 @@ -18,11 +18,12 @@ #include #include #include +#include #include -#include #include #include "usbmscfileclasscontroller.h" #include "usbmscfile.h" +#include "usbmscfileclasscontroller_crkeys.h" #include "debug.h" // Panic category @@ -30,7 +31,6 @@ _LIT( KMsCcPanicCategory, "UsbMscFileCc" ); #endif -_LIT( KResourceFileName, "usbmscfileresource.rsc" ); _LIT( KUsbMsResource, "\\private\\101fe1db\\usbms.rsc" ); /** @@ -397,38 +397,32 @@ LEAVE_IF_ERROR( mscFile.Connect() ); CleanupClosePushL( mscFile ); - LEAVE_IF_ERROR( fs.Connect() ); - CleanupClosePushL( fs ); + CRepository* repository = CRepository::NewLC(KCRUidUsbPhoneAsModemMscFileClassController); + + RArray lunKeys; + CleanupClosePushL(lunKeys); + + repository->FindL(KCRMscFileLogicalUnitNumberColumn, KCRMscFileColumnMask, lunKeys); - TFileName fileName; - const TDriveNumber KStoreDrive = EDriveZ; - TDriveUnit driveUnit( KStoreDrive ); - TDriveName drive = driveUnit.Name(); - fileName.Insert( 0, drive ); - - fileName += KDC_APP_RESOURCE_DIR; // From data_caging_path_literals.hrh - fileName += KResourceFileName; - - RResourceFile resourceFile; - CleanupClosePushL( resourceFile ); - resourceFile.OpenL( fs, fileName ); - resourceFile.ConfirmSignatureL(); + + TInt count = lunKeys.Count(); + for (TInt i=0; iGet(lunKey, lun)); + + TFileName fullName; + LEAVE_IF_ERROR(repository->Get(fullNameKey, fullName)); + + TRACE_INFO( (_L("lun=%d, fullName=%S"), lun, &fullName) ); + + TInt protocol = 0; // It is not used. Bulk Transport(0x50), SCSI transparent command Set(0x06), PDT CD/DVD device(0x05) is supported only. + + LEAVE_IF_ERROR(mscFile.SetupLogicalUnit( fullName, protocol, lun )); + } + CleanupStack::PopAndDestroy( 3 ); // mscFile, repository, lunKeys } diff -r 1a297fa72b1e -r f6533aee8b2b usbclasses/usbphoneasmodem/classimplementation/mscfileserver/rom/phone_as_modem.iso Binary file usbclasses/usbphoneasmodem/classimplementation/mscfileserver/rom/phone_as_modem.iso has changed diff -r 1a297fa72b1e -r f6533aee8b2b usbclasses/usbphoneasmodem/classimplementation/mscfileserver/src/mscfilesession.cpp --- a/usbclasses/usbphoneasmodem/classimplementation/mscfileserver/src/mscfilesession.cpp Wed Apr 14 17:02:32 2010 +0300 +++ b/usbclasses/usbphoneasmodem/classimplementation/mscfileserver/src/mscfilesession.cpp Tue Apr 27 17:41:29 2010 +0300 @@ -118,33 +118,16 @@ TRACE_FUNC_ENTRY TInt protocol; TInt lun; - RBuf buf; + RBuf fullImageFileName; TInt len = aMessage.GetDesLength( 0 ); - buf.CreateL( len ); - buf.CleanupClosePushL(); - aMessage.ReadL( 0, buf ); + fullImageFileName.CreateL( len ); + fullImageFileName.CleanupClosePushL(); + aMessage.ReadL( 0, fullImageFileName ); protocol = aMessage.Int1(); lun = aMessage.Int2(); - - //get the directory and name of image file - RFs fs; - LEAVE_IF_ERROR(fs.Connect()); - CleanupClosePushL(fs); - TFileName fileName; - const TDriveNumber KResourceDrive = EDriveZ; - TDriveUnit driveUnit( KResourceDrive ); - TDriveName drive = driveUnit.Name(); - fileName.Insert( 0, drive ); - // append private path - TPath privatePath; - fs.PrivatePath(privatePath); - fileName.Append(privatePath); - CleanupStack::PopAndDestroy(&fs); - - fileName.Append(buf); - iMscFileServer.Controller().SetupLogicalUnitL( fileName, protocol, lun ); - CleanupStack::PopAndDestroy( &buf ); + iMscFileServer.Controller().SetupLogicalUnitL( fullImageFileName, protocol, lun ); + CleanupStack::PopAndDestroy( &fullImageFileName ); TRACE_FUNC_EXIT } /** diff -r 1a297fa72b1e -r f6533aee8b2b usbengines/usblocodplugin/tsrc/USBLocodPluginTest/conf/USBLocodPluginTest.cfg --- a/usbengines/usblocodplugin/tsrc/USBLocodPluginTest/conf/USBLocodPluginTest.cfg Wed Apr 14 17:02:32 2010 +0300 +++ b/usbengines/usblocodplugin/tsrc/USBLocodPluginTest/conf/USBLocodPluginTest.cfg Tue Apr 27 17:41:29 2010 +0300 @@ -1,3 +1,20 @@ +/* +* Copyright (c) 2002 - 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + // USBLocodPluginTest Module - total 8 tc // USBLocodPluginTest Api Tests (4 tc) diff -r 1a297fa72b1e -r f6533aee8b2b usbengines/usblocodplugin/tsrc/USBLocodPluginTest/init/USBLocodPluginTest_ats.ini --- a/usbengines/usblocodplugin/tsrc/USBLocodPluginTest/init/USBLocodPluginTest_ats.ini Wed Apr 14 17:02:32 2010 +0300 +++ b/usbengines/usblocodplugin/tsrc/USBLocodPluginTest/init/USBLocodPluginTest_ats.ini Tue Apr 27 17:41:29 2010 +0300 @@ -1,3 +1,19 @@ +# +# Copyright (c) 2002 - 2007 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: +# + # # This is STIF initialization file # Comment lines start with '#'-character. diff -r 1a297fa72b1e -r f6533aee8b2b usbengines/usblocodplugin/tsrc/USBLocodPluginTest/init/USBLocodPluginTest_phone.ini --- a/usbengines/usblocodplugin/tsrc/USBLocodPluginTest/init/USBLocodPluginTest_phone.ini Wed Apr 14 17:02:32 2010 +0300 +++ b/usbengines/usblocodplugin/tsrc/USBLocodPluginTest/init/USBLocodPluginTest_phone.ini Tue Apr 27 17:41:29 2010 +0300 @@ -1,3 +1,18 @@ +# +# Copyright (c) 2002 - 2007 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: +# # # This is STIF initialization file # Comment lines start with '#'-character. diff -r 1a297fa72b1e -r f6533aee8b2b usbengines/usbotgwatcher/src/cusbstatehostabase.cpp --- a/usbengines/usbotgwatcher/src/cusbstatehostabase.cpp Wed Apr 14 17:02:32 2010 +0300 +++ b/usbengines/usbotgwatcher/src/cusbstatehostabase.cpp Tue Apr 27 17:41:29 2010 +0300 @@ -189,7 +189,7 @@ case KErrUsbBadDevice: // = -6656 case KErrUsbBadHub: case KErrUsbEventOverflow: - case KErrUsbBadDeviceAttached: + // hosterrors.h case KErrUsbUnsupportedDevice: diff -r 1a297fa72b1e -r f6533aee8b2b usbengines/usbotgwatcher/src/cusbstatehostainitiate.cpp --- a/usbengines/usbotgwatcher/src/cusbstatehostainitiate.cpp Wed Apr 14 17:02:32 2010 +0300 +++ b/usbengines/usbotgwatcher/src/cusbstatehostainitiate.cpp Tue Apr 27 17:41:29 2010 +0300 @@ -245,9 +245,10 @@ } case KErrUsbDeviceDetachedDuringDriverLoading: { - //do not show error, due to device is already detached - // Device Detachment will not come after this (it was not attached yet) - // therefore emulate detachment + LOG( "KErrUsbDeviceDetachedDuringDriverLoading" ); + // do not show error, due to device is already detached + // Device Detachment will not come after this (it was not + // normally attached yet), therefore emulate detachment // content of aTdi is not important, due to detachment anyway DeviceDetachedL(aTdi); break; diff -r 1a297fa72b1e -r f6533aee8b2b usbengines/usbotgwatcher/src/cusbstatehosthandledropping.cpp --- a/usbengines/usbotgwatcher/src/cusbstatehosthandledropping.cpp Wed Apr 14 17:02:32 2010 +0300 +++ b/usbengines/usbotgwatcher/src/cusbstatehosthandledropping.cpp Tue Apr 27 17:41:29 2010 +0300 @@ -17,6 +17,7 @@ #include #include +#include #include "cusbotgwatcher.h" #include "cusbstatehosthandledropping.h" @@ -385,8 +386,8 @@ switch (aMessage) { - // USBDI - case KEventUsbBadDeviceDetached: + // OTGDI + case KEventUsbOtgBadDeviceDetached: { LOG("BadDeviceDetached" ); ChangeHostStateL( EUsbStateHostUndefined); diff -r 1a297fa72b1e -r f6533aee8b2b usbengines/usbotgwatcher/src/cusbstatehostundefined.cpp --- a/usbengines/usbotgwatcher/src/cusbstatehostundefined.cpp Wed Apr 14 17:02:32 2010 +0300 +++ b/usbengines/usbotgwatcher/src/cusbstatehostundefined.cpp Tue Apr 27 17:41:29 2010 +0300 @@ -15,6 +15,7 @@ * */ +#include #include "cusbotgwatcher.h" #include "cusbstatehostundefined.h" @@ -168,7 +169,8 @@ // // --------------------------------------------------------------------------- // -void CUsbStateHostUndefined::DriverLoadPartialSuccessL(TDeviceEventInformation) +void CUsbStateHostUndefined::DriverLoadPartialSuccessL( + TDeviceEventInformation) { LOG_FUNC } @@ -208,7 +210,25 @@ void CUsbStateHostUndefined::MessageNotificationReceivedL(TInt aMessage) { LOG_FUNC - LOG1( "Unhandled message aMessage = %d" , aMessage); + LOG1( "aMessage = %d" , aMessage); + + switch (aMessage) + { + // OTGDI + case KErrUsbOtgBadDeviceAttached: + { + LOG( "BadDeviceAttached" ); + HandleL(EUsbWatcherErrUnsupportedDevice, + EUsbStateHostHandleDropping); + break; + } + default: + { + LOG1( "Unhandled message = %d" , aMessage); + break; + } + + } } // --------------------------------------------------------------------------- diff -r 1a297fa72b1e -r f6533aee8b2b usbengines/usbremotepersonality/tsrc/USBRemotePersonalityTest/conf/USBRemotePersonalityTest.cfg --- a/usbengines/usbremotepersonality/tsrc/USBRemotePersonalityTest/conf/USBRemotePersonalityTest.cfg Wed Apr 14 17:02:32 2010 +0300 +++ b/usbengines/usbremotepersonality/tsrc/USBRemotePersonalityTest/conf/USBRemotePersonalityTest.cfg Tue Apr 27 17:41:29 2010 +0300 @@ -1,3 +1,20 @@ +/* +* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + [StifSettings] CapsModifier= USBRemotePersonalityTest.exe [EndStifSettings] diff -r 1a297fa72b1e -r f6533aee8b2b usbengines/usbremotepersonality/tsrc/USBRemotePersonalityTest/init/USBRemotePersonalityTest_ats.ini --- a/usbengines/usbremotepersonality/tsrc/USBRemotePersonalityTest/init/USBRemotePersonalityTest_ats.ini Wed Apr 14 17:02:32 2010 +0300 +++ b/usbengines/usbremotepersonality/tsrc/USBRemotePersonalityTest/init/USBRemotePersonalityTest_ats.ini Tue Apr 27 17:41:29 2010 +0300 @@ -1,3 +1,20 @@ +# +# Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: +# + + # # This is STIF initialization file # Comment lines start with '#'-character. diff -r 1a297fa72b1e -r f6533aee8b2b usbengines/usbremotepersonality/tsrc/USBRemotePersonalityTest/init/USBRemotePersonalityTest_phone.ini --- a/usbengines/usbremotepersonality/tsrc/USBRemotePersonalityTest/init/USBRemotePersonalityTest_phone.ini Wed Apr 14 17:02:32 2010 +0300 +++ b/usbengines/usbremotepersonality/tsrc/USBRemotePersonalityTest/init/USBRemotePersonalityTest_phone.ini Tue Apr 27 17:41:29 2010 +0300 @@ -1,3 +1,19 @@ +# +# Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: +# + # # This is STIF initialization file # Comment lines start with '#'-character. diff -r 1a297fa72b1e -r f6533aee8b2b usbengines/usbwatcher/src/cusbactivepersonalityhandler.cpp --- a/usbengines/usbwatcher/src/cusbactivepersonalityhandler.cpp Wed Apr 14 17:02:32 2010 +0300 +++ b/usbengines/usbwatcher/src/cusbactivepersonalityhandler.cpp Tue Apr 27 17:41:29 2010 +0300 @@ -29,8 +29,7 @@ #include // CONSTANTS -// const TInt KSerialNumberLength = 12; -const TInt KContainerIdLength = 16; +const TInt KSerialNumberLength = 12; const TUid KUsbmanSvrUid = {0x101fe1db}; @@ -124,23 +123,19 @@ TLex lex( iPhoneInfo.iSerialNumber ); TInt length = iPhoneInfo.iSerialNumber.Length(); - // currently the serial number is used for the USB container ID - // the container ID length must be at least 16 bytes - // also, even when serial number is not used for the container id - // it must be at least 12, see below - if( length < KContainerIdLength ) + if( length < KSerialNumberLength ) { - // In GSM, the complete IMEI can used as USB serial number. But in - // CDMA, the ESN is too short for a valid Mass Storage serial number - // (Mass-Storage and Bulk Only Transport specs both require minimum - // 12 byte number), so it is extended with leading zeroes. When - // doing this, make sure not to write anything over descriptor's - // max length - if( iPhoneInfo.iSerialNumber.MaxLength() < KContainerIdLength ) + // In GSM, the complete IMEI can be used as USB serial + // number. But in CDMA, the ESN is too short for a valid Mass + // Storage serial number (Mass-Storage and Bulk Only Transport + // specs both require minimum 12 byte number), so it is + // extended with trailing zeroes. When doing this, make sure + // not to write anything over descriptor's max length + if( iPhoneInfo.iSerialNumber.MaxLength() < KSerialNumberLength ) { - iPhoneInfo.iSerialNumber.SetLength( KContainerIdLength ); + iPhoneInfo.iSerialNumber.SetLength( KSerialNumberLength ); } - while( length < KContainerIdLength ) + while( length < KSerialNumberLength ) { iPhoneInfo.iSerialNumber.Append( '0' ); ++length;