set buffer expects const pointer now

This commit is contained in:
2022-09-05 16:25:02 +02:00
parent f5421e9abd
commit 1e395dc402
5 changed files with 5 additions and 13 deletions

View File

@ -119,14 +119,7 @@ const uint8_t* SerialBufferAdapter<count_t>::getConstBuffer() const {
}
template <typename count_t>
void SerialBufferAdapter<count_t>::setBuffer(uint8_t* buffer, count_t bufferLength) {
this->buffer = buffer;
this->constBuffer = buffer;
this->bufferLength = bufferLength;
}
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;

View File

@ -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;