some of the deprecation warnings run amok

This commit is contained in:
Robin Müller 2022-07-27 11:33:19 +02:00
parent 18ee2ab903
commit 064b195c75
No known key found for this signature in database
GPG Key ID: 71B58F8A3CDFA9AC
3 changed files with 21 additions and 6 deletions

View File

@ -70,9 +70,7 @@ class ProvidesDataPoolSubscriptionIF {
virtual ReturnValue_t subscribeForDiagPeriodicPacket( virtual ReturnValue_t subscribeForDiagPeriodicPacket(
subdp::DiagnosticsHkPeriodicParams params) = 0; subdp::DiagnosticsHkPeriodicParams params) = 0;
[[deprecated( virtual ReturnValue_t
"Please use the new API which takes all arguments as one wrapper "
"struct")]] virtual ReturnValue_t
subscribeForPeriodicPacket(sid_t sid, bool enableReporting, float collectionInterval, subscribeForPeriodicPacket(sid_t sid, bool enableReporting, float collectionInterval,
bool isDiagnostics) { bool isDiagnostics) {
return subscribeForPeriodicPacket(sid, enableReporting, collectionInterval, isDiagnostics, return subscribeForPeriodicPacket(sid, enableReporting, collectionInterval, isDiagnostics,
@ -106,12 +104,11 @@ class ProvidesDataPoolSubscriptionIF {
virtual ReturnValue_t subscribeForRegularUpdatePacket(subdp::RegularHkUpdateParams params) = 0; virtual ReturnValue_t subscribeForRegularUpdatePacket(subdp::RegularHkUpdateParams params) = 0;
virtual ReturnValue_t subscribeForDiagUpdatePacket(subdp::DiagnosticsHkUpdateParams params) = 0; virtual ReturnValue_t subscribeForDiagUpdatePacket(subdp::DiagnosticsHkUpdateParams params) = 0;
[[deprecated( virtual ReturnValue_t
"Please use the new API which takes all arguments as one wrapper "
"struct")]] virtual ReturnValue_t
subscribeForUpdatePacket(sid_t sid, bool reportingEnabled, bool isDiagnostics) { subscribeForUpdatePacket(sid_t sid, bool reportingEnabled, bool isDiagnostics) {
return subscribeForUpdatePacket(sid, reportingEnabled, isDiagnostics, objects::NO_OBJECT); return subscribeForUpdatePacket(sid, reportingEnabled, isDiagnostics, objects::NO_OBJECT);
} }
[[deprecated( [[deprecated(
"Please use the new API which takes all arguments as one wrapper " "Please use the new API which takes all arguments as one wrapper "
"struct")]] virtual ReturnValue_t "struct")]] virtual ReturnValue_t

View File

@ -12,6 +12,14 @@ PusTmCreator::PusTmCreator(SpacePacketParams initSpParams, PusTmParams initPusPa
PusTmCreator::PusTmCreator() { setup(); } PusTmCreator::PusTmCreator() { setup(); }
void PusTmCreator::disableCrcCalculation() {
calculateCrcOnSerialization = false;
}
void PusTmCreator::enableCrcCalculation() {
calculateCrcOnSerialization = true;
}
uint16_t PusTmCreator::getPacketIdRaw() const { return spCreator.getPacketIdRaw(); } uint16_t PusTmCreator::getPacketIdRaw() const { return spCreator.getPacketIdRaw(); }
uint16_t PusTmCreator::getPacketSeqCtrlRaw() const { return spCreator.getPacketSeqCtrlRaw(); } uint16_t PusTmCreator::getPacketSeqCtrlRaw() const { return spCreator.getPacketSeqCtrlRaw(); }
@ -138,3 +146,4 @@ void PusTmCreator::setService(uint8_t service) { pusParams.secHeader.service = s
void PusTmCreator::setSubservice(uint8_t subservice) { void PusTmCreator::setSubservice(uint8_t subservice) {
pusParams.secHeader.subservice = subservice; pusParams.secHeader.subservice = subservice;
} }
bool PusTmCreator::crcCalculationEnabled() const { return calculateCrcOnSerialization; }

View File

@ -46,6 +46,15 @@ class PusTmCreator : public SerializeIF, public PusTmIF, public CustomUserDataIF
~PusTmCreator() override = default; ~PusTmCreator() override = default;
void setTimeStamper(TimeStamperIF& timeStamper); void setTimeStamper(TimeStamperIF& timeStamper);
/**
* This function disables the CRC16 calculation on serialization. This is useful to avoid
* duplicate calculation if some lower level component needs to update fields like the sequence
* count, which would require a checksum update.
*/
void disableCrcCalculation();
void enableCrcCalculation();
[[nodiscard]] bool crcCalculationEnabled() const;
SpacePacketParams& getSpParams(); SpacePacketParams& getSpParams();
void setApid(uint16_t apid); void setApid(uint16_t apid);
void setDestId(uint16_t destId); void setDestId(uint16_t destId);