|
1 /* |
|
2 boot_reason_api.h |
|
3 |
|
4 Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
5 All rights reserved. |
|
6 |
|
7 This program and the accompanying materials are made available |
|
8 under the terms of the Eclipse Public License v1.0 which accompanies |
|
9 this distribution, and is available at |
|
10 http://www.eclipse.org/legal/epl-v10.html |
|
11 |
|
12 Initial Contributors: |
|
13 Nokia Corporation - initial contribution. |
|
14 |
|
15 Contributors: |
|
16 */ |
|
17 |
|
18 /** @file |
|
19 @brief Boot Reason API H file |
|
20 |
|
21 A header file for Boot Reason API. |
|
22 |
|
23 @publishedDeviceAbstraction |
|
24 */ |
|
25 |
|
26 #ifndef __BOOT_REASON_API_H__ |
|
27 #define __BOOT_REASON_API_H__ |
|
28 |
|
29 // Include files |
|
30 #include <e32def.h> |
|
31 |
|
32 // Constants |
|
33 |
|
34 // Macros |
|
35 |
|
36 // Data types |
|
37 |
|
38 // Function prototypes |
|
39 |
|
40 // Forward declarations |
|
41 |
|
42 // Class declaration |
|
43 |
|
44 /** |
|
45 @brief TBootReason class |
|
46 |
|
47 Execution: Synchronous |
|
48 Re-entrant: No |
|
49 Blocking: No |
|
50 Panic mode: Kern::Fault |
|
51 Memory allocation: No |
|
52 Execution time: Quick |
|
53 SMP safe: Yes |
|
54 |
|
55 @lib boot_reason_api.lib |
|
56 */ |
|
57 class TBootReason |
|
58 { |
|
59 public: |
|
60 enum TStartupMode |
|
61 { |
|
62 EStartupModeNone = 0, |
|
63 EStartupModeNormal, |
|
64 EStartupModeCharging, |
|
65 EStartupModeAlarm, |
|
66 EStartupModeTest, |
|
67 EStartupModeFota |
|
68 }; |
|
69 |
|
70 /** |
|
71 This function is used to read startup mode. |
|
72 |
|
73 @param aStartupMode On return contains one of the enumerated values. |
|
74 |
|
75 @return None. |
|
76 */ |
|
77 IMPORT_C static void GetStartupMode( TStartupMode& aStartupMode ); |
|
78 |
|
79 /** |
|
80 This function is used to write target startup mode. |
|
81 |
|
82 @param aTargetStartupMode Target startup mode. |
|
83 |
|
84 @return None. |
|
85 */ |
|
86 IMPORT_C static void SetTargetStartupMode( TStartupMode aTargetStartupMode ); |
|
87 |
|
88 /** |
|
89 This function is used to read target startup mode. |
|
90 |
|
91 @param aTargetStartupMode On return contains one of the enumerated values. |
|
92 |
|
93 @return None. |
|
94 */ |
|
95 IMPORT_C static void GetTargetStartupMode( TStartupMode& aTargetStartupMode ); |
|
96 |
|
97 /** |
|
98 This function is used to read a hidden reset status. |
|
99 |
|
100 This query should return ETrue if the system startup is caused by a SW reset |
|
101 (e.g. a critical SW failure). |
|
102 This query should return EFalse if the system startup is initiated by any |
|
103 other means (e.g. power key press or a wakeup alarm). |
|
104 |
|
105 @param None. |
|
106 |
|
107 @return ETrue / EFalse. |
|
108 |
|
109 */ |
|
110 IMPORT_C static TBool IsHiddenReset(); |
|
111 |
|
112 /** |
|
113 This function is used to write sleep test timeout value. |
|
114 |
|
115 @param aResetReasons Sleep test timeout value in milliseconds. The value |
|
116 must not be equal to zero. |
|
117 |
|
118 @return None. |
|
119 */ |
|
120 IMPORT_C static void SetSleepTest( TUint16 aTimeout ); |
|
121 }; |
|
122 |
|
123 #endif // __BOOT_REASON_API_H__ |