|
1 /* |
|
2 * Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef __DUMMY_LDD_H__ |
|
19 #define __DUMMY_LDD_H__ |
|
20 |
|
21 static const TInt KDummyConfigDescSize = 9; |
|
22 |
|
23 /****** |
|
24 * NOTE: This dummy implementation of RDevUsbcClient is actually a C-class!!!!!! |
|
25 */ |
|
26 class RDevUsbcClient |
|
27 { |
|
28 public: |
|
29 // functions needed by charging plugin |
|
30 inline TInt GetConfigurationDescriptor(TDes8& aConfigurationDescriptor); |
|
31 inline TInt SetConfigurationDescriptor(const TDesC8& aConfigurationDescriptor); |
|
32 inline TInt GetConfigurationDescriptorSize(TInt& aSize); |
|
33 inline void ReEnumerate(TRequestStatus& aStatus); |
|
34 inline void ReEnumerateCancel(); |
|
35 |
|
36 // used to initialise config desc. |
|
37 inline void Initialise(); |
|
38 private: |
|
39 TBuf8<KDummyConfigDescSize> iConfigDesc; |
|
40 }; |
|
41 |
|
42 inline TInt RDevUsbcClient::GetConfigurationDescriptor(TDes8& aConfigurationDescriptor) |
|
43 { |
|
44 // 8th byte is bMaxPower |
|
45 aConfigurationDescriptor.Copy(iConfigDesc);//[8] = iConfigDesc[8]; |
|
46 return KErrNone; |
|
47 } |
|
48 |
|
49 inline TInt RDevUsbcClient::SetConfigurationDescriptor(const TDesC8& aConfigurationDescriptor) |
|
50 { |
|
51 // 8th byte is bMaxPower |
|
52 iConfigDesc[8] = aConfigurationDescriptor[8]; |
|
53 return KErrNone; |
|
54 } |
|
55 |
|
56 inline TInt RDevUsbcClient::GetConfigurationDescriptorSize(TInt& aSize) |
|
57 { |
|
58 aSize = KDummyConfigDescSize; |
|
59 return KErrNone; |
|
60 } |
|
61 |
|
62 inline void RDevUsbcClient::ReEnumerate(TRequestStatus& aStatus) |
|
63 { |
|
64 // just complete "synchronously". The plugin takes no notice of when this completes |
|
65 // so we don't need to fake it ever failing |
|
66 TRequestStatus* status = &aStatus; |
|
67 User::RequestComplete(status, KErrNone); |
|
68 } |
|
69 |
|
70 inline void RDevUsbcClient::ReEnumerateCancel() |
|
71 { |
|
72 // nothing to do, as ReEnumerate always completes "synchronously". |
|
73 } |
|
74 |
|
75 inline void RDevUsbcClient::Initialise() |
|
76 { |
|
77 iConfigDesc.FillZ(KDummyConfigDescSize); |
|
78 // 8th byte is bMaxPower |
|
79 iConfigDesc[8] = 0; |
|
80 } |
|
81 |
|
82 #endif // __DUMMY_LDD_H__ |