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 :
removed the low level read to flush the input queue
changed the tcflush parameter to flush both Input and Output of the IR interface
changed the write logic to return the number of bytes written, or 0 in case of error.
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.
While reading through the code, I noticed some strange behaviour in the
io.c
module, and more specifically in themy_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 totcflush
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), themy_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.