[Nut-upsdev] NUT: Belkin Universal driver - modification to -k behaviour (diff attached)

j T hyvan_trant at hotmail.com
Mon May 15 19:09:33 UTC 2006


Hi

I'm sending this to you as it appears that you are the person who looks 
after and/or supervises the code for NUT's Belkin drivers. I'm using the 
address you use for the Nut-upsdev mailing list ( selinger at 
mathstat.dal.ca ).

Anyway...

I have a Belkin Universal UPS and, having just upgraded my Fedora Core 
system from 4 to 5 and had to go back through the system RC files 
re-applying the "soft shutdown workaround," I had an idea with regards to 
the NUT belkinunv driver's behaviour when run with the -k option.

The idea is pretty simplistic, but would hopefully mean that the driver 
would behave in a manner that is more consistent with other NUT drivers. 
Basically, instead of -k causing the driver to set a couple of UPS timers 
and hoping for the best, my version uses the existing "wait" code.

I'm not too hot at C, but I've had a go at putting this together (quite a 
lot of it's cut-n-paste-programming I'm afraid), and it seems to work rather 
nicely.

I have attached the output from running "diff -ud belkinunv.c.orig 
belkinunv.c" modifying the first line of the diff file so that the diff can 
be applied to belkinunv.c by doing "patch < belkinunv.diff"  (hopefully...)

I've updated the driver version for the patched driver to 0.06jo01 so that 
it is reasonably apparent that this is an alpha version based on 0.06, 
rather than being presuptuous and calling it 0.07 ;-)

I haven't deleted any of my notes and things from the source file before 
running the Diff, so you can hopefully see what my intentions were...

The modifications allow the driver to be used in its current form, as well 
as in the modified form. This is controlled by a "waitonshutdown = true" 
line being added to the UPS definition in ups.conf.

--
I'm also looking to modify the belkin_hid USB HID subdriver so that it 
supports both the -x wait[=n]
and my modified -k behaviour, but I haven't really gotten anywhere on that 
just yet... I only started with the belkinunv modification on friday...

I have no idea if this modification is something that would be of any use to 
anyone else, but thought it would be nice to do the whole 'give something 
back' thing...

Sorry for bothering you if it is useless!

Jo Turner
   -xx-

--
jT | mail to: hyvan_trant at hotmail.com
** | website: http://www.chiark.greenend.org.uk/~jsturner/

-------------- next part --------------
A non-text attachment was scrubbed...
Name: belkinunv.diff
Type: application/octet-stream
Size: 8866 bytes
Desc: not available
Url : http://lists.alioth.debian.org/pipermail/nut-upsdev/attachments/20060515/cd169d61/belkinunv-0002.obj


More information about the Nut-upsdev mailing list