|
knx
ETS configurable knx-stack
|
This class represents a single group object. More...
#include <group_object.h>
Public Member Functions | |
| GroupObject () | |
| The constructor. More... | |
| virtual | ~GroupObject () |
| The destructor. More... | |
| bool | responseUpdateEnable () |
| Check if the update flag (U) was set. More... | |
| bool | transmitEnable () |
| Check if the transmit flag (T) was set. More... | |
| bool | valueReadOnInit () |
| Check if the initialisation flag (I) was set. More... | |
| bool | writeEnable () |
| Check if the write flag (W) was set. More... | |
| bool | readEnable () |
| Check if the read flag (R) was set. More... | |
| bool | communicationEnable () |
| Check if the communication flag (C) was set. More... | |
| Priority | priority () |
| Get the priority of the group object. More... | |
| ComFlag | commFlag () |
| Return the current state of the group object. More... | |
| void | commFlag (ComFlag value) |
| Set the current state of the group object. More... | |
| bool | initialized () |
| Check if the group object contains a valid value assigned from bus or from application program. More... | |
| void | requestObjectRead () |
| Request the read of a communication object. More... | |
| void | objectWritten () |
| Mark a communication object as written. More... | |
| size_t | valueSize () |
| returns the size of the group object in Byte. More... | |
| size_t | sizeInTelegram () |
| returns the size of the group object in Byte as it is in a telegram. More... | |
| size_t | sizeInMemory () const |
| returns the size of the group object in the heap memory of the group object. More... | |
| uint8_t * | valueRef () |
| returns the pointer to the value of the group object. More... | |
| uint16_t | asap () |
| returns the Application Service Access Point of the group object. More... | |
| void | callback (GroupObjectUpdatedHandler handler) |
| register a callback for this group object. More... | |
| GroupObjectUpdatedHandler | callback () |
| returns the registered callback More... | |
| KNXValue | value (const Dpt &type) |
| return the current value of the group object. More... | |
| bool | value (const KNXValue &value, const Dpt &type) |
| set the current value of the group object and changes the state of the group object to WriteRequest. More... | |
| bool | valueCompare (const KNXValue &value, const Dpt &type) |
| Check if the value (after conversion to dpt) will differ from current value of the group object and changes the state of the group object to WriteRequest if different. More... | |
| bool | valueNoSend (const KNXValue &value, const Dpt &type) |
| set the current value of the group objectand show success. More... | |
| bool | valueNoSendCompare (const KNXValue &value, const Dpt &type) |
| Check if the value (after conversion to dpt) will differ from current value of the group object and update if necessary. More... | |
| bool | tryValue (KNXValue &value, const Dpt &type) |
| set the current value of the group object. More... | |
| KNXValue | value () |
| return the current value of the group object. More... | |
| bool | value (const KNXValue &value) |
| set the current value of the group object and changes the state of the group object to WriteRequest. More... | |
| bool | valueNoSend (const KNXValue &value) |
| set the current value of the group object. More... | |
| bool | tryValue (KNXValue &value) |
| set the current value of the group object. More... | |
| Dpt | dataPointType () |
| returns the currently configured datapoint type. More... | |
| void | dataPointType (Dpt value) |
| sets the datapoint type of the group object. More... | |
Static Public Member Functions | |
| static GroupObjectUpdatedHandler | classCallback () |
| Alternative callback processing: register one global callback for all group object. More... | |
| static void | classCallback (GroupObjectUpdatedHandler handler) |
| static void | processClassCallback (GroupObject &ko) |
Friends | |
| class | GroupObjectTableObject |
This class represents a single group object.
In german they are called "Kommunikationsobjekt" or "KO".
Definition at line 41 of file group_object.h.
| GroupObject::GroupObject | ( | ) |
The constructor.
Definition at line 12 of file group_object.cpp.
|
virtual |
The destructor.
Definition at line 23 of file group_object.cpp.
| uint16_t GroupObject::asap | ( | ) |
returns the Application Service Access Point of the group object.
In reality this is just the number of the group object. (in german "KO-Nr")
Definition at line 95 of file group_object.cpp.
| GroupObjectUpdatedHandler GroupObject::callback | ( | ) |
returns the registered callback
Definition at line 239 of file group_object.cpp.
| void GroupObject::callback | ( | GroupObjectUpdatedHandler | handler | ) |
register a callback for this group object.
The registered callback will be called if the group object was changed from the bus.
Definition at line 233 of file group_object.cpp.
|
static |
Alternative callback processing: register one global callback for all group object.
The registered callback will be called if any group object was changed from the bus. The callback method has to dispatch to the correct handler for this group object.
Definition at line 216 of file group_object.cpp.
|
static |
Definition at line 221 of file group_object.cpp.
| ComFlag GroupObject::commFlag | ( | ) |
Return the current state of the group object.
See ComFlag
Definition at line 162 of file group_object.cpp.
| void GroupObject::commFlag | ( | ComFlag | value | ) |
Set the current state of the group object.
Application code should only use this to set the state to Ok after reading a Updated to mark the changed group object as processed. This is optional.
Definition at line 167 of file group_object.cpp.
| bool GroupObject::communicationEnable | ( | ) |
Check if the communication flag (C) was set.
(K-flag in german)
Definition at line 73 of file group_object.cpp.
| Dpt GroupObject::dataPointType | ( | ) |
returns the currently configured datapoint type.
Definition at line 276 of file group_object.cpp.
| void GroupObject::dataPointType | ( | Dpt | value | ) |
sets the datapoint type of the group object.
Definition at line 270 of file group_object.cpp.
| bool GroupObject::initialized | ( | ) |
Check if the group object contains a valid value assigned from bus or from application program.
Definition at line 175 of file group_object.cpp.
| void GroupObject::objectWritten | ( | ) |
Mark a communication object as written.
Calling this function triggers the sending of a write-group-value telegram.
This sets the state of the group object to WriteRequest
Definition at line 185 of file group_object.cpp.
| Priority GroupObject::priority | ( | ) |
Get the priority of the group object.
Definition at line 82 of file group_object.cpp.
|
static |
| bool GroupObject::readEnable | ( | ) |
Check if the read flag (R) was set.
(L-flag in german)
Definition at line 61 of file group_object.cpp.
| void GroupObject::requestObjectRead | ( | ) |
Request the read of a communication object.
Calling this function triggers the sending of a read-group-value telegram, to read the value of the communication object from the bus.
When the answer is received, the communication object's value will be updated.
This sets the state of the group objecte to ReadRequest
Definition at line 180 of file group_object.cpp.
| bool GroupObject::responseUpdateEnable | ( | ) |
Check if the update flag (U) was set.
(A-flag in german)
Definition at line 29 of file group_object.cpp.
| size_t GroupObject::sizeInMemory | ( | ) | const |
returns the size of the group object in the heap memory of the group object.
The function returns the same value as goSize(), exept fot the 14 byte string type to reserve one byte of a \0 terminator character.
Definition at line 201 of file group_object.cpp.
| size_t GroupObject::sizeInTelegram | ( | ) |
returns the size of the group object in Byte as it is in a telegram.
For Group objects with size smaller than 1 byte (for example Dpt 1) this method will return 0.
Definition at line 195 of file group_object.cpp.
| bool GroupObject::transmitEnable | ( | ) |
Check if the transmit flag (T) was set.
(UE-flag in german)
Definition at line 37 of file group_object.cpp.
| bool GroupObject::tryValue | ( | KNXValue & | value | ) |
set the current value of the group object.
| value | the value the group object is set to |
The parameters must fit the group object and dhe datapoint type must be set with dataPointType(). Otherwise it will stay unchanged.
Definition at line 282 of file group_object.cpp.
set the current value of the group object.
| value | the value the group object is set to |
| type | the datapoint type used for the conversion. |
The parameters must fit the group object. Otherwise it will stay unchanged.
Definition at line 264 of file group_object.cpp.
| KNXValue GroupObject::value | ( | ) |
return the current value of the group object.
The datapoint type must be set with dataPointType(). Otherwise the returned value is invalid.
Definition at line 294 of file group_object.cpp.
return the current value of the group object.
| type | the datapoint type used for the conversion. If this doesn't fit to the group object the returned value is invalid. |
Definition at line 257 of file group_object.cpp.
| bool GroupObject::value | ( | const KNXValue & | value | ) |
set the current value of the group object and changes the state of the group object to WriteRequest.
| value | the value the group object is set to |
The parameters must fit the group object and dhe datapoint type must be set with dataPointType(). Otherwise it will stay unchanged.
Definition at line 288 of file group_object.cpp.
set the current value of the group object and changes the state of the group object to WriteRequest.
| value | the value the group object is set to |
| type | the datapoint type used for the conversion. |
The parameters must fit the group object. Otherwise it will stay unchanged.
Definition at line 245 of file group_object.cpp.
Check if the value (after conversion to dpt) will differ from current value of the group object and changes the state of the group object to WriteRequest if different.
Use this method only, when the value should not be sent if it was not changed, otherwise value(const KNXValue&, const Dpt&) will do the same (without overhead for comparing)
| value | the value the group object is set to |
| type | the datapoint type used for the conversion. |
The parameters must fit the group object. Otherwise it will stay unchanged.
Definition at line 347 of file group_object.cpp.
| bool GroupObject::valueNoSend | ( | const KNXValue & | value | ) |
set the current value of the group object.
| value | the value the group object is set to |
The parameters must fit the group object and the datapoint type must be set with dataPointType(). Otherwise it will stay unchanged.
Definition at line 300 of file group_object.cpp.
set the current value of the group objectand show success.
| value | the value the group object is set to |
| type | the datapoint type used for the conversion. |
The parameters must fit the group object. Otherwise it will stay unchanged.
Definition at line 306 of file group_object.cpp.
Check if the value (after conversion to dpt) will differ from current value of the group object and update if necessary.
Use this method only, when the value change is relevant, otherwise valueNoSend(const KNXValue&, const Dpt&) will do the same (without overhead for comparing)
| value | the value the group object is set to |
| type | the datapoint type used for the conversion. |
The parameters must fit the group object. Otherwise it will stay unchanged.
Definition at line 317 of file group_object.cpp.
| bool GroupObject::valueReadOnInit | ( | ) |
Check if the initialisation flag (I) was set.
Definition at line 45 of file group_object.cpp.
| uint8_t * GroupObject::valueRef | ( | ) |
returns the pointer to the value of the group object.
This can be used if a datapoint type is not supported or if you want do your own conversion.
Definition at line 90 of file group_object.cpp.
| size_t GroupObject::valueSize | ( | ) |
returns the size of the group object in Byte.
For Group objects with size smaller than 1 byte (for example Dpt 1) this method will return 1.
Definition at line 190 of file group_object.cpp.
| bool GroupObject::writeEnable | ( | ) |
Check if the write flag (W) was set.
(S-flag in german)
Definition at line 53 of file group_object.cpp.
|
friend |
Definition at line 43 of file group_object.h.