Skip to content

Conversation

@vincewoo
Copy link
Collaborator

@vincewoo vincewoo commented Aug 1, 2025

Related Issue(s) #3944
Has Unit Tests (y/n) y, pre-existing tests
Documentation Included (y/n) n

Change Description

This change continues the effort for #3781. The FPP change has been completed to be compatible with the new serialization methods. This PR removes the temporary workarounds introduced by #3880 that we had in place to decouple with FPP.

Rationale

Cleaning up the temporary workarounds left that we had in place to decouple the necessary FPP upgrade completed by nasa/fpp#763.

Testing/Review Recommendations

No new UTs were added as part of this change. Existing were updated where necessary and re-run for regression.

Future Work

We still need to mark the legacy serialize and deserialize methods of Fw::Serializable and Fw::SerializeBufferBase as DEPRECATED.

@LeStarch
Copy link
Collaborator

LeStarch commented Aug 1, 2025

@vincewoo I don't want the functions deprecated yet. Can we just remove the temporary variables? Next release we will DEPRECATE and then remote the release after that.

@vincewoo
Copy link
Collaborator Author

vincewoo commented Aug 1, 2025

@vincewoo I don't want the functions deprecated yet. Can we just remove the temporary variables? Next release we will DEPRECATE and then remote the release after that.

Yes, I can do that!

@thomas-bc thomas-bc added the Deferred To Next Release This PR is marked as deferred until after the upcoming release. label Aug 2, 2025

SerializeStatus ComPacket::serializeBase(SerializeBufferBase& buffer) const {
return buffer.serialize(static_cast<FwPacketDescriptorType>(this->m_type));
return buffer.serializeFrom(static_cast<FwPacketDescriptorType>(this->m_type));

Check warning

Code scanning / CodeQL

Unchecked function argument Warning

This use of parameter buffer has not been checked.
SerializeStatus ComPacket::deserializeBase(SerializeBufferBase& buffer) {
FwPacketDescriptorType serVal;
SerializeStatus stat = buffer.deserialize(serVal);
SerializeStatus stat = buffer.deserializeTo(serVal);

Check warning

Code scanning / CodeQL

Unchecked function argument Warning

This use of parameter buffer has not been checked.
// get type
FwEnumStoreType des;
SerializeStatus stat = buffer.deserialize(des);
SerializeStatus stat = buffer.deserializeTo(des);

Check warning

Code scanning / CodeQL

Unchecked function argument Warning

This use of parameter buffer has not been checked.
return this->serializeTo(buffer, maxLength);
// Deprecated method for backward compatibility
SerializeStatus StringBase::serialize(SerializeBufferBase& buffer) const {
return this->serializeTo(buffer);

Check warning

Code scanning / CodeQL

Unchecked function argument Warning

This use of parameter buffer has not been checked.
return this->deserializeFrom(buffer);
// Deprecated method for backward compatibility
SerializeStatus StringBase::serialize(SerializeBufferBase& buffer, SizeType maxLength) const {
return this->serializeTo(buffer, maxLength);

Check warning

Code scanning / CodeQL

Unchecked function argument Warning

This use of parameter buffer has not been checked.
return this->deserializeFrom(buffer);
// Deprecated method for backward compatibility
SerializeStatus StringBase::serialize(SerializeBufferBase& buffer, SizeType maxLength) const {
return this->serializeTo(buffer, maxLength);

Check warning

Code scanning / CodeQL

Unchecked function argument Warning

This use of parameter maxLength has not been checked.
status = this->m_val.serialize(buffer);
}
return status;
return this->m_val.serializeTo(buffer);

Check warning

Code scanning / CodeQL

Unchecked function argument Warning

This use of parameter buffer has not been checked.

SerializeStatus Time::deserialize(SerializeBufferBase& buffer) {
return this->deserializeFrom(buffer);
return this->m_val.deserializeFrom(buffer);

Check warning

Code scanning / CodeQL

Unchecked function argument Warning

This use of parameter buffer has not been checked.

// id
SerializeStatus stat = this->m_tlmBuffer.serialize(id);
SerializeStatus stat = this->m_tlmBuffer.serializeFrom(id);

Check warning

Code scanning / CodeQL

Unchecked function argument Warning

This use of parameter id has not been checked.

// time tag
stat = this->m_tlmBuffer.serialize(timeTag);
stat = this->m_tlmBuffer.serializeFrom(timeTag);

Check warning

Code scanning / CodeQL

Unchecked function argument Warning

This use of parameter timeTag has not been checked.

// id
SerializeStatus stat = this->m_tlmBuffer.deserialize(id);
SerializeStatus stat = this->m_tlmBuffer.deserializeTo(id);

Check warning

Code scanning / CodeQL

Unchecked function argument Warning

This use of parameter id has not been checked.

// time tag
stat = this->m_tlmBuffer.deserialize(timeTag);
stat = this->m_tlmBuffer.deserializeTo(timeTag);

Check warning

Code scanning / CodeQL

Unchecked function argument Warning

This use of parameter timeTag has not been checked.

// telemetry buffer
stat = this->m_tlmBuffer.deserialize(buffer.getBuffAddr(), bufferSize, Fw::Serialization::OMIT_LENGTH);
stat = this->m_tlmBuffer.deserializeTo(buffer.getBuffAddr(), bufferSize, Fw::Serialization::OMIT_LENGTH);

Check warning

Code scanning / CodeQL

Unchecked function argument Warning

This use of parameter buffer has not been checked.

// telemetry buffer
stat = this->m_tlmBuffer.deserialize(buffer.getBuffAddr(), bufferSize, Fw::Serialization::OMIT_LENGTH);
stat = this->m_tlmBuffer.deserializeTo(buffer.getBuffAddr(), bufferSize, Fw::Serialization::OMIT_LENGTH);

Check warning

Code scanning / CodeQL

Unchecked function argument Warning

This use of parameter bufferSize has not been checked.
SerializeStatus TlmPacket::serializeTo(SerializeBufferBase& buffer) const {
// serialize the number of packets
SerializeStatus stat = buffer.serialize(this->m_numEntries);
SerializeStatus stat = buffer.serializeFrom(this->m_numEntries);

Check warning

Code scanning / CodeQL

Unchecked function argument Warning

This use of parameter buffer has not been checked.
SerializeStatus TlmPacket::deserializeFrom(SerializeBufferBase& buffer) {
// deserialize the number of packets
SerializeStatus stat = buffer.deserialize(this->m_numEntries);
SerializeStatus stat = buffer.deserializeTo(this->m_numEntries);

Check warning

Code scanning / CodeQL

Unchecked function argument Warning

This use of parameter buffer has not been checked.
@vincewoo vincewoo marked this pull request as ready for review August 5, 2025 22:02
@vincewoo vincewoo requested a review from thomas-bc August 5, 2025 22:02
@vincewoo vincewoo changed the title Deprecate legacy serialize and deserialize methods. Cleaning up temporary workarounds. (De)Serialization clean up of temporary workarounds Aug 5, 2025
@vincewoo
Copy link
Collaborator Author

vincewoo commented Aug 5, 2025

@thomas-bc Note that this PR is deleting all the serialize/deserialize methods from the child classes so they inherit properly from the parent now. This makes it easier for use to later deprecate as well.

@thomas-bc thomas-bc requested review from Kronos3 and bocchino August 6, 2025 16:23
Copy link
Collaborator

@Kronos3 Kronos3 left a comment

Choose a reason for hiding this comment

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

virtual SerializeStatus serialize(SerializeBufferBase& buffer) const;
virtual SerializeStatus deserialize(SerializeBufferBase& buffer);

I see serialize/deserialize are still virtual, we may not want this since they should not be overridden. Maybe making them inline in the header is better?

// ----------------------------------------------------------------------

virtual SerializeStatus serialize(SerializeBufferBase& buffer) const;
SerializeStatus serialize(SerializeBufferBase& buffer) const { return this->serializeTo(buffer); }

Check warning

Code scanning / CodeQL

Unchecked function argument Warning

This use of parameter buffer has not been checked.
virtual SerializeStatus serialize(SerializeBufferBase& buffer) const;
SerializeStatus serialize(SerializeBufferBase& buffer) const { return this->serializeTo(buffer); }

SerializeStatus deserialize(SerializeBufferBase& buffer) { return this->deserializeFrom(buffer); }

Check warning

Code scanning / CodeQL

Unchecked function argument Warning

This use of parameter buffer has not been checked.
// ----------------------------------------------------------------------

virtual SerializeStatus serialize(SerializeBufferBase& buffer) const;
SerializeStatus serialize(SerializeBufferBase& buffer) const { return this->serializeTo(buffer); }

Check notice

Code scanning / CodeQL

More than one statement per line Note

This line contains 2 statements; only one is allowed.
virtual SerializeStatus serialize(SerializeBufferBase& buffer) const;
SerializeStatus serialize(SerializeBufferBase& buffer) const { return this->serializeTo(buffer); }

SerializeStatus deserialize(SerializeBufferBase& buffer) { return this->deserializeFrom(buffer); }

Check notice

Code scanning / CodeQL

More than one statement per line Note

This line contains 2 statements; only one is allowed.
@vincewoo vincewoo requested a review from thomas-bc August 6, 2025 18:10
Copy link
Collaborator

@Kronos3 Kronos3 left a comment

Choose a reason for hiding this comment

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

I see the virtual on serialize/deserialize has been addressed, looks great! Thanks for the fast turnaround on this!

@bocchino
Copy link
Collaborator

bocchino commented Aug 6, 2025

Looks good, I just had a few questions/comments. @LeStarch @thomas-bc can we remove the Deferred to Next Release label from this PR? I think it is close, and it's important for the release.

@thomas-bc thomas-bc removed the Deferred To Next Release This PR is marked as deferred until after the upcoming release. label Aug 6, 2025
Copy link
Collaborator

@bocchino bocchino left a comment

Choose a reason for hiding this comment

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

Looks good!

@LeStarch
Copy link
Collaborator

LeStarch commented Aug 6, 2025

Got verbal buy off from @thomas-bc and @bocchino . Good to merge.

@LeStarch LeStarch merged commit f38010a into nasa:devel Aug 6, 2025
49 checks passed
@vincewoo vincewoo deleted the FP-3944 branch August 6, 2025 22:07
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.

5 participants