mknx/smarthome — pull request #120 by ohinckel (2014-06-12 09:00:30+00:00)
Title: Sml Plugin: Support more devices using hex strings

This pull request is based on the pull request #118, which should be merged first, because this will merge all the changes from this pull request too. This all was implemented to fix the issue #117 to support a special IR-to-LAN gateway.

Additionally to pull request #118, this patch will add a new `device` attribute which can be used in the plugin configuration and specifies how the data retrieved by the plugin needs to be prepared before extracting the SML data. Currently you can use `raw` (e.g. if you have directly connected an IR device) or `hex` if you're using a different device between your power meter and the SML plugin (e.g. Smart Meter Gateway Com-1).

Additionally to the two values listed above you can also assign a device name; but currenlty only one known device is supported and can be configured by using `smart-meter-gateway-com-1` as value for the `device` attribute. If such a device is configured the SML plugin itself knows how to deal with or prepare the data before doing the SML extraction.

Some other issues fixed with this pull request:
* the plugin now reads in non-blocking mode an all the data which can be gathered by the connection (instead of just reading 512 bytes, which leads to time-shifts since the buffer may deliver the following 512 bytes at the next read call)
* the connection tracking was removed since it never was used and only generates errors (copy&past left over I guess)
* fix debugging output with whitespaces
* fix error generated when reading an entity at nearly EOF (e.g. when only reading a chunk and the last entity is not completely transferred, so it's just a part of it, but should not generate an error)