|
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 // Implementation of client API of mass storage file server |
|
15 // |
|
16 // WARNING: This file contains some APIs which are internal and are subject |
|
17 // to change without noticed. Such APIs should therefore not be used |
|
18 // outside the Kernel and Hardware Services package. |
|
19 // |
|
20 |
|
21 /** |
|
22 @file |
|
23 @internalTechnology |
|
24 */ |
|
25 |
|
26 inline RUsbMassStorage::RUsbMassStorage() |
|
27 { |
|
28 // Intentionally left blank |
|
29 } |
|
30 |
|
31 inline TVersion RUsbMassStorage::Version() const |
|
32 { |
|
33 return(TVersion(KUsbMsSrvMajorVersionNumber,KUsbMsSrvMinorVersionNumber,KUsbMsSrvBuildVersionNumber)); |
|
34 } |
|
35 |
|
36 inline TInt RUsbMassStorage::Connect() |
|
37 { |
|
38 // 1: only a single session is required |
|
39 #ifdef __T_MS_CLISVR__ |
|
40 static _LIT_SECURITY_POLICY_S0(KFileServerPolicy,0x101F7774); |
|
41 #else |
|
42 static _LIT_SECURITY_POLICY_S0(KFileServerPolicy,KFileServerUidValue); |
|
43 #endif |
|
44 return CreateSession(KUsbMsServerName, Version(), 1, EIpcSession_Unsharable,&KFileServerPolicy,0); |
|
45 } |
|
46 |
|
47 /** |
|
48 @capability NetworkControl |
|
49 */ |
|
50 inline TInt RUsbMassStorage::Start(const TMassStorageConfig& aMsConfig) |
|
51 { |
|
52 return SendReceive(EUsbMsStart, TIpcArgs(&aMsConfig.iVendorId, &aMsConfig.iProductId, &aMsConfig.iProductRev)); |
|
53 } |
|
54 |
|
55 /** |
|
56 @capability NetworkControl |
|
57 */ |
|
58 inline TInt RUsbMassStorage::Stop() |
|
59 { |
|
60 return SendReceive(EUsbMsStop); |
|
61 } |
|
62 |
|
63 /** |
|
64 @capability NetworkControl |
|
65 */ |
|
66 inline TInt RUsbMassStorage::Shutdown() |
|
67 { |
|
68 return SendReceive(EUsbMsShutdown); |
|
69 } |