mknx/smarthome — pull request #68 by ohinckel (2013-12-28 14:30:30+00:00)
Title: Fix comfoair empty chunks

In some (rare) situations it happens that the serial device reports readyness but returns no data. In this case an empty chunk is returned.

Usually this is not a problem, since it only happens in rare situtions (e.g. when the device has an invalid state or data transfer errors happened). But when this happens while the plugin is waiting for a response, it will end up in an endless loop still trying to read the response.

This patch catches the situation when an empty chunk is received and will raise an exception to completely ignore the packetand try to reconnect.

I don't know if this patch is really helpful since this problem should not happen when everything goes well. But I had problems with my serial device which was causing overload since the plugin created new threads while old threads are still trying to read data. This patch helped me out there for the time I tried to fix the serial device (was a hardware problem).

On the other handI think the plugin should never create an endless loop and should cover such situations.