1 /* |
1 /* |
2 * Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). |
2 * Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies). |
3 * All rights reserved. |
3 * All rights reserved. |
4 * This component and the accompanying materials are made available |
4 * This component and the accompanying materials are made available |
5 * under the terms of "Eclipse Public License v1.0" |
5 * under the terms of "Eclipse Public License v1.0" |
6 * which accompanies this distribution, and is available |
6 * which accompanies this distribution, and is available |
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
16 */ |
16 */ |
17 |
17 |
18 #ifndef __DUMMY_LDD_H__ |
18 #ifndef __DUMMY_LDD_H__ |
19 #define __DUMMY_LDD_H__ |
19 #define __DUMMY_LDD_H__ |
20 |
20 |
|
21 #ifdef SYMBIAN_USB_BATTERYCHARGING_V1_1 |
|
22 #include <usb/usb_charger_detection_shai_shared.h> |
|
23 #endif |
|
24 |
21 static const TInt KDummyConfigDescSize = 9; |
25 static const TInt KDummyConfigDescSize = 9; |
|
26 |
|
27 #ifdef SYMBIAN_USB_BATTERYCHARGING_V1_1 |
|
28 typedef UsbShai::TPortType TUsbcChargingPortType; |
|
29 typedef UsbShai::TChargerDetectorProperties TUsbcChargerDetectorProperties; |
|
30 const TUint KUsbChargingPortTypeNone = UsbShai::EPortTypeNone; |
|
31 const TUint KUsbChargingPortTypeUnsupported = UsbShai::EPortTypeUnsupported; |
|
32 const TUint KUsbChargingPortTypeChargingPort = UsbShai::EPortTypeChargingPort; |
|
33 const TUint KUsbChargingPortTypeDedicatedChargingPort = UsbShai::EPortTypeDedicatedChargingPort; |
|
34 const TUint KUsbChargingPortTypeChargingDownstreamPort = UsbShai::EPortTypeChargingDownstreamPort; |
|
35 const TUint KUsbChargingPortTypeStandardDownstreamPort = UsbShai::EPortTypeStandardDownstreamPort; |
|
36 const TUint KUsbChargingPortTypeAcaRidA = UsbShai::EPortTypeAcaRidA; |
|
37 const TUint KUsbChargingPortTypeAcaRidB = UsbShai::EPortTypeAcaRidB; |
|
38 const TUint KUsbChargingPortTypeAcaRidC = UsbShai::EPortTypeAcaRidC; |
|
39 |
|
40 const TUint KChargerDetectorCapChirpCurrentLimiting = UsbShai::TChargerDetectorProperties::KChargerDetectorCapChirpCurrentLimiting; |
|
41 #endif |
22 |
42 |
23 /****** |
43 /****** |
24 * NOTE: This dummy implementation of RDevUsbcClient is actually a C-class!!!!!! |
44 * NOTE: This dummy implementation of RDevUsbcClient is actually a C-class!!!!!! |
25 */ |
45 */ |
26 class RDevUsbcClient |
46 class RDevUsbcClient |
30 inline TInt GetConfigurationDescriptor(TDes8& aConfigurationDescriptor); |
50 inline TInt GetConfigurationDescriptor(TDes8& aConfigurationDescriptor); |
31 inline TInt SetConfigurationDescriptor(const TDesC8& aConfigurationDescriptor); |
51 inline TInt SetConfigurationDescriptor(const TDesC8& aConfigurationDescriptor); |
32 inline TInt GetConfigurationDescriptorSize(TInt& aSize); |
52 inline TInt GetConfigurationDescriptorSize(TInt& aSize); |
33 inline void ReEnumerate(TRequestStatus& aStatus); |
53 inline void ReEnumerate(TRequestStatus& aStatus); |
34 inline void ReEnumerateCancel(); |
54 inline void ReEnumerateCancel(); |
|
55 inline TBool CurrentlyUsingHighSpeed(); |
35 |
56 |
36 // used to initialise config desc. |
57 // used to initialise config desc. |
37 inline void Initialise(); |
58 inline void Initialise(); |
|
59 inline void SetCurrentlyUsingHighSpeed(TBool aUsingHighSpeed); |
|
60 #ifdef SYMBIAN_USB_BATTERYCHARGING_V1_1 |
|
61 inline TInt ChargerDetectorCaps(TUsbcChargerDetectorProperties& aProperties); |
|
62 inline void SetChargerDetectorCaps(TUsbcChargerDetectorProperties aProperties); |
|
63 #endif |
|
64 |
38 private: |
65 private: |
39 TBuf8<KDummyConfigDescSize> iConfigDesc; |
66 TBuf8<KDummyConfigDescSize> iConfigDesc; |
|
67 TBool iUsingHighSpeed; |
|
68 #ifdef SYMBIAN_USB_BATTERYCHARGING_V1_1 |
|
69 TUsbcChargerDetectorProperties iChargerDetectorCaps; |
|
70 #endif |
40 }; |
71 }; |
41 |
72 |
42 inline TInt RDevUsbcClient::GetConfigurationDescriptor(TDes8& aConfigurationDescriptor) |
73 inline TInt RDevUsbcClient::GetConfigurationDescriptor(TDes8& aConfigurationDescriptor) |
43 { |
74 { |
44 // 8th byte is bMaxPower |
75 // 8th byte is bMaxPower |
75 inline void RDevUsbcClient::Initialise() |
106 inline void RDevUsbcClient::Initialise() |
76 { |
107 { |
77 iConfigDesc.FillZ(KDummyConfigDescSize); |
108 iConfigDesc.FillZ(KDummyConfigDescSize); |
78 // 8th byte is bMaxPower |
109 // 8th byte is bMaxPower |
79 iConfigDesc[8] = 0; |
110 iConfigDesc[8] = 0; |
|
111 iUsingHighSpeed = EFalse; |
80 } |
112 } |
|
113 inline TBool RDevUsbcClient::CurrentlyUsingHighSpeed() |
|
114 { |
|
115 return iUsingHighSpeed; |
|
116 } |
|
117 |
|
118 inline void RDevUsbcClient::SetCurrentlyUsingHighSpeed(TBool aUsingHighSpeed) |
|
119 { |
|
120 iUsingHighSpeed = aUsingHighSpeed; |
|
121 } |
|
122 |
|
123 #ifdef SYMBIAN_USB_BATTERYCHARGING_V1_1 |
|
124 inline TInt RDevUsbcClient::ChargerDetectorCaps(TUsbcChargerDetectorProperties& aProperties) |
|
125 { |
|
126 aProperties = iChargerDetectorCaps; |
|
127 return KErrNone; |
|
128 } |
|
129 |
|
130 inline void RDevUsbcClient::SetChargerDetectorCaps(TUsbcChargerDetectorProperties aProperties) |
|
131 { |
|
132 iChargerDetectorCaps = aProperties; |
|
133 } |
|
134 #endif |
81 |
135 |
82 #endif // __DUMMY_LDD_H__ |
136 #endif // __DUMMY_LDD_H__ |