knx
ETS configurable knx-stack
InterfaceObject Class Reference

This class represents and interface object. More...

#include <interface_object.h>

Inheritance diagram for InterfaceObject:
Collaboration diagram for InterfaceObject:

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)
 
Propertyproperty (PropertyID id)
 Gets property with PropertyID id if it exists and nullptr otherwise. More...
 
template<typename 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 Propertyproperty (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
 

Detailed Description

This class represents and interface object.

See section 4 of [3].

Definition at line 63 of file interface_object.h.

Constructor & Destructor Documentation

◆ ~InterfaceObject()

InterfaceObject::~InterfaceObject ( )
virtual

Destructor.

Definition at line 6 of file interface_object.cpp.

Member Function Documentation

◆ command()

void InterfaceObject::command ( PropertyID  id,
uint8_t *  data,
uint8_t  length,
uint8_t *  resultData,
uint8_t &  resultLength 
)
virtual

Call command of a function property of the interface object.

Property type must be PDT_FUNCTION

Parameters
idid of the property to call
[in]lengthThe size of the data buffer
[in]dataThe argument data for the function
[out]resultLengthThe size of the result data buffer
[out]resultDataThe result data for the function

Definition at line 98 of file interface_object.cpp.

Here is the call graph for this function:

◆ initializeProperties()

void InterfaceObject::initializeProperties ( size_t  propertiesSize,
Property **  properties 
)
protectedvirtual

Intializes the Property-array the the supplied values.

Reimplemented in TableObject.

Definition at line 122 of file interface_object.cpp.

Here is the caller graph for this function:

◆ masterReset()

void InterfaceObject::masterReset ( EraseCode  eraseCode,
uint8_t  channel 
)
virtual

Reimplemented in RouterObject.

Definition at line 57 of file interface_object.cpp.

Here is the caller graph for this function:

◆ property() [1/2]

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.

Here is the caller graph for this function:

◆ property() [2/2]

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.

◆ propertyData() [1/2]

const uint8_t * InterfaceObject::propertyData ( PropertyID  id)

Definition at line 194 of file interface_object.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ propertyData() [2/2]

const uint8_t * InterfaceObject::propertyData ( PropertyID  id,
uint16_t  elementIndex 
)

Definition at line 200 of file interface_object.cpp.

Here is the call graph for this function:

◆ propertySize()

uint8_t InterfaceObject::propertySize ( PropertyID  id)
virtual

Gets the size of of property in bytes.

Parameters
idof the property to get the size of
Returns
the size in byte or 0 if the interface object does not have the property

Definition at line 87 of file interface_object.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ propertyValue() [1/2]

template<typename T >
T InterfaceObject::propertyValue ( PropertyID  id)
inline

Definition at line 163 of file interface_object.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ propertyValue() [2/2]

template<typename T >
void InterfaceObject::propertyValue ( PropertyID  id,
value 
)
inline

Definition at line 173 of file interface_object.h.

Here is the call graph for this function:

◆ readProperty()

void InterfaceObject::readProperty ( PropertyID  id,
uint16_t  start,
uint8_t &  count,
uint8_t *  data 
)
virtual

Read a property of the interface object.

See section 4.8.4.2 of [3].

Parameters
idid of the property to read
start(for properties with multiple values) at which element should we start
[in,out]counthow many values should be read. If there is a problem (e.g. property does not exist) this value is set to 0.
[out]dataThe requested data of the property.

Definition at line 63 of file interface_object.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ readPropertyDescription()

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.

Parameters
[in,out]propertyIdThe 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]propertyIndexThe 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]writeEnableCan the property be written to.
[out]typethe PropertyDataType of the property
[out]numberOfElementsthe number of elements of the property. Zero if the interface object does not have the requested property.
[out]accessthe AccessLevel necessary to read/write the property.

Definition at line 12 of file interface_object.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ restore()

const uint8_t * InterfaceObject::restore ( const uint8_t *  buffer)
overridevirtual

This method is called when the object should restore its state from the buffer.

Parameters
bufferThe buffer the object should restore its state from.
Returns
The buffer plus the size of the object state. The next object will use this value as the start of its buffer.

Reimplemented from SaveRestore.

Reimplemented in TableObject, and RouterObject.

Definition at line 154 of file interface_object.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ save()

uint8_t * InterfaceObject::save ( uint8_t *  buffer)
overridevirtual

This method is called when the object should save its state to the buffer.

Parameters
bufferThe buffer the object should save its state to.
Returns
The buffer plus the size of the object state. The next object will use this value as the start of its buffer.

Reimplemented from SaveRestore.

Reimplemented in TableObject.

Definition at line 140 of file interface_object.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ saveSize()

uint16_t InterfaceObject::saveSize ( )
overridevirtual
Returns
The maximum number of bytes the object needs to save its state.

Reimplemented from SaveRestore.

Reimplemented in TableObject.

Definition at line 168 of file interface_object.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ state()

void InterfaceObject::state ( PropertyID  id,
uint8_t *  data,
uint8_t  length,
uint8_t *  resultData,
uint8_t &  resultLength 
)
virtual

Get state of a function property of the interface object.

Property type must be PDT_FUNCTION

Parameters
idid of the property to call
[in]lengthThe size of the data buffer
[in]dataThe argument data for the function
[out]resultLengthThe size of the result data buffer
[out]resultDataThe result data for the function

Definition at line 110 of file interface_object.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ writeProperty()

void InterfaceObject::writeProperty ( PropertyID  id,
uint16_t  start,
uint8_t *  data,
uint8_t &  count 
)
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].

Parameters
idid of the property to write
start(for properties with multiple values) at which element should we start
[in,out]counthow many values should be written. If there is a problem (e.g. property does not exist) this value is set to 0.
[in]dataThe data that should be written.

Definition at line 75 of file interface_object.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ _properties

Property** InterfaceObject::_properties = nullptr
protected

Definition at line 196 of file interface_object.h.

◆ _propertyCount

uint8_t InterfaceObject::_propertyCount = 0
protected

Definition at line 197 of file interface_object.h.


The documentation for this class was generated from the following files: