eive-obsw/mission/devices/devicedefinitions/P60DockHandlerDefinitions.h
2020-12-14 08:42:48 +01:00

91 lines
3.0 KiB
C++

#ifndef MISSION_DEVICES_DEVICEDEFINITIONS_P60DOCKHANDLERDEFINITIONS_H_
#define MISSION_DEVICES_DEVICEDEFINITIONS_P60DOCKHANDLERDEFINITIONS_H_
/**
* @brief This class helps to serialize and deserialze the P60 dock packet
* holding information about the module configuration. The parameters
* of this table are described in the gs-man-nanopower-p60-dock-2.2.9.pdf
* on page 16.
*/
//class ModuleConfigTable : public SerialLinkedListAdapter<SerializeIF> { //!< [EXPORT] : [SUBSERVICE] 2
//public:
// typedef char dataBufferType;
// typedef uint8_t typeOfMaxData;
//
// ModuleConfigTable() {
// setStart(&objectId);
// objectId.setNext(&sizeOfRepositoryPath);
// sizeOfRepositoryPath.setNext(&repositoryPath);
// repositoryPath.setNext(&sizeOfFilename);
// sizeOfFilename.setNext(&filename);
// /* Add string terminator to filename and repository path */
// repositoryPath.entry.insert('\0');
// filename.entry.insert('\0');
// }
//
// uint32_t getSizeOfRepositoryPath() {
// return sizeOfRepositoryPath;
// }
//
// uint32_t getSizeOfFilename() {
// return sizeOfFilename;
// }
//
// uint8_t * getRepositoryPath() {
// return repositoryPath.entry.front();
// }
//
// uint8_t getFilename() {
// return filename.entry.front();
// }
//
//private:
// /* Prevent object copying */
// ModuleConfigTable(const ModuleConfigTable &obj);
//
// SerializeElement<SerialBufferAdapter<char>> out_name;
// SerializeElement<SerialBufferAdapter<uint8_t>> out_en;
// SerializeElement<SerialBufferAdapter<uint16_t>> out_on_cnt;
// SerializeElement<SerialBufferAdapter<uint16_t>> out_on_cnt;
// SerializeElement<uint16_t> sizeOfRepositoryPath;
// SerializeElement<SerialFixedArrayListAdapter<dataBufferType, FN_MAXPATHNAME, typeOfMaxData>> repositoryPath;
// SerializeElement<uint8_t> sizeOfFilename;
// SerializeElement<SerialFixedArrayListAdapter<dataBufferType, FN_MAXNAME, typeOfMaxData>> filename;
//};
/**
* @brief A serial linked list adapter implementation of the gs_rparam_query_t struct
* defined in rparam.h
*/
class GetParamCommand: public SerialLinkedListAdapter<SerializeIF> { //!< [EXPORT] : [SUBSERVICE] 130
public:
typedef uint16_t typeOfMaxDataSize;
static const uint16_t MAX_DATA_LENGTH = sizeof(typeOfMaxDataSize);
GetParamCommand(uint8_t objectId_, ActionId_t actionId_,
const uint8_t * replyDataBuffer_ = NULL, uint16_t replyDataSize_ = 0):
objectId(objectId_), actionId(actionId_), replyData(replyDataBuffer_,replyDataSize_){
setLinks();
}
private:
GetParamCommand(const GetParamCommand &reply);
void setLinks() {
setStart(&action);
action.setNext(&tableId);
tableId.setNext(&length);
lenght.setNext(&checksum);
checksum.setNext(&seq);
checksum.setNext(&addr);
}
SerializeElement<uint8_t> cspPort = 7;
SerializeElement<uint8_t> action;
SerializeElement<uint8_t> tableId;
SerializeElement<uint16_t> length;
SerializeElement<uint16_t> checksum;
SerializeElement<uint16_t> seq;
SerializeElement<uint16_t> total;
SerializeElement<uint16_t> addr;
};
#endif /* MISSION_DEVICES_DEVICEDEFINITIONS_P60DOCKHANDLERDEFINITIONS_H_ */