[Nut-upsdev] Fwd: Megatec - modem control lines [impact to megatec_usb]
Carlos Rodrigues
carlos.efr at mail.telepac.pt
Tue Jun 19 08:39:36 UTC 2007
On 6/19/07, Arjen de Korte <nut+devel at de-korte.org> wrote:
> Carlos Rodrigues wrote:
>
> > Ok, I've tested it and it seems ok. However, this needs to be done in
> > a way that doesn't hurt megatec_usb, so I don't think it is a good
> > idea to add this to the trunk as is.
>
> Of course. See what I came up with in the trunk. This should be flexible
> enough.
Yep, it works, but it means the main driver is being "tweaked" by the
subdrivers instead of just delegating stuff to them, which is
something I wanted to avoid.
This would be easier if NUT provided some "ser_" function to set the
lines. Then the subdriver only had to implement this function as a
no-op, just like it does for the rest of the serial interface. This
would even ease a port for non unix platforms, if someone ever wanted
to do it.
What do you think?
Another alternative is to create a pair of functions, to set state and
to put it back, and then the subdrivers either implemented alternate
versions doing "whatever", or just provided no-ops. It should be any
more complex than the current scheme.
--
Carlos Rodrigues
More information about the Nut-upsdev
mailing list