LibJuno 1.0.1
LibJuno is a lightweight C11 library designed specifically for embedded systems.
Loading...
Searching...
No Matches
engine_tlm_msg.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
18#ifndef ENGINE_TLM_MSG_H
19#define ENGINE_TLM_MSG_H
20#include "juno/ds/array_api.h"
22#include "juno/module.h"
23#include "juno/sb/broker_api.h"
24#include "juno/status.h"
25#include "juno/time/time_api.h"
26
27#ifdef __cplusplus
28extern "C" {
29#endif
30
31#define ENGINE_TLM_MSG_MID (1)
32
33typedef struct ENGINE_TLM_MSG_TAG
34{
35 //TODO: Replace me:
36 float fRpm;
39
40typedef struct ENGINE_TLM_MSG_ARRAY_TAG JUNO_MODULE_DERIVE(JUNO_DS_ARRAY_ROOT_T,
41 ENGINE_TLM_MSG_T *ptArrEngineTlmMsgBuffer;
42) ENGINE_TLM_MSG_ARRAY_T;
43
45
46#define EngineTlmMsg_PointerInit(addr) JunoMemory_PointerInit(&gtEngineTlmMsgPointerApi, ENGINE_TLM_MSG_T, addr)
47#define EngineTlmMsg_PointerVerify(tPointer) JunoMemory_PointerVerifyType(tPointer, ENGINE_TLM_MSG_T, gtEngineTlmMsgPointerApi)
48JUNO_STATUS_T EngineTlmMsg_ArrayInit(ENGINE_TLM_MSG_ARRAY_T *ptEngineTlmMsgPipe, ENGINE_TLM_MSG_T *ptArrEngineTlmMsgBuffer, size_t iCapacity, JUNO_FAILURE_HANDLER_T pfcnFailureHdlr, JUNO_USER_DATA_T *pvUserData);
49
50#ifdef __cplusplus
51}
52#endif
53#endif
54
Abstract fixed-capacity array interface for DS modules.
struct JUNO_DS_ARRAY_ROOT_TAG JUNO_DS_ARRAY_ROOT_T
Opaque array root carrying capacity and API pointer.
Definition array_api.h:58
Software Bus (SB) broker for single-threaded message fan-out.
const JUNO_POINTER_API_T gtEngineTlmMsgPointerApi
Definition engine_tlm_msg.c:35
JUNO_STATUS_T EngineTlmMsg_ArrayInit(ENGINE_TLM_MSG_ARRAY_T *ptEngineTlmMsgPipe, ENGINE_TLM_MSG_T *ptArrEngineTlmMsgBuffer, size_t iCapacity, JUNO_FAILURE_HANDLER_T pfcnFailureHdlr, JUNO_USER_DATA_T *pvUserData)
Definition engine_tlm_msg.c:74
struct ENGINE_TLM_MSG_TAG ENGINE_TLM_MSG_T
#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
Module system and dependency injection primitives for LibJuno.
Pointer trait and helpers for memory operations.
Status codes and failure-handling helpers for LibJuno.
Definition engine_tlm_msg.h:34
JUNO_TIMESTAMP_T tTimestamp
Definition engine_tlm_msg.h:37
float fRpm
Definition engine_tlm_msg.h:36
Pointer operations API (copy/reset).
Definition pointer_api.h:74
Timestamp consisting of whole seconds and fixed-point subseconds.
Definition time_api.h:105
Juno Time module API and common time math helpers.