Merge branch 'mueller/refactor-tmtc-stack' into mueller/cfdp-routers
This commit is contained in:
commit
61db018a74
@ -119,14 +119,7 @@ const uint8_t* SerialBufferAdapter<count_t>::getConstBuffer() const {
|
||||
}
|
||||
|
||||
template <typename count_t>
|
||||
void SerialBufferAdapter<count_t>::setBuffer(uint8_t* data, count_t len) {
|
||||
this->buffer = data;
|
||||
this->constBuffer = data;
|
||||
this->bufferLength = len;
|
||||
}
|
||||
|
||||
template <typename count_t>
|
||||
void SerialBufferAdapter<count_t>::setConstBuffer(const uint8_t* buf, count_t bufLen) {
|
||||
void SerialBufferAdapter<count_t>::setBuffer(const uint8_t* buf, count_t bufLen) {
|
||||
this->buffer = nullptr;
|
||||
this->bufferLength = bufLen;
|
||||
this->constBuffer = buf;
|
||||
|
@ -65,8 +65,7 @@ class SerialBufferAdapter : public SerializeIF {
|
||||
|
||||
uint8_t* getBuffer();
|
||||
[[nodiscard]] const uint8_t* getConstBuffer() const;
|
||||
void setBuffer(uint8_t* buffer, count_t bufferLength);
|
||||
void setConstBuffer(const uint8_t* buf, count_t bufLen);
|
||||
void setBuffer(const uint8_t* buf, count_t bufLen);
|
||||
|
||||
private:
|
||||
bool serializeLength = false;
|
||||
|
@ -84,7 +84,7 @@ SpacePacketParams &PusTcCreator::getSpParams() { return spCreator.getParams(); }
|
||||
|
||||
ReturnValue_t PusTcCreator::setRawUserData(const uint8_t *data, size_t len) {
|
||||
// TODO: Check length field?
|
||||
pusParams.bufAdapter.setConstBuffer(data, len);
|
||||
pusParams.bufAdapter.setBuffer(data, len);
|
||||
pusParams.appData = &pusParams.bufAdapter;
|
||||
updateSpLengthField();
|
||||
return returnvalue::OK;
|
||||
|
@ -13,7 +13,7 @@ struct PusTcParams {
|
||||
PusTcParams(uint8_t service_, uint8_t subservice_) : service(service_), subservice(subservice_) {}
|
||||
|
||||
void setRawAppData(const uint8_t *data, size_t len) {
|
||||
bufAdapter.setConstBuffer(data, len);
|
||||
bufAdapter.setBuffer(data, len);
|
||||
appData = &bufAdapter;
|
||||
}
|
||||
|
||||
|
@ -131,7 +131,7 @@ ReturnValue_t PusTmCreator::setRawUserData(const uint8_t* data, size_t len) {
|
||||
if (data == nullptr or len == 0) {
|
||||
pusParams.sourceData = nullptr;
|
||||
} else {
|
||||
pusParams.adapter.setConstBuffer(data, len);
|
||||
pusParams.adapter.setBuffer(data, len);
|
||||
pusParams.sourceData = &pusParams.adapter;
|
||||
}
|
||||
updateSpLengthField();
|
||||
|
Loading…
Reference in New Issue
Block a user