userlibandfileserver/fileserver/smassstorage/inc/rusbmassstorage.inl
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Tue, 11 May 2010 17:28:22 +0300
branchRCL_3
changeset 26 c734af59ce98
parent 0 a41df078684a
permissions -rw-r--r--
Revision: 201019 Kit: 201019

// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
// All rights reserved.
// This component and the accompanying materials are made available
// under the terms of the License "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:
// Implementation of client API of mass storage file server
// 
// WARNING: This file contains some APIs which are internal and are subject
//          to change without noticed. Such APIs should therefore not be used
//          outside the Kernel and Hardware Services package.
//

/**
 @file
 @internalTechnology
*/

inline RUsbMassStorage::RUsbMassStorage()
	{
	// Intentionally left blank
	}

inline TVersion RUsbMassStorage::Version() const
	{
	return(TVersion(KUsbMsSrvMajorVersionNumber,KUsbMsSrvMinorVersionNumber,KUsbMsSrvBuildVersionNumber));
	}

inline TInt RUsbMassStorage::Connect()
	{
    // 1: only a single session is required
#ifdef __T_MS_CLISVR__
   	static _LIT_SECURITY_POLICY_S0(KFileServerPolicy,0x101F7774);
#else
  	static _LIT_SECURITY_POLICY_S0(KFileServerPolicy,KFileServerUidValue);
#endif
  	return CreateSession(KUsbMsServerName, Version(), 1, EIpcSession_Unsharable,&KFileServerPolicy,0);
	}

/**
 @capability NetworkControl 
 */
inline TInt RUsbMassStorage::Start(const TMassStorageConfig& aMsConfig)
	{
	return SendReceive(EUsbMsStart, TIpcArgs(&aMsConfig.iVendorId, &aMsConfig.iProductId, &aMsConfig.iProductRev));
	}

/**
 @capability NetworkControl 
 */	
inline TInt RUsbMassStorage::Stop()
	{
	return SendReceive(EUsbMsStop);
	}

/**
 @capability NetworkControl 
 */	
inline TInt RUsbMassStorage::Shutdown()
	{
	return SendReceive(EUsbMsShutdown);
	}