Displaying 5 results from an estimated 5 matches for "d_usec".
2010 Dec 16
3
windows_port NUT branch
Hi,
Frederic, big thanks for your work on this, by a coincedence it's exactly what
i need at work :)
I'm compiling your branch on Debian GNU/Linux with mingw and having some minor
troubles worth mentioning and (i hope) fixing.
I configure with
CC=586-mingw32msvc-gcc ./configure --host=i586-mingw32msvc --prefix=/c/winnut/
Interestingly, there's scripts/Windows/Makefile in the repo
2009 Aug 14
2
Bestfortress driver, network serial patch for nut-2.0
...;
va_list ap;
unsigned int sent = 0;
va_start(ap, fmt);
ret = vsnprintf(buf, sizeof(buf), fmt, ap);
va_end(ap);
if ((ret < 1) || (ret >= (int) sizeof(buf)))
upslogx(LOG_WARNING, "ser_send_pace: vsnprintf needed more "
"than %d bytes", sizeof(buf));
int d_usec = UPSDELAY;
for (p = buf; *p; p++) {
if (write(upsfd, p, 1) != 1)
return -1;
if (d_usec)
usleep(d_usec);
sent++;
}
return sent;
}
static int upsrecv(char *buf,size_t bufsize,char ec,const char *ic) {
return ser_get_line(upsfd, buf, bufsize - 1, ec, ic,
SER_WAIT_SE...
2008 Oct 30
1
Adding debugging information in serial.c
In order to improve the diagnostics for serial connected devices, I
would like to add the possibility to differentiate between errors and
timeouts.
For the ser_get_char() and ser_get_buf_len() we might do this by
changing the return value. For the first, return value -1 would be an
error, 0 a timeout and 1 success. The latter could return -1 on error,
between 0 and (buflen-1) for a
2011 Oct 03
2
patch: Replace many usleep and some sleep calls with nanosleep
...e6 /* 50e6 ns delay required for reliable operation */
#define SER_WAIT_SEC 2 /* allow 2.0 sec for ser_get calls */
#define SER_WAIT_USEC 0
#define ENDCHAR '\r'
@@ -162,7 +162,7 @@ static int upssend(const char *fmt,...)
char buf[1024], *p;
va_list ap;
unsigned int sent = 0;
- int d_usec = UPSDELAY;
+ struct timespec d_nsec = {0, UPSDELAY};
va_start(ap, fmt);
ret = vsnprintf(buf, sizeof(buf), fmt, ap);
@@ -175,8 +175,7 @@ static int upssend(const char *fmt,...)
if (write(upsfd, p, 1) != 1)
return -1;
- if (d_usec)
- usleep(d_usec);
+ nanosleep(&d_nsec, NULL);...
2007 Jan 23
2
Voltage override in megatec and megatec-over-usb [was: Re: nut-2.0.5 megatec + Online Xanto]
On 1/23/07, Henning Brauer <hb-nut@bsws.de> wrote:
> good new first: the megatec driverin 2.0.5 now works with the Online
> Xanto S3000R here - well, for the very basics.
>
> the UPS has NO way ofidentifying itself. It also does not respond to
> the power ratings query ("F"). I previously used a hacked up fentonups
> driver. This means the driver cannot figure out