userlibandfileserver/fileserver/smassstorage/inc/drivemanager.inl
changeset 0 a41df078684a
equal deleted inserted replaced
-1:000000000000 0:a41df078684a
       
     1 // Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of the License "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 // Implementations of inline functions declared in drivemanager.h.
       
    15 // 
       
    16 //
       
    17 
       
    18 /**
       
    19  @file
       
    20  @internalTechnology
       
    21  
       
    22  @return Current drive mount state
       
    23 */
       
    24 inline CMassStorageDrive::TMountState CMassStorageDrive::MountState() const
       
    25 	{
       
    26 	return iMountState;
       
    27 	}
       
    28 
       
    29 /**
       
    30 Set the mount state
       
    31 */
       
    32 inline TInt CMassStorageDrive::SetMountDisconnected()
       
    33 	{
       
    34 	return SetMountState(EDisconnected);
       
    35 	}
       
    36 
       
    37 /**
       
    38 Set the mount state
       
    39 */
       
    40 inline TInt CMassStorageDrive::SetMountConnecting()
       
    41 	{
       
    42 	return SetMountState(EConnecting);
       
    43 	}
       
    44 
       
    45 /**
       
    46 Set the mount state
       
    47 */
       
    48 inline TInt CMassStorageDrive::SetMountDisconnecting()
       
    49 	{
       
    50 	return SetMountState(EDisconnecting);
       
    51 	}
       
    52 
       
    53 /**
       
    54 Set the mount state
       
    55 */
       
    56 inline TInt CMassStorageDrive::SetMountConnected()
       
    57 	{
       
    58 	iCritSec.Wait();
       
    59 	return SetMountState(EConnected);
       
    60 	}
       
    61 
       
    62 /**
       
    63  Is Whole Media Access Permitted for Mass Storage Drive
       
    64  */
       
    65 inline TBool CMassStorageDrive::IsWholeMediaAccess()
       
    66 	{
       
    67 	return iWholeMediaAccess;
       
    68 	}
       
    69 
       
    70 #ifndef USB_TRANSFER_PUBLISHER
       
    71 /**
       
    72 @return Cumulative bytes read since the host connected to the drive, 
       
    73         in multiples of KBytesPerKilobyte rounded to nearest integer value.
       
    74         The KBytes refers to multiples of 1000, not 1024.
       
    75 */
       
    76 inline TUint CMassStorageDrive::KBytesRead() const
       
    77 	{
       
    78 	return I64LOW(iBytesRead / (TUint64)1000);
       
    79 	}
       
    80 
       
    81 /**
       
    82 @return Cumulative bytes written since the host connected to the drive, 
       
    83         in multiples of KBytesPerKilobyte rounded to nearest integer value.
       
    84         The KBytes refer to multiples of 1000, not 1024.
       
    85 */
       
    86 inline TUint CMassStorageDrive::KBytesWritten() const
       
    87 	{
       
    88 	return I64LOW(iBytesWritten / (TUint64)1000);
       
    89 	}
       
    90 
       
    91 #else
       
    92 /**
       
    93 Transfer function for the property
       
    94 
       
    95 @return Cumulative bytes read since the host connected to the drive, 
       
    96         in multiples of KBytesPerKilobyte rounded to nearest integer value.
       
    97         The KBytes refer to multiples of 1000, not 1024.
       
    98 */
       
    99 inline TUint CUsbTransferPublisher::GetBytesTransferred(TUint aLun) const
       
   100 {
       
   101 	return I64LOW(iArray[aLun] / (TUint64)1000);
       
   102 }
       
   103 
       
   104 #endif // USB_TRANSFER_PUBLISHER