usbclasses/usbphoneasmodem/classimplementation/inc/usbmscfile.inl
changeset 0 1e05558e2206
child 2 468cfcb53fd1
equal deleted inserted replaced
-1:000000000000 0:1e05558e2206
       
     1 // Copyright (c) 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 "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 // 
       
    15 // 
       
    16 
       
    17 
       
    18 /**
       
    19  @file
       
    20  @internalTechnology 
       
    21  Implementation of client API of mass storage file server
       
    22  */
       
    23 
       
    24 #ifndef USBMSCFILE_INL
       
    25 #define USBMSCFILE_INL
       
    26 
       
    27 
       
    28 inline RUsbMscFile::RUsbMscFile()
       
    29 	{
       
    30 	// Intentionally left blank
       
    31 	}
       
    32 
       
    33 inline TVersion RUsbMscFile::Version() const
       
    34 	{
       
    35 	return ( TVersion( KUsbMsSrvMajorVersionNumber,
       
    36 	                   KUsbMsSrvMinorVersionNumber,
       
    37 	                   KUsbMsSrvBuildVersionNumber ) );
       
    38 	}
       
    39 
       
    40 inline TInt RUsbMscFile::Connect()
       
    41 	{
       
    42     // 1: only a single session is required
       
    43 #ifdef __T_MS_CLISVR__
       
    44    	static _LIT_SECURITY_POLICY_S0(KFileServerPolicy,0x101F7774);
       
    45 #else
       
    46   	static _LIT_SECURITY_POLICY_S0(KFileServerPolicy,KFileServerUidValue);
       
    47   	static _LIT_SECURITY_POLICY_PASS(KPolicyPass);
       
    48 #endif
       
    49   	return CreateSession( KMscFileServerName, 
       
    50   	                      Version(), 
       
    51   	                      1, 
       
    52   	                      EIpcSession_Unsharable,
       
    53   	                      &KPolicyPass,
       
    54   	                      0);
       
    55 	}
       
    56 
       
    57 inline TInt RUsbMscFile::SetupLogicalUnit( const TDesC& aFileName, 
       
    58                                         const TInt aProtocol, 
       
    59                                         const TInt aLun /* = 0 */ )
       
    60 
       
    61     {
       
    62     return SendReceive( EMscFileSetupLu, TIpcArgs( &aFileName, aProtocol, aLun ) );
       
    63     }
       
    64 /**
       
    65  @capability NetworkControl 
       
    66  */
       
    67 inline TInt RUsbMscFile::Start( const TMassStorageConfig& aMsConfig )
       
    68 	{
       
    69 	return SendReceive( EMscFileStart, TIpcArgs( &aMsConfig.iVendorId, 
       
    70 	                                             &aMsConfig.iProductId, 
       
    71 	                                             &aMsConfig.iProductRev ) );
       
    72 	}
       
    73 
       
    74 /**
       
    75  @capability NetworkControl 
       
    76  */	
       
    77 inline TInt RUsbMscFile::Stop()
       
    78 	{
       
    79 	return SendReceive( EMscFileStop );
       
    80 	}
       
    81 
       
    82 /**
       
    83  @capability NetworkControl 
       
    84  */	
       
    85 inline TInt RUsbMscFile::Shutdown()
       
    86 	{
       
    87 	return SendReceive(EMscFileShutdown);
       
    88 	}
       
    89 
       
    90 #endif  //USBMSCFILE_INL