'*' is no longer ignored - this is old APC models' "OK" reply to some of the shutdown commands.
'?' and '=' are responsible for alerting about overload (among supposedly other things), so we handle them now. Signed-off-by: Michal Soltys <[email protected]> --- drivers/apcsmart.c | 10 ++++++++++ drivers/apcsmart.h | 12 +++++++----- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/drivers/apcsmart.c b/drivers/apcsmart.c index 929372f..f0f1878 100644 --- a/drivers/apcsmart.c +++ b/drivers/apcsmart.c @@ -178,6 +178,16 @@ static void alert_handler(char ch) ups_status |= APC_STAT_RB; break; + case '?': /* set OVER */ + upsdebugx(4, "alert_handler: OVER"); + ups_status |= APC_STAT_OVER; + break; + + case '=': /* clear OVER */ + upsdebugx(4, "alert_handler: not OVER"); + ups_status &= ~APC_STAT_OVER; + break; + default: upsdebugx(4, "alert_handler got 0x%02x (unhandled)", ch); break; diff --git a/drivers/apcsmart.h b/drivers/apcsmart.h index 95e8c14..939b6cb 100644 --- a/drivers/apcsmart.h +++ b/drivers/apcsmart.h @@ -28,15 +28,17 @@ /* Basic UPS reply line structure */ #define ENDCHAR 10 /* APC ends responses with LF */ -/* these two are only used during startup */ -#define IGNCHARS "\015+$|!~%?=*#&" /* special characters to ignore */ +/* characters ignored by default */ +#define IGNCHARS "\015+$|!~%?=#&" /* special characters to ignore */ + +/* these one is used only during startup, due to ^Z sending certain characters such as # */ #define MINIGNCHARS "\015+$|!" /* minimum set of special characters to ignore */ /* normal polls: characters we don't want to parse (including a few alerts) */ -#define POLL_IGNORE "\015?=*&|" +#define POLL_IGNORE "\015&|" -/* alert characters we care about - OL, OB, LB, not LB, RB */ -#define POLL_ALERT "$!%+#" +/* alert characters we care about - OL, OB, LB, not LB, RB, OVER, not OVER */ +#define POLL_ALERT "$!%+#?=" #define UPSDELAY 50000 /* slow down multicharacter commands */ #define CMDLONGDELAY 1500000 /* some commands need a 1.5s gap for safety */ -- 1.7.2.1 _______________________________________________ Nut-upsdev mailing list [email protected] http://lists.alioth.debian.org/mailman/listinfo/nut-upsdev
