Skip to content

Commit

Permalink
Merge pull request #294 from skliper/fix206-documentation_1
Browse files Browse the repository at this point in the history
Fix #18 #206 #287, Comment cleanup and spelling
  • Loading branch information
dzbaker authored Jul 28, 2022
2 parents a72855d + a395ff5 commit 557c132
Show file tree
Hide file tree
Showing 22 changed files with 912 additions and 202 deletions.
12 changes: 6 additions & 6 deletions fsw/platform_inc/cf_platform_cfg.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ typedef uint32 CF_TransactionSeq_t;
* Dictates the pipe depth of the cf command pipe.
*
* @par Limits:
* The minimum size of this paramater is 1
* The minimum size of this parameter is 1
* The maximum size dictated by cFE platform configuration
* parameter is CFE_SB_MAX_PIPE_DEPTH
*/
Expand All @@ -95,7 +95,7 @@ typedef uint32 CF_TransactionSeq_t;
* @brief Number of channels
*
* @par Description:
* The number of chanenls in the engine. Changing this
* The number of channels in the engine. Changing this
* value changes the configuration table for the application.
*
* @par Limits:
Expand Down Expand Up @@ -123,13 +123,13 @@ typedef uint32 CF_TransactionSeq_t;
* Number of chunks per transaction per channel (RX).
*
* CHUNKS -
* A chunk is a representatino of a range range (offset, size) of data received by a receiver.
* A chunk is a representation of a range range (offset, size) of data received by a receiver.
*
* Class 2 CFDP deals with NAK, so received data must be tracked for receivers in order to generate
* the NAK. The sender must also keep track of NAK requests and send new file data PDUs as a result.
* (array size must be CF_NUM_CHANNELS)
* CF_CHANNEL_NUM_RX_CHUNKS_PER_TRANSACTION is an array for each channel indicating the number of chunks per transaction
* CF_CHANNEL_NUM_TX_CHUNKS_PER_TRANSACTION is an array for each channel indciate the number of chunks to keep track of
* CF_CHANNEL_NUM_TX_CHUNKS_PER_TRANSACTION is an array for each channel indicate the number of chunks to keep track of
* NAK requests from the receiver per transaction
*
* @par Limits:
Expand Down Expand Up @@ -197,7 +197,7 @@ typedef uint32 CF_TransactionSeq_t;
* @brief Max number of commanded playback directories per channel.
*
* @par Description:
* Each channel can support this number of groudn commanded directory playbacks.
* Each channel can support this number of ground commanded directory playbacks.
*
* @par Limits:
*
Expand All @@ -217,7 +217,7 @@ typedef uint32 CF_TransactionSeq_t;
#define CF_MAX_POLLING_DIR_PER_CHAN (5)

/**
* @brief Number of transactions per playback directoriy.
* @brief Number of transactions per playback directory.
*
* @par Description:
* Each playback/polling directory operation will be able to have this
Expand Down
2 changes: 1 addition & 1 deletion fsw/src/cf_app.c
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ int32 CF_Init(void)
status = CFE_SB_CreatePipe(&CF_AppData.cmd_pipe, CF_PIPE_DEPTH, CF_PIPE_NAME);
if (status != CFE_SUCCESS)
{
CFE_ES_WriteToSysLog("CF app: error creating pipe %s, returend 0x%08lx", CF_PIPE_NAME,
CFE_ES_WriteToSysLog("CF app: error creating pipe %s, returned 0x%08lx", CF_PIPE_NAME,
(unsigned long)status);
}
}
Expand Down
23 changes: 9 additions & 14 deletions fsw/src/cf_cfdp.c
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ CF_Logical_PduBuffer_t *CF_CFDP_ConstructPduHeader(const CF_Transaction_t *t, CF

hdr->version = 1;
hdr->pdu_type = (directive_code == 0); /* set to '1' for file data pdu, '0' for a directive pdu */
hdr->direction = (towards_sender != 0); /* set to '1' for toward sender, '0' for toward recevier */
hdr->direction = (towards_sender != 0); /* set to '1' for toward sender, '0' for toward receiver */
hdr->txm_mode = (CF_CFDP_GetClass(t) == CF_CFDP_CLASS_1); /* set to '1' for class 1 data, '0' for class 2 */

/* choose the larger of the two EIDs to determine size */
Expand Down Expand Up @@ -374,10 +374,8 @@ CF_SendRet_t CF_CFDP_SendMd(CF_Transaction_t *t)
/* this does not actually copy here - that is done during encode */
md->source_filename.length =
CF_strnlen(t->history->fnames.src_filename, sizeof(t->history->fnames.src_filename));
;
md->source_filename.data_ptr = t->history->fnames.src_filename;
md->dest_filename.length = CF_strnlen(t->history->fnames.dst_filename, sizeof(t->history->fnames.dst_filename));
;
md->dest_filename.data_ptr = t->history->fnames.dst_filename;

CF_CFDP_EncodeMd(ph->penc, md);
Expand Down Expand Up @@ -805,7 +803,6 @@ int CF_CFDP_RecvFd(CF_Transaction_t *t, CF_Logical_PduBuffer_t *ph)
*-----------------------------------------------------------------*/
int CF_CFDP_RecvEof(CF_Transaction_t *t, CF_Logical_PduBuffer_t *ph)
{
/* CF_CFDP_RecvPh() must have been called before this, so use ldst to access pdu header */
int ret = 0;

CF_CFDP_DecodeEof(ph->pdec, &ph->int_header.eof);
Expand All @@ -830,7 +827,6 @@ int CF_CFDP_RecvEof(CF_Transaction_t *t, CF_Logical_PduBuffer_t *ph)
*-----------------------------------------------------------------*/
int CF_CFDP_RecvAck(CF_Transaction_t *t, CF_Logical_PduBuffer_t *ph)
{
/* CF_CFDP_RecvPh() must have been called before this, so use ldst to access pdu header */
int ret = 0;

CF_CFDP_DecodeAck(ph->pdec, &ph->int_header.ack);
Expand All @@ -856,7 +852,6 @@ int CF_CFDP_RecvAck(CF_Transaction_t *t, CF_Logical_PduBuffer_t *ph)
*-----------------------------------------------------------------*/
int CF_CFDP_RecvFin(CF_Transaction_t *t, CF_Logical_PduBuffer_t *ph)
{
/* CF_CFDP_RecvPh() must have been called before this, so use ldst to access pdu header */
int ret = 0;

CF_CFDP_DecodeFin(ph->pdec, &ph->int_header.fin);
Expand All @@ -869,7 +864,7 @@ int CF_CFDP_RecvFin(CF_Transaction_t *t, CF_Logical_PduBuffer_t *ph)
}

/* NOTE: right now we don't care about the fault location */
/* nothing to do for this one. all fields are bytes */
/* nothing to do for this one. All fields are bytes */
return ret;
}

Expand Down Expand Up @@ -968,7 +963,7 @@ void CF_CFDP_RecvIdle(CF_Transaction_t *t, CF_Logical_PduBuffer_t *ph)
status = CF_CFDP_RecvMd(t, ph);
if (!status)
{
/* NOTE: whether or not class 1 or 2, get a free chunks. it's cheap, and simplifies cleanup path */
/* NOTE: whether or not class 1 or 2, get a free chunks. It's cheap, and simplifies cleanup path */
t->state = ph->pdu_header.txm_mode ? CF_TxnState_R1 : CF_TxnState_R2;
t->flags.rx.md_recv = 1;
CF_CFDP_R_Init(t); /* initialize R */
Expand Down Expand Up @@ -1146,7 +1141,7 @@ void CF_CFDP_CycleTx(CF_Channel_t *c)

/* loop through as long as there are pending transactions, and a message buffer to send their pdus on */

/* NOTE: tick processesing is higher priority than sending new filedata pdus, so only send however many
/* NOTE: tick processing is higher priority than sending new filedata pdus, so only send however many
* PDUs that can be sent once we get to here */
if (!c->cur)
{ /* don't enter if cur is set, since we need to pick up where we left off on tick processing next wakeup */
Expand Down Expand Up @@ -1235,7 +1230,7 @@ void CF_CFDP_TickTransactions(CF_Channel_t *c)
CF_CList_Traverse(c->qs[qs[c->tick_type]], CF_CFDP_DoTick, &args);
if (args.early_exit)
{
/* early exit means we ran out of availalbe outgoing messages this wakeup.
/* early exit means we ran out of available outgoing messages this wakeup.
* If current tick type is nak response, then reset tick type. It would be
* bad to let NAK response starve out RX or TXW ticks on the next cycle.
*
Expand Down Expand Up @@ -1317,7 +1312,7 @@ static void CF_CFDP_TxFile_Initiate(CF_Transaction_t *t, CF_CFDP_Class_t cfdp_cl

CF_CFDP_ArmInactTimer(t);

/* NOTE: whether or not class 1 or 2, get a free chunks. it's cheap, and simplifies cleanup path */
/* NOTE: whether or not class 1 or 2, get a free chunks. It's cheap, and simplifies cleanup path */
t->chunks = CF_CFDP_FindUnusedChunks(&CF_AppData.engine.channels[chan], CF_Direction_TX);
CF_InsertSortPrio(t, CF_QueueIdx_PEND);
}
Expand Down Expand Up @@ -1596,7 +1591,7 @@ void CF_CFDP_ProcessPollingDirectories(CF_Channel_t *c)
}
else
{
/* error occured in playback directory, so reset the timer */
/* error occurred in playback directory, so reset the timer */
/* an event is sent in CF_CFDP_PlaybackDir_Initiate so there is no reason to
* to have another here */
CF_Timer_InitRelSec(&p->interval_timer, pd->interval_sec);
Expand Down Expand Up @@ -1701,7 +1696,7 @@ void CF_CFDP_ResetTransaction(CF_Transaction_t *t, int keep_history)

if (t->p)
{
/* a playback's transaction is now done. decrement the playback counter */
/* a playback's transaction is now done, decrement the playback counter */
CF_Assert(t->p->num_ts);
--t->p->num_ts;
}
Expand Down Expand Up @@ -1813,7 +1808,7 @@ void CF_CFDP_DisableEngine(void)
CF_CList_Traverse(c->qs[CLOSE_QUEUES[j]], CF_CFDP_CloseFiles, NULL);
}

/* any playback directories need to have their dirents closed */
/* any playback directories need to have their directory ids closed */
for (j = 0; j < CF_MAX_COMMANDED_PLAYBACK_DIRECTORIES_PER_CHAN; ++j)
{
if (c->playback[j].busy)
Expand Down
18 changes: 9 additions & 9 deletions fsw/src/cf_cfdp.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ void CF_CFDP_EncodeStart(CF_EncoderState_t *penc, void *msgbuf, CF_Logical_PduBu

/********************************************************************************/
/**
* @brief Initiate the process of decoding a receieved PDU
* @brief Initiate the process of decoding a received PDU
*
* This resets the decoder and PDU buffer to initial values, and prepares for decoding a new PDU
* that was received from a remote entity.
Expand Down Expand Up @@ -186,7 +186,7 @@ int32 CF_CFDP_PlaybackDir(const char *src_filename, const char *dst_filename, CF
* @param dst_eid Value to set in destination entity ID field
* @param towards_sender Whether this is transmitting toward the sender entity
* @param tsn Transaction sequence number to put into PDU
* @param silent If true, supresses error event if no message buffer available
* @param silent If true, suppress error event if no message buffer available
*
* @returns Pointer to PDU buffer which may be filled with additional data
* @retval NULL if no message buffer available
Expand Down Expand Up @@ -222,7 +222,7 @@ CF_SendRet_t CF_CFDP_SendMd(CF_Transaction_t *t);
* @note Unlike other "send" routines, the file data PDU must be acquired and
* filled by the caller prior to invoking this routine. This routine only
* sends the PDU that was previously allocated and assembled. As such, the
* typical failure possibilies do not apply to this call.
* typical failure possibilities do not apply to this call.
*
* @returns CF_SendRet_t status code
* @retval CF_SendRet_SUCCESS on success.
Expand Down Expand Up @@ -301,7 +301,7 @@ CF_SendRet_t CF_CFDP_SendFin(CF_Transaction_t *t, CF_CFDP_FinDeliveryCode_t dc,
* @note Unlike other "send" routines, the NAK PDU must be acquired and
* filled by the caller prior to invoking this routine. This routine only
* encodes and sends the previously-assembled PDU buffer. As such, the
* typical failure possibilies do not apply to this call.
* typical failure possibilities do not apply to this call.
*
* @returns CF_SendRet_t status code
* @retval CF_SendRet_SUCCESS on success.
Expand Down Expand Up @@ -403,7 +403,7 @@ int CF_CFDP_RecvEof(CF_Transaction_t *t, CF_Logical_PduBuffer_t *ph);
/** @brief Unpack an ack PDU from a received message.
*
* This should only be invoked for buffers that have been identified
* as an acknowledgement PDU.
* as an acknowledgment PDU.
*
* @par Assumptions, External Events, and Notes:
* t must not be NULL.
Expand Down Expand Up @@ -441,7 +441,7 @@ int CF_CFDP_RecvFin(CF_Transaction_t *t, CF_Logical_PduBuffer_t *ph);
/** @brief Unpack a nak PDU from a received message.
*
* This should only be invoked for buffers that have been identified
* as an negative/non-acknowledgement PDU.
* as an negative/non-acknowledgment PDU.
*
* @par Assumptions, External Events, and Notes:
* t must not be NULL.
Expand Down Expand Up @@ -615,7 +615,7 @@ void CF_CFDP_CycleTx(CF_Channel_t *c);
* data pdus until there are no outgoing message buffers.
*
* @par Assumptions, External Events, and Notes:
* node must not be NULL. context must not be NULL.
* node must not be NULL. Context must not be NULL.
*
* @param node Pointer to list node
* @param context Pointer to CF_CFDP_CycleTx_args_t object (passed through)
Expand Down Expand Up @@ -649,7 +649,7 @@ void CF_CFDP_TickTransactions(CF_Channel_t *c);
* if a valid file is found initiates playback on it.
*
* @par Assumptions, External Events, and Notes:
* c must not be NULL. p must not be NULL.
* c must not be NULL, p must not be NULL.
*
* @param c The channel associated with the playback
* @param p The playback state
Expand All @@ -676,7 +676,7 @@ void CF_CFDP_ProcessPollingDirectories(CF_Channel_t *c);
* This helper is used in conjunction with CF_CList_Traverse().
*
* @par Assumptions, External Events, and Notes:
* node must not be NULL. context must not be NULL.
* node must not be NULL, context must not be NULL.
*
* @param node Pointer to list node
* @param context Pointer to CF_CFDP_Tick_args_t object (passed through)
Expand Down
4 changes: 2 additions & 2 deletions fsw/src/cf_cfdp_dispatch.c
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,9 @@ void CF_CFDP_S_DispatchRecv(CF_Transaction_t *t, CF_Logical_PduBuffer_t *ph,
(unsigned long)t->history->src_eid, (unsigned long)t->history->seq_num);
}

/* check that there's a valid function pointer. if there isn't,
/* check that there's a valid function pointer. If there isn't,
* then silently ignore. We may want to discuss if it's worth
* shutting down the whole transation if a PDU is received
* shutting down the whole transaction if a PDU is received
* that doesn't make sense to be received (For example,
* class 1 CFDP receiving a NAK PDU) but for now, we silently
* ignore the received packet and keep chugging along. */
Expand Down
4 changes: 2 additions & 2 deletions fsw/src/cf_cfdp_dispatch.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ typedef struct
} CF_CFDP_FileDirectiveDispatchTable_t;

/**
* @brief A dispatch table for receive file transactions, recieve side
* @brief A dispatch table for receive file transactions, receive side
*
* This is used for "receive file" transactions upon receipt of a directive PDU.
* Depending on the sub-state of the transaction, a different action may be taken.
Expand Down Expand Up @@ -125,7 +125,7 @@ typedef struct

/************************************************************************/
/**
* @brief Dispatch function for received PDUs on receieve-file transactions
* @brief Dispatch function for received PDUs on receive-file transactions
*
* Receive file transactions primarily only react/respond to received PDUs
*
Expand Down
10 changes: 5 additions & 5 deletions fsw/src/cf_cfdp_pdu.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
* Structures defining to CFDP PDUs
*
* Note that structures and enumerations defined in this file with a CF_CFDP
* prefix are defined according to the CCSDS CFDP specifiction (727.0-B-5).
* prefix are defined according to the CCSDS CFDP specification (727.0-B-5).
* These values must match the specification for that structure/field, they are
* not locally changeable.
*
Expand Down Expand Up @@ -232,9 +232,9 @@ typedef enum
} CF_CFDP_Class_t;

/**
* @brief Values for "acknowledgement transfer status"
* @brief Values for "acknowledgment transfer status"
*
* This enum is pertient to the ACK PDU type, defines the
* This enum is pertinent to the ACK PDU type, defines the
* values for the directive field.
*
* Defined per section 5.2.4 / table 5-8 of CCSDS 727.0-B-5
Expand All @@ -251,7 +251,7 @@ typedef enum
/**
* @brief Values for "finished delivery code"
*
* This enum is pertient to the FIN PDU type, defines the
* This enum is pertinent to the FIN PDU type, defines the
* values for the delivery code field.
*
* Defined per section 5.2.3 / table 5-7 of CCSDS 727.0-B-5
Expand All @@ -266,7 +266,7 @@ typedef enum
/**
* @brief Values for "finished file status"
*
* This enum is pertient to the FIN PDU type, defines the
* This enum is pertinent to the FIN PDU type, defines the
* values for the file status field.
*
* Defined per section 5.2.3 / table 5-7 of CCSDS 727.0-B-5
Expand Down
6 changes: 3 additions & 3 deletions fsw/src/cf_cfdp_r.c
Original file line number Diff line number Diff line change
Expand Up @@ -126,12 +126,12 @@ void CF_CFDP_R2_Complete(CF_Transaction_t *t, int ok_to_send_nak)
{
int send_nak = 0;
int send_fin = 0;
/* checking if r2 is complete. check nak list, and send NAK if appropriate */
/* checking if r2 is complete. Check nak list, and send NAK if appropriate */
/* if all data is present, then there will be no gaps in the chunk */

if (t->history->cc == CF_CFDP_ConditionCode_NO_ERROR)
{
/* first, check if md is received. if not, send specialized nak */
/* first, check if md is received. If not, send specialized nak */
if (!t->flags.rx.md_recv)
{
send_nak = 1;
Expand Down Expand Up @@ -716,7 +716,7 @@ int CF_CFDP_R2_CalcCrcChunk(CF_Transaction_t *t)
/* all bytes calculated, so now check */
if (!CF_CFDP_R_CheckCrc(t, t->state_data.r.r2.eof_crc))
{
/* crc matched! we are happy */
/* crc matched! We are happy */
t->keep = 1; /* save the file */

/* set fin pdu status */
Expand Down
4 changes: 2 additions & 2 deletions fsw/src/cf_cfdp_r.h
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ int CF_CFDP_R_CheckCrc(CF_Transaction_t *t, uint32 expected_crc);
* t must not be NULL.
*
* @param t Pointer to the transaction object
* @param ok_to_send_nak If set to 0, supresses sending of a NAK packet
* @param ok_to_send_nak If set to 0, suppress sending of a NAK packet
*/
void CF_CFDP_R2_Complete(CF_Transaction_t *t, int ok_to_send_nak);

Expand Down Expand Up @@ -288,7 +288,7 @@ void CF_CFDP_R2_SubstateRecvFileData(CF_Transaction_t *t, CF_Logical_PduBuffer_t
* This is a function callback from CF_ChunkList_ComputeGaps().
*
* @par Assumptions, External Events, and Notes:
* chunks must not be NULL. c must not be NULL. opaque must not be NULL.
* chunks must not be NULL, c must not be NULL, opaque must not be NULL.
*
* @retval 0 on success. Returns anything else on error.
*
Expand Down
2 changes: 1 addition & 1 deletion fsw/src/cf_cfdp_s.c
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ int32 CF_CFDP_S_SendFileData(CF_Transaction_t *t, uint32 foffs, uint32 bytes_to_

if (!ph)
{
ret = 0; /* couldn't get message, so no bytes sent. will try again next time */
ret = 0; /* couldn't get message, so no bytes sent. Will try again next time */
success = false;
}
else
Expand Down
2 changes: 1 addition & 1 deletion fsw/src/cf_cfdp_sbintf.c
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ void CF_CFDP_ReceiveMessage(CF_Channel_t *c)
t = CF_FindTransactionBySequenceNumber(c, ph->pdu_header.sequence_num, ph->pdu_header.source_eid);
if (t)
{
/* found one! send it to the transaction state processor */
/* found one! Send it to the transaction state processor */
CF_Assert(t->state > CF_TxnState_IDLE);
CF_CFDP_DispatchRecv(t, ph);
}
Expand Down
2 changes: 1 addition & 1 deletion fsw/src/cf_cfdp_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
typedef enum
{
CF_TxnState_IDLE = 0, /**< \brief State assigned to a newly allocated transaction object */
CF_TxnState_R1 = 1, /**< \brief Recieve file as class 1 */
CF_TxnState_R1 = 1, /**< \brief Receive file as class 1 */
CF_TxnState_S1 = 2, /**< \brief Send file as class 1 */
CF_TxnState_R2 = 3, /**< \brief Receive file as class 2 */
CF_TxnState_S2 = 4, /**< \brief Send file as class 2 */
Expand Down
Loading

0 comments on commit 557c132

Please sign in to comment.