Skip to content

Conversation

@cornelius-koepp
Copy link
Member

Issue

Setting a value which cannot be converted to the given DPT did result in unexpected behaviour.

  • valueNoSendCompare/valueCompare resulted in value 0 (and returned change based on this value)
  • valueNoSend updated state from unitialized to OK, without updating the value
  • value wrote to GA without setting the KO value

Reproduce

For all cases use a value/type combination which results in KNX_Encode_Value return false.

Example: value 500 with type DPT_Value_1_Ucount, or any other

Note: DPT1 will not fail; ignoring all other bits.

  • valueNoSendCompare/valueCompare: did always set value to 0 (no special preconditions needed beside conversion fail)
  • valueNoSend: use before any other change of KO. No change in value expected, but read requests will answered (with undefined value)
  • value use before any other change of KO. Will result in write telegram (with other value included)

Fix

Suppress updating, status-update and sending for invalid values.

To Discuss

The fix does not change the public interface for changing/writing KO values, so there will be no feedback if conversion fails. Current methods return type void could be changed to bool to indicate success, without breaking.

@cornelius-koepp cornelius-koepp added the bug Something isn't working label Nov 2, 2024
@cornelius-koepp cornelius-koepp requested a review from mumpf November 2, 2024 20:34
@cornelius-koepp cornelius-koepp changed the title Fix Sending Wrong Values on Failed Convertion to DPT Fix Sending Wrong Values on Failed Conversion to DPT Nov 6, 2024
…ersion to DPT

Remove _valueNoSend(..) as valueNoSend(..) is now the same
@cornelius-koepp cornelius-koepp changed the base branch from v1 to v1dev November 17, 2024 22:54
@Ing-Dom
Copy link
Member

Ing-Dom commented Nov 18, 2024

please add a short description in the Changelog about this
then I will merge it
https://github.com/OpenKNX/knx/blob/v1dev/README.md#v1dev-replace-this-with-version-and-date-when-releasing-to-v1

@Ing-Dom Ing-Dom merged commit 2cd5a28 into v1dev Nov 18, 2024
6 checks passed
Ing-Dom added a commit that referenced this pull request Jul 3, 2025
* fix: only set pinMode of Prog button pin when pin is >= 0 and isr function is defined
otherwise it is useless anyway and causes warnings.

* String \0 terminated in group objects (#25)

* String \0 terminated in group objects

* Remove copy constructor, fix bugs in setting buffer to 0

* Remove copy constructor in GroupObject

* remove generic ethernet support on rp2040. uses now KNX_IP_LAN or KNX_IP_WIFI

* update rp2040 plattform version in examples and ci

* Better Routing and new Tunneling Support (#26)

Support 0x091A IP-Router better, including KNX IP Tunneling and a lot of smaller fixes

* add DPT 27.001

* Prevent using inadvertently copy constructor of GroupObject

* V2.1.1 (rq queue bugfix)

* prepare README.md - add current changes

* increase device object api version to 2 (invalidation of knx flash data stored by older versions)
neccessary due to changes to TableObject.save and restore for router (0x091A) support

* add #pragma once to Arduino plattform to allow derived plattforms

* Fix Sending Wrong Values on Failed Conversion to DPT (#30)

* Fix `valueNoSendCompare`: DPT Conversion Fail Resulted in Setting KO to 0
* Fix `valueNoSend`: Do NOT End KO Uninitialized when Value Conversion Failed
* Fix: Do NOT Send when Updating KO Failed on Value Conversion
* Group-Object Value Update: Return Indication for Success/Fail of Conversion to DPT
* Update Changelog: #30 Fix and Signature Change of `GroupObject` Value Update

* adapt esp plattform using KNX_NETIF

* add changelog

* fix some bugs in tunneling support detected by the usage of esp32 (heap corruption)

* Fix casing of ETH in include

* fix Bau091A:IsAckRequired for Broadcasts

* fix bug in res tunnel feature

* remove debug printf

* fix searchResponseExtended DHCP, prints, length

* fix getting MAC-Address from ipstack in rp2040 and ESP plattform

* pack CC1310 example to reduce filecount

* fix data port selection for IP tunneling

* new tpuart implementation (#34)

new tpuart implementation

* enhance multicast setup with network interface check and initialization message

* suppress unused variable warning in multicast setup

* cleanup examples and ci pipeline

* - use tpuart lib 1.0.0
- filter echoed and repeated inbound frames

* adds: disable repitions filter on router

* fix doNotRepeat flag not correctly propagated to link layer

* use TPuart lib 1.0.1

* adapt README.md

* prepare V2.2.0

---------

Co-authored-by: Michael Geramb <lasso_riefen0m@icloud.com>
Co-authored-by: Marco Scholl <develop@marco-scholl.de>
Co-authored-by: Cornelius Köpp <121643070+cornelius-koepp@users.noreply.github.com>
@Ing-Dom Ing-Dom deleted the fix/group-object-setting-invalid-value branch July 3, 2025 23:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants