[Nut-upsdev] Re: [Nut-upsuser] Ablerex 625L USB version

Jon Gough jon.gough at eclipsesystems.com.au
Fri Feb 2 06:19:55 CET 2007


Peter,
    The only changes that were needed was the addition of the get/set 
Ablerex code, or the using of the Krauler stuff for Ablerex. The 
'usb_get_string_simple' does the same job as 'usb_get_descriptor', 
the former just has one less parameter, and during my investigations 
the simpler the better.

    Having got this far I may have to go a little slow on it as I 
have some other stuff I have to do and have been putting off till 
this worked. It could be a few days before I get time again.

Regards
    Jon

At 11:47 2/02/2007, Peter Selinger wrote:
>Alexander,
>
>don't worry, I am trying to sort out these patches. Thanks for all of
>your work so far. I have created a branch at:
>
>   svn://svn.debian.org/svn/nut/branches/megatec-usb
>
>this currently contains:
>
>revision 793: Andrey's patch (updated)
>revision 794: Alexander's patch (updated)
>revision 796: Jon's changes merged into Alexander's
>
>Notes: in revision 794, I have edited your patch slightly to remove
>some unnecessary whitespace changes, to show more clearly the
>differences and similarities to Andrey's patch. For the same reason, I
>have retained the name megatec_usb.c for the source file,
>rather than serial_usb_megatec.c.
>
>In revision 796, I have taken some of Jon's changes and applied them
>on top of your changes. I did not apply the multitude of extra
>debugging statements that Jon had added. I also did not add some of
>Jon's changes:
>
>Near line 125:
>
>-        param_arg.get_data = get_data_agiler;
>-        param_arg.set_data = set_data_agiler;
>+        param_arg.get_data = usb_ups_device->get_data;
>+        param_arg.set_data = usb_ups_device->set_data;
>
>This didn't make sense to me, because usb_ups_device will be
>uninitialized at this point.
>
>Near line 198:
>
>          if ( (c==endchar) || (c==0) ) {
>              break;
>          }
>
>+        if (ignset == NULL) break;
>          if (NULL!=strchr(ignset,c)) continue;
>
>I wasn't sure if this makes sense. Can ignset ever be NULL? And if
>yes, why should there be a "break", rather than just skipping the
>following test?
>
>It looks indeed like the get/set_data_ablerex and get/set_data_krauler
>functions have some similarities, although they are not quite the
>same. It's probably good if you experiment with each other's code,
>which should be convenient now that it is in SVN.
>
>Another note: I don't like the matching code (ser_open,
>comm_usb_match). The current logic makes little sense, for example any
>device for which vid:pid is specified as the port will be assumed to
>be an AGILER device.
>
>There should be a more general mechanism, as in usbhid-ups, using
>options such as -x vendorid=<regex>, -x product=<regex>, -x
>serial=<regex>, etc. The work has already been done in usbhid-ups (see
>upsdrv_makevartable(), upsdrv_initups()), and should be easy to
>duplicate here.
>
>-- Peter
>
>Alexander I. Gordeev wrote:
> >
> > Jon, Carlos,
> >




---
avast! Antivirus: Outbound message clean.
Virus Database (VPS): 000709-2, 01/02/2007
Tested on: 2/02/2007 4:19:59 PM
avast! is copyright (c) 2000-2007 ALWIL Software.
http://www.avast.com


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.alioth.debian.org/pipermail/nut-upsdev/attachments/20070202/66ac5892/attachment.html


More information about the Nut-upsdev mailing list