[Nut-upsdev] Problem with bestfcom and old Ferrups

Chris Adams cmadams at hiwaay.net
Thu Feb 7 14:49:01 UTC 2008


Once upon a time, Arjen de Korte <nut+devel at de-korte.org> said:
> I think this is better handled by a strategically placed 'ser_flush_io()'
> command. Since you're not actually reading data, this is probably all it
> takes to get rid of the garbarge that is left in the buffer. From looking
> at the execute() function, a favorable position would be
> 
> 193- 	        ser_get_line_alert(upsfd, buf, sizeof(buf), '\012', "",
> 194- 	                POLL_ALERT, alert_handler, 0, 20000);
> 193+
> 194+ 	        ser_flush_io(upsfd);
> 195
> 196 	        ser_send(upsfd, cmd);

I tried this, but it didn't catch the extra data.  I still needed the
ser_get_line() calls.

-- 
Chris Adams <cmadams at hiwaay.net>
Systems and Network Administrator - HiWAAY Internet Services
I don't speak for anybody but myself - that's enough trouble.



More information about the Nut-upsdev mailing list