CCAux
2.7.2.0
CCAux API reference
Main Page
Namespaces
Data Structures
Files
File List
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
IncludeFiles
PowerMgr.h
Go to the documentation of this file.
1
/************************************************
2
*
3
* CROSSCONTROL AUX API
4
*
5
* PowerMgr.h
6
*
7
* Version 2.7.2.0, 2014-08-25
8
*
9
* (c) maximatecc 2013
10
*
11
* File description:
12
* Access functions for managing application shutdown/cleanup
13
* when suspend or shutdown events occur. An application can use this framework
14
* to delay a suspend/shutdown until it is ready with any tasks it needs to do.
15
* It is also possible to use existing OS functions to achieve the same result.
16
*
17
* Note that applications should not use these functions to delay a suspend/shutdown
18
* request for a long time (up to 20s may be okay). The computer will eventually
19
* be shut down forcibly if the application does not respond.
20
*
21
* This framework can be used with multiple applications at the same time.
22
* Note that a shutdown initiated by the OS may not be caught by this framework.
23
* Applications may need to handle that case with a separate exit handler.
24
*
25
* Example Usage:
26
* @include powermgr_example.cpp
27
*
28
************************************************/
29
30
#ifndef CC_POWERMGR_H_
31
#define CC_POWERMGR_H_
32
33
#include "
CCAuxErrors.h
"
34
#include "
CCAuxTypes.h
"
35
#include "
CCPlatform.h
"
36
37
#ifdef __cplusplus
38
namespace
CrossControl
39
{
40
#endif
41
45
typedef
enum
PowerMgrConf
46
{
52
Normal
= 0,
53
57
ApplicationControlled
= 1,
58
65
BatterySuspend
= 2
66
}
67
_PowerMgrConf
;
68
69
typedef
enum
PowerMgrStatus
70
{
74
NoRequestsPending
= 0,
78
SuspendPending
= 1,
82
ShutdownPending
= 2
83
}
84
_PowerMgrStatus
;
85
86
typedef
void
*
POWERMGRHANDLE
;
87
101
EXTERN_C
102
CCAUXDLL_API
103
POWERMGRHANDLE
104
CCAUXDLL_CALLING_CONV
105
GetPowerMgr
(
void
);
106
117
EXTERN_C
118
CCAUXDLL_API
119
void
120
CCAUXDLL_CALLING_CONV
121
PowerMgr_release
(
POWERMGRHANDLE
);
122
135
EXTERN_C
136
CCAUXDLL_API
137
eErr
138
CCAUXDLL_CALLING_CONV
139
PowerMgr_registerControlledSuspendOrShutDown
(
POWERMGRHANDLE
,
PowerMgrConf
conf);
140
153
EXTERN_C
154
CCAUXDLL_API
155
eErr
156
CCAUXDLL_CALLING_CONV
157
PowerMgr_getConfiguration
(
POWERMGRHANDLE
,
PowerMgrConf
* conf);
158
172
EXTERN_C
173
CCAUXDLL_API
174
eErr
175
CCAUXDLL_CALLING_CONV
176
PowerMgr_getPowerMgrStatus
(
POWERMGRHANDLE
,
PowerMgrStatus
* status);
177
189
EXTERN_C
190
CCAUXDLL_API
191
eErr
192
CCAUXDLL_CALLING_CONV
193
PowerMgr_setAppReadyForSuspendOrShutdown
(
POWERMGRHANDLE
);
194
207
EXTERN_C
208
CCAUXDLL_API
209
eErr
210
CCAUXDLL_CALLING_CONV
211
PowerMgr_hasResumed
(
POWERMGRHANDLE
,
bool
* resumed);
212
213
#ifdef __cplusplus
214
}
215
#endif
216
217
#endif
/* CC_POWERMGR_H_ */
218
219
Generated on Mon Aug 25 2014 17:48:49 for CCAux by
1.8.3.1