[Nut-upsdev] Re: [nut-commits] svn commit r433 - in trunk: data drivers include

Arnaud Quette aquette.dev at gmail.com
Tue Jun 20 06:53:00 UTC 2006


Hi Peter,

2006/6/19, Peter Selinger <selinger at mathstat.dal.ca>:
> Hi Arnaud,
>
> I have a suggestion on code organization. Since libshut.c and libhid.c
> are intended to share the same interface, perhaps this should be
> made explicit by making them use the same header file. I.e.,
> newhidups.c would always include libhid.h, instead of including
> one of libshut.h / libhid.h.
>
> The stuff in libshut.c that does not implement the libhid interface
> (essentially the definition of the shut_subdriver data structure)
> would be moved into its own source file, by analogy with the
> {apc,belkin,generic,mge,tripplite}-hid.[ch] files. This way there
> would be a clear distinction between (1) the HID/SHUT (abstract)
> interface, and (2) specific driver code.
>
> Ultimately, it would be a nice goal to make the HID/SHUT interface
> abstract enough to eliminate all the new #ifdef's from newhidups.c,
> i.e., it should be transparent to newhidups whether it is using HID or
> SHUT.

that was intended for a second round, along with set_report and
notification management.
If you have a bit of time to do the above, be my guest as I'll again
be missing for some more time...

Arnaud



More information about the Nut-upsdev mailing list