Skip to content
Open
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
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ if (CFE_EDS_ENABLED)
list(APPEND APP_SRC_FILES fsw/src/cf_eds_dispatch.c)
else()
list(APPEND APP_SRC_FILES fsw/src/cf_dispatch.c)
list(APPEND APP_SRC_FILES fsw/src/cf_cmd_compat.c)
endif()

# Create the app module
Expand Down
69 changes: 48 additions & 21 deletions config/default_cf_fcncode_values.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,28 +35,55 @@

#define CF_CCVAL(x) CF_FunctionCode_##x

/*
* For the interim release, the pre-existing function codes will point
* to the compatibility shim for CF commands. This shim will convert the
* arguments into the new form and invoke the new command. The new commands
* have the command code shifted up by 30.
*/
Comment on lines +38 to +43

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the only comment I have while I wait for my test and update files for this function code scheme with the new test (PR of my own on the plugin). After the meeting today I think this comment needs reworded slightly. It was my understanding that the new function code will be the standard for some time, even after this compatibility layer is removed. I guess I'm advocating for stronger wording to indicate that the new function codes for the new commands will be solid for the foreseeable future. @dzbaker please confirm this understanding when you are able.

enum CF_FunctionCode
{
CF_FunctionCode_NOOP = 0,
CF_FunctionCode_RESET_COUNTERS = 1,
CF_FunctionCode_TX_FILE = 2,
CF_FunctionCode_PLAYBACK_DIR = 3,
CF_FunctionCode_FREEZE = 4,
CF_FunctionCode_THAW = 5,
CF_FunctionCode_SUSPEND = 6,
CF_FunctionCode_RESUME = 7,
CF_FunctionCode_CANCEL = 8,
CF_FunctionCode_ABANDON = 9,
CF_FunctionCode_SET_PARAM = 10,
CF_FunctionCode_GET_PARAM = 11,
CF_FunctionCode_WRITE_QUEUE = 15,
CF_FunctionCode_ENABLE_DEQUEUE = 16,
CF_FunctionCode_DISABLE_DEQUEUE = 17,
CF_FunctionCode_ENABLE_DIR_POLLING = 18,
CF_FunctionCode_DISABLE_DIR_POLLING = 19,
CF_FunctionCode_PURGE_QUEUE = 21,
CF_FunctionCode_ENABLE_ENGINE = 22,
CF_FunctionCode_DISABLE_ENGINE = 23,
CF_FunctionCode_NOOP = 0,
CF_FunctionCode_RESET_COUNTERS_COMPAT = 1,
CF_FunctionCode_TX_FILE_COMPAT = 2,
CF_FunctionCode_PLAYBACK_DIR_COMPAT = 3,
CF_FunctionCode_FREEZE_COMPAT = 4,
CF_FunctionCode_THAW_COMPAT = 5,
CF_FunctionCode_SUSPEND_COMPAT = 6,
CF_FunctionCode_RESUME_COMPAT = 7,
CF_FunctionCode_CANCEL_COMPAT = 8,
CF_FunctionCode_ABANDON_COMPAT = 9,
CF_FunctionCode_SET_PARAM_COMPAT = 10,
CF_FunctionCode_GET_PARAM_COMPAT = 11,
CF_FunctionCode_WRITE_QUEUE_COMPAT = 15,
CF_FunctionCode_ENABLE_DEQUEUE_COMPAT = 16,
CF_FunctionCode_DISABLE_DEQUEUE_COMPAT = 17,
CF_FunctionCode_ENABLE_DIR_POLLING_COMPAT = 18,
CF_FunctionCode_DISABLE_DIR_POLLING_COMPAT = 19,
CF_FunctionCode_PURGE_QUEUE_COMPAT = 21,

/* NOTE: these commands did not change (they have no args) */
CF_FunctionCode_ENABLE_ENGINE = 22,
CF_FunctionCode_DISABLE_ENGINE = 23,

CF_FunctionCode_RESET_COUNTERS = 31,
CF_FunctionCode_TX_FILE = 32,
CF_FunctionCode_PLAYBACK_DIR = 33,
CF_FunctionCode_FREEZE = 34,
CF_FunctionCode_THAW = 35,
CF_FunctionCode_SUSPEND = 36,
CF_FunctionCode_RESUME = 37,
CF_FunctionCode_CANCEL = 38,
CF_FunctionCode_ABANDON = 39,
CF_FunctionCode_SET_PARAM = 40,
CF_FunctionCode_GET_PARAM = 41,
CF_FunctionCode_WRITE_QUEUE = 45,
CF_FunctionCode_ENABLE_DEQUEUE = 46,
CF_FunctionCode_DISABLE_DEQUEUE = 47,
CF_FunctionCode_ENABLE_DIR_POLLING = 48,
CF_FunctionCode_DISABLE_DIR_POLLING = 49,
CF_FunctionCode_PURGE_QUEUE = 51,

};

#endif
#endif
78 changes: 78 additions & 0 deletions config/default_cf_msgdefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,16 @@ typedef struct CF_EotPacket_Payload
* \{
*/

/**
* \brief Command payload argument union to support 4 uint8's, 2 uint16's or 1 uint32
*/
typedef union CF_UnionArgs_CompatPayload
{
uint32 dword; /**< \brief Generic uint32 argument */
uint16 hword[2]; /**< \brief Generic uint16 array of arguments */
uint8 byte[4]; /**< \brief Generic uint8 array of arguments */
} CF_UnionArgs_CompatPayload_t;

/**
* \brief Enum labels for use for Reset cmd
*/
Expand Down Expand Up @@ -335,6 +345,17 @@ typedef struct CF_GetParam_Payload
CF_ChannelSelect_t chan_num; /**< \brief Channel number */
} CF_GetParam_Payload_t;

/**
* \brief Get parameter command structure
*
* For command details see #CF_GET_PARAM_CC
*/
typedef struct CF_GetParam_CompatPayload
{
uint8 key; /**< \brief Parameter key, see #CF_GetSet_ValueID_t */
uint8 chan_num; /**< \brief Channel number */
} CF_GetParam_CompatPayload_t;

/**
* \brief Set parameter command structure
*
Expand All @@ -348,6 +369,19 @@ typedef struct CF_SetParam_Payload
uint8 spare[2]; /**< \brief Alignment spare, uint32 multiple */
} CF_SetParam_Payload_t;

/**
* \brief Set parameter command structure
*
* For command details see #CF_SET_PARAM_CC
*/
typedef struct CF_SetParam_CompatPayload
{
uint32 value; /**< \brief Parameter value to set */
uint8 key; /**< \brief Parameter key, see #CF_GetSet_ValueID_t */
uint8 chan_num; /**< \brief Channel number */
uint8 spare[2]; /**< \brief Alignment spare, uint32 multiple */
} CF_SetParam_CompatPayload_t;

/**
* \brief Transmit file command structure
*
Expand All @@ -364,6 +398,22 @@ typedef struct CF_TxFile_Payload
char dst_filename[CF_FILENAME_MAX_LEN]; /**< \brief Destination file/directory name */
} CF_TxFile_Payload_t;

/**
* \brief Transmit file command structure
*
* For command details see #CF_TX_FILE_CC
*/
typedef struct CF_TxFile_CompatPayload
{
uint8 cfdp_class; /**< \brief CFDP class: 0=class 1, 1=class 2 */
uint8 keep; /**< \brief Keep file flag: 1=keep, else delete */
uint8 chan_num; /**< \brief Channel number */
uint8 priority; /**< \brief Priority: 0=highest priority */
CF_EntityId_t dest_id; /**< \brief Destination entity id */
char src_filename[CF_FILENAME_MAX_LEN]; /**< \brief Source file/directory name */
char dst_filename[CF_FILENAME_MAX_LEN]; /**< \brief Destination file/directory name */
} CF_TxFile_CompatPayload_t;

/**
* \brief Write Queue command structure
*
Expand All @@ -379,6 +429,21 @@ typedef struct CF_WriteQueue_Payload
char filename[CF_FILENAME_MAX_LEN]; /**< \brief Filename written to */
} CF_WriteQueue_Payload_t;

/**
* \brief Write Queue command structure
*
* For command details see #CF_WRITE_QUEUE_CC
*/
typedef struct CF_WriteQueue_CompatPayload
{
uint8 type; /**< \brief Transaction direction: all=0, up=1, down=2 */
uint8 chan; /**< \brief Channel number */
uint8 queue; /**< \brief Queue type: 0=pending, 1=active, 2=history, 3=all */
uint8 spare; /**< \brief Alignment spare, puts filename on 32-bit boundary */

char filename[CF_FILENAME_MAX_LEN]; /**< \brief Filename written to */
} CF_WriteQueue_CompatPayload_t;

/**
* \brief Transaction command structure
*
Expand All @@ -394,6 +459,19 @@ typedef struct CF_Transaction_Payload
uint8 spare[2]; /**< \brief Alignment spare for 32-bit multiple */
} CF_Transaction_Payload_t;

/**
* \brief Transaction command structure
*
* For command details see #CF_SUSPEND_CC, #CF_RESUME_CC, #CF_CANCEL_CC, #CF_ABANDON_CC
*/
typedef struct CF_Transaction_CompatPayload
{
CF_TransactionSeq_t ts; /**< \brief Transaction sequence number */
CF_EntityId_t eid; /**< \brief Entity id */
uint8 chan; /**< \brief Channel number: 254=use ts, 255=all channels, else channel */
uint8 spare[3]; /**< \brief Alignment spare for 32-bit multiple */
} CF_Transaction_CompatPayload_t;

/**\}*/

/**
Expand Down
Loading
Loading