add helper method

This commit is contained in:
Robin Müller 2024-11-14 17:23:14 +01:00
parent 97e92c0dd2
commit dea2da9eee
Signed by: muellerr
GPG Key ID: A649FB78196E3849
3 changed files with 13 additions and 0 deletions

View File

@ -323,6 +323,10 @@ ReturnValue_t PeriodicHelper::enablePeriodicPacket(const dp::structure_id_t stru
return returnvalue::OK; return returnvalue::OK;
} }
ReturnValue_t PeriodicHelper::enablePeriodicPacket(const dp::structure_id_t structureId) {
return enablePeriodicPacket(structureId, std::nullopt);
}
ReturnValue_t PeriodicHelper::disablePeriodicPacket(const dp::structure_id_t structureId) { ReturnValue_t PeriodicHelper::disablePeriodicPacket(const dp::structure_id_t structureId) {
// Get and check dataset first. // Get and check dataset first.
const auto optSetSpec = getMutSetSpecification(structureId); const auto optSetSpec = getMutSetSpecification(structureId);

View File

@ -135,6 +135,7 @@ class PeriodicHelper : public PeriodicHelperIF {
*/ */
ReturnValue_t enablePeriodicPacket(dp::sid_t structureId, ReturnValue_t enablePeriodicPacket(dp::sid_t structureId,
std::optional<dur_millis_t> frequencyMs) override; std::optional<dur_millis_t> frequencyMs) override;
ReturnValue_t enablePeriodicPacket(dp::sid_t structureId) override;
ReturnValue_t disablePeriodicPacket(dp::sid_t structureId) override; ReturnValue_t disablePeriodicPacket(dp::sid_t structureId) override;
ReturnValue_t collectionEnabled(dp::sid_t structureId, bool& collectionEnabled) const override; ReturnValue_t collectionEnabled(dp::sid_t structureId, bool& collectionEnabled) const override;

View File

@ -17,6 +17,14 @@ class PeriodicHelperIF {
dur_millis_t newCollectionIntervalMs) = 0; dur_millis_t newCollectionIntervalMs) = 0;
virtual ReturnValue_t enablePeriodicPacket(dp::sid_t structureId, virtual ReturnValue_t enablePeriodicPacket(dp::sid_t structureId,
std::optional<dur_millis_t> frequencyMs) = 0; std::optional<dur_millis_t> frequencyMs) = 0;
/**
* @brief Enables periodic packet generation for a given structure, and
* keeps the previous configured collection interval.
*
* @param structureId
* @return ReturnValue_t
*/
virtual ReturnValue_t enablePeriodicPacket(dp::sid_t structureId) = 0;
virtual ReturnValue_t disablePeriodicPacket(dp::sid_t structureId) = 0; virtual ReturnValue_t disablePeriodicPacket(dp::sid_t structureId) = 0;
virtual ReturnValue_t collectionEnabled(dp::sid_t structureId, bool& collectionEnabled) const = 0; virtual ReturnValue_t collectionEnabled(dp::sid_t structureId, bool& collectionEnabled) const = 0;
}; };