Skip to content

Commit

Permalink
Merge pull request nasa#98 from jphickey/fix-42-naming-conventions
Browse files Browse the repository at this point in the history
Fix nasa#42, naming conventions and style compliance
  • Loading branch information
astrogeco authored Dec 9, 2021
2 parents 1725cd0 + 6bde5e5 commit a894069
Show file tree
Hide file tree
Showing 48 changed files with 6,163 additions and 5,881 deletions.
4 changes: 2 additions & 2 deletions fsw/platform_inc/cf_platform_cfg.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
** \par Limits
** Must be one of uint8, uint16, uint32, uint64.
*/
typedef uint8 cf_entity_id_t;
typedef uint8 CF_EntityId_t;

/**
** \cfcfg transaction sequence number size
Expand All @@ -56,7 +56,7 @@ typedef uint8 cf_entity_id_t;
** \par Limits
** Must be one of uint8, uint16, uint32, uint64.
*/
typedef uint32 cf_transaction_seq_t;
typedef uint32 CF_TransactionSeq_t;

/**
** \cfcfg CF_HW_ALIGNMENT and CF_SW_ALIGNMENT
Expand Down
41 changes: 21 additions & 20 deletions fsw/platform_inc/cf_tbldefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,19 @@
#include "cf_platform_cfg.h"
#include "cf_cfdp_pdu.h"

typedef struct
typedef struct CF_PollDir
{
uint32_t interval_sec; /* number of seconds to wait before trying a new directory.
Must be >0 or slot is inactive. */
uint8 priority; /* priority to use when placing transactions on the pending queue */
cfdp_class_t cfdp_class; /* the CFDP class to send */
cf_entity_id_t dest_eid; /* destination entity id */
char src_dir[CF_FILENAME_MAX_PATH]; /* path to source dir */
char dst_dir[CF_FILENAME_MAX_PATH]; /* path to destination dir */
uint8 enabled;
} polldir_t;
uint32_t interval_sec; /* number of seconds to wait before trying a new directory.
Must be >0 or slot is inactive. */
uint8 priority; /* priority to use when placing transactions on the pending queue */
CF_CFDP_Class_t cfdp_class; /* the CFDP class to send */
CF_EntityId_t dest_eid; /* destination entity id */
char src_dir[CF_FILENAME_MAX_PATH]; /* path to source dir */
char dst_dir[CF_FILENAME_MAX_PATH]; /* path to destination dir */
uint8 enabled;
} CF_PollDir_t;

typedef struct
typedef struct CF_ChannelConfig
{
uint32 max_outgoing_messages_per_wakeup; /* max number of messages to send per wakeup (0 - unlimited) */
uint32 rx_max_messages_per_wakeup; /* max number of rx messages to process per wakeup */
Expand All @@ -52,30 +52,31 @@ typedef struct

uint16 pipe_depth_input; /* depth of pipe to receive incoming pdu */

polldir_t polldir[CF_MAX_POLLING_DIR_PER_CHAN];
CF_PollDir_t polldir[CF_MAX_POLLING_DIR_PER_CHAN];

char sem_name[OS_MAX_API_NAME]; /* name of throttling semaphore in TO */
uint8 dequeue_enabled; /* if 1, then the channel will make pending transactions active */
} cf_channel_t;
} CF_ChannelConfig_t;

typedef struct
typedef struct CF_ConfigTable
{
uint32 ticks_per_second; /* expected ticks per second to cfdp app */
uint32 rx_crc_calc_bytes_per_wakeup; /* max number of bytes per wakeup to calculate r2 crc for recvd file (must by
1024-byte aligned */

cf_entity_id_t local_eid; /* the local entity ID of the CF app */
CF_EntityId_t local_eid; /* the local entity ID of the CF app */

cf_channel_t chan[CF_NUM_CHANNELS];
uint32 ack_timer_s; /* in seconds */
uint32 nak_timer_s; /* in seconds */
uint32 inactivity_timer_s; /* in seconds */
CF_ChannelConfig_t chan[CF_NUM_CHANNELS];

uint32 ack_timer_s; /* in seconds */
uint32 nak_timer_s; /* in seconds */
uint32 inactivity_timer_s; /* in seconds */

uint8 ack_limit; /* number of times to retry ACK (for ex, send fin and wait for fin-ack) */
uint8 nak_limit; /* number of times to retry NAK before giving up (resets on a single response */

uint16 outgoing_file_chunk_size; /* size of outgoing file data PDUs */
char tmp_dir[CF_FILENAME_MAX_PATH]; /* temp directory to put temp files */
} cf_config_table_t;
} CF_ConfigTable_t;

#endif /* !CF_TBLDEFS__H */
6 changes: 3 additions & 3 deletions fsw/src/cf_app.c
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ static void CF_CheckTables(void)
*************************************************************************/
static int32 CF_ValidateConfigTable(void *tbl_ptr)
{
cf_config_table_t *tbl = (cf_config_table_t *)tbl_ptr;
CF_ConfigTable_t *tbl = (CF_ConfigTable_t *)tbl_ptr;
int32 ret; /* initialized below */
static const int32 no_ticks_per_second = -1;
static const int32 crc_alignment = -2;
Expand All @@ -129,7 +129,7 @@ static int32 CF_ValidateConfigTable(void *tbl_ptr)
"CF: config table has rx crc size not aligned with 1024");
ret = crc_alignment; /* must be 1024-byte aligned */
}
else if (tbl->outgoing_file_chunk_size > sizeof(pdu_fd_data_t))
else if (tbl->outgoing_file_chunk_size > sizeof(CF_CFDP_PduFileDataContent_t))
{
CFE_EVS_SendEvent(CF_EID_ERR_INIT_OUTGOING_SIZE, CFE_EVS_EventType_ERROR,
"CF: config table has outgoing file chunk size too large");
Expand Down Expand Up @@ -159,7 +159,7 @@ static int32 CF_TableInit(void)
{
int32 status = CFE_SUCCESS;

status = CFE_TBL_Register(&CF_AppData.config_handle, CF_CONFIG_TABLE_NAME, sizeof(cf_config_table_t),
status = CFE_TBL_Register(&CF_AppData.config_handle, CF_CONFIG_TABLE_NAME, sizeof(CF_ConfigTable_t),
CFE_TBL_OPT_SNGL_BUFFER | CFE_TBL_OPT_LOAD_DUMP, CF_ValidateConfigTable);
if (status != CFE_SUCCESS)
{
Expand Down
10 changes: 5 additions & 5 deletions fsw/src/cf_app.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,17 @@

typedef struct
{
cf_hk_packet_t hk;
cf_cfg_packet_t cfg;
CF_HkPacket_t hk;
CF_ConfigPacket_t cfg;

uint32 run_status;

CFE_SB_PipeId_t cmd_pipe;

CFE_TBL_Handle_t config_handle;
cf_config_table_t *config_table;
CFE_TBL_Handle_t config_handle;
CF_ConfigTable_t *config_table;

cfdp_engine_t engine;
CF_Engine_t engine;
} CF_AppData_t;

extern CF_AppData_t CF_AppData;
Expand Down
Loading

0 comments on commit a894069

Please sign in to comment.