search for: endchar

Displaying 20 results from an estimated 27 matches for "endchar".

2007 Feb 01
2
Re: [Nut-upsuser] Ablerex 625L USB version
...+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 \"Q1\" command."); > > --- 243,253 ---- > char buffer[RECV_BUFFER_LEN]; >...
2006 Dec 05
3
megatec over USB - new driver patch
...c 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, ENDCHAR, IGNCHARS); if (ret < F_CMD_REPLY_LEN) { upsdebugx(2, "Wrong answer to \"F\" command.&...
2011 Oct 03
2
patch: Replace many usleep and some sleep calls with nanosleep
...detect a Best/SOLA or Phoenix protocol UPS"); @@ -333,7 +333,7 @@ void upsdrv_updateinfo(void) } /* these things need a long time to respond completely */ - usleep(200000); + struct timespec delay = {0, 200e6}; nanosleep(&delay, NULL); ret = ser_get_line(upsfd, buf, sizeof(buf), ENDCHAR, "", SER_WAIT_SEC, SER_WAIT_USEC); Index: b/drivers/microdowell.c =================================================================== --- a/drivers/microdowell.c 2011-08-17 00:40:17.000000000 +0300 +++ b/drivers/microdowell.c 2011-08-17 00:40:17.000000000 +0300 @@ -223,8 +223,9 @@ uns...
2008 Oct 30
1
Adding debugging information in serial.c
...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 timeout and buflen for success. Unfortunately, the ser_get_line_alert() and ser_get_line() functions don't have a fixed number of bytes (this is determined by the endchar). So we can no longer check if an endchar was received. Bad idea. I'd prefer to add a couple of upsdebug statements in the serial.c library instead. This would leave the interface intact, at the cost of possibly redundant upsdebug statements (if the drivers already provide these). Befo...
2010 Apr 19
1
Patch for the bestfortress driver 0.02
...\r "); upssend ("f\r"); + while (ser_get_char(upsfd, &ch, 0, UPSDELAY) > 0 && ch != '\n'); // response starts with \r\n + temp[2] = 0; do { - if (upsrecv (temp+2, sizeof temp - 2, ENDCHAR, IGNCHARS) <= 0) { + if ((len = upsrecv (temp+2, sizeof temp - 2, ENDCHAR, IGNCHARS)) <= 0) { upsflushin (0, 0, "\r "); upssend ("f\r"); + while (ser_get_cha...
2004 Jul 16
1
/proc/xen/memory_target patch
...balloon_pde->write_proc = balloon_write; return 0; } --- 222,307 ---- return ret; } + #define PAGE_TO_MB_SHIFT 8 + static int balloon_write(struct file *file, const char *buffer, u_long count, void *data) { ! char memstring[64], *endchar; ! int len, i, pages; ! unsigned long long target; /* Only admin can play with the balloon :) */ if ( !capable(CAP_SYS_ADMIN) ) return -EPERM; ! if (count>sizeof memstring) { ! return -EFBIG; ! } ! ! len = strnlen_user(buffer, count); ! i...
2008 Dec 05
2
Mustek PowerMust 848
Hi, I'm not the maintainter for the "megatec_usb" driver (in fact, I'm no longer maintainer for the base "megatec" either), so I don't really know the status for that particular UPS. I'm forwarding this to the NUT mailing-list though. Regards, -- Carlos Rodrigues On Fri, Dec 5, 2008 at 10:30 AM, Adrian Czerniak <adrian.czerniak at becomo.com> wrote:
2008 Dec 05
2
Mustek PowerMust 848
Hi, I'm not the maintainter for the "megatec_usb" driver (in fact, I'm no longer maintainer for the base "megatec" either), so I don't really know the status for that particular UPS. I'm forwarding this to the NUT mailing-list though. Regards, -- Carlos Rodrigues On Fri, Dec 5, 2008 at 10:30 AM, Adrian Czerniak <adrian.czerniak at becomo.com> wrote:
2008 Jul 10
2
[PATCH] tripplite driver updates
....cpp, available from Tripp Lite at - http://www.tripplite.com/linux/. + opensrc_server/upscmd.cpp, formerly (but not longer) available from + Tripp Lite at http://www.tripplite.com/linux/. */ /* REFERENCE 2 @@ -111,30 +111,6 @@ #include <math.h> #include <ctype.h> -#define ENDCHAR '\n' /* replies end with CR LF -- use LF to end */ -#define IGNCHAR '\r' /* ignore CR */ -#define MAXTRIES 3 -#define SER_WAIT_SEC 3 /* allow 3.0 sec for ser_get calls */ -#define SER_WAIT_USEC 0 -#define DEFAULT_OFFDELAY 64 /* seconds (max 0xFF) */ -#...
2008 Nov 06
0
[nut-commits] svn commit r1549 - in trunk: . drivers
...only work if the driver is able > to keep up with the flow of data from the UPS and the select_read() > function in ser_get_line() > reads one character at a time. In that case, switching to > ser_get_char() is more reliable, > since that is not prone to losing data after reading ENDCHAR. What was I thinking? I completely missed the fact that the UPScode II driver sets the communication parameters to ICANON (Canonical Mode Input Processing), so the above is not an issue at all. There is a (slightly) better way to do this however, by using select_read() instead and let the...
2008 Jan 25
2
Help Me to Adjust the R Code
Hi, The following code, from Angelo Canty article on line "Resampling Methods in R: the boot Package, 2002", works fine for Angelo Canty using R 2.6.0 on Windows XP. It also works for me using R 1.2.1 and S-PLUS 2000 on Windows XP after installing the S-PLUS bootstrap library, with slight differences in my outputs. > library(boot) > library(survival) >
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
2008 Dec 19
1
megatec_usb: Ippon BackComfoPro (06da:0003 Phoenixtec Power)
...ec_usb driver can't get a proper reply to a Q1 request, failing with an error message about "short read (14 bytes)" instead. I have found the reason for this. The function run_query in megatec.c uses ser_get_line to get information from the UPS. The ser_get_line function has an "endchar" parameter, and "\r" is currently passed there. As a result, ser_get_line only returns the received characters up to the first "\r" (hex 0d) back to run_query. The problem is, the data returned by my UPS is for some reason sprinkled with these "\r" characters rig...
2006 May 12
1
Fwd: RE New xanto driver for NUT
Dear Andreas, some googling revealed, you created a driver for the xanto series of online-usv.de. In what state it is currently? I've to manage a S2000 and would like to use nut for it, is it usable by now? Do you need another tester? TIA, Pete
2009 Aug 14
2
Bestfortress driver, network serial patch for nut-2.0
...USA */ /* anything commented is optional anything else is mandatory */ #include "main.h" #include "serial.h" #define UPSDELAY 50000 /* 50 ms 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' #define IGNCHARS " \n" #if defined(__sgi) && ! defined(__GNUC__) #define inline __inline #endif static int instcmd (const char *cmdname, const char *extra); static int upsdrv_setvar (const char *varname, const char *val); /* rated VA load if known */ stati...
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 -
2009 May 07
1
increasing memory for R bg job
Hi, Is the following command used to increase the memory or any other command when a background R job is run? R --min-vsize=vl --max-vsize=vu --min-nsize=nl --max-nsize=nu --max-ppsize=N source: http://stat.ethz.ch/R-manual/R-patched/library/base/html/Memory.html Thx Carol [[alternative HTML version deleted]]
2006 Jan 27
0
[PATCH] fentonups patch to make it work with some powercom ups's
...{ int modelnum, i, ret; char temp[256], model[32], *raw; + if (testvar("powercom")) { + set_powercom_lines(); +// straced from powercom's upsmon (reset?) + ret = ser_send(upsfd, "%c%c%c%c%c\r", 1, 2, 2, 3, 5); + ret = ser_get_line(upsfd, temp, sizeof(temp), ENDCHAR, "", + SER_WAIT_SEC, SER_WAIT_USEC); + } raw = get_id(); if (!raw) @@ -426,6 +445,7 @@ void upsdrv_help(void) void upsdrv_makevartable(void) { addvar(VAR_VALUE, "lowbattvolt", "Set low battery level, in volts"); + addvar(VAR_FLAG, "powercom", &quo...
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