Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ See the examples for basic usage options

## Changelog

### v2.3.1 - 2026-03-04

- Hotfix: DPT16 was not correctly handled for uninitialized KOs

### v2.3.0 - 2026-01-28
- Fix Define for 'DPT_FlowRate_m3/h'
- Enhance multicast initialization logging
Expand Down
2 changes: 1 addition & 1 deletion library.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "knx",
"version": "2.2.2",
"version": "2.3.1",
"description": "knx stack",
"homepage": "https://openknx.de",
"authors": [
Expand Down
4 changes: 2 additions & 2 deletions src/knx/dpt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ bool Dpt::operator!=(const Dpt& other) const
return !(other == *this);
}

unsigned char Dpt::sizeInMemory() const
unsigned char Dpt::dataLength() const
{
switch (mainGroup)
{
Expand Down Expand Up @@ -72,7 +72,7 @@ unsigned char Dpt::sizeInMemory() const
case 275:
return 8;
case 16:
return 15; // terminating with 0x00 char
return 14;
case 285:
return 16;
default:
Expand Down
2 changes: 1 addition & 1 deletion src/knx/dpt.h
Original file line number Diff line number Diff line change
Expand Up @@ -370,5 +370,5 @@ class Dpt
unsigned short index;
bool operator==(const Dpt& other) const;
bool operator!=(const Dpt& other) const;
unsigned char sizeInMemory() const;
unsigned char dataLength() const;
};
11 changes: 6 additions & 5 deletions src/knx/group_object.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -287,14 +287,15 @@ bool GroupObject::valueNoSend(const KNXValue& value)

void GroupObject::recalculateDataLength(const Dpt& type)
{
uint8_t sizeInMemory = type.sizeInMemory();
if (_commFlagEx.uninitialized && sizeInMemory > _dataLength)
uint8_t dataLength = type.dataLength();
if (_commFlagEx.uninitialized && dataLength > _dataLength)
{
_dataLength = sizeInMemory;
_dataLength = dataLength;
if (_data)
delete[] _data;
_data = new uint8_t[_dataLength];
memset(_data, 0, _dataLength);
uint8_t sizeInMemory = (type.mainGroup == 16) ? dataLength + 1 : dataLength;
_data = new uint8_t[sizeInMemory];
memset(_data, 0, sizeInMemory);
}
}

Expand Down
Loading