Skip to content

Fix #40, update traverse history/write file#174

Merged
astrogeco merged 1 commit intonasa:mainfrom
jphickey:fix-40-writefile
Jan 18, 2022
Merged

Fix #40, update traverse history/write file#174
astrogeco merged 1 commit intonasa:mainfrom
jphickey:fix-40-writefile

Conversation

@jphickey
Copy link
Copy Markdown
Contributor

Describe the contribution

  • rename the functions to better indicate what they do
  • do not discard the part of the output that has EID/TSN/CC information
  • do not pass the return value of snprintf directly to write(), use strlen()
  • simplify the code

Fixes #40

Testing performed
Build and unit test CF.
Run two instances of CFE+CF, execute transfer in both directions and confirm
Issue CF_WRITE_QUEUE_CC (15) to write the transaction and history queues to the file
Confirm contents of the file are correct.

Expected behavior changes
The file contains the information it is intended to contain, mainly the SEQ/DIR/PEER/CC bits are not omitted. There is also no risk of buffer overruns.

Here is an example file output, after running two transactions between two nodes (one RX, one TX)

SEQ (2, 1)      DIR: RX PEER 2  CC: 0   SRC: /cf/testfile2      DST: /cf/testfile2
SEQ (1, 1)      DIR: TX PEER 2  CC: 0   SRC: /cf/testfile1      DST: /cf/testfile1

System(s) tested on
Ubuntu 21.10

Contributor Info - All information REQUIRED for consideration of pull request
Joseph Hickey, Vantage Systems, Inc.

- rename the function to better indicate what it does
- do not discard the part of the output that has EID/TSN/CC information
- do not pass the return value of snprintf directly to write(), use strlen()
- simplify the code
@jphickey jphickey added the CCB:Ready Ready for discussion at the Configuration Control Board (CCB) label Jan 13, 2022
@astrogeco astrogeco requested a review from skliper January 18, 2022 06:10
@astrogeco astrogeco merged commit fe02332 into nasa:main Jan 18, 2022
@astrogeco astrogeco added CCB:Approved and removed CCB:Ready Ready for discussion at the Configuration Control Board (CCB) labels Jan 19, 2022
@astrogeco
Copy link
Copy Markdown
Contributor

CCB:2022-01-19 APPROVED

@jphickey jphickey deleted the fix-40-writefile branch March 11, 2022 15:48
@skliper skliper added this to the Draco milestone Mar 25, 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.

CF_TraverseHistory string buffer handling

3 participants