LibJuno 1.0.1
LibJuno is a lightweight C11 library designed specifically for embedded systems.
Loading...
Searching...
No Matches
system_manager_app.c File Reference
#include "engine_app/engine_cmd_msg.h"
#include "engine_app/engine_tlm_msg.h"
#include "juno/ds/queue_api.h"
#include "juno/log/log_api.h"
#include "system_manager_app/system_manager_app.h"
#include "juno/macros.h"
#include "juno/memory/pointer_api.h"
#include "juno/sb/broker_api.h"
#include "juno/status.h"
#include "juno/time/time_api.h"
#include <math.h>
#include <stdlib.h>
#include <unistd.h>
Include dependency graph for system_manager_app.c:

Functions

static JUNO_STATUS_T Verify (JUNO_APP_ROOT_T *ptJunoApp)
 
static JUNO_STATUS_T OnStart (JUNO_APP_ROOT_T *ptJunoApp)
 
static JUNO_STATUS_T OnProcess (JUNO_APP_ROOT_T *ptJunoApp)
 
static JUNO_STATUS_T OnExit (JUNO_APP_ROOT_T *ptJunoApp)
 
JUNO_STATUS_T SystemManagerApp (SYSTEM_MANAGER_APP_T *ptSystemManagerApp, JUNO_LOG_ROOT_T *ptLogger, JUNO_TIME_ROOT_T *ptTime, JUNO_SB_BROKER_ROOT_T *ptBroker, JUNO_FAILURE_HANDLER_T pfcnFailureHandler, JUNO_USER_DATA_T *pvUserData)
 

Variables

static const JUNO_APP_API_T tSystemManagerAppApi
 

Function Documentation

◆ OnExit()

static JUNO_STATUS_T OnExit ( JUNO_APP_ROOT_T ptJunoApp)
static

DOC

Conclusion

Hopefully this tutorial helped demonstrate how to utilize the LibJuno micro-framework within a software project. Its intent is to provide a toolbox to developers of interfaces and implementations that they can choose to use. Ultimately the developers will implement solutions targeted for their project so much of the architecture is dependent on specific project needs that can't possibly be captured here. This example project is to showcase the various capabilities a user can choose to implement. END

◆ OnProcess()

static JUNO_STATUS_T OnProcess ( JUNO_APP_ROOT_T ptJunoApp)
static

DOC The System Manager application for this car example will subscribe to the engine apps's telemetry. Similar to the engine app's command pipe, the system manager will read the telemetry off its telemetry pipe. This is done by allocating a telemetry buffer.

DOC Additionally the system manager will command the engine to certain RPMs. It will create the command and command pointer here.

DOC The system manager will attempt to read telemetry off the software bus from the engine. If there is telemetry it will process it and set a new RPM. If there is no telemetry it will command the engine to the same target as before.

DOC The system manager will substract the time from engine start to get an elapsed time. I will then check if the engine is within the target RPM. If it is it will increment the RPM by 10RPM. If not it will send the same target RPM as before.

DOC Finally the system manager sets the target RPM and publishes the message

◆ OnStart()

static JUNO_STATUS_T OnStart ( JUNO_APP_ROOT_T ptJunoApp)
static

◆ SystemManagerApp()

JUNO_STATUS_T SystemManagerApp ( SYSTEM_MANAGER_APP_T ptSystemManagerApp,
JUNO_LOG_ROOT_T ptLogger,
JUNO_TIME_ROOT_T ptTime,
JUNO_SB_BROKER_ROOT_T ptBroker,
JUNO_FAILURE_HANDLER_T  pfcnFailureHandler,
JUNO_USER_DATA_T pvUserData 
)

◆ Verify()

static JUNO_STATUS_T Verify ( JUNO_APP_ROOT_T ptJunoApp)
inlinestatic

Variable Documentation

◆ tSystemManagerAppApi

const JUNO_APP_API_T tSystemManagerAppApi
static
Initial value:
= {
.OnStart = OnStart,
.OnProcess = OnProcess,
.OnExit = OnExit
}
static JUNO_STATUS_T OnProcess(JUNO_APP_ROOT_T *ptJunoApp)
Definition system_manager_app.c:121
static JUNO_STATUS_T OnStart(JUNO_APP_ROOT_T *ptJunoApp)
Definition system_manager_app.c:93
static JUNO_STATUS_T OnExit(JUNO_APP_ROOT_T *ptJunoApp)
Definition system_manager_app.c:195