2018-07-12 16:29:32 +02:00
|
|
|
#ifndef POWERCOMPONENT_H_
|
|
|
|
#define POWERCOMPONENT_H_
|
|
|
|
|
|
|
|
#include <framework/objectmanager/SystemObjectIF.h>
|
|
|
|
#include <framework/power/PowerComponentIF.h>
|
|
|
|
|
|
|
|
class PowerComponent: public PowerComponentIF {
|
|
|
|
public:
|
|
|
|
PowerComponent(object_id_t setId, uint8_t moduleId, float min, float max, uint8_t switchId1,
|
|
|
|
bool twoSwitches = false, uint8_t switchId2 = 0xFF);
|
|
|
|
|
|
|
|
virtual object_id_t getDeviceObjectId();
|
|
|
|
|
|
|
|
virtual uint8_t getSwitchId1();
|
|
|
|
virtual uint8_t getSwitchId2();
|
|
|
|
|
|
|
|
bool hasTwoSwitches();
|
|
|
|
|
|
|
|
float getMin();
|
|
|
|
float getMax();
|
|
|
|
|
2020-04-05 17:58:39 +02:00
|
|
|
ReturnValue_t serialize(uint8_t** buffer, size_t* size,
|
|
|
|
const size_t max_size, bool bigEndian) const;
|
2018-07-12 16:29:32 +02:00
|
|
|
|
2020-04-05 21:54:11 +02:00
|
|
|
size_t getSerializedSize() const;
|
2018-07-12 16:29:32 +02:00
|
|
|
|
2020-04-05 22:42:48 +02:00
|
|
|
ReturnValue_t deSerialize(const uint8_t** buffer, ssize_t* size,
|
2018-07-12 16:29:32 +02:00
|
|
|
bool bigEndian);
|
|
|
|
|
|
|
|
ReturnValue_t getParameter(uint8_t domainId, uint16_t parameterId,
|
|
|
|
ParameterWrapper *parameterWrapper,
|
|
|
|
const ParameterWrapper *newValues, uint16_t startAtIndex);
|
|
|
|
private:
|
|
|
|
const object_id_t deviceObjectId;
|
|
|
|
const uint8_t switchId1;
|
|
|
|
const uint8_t switchId2;
|
|
|
|
|
|
|
|
const bool doIHaveTwoSwitches;
|
|
|
|
|
|
|
|
float min;
|
|
|
|
float max;
|
|
|
|
|
|
|
|
uint8_t moduleId;
|
|
|
|
|
|
|
|
PowerComponent();
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* POWERCOMPONENT_H_ */
|