From b9151fbd6eed292aa6ee2604c0ed154138a726e3 Mon Sep 17 00:00:00 2001 From: "Jakob.Meier" Date: Wed, 16 Dec 2020 11:02:49 +0100 Subject: [PATCH] successful change of endian swapping in p60dock param set --- mission/devices/P60DockHandler.cpp | 24 +++--------------------- 1 file changed, 3 insertions(+), 21 deletions(-) diff --git a/mission/devices/P60DockHandler.cpp b/mission/devices/P60DockHandler.cpp index 8263165b..a7f9b820 100644 --- a/mission/devices/P60DockHandler.cpp +++ b/mission/devices/P60DockHandler.cpp @@ -40,8 +40,7 @@ ReturnValue_t P60DockHandler::buildCommandFromCommand( SetParamMessageUnpacker setParamMessageUnpacker(commandData, commandDataLen); uint8_t tableId = setParamMessageUnpacker.getTableId(); - uint16_t address = EndianConverter::convertLittleEndian( - setParamMessageUnpacker.getAddress()); + uint16_t address = setParamMessageUnpacker.getAddress(); uint16_t checksum = GOMSPACE::IGNORE_CHECKSUM; uint16_t seq = 0; uint16_t total = 0; @@ -49,26 +48,9 @@ ReturnValue_t P60DockHandler::buildCommandFromCommand( uint16_t querySize = 1; const uint8_t* parameterPtr = setParamMessageUnpacker.getParameter(); uint8_t parameterSize = setParamMessageUnpacker.getParameterSize(); - uint32_t parameter; - parameter = *parameterPtr; - switch(parameterSize) { - case(sizeof(uint16_t)): { - parameter = EndianConverter::convertLittleEndian( - (uint16_t)parameter); - break; - } - case(sizeof(uint32_t)): { - parameter = EndianConverter::convertLittleEndian( - parameter); - break; - } - default: - break; - } - uint16_t payloadlength = EndianConverter::convertLittleEndian( - sizeof(address) + parameterSize); + uint16_t payloadlength = sizeof(address) + parameterSize; CspSetParamCommand setParamCmd(querySize, PARAM_SET, tableId, payloadlength, - checksum, seq, total, address, (uint8_t*) ¶meter, + checksum, seq, total, address, parameterPtr, parameterSize); size_t cspPacketLen = 0; uint8_t* buffer = cspPacket;