dufourgilles / knx-ip

KNX IP Gateway protocol implementation
30 stars 9 forks source link

Fix handling connection state response status #11

Closed ErwinSteffens closed 3 years ago

ErwinSteffens commented 3 years ago

Suggestion to fix handling the status in the KNXConnectionStateResponse message.

We are using this library with knxd (https://github.com/knxd/knxd). When a client (using knx-ip) does not ack within the specified time knxd marks the connection state as errored. The only way for now to detect this is the status field in the KNXConnectionStateResponse message. This will indicate a non-zero value with an error.

Also we think the handling of the request ack is broken in the develop-tp branch because it start reading it's values on the wrong index.

I would also like to suggest a change for passing some options to the knx socket (like the keep-alive time-out time), but I will make a separate MR for this.

dufourgilles commented 3 years ago

Thanks for spotting this problem and giving the fix.