le_wdog_interface.h

Go to the documentation of this file.
1 
2 
3 /*
4  * ====================== WARNING ======================
5  *
6  * THE CONTENTS OF THIS FILE HAVE BEEN AUTO-GENERATED.
7  * DO NOT MODIFY IN ANY WAY.
8  *
9  * ====================== WARNING ======================
10  */
11 
12 /**
13  * @page c_wdog Watchdog Service
14  *
15  * @ref le_wdog_interface.h "API Reference"
16  *
17  * <HR>
18  *
19  * Simple watchdog service.
20  *
21  * Provides a kickable watchdog with a timeout that can be configured in <c> .adef</c> or specified at run
22  * time. If a kick is not received within the specified time, the supervisor will be signalled
23  * to perform the action specified in WatchdogAction.
24  *
25  * <HR>
26  *
27  * Copyright (C) Sierra Wireless Inc.
28  */
29 /**
30  * @file le_wdog_interface.h
31  *
32  * Legato @ref c_wdog include file.
33  *
34  * Copyright (C) Sierra Wireless Inc.
35  */
36 /**
37  * Special values that have specific meaning when used as durations in Timeout():
38  * - @ref LE_WDOG_TIMEOUT_NEVER
39  * - @ref LE_WDOG_TIMEOUT_NOW
40  */
41 
42 #ifndef LE_WDOG_INTERFACE_H_INCLUDE_GUARD
43 #define LE_WDOG_INTERFACE_H_INCLUDE_GUARD
44 
45 
46 #include "legato.h"
47 
48 
49 //--------------------------------------------------------------------------------------------------
50 /**
51  * Type for handler called when a server disconnects.
52  */
53 //--------------------------------------------------------------------------------------------------
54 typedef void (*le_wdog_DisconnectHandler_t)(void *);
55 
56 //--------------------------------------------------------------------------------------------------
57 /**
58  *
59  * Connect the current client thread to the service providing this API. Block until the service is
60  * available.
61  *
62  * For each thread that wants to use this API, either ConnectService or TryConnectService must be
63  * called before any other functions in this API. Normally, ConnectService is automatically called
64  * for the main thread, but not for any other thread. For details, see @ref apiFilesC_client.
65  *
66  * This function is created automatically.
67  */
68 //--------------------------------------------------------------------------------------------------
70 (
71  void
72 );
73 
74 //--------------------------------------------------------------------------------------------------
75 /**
76  *
77  * Try to connect the current client thread to the service providing this API. Return with an error
78  * if the service is not available.
79  *
80  * For each thread that wants to use this API, either ConnectService or TryConnectService must be
81  * called before any other functions in this API. Normally, ConnectService is automatically called
82  * for the main thread, but not for any other thread. For details, see @ref apiFilesC_client.
83  *
84  * This function is created automatically.
85  *
86  * @return
87  * - LE_OK if the client connected successfully to the service.
88  * - LE_UNAVAILABLE if the server is not currently offering the service to which the client is
89  * bound.
90  * - LE_NOT_PERMITTED if the client interface is not bound to any service (doesn't have a binding).
91  * - LE_COMM_ERROR if the Service Directory cannot be reached.
92  */
93 //--------------------------------------------------------------------------------------------------
95 (
96  void
97 );
98 
99 //--------------------------------------------------------------------------------------------------
100 /**
101  * Set handler called when server disconnection is detected.
102  *
103  * When a server connection is lost, call this handler then exit with LE_FATAL. If a program wants
104  * to continue without exiting, it should call longjmp() from inside the handler.
105  */
106 //--------------------------------------------------------------------------------------------------
108 (
109  le_wdog_DisconnectHandler_t disconnectHandler,
110  void *contextPtr
111 );
112 
113 //--------------------------------------------------------------------------------------------------
114 /**
115  *
116  * Disconnect the current client thread from the service providing this API.
117  *
118  * Normally, this function doesn't need to be called. After this function is called, there's no
119  * longer a connection to the service, and the functions in this API can't be used. For details, see
120  * @ref apiFilesC_client.
121  *
122  * This function is created automatically.
123  */
124 //--------------------------------------------------------------------------------------------------
126 (
127  void
128 );
129 
130 
131 //--------------------------------------------------------------------------------------------------
132 /**
133  * Suspend the watchdog so that it never times out.
134  */
135 //--------------------------------------------------------------------------------------------------
136 #define LE_WDOG_TIMEOUT_NEVER -1
137 
138 //--------------------------------------------------------------------------------------------------
139 /**
140  * Timeout immediately
141  */
142 //--------------------------------------------------------------------------------------------------
143 #define LE_WDOG_TIMEOUT_NOW 0
144 
145 //--------------------------------------------------------------------------------------------------
146 /**
147  * Kicks the watchdog timer.
148  *
149  * Once the watchdog has been kicked it must be kicked again before the expiration of the current
150  * effective timeout else the configured WatchdogAction will be executed.
151  */
152 //--------------------------------------------------------------------------------------------------
153 void le_wdog_Kick
154 (
155  void
156 );
157 
158 //--------------------------------------------------------------------------------------------------
159 /**
160  * Set a time out.
161  *
162  * The watchdog is kicked and a new effective timeout value is set. The new timeout will be
163  * effective until the next kick at which point it will revert to the original value.
164  */
165 //--------------------------------------------------------------------------------------------------
166 void le_wdog_Timeout
167 (
168  int32_t milliseconds
169  ///< [IN] The number of milliseconds until this timer expires
170 );
171 
172 #endif // LE_WDOG_INTERFACE_H_INCLUDE_GUARD
le_result_t
Definition: le_basics.h:35
void(* le_wdog_DisconnectHandler_t)(void *)
Definition: le_wdog_interface.h:54
void le_wdog_Kick(void)
le_result_t le_wdog_TryConnectService(void)
void le_wdog_Timeout(int32_t milliseconds)
void le_wdog_DisconnectService(void)
void le_wdog_ConnectService(void)
void le_wdog_SetServerDisconnectHandler(le_wdog_DisconnectHandler_t disconnectHandler, void *contextPtr)