search for: upsdebugx

Displaying 20 results from an estimated 100 matches for "upsdebugx".

2007 Feb 01
2
Re: [Nut-upsuser] Ablerex 625L USB version
...s Ablerex. > > Regards > Jon > > *** megatec.c.orig 2007-01-29 08:12:19.000000000 +1100 > --- megatec.c 2007-01-31 18:28:33.000000000 +1100 > *************** > *** 243,251 **** > char buffer[RECV_BUFFER_LEN]; > int ret; > > ! upsdebugx(2, "Sending \"Q1\" command..."); > ! comm->send("Q1%c", ENDCHAR); > ret = comm->recv(buffer, RECV_BUFFER_LEN, ENDCHAR, IGNCHARS); > if (ret < Q1_CMD_REPLY_LEN) { > upsdebugx(2, "Wrong answer to \"Q...
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 -
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
2005 Dec 19
0
new(er) SEC driver.
...and store in <data> in buf. * * Return -2 if failed to read valid response * Return -1 if command failed (^0) * Return 0 if command succeeded (^1) * Return len if data returned * */ static int sec_recv(int fd, char *buf, int len) { char *p; int i, l, r; errno = EINVAL; upsdebugx(SEC_LOG_LOWLEVEL, "sec_recv..."); if (len < 4) { /* min length */ upsdebugx(SEC_LOG_LOWLEVEL, " invalid buffer length %d", len); return -2; } /* look for the startchar */ *buf = '\0'; for (i=0; i<30 && (*buf != SEC_MSG_STARTCHAR); i++...
2010 Nov 05
2
segmentation fault in blazer_status().
...(argc=<value optimized out>, argv=<value optimized out>) at main.c:625 199| for (i = 0, val = strtok_r(buf+1, " ", &last); status[i].var; i++, val = strtok_r(NULL, " \r\n", &last)) { 200| 201| if (!val) { 202| upsdebugx(2, "%s: parsing failed", __func__); 203| return -1; 204| } 205| 206| if (strspn(val, "0123456789.") != strlen(val)) { 207| upsdebugx(2, "%s: non numerical value [%s]", __func__, val); 208|...
2023 Jan 15
1
logging strategy
I am looking at bestfortress and trying to figure out and fix some things, which is causing me to try to improve logging first. A few questions: 0) The developer guide doesn't seem to address any of this, or did I miss it? 1) It seems upsdebugx prints to stdout instead of syslog if in foreground. That's great but I didn't figure it out from docs. 2) I didn't find a plan for debug levels, so I made one up for bestfortress and put it in comments. Did I miss a plan? Should there be on in common.h? someplace else? Probably...
2020 Apr 03
0
Powercool PCRACK-1200VA patch update
...!= -1) { + +        /* in this case we use the langid_fix value for langid */ +        int ret = usb_get_string(dev, index, langid_fix, buf, blen); + +        /* Limit this check, at least for now */ +        /* Invalid receive size - message corrupted */ +        if (ret != buf[0]) { +            upsdebugx(1, "size mismatch: %d / %d", ret, buf[0]); +            return 0; +        } + +        /* Simple unicode -> ASCII inplace conversion +            * FIXME: this code is at least shared with mge-shut/libshut +            * Create a common function? */ +        unsigned int    di, si, si...
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...
2023 Jan 15
1
logging strategy
...e the logic progression at a given debug level (e.g. if major milestones of a routine are logged at level N, further traces like "I saw value X here" would be N+1 or more). De-facto verbosities fizzle out at 6, but generally it is an int value, so... Regarding syslog/stdout/stderr, the upsdebugx*() methods are defined here and near: https://github.com/networkupstools/nut/blob/ad70749f243527e774c3f03a08228430143396e9/common/common.c#L1205 and end up calling vupslog() at which can report to stderr (not stdout) and/or syslog, based on settings - see around https://github.com/networkupstools/n...
2007 Aug 23
1
[nut-commits] svn commit r1073 - in trunk: . drivers
...defined(SHUT_MODE) || defined(SUN_LIBUSB) > /* Cause a double free corruption in USB mode on linux! */ > if (*udevp != NULL) { > @@ -623,7 +674,7 @@ > if (ReportSize < 0) > return NULL; > > - if (mode == MODE_REOPEN) { > + if (*mode == MODE_REOPEN) { > upsdebugx(4, "Device reopened successfully"); > return hd; > } > @@ -632,6 +683,7 @@ > upsdebug_hex(3, "Report Descriptor", ReportDesc, ReportSize); > > /* Parse Report Descriptor */ > + Free_ReportDesc(pDesc); > pDesc = Parse_ReportDesc(ReportDesc, Re...
2023 Jan 15
1
logging strategy
...re" would be N+1 or more). > De-facto verbosities fizzle out at 6, but generally it is an int value, > so... Sounds good - what I wrote down as a plan for bestfortress very much matches that, 1 to 5 where 5 is if you want to see every IO byte. > Regarding syslog/stdout/stderr, the upsdebugx*() methods are defined here > and near: > https://github.com/networkupstools/nut/blob/ad70749f243527e774c3f03a08228430143396e9/common/common.c#L1205 > and end up calling vupslog() at which can report to stderr (not stdout) > and/or syslog, based on settings - see around > https://git...
2005 Dec 19
1
MGE Pulsar ES 8+
...lowing code in the function upsdrv_initups(void): bytes_rcvd = mge_command(buf, sizeof(buf), "Sm ?"); if(bytes_rcvd > 0 && buf[0] != '?') { mge_command(buf, sizeof(buf), "Sm %d", mge_ups.OnDelay); if(strcmp(buf, "OK")) upsdebugx(1, "UPS response to %d min ON delay was %s", mge_ups.OnDelay, buf); } else upsdebugx(1, "initups: OnDelay unavailable"); bytes_rcvd = mge_command(buf, sizeof(buf), "Sn ?"); if(bytes_rcvd > 0 && buf[0] != '?')...
2007 Jul 31
1
Proposed apcsmart driver patch
..., SER_WAIT_USEC); /* found one, force the model information */ - if (!strcmp(buf, "6QD")) { + if(!strcmp(buf, "8QD") || /* (SmartUPS 1250, vintage 07/94.) */ + !strcmp(buf, "6QD") || /* (APC600.) */ + !strcmp(buf, "6TI")) { /* (APC600.) */ upsdebugx(1, "Found Smart-UPS"); dstate_setinfo("ups.model", "Smart-UPS"); } - else if (!strcmp(buf, "6TI")) { - upsdebugx(1, "Found Smart-UPS"); - dstate_setinfo("ups.model", "Smart-UPS"); - } - else return 0; + else +...
2011 May 19
2
Scheduling NUT 2.6.1
Fellows, time has come for a new NUT release: I'm planning on 2.6.1 next week (max Friday 27), and I'm currently processing remaining patches. If you have some more on your side, please send in. cheers, Arnaud -- Linux / Unix Expert R&D - Eaton - http://powerquality.eaton.com Network UPS Tools (NUT) Project Leader - http://www.networkupstools.org/ Debian Developer -
2013 Jul 01
1
bcmxcp: Patch for cosmetic code changes
...or indentation --- drivers/bcmxcp.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/bcmxcp.c b/drivers/bcmxcp.c index 2e5f18f..480258c 100644 --- a/drivers/bcmxcp.c +++ b/drivers/bcmxcp.c @@ -948,16 +948,16 @@ int init_outlet(unsigned char len) upsdebugx(2, "Auto delay off: %d\n", auto_dly_off); snprintf(outlet_name, sizeof(outlet_name)-1, "outlet.%d.delay.shutdown", num); dstate_setinfo(outlet_name, "%d", auto_dly_off); - dstate_setflags(outlet_name, ST_FLAG_RW | ST_FLAG_STRING); - d...
2023 May 24
1
Synthesize low batt (LB) fron SNMP UPS which does not support this?
...rs Carsten [1] Please don't judge me by this, I still use printf and friends a lot for debugging (sorry for breaking lines, it's just for illustration): @@ -1113,12 +1116,13 @@ /* write the status_buf into the externally visible dstate storage */ void status_commit(void) { + upsdebugx(2, "%s: Entering (%d)", __func__, ignorelb); while (ignorelb) { const char *val, *low; val = dstate_getinfo("battery.charge"); low = dstate_getinfo("battery.charge.low"); - + upsdebugx(2, &...
2009 Dec 29
1
SUN_LIBUSB
...eout * 1000); */ return 0; #else /* FIXME: hardcoded interrupt EP => need to get EP descr for IF descr */ ret = usb_interrupt_read(udev, 0x81, (char *)buf, bufsize, timeout); if (ret > 0) { upsdebugx(6, " ok"); } else { upsdebugx(6, " none (%i)", ret); } return ret; #endif It seems that when using Sun libusb, nut completely blocks out the read attempt. I removed the preprocessor direc...
2006 Dec 05
3
megatec over USB - new driver patch
...only once */ #define CLAMP(x, min, max) (((x) < (min)) ? (min) : (((x) > (max)) ? (max) : (x))) - static float batt_charge_pct(float battvolt) { float value; @@ -178,15 +173,14 @@ return value * 100; } - static int check_ups(void) { char buffer[RECV_BUFFER_LEN]; int ret; upsdebugx(2, "Sending \"F\" command..."); - ser_send_pace(upsfd, SEND_PACE, "F%c", ENDCHAR); - ret = ser_get_line(upsfd, buffer, RECV_BUFFER_LEN, ENDCHAR, IGNCHARS, READ_TIMEOUT, 0); + comm->send("F%c", ENDCHAR); + ret = comm->recv(buffer, RECV_BUFFER_LEN, ENDCHA...
2006 Nov 26
1
Patch for optiups to support Zinto D from ONLINE USV-Systeme AG
..."OF", "output.frequency", 0.1 }, + { "NF", "input.frequency", 0.1 }, + { "BT", "ups.temperature" }, +}; /* model "IO" is parsed differently in upsdrv_initinfo() */ static ezfill _initv[] = { @@ -105,6 +117,10 @@ r=-2; upsdebugx(1, "READ: <unsupported command>"); } + if ( _buf[0] == 0x06 ) + { + upsdebugx(2, "READ: <command done>"); + } else { upsdebugx(2, "READ: \"%s\"", _buf ); @@ -125,6 +141,7 @@ { upsdebugx(2, "SEND: \"%s\"", c...