Files
fprime/FppTest/state_machine/HackSm.hpp
garthwatney d2bcd0e97c Phase 1 state machines (#2829)
* Add a state machine unit test under FppTest

* Updated the base class and unit tests work

* Remove the sendEvent function as it did not allow for data to be passed

* Add state machine in SmTest.fpp

* Add dependency in SmTest.fpp

* state machine unit test passes with new fpp phase 1

* Makefile for state machines don't use special switch

* Rebase DeviceSm.hpp

* Update on SMEvents inclusion

* Use latest phase1 fpp and STARS which uses _Interface

* Change SMEvents to SMSignals

* Use SMSignals instead of SMEvents

* Update test for state machine instance priority and full queue behavior

* Update requirements to use new fpp version

* Removed unneeded files

* update FppTest for new autocoder changes

* Get unit tests updated and working for fpp state machines phase 1 delivery

* Rename Fw/SMTest to Fw/Sm

* Update STARS to use FW_ASSERT

* Rename SMSignalBuffer to SmSignalBuffer

* Fix spelling issues with CI

* Update requirements to the FPP alpha release v2.2.0a3

* Fix requirements.txt

* Fix requirements.txt

* Initialize data in the constructor of SmSignalBuffer

* Add constructor list to all the constructors in SmSignalBuffer

* Fixes for reserved word state and address review comments

* Fix other review issues pertaining to unit tests and argument checks in the SmSignalBuffer constructors

* Add a cast to NATIVE_UINT_TYPE in SmSignalBuffer

* Fixing type

* Fixing size type in cpp

---------

Co-authored-by: watney <garth.j.watney@jpl.nasa.gov>
Co-authored-by: Rob Bocchino <bocchino@jpl.nasa.gov>
Co-authored-by: M Starch <LeStarch@googlemail.com>
2024-09-19 12:19:11 -07:00

64 lines
1.6 KiB
C++

// ======================================================================
// \title HackSm.h
// \author Auto-generated
// \brief header file for state machine HackSm
//
// ======================================================================
#ifndef HACKSM_H_
#define HACKSM_H_
#include <Fw/Sm/SmSignalBuffer.hpp>
#include <config/FpConfig.hpp>
namespace FppTest {
class HackSm_Interface {
public:
enum HackSm_Signals {
RTI_SIG,
CHECK_SIG,
};
virtual void HackSm_turnOff(const FwEnumStoreType stateMachineId) = 0;
virtual void HackSm_turnOn(const FwEnumStoreType stateMachineId) = 0;
virtual void HackSm_doDiag(const FwEnumStoreType stateMachineId) = 0;
};
class HackSm {
private:
HackSm_Interface *parent;
public:
HackSm(HackSm_Interface* parent) : parent(parent) {}
enum HackSm_States {
OFF,
ON,
DIAG,
};
enum HackSm_States state;
void init(const FwEnumStoreType stateMachineId);
void update(
const FwEnumStoreType stateMachineId,
const HackSm_Interface::HackSm_Signals signal,
const Fw::SmSignalBuffer &data
);
};
}
#endif