[Nut-upsdev] Change required for upscode2 driver
Arjen de Korte
nut+devel at de-korte.org
Mon Nov 3 08:52:30 UTC 2008
Niklas, Niels,
Some changes are required in the upscode2 driver since ser_get_line()
will now return 0 on timeouts. This means that there is no way to tell
this apart from an empty line, which is a condition that is checked
for in this driver. I committed a change to prevent the driver from
locking up on timeouts, but this removed the empty line skipping in
the process.
Note that using ser_get_line() to discard empty lines is (and never
was) a good way to do this. The function internally reads up to 64
bytes at a time and if the first byte is equal to ENDCHAR, the
remaining characters are discarded and lost forever. See also the
example in docs/new-drivers.txt. In all likelihood, this never worked
like intended.
Best regards, Arjen
--
Please keep list traffic on the list
More information about the Nut-upsdev
mailing list