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; + } } }