Displaying 17 results from an estimated 17 matches for "smallbuf".
Did you mean:
callbuf
2009 Aug 02
2
Driver fix for Ippon BCP800 (06da/0003), blazer_usb.c
...wrappers
for every needing driver to use):
Index: drivers/blazer_usb.c
===================================================================
--- drivers/blazer_usb.c (revision 1896)
+++ drivers/blazer_usb.c (working copy)
@@ -94,6 +94,23 @@
}
+static int phoenix_flush_io()
+{
+ static
+ char buf[SMALLBUF+1];
+ int i, ret;
+ upsdebugx(3, "phoenix_flush_io");
+ for(i = 0; i < 10; i++) {
+ memset(buf, 0, sizeof(buf));
+ /* ret = usb->get_interrupt(udev, (unsigned char *)buf, 8, 1000); */
+ ret = usb_interrupt_read(udev, 0x81, buf, SMALLBUF, 1000);
+ upsdebugx(4, "flush(%d,%d)...
2011 Jan 18
1
[nut-commits] svn commit r2839 - branches/windows_port/scripts/Windows
Citeren Frederic BOHE <fbohe-guest op alioth.debian.org>:
> --- branches/windows_port/scripts/Windows/wininit.c Tue Jan 18
> 08:57:03 2011 (r2838)
> +++ branches/windows_port/scripts/Windows/wininit.c Tue Jan 18
> 10:05:01 2011 (r2839)
> @@ -285,8 +285,11 @@
> char fn[SMALLBUF];
> FILE *nutf;
> char buf[SMALLBUF];
> + const char * conf_path;
>
> - snprintf(fn,sizeof(fn),"%s/nut.conf",CONFPATH);
> + conf_path = confpath();
> + snprintf(fn,sizeof(fn),"%s/nut.conf",conf_path);
> + free(conf_path);
This won't work. You can...
2007 Jan 19
1
Re: [nut-commits] svn commit r755 - in trunk: . clients
...-912,60 +912,99 @@
> return 0;
> }
>
> -/* split upsname@hostname[:port] into separate components */
> +/* split upsname[@hostname[:port]] into separate components */
> int upscli_splitname(const char *buf, char **upsname, char **hostname, int *port)
> {
> - char tmp[SMALLBUF], *s;
> + char *s, tmp[SMALLBUF];
>
> /* paranoia */
> if ((!buf) || (!upsname) || (!hostname) || (!port))
> return -1;
>
> - snprintf(tmp, sizeof(tmp), "%s", buf);
> -
> - /* split at the '@' character */
> - if ((s = strtok(tmp, "@&q...
2020 Apr 03
0
Patch to support Powercool PCRACK-1200VA
...karound */
+ int blen;
+ if(getval("buflen_fix")) {
+ if(sscanf(getval("buflen_fix"),"%d",&blen) != 1) {
+ upslogx(LOG_NOTICE, "Error enabling buflen workaround");
+ } else {
+ if (blen >SMALLBUF) {
+ upslogx(LOG_NOTICE,
+ "Error enabling buflen workaround, buflen must be
<= %d",
+ SMALLBUF);
+ } else {
+ buflen_fix = blen;
+ }
+ }
+ }
+
/* Chec...
2016 Jul 11
0
Proposal for technique to stop a timer at any moment
...@@ -407,10 +407,25 @@ void upslogx(int priority, const char *f
void upsdebug_with_errno(int level, const char *fmt, ...)
{
va_list va;
-
- if (nut_debug_level < level)
- return;
+ /* Sysadmin may use "echo n > /etc/ups/NUT_DEBUG_LEVEL" to set debug level n. RP */
+ char fn[SMALLBUF];
+ FILE *fp;
+ int ndl; /* 0 through 4 */
+
+ snprintf(fn, sizeof(fn), "%s/NUT_DEBUG_LEVEL", confpath()); /* E.g. /etc/ups/NUT_DEBUG_LEVEL RP */
+ fp = fopen(fn, "r");
+ if (!fp) {
+ ndl = 0; /* Ignore errors */
+ } else {
+ if (fscanf(fp, "%d", &...
2013 Aug 11
1
N-Power MEV-3000LT compatibility report and problem
Hello,
the code below the failing part mentions this flavor of protocol, drivers/blazer_ser.c:463
/*
* If a command is invalid, it will be echoed back.
* As an exception, Best UPS units will report "ACK" in case of success!
*/
I prepared a patch, it adds a similar check and also checks (in both occurencies) for
blazer_command()<0, the latter
2012 Aug 10
1
NSS branch testing.
Hello all,
In order to prepare the merge of the NSS branch to the trunk, I have validated the code in this branch by passing this validation document written by Emilien Kia :
http://www.networkupstools.org/tmp/NUT-NSS_Mini_DVT_Plan-final.pdf
The testing has been done on rev 3685 of the ssl-nss-port branch.
As you can read, I have found no issue.
Let me know if you have any comments on this.
2007 Jan 12
2
Makefiles driving me NUTs
I want to use upsdebugx, upslogx in 'clients/upsclient.c', however this
fails with the following error messages (I trimmed the path to the build
directory to <path> in order to prevent line wrapping):
<path>/clients/upsclient.c:941: undefined reference to `upsdebugx'
<path>/clients/upsclient.c:910: undefined reference to `upslogx'
2010 Mar 19
1
usbhid-ups fails with Belkin F6C120-UNV in nut-2.4.3
I recently upgraded from nut-2.4.1 to 2.4.3 and my UPS stopped working.
usbhid-ups now fails two communicate with the UPS:
With 2.4.1:
# /sbin/usbhid-ups -D -a auto
Network UPS Tools - Generic HID driver 0.34 (2.4.1)
USB communication driver 0.31
debug level is '1'
upsdrv_initups...
Using subdriver: Belkin HID 0.12
Path: UPS.BELKINConfig.BELKINConfigVoltage, Type: Feature, ReportID: 0x01,
2019 Jul 16
2
Two APC900 UPS on the same usbbus1
...se global value by default */
@@ -129,9 +124,6 @@
if (!strcmp(var, "port"))
tmp->port = xstrdup(val);
- if (!strcmp(var, "serial"))
- tmp->serial = xstrdup(val);
-
if (last)
last->next = tmp;
else
@@ -267,7 +259,6 @@
{
char *argv[8];
char dfn[SMALLBUF];
- char *tval = NULL;
int ret, arg = 0;
int initial_exec_error = exec_error, drv_maxretry = maxretry;
struct stat fs;
@@ -284,15 +275,6 @@
argv[arg++] = (char *)"-a"; /* FIXME: cast away const */
argv[arg++] = ups->upsname;
- if (ups->serial) {
-
- if ((tval = ma...
2007 Jan 23
2
Re: [nut-commits] svn commit r731
...separate components */
> -int upscli_splitname(const char *buf, char **upsname, char **hostname,
> - int *port)
> +/* split upsname@hostname[:port] into separate components */
> +int upscli_splitname(const char *buf, char **upsname, char **hostname, int *port)
> {
> - char tmp[SMALLBUF], *ptr, *ap, *cp;
> + char tmp[SMALLBUF], *s;
>
> + /* paranoia */
> if ((!buf) || (!upsname) || (!hostname) || (!port))
> return -1;
>
> snprintf(tmp, sizeof(tmp), "%s", buf);
>
> - ap = strchr(tmp, '@');
> -
> - if (!ap) {
> + /*...
2007 Jan 06
1
Re: [nut-commits] svn commit r710 - in trunk: . clients server
...l)
> +++ trunk/server/ctype.h Sat Jan 6 19:39:08 2007
> @@ -32,7 +32,11 @@
> char *addr;
> int fd;
> int delete; /* set after a write fails */
> +#ifndef HAVE_IPV6
> + struct sockaddr_in sock;
> +#else
> struct sockaddr_storage sock;
> +#endif
> char rq[SMALLBUF];
> size_t rqpos;
> char *loginups;
>
> Modified: trunk/server/upsd.c
> ==============================================================================
> --- trunk/server/upsd.c (original)
> +++ trunk/server/upsd.c Sat Jan 6 19:39:08 2007
> @@ -61,11 +61,15 @@
> sta...
2007 Nov 20
2
Mustek Powermust 600VA
Hi,
I'm having a hard time configuring a Mustek Powermust 600VA ups to
work via USB with nut. I read somewhere that nut works OK via the
rs232 cable, but unfortunately I don't have a COM port in my computer.
The kernel detects the ups as an Xbox pad :) and loads the xpad
module. I tried running /lib/nut/megatec with different /dev/ttySx but
it displays megatec protocol UPS was not
2011 Mar 05
19
[RFC apcsmart V3 00/18] apcsmart driver updates
Sorry for a bit longer delay than I anticipated, I was stuffed with the work.
This is the next iteration of the patch adding some functionality to apcsmart
driver, and relying on 'ignorelb' recently added.
Follow up from previous thread:
http://www.mail-archive.com/nut-upsdev at lists.alioth.debian.org/msg02331.html
Main differences is that V3 is split into many small patches, so the
2007 Jan 06
3
Re: [nut-commits] svn commit r708 - in trunk: . clients server
...===========
> --- trunk/server/ctype.h (original)
> +++ trunk/server/ctype.h Fri Jan 5 21:06:59 2007
> @@ -32,7 +32,7 @@
> char *addr;
> int fd;
> int delete; /* set after a write fails */
> - struct sockaddr_in sock;
> + struct sockaddr_storage sock;
> char rq[SMALLBUF];
> size_t rqpos;
> char *loginups;
>
> Modified: trunk/server/upsd.c
> ==============================================================================
> --- trunk/server/upsd.c (original)
> +++ trunk/server/upsd.c Fri Jan 5 21:06:59 2007
> @@ -26,6 +26,7 @@
>
>...
2011 Jan 25
1
[RFC] Updates to ACP smart driver
This patch introduces a handful of new options, I mentioned earlier in:
http://www.mail-archive.com/nut-upsdev at lists.alioth.debian.org/msg02088.html
See the large commit message in the follow-up for the details and rationale.
I realize it's a bit larger diff - so if it's required I can split it into few
smaller ones.
Michal Soltys (1):
APC smart driver update and new features.
2011 Feb 07
4
[PATCH/RFC v2 0/3] Updates to ACP smart driver
This is 2nd version of the earlier patch featuring a few new features
and fixes to the apcsmart driver, following the remarks in:
http://www.mail-archive.com/nut-upsdev at lists.alioth.debian.org/msg02294.html
Major changes from v1:
- handle battery.charge and battery.runtime checks at main.c level
- handle "immutable but writable" conflict gracefully at driver level
-