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

Remove hardcoded "success" return from my_send #51

Closed philverh closed 5 years ago

philverh commented 5 years ago

As I said in issue #50
Return code from my_send is tested when the routine is called, and still there was a hardcoded "1" meaning success, returned by the function in all cases. I replaced it with either the number of bytes written to indicate a success, or "0" to indicate failure. In that case the number of bytes written versus the expected length is logged. I also removed the readn used to flush the IR input queue, with a call to tcflush to flush both input and output of the IR interface.

philverh commented 5 years ago

Far from home (and the machine where I do this development) those weeks. It seems the changes are not accepted because removing blank lines does not change the actual code which results in a failre in the automated tests. (code already exists). Will look into this from the 15th of this month when I can access the dev. machine again.

hmueller01 commented 5 years ago

I downloaded io.c and compiled and installed this change. Runs well for the last few hours. I will complain, if I see something strange.

hmueller01 commented 5 years ago

@philverh Can you please change the else { statement I commented above. After that I can merge your pull. Tx.

philverh commented 5 years ago

Done. (again, as I think I already accepted the change you suggested. Thanks @hmueller01 for spotting the mistake and suggesting the change) Changed the else { statement to write to ERR instead of INFO in case of an error.

hmueller01 commented 5 years ago

Sorry, but io.c still has a

} 
else {

instead of

} else {

on line 147/148. Please fix this. Thanks.

philverh commented 5 years ago

Done