Peter Selinger
2007-Feb-26 04:34 UTC
[Nut-upsdev] Some questions on driver implementation and variable
=?ISO-8859-1?Q?Edgar_Fu=DF?= wrote:> > > On the other hand, if it is not a HID device, then it is most likely a > > serial-over-USB protocol > Yes, it is serial-over USB, but non-standard. > > > might be supportable by one of the existing serial-over-USB drivers > I did not look into these as they wouldn't support the specific > serial protocol (encapsulated in USB in this case). > > > An entirely new driver would only be warranted if it's a genuinely new > > protocol. > Well, the low-level (USB over serial) protocol is rather simple (send > the command in a vendor endpoint write, command 0x0d to the control > endpoint, read data from endpoint 1). > However, the serial protocol itself (looks like a variant of megatec) > is only very basically supported by the existing masterguard driver > (as I wrote), so I decided to re-write the driver from scratch.I see. If your protocol is compatible with the megatec protocol, you might be able to integrate your driver with the new megatec_usb driver from the nut SVN trunk. That driver already supports two different serial-over-USB access methods; it would be easy to add another access method if it's not already identical to one of the supported ones. The main question is how compatible the underlying serial protocol is. -- Peter
Carlos Rodrigues
2007-Feb-26 13:24 UTC
[Nut-upsdev] Some questions on driver implementation and variable
On 2/26/07, Peter Selinger <selinger@mathstat.dal.ca> wrote:> I see. If your protocol is compatible with the megatec protocol, you > might be able to integrate your driver with the new megatec_usb driver > from the nut SVN trunk. That driver already supports two different > serial-over-USB access methods; it would be easy to add another access > method if it's not already identical to one of the supported ones. The > main question is how compatible the underlying serial protocol is.Judging from the existing masterguard driver, the protocol is similar to megatec, but not quite. The command to get information _about_ the UPS and _from_ the UPS are different. However, in the latter case, the same command used by all other megatec UPSes also seems to be supported, but that doesn't give as much info as the masterguard specific one. This means that megatec should already work with masterguard UPSes, but with a little help it can be made to work with masterguard too. It will require a bit of a reworking in the driver though. -- Carlos Rodrigues