[Nut-upsdev] [RFC apcsmart V3 13/18] drivers/apcsmart.c: update in-driver help information

Michal Soltys soltys at ziu.info
Sat Mar 5 10:38:30 UTC 2011


Signed-off-by: Michal Soltys <soltys at ziu.info>
---
 drivers/apcsmart.c |   93 +++++++++++++++++++++++++++++++++++++++++++++++-----
 1 files changed, 84 insertions(+), 9 deletions(-)

diff --git a/drivers/apcsmart.c b/drivers/apcsmart.c
index e8ae00a..ac459de 100644
--- a/drivers/apcsmart.c
+++ b/drivers/apcsmart.c
@@ -1444,7 +1444,9 @@ static void setuphandlers(void)
 void upsdrv_makevartable(void)
 {
 	addvar(VAR_VALUE, "cable", "Specify alternate cable (940-0095B)");
-	addvar(VAR_VALUE, "sdtype", "Specify shutdown type (1-3)");
+	addvar(VAR_VALUE, "wugrace", "Hard hibernate's wakeup grace");
+	addvar(VAR_VALUE, "sdtype", "Specify simple shutdown method (0-6)");
+	addvar(VAR_VALUE, "advorder", "Enable advanced shutdown control");
 }
 
 void upsdrv_initups(void)
@@ -1465,14 +1467,87 @@ void upsdrv_initups(void)
 
 void upsdrv_help(void)
 {
-	printf("\nShutdown types:\n");
-	printf("  0: soft shutdown or powerdown, depending on battery status\n");
-	printf("  1: soft shutdown followed by powerdown\n");
-	printf("  2: instant power off\n");
-	printf("  3: power off with grace period\n");
-	printf("  4: 'force OB' hack method for CS 350\n");
-	printf("Modes 0-1 will make the UPS come back when power returns\n");
-	printf("Modes 2-3 will make the UPS stay turned off when power returns\n");
+	printf(
+	"\n\nAdditional explanation of the driver's options:\n\n"
+
+	"  sdtype:\n"
+	"    see \"Simple shutdown method\" below for details\n\n"
+
+	"  advorder:\n"
+	"    see \"Advanced shutdown control\" below for details\n\n"
+
+	"  wugrace:\n"
+	"    Additional grace period used with 'hard hibernate' shutdown command.\n"
+	"    The value is in 6 minute units and its acceptable range is 0 - 999.\n"
+	"    If the value is invalid or out of range, it's assumed to be 0.\n"
+	"    \"nn hack\" version of the command expects 0 - 99 range.\n\n"
+
+	"Shutdown types:\n\n"
+
+	"  soft hibernate:\n"
+	"    Works only when the ups is in OB state. The power is cut off after the\n"
+	"    eeprom defined grace period. The ups will wake up when the power\n"
+	"    returns, after the eeprom defined delay AND if the eeprom defined min.\n"
+	"    battery charge level is met. The delay is counted from the power's\n"
+	"    return.\n\n"
+
+	"    On older models (usually w/o programmable eeprom), the ups will power up\n"
+	"    immediately after the power returns. On such models, it's safer to use\n"
+	"    'hard hibernate'. YMMV, depending on the ups model and firmware\n"
+	"    revision.\n\n"
+
+	"  hard hibernate:\n"
+	"    Works regardless if the ups is in OB or OL states.  The power is cut off\n"
+	"    after the eeprom defined grace period. The ups will wake up when the\n"
+	"    power returns, after the eeprom defined delay + 6*n AND if the eeprom\n"
+	"    defined min. battery charge level is met. The delay is counted from the\n"
+	"    power's return. Value 'n' is in 6 minute units, and can be provided by\n"
+	"    the user.\n\n"
+
+	"    On older models (usually w/o programmable eeprom), the ups will power up\n"
+	"    after 6*n minutes, often regardless it the power returned on not. YMMV,\n"
+	"    depending on the ups model and firmware revision.\n\n"
+
+	"  delayed poweroff:\n"
+	"    The ups will powerdown after the eeprom defined grace period. The ups\n"
+	"    stays offline until the user's intervention.\n\n"
+
+	"  instant poweroff:\n"
+	"    The ups will powerdown immediately. The ups stays offline until the\n"
+	"    user's intervention.\n\n"
+
+	"  CS 350 hack:\n"
+	"    The same as 'soft hibernate', but first the ups is forced to go into OB\n"
+	"    state.\n\n"
+
+	"Simple shutdown method:\n\n"
+
+	"    0: soft hibernate or hard hibernate, depending on battery status\n"
+	"    1: soft hibernate followed by hard hibernate, if the former fails\n"
+	"    2: instant poweroff\n"
+	"    3: delayed poweroff\n"
+	"    4: \"force OB\" hack method for CS 350\n"
+	"    5: \"hack nn\" hard hibernate only\n"
+	"    6: hard hibernate only\n\n"
+
+	"  User should provide requested method in 'sdtype'. The default is 0.\n\n"
+
+	"Advanced shutdown control:\n\n"
+
+	"    0: soft hibernate\n"
+	"    1: hard hibernate\n"
+	"    2: delayed poweroff\n"
+	"    3: instant poweroff\n"
+	"    4: \"force OB\" hack method for CS 350\n"
+	"    5: \"nn hack\" hard hibernate\n\n"
+
+	"  User should set the 'advorder' option and provide the list of the methods.\n"
+	"  The methods are tried in order, until one of them succeedes.\n"
+	"  If the list is too long or contains invalid characters, it will fallback to\n"
+	"  the default - 0123. You can also use \"no\" to explicitly ignore it and use\n"
+	"  \"sdtype\". Advanced shutdown control takes precedence over simple\n"
+	"  one, if both are defined.\n"
+	);
 }
 
 void upsdrv_initinfo(void)
-- 
1.7.2.1




More information about the Nut-upsdev mailing list