heater main switch commanding

This commit is contained in:
2021-02-11 08:19:48 +01:00
parent d602912364
commit 5ccb3d1488
9 changed files with 75 additions and 24 deletions

View File

@ -394,7 +394,7 @@ class GomspaceSetParamMessage : public SerialLinkedListAdapter<SerializeIF> {
public:
/* The size of the largest parameter */
static const uint32_t MAX_SIZE = 4;
static const uint8_t MAX_SIZE = 4;
/**
* @brief Constructor
@ -404,11 +404,9 @@ public:
* @param parameterSize The size of the parameter.
*
*/
GomspaceSetParamMessage(uint16_t memoryAddress, const uint8_t** parameterValue,
GomspaceSetParamMessage(uint16_t memoryAddress, const uint8_t* parameterValue,
uint8_t parameterSize) :
memoryAddress(memoryAddress) {
size_t size = parameterSize;
parameterValueInfo.deSerialize(parameterValue, &size, SerializeIF::Endianness::BIG);
memoryAddress(memoryAddress), parameterValueBuffer(parameterValue, parameterSize, true) {
setLinks();
}
@ -416,10 +414,14 @@ private:
GomspaceSetParamMessage(const GomspaceSetParamMessage &reply);
void setLinks() {
setStart(&memoryAddress);
memoryAddress.setNext(&parameterValueInfo);
memoryAddress.setNext(&parameterValueBuffer);
}
SerializeElement<uint16_t> memoryAddress;
SerializeElement<SerialFixedArrayListAdapter<uint8_t, MAX_SIZE, uint8_t>> parameterValueInfo;
/**
* Parameter can be uint8_t, uint16_t or uint32_t. Thus max size of parameterValueBuffer is
* four bytes.
*/
SerializeElement<SerialBufferAdapter<uint8_t>> parameterValueBuffer;
};