[Nut-upsdev] upsdrv_print_ups_list and afferant reflections

Charles Lepple clepple at gmail.com
Wed Aug 2 15:00:00 UTC 2006


On 8/2/06, Jonathan Dion <dion.jonathan at gmail.com> wrote:
> Hello ups-dev
>
> Arnaud asked me to add a function upsdrv_print_ups_list the drivers
>
> upsdrv_print_ups_list : why
>
> This function would print the vendorId and the productId of the UPS
> supported by the driver (for USB driver at least). It could then be
> parsed by a tool (that I'll have to make too), whose the goal would be
> to automagically generate 4 sort of file :
>  - fdi file for HAL
>  - udev rules file for udev
>  - hotplug usermap for hotplug
>  - Html array to have a compatibility list
>
> This way, one just have to modify a table in the driver to says which
> UPS it support and then to run this tool, and no more have to manually
> create those 4 files.

That sounds like a good idea. I was pondering how we could do this
another way, where drivers.list is the source file, and it generates
matching code for individual drivers, but your way allows us to
extract information from drivers contained in binary packages.

I assume you would have the output parsable by your new configuration
file library?

Another thing to consider is to have a "matching score", where some
drivers have higher confidence that they can handle a certain VID/PID,
but less confidence if they only match the VID. The override could be
done by lowering the minimum required match confidence level.

-- 
- Charles Lepple



More information about the Nut-upsdev mailing list