Update FSFW from upstream #71
@ -1,10 +1,10 @@
|
|||||||
#include "fsfw/container/SimpleRingBuffer.h"
|
#include "fsfw/container/SimpleRingBuffer.h"
|
||||||
#include "fsfw/FSFW.h"
|
|
||||||
|
|
||||||
#include "fsfw/serviceinterface.h"
|
|
||||||
|
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
|
|
||||||
|
#include "fsfw/FSFW.h"
|
||||||
|
#include "fsfw/serviceinterface.h"
|
||||||
|
|
||||||
SimpleRingBuffer::SimpleRingBuffer(const size_t size, bool overwriteOld, size_t maxExcessBytes)
|
SimpleRingBuffer::SimpleRingBuffer(const size_t size, bool overwriteOld, size_t maxExcessBytes)
|
||||||
: RingBufferBase<>(0, size, overwriteOld), maxExcessBytes(maxExcessBytes) {
|
: RingBufferBase<>(0, size, overwriteOld), maxExcessBytes(maxExcessBytes) {
|
||||||
if (maxExcessBytes > size) {
|
if (maxExcessBytes > size) {
|
||||||
@ -51,10 +51,10 @@ void SimpleRingBuffer::confirmBytesWritten(size_t amount) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ReturnValue_t SimpleRingBuffer::writeData(const uint8_t* data, size_t amount) {
|
ReturnValue_t SimpleRingBuffer::writeData(const uint8_t* data, size_t amount) {
|
||||||
if(data == nullptr) {
|
if (data == nullptr) {
|
||||||
return HasReturnvaluesIF::RETURN_FAILED;
|
return HasReturnvaluesIF::RETURN_FAILED;
|
||||||
}
|
}
|
||||||
if(amount > getMaxSize()) {
|
if (amount > getMaxSize()) {
|
||||||
#if FSFW_VERBOSE_LEVEL >= 1
|
#if FSFW_VERBOSE_LEVEL >= 1
|
||||||
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
||||||
sif::error << "SimpleRingBuffer::writeData: Amount of data too large" << std::endl;
|
sif::error << "SimpleRingBuffer::writeData: Amount of data too large" << std::endl;
|
||||||
|
@ -64,13 +64,15 @@ class SerializeIF {
|
|||||||
/**
|
/**
|
||||||
* Forwards to regular @serialize call with big (network) endianness
|
* Forwards to regular @serialize call with big (network) endianness
|
||||||
*/
|
*/
|
||||||
[[nodiscard]] virtual ReturnValue_t serializeBe(uint8_t** buffer, size_t* size, size_t maxSize) const {
|
[[nodiscard]] virtual ReturnValue_t serializeBe(uint8_t **buffer, size_t *size,
|
||||||
|
size_t maxSize) const {
|
||||||
return serialize(buffer, size, maxSize, SerializeIF::Endianness::NETWORK);
|
return serialize(buffer, size, maxSize, SerializeIF::Endianness::NETWORK);
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* If endianness is not explicitly specified, use machine endianness
|
* If endianness is not explicitly specified, use machine endianness
|
||||||
*/
|
*/
|
||||||
[[nodiscard]] virtual ReturnValue_t serialize(uint8_t **buffer, size_t *size, size_t maxSize) const {
|
[[nodiscard]] virtual ReturnValue_t serialize(uint8_t **buffer, size_t *size,
|
||||||
|
size_t maxSize) const {
|
||||||
return serialize(buffer, size, maxSize, SerializeIF::Endianness::MACHINE);
|
return serialize(buffer, size, maxSize, SerializeIF::Endianness::MACHINE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -105,13 +107,13 @@ class SerializeIF {
|
|||||||
/**
|
/**
|
||||||
* Forwards to regular @deSerialize call with big (network) endianness
|
* Forwards to regular @deSerialize call with big (network) endianness
|
||||||
*/
|
*/
|
||||||
virtual ReturnValue_t deSerializeBe(const uint8_t** buffer, size_t* size) {
|
virtual ReturnValue_t deSerializeBe(const uint8_t **buffer, size_t *size) {
|
||||||
return deSerialize(buffer, size, SerializeIF::Endianness::NETWORK);
|
return deSerialize(buffer, size, SerializeIF::Endianness::NETWORK);
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* If endianness is not explicitly specified, use machine endianness
|
* If endianness is not explicitly specified, use machine endianness
|
||||||
*/
|
*/
|
||||||
virtual ReturnValue_t deSerialize(const uint8_t** buffer, size_t *size) {
|
virtual ReturnValue_t deSerialize(const uint8_t **buffer, size_t *size) {
|
||||||
return deSerialize(buffer, size, SerializeIF::Endianness::MACHINE);
|
return deSerialize(buffer, size, SerializeIF::Endianness::MACHINE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user