LibJuno 1.0.4
LibJuno is a lightweight C11 library designed specifically for embedded systems.
Loading...
Searching...
No Matches
udp_msg_api.h File Reference

Message API infrastructure for the udp-threads example. More...

Include dependency graph for udp_msg_api.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define UDPTH_PIPE_CAPACITY   8u
 
#define UDPTH_MSG_MID   ((JUNO_SB_MID_T)1u)
 
#define UdpThreadMsg_PointerInit(addr)    JunoMemory_PointerInit(&g_udpThreadMsgPointerApi, UDP_THREAD_MSG_T, (addr))
 Convenience macro to initialise a JUNO_POINTER_T for a UDP_THREAD_MSG_T.
 

Typedefs

typedef struct UDPTH_MSG_ARRAY_TAG UDPTH_MSG_ARRAY_T
 

Functions

struct UDPTH_MSG_ARRAY_TAG JUNO_MODULE_DERIVE (JUNO_DS_ARRAY_ROOT_T, UDP_THREAD_MSG_T atBuffer[UDPTH_PIPE_CAPACITY];)
 Concrete array type for the MonitorApp and ProcessorApp pipe queues.
 
static JUNO_STATUS_T UdpThreadMsgArray_Init (UDPTH_MSG_ARRAY_T *ptArr, JUNO_FAILURE_HANDLER_T pfcnHandler, JUNO_USER_DATA_T *pvUserData)
 Initialise a UDPTH_MSG_ARRAY_T with the shared array API.
 

Variables

const JUNO_POINTER_API_T g_udpThreadMsgPointerApi
 Pointer API for UDP_THREAD_MSG_T — used with JunoMemory_PointerInit.
 
const JUNO_DS_ARRAY_API_T g_udpThreadMsgArrayApi
 Array API for UDPTH_MSG_ARRAY_T — used with JunoDs_ArrayInit.
 

Detailed Description

Message API infrastructure for the udp-threads example.

Provides the pointer API and array API for UDP_THREAD_MSG_T, along with the concrete UDPTH_MSG_ARRAY_T type used as backing storage for pipe queues in MonitorApp and ProcessorApp. Also defines the shared message ID constant.

Macro Definition Documentation

◆ UDPTH_MSG_MID

#define UDPTH_MSG_MID   ((JUNO_SB_MID_T)1u)

Message ID used by all four apps on the software bus.

◆ UDPTH_PIPE_CAPACITY

#define UDPTH_PIPE_CAPACITY   8u

Number of messages the pipe queue can buffer.

◆ UdpThreadMsg_PointerInit

#define UdpThreadMsg_PointerInit (   addr)     JunoMemory_PointerInit(&g_udpThreadMsgPointerApi, UDP_THREAD_MSG_T, (addr))

Convenience macro to initialise a JUNO_POINTER_T for a UDP_THREAD_MSG_T.

Parameters
addrAddress of the UDP_THREAD_MSG_T instance.
Returns
A populated JUNO_POINTER_T describing the location, size, and alignment.

Typedef Documentation

◆ UDPTH_MSG_ARRAY_T

typedef struct UDPTH_MSG_ARRAY_TAG UDPTH_MSG_ARRAY_T

Function Documentation

◆ JUNO_MODULE_DERIVE()

struct UDPTH_MSG_ARRAY_TAG JUNO_MODULE_DERIVE ( JUNO_DS_ARRAY_ROOT_T  ,
UDP_THREAD_MSG_T atBuffer;  [UDPTH_PIPE_CAPACITY] 
)

Concrete array type for the MonitorApp and ProcessorApp pipe queues.

Embeds JUNO_DS_ARRAY_ROOT_T as first member (via JUNO_MODULE_DERIVE pattern), followed by the fixed-size message buffer. The composition root allocates this struct statically and injects &tArr.tRoot into MonitorApp_Init / ProcessorApp_Init.

◆ UdpThreadMsgArray_Init()

static JUNO_STATUS_T UdpThreadMsgArray_Init ( UDPTH_MSG_ARRAY_T ptArr,
JUNO_FAILURE_HANDLER_T  pfcnHandler,
JUNO_USER_DATA_T pvUserData 
)
inlinestatic

Initialise a UDPTH_MSG_ARRAY_T with the shared array API.

Parameters
ptArrCaller-owned array storage; must be non-NULL.
pfcnHandlerOptional failure handler; may be NULL.
pvUserDataOptional user data passed to the failure handler; may be NULL.
Returns
JUNO_STATUS_SUCCESS on success; non-zero on failure.

Variable Documentation

◆ g_udpThreadMsgArrayApi

const JUNO_DS_ARRAY_API_T g_udpThreadMsgArrayApi
extern

Array API for UDPTH_MSG_ARRAY_T — used with JunoDs_ArrayInit.

◆ g_udpThreadMsgPointerApi

const JUNO_POINTER_API_T g_udpThreadMsgPointerApi
extern
Initial value:
= {
}
static JUNO_STATUS_T UdpThreadMsg_Reset(JUNO_POINTER_T tPointer)
Definition udp_thread_msg.cpp:76
static JUNO_STATUS_T UdpThreadMsg_Copy(JUNO_POINTER_T tDest, const JUNO_POINTER_T tSrc)
Definition udp_thread_msg.cpp:64

Pointer API for UDP_THREAD_MSG_T — used with JunoMemory_PointerInit.