Skip to content

Conversation

@ethancheez
Copy link
Contributor

Related Issue(s) N/A
Has Unit Tests (y/n) N
Documentation Included (y/n) N
Generative AI was used in this contribution (y/n) N

Change Description

Add static_cast<FwPacketDescriptorType> to serialize() call in FpySequencer

Rationale

Older compilers can't decide which overloaded option to use without being specific with a static_cast

/path/to/lib/fprime/Svc/FpySequencer/FpySequencerDirectives.cpp:292:48: error: call of overloaded 'serialize(ComCfg::APID::T)' is ambiguous
  292 |     Fw::SerializeStatus stat = cmdBuf.serialize(Fw::ComPacketType::FW_PACKET_COMMAND);
      |                                ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /path/to/lib/fprime/Fw/Com/ComPacket.hpp:11,
                 from /home/ethan/Git/jpl/fprime-tutorial-arduino-blinker/lib/fprime/Svc/FpySequencer/FpySequencerDirectives.cpp:2:
/path/to/lib/fprime/Fw/Types/Serializable.hpp:163:21: note: candidate: 'Fw::SerializeStatus Fw::SerializeBufferBase::serialize(U8)'
  163 |     SerializeStatus serialize(U8 val);
      |                     ^~~~~~~~~
/path/to/lib/fprime/Fw/Types/Serializable.hpp:164:21: note: candidate: 'Fw::SerializeStatus Fw::SerializeBufferBase::serialize(I8)'
  164 |     SerializeStatus serialize(I8 val);
      |                     ^~~~~~~~~
/path/to/lib/fprime/Fw/Types/Serializable.hpp:166:21: note: candidate: 'Fw::SerializeStatus Fw::SerializeBufferBase::serialize(U16)'
  166 |     SerializeStatus serialize(U16 val);

...

Testing/Review Recommendations

N/A

Future Work

N/A

AI Usage (policy)

N/A

Signal FpySequencer::cmd_directiveHandler(const FpySequencer_CmdDirective& directive, DirectiveError& error) {
Fw::ComBuffer cmdBuf;
Fw::SerializeStatus stat = cmdBuf.serialize(Fw::ComPacketType::FW_PACKET_COMMAND);
Fw::SerializeStatus stat = cmdBuf.serialize(static_cast<FwPacketDescriptorType>(Fw::ComPacketType::FW_PACKET_COMMAND));
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could use the new form serializeFrom() variant. serialize() will be deprecated next release.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I agree. I'll open a ticket asking for this change. We can address it in a separate PR

Copy link
Collaborator

Choose a reason for hiding this comment

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

Here is the ticket #4011

@kevin-f-ortega kevin-f-ortega merged commit 2dea8ab into nasa:devel Aug 10, 2025
49 checks passed
ianbrault pushed a commit to ianbrault/fprime that referenced this pull request Sep 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants