7 #ifdef SMALL_GROUPOBJECT
17 #ifndef SMALL_GROUPOBJECT
24 _data =
new uint8_t[other._dataLength];
25 _commFlag = other._commFlag;
26 _dataLength = other._dataLength;
28 #ifndef SMALL_GROUPOBJECT
29 _updateHandler = other._updateHandler;
31 memcpy(_data, other._data, _dataLength);
45 return bitRead(ntohs(_table->_tableData[_asap]), 15) > 0;
53 return bitRead(ntohs(_table->_tableData[_asap]), 14) > 0 ;
61 return bitRead(ntohs(_table->_tableData[_asap]), 13) > 0;
69 return bitRead(ntohs(_table->_tableData[_asap]), 12) > 0 ;
81 return bitRead(ntohs(_table->_tableData[_asap]), 11) > 0;
89 return bitRead(ntohs(_table->_tableData[_asap]), 10) > 0;
98 return (
Priority)((ntohs(_table->_tableData[_asap]) >> 6) & (3 << 2)) ;
111 size_t GroupObject::goSize()
121 size_t GroupObject::asapValueSize(uint8_t code)
127 if (code < 11 || (code > 20 && code < 255))
185 uint8_t code = lowByte(ntohs(_table->_tableData[_asap]));
186 return asapValueSize(code);
189 #ifdef SMALL_GROUPOBJECT
192 return _updateHandlerStatic;
197 _updateHandlerStatic = handler;
200 void GroupObject::processClassCallback(
GroupObject& ko)
202 if (_updateHandlerStatic != 0)
203 _updateHandlerStatic(ko);
209 _updateHandler = handler;
215 return _updateHandler;
238 #ifndef SMALL_GROUPOBJECT
241 _datapointType =
value;
247 return _datapointType;
259 this->
value(value, _datapointType);
265 return value(_datapointType);
This class represents a single group object.
bool writeEnable()
Check if the write flag (W) was set.
GroupObjectUpdatedHandler callback()
returns the registered callback
uint16_t asap()
returns the Application Service Access Point of the group object.
bool responseUpdateEnable()
Check if the update flag (U) was set.
virtual ~GroupObject()
The destructor.
size_t sizeInTelegram()
returns the size of the group object in Byte as it is in a telegram.
ComFlag commFlag()
Return the current state of the group object.
KNXValue value()
return the current value of the group object.
bool transmitEnable()
Check if the transmit flag (T) was set.
GroupObject()
The constructor.
void objectWritten()
Mark a communication object as written.
uint8_t * valueRef()
returns the pointer to the value of the group object.
void requestObjectRead()
Request the read of a communication object.
Priority priority()
Get the priority of the group object.
bool valueReadOnInit()
Check if the initialisation flag (I) was set.
bool communicationEnable()
Check if the communication flag (C) was set.
void valueNoSend(const KNXValue &value, const Dpt &type)
set the current value of the group object.
bool tryValue(KNXValue &value, const Dpt &type)
set the current value of the group object.
size_t valueSize()
returns the size of the group object in Byte.
Dpt dataPointType()
returns the currently configured datapoint type.
bool readEnable()
Check if the read flag (R) was set.
int KNX_Decode_Value(uint8_t *payload, size_t payload_length, const Dpt &datatype, KNXValue &value)
Converts the KNX Payload given by the specific DPT and puts the value in the KNXValue struc.
int KNX_Encode_Value(const KNXValue &value, uint8_t *payload, size_t payload_length, const Dpt &datatype)
Converts the KNXValue struct to the KNX Payload as the specific DPT.
@ Ok
read or write request were send successfully
@ ReadRequest
Read was requested but was not processed.
@ Uninitialized
uninitialized Group Object, its value is not valid
@ WriteRequest
Write was requested but was not processed.
std::function< void(GroupObject &)> GroupObjectUpdatedHandler
@ LowPriority
Normal priority of group communication.