diff --git a/CMakeLists.txt b/CMakeLists.txt index 69b1dd6..aa577b6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,9 +1,5 @@ project(CFS_LC C) -include_directories(fsw/src) -include_directories(fsw/mission_inc) -include_directories(fsw/platform_inc) - set(APP_SRC_FILES fsw/src/lc_custom.c fsw/src/lc_app.c @@ -16,6 +12,10 @@ set(APP_SRC_FILES # Create the app module add_cfe_app(lc ${APP_SRC_FILES}) +# This permits direct access to public headers in the fsw/inc and fsw/src directories +target_include_directories(lc PUBLIC fsw/inc) +target_include_directories(lc PUBLIC fsw/src) + set(APP_TABLE_FILES fsw/tables/lc_def_wdt.c fsw/tables/lc_def_adt.c diff --git a/fsw/src/lc_events.h b/fsw/inc/lc_events.h similarity index 100% rename from fsw/src/lc_events.h rename to fsw/inc/lc_events.h diff --git a/fsw/mission_inc/lc_mission_cfg.h b/fsw/inc/lc_mission_cfg.h similarity index 100% rename from fsw/mission_inc/lc_mission_cfg.h rename to fsw/inc/lc_mission_cfg.h diff --git a/fsw/inc/lc_msg.h b/fsw/inc/lc_msg.h new file mode 100644 index 0000000..8b9abba --- /dev/null +++ b/fsw/inc/lc_msg.h @@ -0,0 +1,202 @@ +/************************************************************************ + * NASA Docket No. GSC-18,921-1, and identified as “CFS Limit Checker + * Application version 2.2.1” + * + * Copyright (c) 2021 United States Government as represented by the + * Administrator of the National Aeronautics and Space Administration. + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ************************************************************************/ + +/** + * @file + * Specification for the CFS Limit Checker (LC) command and telemetry + * message data types. + * + * @note + * Constants and enumerated types related to these message structures + * are defined in lc_msgdefs.h. They are kept separate to allow easy + * integration with ASIST RDL files which can't handle typedef + * declarations (see the main comment block in lc_msgdefs.h for more + * info). + */ +#ifndef LC_MSG_H +#define LC_MSG_H + +/************************************************************************ + * Includes + ************************************************************************/ +#include "cfe.h" +#include "lc_msgdefs.h" + +/************************************************************************ + * Type Definitions + ************************************************************************/ + +/** + * \defgroup cfslccmdstructs CFS Limit Checker Command Structures + * \{ + */ + +/** + * \brief No Arguments Command + * + * For command details see #LC_NOOP_CC, #LC_RESET_CC + * Also see #LC_SEND_HK_MID + */ +typedef struct +{ + CFE_MSG_CommandHeader_t CmdHeader; /**< \brief Command Header */ +} LC_NoArgsCmd_t; + +/** + * \brief Set LC Application State Command + * + * For command details see #LC_SET_LC_STATE_CC + */ +typedef struct +{ + CFE_MSG_CommandHeader_t CmdHeader; /**< \brief Command Header */ + + uint16 NewLCState; /**< \brief New LC application state */ + uint16 Padding; /**< \brief Structure padding */ +} LC_SetLCState_t; + +/** + * \brief Set AP (Actionpoint) State Command + * + * For command details see #LC_SET_AP_STATE_CC + */ +typedef struct +{ + CFE_MSG_CommandHeader_t CmdHeader; /**< \brief Command Header */ + + uint16 APNumber; /**< \brief Which actionpoint(s) to change */ + uint16 NewAPState; /**< \brief New actionpoint state */ +} LC_SetAPState_t; + +/** + * \brief Set AP (Actionpoint) Permanently Off + * + * For command details see #LC_SET_AP_PERMOFF_CC + */ +typedef struct +{ + CFE_MSG_CommandHeader_t CmdHeader; /**< \brief Command Header */ + + uint16 APNumber; /**< \brief Which actionpoint to change */ + uint16 Padding; /**< \brief Structure padding */ +} LC_SetAPPermOff_t; + +/** + * \brief Reset AP (Actionpoint) Statistics + * + * For command details see #LC_RESET_AP_STATS_CC + */ +typedef struct +{ + CFE_MSG_CommandHeader_t CmdHeader; /**< \brief Command Header */ + + uint16 APNumber; /**< \brief Which actionpoint(s) to change */ + uint16 Padding; /**< \brief Structure padding */ +} LC_ResetAPStats_t; + +/** + * \brief Reset WP (Watchpoint) Statistics + * + * For command details see #LC_RESET_WP_STATS_CC + */ +typedef struct +{ + CFE_MSG_CommandHeader_t CmdHeader; /**< \brief Command Header */ + + uint16 WPNumber; /**< \brief Which watchpoint(s) to change */ + uint16 Padding; /**< \brief Structure padding */ +} LC_ResetWPStats_t; + +/** + * \brief Sample AP (Actionpoint) Request + * + * See #LC_SAMPLE_AP_MID + */ +typedef struct +{ + CFE_MSG_CommandHeader_t CmdHeader; /**< \brief Command Header */ + + uint16 StartIndex; /**< \brief Start actionpoint to sample */ + uint16 EndIndex; /**< \brief End actionpoint to sample */ + + uint16 UpdateAge; /**< \brief Update WP results age (T or F) */ + uint16 Padding; /**< \brief Structure padding */ +} LC_SampleAP_t; + +/** + * \brief Send Command to Start a Stored Command RTS + * + * This is a local declaration of the command message structure + * to initiate an RTS and has been placed here to allow the + * the LC application to be built without including headers from + * any other applications (like Stored Commanding). + * A mission may choose to remove this and use a message + * structure declared elsewhere instead. + * + * This also applies to the LC_RTS_REQ_MID and LC_RTS_REQ_CC + * constants (see lc_mission_cfg.h). + */ +typedef struct +{ + CFE_MSG_CommandHeader_t CmdHeader; /**< \brief Command Header */ + + uint16 RTSId; /**< \brief RTS Id to start */ +} LC_RTSRequest_t; + +/**\}*/ + +/** + * \defgroup cfslctlm CFS Limit Checker Telemetry + * \{ + */ + +/** + * \brief Housekeeping Packet Structure + */ +typedef struct +{ + CFE_MSG_TelemetryHeader_t TlmHeader; /**< \brief Telemetry Header */ + + uint8 CmdCount; /**< \brief LC Application Command Counter */ + uint8 CmdErrCount; /**< \brief LC Application Command Error Counter */ + uint8 CurrentLCState; /**< \brief Current LC application operating state */ + + uint8 Pad8; /**< \brief Structure padding */ + + uint8 WPResults[LC_HKWR_NUM_BYTES]; /**< \brief Packed watchpoint results data, 2 bits per watchpoint */ + uint8 APResults[LC_HKAR_NUM_BYTES]; /**< \brief Packed actionpoint results data, 4 bits per actionpoint */ + + uint16 PassiveRTSExecCount; /**< \brief Total count of RTS sequences not initiated because the LC state is + * set to #LC_STATE_PASSIVE or the state of the actionpoint that failed + * is set to #LC_APSTATE_PASSIVE + */ + + uint16 WPsInUse; /**< \brief How many watchpoints are currently in effect */ + uint16 ActiveAPs; /**< \brief How many actionpoints are currently active */ + + uint16 Pad16; /**< \brief Structure padding */ + + uint32 APSampleCount; /**< \brief Total count of Actionpoints sampled */ + uint32 MonitoredMsgCount; /**< \brief Total count of messages monitored for watchpoints */ + uint32 RTSExecCount; /**< \brief Total count of RTS sequences initiated */ +} LC_HkPacket_t; + +/**\}*/ + +#endif diff --git a/fsw/inc/lc_msgdefs.h b/fsw/inc/lc_msgdefs.h new file mode 100644 index 0000000..5eb530d --- /dev/null +++ b/fsw/inc/lc_msgdefs.h @@ -0,0 +1,362 @@ +/************************************************************************ + * NASA Docket No. GSC-18,921-1, and identified as “CFS Limit Checker + * Application version 2.2.1” + * + * Copyright (c) 2021 United States Government as represented by the + * Administrator of the National Aeronautics and Space Administration. + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ************************************************************************/ + +/** + * @file + * Specification for the CFS Limit Checker (LC) command and telemetry + * message constant definitions. + * + * @note + * These Macro definitions have been put in this file (instead of + * lc_msg.h) so this file can be included directly into ASIST build + * test scripts. ASIST RDL files can accept C language \#defines but + * can't handle type definitions. As a result: DO NOT PUT ANY + * TYPEDEFS OR STRUCTURE DEFINITIONS IN THIS FILE! + * ADD THEM TO lc_msg.h IF NEEDED! + */ +#ifndef LC_MSGDEFS_H +#define LC_MSGDEFS_H + +/************************************************************************ + * Includes + ************************************************************************/ +#include "lc_platform_cfg.h" + +/************************************************************************ + * Macro Definitions + ************************************************************************/ + +/** + * \name LC Application States + * \{ + */ +#define LC_STATE_ACTIVE 1 /**< \brief LC Application State Active */ +#define LC_STATE_PASSIVE 2 /**< \brief LC Application State Pasive */ +#define LC_STATE_DISABLED 3 /**< \brief LC Application State Disabled */ +#define LC_STATE_FROM_CDS 4 /**< \brief Used for reset processing, not valid state */ +/**\}*/ + +/** + * \name Actionpoint States + * \{ + */ +#define LC_ACTION_NOT_USED 0xFF /**< \brief Actionpoint unused, not valid command argument */ +#define LC_APSTATE_ACTIVE 1 /**< \brief Actionpoint state active */ +#define LC_APSTATE_PASSIVE 2 /**< \brief Actionpoint state passive */ +#define LC_APSTATE_DISABLED 3 /**< \brief Actionpoint state disabled */ +#define LC_APSTATE_PERMOFF 4 /**< \brief Actionpoint state permanently off, see #LC_SET_AP_PERMOFF_CC */ +/**\}*/ + +/** + * \name Special Values for Commands + * \{ + */ +#define LC_ALL_ACTIONPOINTS 0xFFFF /**< \brief Special number indicating all actionpoints */ +#define LC_ALL_WATCHPOINTS 0xFFFF /**< \brief Special number indicating all watchpoints */ +/**\}*/ + +/** + * \name Housekeeping Packed Watch Results + * \{ + */ +#define LC_HKWR_FALSE 0x00 /**< \brief Two bit value used for FALSE */ +#define LC_HKWR_TRUE 0x01 /**< \brief Two bit value used for TRUE */ +#define LC_HKWR_ERROR 0x02 /**< \brief Two bit value used for ERROR */ +#define LC_HKWR_STALE 0x03 /**< \brief Two bit value used for STALE */ +/**\}*/ + +/** + * \name Housekeeping Packed Action Results + * \{ + */ +#define LC_HKAR_PASS 0x00 /**< \brief Two bit value used for PASS */ +#define LC_HKAR_FAIL 0x01 /**< \brief Two bit value used for FAIL */ +#define LC_HKAR_ERROR 0x02 /**< \brief Two bit value used for ERROR */ +#define LC_HKAR_STALE 0x03 /**< \brief Two bit value used for STALE */ +/**\}*/ + +/** + * \name Housekeeping Packed Action Results, State Identifiers + * \{ + */ +#define LC_HKAR_STATE_NOT_USED 0x00 /**< \brief Two bit value used for NOT USED and PERMOFF */ +#define LC_HKAR_STATE_ACTIVE 0x01 /**< \brief Two bit value used for ACTIVE */ +#define LC_HKAR_STATE_PASSIVE 0x02 /**< \brief Two bit value used for PASSIVE */ +#define LC_HKAR_STATE_DISABLED 0x03 /**< \brief Two bit value used for DISABLED */ +/**\}*/ + +/** + * \name Housekeeping Packed Results, Array Sizes + * \{ + */ +#define LC_HKWR_NUM_BYTES \ + (((LC_MAX_WATCHPOINTS + 15) / 16) * 4) /**< \brief 2 bits per WP and keeping \ + * array on longword boundary \ + */ + +#define LC_HKAR_NUM_BYTES \ + (((LC_MAX_ACTIONPOINTS + 7) / 8) * 4) /**< \brief 4 bits per AP and keeping \ + * array on longword boundary \ + */ +/**\}*/ + +/** + * \defgroup cfslccmdcodes CFS Limit Checker Command Codes + * \{ + */ + +/** + * \brief Noop + * + * \par Description + * Implements the Noop command that insures the LC task is alive + * + * \par Command Structure + * #LC_NoArgsCmd_t + * + * \par Command Verification + * Successful execution of this command may be verified with + * the following telemetry: + * - #LC_HkPacket_t.CmdCount will increment + * - The #LC_NOOP_INF_EID informational event message will be + * generated when the command is received + * + * \par Error Conditions + * This command may fail for the following reason(s): + * - Command packet length not as expected + * + * \par Evidence of failure may be found in the following telemetry: + * - #LC_HkPacket_t.CmdErrCount will increment + * - Error specific event message #LC_LEN_ERR_EID + * + * \par Criticality + * None + * + * \sa #LC_RESET_CC + */ +#define LC_NOOP_CC 0 + +/** + * \brief Reset Counters + * + * \par Description + * Resets the LC housekeeping counters + * + * \par Command Structure + * #LC_NoArgsCmd_t + * + * \par Command Verification + * Successful execution of this command may be verified with + * the following telemetry: + * - #LC_HkPacket_t.CmdCount will be cleared + * - The #LC_RESET_DBG_EID debug event message will be + * generated when the command is executed + * + * \par Error Conditions + * This command may fail for the following reason(s): + * - Command packet length not as expected + * + * \par Evidence of failure may be found in the following telemetry: + * - #LC_HkPacket_t.CmdErrCount will increment + * - Error specific event message #LC_LEN_ERR_EID + * + * \par Criticality + * None + * + * \sa #LC_NOOP_CC + */ +#define LC_RESET_CC 1 + +/** + * \brief Set LC Application State + * + * \par Description + * Sets the operational state of the LC application + * + * \par Command Structure + * #LC_SetLCState_t + * + * \par Command Verification + * Successful execution of this command may be verified with + * the following telemetry: + * - #LC_HkPacket_t.CmdCount will increment + * - #LC_HkPacket_t.CurrentLCState will be set to the new state + * - The #LC_LCSTATE_INF_EID informational event message will be + * generated when the command is executed + * + * \par Error Conditions + * This command may fail for the following reason(s): + * - Command packet length not as expected + * - Invalid new state specified in command message + * + * \par Evidence of failure may be found in the following telemetry: + * - #LC_HkPacket_t.CmdErrCount will increment + * - Error specific event message #LC_LEN_ERR_EID + * - Error specific event message #LC_LCSTATE_ERR_EID + * + * \par Criticality + * None + * + */ +#define LC_SET_LC_STATE_CC 2 + +/** + * \brief Set AP State + * + * \par Description + * Set actionpoint state + * + * \par Command Structure + * #LC_SetAPState_t + * + * \par Command Verification + * Successful execution of this command may be verified with + * the following telemetry: + * - #LC_HkPacket_t.CmdCount will increment + * - The #LC_APSTATE_INF_EID informational event message will be + * generated when the command is executed + * + * \par Error Conditions + * This command may fail for the following reason(s): + * - Command packet length not as expected + * - Invalid actionpoint state specified in command message + * - Actionpoint number specified in command message is + * out of range + * - Actionpoint current state is either #LC_ACTION_NOT_USED + * or #LC_APSTATE_PERMOFF + * + * \par Evidence of failure may be found in the following telemetry: + * - #LC_HkPacket_t.CmdErrCount will increment + * - Error specific event message #LC_LEN_ERR_EID + * - Error specific event message #LC_APSTATE_NEW_ERR_EID + * - Error specific event message #LC_APSTATE_APNUM_ERR_EID + * - Error specific event message #LC_APSTATE_CURR_ERR_EID + * + * \par Criticality + * None + * + */ +#define LC_SET_AP_STATE_CC 3 + +/** + * \brief Set AP Permanently Off + * + * \par Description + * Set the specified actionpoint's state to #LC_APSTATE_PERMOFF + * + * \par Command Structure + * #LC_SetAPPermOff_t + * + * \par Command Verification + * Successful execution of this command may be verified with + * the following telemetry: + * - #LC_HkPacket_t.CmdCount will increment + * - The #LC_APOFF_INF_EID informational event message will be + * generated when the command is executed + * + * \par Error Conditions + * This command may fail for the following reason(s): + * - Command packet length not as expected + * - Actionpoint number specified in command message is + * out of range + * - Actionpoint current state is not #LC_APSTATE_DISABLED + * + * \par Evidence of failure may be found in the following telemetry: + * - #LC_HkPacket_t.CmdErrCount will increment + * - Error specific event message #LC_LEN_ERR_EID + * - Error specific event message #LC_APOFF_APNUM_ERR_EID + * - Error specific event message #LC_APOFF_CURR_ERR_EID + * + * \par Criticality + * None + * + */ +#define LC_SET_AP_PERMOFF_CC 4 + +/** + * \brief Reset AP Statistics + * + * \par Description + * Resets actionpoint statistics + * + * \par Command Structure + * #LC_ResetAPStats_t + * + * \par Command Verification + * Successful execution of this command may be verified with + * the following telemetry: + * - #LC_HkPacket_t.CmdCount will increment + * - The #LC_APSTATS_INF_EID informational event message will be + * generated when the command is executed + * + * \par Error Conditions + * This command may fail for the following reason(s): + * - Command packet length not as expected + * - Actionpoint number specified in command message is + * out of range + * + * \par Evidence of failure may be found in the following telemetry: + * - #LC_HkPacket_t.CmdErrCount will increment + * - Error specific event message #LC_LEN_ERR_EID + * - Error specific event message #LC_APSTATS_APNUM_ERR_EID + * + * \par Criticality + * None + * + * \sa #LC_RESET_WP_STATS_CC + */ +#define LC_RESET_AP_STATS_CC 5 + +/** + * \brief Reset WP Statistics + * + * \par Description + * Resets watchpoint statistics + * + * \par Command Structure + * #LC_ResetWPStats_t + * + * \par Command Verification + * Successful execution of this command may be verified with + * the following telemetry: + * - #LC_HkPacket_t.CmdCount will increment + * - The #LC_WPSTATS_INF_EID informational event message will be + * generated when the command is executed + * + * \par Error Conditions + * This command may fail for the following reason(s): + * - Command packet length not as expected + * - Watchpoint number specified in command message is + * out of range + * + * \par Evidence of failure may be found in the following telemetry: + * - #LC_HkPacket_t.CmdErrCount will increment + * - Error specific event message #LC_LEN_ERR_EID + * - Error specific event message #LC_WPSTATS_WPNUM_ERR_EID + * + * \par Criticality + * None + * + * \sa #LC_RESET_AP_STATS_CC + */ +#define LC_RESET_WP_STATS_CC 6 + +/**\}*/ + +#endif diff --git a/fsw/platform_inc/lc_msgids.h b/fsw/inc/lc_msgids.h similarity index 100% rename from fsw/platform_inc/lc_msgids.h rename to fsw/inc/lc_msgids.h diff --git a/fsw/mission_inc/lc_perfids.h b/fsw/inc/lc_perfids.h similarity index 100% rename from fsw/mission_inc/lc_perfids.h rename to fsw/inc/lc_perfids.h diff --git a/fsw/platform_inc/lc_platform_cfg.h b/fsw/inc/lc_platform_cfg.h similarity index 100% rename from fsw/platform_inc/lc_platform_cfg.h rename to fsw/inc/lc_platform_cfg.h diff --git a/fsw/inc/lc_tbldefs.h b/fsw/inc/lc_tbldefs.h new file mode 100644 index 0000000..1a6b2de --- /dev/null +++ b/fsw/inc/lc_tbldefs.h @@ -0,0 +1,149 @@ +/************************************************************************ + * NASA Docket No. GSC-18,921-1, and identified as “CFS Limit Checker + * Application version 2.2.1” + * + * Copyright (c) 2021 United States Government as represented by the + * Administrator of the National Aeronautics and Space Administration. + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ************************************************************************/ + +/** + * @file + * Specification for the CFS Limit Checker (LC) table related + * constant definitions. + * + * @note + * These Macro definitions have been put in this file (instead of + * lc_tbl.h) so this file can be included directly into ASIST build + * test scripts. ASIST RDL files can accept C language \#defines but + * can't handle type definitions. As a result: DO NOT PUT ANY + * TYPEDEFS OR STRUCTURE DEFINITIONS IN THIS FILE! + * ADD THEM TO lc_tbl.h IF NEEDED! + */ +#ifndef LC_TBLDEFS_H +#define LC_TBLDEFS_H + +/************************************************************************ + * Macro Definitions + ************************************************************************/ + +/** + * \name LC CDS Saved on Exit Identifiers + * \{ + */ +#define LC_CDS_SAVED 0xF0F0 /**< \brief CDS saved on exit */ +#define LC_CDS_NOT_SAVED 0x0F0F /**< \brief CDS not saved on exit */ +/**\}*/ + +/** + * \name Watchpoint Definition Table (WDT) DataType Enumerated Types + * \{ + */ +#define LC_WATCH_NOT_USED 0xFF /**< \brief Use for empty entries */ +#define LC_DATA_BYTE 1 /**< \brief 8 bit signed byte */ +#define LC_DATA_UBYTE 2 /**< \brief 8 bit unsigned byte */ +#define LC_DATA_WORD_BE 3 /**< \brief 16 bit signed word big endian byte order */ +#define LC_DATA_WORD_LE 4 /**< \brief 16 bit signed word little endian byte order */ +#define LC_DATA_UWORD_BE 5 /**< \brief 16 bit unsigned word big endian byte order */ +#define LC_DATA_UWORD_LE 6 /**< \brief 16 bit unsigned word little endian byte order */ +#define LC_DATA_DWORD_BE 7 /**< \brief 32 bit signed double word big endian byte order */ +#define LC_DATA_DWORD_LE 8 /**< \brief 32 bit signed double word little endian byte order */ +#define LC_DATA_UDWORD_BE 9 /**< \brief 32 bit unsigned double word big endian byte order */ +#define LC_DATA_UDWORD_LE 10 /**< \brief 32 bit unsigned double word little endian byte order */ +#define LC_DATA_FLOAT_BE \ + 11 /**< \brief 32 bit single precision IEEE-754 floating point number, \ + * big endian byte order \ + */ +#define LC_DATA_FLOAT_LE \ + 12 /**< \brief 32 bit single precision IEEE-754 floating point number, \ + * little endian byte order \ + */ +/**\}*/ + +/** + * \name Watchpoint Definition Table (WDT) OperatorID Enumerated Types + * \{ + */ +#define LC_NO_OPER 0xFF /**< \brief Use for empty entries */ +#define LC_OPER_LT 1 /**< \brief Less Than (<) */ +#define LC_OPER_LE 2 /**< \brief Less Than or Equal To (<=) */ +#define LC_OPER_NE 3 /**< \brief Not Equal (!=) */ +#define LC_OPER_EQ 4 /**< \brief Equal (==) */ +#define LC_OPER_GE 5 /**< \brief Greater Than or Equal To (>=) */ +#define LC_OPER_GT 6 /**< \brief Greater Than (>) */ +#define LC_OPER_CUSTOM 7 /**< \brief Use custom function */ +/**\}*/ + +/** + * \name Watchpoint Definition Table (WDT) BitMask Enumerated Types + * \{ + */ +#define LC_NO_BITMASK 0xFFFFFFFF /**< \brief Use for no masking */ +/**\}*/ + +/** + * \name Actionpoint Definition Table (ADT) Reverse Polish Operators + * \{ + */ +#define LC_RPN_AND 0xFFF1 /**< \brief RPN and operator */ +#define LC_RPN_OR 0xFFF2 /**< \brief RPN or operator */ +#define LC_RPN_XOR 0xFFF3 /**< \brief RPN xor operator */ +#define LC_RPN_NOT 0xFFF4 /**< \brief RPN not operator */ +#define LC_RPN_EQUAL 0xFFF5 /**< \brief RPN equal operator */ +/**\}*/ + +/** + * \name Watchpoint Results Table (WRT) WatchResult Enumerated Types + * \{ + */ +#define LC_WATCH_STALE 0xFF /**< \brief Watchpoint stale */ +#define LC_WATCH_FALSE 0 /**< \brief Watchpoint false, must be zero for RPN evaluation */ +#define LC_WATCH_TRUE 1 /**< \brief Watchpoint true, must be one for RPN evaluation */ +#define LC_WATCH_ERROR 2 /**< \brief Watchpoint error */ +/**\}*/ + +/** + * \name Actionpoint Results Table (ART) ActionResult Enumerated Types + * \{ + */ +#define LC_ACTION_STALE 0xFF /**< \brief Actionpoint stale */ +#define LC_ACTION_PASS 0 /**< \brief Actionpoint pass */ +#define LC_ACTION_FAIL 1 /**< \brief Actionpoint fail */ +#define LC_ACTION_ERROR 2 /**< \brief Actionpoint error */ +/**\}*/ + +/** + * \name Watchpoint Definition Table (WDT) Validation Error Enumerated Types + * \{ + */ +#define LC_WDTVAL_NO_ERR 0 /**< \brief No error */ +#define LC_WDTVAL_ERR_DATATYPE 1 /**< \brief Invalid DataType */ +#define LC_WDTVAL_ERR_OPER 2 /**< \brief Invalid OperatorID */ +#define LC_WDTVAL_ERR_MID 3 /**< \brief Invalid MessageID */ +#define LC_WDTVAL_ERR_FPNAN 4 /**< \brief ComparisonValue is NAN float */ +#define LC_WDTVAL_ERR_FPINF 5 /**< \brief ComparisonValue is infinite float */ +/**\}*/ + +/** + * \name Actionpoint Definition Table (ADT) Validation Error Enumerated Types + * \{ + */ +#define LC_ADTVAL_NO_ERR 0 /**< \brief No error */ +#define LC_ADTVAL_ERR_DEFSTATE 1 /**< \brief Invalid DefaultState */ +#define LC_ADTVAL_ERR_RTSID 2 /**< \brief Invalid RTSId */ +#define LC_ADTVAL_ERR_FAILCNT 3 /**< \brief MaxFailsBeforeRTS is zero */ +#define LC_ADTVAL_ERR_EVTTYPE 4 /**< \brief Invalid EventType */ +#define LC_ADTVAL_ERR_RPN 5 /**< \brief Invalid Reverse Polish Expression */ +/**\}*/ + +#endif diff --git a/unit-test/CMakeLists.txt b/unit-test/CMakeLists.txt index 4aed619..332d8c0 100644 --- a/unit-test/CMakeLists.txt +++ b/unit-test/CMakeLists.txt @@ -20,8 +20,10 @@ add_cfe_coverage_stubs("lc_internal" # Link with the cfe core stubs and unit test assert libs target_link_libraries(coverage-lc_internal-stubs ut_core_api_stubs ut_assert) -# Include and expose unit test utilities includes +# Include and expose unit test utilities, fsw/inc, and fsw/src includes target_include_directories(coverage-lc_internal-stubs PUBLIC utilities) +target_include_directories(coverage-lc_internal-stubs PUBLIC ../fsw/inc) +target_include_directories(coverage-lc_internal-stubs PUBLIC ../fsw/src) # Generate a dedicated "testrunner" executable for each test file # Accomplish this by cycling through all the app's source files, there must be