openv / vcontrold

:fire: vcontrold Daemon for control and logging of Viessmann® type heating devices
https://github.com/openv/openv/wiki
GNU General Public License v3.0
101 stars 54 forks source link

Write logic #50

Closed philverh closed 5 years ago

philverh commented 5 years ago

While reading through the code, I noticed some strange behaviour in the io.c module, and more specifically in the my_send function used to write commands to the vito IR interface. What I noticed is that before trying to write something to the IR interface (output queue), a call is made to read any pending characters in the input, followed by a call to tcflush the INPUT queue, before writing to the output queue without checking the return code. Indeed the my_send function is hardcoded to return success in the form of "1" instead of returning a value depending on the result of the write. In the remainder of the vcontrold project (framer.c and parser.c), the my_send function is called and the return value is evaluated to check the success of the write ...

I have been running for some time now with an altered io.c, where I :

I do not have a lot of experience with github, so I'll need to do some reading on how to propose those changes for inclusion in the project.

philverh commented 5 years ago

Close this issue, as it is a duplicate. The solution is being worked out in issue #51 .