le_bootReason_interface.h

Go to the documentation of this file.
1 /*
2  * ====================== WARNING ======================
3  *
4  * THE CONTENTS OF THIS FILE HAVE BEEN AUTO-GENERATED.
5  * DO NOT MODIFY IN ANY WAY.
6  *
7  * ====================== WARNING ======================
8  */
9 
10 /**
11  * @page c_bootReason Boot Reason Query
12  *
13  * @ref le_bootReason_interface.h "API Reference"
14  *
15  * <HR>
16  *
17  * This API can be used to determine the reason for the last OS boot when using @ref c_ulpm
18  * (e.g., power on due to pre-configured time setty or GPIO toggled externally).
19  *
20  * Boot may occur due to exit from ultra low power mode or press on Power button. Exit from low
21  * power state may occur through various sources (e.g., GPIO pins or timers that are specific to the
22  * device hardware).
23  *
24  * @section bootReason_example Sample Code
25  *
26  * This C code sample sows an API calling sequence to get boot-reason:
27  *
28  * @code
29  *
30  * void CheckMDMBootReason
31  * (
32  * void
33  * )
34  * {
35  * if (le_bootReason_WasTimer())
36  * {
37  * LE_INFO("Timer boot");
38  * }
39  * else if (le_bootReason_WasGpio(<gpioNum>))
40  * {
41  * LE_INFO("GPIO<gpioNum> boot");
42  * }
43  * else
44  * {
45  * LE_INFO("Power-on");
46  * }
47  * }
48  *
49  * @endcode
50  *
51  * <HR>
52  *
53  * Copyright (C) Sierra Wireless Inc. Use of this work is subject to license.
54  */
55 /**
56  * @file le_bootReason_interface.h
57  *
58  * Legato @ref c_bootReason include file.
59  *
60  * Copyright (C) Sierra Wireless Inc. Use of this work is subject to license.
61  */
62 
63 #ifndef LE_BOOTREASON_INTERFACE_H_INCLUDE_GUARD
64 #define LE_BOOTREASON_INTERFACE_H_INCLUDE_GUARD
65 
66 
67 #include "legato.h"
68 
69 //--------------------------------------------------------------------------------------------------
70 /**
71  *
72  * Connect the current client thread to the service providing this API. Block until the service is
73  * available.
74  *
75  * For each thread that wants to use this API, either ConnectService or TryConnectService must be
76  * called before any other functions in this API. Normally, ConnectService is automatically called
77  * for the main thread, but not for any other thread. For details, see @ref apiFilesC_client.
78  *
79  * This function is created automatically.
80  */
81 //--------------------------------------------------------------------------------------------------
83 (
84  void
85 );
86 
87 //--------------------------------------------------------------------------------------------------
88 /**
89  *
90  * Try to connect the current client thread to the service providing this API. Return with an error
91  * if the service is not available.
92  *
93  * For each thread that wants to use this API, either ConnectService or TryConnectService must be
94  * called before any other functions in this API. Normally, ConnectService is automatically called
95  * for the main thread, but not for any other thread. For details, see @ref apiFilesC_client.
96  *
97  * This function is created automatically.
98  *
99  * @return
100  * - LE_OK if the client connected successfully to the service.
101  * - LE_UNAVAILABLE if the server is not currently offering the service to which the client is bound.
102  * - LE_NOT_PERMITTED if the client interface is not bound to any service (doesn't have a binding).
103  * - LE_COMM_ERROR if the Service Directory cannot be reached.
104  */
105 //--------------------------------------------------------------------------------------------------
107 (
108  void
109 );
110 
111 //--------------------------------------------------------------------------------------------------
112 /**
113  *
114  * Disconnect the current client thread from the service providing this API.
115  *
116  * Normally, this function doesn't need to be called. After this function is called, there's no
117  * longer a connection to the service, and the functions in this API can't be used. For details, see
118  * @ref apiFilesC_client.
119  *
120  * This function is created automatically.
121  */
122 //--------------------------------------------------------------------------------------------------
124 (
125  void
126 );
127 
128 //--------------------------------------------------------------------------------------------------
129 /**
130  * Checks whether boot-reason was timer expiry.
131  *
132  * @return
133  * - TRUE if boot-reason was timer expiry.
134  * - FALSE otherwise.
135  */
136 //--------------------------------------------------------------------------------------------------
138 (
139  void
140 );
141 
142 //--------------------------------------------------------------------------------------------------
143 /**
144  * Checks whether boot-reason was specific gpio change. GPIO number is specified in parameter.
145  *
146  * @return
147  * - TRUE if boot-reason was specified gpio change.
148  * - FALSE otherwise.
149  *
150  * @note The process exits if invalid gpio number is passed. Check corresponding device documents
151  * for valid list of gpio.
152  */
153 //--------------------------------------------------------------------------------------------------
155 (
156  uint32_t gpioNum
157  ///< [IN] GPIO number.
158 );
159 
160 
161 #endif // LE_BOOTREASON_INTERFACE_H_INCLUDE_GUARD
162 
le_result_t
Definition: le_basics.h:35
le_result_t le_bootReason_TryConnectService(void)
bool le_bootReason_WasGpio(uint32_t gpioNum)
bool le_bootReason_WasTimer(void)
void le_bootReason_ConnectService(void)
void le_bootReason_DisconnectService(void)