search for: ser_flush_io

Displaying 4 results from an estimated 4 matches for "ser_flush_io".

Did you mean: ser_flush_in
2008 Nov 06
0
[nut-commits] svn commit r1549 - in trunk: . drivers
...eft in the input buffer. So flushing the input buffers > was not guaranteed to work. This still holds true, a zero length reply doesn't mean there is nothing more in the input buffer (this might be an empty line with only a <NL> in it), so we'd better use ser_flush_in() or ser_flush_io() instead. Best regards, Arjen -- Please keep list traffic on the list
2008 Feb 07
1
Megatec serial UPS woes
Hi! This is the weirdest problem I have found for a long time! Using nut-2.0.5 and a Gentoo powered HP Proliant ML350 I setup the config files just the same as I always do and tried to get the megatec driver chatting to the UPS. It worked fine on a Windoze server with Upsilon2000 so I have a bit of confidence in cable etc! When I ran upsc after starting upsd to complained about stale data! Most
2008 Jul 10
2
[PATCH] tripplite driver updates
...r(upsfd, &c, SER_WAIT_SEC, SER_WAIT_USEC); if (ret == -1) - return -1; + goto out; if (c == IGNCHAR || c == ENDCHAR) continue; buf[i++] = c; } while (c != ENDCHAR && i < len); buf[i] = '\0'; - ser_flush_in(upsfd, NULL, 0); - return i; + ret = i; +out: + ser_flush_io(upsfd); + return ret; } static void ups_sync(void) @@ -301,14 +285,17 @@ void upsdrv_initinfo(void) int va; long w, l; - /* Detect the UPS or die. */ ups_sync(); - send_cmd(":W\r", w_value, sizeof w_value); - send_cmd(":L\r", l_value, sizeof l_value); - send_cmd...
2011 Oct 03
2
patch: Replace many usleep and some sleep calls with nanosleep
...:17.000000000 +0300 +++ b/drivers/belkinunv.c 2011-08-17 00:40:17.000000000 +0300 @@ -239,7 +239,7 @@ static void belkin_nut_open_tty(void) "smart" mode */ ser_set_dtr(upsfd, 0); ser_set_rts(upsfd, 1); - sleep(1); + struct timespec delay = {1, 0}; nanosleep(&delay, NULL); ser_flush_io(upsfd); } @@ -495,7 +495,7 @@ static int belkin_std_open_tty(const cha /* sleep at least 0.25 seconds for the UPS to wake up. Belkin's own software sleeps 1 second, so that's what we do, too. */ - usleep(1000000); + struct timespec delay = {1, 0}; nanosleep(&delay, NULL);...