[nut-Feature Requests][304329] Drivers: add a -p probe parameter

nut-featurerequests at alioth.debian.org nut-featurerequests at alioth.debian.org
Mon Jan 15 11:25:48 CET 2007


Feature Requests item #304329, was opened at 11/01/2007 10:11
Status: Open
Priority: 3
Submitted By: Arnaud Quette (aquette)
Assigned to: Nobody (None)
>Summary: Drivers: add a -p probe parameter 
Group: None
Category: None


Initial Comment:
having a "-p" parameter to probe for device, and exit upon completion would be a good thing for applications such as MGE PSP for autodetecting local UPS.

Ie, calling "usbhid-ups -p auto" would return
Detected a UPS: MGE UPS SYSTEMS/Evolution on bus ...
or No UPS detected.

Some notes:
- the output need to be standardized to be usable by external apps,
- the driver exits after having printed the above message, so after the first call to upsdrv_updateinfo() in drivers/main.c,
- the output message can be handled in drivers/main.c
- the MGE PSP currently rip the driver code (from usbhid-ups, mge-shut and mge-utalk) to do the device autodetection. This is obviously sub optimal and is in NUT scope, rather than application scope. 


----------------------------------------------------------------------

>Comment By: Arnaud Quette (aquette)
Date: 15/01/2007 11:25

Message:
in fact, this is currently only needed by the MGE PSP.
We start by probing the USB bus, then call for SHUT probe and end with UTalk probe. The process is stopped as soon as an UPS is detected.

The scope is very limited, but would help application after the configuration stage, during the test stage.
Ie, the user select his model / port (apart for USB), then the app check using the driver if there is really something attached.

Finally note that this is part of a wider plan, including the new configuration lib/tools, some QA things (autotest, config validation, ...).

----------------------------------------------------------------------

Comment By: Peter Selinger (selinger-guest)
Date: 11/01/2007 19:39

Message:
This is more or less what the -x explore option does, except
it does not exit after the driver detection stage. (However,
it would be easy for a wrapper script to just terminate the
process after say 2 seconds). 

The output is not quite as you describe, but the relevant
information can be found by "grep". 

Keep in mind that by adding the option to usbhid-ups, you
will only detect devices that are supported by that driver.
Presumably these are different than the devices supported by
mge-shut and mge-utalk. 

-- Peter

----------------------------------------------------------------------

You can respond by visiting: 
http://alioth.debian.org/tracker/?func=detail&atid=411545&aid=304329&group_id=30602



More information about the NUT-tracker mailing list