Emit state machine's state in an event/as telemetry (typing the state variable) #4368
Answered
by
bocchino
Saransh-cpp
asked this question in
Q&A
-
|
I am trying to emit my state machine's state in an event / as a telemetry, but I can't figure out what type should I use for the variable that will be assigned the state. My component looks like this - module App {
active component EventAction {
state machine StateMachine {
...
}
state machine instance stateMachine: StateMachine
...
}I can see that the state is defined in - namespace App {
class EventAction_StateMachineStateMachineBase {
...
enum class State : FwEnumStoreType {
//! The uninitialized state
__FPRIME_AC_UNINITIALIZED,
//! The CHARGE state
CHARGE,
//! The COM state
COM,
//! The DOWNLINK state
DOWNLINK,
//! The MEASURE state
MEASURE,
//! The SAFE-CHARGE sub-state
SAFE_SAFE_CHARGE,
//! The SAFE-COM sub-state
SAFE_SAFE_COM,
//! The SAFE-DETUMBLE sub-state
SAFE_SAFE_DETUMBLE,
};
...
}
}What type do I use in these cases - event MODE_CHANGE(new_mode: <?what_type_to_use_here?>) severity activity high id 0 format "Mode set to {}"
telemetry Mode: <?what_type_to_use_here?> |
Beta Was this translation helpful? Give feedback.
Answered by
bocchino
Oct 28, 2025
Replies: 1 comment 1 reply
-
|
For now you need to construct your own FPP enumeration and write code to convert from the C++ enumeration to the FPP enumeration. We have an issue open to automatically generate the FPP enumeration: nasa/fpp#615. |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
Saransh-cpp
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
For now you need to construct your own FPP enumeration and write code to convert from the C++ enumeration to the FPP enumeration. We have an issue open to automatically generate the FPP enumeration: nasa/fpp#615.