knx
ETS configurable knx-stack
|
This class represents and interface object. More...
#include <interface_object.h>
Public Member Functions | |
virtual | ~InterfaceObject () |
Destructor. More... | |
virtual void | readProperty (PropertyID id, uint16_t start, uint8_t &count, uint8_t *data) |
Read a property of the interface object. More... | |
virtual void | writeProperty (PropertyID id, uint16_t start, uint8_t *data, uint8_t &count) |
Write property of the interface object. More... | |
virtual uint8_t | propertySize (PropertyID id) |
Gets the size of of property in bytes. More... | |
virtual void | command (PropertyID id, uint8_t *data, uint8_t length, uint8_t *resultData, uint8_t &resultLength) |
Call command of a function property of the interface object. More... | |
virtual void | state (PropertyID id, uint8_t *data, uint8_t length, uint8_t *resultData, uint8_t &resultLength) |
Get state of a function property of the interface object. More... | |
void | readPropertyDescription (uint8_t &propertyId, uint8_t &propertyIndex, bool &writeEnable, uint8_t &type, uint16_t &numberOfElements, uint8_t &access) |
Read the Description of a property of the interface object. More... | |
virtual void | masterReset (EraseCode eraseCode, uint8_t channel) |
Property * | property (PropertyID id) |
Gets property with PropertyID id if it exists and nullptr otherwise. More... | |
template<typename T > | |
T | propertyValue (PropertyID id) |
template<typename T > | |
void | propertyValue (PropertyID id, T value) |
const uint8_t * | propertyData (PropertyID id) |
const uint8_t * | propertyData (PropertyID id, uint16_t elementIndex) |
const Property * | property (PropertyID id) const |
Gets const property with PropertyID id if it exists and nullptr otherwise. More... | |
uint8_t * | save (uint8_t *buffer) override |
This method is called when the object should save its state to the buffer. More... | |
const uint8_t * | restore (const uint8_t *buffer) override |
This method is called when the object should restore its state from the buffer. More... | |
uint16_t | saveSize () override |
Protected Member Functions | |
virtual void | initializeProperties (size_t propertiesSize, Property **properties) |
Intializes the Property-array the the supplied values. More... | |
Protected Attributes | |
Property ** | _properties = nullptr |
uint8_t | _propertyCount = 0 |
This class represents and interface object.
See section 4 of [3].
Definition at line 63 of file interface_object.h.
|
virtual |
Destructor.
Definition at line 6 of file interface_object.cpp.
|
virtual |
Call command of a function property of the interface object.
Property type must be PDT_FUNCTION
id | id of the property to call | |
[in] | length | The size of the data buffer |
[in] | data | The argument data for the function |
[out] | resultLength | The size of the result data buffer |
[out] | resultData | The result data for the function |
Definition at line 98 of file interface_object.cpp.
|
protectedvirtual |
Intializes the Property-array the the supplied values.
Reimplemented in TableObject.
Definition at line 122 of file interface_object.cpp.
|
virtual |
Reimplemented in RouterObject.
Definition at line 57 of file interface_object.cpp.
Property * InterfaceObject::property | ( | PropertyID | id | ) |
Gets property with PropertyID id if it exists and nullptr otherwise.
Definition at line 130 of file interface_object.cpp.
const Property * InterfaceObject::property | ( | PropertyID | id | ) | const |
Gets const property with PropertyID id if it exists and nullptr otherwise.
Definition at line 184 of file interface_object.cpp.
const uint8_t * InterfaceObject::propertyData | ( | PropertyID | id | ) |
Definition at line 194 of file interface_object.cpp.
const uint8_t * InterfaceObject::propertyData | ( | PropertyID | id, |
uint16_t | elementIndex | ||
) |
|
virtual |
Gets the size of of property in bytes.
id | of the property to get the size of |
Definition at line 87 of file interface_object.cpp.
|
inline |
Definition at line 163 of file interface_object.h.
|
inline |
|
virtual |
Read a property of the interface object.
See section 4.8.4.2 of [3].
id | id of the property to read | |
start | (for properties with multiple values) at which element should we start | |
[in,out] | count | how many values should be read. If there is a problem (e.g. property does not exist) this value is set to 0. |
[out] | data | The requested data of the property. |
Definition at line 63 of file interface_object.cpp.
void InterfaceObject::readPropertyDescription | ( | uint8_t & | propertyId, |
uint8_t & | propertyIndex, | ||
bool & | writeEnable, | ||
uint8_t & | type, | ||
uint16_t & | numberOfElements, | ||
uint8_t & | access | ||
) |
Read the Description of a property of the interface object.
The output parameters are only valid if nuberOfElements is not zero.
[in,out] | propertyId | The id of the property of which to read the description of. If this parameter is not zero propertyIndex paramter is ignored as input and the corrrect index of the property is written to it. If this parameter is zero the PropertyID of the property specified by propertyIndex is written to it. |
[in,out] | propertyIndex | The index of the property of the interface object of which to read the description of. only used for input if propertyId is not set. Otherwise the index of the property specified by propertyId is written to it. |
[out] | writeEnable | Can the property be written to. |
[out] | type | the PropertyDataType of the property |
[out] | numberOfElements | the number of elements of the property. Zero if the interface object does not have the requested property. |
[out] | access | the AccessLevel necessary to read/write the property. |
Definition at line 12 of file interface_object.cpp.
|
overridevirtual |
This method is called when the object should restore its state from the buffer.
buffer | The buffer the object should restore its state from. |
Reimplemented from SaveRestore.
Reimplemented in TableObject, and RouterObject.
Definition at line 154 of file interface_object.cpp.
|
overridevirtual |
This method is called when the object should save its state to the buffer.
buffer | The buffer the object should save its state to. |
Reimplemented from SaveRestore.
Reimplemented in TableObject.
Definition at line 140 of file interface_object.cpp.
|
overridevirtual |
Reimplemented from SaveRestore.
Reimplemented in TableObject.
Definition at line 168 of file interface_object.cpp.
|
virtual |
Get state of a function property of the interface object.
Property type must be PDT_FUNCTION
id | id of the property to call | |
[in] | length | The size of the data buffer |
[in] | data | The argument data for the function |
[out] | resultLength | The size of the result data buffer |
[out] | resultData | The result data for the function |
Definition at line 110 of file interface_object.cpp.
|
virtual |
Write property of the interface object.
If the interface object does not have the property this method does nothing. See section 4.8.4.4 of [3].
id | id of the property to write | |
start | (for properties with multiple values) at which element should we start | |
[in,out] | count | how many values should be written. If there is a problem (e.g. property does not exist) this value is set to 0. |
[in] | data | The data that should be written. |
Definition at line 75 of file interface_object.cpp.
|
protected |
Definition at line 196 of file interface_object.h.
|
protected |
Definition at line 197 of file interface_object.h.