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