search for: bytes_rcvd

Displaying 2 results from an estimated 2 matches for "bytes_rcvd".

Did you mean: bytes_recvd
2005 Dec 19
1
MGE Pulsar ES 8+
...) command. Playing with the source code, I found that with a small wait before the command is sent, the driver works better: static int mge_command(char *reply, int replylen, const char *fmt, ...) { const char *p; char command[BUFFLEN]; int bytes_sent = 0; int bytes_rcvd = 0; int ret; va_list ap; /* wait */ usleep(100000); ... ... ... } [root@srv01 ~]# /home/rog/src/nut/drivers/mge-utalk -i 20 -DDD -u root /dev/ttyS0 Network UPS Tools - MGE UPS SYSTEMS/U-Talk driver 0.86 (2.1.0) debug level is '3' initups: LowBatt una...
2011 Oct 03
2
patch: Replace many usleep and some sleep calls with nanosleep
...quot;Z"); mge_command(NULL, 0, "Ax 1"); - usleep(MGE_CONNECT_DELAY); + struct timespec delay = {0, MGE_CONNECT_DELAY}; nanosleep(&delay, NULL); } ser_flush_in(upsfd, "?\r\n", nut_debug_level); @@ -863,6 +863,7 @@ static int mge_command(char *reply, int int bytes_rcvd = 0; int ret; va_list ap; + struct timespec delay; /* build command string */ va_start(ap, fmt); @@ -875,11 +876,13 @@ static int mge_command(char *reply, int va_end(ap); /* Delay a bit to avoid overlap of a previous answer */ - usleep(100000); + delay.tv_sec = 0; delay.tv_nsec = 10...