0
|
1 |
/*
|
|
2 |
* Copyright (c) 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 the License "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 |
* DMC Logical Device class declaration.
|
|
16 |
*
|
|
17 |
*/
|
|
18 |
|
|
19 |
|
|
20 |
#ifndef DMC_LOGICAL_DEVICE_H
|
|
21 |
#define DMC_LOGICAL_DEVICE_H
|
|
22 |
|
|
23 |
#ifndef DMC_INTERNAL_INCLUDE
|
|
24 |
#error Illegal usage of dmc_logical_device.h, It is only for DMC internal use !
|
|
25 |
#endif // DMC_INTERNAL_INCLUDE
|
|
26 |
|
|
27 |
// INCLUDES
|
|
28 |
#include <kernel.h> // DLogicalDevice
|
|
29 |
|
|
30 |
// CONSTANTS
|
|
31 |
// MACROS
|
|
32 |
// DATA TYPES
|
|
33 |
// EXTERNAL DATA STRUCTURES
|
|
34 |
// FUNCTION PROTOTYPES
|
|
35 |
// FORWARD DECLARATIONS
|
|
36 |
// CLASS DEFINITIONS
|
|
37 |
|
|
38 |
|
|
39 |
/**
|
|
40 |
* DDmcLogicalDevice
|
|
41 |
*/
|
|
42 |
NONSHARABLE_CLASS(DDmcLogicalDevice) : public DLogicalDevice
|
|
43 |
{
|
|
44 |
public:
|
|
45 |
/**
|
|
46 |
* C++ default constructor.
|
|
47 |
*/
|
|
48 |
DDmcLogicalDevice();
|
|
49 |
|
|
50 |
/**
|
|
51 |
* C++ default destructor.
|
|
52 |
*/
|
|
53 |
~DDmcLogicalDevice();
|
|
54 |
|
|
55 |
public: // from DLogicalDevice
|
|
56 |
/**
|
|
57 |
* Second stage constructor, completes the installation
|
|
58 |
* of this the device.
|
|
59 |
*
|
|
60 |
* @param None
|
|
61 |
* @return KErrNone or standard error code
|
|
62 |
*/
|
|
63 |
TInt Install();
|
|
64 |
|
|
65 |
/**
|
|
66 |
* Returns device capabilities.
|
|
67 |
* @param aDes, On return, contains information describing the capabilities
|
|
68 |
* of the device.
|
|
69 |
* @return none
|
|
70 |
*/
|
|
71 |
void GetCaps(TDes8& aDes) const;
|
|
72 |
|
|
73 |
/**
|
|
74 |
* Creates a logical channel
|
|
75 |
*
|
|
76 |
* @param aChannel, Set to point to the created Logical Channel.
|
|
77 |
* @return KErrNone or standard error code
|
|
78 |
*/
|
|
79 |
TInt Create(DLogicalChannelBase*& aChannel);
|
|
80 |
|
|
81 |
public: // New functions
|
|
82 |
/**
|
|
83 |
* Returns a target startup mode in which a device is started.
|
|
84 |
*
|
|
85 |
* @param &aTargetStartUpmode A reference in which a target startup mode
|
|
86 |
* is written.
|
|
87 |
* @return KErrNone or one of the system wide error
|
|
88 |
*/
|
|
89 |
TInt GetTargetStartUpMode(RDmc::TTargetStartupMode &aTargetStartUpmode) const;
|
|
90 |
|
|
91 |
/**
|
|
92 |
* Generates a reset.
|
|
93 |
*
|
|
94 |
* @param aTargetStartUpmode A mode in which a device is reset.
|
|
95 |
* @return KErrNone or KErrLocked
|
|
96 |
*/
|
|
97 |
TInt GenerateReset(const RDmc::TTargetStartupMode aTargetStartUpmode) const;
|
|
98 |
|
|
99 |
/**
|
|
100 |
* Power OFF the device
|
|
101 |
*
|
|
102 |
* @param None
|
|
103 |
* @return KErrNone or KErrLocked
|
|
104 |
*/
|
|
105 |
TInt PowerOff() const;
|
|
106 |
|
|
107 |
/**
|
|
108 |
* Power OFF the device
|
|
109 |
*
|
|
110 |
* @param aHiddenStatus ETrue if the reset is hidden, otherwise EFalse.
|
|
111 |
* @return KErrNone or one of the system wide error
|
|
112 |
*/
|
|
113 |
TInt IsHiddenReset(TBool& aHiddenStatus) const;
|
|
114 |
|
|
115 |
/**
|
|
116 |
* Subscribe events
|
|
117 |
*
|
|
118 |
* Subscribes modem or PC SW orginated reset and power off events.
|
|
119 |
*
|
|
120 |
* @param aLogChnlPtr Pointer to logical channel.
|
|
121 |
* @return None
|
|
122 |
*/
|
|
123 |
void SubscribeEvents(const DDmcLogicalChannel* const aLogChnlPtr);
|
|
124 |
|
|
125 |
/**
|
|
126 |
* Unsubscribe events
|
|
127 |
*
|
|
128 |
* Unsubscribe power off and reset events.
|
|
129 |
*
|
|
130 |
* @param aLogChnlPtr Pointer to logical channel.
|
|
131 |
* @return None
|
|
132 |
*/
|
|
133 |
void UnsubscribeEvents(const DDmcLogicalChannel* const aLogChnlPtr);
|
|
134 |
|
|
135 |
/**
|
|
136 |
* Returs a pointer to iDmcLogDeviceDfcQueuePtr;
|
|
137 |
*
|
|
138 |
* @param None
|
|
139 |
* @return TDynamicDfcQue* A pointer to the DMC Logical Device owned
|
|
140 |
* dynamic dfc queue.
|
|
141 |
*/
|
|
142 |
TDynamicDfcQue* GetDynamicDfcQueue() const;
|
|
143 |
|
|
144 |
private: // New functions
|
|
145 |
/**
|
|
146 |
* Dfc function for receiving events.
|
|
147 |
*
|
|
148 |
* @param aPtr Pointer to DDmc logical deveice object.
|
|
149 |
* @return None
|
|
150 |
*/
|
|
151 |
static void ReceiveEventsDfc(TAny* Ptr);
|
|
152 |
|
|
153 |
private: // Data members
|
|
154 |
/**
|
|
155 |
* A pointer table to a DMC logical channels,
|
|
156 |
* needed for delivering events to a user side clients.
|
|
157 |
*/
|
|
158 |
RPointerArray <DDmcLogicalChannel> iLogChannelsPtr;
|
|
159 |
|
|
160 |
/**
|
|
161 |
* A pointer to a dynamic dfc queue owned by the DMC logical device.
|
|
162 |
*/
|
|
163 |
TDynamicDfcQue* iDmcLogDeviceDfcQueuePtr;
|
|
164 |
|
|
165 |
/**
|
|
166 |
* A pointer to DMC user / kernel Dfc-queue.
|
|
167 |
* This class owns this pointer.
|
|
168 |
*
|
|
169 |
*/
|
|
170 |
TDfc* iUserEventDfcPtr;
|
|
171 |
};
|
|
172 |
|
|
173 |
#endif // DMC_LOGICAL_DEVICE_H
|
|
174 |
|
|
175 |
// End of File
|