WIP: somethings wrong.. #19
@ -58,6 +58,11 @@ public:
|
|||||||
virtual void setNext(LinkedElement* next) {
|
virtual void setNext(LinkedElement* next) {
|
||||||
this->next = next;
|
this->next = next;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void setEnd() {
|
||||||
|
this->next = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
LinkedElement* begin() {
|
LinkedElement* begin() {
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
@ -123,6 +123,11 @@ void SerialBufferAdapter<T>::setBuffer(uint8_t * buffer_, T bufferLength_) {
|
|||||||
bufferLength = bufferLength_;
|
bufferLength = bufferLength_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
void SerialBufferAdapter<T>::setBuffer(uint32_t * buffer_, T bufferLength_) {
|
||||||
|
buffer = reinterpret_cast<uint8_t *>(buffer_);
|
||||||
|
bufferLength = 4 * bufferLength_;
|
||||||
|
}
|
||||||
|
|
||||||
//forward Template declaration for linker
|
//forward Template declaration for linker
|
||||||
template class SerialBufferAdapter<uint8_t>;
|
template class SerialBufferAdapter<uint8_t>;
|
||||||
|
@ -59,6 +59,7 @@ public:
|
|||||||
uint8_t * getBuffer();
|
uint8_t * getBuffer();
|
||||||
const uint8_t * getConstBuffer();
|
const uint8_t * getConstBuffer();
|
||||||
void setBuffer(uint8_t * buffer_, T bufferLength_);
|
void setBuffer(uint8_t * buffer_, T bufferLength_);
|
||||||
|
void setBuffer(uint32_t * buffer_, T bufferLength_);
|
||||||
private:
|
private:
|
||||||
|
|
||||||
enum bufferType {
|
enum bufferType {
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
*
|
*
|
||||||
* 1. Buffers with a size header inside that class can be declared with
|
* 1. Buffers with a size header inside that class can be declared with
|
||||||
* SerialFixedArrayListAdapter<BUFFER_TYPE, MAX_BUFFER_LENGTH, LENGTH_FIELD_TYPE>.
|
* SerialFixedArrayListAdapter<BUFFER_TYPE, MAX_BUFFER_LENGTH, LENGTH_FIELD_TYPE>.
|
||||||
* 2. MAX_BUFFER_LENGTH specifies the maximum allowed value for the buffer size.
|
* 2. MAX_BUFFER_LENGTH specifies the maximum allowed number of elements in FixedArrayList
|
||||||
* 3. LENGTH_FIELD_TYPE specifies the data type of the buffer header containing the buffer size
|
* 3. LENGTH_FIELD_TYPE specifies the data type of the buffer header containing the buffer size
|
||||||
* (defaults to 1 byte length field) that follows
|
* (defaults to 1 byte length field) that follows
|
||||||
*
|
*
|
||||||
|
Loading…
Reference in New Issue
Block a user