[Nut-upsdev] [Nut-upsuser] Sweex 1000VA UPS (was: powermust usb)

Alexander I. Gordeev lasaine at lvk.cs.msu.su
Mon Jun 4 15:07:42 UTC 2007

On Thu, 31 May 2007 20:08:47 +0400, Peter van Valderen <p.v.valderen at probu.nl> wrote:

>> Have you switched from nut_usb.c interface to libusb.c/libhid.c
>> as Peter proposed?
> I hadn't up until today, lack of time as well. My new version no
> longer uses nut_usb.c. To be honest, for the most part I just copied
> bits over from nut_usb.c and changed them to suit my needs. It now
> compiles without nut_usb.c.

No, this is even worse! Please, use libusb.c/libhid.c interface. It has
significant advantages. It is simplier. It supports much more flexible
device claiming: you can create your own "matchers" or use existing and
combine them into chains. You should give more control to the user in the
future by exporting some driver variables and using "regex" matcher. This
will allow users to test your driver on their devices without recompilation.
So please don't use nut_usb.c. Use libusb.c/libhid.c instead.

Please take a look at this post explaining device matching in USB drivers:

> I also added some things such as a reconnect when communications fail,
> this seems to happen every few days as I found out after using it for
> a while. Should be fixed now.


> The newest version can be found here:
> http://probu.nl/~p.v.valderen/lakeview.v2.patch
> I'd include it in this message, but that didn't work too well last time ;-)

This is fine, thanks :)


More information about the Nut-upsdev mailing list