Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -316,4 +316,40 @@ void AntennaDeployer ::writeDeploymentState(bool deployed) {
}
}

// ----------------------------------------------------------------------
// Parameter update handler
// ----------------------------------------------------------------------

void AntennaDeployer ::parameterUpdated(FwPrmIdType id) {
switch (id) {
case AntennaDeployer::PARAMID_RETRY_DELAY_SEC: {
Fw::ParamValid is_valid;
U32 parameter = this->paramGet_RETRY_DELAY_SEC(is_valid);
if ((is_valid != Fw::ParamValid::INVALID) && (is_valid != Fw::ParamValid::UNINIT)) {
this->log_ACTIVITY_HI_RetryDelaySecParamSet(parameter);
this->tlmWrite_RetryDelaySecParam(parameter);
}
} break;
case AntennaDeployer::PARAMID_MAX_DEPLOY_ATTEMPTS: {
Fw::ParamValid is_valid;
U32 parameter = this->paramGet_MAX_DEPLOY_ATTEMPTS(is_valid);
if ((is_valid != Fw::ParamValid::INVALID) && (is_valid != Fw::ParamValid::UNINIT)) {
this->log_ACTIVITY_HI_MaxDeployAttemptsParamSet(parameter);
this->tlmWrite_MaxDeployAttemptsParam(parameter);
}
} break;
case AntennaDeployer::PARAMID_BURN_DURATION_SEC: {
Fw::ParamValid is_valid;
U32 parameter = this->paramGet_BURN_DURATION_SEC(is_valid);
if ((is_valid != Fw::ParamValid::INVALID) && (is_valid != Fw::ParamValid::UNINIT)) {
this->log_ACTIVITY_HI_BurnDurationSecParamSet(parameter);
this->tlmWrite_BurnDurationSecParam(parameter);
}
} break;
default:
FW_ASSERT(0);
break; // Fallthrough from assert (static analysis)
}
}

} // namespace Components
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,21 @@ module Components {
severity warning high \
format "File operation failed: {} on file {}"

@ Event when RETRY_DELAY_SEC parameter is set
event RetryDelaySecParamSet(value: U32) \
severity activity high \
format "RETRY_DELAY_SEC parameter set to {} seconds."

@ Event when MAX_DEPLOY_ATTEMPTS parameter is set
event MaxDeployAttemptsParamSet(value: U32) \
severity activity high \
format "MAX_DEPLOY_ATTEMPTS parameter set to {}."

@ Event when BURN_DURATION_SEC parameter is set
event BurnDurationSecParamSet(value: U32) \
severity activity high \
format "BURN_DURATION_SEC parameter set to {} seconds."

######################################################################
# Ports
######################################################################
Expand All @@ -97,6 +112,15 @@ module Components {
@ Duration (seconds) for which to hold each burn attempt before issuing STOP
param BURN_DURATION_SEC: U32 default 8

@ RETRY_DELAY_SEC parameter value
telemetry RetryDelaySecParam: U32

@ MAX_DEPLOY_ATTEMPTS parameter value
telemetry MaxDeployAttemptsParam: U32

@ BURN_DURATION_SEC parameter value
telemetry BurnDurationSecParam: U32

########################################################################
# Standard AC Ports: Required for Channels, Events, Commands, Parameters
########################################################################
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ class AntennaDeployer final : public AntennaDeployerComponentBase {
~AntennaDeployer();

private:
//! Parameter update handler
void parameterUpdated(FwPrmIdType id //!< The parameter ID
) override;

// ----------------------------------------------------------------------
// Handler implementations
// ----------------------------------------------------------------------
Expand Down
20 changes: 20 additions & 0 deletions FprimeZephyrReference/Components/Authenticate/Authenticate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -350,4 +350,24 @@ void Authenticate ::SET_SEQ_NUM_cmdHandler(FwOpcodeType opCode, U32 cmdSeq, U32
this->cmdResponse_out(opCode, cmdSeq, Fw::CmdResponse::OK);
}

// ----------------------------------------------------------------------
// Parameter update handler
// ----------------------------------------------------------------------

void Authenticate ::parameterUpdated(FwPrmIdType id) {
switch (id) {
case Authenticate::PARAMID_SEQ_NUM_WINDOW: {
Fw::ParamValid is_valid;
U32 parameter = this->paramGet_SEQ_NUM_WINDOW(is_valid);
if ((is_valid != Fw::ParamValid::INVALID) && (is_valid != Fw::ParamValid::UNINIT)) {
this->log_ACTIVITY_HI_SeqNumWindowParamSet(parameter);
this->tlmWrite_SeqNumWindowParam(parameter);
}
} break;
default:
FW_ASSERT(0);
break; // Fallthrough from assert (static analysis)
}
}

} // namespace Components
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ module Components {

event PacketRejected() severity warning high id 15 format "Packet Rejected" throttle 2

@ Event when SEQ_NUM_WINDOW parameter is set
event SeqNumWindowParamSet(value: U32) severity activity high format "SEQ_NUM_WINDOW parameter set to {}."


# @ Ports for packet authentication

Expand All @@ -62,6 +65,9 @@ module Components {

param SEQ_NUM_WINDOW : U32 default 50000

@ SEQ_NUM_WINDOW parameter value
telemetry SeqNumWindowParam: U32

###############################################################################
# Standard AC Ports: Required for Channels, Events, Commands, and Parameters #
###############################################################################
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ class Authenticate final : public AuthenticateComponentBase {
void init(FwEnumStoreType instance);

private:
//! Parameter update handler
void parameterUpdated(FwPrmIdType id //!< The parameter ID
) override;

// ----------------------------------------------------------------------
// Handler implementations for typed input ports
// ----------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -246,4 +246,32 @@ void AuthenticationRouter ::fileBufferReturnIn_handler(FwIndexType portNum, Fw::
this->bufferDeallocate_out(0, fwBuffer);
}

// ----------------------------------------------------------------------
// Parameter update handler
// ----------------------------------------------------------------------

void AuthenticationRouter ::parameterUpdated(FwPrmIdType id) {
switch (id) {
case AuthenticationRouter::PARAMID_COMM_LOSS_TIME: {
Fw::ParamValid is_valid;
Fw::TimeIntervalValue parameter = this->paramGet_COMM_LOSS_TIME(is_valid);
if ((is_valid != Fw::ParamValid::INVALID) && (is_valid != Fw::ParamValid::UNINIT)) {
this->log_ACTIVITY_HI_CommLossTimeParamSet(parameter);
this->tlmWrite_CommLossTimeParam(parameter);
}
} break;
case AuthenticationRouter::PARAMID_COMM_LOSS_TIME_START_FILE: {
Fw::ParamValid is_valid;
Fw::ParamString parameter = this->paramGet_COMM_LOSS_TIME_START_FILE(is_valid);
if ((is_valid != Fw::ParamValid::INVALID) && (is_valid != Fw::ParamValid::UNINIT)) {
this->log_ACTIVITY_HI_CommLossTimeStartFileParamSet(parameter);
this->tlmWrite_CommLossTimeStartFileParam(parameter);
}
} break;
default:
FW_ASSERT(0);
break; // Fallthrough from assert (static analysis)
}
}

} // namespace Svc
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,26 @@ module Svc {
format "Command Loss Timer Failed to update most recent time" \
throttle 1

@ Event when COMM_LOSS_TIME parameter is set
event CommLossTimeParamSet(value: Fw.TimeIntervalValue) severity activity high \
format "COMM_LOSS_TIME parameter set to {}."

@ Event when COMM_LOSS_TIME_START_FILE parameter is set
event CommLossTimeStartFileParamSet(value: string) severity activity high \
format "COMM_LOSS_TIME_START_FILE parameter set to '{}'."

@ Command Loss Time in seconds by Default: one day = 3*60*60*24
param COMM_LOSS_TIME: Fw.TimeIntervalValue default {seconds = 3*60*60*24, useconds = 0}

@ File to Read last command loss time from
param COMM_LOSS_TIME_START_FILE: string default "/comm_loss_start.bin"

@ COMM_LOSS_TIME parameter value
telemetry CommLossTimeParam: Fw.TimeIntervalValue

@ COMM_LOSS_TIME_START_FILE parameter value
telemetry CommLossTimeStartFileParam: string


###############################################################################
# Standard AC Ports for Events
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ class AuthenticationRouter final : public AuthenticationRouterComponentBase {
~AuthenticationRouter();

private:
//! Parameter update handler
void parameterUpdated(FwPrmIdType id //!< The parameter ID
) override;

// ----------------------------------------------------------------------
// Handler implementations for user-defined typed input ports
// ----------------------------------------------------------------------
Expand Down
20 changes: 20 additions & 0 deletions FprimeZephyrReference/Components/Burnwire/Burnwire.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,24 @@ void Burnwire ::STOP_BURNWIRE_cmdHandler(FwOpcodeType opCode, U32 cmdSeq) {
this->cmdResponse_out(opCode, cmdSeq, Fw::CmdResponse::OK);
}

// ----------------------------------------------------------------------
// Parameter update handler
// ----------------------------------------------------------------------

void Burnwire ::parameterUpdated(FwPrmIdType id) {
switch (id) {
case Burnwire::PARAMID_SAFETY_TIMER: {
Fw::ParamValid is_valid;
U32 parameter = this->paramGet_SAFETY_TIMER(is_valid);
if ((is_valid != Fw::ParamValid::INVALID) && (is_valid != Fw::ParamValid::UNINIT)) {
this->log_ACTIVITY_HI_SafetyTimerParamSet(parameter);
this->tlmWrite_SafetyTimerParam(parameter);
}
} break;
default:
FW_ASSERT(0);
break; // Fallthrough from assert (static analysis)
}
}

} // namespace Components
8 changes: 8 additions & 0 deletions FprimeZephyrReference/Components/Burnwire/Burnwire.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ module Components {
severity activity low \
format "Burnwire Burned for {} Seconds"

@ Event when SAFETY_TIMER parameter is set
event SafetyTimerParamSet(value: U32) \
severity activity high \
format "SAFETY_TIMER parameter set to {} seconds."

@ Port getting start signal
sync input port burnStart: Fw.Signal

Expand All @@ -41,6 +46,9 @@ module Components {
# @ SAFETY_TIMER parameter is the maximum time that the burn component will run
param SAFETY_TIMER: U32 default 10

@ SAFETY_TIMER parameter value
telemetry SafetyTimerParam: U32

###############################################################################
# Standard AC Ports: Required for Channels, Events, Commands, and Parameters #
###############################################################################
Expand Down
4 changes: 4 additions & 0 deletions FprimeZephyrReference/Components/Burnwire/Burnwire.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ class Burnwire final : public BurnwireComponentBase {
~Burnwire();

private:
//! Parameter update handler
void parameterUpdated(FwPrmIdType id //!< The parameter ID
) override;

// ----------------------------------------------------------------------
// Handler implementations for typed input ports
// ----------------------------------------------------------------------
Expand Down
1 change: 1 addition & 0 deletions FprimeZephyrReference/Components/ComDelay/ComDelay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ void ComDelay ::parameterUpdated(FwPrmIdType id) {
U16 new_divider = this->paramGet_DIVIDER(is_valid);
if ((is_valid != Fw::ParamValid::INVALID) && (is_valid != Fw::ParamValid::UNINIT)) {
this->log_ACTIVITY_HI_DividerSet(new_divider);
this->tlmWrite_DividerParam(new_divider);
}
} break;
default:
Expand Down
6 changes: 6 additions & 0 deletions FprimeZephyrReference/Components/ComDelay/ComDelay.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ module Components {
@ Divider of the incoming rate tick
param DIVIDER: U16 default DEFAULT_DIVIDER # Start slow i.e. on a 1S tick, transmit every 30S

@ DIVIDER parameter value
telemetry DividerParam: U16

@ Divider set event
event DividerSet(divider: U16) severity activity high \
format "Set divider to: {}"
Expand All @@ -39,6 +42,9 @@ module Components {
@ Port for sending events to downlink
event port logOut

@ Port for sending telemetry channels to downlink
telemetry port tlmOut

@ Port to return the value of a parameter
param get port prmGetOut

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -252,4 +252,40 @@ Fw::Success Veml6031Manager ::configureSensorAttributes(sensor_channel chan) {
return Fw::Success::SUCCESS;
}

// ----------------------------------------------------------------------
// Parameter update handler
// ----------------------------------------------------------------------

void Veml6031Manager ::parameterUpdated(FwPrmIdType id) {
switch (id) {
case Veml6031Manager::PARAMID_GAIN: {
Fw::ParamValid is_valid;
GAIN parameter = this->paramGet_GAIN(is_valid);
if ((is_valid != Fw::ParamValid::INVALID) && (is_valid != Fw::ParamValid::UNINIT)) {
this->log_ACTIVITY_HI_GainParamSet(parameter);
this->tlmWrite_GainParam(parameter);
}
} break;
case Veml6031Manager::PARAMID_INTEGRATION_TIME: {
Fw::ParamValid is_valid;
IT parameter = this->paramGet_INTEGRATION_TIME(is_valid);
if ((is_valid != Fw::ParamValid::INVALID) && (is_valid != Fw::ParamValid::UNINIT)) {
this->log_ACTIVITY_HI_IntegrationTimeParamSet(parameter);
this->tlmWrite_IntegrationTimeParam(parameter);
}
} break;
case Veml6031Manager::PARAMID_EFFECTIVE_PHOTODIODE_SIZE: {
Fw::ParamValid is_valid;
DIV4 parameter = this->paramGet_EFFECTIVE_PHOTODIODE_SIZE(is_valid);
if ((is_valid != Fw::ParamValid::INVALID) && (is_valid != Fw::ParamValid::UNINIT)) {
this->log_ACTIVITY_HI_EffectivePhotodiodeSizeParamSet(parameter);
this->tlmWrite_EffectivePhotodiodeSizeParam(parameter);
}
} break;
default:
FW_ASSERT(0);
break; // Fallthrough from assert (static analysis)
}
}

} // namespace Drv
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,26 @@ module Drv {
@ Event for reporting visible light lux
event VisibleLight(lux: F32) severity activity high format "Visible light: {} lux"

@ Event when GAIN parameter is set
event GainParamSet(value: GAIN) severity activity high format "GAIN parameter set to {}."

@ Event when INTEGRATION_TIME parameter is set
event IntegrationTimeParamSet(value: IT) severity activity high format "INTEGRATION_TIME parameter set to {}."

@ Event when EFFECTIVE_PHOTODIODE_SIZE parameter is set
event EffectivePhotodiodeSizeParamSet(value: DIV4) severity activity high format "EFFECTIVE_PHOTODIODE_SIZE parameter set to {}."

#### Telemetry for parameters ####

@ GAIN parameter value
telemetry GainParam: GAIN

@ INTEGRATION_TIME parameter value
telemetry IntegrationTimeParam: IT

@ EFFECTIVE_PHOTODIODE_SIZE parameter value
telemetry EffectivePhotodiodeSizeParam: DIV4

###############################################################################
# Standard AC Ports: Required for Channels, Events, Commands, and Parameters #
###############################################################################
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ class Veml6031Manager final : public Veml6031ManagerComponentBase {
void configure(const struct device* tca, const struct device* mux, const struct device* dev);

private:
//! Parameter update handler
void parameterUpdated(FwPrmIdType id //!< The parameter ID
) override;

// ----------------------------------------------------------------------
// Handler implementations for typed input ports
// ----------------------------------------------------------------------
Expand Down
Loading