[Nut-upsdev] newhidups: today's changes

Peter Selinger selinger at mathstat.dal.ca
Sat Sep 24 04:53:18 UTC 2005


Here is a summary of the changes I made to newhidups today (between
the tags after_PSE_6 and after_PSE_9, roughly).

* all the vendor-specific code that was in various "switch" statements
  has now been moved to the individual subdriver (apc-hid, mge-hid,
  belkin-hid) files. This also includes the vendor-specific Usage
  tables.

  In future, it should be quite easy to add new subdrivers:
  essentially this involves adding two files and one table entry in
  newhidups.c. I added a document docs/hid-subdrivers.txt that is
  intended to explain how to make subdrivers. This information is
  still incomplete, but might be a good start.

* I have eliminated all global variables from libusb and some global
  variables from libhid. IMHO, the use of global variables in a
  library is a really bad idea, because it makes the library
  non-reentrant, as well as making it near impossible to track the
  data the enters and exits a function call.

-- Peter



More information about the Nut-upsdev mailing list