knx
ETS configurable knx-stack
data_property.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "property.h"
4 
5 class DataProperty : public Property
6 {
7  public:
8  DataProperty(PropertyID id, bool writeEnable, PropertyDataType type, uint16_t maxElements, uint8_t access);
9  DataProperty(PropertyID id, bool writeEnable, PropertyDataType type, uint16_t maxElements, uint8_t access, uint8_t value);
10  DataProperty(PropertyID id, bool writeEnable, PropertyDataType type, uint16_t maxElements, uint8_t access, uint16_t value);
11  DataProperty(PropertyID id, bool writeEnable, PropertyDataType type, uint16_t maxElements, uint8_t access, uint32_t value);
12  DataProperty(PropertyID id, bool writeEnable, PropertyDataType type, uint16_t maxElements, uint8_t access, const uint8_t* value);
13  ~DataProperty() override;
14  uint8_t read(uint16_t start, uint8_t count, uint8_t* data) const override;
15  uint8_t write(uint16_t start, uint8_t count, const uint8_t* data) override;
16  uint8_t* save(uint8_t* buffer) override;
17  const uint8_t* restore(const uint8_t* buffer) override;
18  uint16_t saveSize() override;
19  const uint8_t* data();
20  const uint8_t* data(uint16_t elementIndex);
21 
22  private:
23  uint16_t _currentElements = 0;
24  uint8_t* _data = nullptr;
25 };
~DataProperty() override
uint16_t saveSize() override
uint8_t * save(uint8_t *buffer) override
This method is called when the object should save its state to the buffer.
const uint8_t * data()
uint8_t write(uint16_t start, uint8_t count, const uint8_t *data) override
DataProperty(PropertyID id, bool writeEnable, PropertyDataType type, uint16_t maxElements, uint8_t access)
const uint8_t * restore(const uint8_t *buffer) override
This method is called when the object should restore its state from the buffer.
uint8_t read(uint16_t start, uint8_t count, uint8_t *data) const override
PropertyID
Definition: property.h:70
PropertyDataType
The data type of a property.
Definition: property.h:17