1
0
forked from fsfw/fsfw

Array List Entry swapper function

And respective SerialAdapter functions to use it
This commit is contained in:
2020-01-22 14:24:48 +01:00
parent 3d2bdae14d
commit 1977942c4b
5 changed files with 36 additions and 15 deletions

View File

@ -79,20 +79,9 @@ public:
return result;
}
/**
* Swap the endianness of the Array list (not the length field !)
* Useful if the case the buffer type is large than uint8_t and the endianness
* is inconsistent with other SerializeElements.
* @param list
*/
static void swapArrayListEndianness(ArrayList<T, count_t>* list) {
ReturnValue_t result = HasReturnvaluesIF::RETURN_OK;
count_t i = 0;
while ((result == HasReturnvaluesIF::RETURN_OK) && (i < list->size)) {
T newEntry = EndianSwapper::swap(list->entries[i]);
list->entries[i] = newEntry;
++i;
}
list->swapArrayListEndianness();
}
private:
ArrayList<T, count_t> *adaptee;