LibJuno 1.0.1
LibJuno is a lightweight C11 library designed specifically for embedded systems.
Loading...
Searching...
No Matches
engine_app.h
Go to the documentation of this file.
1/*
2 MIT License
3
4 Copyright (c) 2025 Robin A. Onsay
5
6 Permission is hereby granted, free of charge, to any person obtaining
7 a copy of this software and associated documentation files
8 (the "Software"), to deal in the Software without restriction,
9 including without limitation the rights to use, copy, modify, merge,
10 publish, distribute, sublicense, and/or sell copies of the Software,
11 and to permit persons to whom the Software is furnished to do so,
12 subject to the following conditions:
13
14 The above copyright notice and this permission notice shall be
15 included in all copies or substantial portions of the Software.
16*/
17
27#ifndef ENGINE_APP_API_H
28#define ENGINE_APP_API_H
29#include "juno/log/log_api.h"
30#include "juno/sb/broker_api.h"
31#include "juno/status.h"
32#include "juno/module.h"
33#include "juno/app/app_api.h"
35#include "juno/time/time_api.h"
36#ifdef __cplusplus
37extern "C"
38{
39#endif
40
80typedef struct ENGINE_APP_TAG ENGINE_APP_T;
81#define ENGINE_CMD_MSG_PIPE_DEPTH (1)
82
83struct ENGINE_APP_TAG JUNO_MODULE_DERIVE(JUNO_APP_ROOT_T,
84 const JUNO_LOG_ROOT_T *ptLogger;
85 const JUNO_TIME_ROOT_T *ptTime;
86 JUNO_SB_BROKER_ROOT_T *ptBroker;
88 ENGINE_CMD_MSG_ARRAY_T tCmdArray;
89 JUNO_SB_PIPE_T tCmdPipe;
90 float fCurrentRpm;
91);
92
99JUNO_STATUS_T EngineApp_Init(ENGINE_APP_T *ptEngineApp, const JUNO_LOG_ROOT_T *ptLogger, const JUNO_TIME_ROOT_T *ptTime, JUNO_SB_BROKER_ROOT_T *ptBroker, JUNO_FAILURE_HANDLER_T pfcnFailureHandler, JUNO_USER_DATA_T *pvUserData);
101#ifdef __cplusplus
102}
103#endif
104#endif // ENGINE_APP_API_H
Application module API (start/process/exit lifecycle).
struct JUNO_APP_ROOT_TAG JUNO_APP_ROOT_T
The application module.
Definition app_api.h:50
Software Bus (SB) broker for single-threaded message fan-out.
struct JUNO_SB_BROKER_ROOT_TAG JUNO_SB_BROKER_ROOT_T
Definition broker_api.h:65
struct JUNO_SB_PIPE_TAG JUNO_SB_PIPE_T
Definition broker_api.h:67
#define ENGINE_CMD_MSG_PIPE_DEPTH
Definition engine_app.h:81
JUNO_STATUS_T EngineApp_Init(ENGINE_APP_T *ptEngineApp, const JUNO_LOG_ROOT_T *ptLogger, const JUNO_TIME_ROOT_T *ptTime, JUNO_SB_BROKER_ROOT_T *ptBroker, JUNO_FAILURE_HANDLER_T pfcnFailureHandler, JUNO_USER_DATA_T *pvUserData)
Definition engine_app.c:106
struct ENGINE_APP_TAG ENGINE_APP_T
Definition engine_app.h:80
#define JUNO_MODULE_DERIVE(ROOT_T,...)
Implement a derived module embedding the root as the first member.
Definition module.h:157
void(* JUNO_FAILURE_HANDLER_T)(JUNO_STATUS_T tStatus, const char *pcCustomMessage, JUNO_USER_DATA_T *pvUserData)
Failure handler callback signature.
Definition status.h:104
int32_t JUNO_STATUS_T
Canonical status type for LibJuno functions.
Definition status.h:49
void JUNO_USER_DATA_T
Opaque user data type for failure callbacks.
Definition status.h:96
struct JUNO_TIME_ROOT_TAG JUNO_TIME_ROOT_T
Definition time_api.h:69
Minimal logging facade for embedded targets.
struct JUNO_LOG_ROOT_TAG JUNO_LOG_ROOT_T
Definition log_api.h:49
Module system and dependency injection primitives for LibJuno.
Status codes and failure-handling helpers for LibJuno.
Definition engine_cmd_msg.h:53
Juno Time module API and common time math helpers.