[Nut-upsdev] RFC: allow HID subdriver's to register ups.conf

j T hyvan_trant at hotmail.com
Mon Jun 5 21:59:21 UTC 2006

Hi Peter

That's a shame, cos I've got it working!

It's not exactly how I described earlier, but I'm rather pleased with it :-)

And belkinunv still builds and works properly with the changes applied to 
main.c and main.h.

All the drivers normally built by "make all" build successfully using GCC.

valgrind-ing both belkinunv and newhidups with the changes applied produces 
the same output as it does without them, so it doesn't look as though I've 
introduced any memory leaks, etc to any of the shared code.
With respect to providing command-line help on the different subdrivers, I 
was thinking of keeping them out of the main driver help. Instead, I was 
going to introducing a new "-x help=subdriver" option to newhidups:
- When "newhidups -h" where issued, you'd have a line like "Get help on 
subdriver-specific options : -x help=subdriver-name".
- When "newhidups -x help=subdriver-name" were issued, you would get  help 
relevent to the specified subdriver
I haven't implemented this yet though...
Anyway, I've attached a unified diff that contains all the changes necessary 
to get subdriver options functional. The diff includes changes to belkin-hid 
to make it accept the same options as my revised belkinunv driver, and the 
tiny changes to the other HID driver .c files so that they shouldn't break 
(adding "NULL," at the end of the "vendor_subdriver" struct).

Jo Turner

-------------- next part --------------
A non-text attachment was scrubbed...
Name: subdrivers_have_options.diff
Type: text/x-patch
Size: 6975 bytes
Desc: not available
Url : http://lists.alioth.debian.org/pipermail/nut-upsdev/attachments/20060605/e9e20ecf/subdrivers_have_options.bin

More information about the Nut-upsdev mailing list