Adding Code for Linux

This commit is contained in:
Steffen Gaisser
2018-12-19 19:42:00 +01:00
parent db1f93a155
commit fd782b20c0
90 changed files with 2411 additions and 1497 deletions
+3 -3
View File
@@ -8,7 +8,7 @@
DataPoolAdmin::DataPoolAdmin(object_id_t objectId) :
SystemObject(objectId), storage(NULL), commandQueue(NULL), memoryHelper(
this, commandQueue), actionHelper(this, commandQueue) {
this, NULL), actionHelper(this, NULL) {
commandQueue = QueueFactory::instance()->createMessageQueue();
}
@@ -171,7 +171,7 @@ ReturnValue_t DataPoolAdmin::initialize() {
return result;
}
result = memoryHelper.initialize();
result = memoryHelper.initialize(commandQueue);
if (result != HasReturnvaluesIF::RETURN_OK) {
return result;
}
@@ -181,7 +181,7 @@ ReturnValue_t DataPoolAdmin::initialize() {
return HasReturnvaluesIF::RETURN_FAILED;
}
result = actionHelper.initialize();
result = actionHelper.initialize(commandQueue);
return result;
}
+2
View File
@@ -24,6 +24,8 @@ public:
ReturnValue_t switchHK(SerializeIF *sids, bool enable);
virtual void setTaskIF(PeriodicTaskIF* task_){};
protected:
virtual void stepSuccessfulReceived(ActionId_t actionId, uint8_t step);
virtual void stepFailedReceived(ActionId_t actionId, uint8_t step,
+16 -16
View File
@@ -76,13 +76,13 @@ ReturnValue_t PoolRawAccess::getEntryEndianSafe(uint8_t* buffer,
return DATA_POOL_ACCESS_FAILED;
if (typeSize > max_size)
return INCORRECT_SIZE;
#ifndef BYTE_ORDER
#error BYTE_ORDER not defined
#elif BYTE_ORDER == LITTLE_ENDIAN
#ifndef BYTE_ORDER_SYSTEM
#error BYTE_ORDER_SYSTEM not defined
#elif BYTE_ORDER_SYSTEM == LITTLE_ENDIAN
for (uint8_t count = 0; count < typeSize; count++) {
buffer[count] = data_ptr[typeSize - count - 1];
}
#elif BYTE_ORDER == BIG_ENDIAN
#elif BYTE_ORDER_SYSTEM == BIG_ENDIAN
memcpy(buffer, data_ptr, typeSize);
#endif
*writtenBytes = typeSize;
@@ -112,13 +112,13 @@ PoolVariableIF::ReadWriteMode_t PoolRawAccess::getReadWriteMode() const {
ReturnValue_t PoolRawAccess::setEntryFromBigEndian(const uint8_t* buffer,
uint32_t setSize) {
if (typeSize == setSize) {
#ifndef BYTE_ORDER
#error BYTE_ORDER not defined
#elif BYTE_ORDER == LITTLE_ENDIAN
#ifndef BYTE_ORDER_SYSTEM
#error BYTE_ORDER_SYSTEM not defined
#elif BYTE_ORDER_SYSTEM == LITTLE_ENDIAN
for (uint8_t count = 0; count < typeSize; count++) {
value[count] = buffer[typeSize - count - 1];
}
#elif BYTE_ORDER == BIG_ENDIAN
#elif BYTE_ORDER_SYSTEM == BIG_ENDIAN
memcpy(value, buffer, typeSize);
#endif
return HasReturnvaluesIF::RETURN_OK;
@@ -149,13 +149,13 @@ ReturnValue_t PoolRawAccess::serialize(uint8_t** buffer, uint32_t* size,
const uint32_t max_size, bool bigEndian) const {
if (typeSize + *size <= max_size) {
if (bigEndian) {
#ifndef BYTE_ORDER
#error BYTE_ORDER not defined
#elif BYTE_ORDER == LITTLE_ENDIAN
#ifndef BYTE_ORDER_SYSTEM
#error BYTE_ORDER_SYSTEM not defined
#elif BYTE_ORDER_SYSTEM == LITTLE_ENDIAN
for (uint8_t count = 0; count < typeSize; count++) {
(*buffer)[count] = value[typeSize - count - 1];
}
#elif BYTE_ORDER == BIG_ENDIAN
#elif BYTE_ORDER_SYSTEM == BIG_ENDIAN
memcpy(*buffer, value, typeSize);
#endif
} else {
@@ -179,13 +179,13 @@ ReturnValue_t PoolRawAccess::deSerialize(const uint8_t** buffer, int32_t* size,
if (*size >= 0) {
if (bigEndian) {
#ifndef BYTE_ORDER
#error BYTE_ORDER not defined
#elif BYTE_ORDER == LITTLE_ENDIAN
#ifndef BYTE_ORDER_SYSTEM
#error BYTE_ORDER_SYSTEM not defined
#elif BYTE_ORDER_SYSTEM == LITTLE_ENDIAN
for (uint8_t count = 0; count < typeSize; count++) {
value[count] = (*buffer)[typeSize - count - 1];
}
#elif BYTE_ORDER == BIG_ENDIAN
#elif BYTE_ORDER_SYSTEM == BIG_ENDIAN
memcpy(value, *buffer, typeSize);
#endif
} else {