CFDP Update #682

Merged
gaisser merged 158 commits from mueller/cfdp-update-without-handlers into development 2022-11-14 15:04:45 +01:00
3 changed files with 24 additions and 0 deletions
Showing only changes of commit 34dd478848 - Show all commits

View File

@ -131,3 +131,7 @@ bool cfdp::VarLenField::operator<(const cfdp::VarLenField &other) const {
bool cfdp::VarLenField::operator==(const cfdp::VarLenField &other) const {
return getWidth() == other.getWidth() and getValue() == other.getValue();
}
bool cfdp::VarLenField::operator!=(const cfdp::VarLenField &other) const {
return not(*this == other);
}

View File

@ -27,6 +27,7 @@ class VarLenField : public SerializeIF {
VarLenField(cfdp::WidthInBytes width, size_t value);
bool operator==(const VarLenField &other) const;
bool operator!=(const VarLenField &other) const;
bool operator<(const VarLenField &other) const;
ReturnValue_t setValue(cfdp::WidthInBytes, size_t value);

View File

@ -11,6 +11,25 @@ class RemoteConfigTableIF {
virtual bool getRemoteCfg(const cfdp::EntityId& remoteId, cfdp::RemoteEntityCfg** cfg) = 0;
};
/**
* Helper class for the common case that there is exactly one remote entity
*/
class OneRemoteConfigProvider : public RemoteConfigTableIF {
public:
explicit OneRemoteConfigProvider(RemoteEntityCfg cfg) : cfg(std::move(cfg)) {}
bool getRemoteCfg(const EntityId& remoteId, cfdp::RemoteEntityCfg** cfg_) override {
if (remoteId != cfg.remoteId) {
return false;
}
*cfg_ = &cfg;
return true;
}
private:
RemoteEntityCfg cfg;
};
} // namespace cfdp
#endif // FSFW_CFDP_HANDLER_REMOTECONFIGTABLEIF_H