LibJuno 1.0.4
LibJuno is a lightweight C11 library designed specifically for embedded systems.
Loading...
Searching...
No Matches
udp_bridge_app.cpp File Reference
#include "udp_bridge_app.h"
#include "udp_msg_api.h"
#include "juno/macros.h"
#include <stdio.h>
Include dependency graph for udp_bridge_app.cpp:

Functions

static JUNO_STATUS_T OnStart (JUNO_APP_ROOT_T *ptApp)
 
static JUNO_STATUS_T OnProcess (JUNO_APP_ROOT_T *ptApp)
 
static JUNO_STATUS_T OnExit (JUNO_APP_ROOT_T *ptApp)
 
JUNO_STATUS_T UdpBridgeApp_Init (UDP_BRIDGE_APP_T *ptApp, JUNO_UDP_ROOT_T *ptUdp, JUNO_SB_BROKER_ROOT_T *ptBroker, JUNO_FAILURE_HANDLER_T pfcnFailureHandler, void *pvFailureUserData)
 Initialize a UdpBridgeApp instance with its dependencies.
 

Variables

static const JUNO_APP_API_T s_tUdpBridgeAppApi
 

Function Documentation

◆ OnExit()

static JUNO_STATUS_T OnExit ( JUNO_APP_ROOT_T ptApp)
static

◆ OnProcess()

static JUNO_STATUS_T OnProcess ( JUNO_APP_ROOT_T ptApp)
static

◆ OnStart()

static JUNO_STATUS_T OnStart ( JUNO_APP_ROOT_T ptApp)
static

◆ UdpBridgeApp_Init()

JUNO_STATUS_T UdpBridgeApp_Init ( UDP_BRIDGE_APP_T ptApp,
JUNO_UDP_ROOT_T ptUdp,
JUNO_SB_BROKER_ROOT_T ptBroker,
JUNO_FAILURE_HANDLER_T  pfcnFailureHandler,
void *  pvFailureUserData 
)

Initialize a UdpBridgeApp instance with its dependencies.

Wires the internal static vtable into ptApp->tRoot.ptApi, stores ptUdp and ptBroker, stores the failure handler and user data into ptApp->tRoot, and verifies that no required pointer is NULL. Must be called before any lifecycle function.

The UDP socket is opened by the composition root (main.cpp) via JunoUdp_LinuxInit before the thread starts; OnStart does not re-open it.

Parameters
ptAppCaller-owned app instance storage; must be non-NULL.
ptUdpUDP module root (receiver role); must be non-NULL and must outlive ptApp.
ptBrokerThread 2's software-bus broker root; must be non-NULL and must outlive ptApp.
pfcnFailureHandlerDiagnostic callback invoked before any error return; may be NULL.
pvFailureUserDataOpaque pointer threaded to pfcnFailureHandler; may be NULL.
Returns
JUNO_STATUS_SUCCESS on success; JUNO_STATUS_NULLPTR_ERROR if any required pointer is NULL.

Variable Documentation

◆ s_tUdpBridgeAppApi

const JUNO_APP_API_T s_tUdpBridgeAppApi
static
Initial value:
= {
}
static JUNO_STATUS_T OnStart(JUNO_APP_ROOT_T *ptApp)
Definition udp_bridge_app.cpp:72
static JUNO_STATUS_T OnProcess(JUNO_APP_ROOT_T *ptApp)
Definition udp_bridge_app.cpp:79
static JUNO_STATUS_T OnExit(JUNO_APP_ROOT_T *ptApp)
Definition udp_bridge_app.cpp:109