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

cFS Header Version 2 (includes CCSDS Extended header) support and major update #92

Merged

Conversation

skliper
Copy link
Contributor

@skliper skliper commented May 21, 2020

Describe the contribution

This is a major rewrite of the tool that resolves the issues above and:

  • All header fields can now be set (or overridden)
  • Little endian with forced big endian fields are supported for raw packet generation (from scratch)
  • Added protocol options (no recompile needed) including raw
  • Added test script
  • Added debug and -m32 build options

Testing performed
See tests.sh - verified all raw outputs are as expected (and error responses)
Built from bundle with both default (64 bit) and 32 bit, confirmed same output from tests.sh from both and no warnings w/ strict flags.

Expected behavior changes
Default behavior is the same except adds checksum and doesn't actually require fields

  • Adds all the packet fields, overrides, more supported data types, etc

System(s) tested on

  • Hardware: cFS Dev Server 3
  • OS: Ubuntu 18.04
  • Versions: Bundle + this PR

Additional context
None

Third party code
None

Contributor Info - All information REQUIRED for consideration of pull request
Jacob Hageman - NASA/GSFC

@skliper skliper changed the title Version 2 support and various cleanup (WIP) Version 2 support and various cleanup May 21, 2020
@skliper skliper added the enhancement New feature or request label May 21, 2020
@skliper skliper added this to the 2.2.0 milestone May 21, 2020
@skliper skliper force-pushed the fix80-v2-plus-general-cleanup branch from 84ef00b to a959171 Compare May 21, 2020 18:07
astrogeco and others added 3 commits May 22, 2020 10:49
Added header guard
Removed local parameter hiding global
@skliper skliper added the CCB:Ready Pull request is ready for discussion at the Configuration Control Board (CCB) label May 26, 2020
@skliper skliper force-pushed the fix80-v2-plus-general-cleanup branch 3 times, most recently from 4d812ea to c44cdfd Compare May 26, 2020 20:05
Major rewrite -
Fix nasa#2: Added 64-bit support
Added big endian payload options (use when LE selected to write BE fields)
Fix nasa#3: Added checksum calculation/overide
Added the rest of the override possible fields (for error checking)
Fix nasa#48: Added standard type options (more clear/consistant sizing)
Fix nasa#80: Added cFS Version 2 header support
Added protocol options
Added raw message generation support
Added test script
Added debug and thirtytwo build options
@skliper skliper force-pushed the fix80-v2-plus-general-cleanup branch from c44cdfd to 3e62ff8 Compare May 26, 2020 20:25
@skliper skliper changed the title (WIP) Version 2 support and various cleanup Version 2 support and major update May 26, 2020
@skliper skliper marked this pull request as ready for review May 26, 2020 20:26
@astrogeco
Copy link
Contributor

@skliper Can you make the title and or description more extensive? I'm assuming Version 2 refers to CCSDS headers.

@skliper skliper changed the title Version 2 support and major update cFS Header Version 2 (includes CCSDS Extended header) support and major update May 27, 2020
#include <ws2tcpip.h>
#include <windows.h>
typedef int socklen_t;
#pragma warning(disable : 4786)
Copy link
Contributor

Choose a reason for hiding this comment

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

Has this been built on WIN32 to ensure that these pragma changes still work with the spacing changed? Sometimes these can be picky.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nope. I'm actually inclined to remove the special WIN32 logic. We don't test it and nothing else does special handling to support it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Although I am curious what works and doesn't in WSL... but that's a different issue.

@astrogeco astrogeco added CCB-20200527 and removed CCB:Ready Pull request is ready for discussion at the Configuration Control Board (CCB) labels May 27, 2020
@astrogeco
Copy link
Contributor

CCB 2020-05-27 APPROVED. @skliper Will write a new PR to FIx #93

else
tempuint16 = htole16(tempuint16);

CopyData(cmd.Packet, &startbyte, (char *)&tempuint16, sizeof(tempuint16));
Copy link
Contributor

Choose a reason for hiding this comment

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

Wouldn't it be easier/simpler to pass an extra parameter to CopyOut that indicated the byte order? That is, either "passthrough" (for native values), "big" to write bytes in network order, or "little" to write in inverse network order. This could be implemented in an endian-neutral code to avoid depending on these non-posix functions.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good suggestion! I'll write an enhancement issue.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

See #95

@skliper
Copy link
Contributor Author

skliper commented May 27, 2020

CCB 2020-05-27 APPROVED. @skliper Will write a new PR to FIx #93

Or anyone else who wants to fix #93 is welcome to it. I likely won't get back to it for a while (higher priority issues to resolve.)

@skliper
Copy link
Contributor Author

skliper commented May 28, 2020

Turns out the comments in cFS relating to the checksum calc (in cfe) don't match actual implementation. Added a test to actually verify the checksum, and had to update it's calculation here (it's bitwise exclusive or w/ a starting value of 0xFF).

@astrogeco astrogeco changed the base branch from master to integration-candidate June 1, 2020 18:18
@astrogeco astrogeco merged commit 59409e6 into nasa:integration-candidate Jun 2, 2020
@skliper skliper deleted the fix80-v2-plus-general-cleanup branch February 1, 2021 21:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
3 participants