Safe API Framework 0.1.0 build 384e6ae
Layered API framework for safety-related applications (ERTMS RBC reference targeting CENELEC EN 50128 SIL 4)
Loading...
Searching...
No Matches
rte_watchdog.h
Go to the documentation of this file.
1
16
17#ifndef RTE_WATCHDOG_H
18#define RTE_WATCHDOG_H
19
22
23#ifdef __cplusplus
24extern "C" {
25#endif
26
27/* ============================================================================
28 * Types & Constants
29 * ========================================================================== */
30
34typedef struct rte_watchdog_s *rte_watchdog_t;
35
47
69
87
101
102/* ============================================================================
103 * API: Core Watchdog Operations
104 * ========================================================================== */
105
134rte_status_t rte_watchdog_create(rte_watchdog_t *handle_out,
135 const rte_watchdog_config_t *config);
136
161rte_status_t rte_watchdog_start(rte_watchdog_t watchdog);
162
177rte_status_t rte_watchdog_stop(rte_watchdog_t watchdog);
178
213rte_status_t rte_watchdog_kick(rte_watchdog_t watchdog);
214
247rte_status_t rte_watchdog_get_status(rte_watchdog_t watchdog,
248 rte_watchdog_status_t *status_out);
249
263rte_status_t rte_watchdog_destroy(rte_watchdog_t watchdog);
264
265/* ============================================================================
266 * API: Watchdog Manager (Global)
267 * ========================================================================== */
268
282
296
297/* ============================================================================
298 * Watchdog Timeout Callback (Invoked by Framework)
299 * ========================================================================== */
300
316void rte_watchdog_timeout_handler(uint32_t watchdog_id);
317
346void rte_watchdog_timer_tick(void);
347
348#ifdef __cplusplus
349}
350#endif
351
352#endif /* RTE_WATCHDOG_H */
353 /* WATCHDOG */
rte_status_t
Common result/status codes.
Definition rte_status.h:27
uint32_t rte_duration_ms_t
Definition rte_types.h:27
rte_status_t rte_watchdog_start(rte_watchdog_t watchdog)
Start watchdog timer.
rte_status_t rte_watchdog_manager_shutdown(void)
Shutdown watchdog manager (call once at shutdown).
void rte_watchdog_timeout_handler(uint32_t watchdog_id)
Watchdog timeout handler (INTERNAL - called by framework).
rte_watchdog_type_t
Watchdog type.
rte_status_t rte_watchdog_kick(rte_watchdog_t watchdog)
Kick (pet) watchdog - prove liveness.
rte_status_t rte_watchdog_destroy(rte_watchdog_t watchdog)
Destroy watchdog.
rte_status_t rte_watchdog_manager_initialize(void)
Initialize watchdog manager (call once at startup).
rte_watchdog_action_t
Recovery action when watchdog fires.
rte_status_t rte_watchdog_get_status(rte_watchdog_t watchdog, rte_watchdog_status_t *status_out)
Get watchdog status.
rte_status_t rte_watchdog_stop(rte_watchdog_t watchdog)
Stop watchdog timer.
void rte_watchdog_timer_tick(void)
Poll all active watchdogs for expiry (call periodically).
rte_status_t rte_watchdog_create(rte_watchdog_t *handle_out, const rte_watchdog_config_t *config)
Create a watchdog.
@ RTE_WATCHDOG_SYSTEM
@ RTE_WATCHDOG_CHANNEL
@ RTE_WATCHDOG_CHECKPOINT
@ RTE_WATCHDOG_TASK
@ RTE_WATCHDOG_ACTION_REBOOT
@ RTE_WATCHDOG_ACTION_SAFESTATE
@ RTE_WATCHDOG_ACTION_LOG
@ RTE_WATCHDOG_ACTION_FAILOVER
@ RTE_WATCHDOG_ACTION_CUSTOM
Common status/error codes returned by every Safe API Framework function. Shared across all OS Abstrac...
Common fixed-width types and the caller-owned-storage handle pattern used by every OAL service (see A...
Watchdog configuration.
rte_duration_ms_t timeout_ms
rte_watchdog_type_t type
rte_watchdog_action_t action
void(*) custom_action(void *ctx)
Watchdog handle (opaque).
Watchdog health/status information.
rte_duration_ms_t time_since_last_kick
rte_duration_ms_t time_until_fire