Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #37, Sends message when file complete #39

Merged
merged 1 commit into from
Aug 3, 2022
Merged

Conversation

chillfig
Copy link
Contributor

Checklist (Please check before submitting)

Describe the contribution
A clear and concise description of what the contribution is.

Testing performed
Steps taken to test the contribution:

  1. Build steps '...'
  2. Execution steps '...'

Expected behavior changes
Generate a message when a file gets completed.

System(s) tested on

  • Ubuntu 18.04

Additional context
None

Third party code
If included, identify any third party code and provide text file of license

Contributor Info - All information REQUIRED for consideration of pull request
Justin Figueroa, ASRC Federal

@chillfig
Copy link
Contributor Author

chillfig commented Jul 21, 2022

@skliper Do I manually implement the stub function in apps/ds/unit-test/stubs in this pull request?

fsw/src/ds_file.c Fixed Show fixed Hide fixed
fsw/src/ds_file.c Fixed Show fixed Hide fixed
fsw/src/ds_file.c Fixed Show fixed Hide fixed
fsw/src/ds_file.c Fixed Show fixed Hide fixed
fsw/src/ds_file.c Fixed Show fixed Hide fixed
fsw/src/ds_file.c Fixed Show fixed Hide fixed
fsw/src/ds_file.c Fixed Show fixed Hide fixed
fsw/src/ds_file.c Fixed Show fixed Hide fixed
@chillfig chillfig force-pushed the send_msg branch 2 times, most recently from b6b6fc2 to 12d30a4 Compare July 21, 2022 17:46
fsw/src/ds_file.c Fixed Show fixed Hide fixed
@chillfig chillfig marked this pull request as draft July 21, 2022 17:50
@chillfig chillfig requested a review from skliper July 21, 2022 17:50
@chillfig chillfig marked this pull request as ready for review July 21, 2022 17:50
Copy link
Contributor

@skliper skliper left a comment

Choose a reason for hiding this comment

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

Great start! See comments. Since the new function is only called from ds_file.c it doesn't seem like you need to implement a stub. Just add a unit test within the ds_file_tests.c. Should also consider adding a requirement and updating the design slides, although the design slides aren't configuration managed within the repo anymore so we'll need to establish a new process.

fsw/src/ds_file.c Outdated Show resolved Hide resolved
fsw/src/ds_file.c Outdated Show resolved Hide resolved
fsw/src/ds_file.c Outdated Show resolved Hide resolved
fsw/src/ds_file.c Outdated Show resolved Hide resolved
fsw/src/ds_file.c Outdated Show resolved Hide resolved
@chillfig chillfig force-pushed the send_msg branch 4 times, most recently from 8a78e3c to a269a84 Compare July 25, 2022 18:05
fsw/src/ds_file.c Fixed Show fixed Hide fixed
fsw/src/ds_file.c Fixed Show fixed Hide fixed
@chillfig chillfig requested a review from skliper July 25, 2022 19:34
fsw/src/ds_file.c Outdated Show resolved Hide resolved
fsw/src/ds_msg.h Outdated Show resolved Hide resolved
fsw/src/ds_file.c Fixed Show fixed Hide fixed
/*
** Get the directory name...
*/
strncpy(FileStatus->FileName, PathName, sizeof(PathName));

Check warning

Code scanning / CodeQL-coding-standard

Unchecked return value

The return value of non-void function [strncpy](1) is not checked.
fsw/src/ds_file.c Fixed Show fixed Hide fixed
fsw/src/ds_file.c Fixed Show fixed Hide fixed
fsw/src/ds_file.c Outdated Show resolved Hide resolved
@chillfig chillfig force-pushed the send_msg branch 5 times, most recently from 3d3a084 to 49ebb24 Compare July 27, 2022 14:34
fsw/src/ds_file.c Fixed Show fixed Hide fixed
fsw/src/ds_file.c Fixed Show fixed Hide fixed
fsw/src/ds_file.c Fixed Show fixed Hide fixed
fsw/src/ds_file.c Fixed Show fixed Hide fixed
fsw/src/ds_file.c Fixed Show fixed Hide fixed
fsw/src/ds_file.c Fixed Show fixed Hide fixed
fsw/src/ds_file.c Fixed Show fixed Hide fixed
fsw/src/ds_file.c Fixed Show fixed Hide fixed
fsw/src/ds_file.c Fixed Show fixed Hide fixed
fsw/src/ds_file.c Fixed Show fixed Hide fixed
fsw/src/ds_file.c Fixed Show fixed Hide fixed
fsw/src/ds_file.c Fixed Show fixed Hide fixed
fsw/src/ds_file.c Fixed Show fixed Hide fixed
@chillfig chillfig force-pushed the send_msg branch 7 times, most recently from 26573f2 to 5c1b8b9 Compare July 28, 2022 18:28
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

void DS_FileTransmit(DS_AppFileStatus_t *FileStatus)

Check notice

Code scanning / CodeQL-coding-standard

Long function without assertion

All functions of more than 10 lines should have at least one assertion.
fsw/src/ds_msg.h Fixed Show fixed Hide fixed
@chillfig chillfig requested a review from skliper July 28, 2022 19:00
@chillfig chillfig changed the title Fix #37, Attempt to send message when file complete Fix #37, send message when file complete Jul 28, 2022
@chillfig chillfig changed the title Fix #37, send message when file complete Fix #37, Sends message when file compelte Jul 28, 2022
@chillfig chillfig changed the title Fix #37, Sends message when file compelte Fix #37, Sends message when file complete Jul 28, 2022
*/
if (PktBuf != NULL)
{
CFE_MSG_Init(&PktBuf->Pkt.TlmHeader.Msg, CFE_SB_ValueToMsgId(DS_COMP_TLM_MID), sizeof(*PktBuf));

Check warning

Code scanning / CodeQL-coding-standard

Unchecked return value

The return value of non-void function [CFE_MSG_Init](1) is not checked.
/*
** Set current open filename...
*/
strcpy(PktBuf->Pkt.FileInfo.FileName, FileStatus->FileName);

Check warning

Code scanning / CodeQL-coding-standard

Unchecked return value

The return value of non-void function [strcpy](1) is not checked.
** Timestamp and send file info telemetry...
*/
CFE_SB_TimeStampMsg(&PktBuf->Pkt.TlmHeader.Msg);
CFE_SB_TransmitBuffer(&PktBuf->SBBuf, true);

Check warning

Code scanning / CodeQL-coding-standard

Unchecked return value

The return value of non-void function [CFE_SB_TransmitBuffer](1) is not checked.
/*
** Set file age and size...
*/
PktBuf->Pkt.FileInfo.FileAge = FileStatus->FileAge;

Check warning

Code scanning / CodeQL-coding-standard

Unchecked function argument

This use of parameter FileStatus has not been checked.
fsw/src/ds_msg.h Outdated Show resolved Hide resolved
@chillfig chillfig force-pushed the send_msg branch 4 times, most recently from 79a445a to 32c0895 Compare August 2, 2022 19:25
Adds FileStatus as the sole parameter to DS_FileTransmit(), Adds unit test,
Adds inclusion of ds_apps.h to ds_msg.h, Removes whitespaces, Adds dereference,
Adds logic to extract data from FileStatus, Adds copy of Move Directory,
Removes ds_apps.h inclusion, Sets OpenState to DS_CLOSED,
Adds unit test, Adds buffer struct, Adds CFE_SB_AllocateMessageBuffer
and CFE_SB_TransmitBuffer, Adds pointer cast in CFE_SB_AllocateMessageBuffer,
Adds CFE_SB_ValueToMsgId to CFE_MSG_Init, Adds & to CFE_SB_TransmitBuffer,
Adds pointer cast to CFE_SB_TransmitBuffer, Adds format correction,
Adds CFE_SB_Buffer_t to DS_FileCompletePkt_t, Adds requirement to csv,
Update software buffer use to work correctly, Corrects whitespace in csv,
Adds buffer to unit test, Adds comment changes for doxygen and readability,
Changes \sa references in comment header of DS_FileTransmit(),
Adds DS_FileCompletePktBuf_t element comments
* that compiles with the alignment constraints of a CFE_SB_Buffer_t
*/
typedef union
{

Check notice

Code scanning / CodeQL-coding-standard

AV Rule 153

AV Rule 153: Unions shall not be used.
@skliper skliper added this to the Draco milestone Aug 3, 2022
@skliper
Copy link
Contributor

skliper commented Aug 3, 2022

@dzbaker I think this is ready to merge.

@dzbaker dzbaker merged commit 060607e into nasa:main Aug 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Send a message when new files are completed
4 participants