Solaris Software
Loading...
Searching...
No Matches
custom.c File Reference

Custom definitions for the Solaris Packet Protocol. More...

Include dependency graph for custom.c:

Go to the source code of this file.

Functions

static spp_bool_t CUSTOM_registerConsumerProducer (void)
 Registers the application's producers and consumers.
static spp_bool_t guard_startInitializationOfModules (void)
 Registers producers and consumers and initializes the SPP core.
static void action_emitTelemetry (void)
 Publishes application and core initialization error flags.
const FSM_Transition_t * CUSTOM_getFsmTable (void)
 Returns the application-specific FSM transition table.

Variables

static FSM_Transition_t s_transitionTable []
static FsmErrors_t s_fsmErrors = {0}

Detailed Description

Custom definitions for the Solaris Packet Protocol.

Definition in file custom.c.

Function Documentation

◆ CUSTOM_registerConsumerProducer()

spp_bool_t CUSTOM_registerConsumerProducer ( void )
static

Registers the application's producers and consumers.

Assigns producer KPIDs, configures consumer subscriptions and records registration failures.

Returns
true if at least one producer and one consumer were registered successfully, false otherwise.

Definition at line 167 of file custom.c.

References CUSTOM_registerConsumerProducer(), K_SPP_KPID_FSM, K_SPP_OK, s_fsmErrors, SPP_SERVICES_BMP390_getProducerContract(), SPP_SERVICES_DATALOGGER_getConsumerContract(), SPP_SERVICES_ICM20948_getProducerContract(), SPP_SERVICES_PUBSUB_registerConsumer(), SPP_SERVICES_PUBSUB_registerProducer(), SPP_SERVICES_SX1262_getConsumerContract(), and SPP_Kpid_t::value.

Referenced by CUSTOM_registerConsumerProducer(), and guard_startInitializationOfModules().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ guard_startInitializationOfModules()

spp_bool_t guard_startInitializationOfModules ( void )
static

Registers producers and consumers and initializes the SPP core.

Returns
true if registration requirements and core initialization succeed, false otherwise.

Definition at line 69 of file custom.c.

References CUSTOM_registerConsumerProducer(), guard_startInitializationOfModules(), K_SPP_ERROR, K_SPP_OK, s_fsmErrors, SPP_CORE_init(), SPP_SERVICES_BMP390_getProducerContract(), SPP_SERVICES_DATALOGGER_getConsumerContract(), SPP_SERVICES_ICM20948_getProducerContract(), SPP_SERVICES_PUBSUB_getConsumerInitResult(), SPP_SERVICES_PUBSUB_getProducerInitResult(), and SPP_SERVICES_SX1262_getConsumerContract().

Referenced by guard_startInitializationOfModules().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ action_emitTelemetry()

void action_emitTelemetry ( void )
static

Publishes application and core initialization error flags.

Encodes both 16-bit error bitfields into an SPP packet and publishes it using the FSM KPID.

Definition at line 131 of file custom.c.

References action_emitTelemetry(), CommonBitErrors_t::errors, FsmErrors_t::errors, K_SPP_KPID_FSM, K_SPP_OK, s_fsmErrors, SPP_CORE_COMMONBIT_getBit(), SPP_Packet_t, SPP_SERVICES_DATABANK_getPacket(), SPP_SERVICES_DATABANK_packetData(), and SPP_SERVICES_PUBSUB_publish().

Referenced by action_emitTelemetry().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CUSTOM_getFsmTable()

const FSM_Transition_t * CUSTOM_getFsmTable ( void )

Returns the application-specific FSM transition table.

Returns
Pointer to the statically allocated transition table.

Definition at line 53 of file custom.c.

References CUSTOM_getFsmTable(), and s_transitionTable.

Referenced by APP_initFsm(), and CUSTOM_getFsmTable().

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ s_transitionTable

FSM_Transition_t s_transitionTable[]
static
Initial value:
= {
{
.fromState = FSM_STATE_INIT,
.fromSubState = FSM_SUBSTATE_NONE,
.toState = FSM_STATE_READY,
.toSubState = FSM_SUBSTATE_NONE,
.stateFunction = NULL,
},
}
static spp_bool_t guard_startInitializationOfModules(void)
Registers producers and consumers and initializes the SPP core.
Definition custom.c:69
static void action_emitTelemetry(void)
Publishes application and core initialization error flags.
Definition custom.c:131
@ FSM_STATE_READY
Definition fsm.h:30
@ FSM_STATE_INIT
Definition fsm.h:29
@ FSM_SUBSTATE_NONE
Definition fsm.h:40

Definition at line 36 of file custom.c.

Referenced by CUSTOM_getFsmTable().

◆ s_fsmErrors