knx
ETS configurable knx-stack
AddressTableObject Class Reference

This class represents the group address table. More...

#include <address_table_object.h>

Inheritance diagram for AddressTableObject:
[legend]
Collaboration diagram for AddressTableObject:
[legend]

Public Member Functions

 AddressTableObject (Memory &memory)
 The constructor. 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 entryCount ()
 returns the number of group addresses of the object. More...
 
uint16_t getGroupAddress (uint16_t tsap)
 Get the group address mapped to a TSAP. More...
 
uint16_t getTsap (uint16_t groupAddress)
 Get the TSAP mapped to a group address. More...
 
bool contains (uint16_t groupAddress)
 Check if the address table contains a group address. More...
 
- Public Member Functions inherited from TableObject
 TableObject (Memory &memory, uint32_t staticTableAdr=0, uint32_t staticTableSize=0)
 The constuctor. More...
 
virtual ~TableObject ()
 The destructor. More...
 
LoadState loadState ()
 This method returns the LoadState of the interface object. 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
 
- Public Member Functions inherited from InterfaceObject
virtual ~InterfaceObject ()
 Destructor. More...
 
virtual void readPropertyLength (PropertyID id, uint16_t &length)
 Read length of a property of the interface object. 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...
 

Protected Member Functions

void beforeStateChange (LoadState &newState) override
 This method is called before the interface object enters a new LoadState. More...
 
- Protected Member Functions inherited from TableObject
uint8_t * data ()
 returns the internal data of the interface object. More...
 
void errorCode (ErrorCode errorCode)
 Set the reason for a state change failure. More...
 
void initializeProperties (size_t propertiesSize, Property **properties) override
 Intializes the Property-array the the supplied values. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from TableObject
static void beforeTablesUnloadCallback (BeforeTablesUnloadCallback func)
 
static BeforeTablesUnloadCallback beforeTablesUnloadCallback ()
 
- Protected Attributes inherited from TableObject
Memory_memory
 
- Protected Attributes inherited from InterfaceObject
Property ** _properties = nullptr
 
uint8_t _propertyCount = 0
 
- Static Protected Attributes inherited from TableObject
static BeforeTablesUnloadCallback _beforeTablesUnload = 0
 

Detailed Description

This class represents the group address table.

It provides a mapping between transport layer service access points (TSAP) and group addresses. The TSAP can be imagined as an index to the array of group addresses.

See section 4.10 of [4] for further details. It implements realisation type 7 (see section 4.10.7 of [4]).

Definition at line 12 of file address_table_object.h.

Constructor & Destructor Documentation

◆ AddressTableObject()

AddressTableObject::AddressTableObject ( Memory memory)

The constructor.

Parameters
memoryThis parameter is only passed to the constructor of TableObject and is not used by this class.

Definition at line 9 of file address_table_object.cpp.

Here is the call graph for this function:

Member Function Documentation

◆ beforeStateChange()

void AddressTableObject::beforeStateChange ( LoadState newState)
overrideprotectedvirtual

This method is called before the interface object enters a new LoadState.

If there is a error changing the state newState should be set to LS_ERROR and errorCode() to a reason for the failure.

Reimplemented from TableObject.

Definition at line 88 of file address_table_object.cpp.

Here is the call graph for this function:

◆ contains()

bool AddressTableObject::contains ( uint16_t  groupAddress)

Check if the address table contains a group address.

Parameters
groupAddressthe group address to check
Returns
true if the address table contains the group address, false otherwise

Definition at line 83 of file address_table_object.cpp.

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

◆ entryCount()

uint16_t AddressTableObject::entryCount ( )

returns the number of group addresses of the object.

Definition at line 20 of file address_table_object.cpp.

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

◆ getGroupAddress()

uint16_t AddressTableObject::getGroupAddress ( uint16_t  tsap)

Get the group address mapped to a TSAP.

Parameters
tsapThe TSAP of which to get the group address for.
Returns
the groupAddress if found or zero if no group address was found.

Definition at line 29 of file address_table_object.cpp.

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

◆ getTsap()

uint16_t AddressTableObject::getTsap ( uint16_t  groupAddress)

Get the TSAP mapped to a group address.

Parameters
groupAddressthe group address of which to get the TSAP for.
Returns
the TSAP if found or zero if no tsap was found.

Definition at line 37 of file address_table_object.cpp.

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

◆ restore()

const uint8_t * AddressTableObject::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.

Definition at line 72 of file address_table_object.cpp.

Here is the call graph for this function:

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