From 2d0b0d05e5d7dc3e279ae71966348ccc882eecce Mon Sep 17 00:00:00 2001 From: Nanosonde <2073569+nanosonde@users.noreply.github.com> Date: Fri, 10 Jul 2020 21:37:28 +0200 Subject: [PATCH] save work --- src/knx/tpuart_data_link_layer.cpp | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/src/knx/tpuart_data_link_layer.cpp b/src/knx/tpuart_data_link_layer.cpp index 50c103c..4b00aee 100644 --- a/src/knx/tpuart_data_link_layer.cpp +++ b/src/knx/tpuart_data_link_layer.cpp @@ -266,8 +266,9 @@ void TpUartDataLinkLayer::loop() { uint8_t c = 0x10; - // If this is not a nullptr we consider this a device to be a coupler - // TODO: Improve for coupler mode, only ACK according to filter tables + // TODO: Improve for coupler mode. Use callback from bau to check if we are addressed + // The bau knows everything and could either check the address table object (normal device) + // or any filter tables (coupler) to see if we are addressed. if (_groupAddressTable) { //check if individual or group address @@ -291,10 +292,26 @@ void TpUartDataLinkLayer::loop() else { // TODO: test for only our coupler + //individual - if (_deviceObject.induvidualAddress() == getWord(buffer + 4)) + //check if individual or group address + if ((buffer[6] & 0x80) == 0) { - c |= 0x01; + //individual + if (_deviceObject.induvidualAddress() == getWord(buffer + 4)) + { + c |= 0x01; + } + } + else + { + // TODO: test for only our coupler + + //group + if (getWord(buffer + 4) == 0) + { + c |= 0x01; + } } }