[Nut-upsdev] new ups for database?

Peter Selinger selinger at mathstat.dal.ca
Sat Sep 23 19:18:31 UTC 2006


Thanks for the info. Attached is the patch for an MEC subdriver stub.
Plesae see if you can get this to work and read any info from the
device via "upsd" and "upsc". Thanks, -- Peter

spamwhole at gmail.com wrote:
> 
> Peter, 
> 
> Please see below.  I've left the extra USB devices in there too, just in 
> case. 
> 
> thanks 
> 
> Rob 
> 
> rmk drivers # ./newhidups -DD -u root -x generic -x vendorid=0001 auto
> Network UPS Tools: 0.28 USB communication driver 0.28 - core 0.30 (2.1.0) 
> 
> debug level is '2'
> Checking device (0000/0000) (003/001)
>  - VendorID: 0000
>  - ProductID: 0000
>  - Manufacturer: Linux 2.6.18-1 ohci_hcd
>  - Product: OHCI Host Controller
>  - Serial Number: 0000:00:02.0
>  - Bus: 003
> Trying to match device
> Device does not match - skipping
> Checking device (14AA/022B) (002/011)
>  - VendorID: 14aa
>  - ProductID: 022b
>  - Manufacturer: Digital TV Receiver
>  - Product: Digital TV Receiver
>  - Serial Number: unknown
>  - Bus: 002
> Trying to match device
> Device does not match - skipping
> Checking device (0000/0000) (002/001)
>  - VendorID: 0000
>  - ProductID: 0000
>  - Manufacturer: Linux 2.6.18-1 ehci_hcd
>  - Product: EHCI Host Controller
>  - Serial Number: 0000:05:06.2
>  - Bus: 002
> Trying to match device
> Device does not match - skipping
> Checking device (0000/0000) (004/001)
>  - VendorID: 0000
>  - ProductID: 0000
>  - Manufacturer: Linux 2.6.18-1 uhci_hcd
>  - Product: UHCI Host Controller
>  - Serial Number: 0000:05:06.0
>  - Bus: 004
> Trying to match device
> Device does not match - skipping
> Checking device (0D3D/0001) (004/002)
>  - VendorID: 0d3d
>  - ProductID: 0001
>  - Manufacturer: unknown
>  - Product: USBPS2
>  - Serial Number: unknown
>  - Bus: 004
> Trying to match device
> Device does not match - skipping
> Checking device (0000/0000) (001/001)
>  - VendorID: 0000
>  - ProductID: 0000
>  - Manufacturer: Linux 2.6.18-1 ehci_hcd
>  - Product: EHCI Host Controller
>  - Serial Number: 0000:00:02.1
>  - Bus: 001
> Trying to match device
> Device does not match - skipping
> Checking device (0001/0000) (005/004)
>  - VendorID: 0001
>  - ProductID: 0000
>  - Manufacturer: MEC
>  - Product: MEC0002
>  - Serial Number: unknown
>  - Bus: 005
> Trying to match device
> Device matches
> failed to claim USB device, trying 2 more time(s)...
> detaching kernel driver from USB device...
> trying again to claim USB device...
> HID descriptor retrieved (Reportlen = 624)
> Report descriptor retrieved (Reportlen = 624)
> Found HID device
> Report Descriptor size = 624
> Detected a UPS: MEC/MEC0002
> Using subdriver: GENERIC HID 0.1
> Can't retrieve Report 1 (-32/32): Broken pipe
> Path: 00860004.Flow.FlowID, Type: Feature
> Can't retrieve Report 1 (-32/32): Broken pipe
> Path: 00860004.Flow.ConfigVoltage, Type: Feature
> Can't retrieve Report 1 (-32/32): Broken pipe
> Path: 00860004.Flow.ConfigFrequency, Type: Feature
> Can't retrieve Report 1 (-32/32): Broken pipe
> Path: 00860004.Flow.LowVoltageTransfer, Type: Feature
> Can't retrieve Report 1 (-32/32): Broken pipe
> Path: 00860004.Flow.HighVoltageTransfer, Type: Feature
> Can't retrieve Report 1 (-32/32): Broken pipe
> Path: 00860004.Flow.iManufacturer, Type: Feature
> Can't retrieve Report 1 (-32/32): Broken pipe
> Path: 00860004.Flow.iProduct, Type: Feature
> Can't retrieve Report 1 (-32/32): Broken pipe
> Path: 00860004.Flow.iSerialNumber, Type: Feature
> Can't retrieve Report 1 (-32/32): Broken pipe
> Path: 00860004.Flow.FlowID, Type: Feature
> Can't retrieve Report 1 (-32/32): Broken pipe
> Path: 00860004.Flow.ConfigVoltage, Type: Feature
> Can't retrieve Report 1 (-32/32): Broken pipe
> Path: 00860004.Flow.ConfigFrequency, Type: Feature
> Can't retrieve Report 2 (-32/32): Broken pipe
> Path: 00860004.Flow.ConfigApparentPower, Type: Feature
> Can't retrieve Report 2 (-32/32): Broken pipe
> Path: 00860004.Flow.ConfigActivePower, Type: Feature
> Can't retrieve Report 2 (-32/32): Broken pipe
> Path: 00860004.Flow.DelayBeforeStartup, Type: Feature
> Can't retrieve Report 2 (-32/32): Broken pipe
> Path: 00860004.Flow.DelayBeforeShutdown, Type: Feature
> Can't retrieve Report 3 (-32/32): Broken pipe
> Path: 00860004.BatterySystem.BatterySystemID, Type: Feature
> Can't retrieve Report 3 (-32/32): Broken pipe
> Path: 00860004.BatterySystem.PresentStatus.Used, Type: Feature
> Can't retrieve Report 3 (-32/32): Broken pipe
> Path: 00860004.BatterySystem.PresentStatus.Good, Type: Feature
> Can't retrieve Report 3 (-32/32): Broken pipe
> Path: 00860004.BatterySystem.Voltage, Type: Feature
> Can't retrieve Report 3 (-32/32): Broken pipe
> Path: 00860004.BatterySystem.Temperature, Type: Feature
> Can't retrieve Report 3 (-32/32): Broken pipe
> Path: 00860004.BatterySystem.Test, Type: Input
> Can't retrieve Report 3 (-32/32): Broken pipe
> Path: 00860004.BatterySystem.Test, Type: Feature
> Can't find object 00860004.PowerConverter.PowerConverterID
> Path: 00860004.PowerConverter.PowerConverterID, Type: Input
> Can't find object 00860004.PowerConverter.Input.InputID
> Path: 00860004.PowerConverter.Input.InputID, Type: Input
> Can't find object 00860004.PowerConverter.Input.FlowID
> Path: 00860004.PowerConverter.Input.FlowID, Type: Input
> Can't find object 00860004.PowerConverter.Input.PresentStatus.Good
> Path: 00860004.PowerConverter.Input.PresentStatus.Good, Type: Input
> Can't find object 00860004.PowerConverter.Input.Voltage
> Path: 00860004.PowerConverter.Input.Voltage, Type: Input
> Can't find object 00860004.PowerConverter.Input.Frequency
> Path: 00860004.PowerConverter.Input.Frequency, Type: Input
> Can't find object 00860004.PowerConverter.Output.OutputID
> Path: 00860004.PowerConverter.Output.OutputID, Type: Input
> Can't find object 00860004.PowerConverter.Output.FlowID
> Path: 00860004.PowerConverter.Output.FlowID, Type: Input
> Can't find object 00860004.PowerConverter.Output.Voltage
> Path: 00860004.PowerConverter.Output.Voltage, Type: Input
> Can't find object 00860004.PowerConverter.Output.Frequency
> Path: 00860004.PowerConverter.Output.Frequency, Type: Input
> Can't find object 00860004.PowerConverter.Output.PercentLoad
> Path: 00860004.PowerConverter.Output.PercentLoad, Type: Input
> Can't find object 00860004.PowerConverter.Output.PresentStatus.Overload
> Path: 00860004.PowerConverter.Output.PresentStatus.Overload, Type: Input
> Can't find object 00860004.PowerConverter.Output.PresentStatus.Boost
> Path: 00860004.PowerConverter.Output.PresentStatus.Boost, Type: Input
> Can't find object 00860004.PowerConverter.Output.PresentStatus.Buck
> Path: 00860004.PowerConverter.Output.PresentStatus.Buck, Type: Input
> upsdrv_updateinfo...
> dstate_init: sock /var/state/ups/newhidups-auto open on fd 5
> upsdrv_updateinfo...
> Waiting for notifications...
> upsdrv_updateinfo...
> Waiting for notifications...
> Signal 2: exiting
> Closing device
> rmk drivers # 
> 
> 
> Peter Selinger writes: 
> 
> > Rob and Dave, 
> > 
> > that device looks like it is using an illegal vendor id, "0001". It
> > also looks like it is made by MEC, not Belkin (probably sold under
> > license).  
> > 
> > We might be able to support its USB interface. To find out more,
> > please do the following: 
> > 
> > * get the latest development version of NUT from SVN. You can follow
> >   the instructions at http://www.networkupstools.org/source.html under
> >   "Development tree" to get it. 
> > 
> > * post the output of 
> > 
> >    drivers/newhidups -DD -u root -x generic -x vendorid=0001 auto 
> > 
> >   from this newest NUT version. 
> > 
> > This should output a bunch of debugging data, and then go into an
> > infinite loop waiting for data. You can do "Ctrl-C" to kill the driver
> > (it will not do anything useful at this point). 
> > 
> > -- Peter 
> > 
> > spamwhole at gmail.com wrote:
> >> 
> >> Hi,  
> >> 
> >> I have the same device, a F6H500ukUNV, it has both RS-232 and USB.  
> >> 
> >> url:
> >> http://catalog.belkin.com/IWCatProductPage.process?Product_Id=201050  
> >> 
> >> 
> >> The details I have from my system are below.  If you would like further 
> >> informatinon, or a more verbose lsusb please let me know.  
> >> 
> >> thanks  
> >> 
> >> Rob  
> >> 
> >> dmesg:
> >> hiddev96: USB HID v1.00 Device [MEC MEC0002] on usb-0000:05:06.1-2  
> >> 
> >> lsusb:
> >> Bus 005 Device 004: ID 0001:0000 Fry's Electronics  
> >> 
> >> cat /proc/bus/usb/device:
> >> T:  Bus=05 Lev=01 Prnt=01 Port=01 Cnt=01 Dev#=  4 Spd=1.5 MxCh= 0
> >> D:  Ver= 1.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs=  1
> >> P:  Vendor=0001 ProdID=0000 Rev= 1.00
> >> S:  Manufacturer=MEC
> >> S:  Product=MEC0002
> >> C:* #Ifs= 1 Cfg#= 1 Atr=80 MxPwr=100mA
> >> I:  If#= 0 Alt= 0 #EPs= 1 Cls=03(HID  ) Sub=00 Prot=00 Driver=usbhid
> >> E:  Ad=81(I) Atr=03(Int.) MxPS=   8 Ivl=10ms  
> >> 
> >> >
> >> >Hi Dave, 
> >> >
> >> >nothing in the outputs you sent looks like any Belkin device is
> >> >present. Are you sure it is attached to your computer? You should have
> >> >something like this in /proc/bus/usb/devices: 
> >> >
> >> >T:  Bus=04 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#=  3 Spd=1.5 MxCh= 0
> >> >D:  Ver= 1.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs=  1
> >> >P:  Vendor=050d ProdID=0980 Rev= 0.06
> >> >S:  Manufacturer=       
> >> >S:  Product=UPS
> >> >C:* #Ifs= 1 Cfg#= 1 Atr=c0 MxPwr= 20mA
> >> >I:  If#= 0 Alt= 0 #EPs= 1 Cls=03(HID  ) Sub=00 Prot=00 Driver=usbhid
> >> >E:  Ad=81(I) Atr=03(Int.) MxPS=   8 Ivl=248ms 
> >> >
> >> >Note "Vendor=050d", which is Belkin's vendor ID.  
> >> >
> >> >The output from newhidups does not show a 050d/XXXX device either.  
> >> >
> >> >-- Peter 
> >> >
> >> >meherenow at darkglobe.org wrote:
> >> >> 
> >> >> I have a Belkin F6H500ukUNV ups that I am attempting to get working =20
> >> >> under nut, however it
> >> >> does not appear to be detected by nut, I'm assuming that I need to =20
> >> >> feed some information
> >> >> back to you guys to get it included in the database somwhere. 
> >> >> 
> >> >> I've included (what I can think might be) the relivant outputs. Please >=20
> >> >> let me know if you
> >> >> require anything else. 
> >> >> 
> >> >> dmesg output
> >> >> /sbin/newhidsups output
> >> >> ll /dev/usb*
> >> >> cat /proc/bus/usb/devices 
> >> >> 
> >> >> p.s. I tried chmodding /dev/usb<blah> 777 just incase it was a =20
> >> >> permissions problem, but
> >> >> that didn't help either. 
> >> >> 
> >> >> Many thanks. 
> >> >> 
> >> >> ###########################################################
> >> >> dmesg output when connecting the ups 
> >> >> 
> >> >> usb 2-1: new low speed USB device using uhci_hcd and address 2
> >> >> PM: Adding info for usb:2-1
> >> >> PM: Adding info for No Bus:usbdev2.2_ep00
> >> >> usb 2-1: configuration #1 chosen from 1 choice
> >> >> PM: Adding info for usb:2-1:1.0
> >> >> hiddev96: USB HID v1.00 Device [MEC MEC0002] on usb-0000:00:10.1-1
> >> >> PM: Adding info for No Bus:usbdev2.2_ep81 
> >> 
> >> _______________________________________________
> >> Nut-upsdev mailing list
> >> Nut-upsdev at lists.alioth.debian.org
> >> http://lists.alioth.debian.org/mailman/listinfo/nut-upsdev 
> >> 
> > 
> 

-------------- next part --------------
Index: drivers/mec-hid.c
===================================================================
--- drivers/mec-hid.c	(revision 0)
+++ drivers/mec-hid.c	(revision 0)
@@ -0,0 +1,161 @@
+/* mec-hid.c - subdriver to monitor MEC USB/HID devices with NUT
+ *
+ *  Copyright (C)
+ *  2003 - 2005 Arnaud Quette <arnaud.quette at free.fr>
+ *  2005 - 2006 Peter Selinger <selinger at users.sourceforge.net>         
+ *
+ *  Note: this subdriver was initially generated as a "stub" by the
+ *  path-to-subdriver script. It must be customized.
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+
+#include "newhidups.h"
+#include "mec-hid.h"
+#include "extstate.h" /* for ST_FLAG_STRING */
+#include "dstate.h"   /* for STAT_INSTCMD_HANDLED */
+#include "main.h"     /* for getval() */
+#include "common.h"
+
+#define MEC_HID_VERSION      "MEC HID 0.1"
+
+#define MEC_VENDORID 0x0001
+
+/* --------------------------------------------------------------- */
+/*      Vendor-specific usage table */
+/* --------------------------------------------------------------- */
+
+/* MEC usage table */
+static usage_lkp_t mec_usage_lkp[] = {
+	{ "MEC1",	0x00860004 },
+	{  "\0", 0x0 }
+};
+
+static usage_tables_t mec_utab[] = {
+	mec_usage_lkp,
+	hid_usage_lkp,
+	NULL,
+};
+
+/* --------------------------------------------------------------- */
+/* HID2NUT lookup table                                            */
+/* --------------------------------------------------------------- */
+
+static hid_info_t mec_hid2nut[] = {
+
+  { "unmapped.mec1.flow.flowid", 0, 0, "MEC1.Flow.FlowID", NULL, "%.0f", HU_FLAG_OK, NULL },
+  { "unmapped.mec1.flow.configvoltage", 0, 0, "MEC1.Flow.ConfigVoltage", NULL, "%.0f", HU_FLAG_OK, NULL },
+  { "unmapped.mec1.flow.configfrequency", 0, 0, "MEC1.Flow.ConfigFrequency", NULL, "%.0f", HU_FLAG_OK, NULL },
+  { "unmapped.mec1.flow.lowvoltagetransfer", 0, 0, "MEC1.Flow.LowVoltageTransfer", NULL, "%.0f", HU_FLAG_OK, NULL },
+  { "unmapped.mec1.flow.highvoltagetransfer", 0, 0, "MEC1.Flow.HighVoltageTransfer", NULL, "%.0f", HU_FLAG_OK, NULL },
+  { "unmapped.mec1.flow.imanufacturer", 0, 0, "MEC1.Flow.iManufacturer", NULL, "%.0f", HU_FLAG_OK, NULL },
+  { "unmapped.mec1.flow.iproduct", 0, 0, "MEC1.Flow.iProduct", NULL, "%.0f", HU_FLAG_OK, NULL },
+  { "unmapped.mec1.flow.iserialnumber", 0, 0, "MEC1.Flow.iSerialNumber", NULL, "%.0f", HU_FLAG_OK, NULL },
+  { "unmapped.mec1.flow.flowid", 0, 0, "MEC1.Flow.FlowID", NULL, "%.0f", HU_FLAG_OK, NULL },
+  { "unmapped.mec1.flow.configvoltage", 0, 0, "MEC1.Flow.ConfigVoltage", NULL, "%.0f", HU_FLAG_OK, NULL },
+  { "unmapped.mec1.flow.configfrequency", 0, 0, "MEC1.Flow.ConfigFrequency", NULL, "%.0f", HU_FLAG_OK, NULL },
+  { "unmapped.mec1.flow.configapparentpower", 0, 0, "MEC1.Flow.ConfigApparentPower", NULL, "%.0f", HU_FLAG_OK, NULL },
+  { "unmapped.mec1.flow.configactivepower", 0, 0, "MEC1.Flow.ConfigActivePower", NULL, "%.0f", HU_FLAG_OK, NULL },
+  { "unmapped.mec1.flow.delaybeforestartup", 0, 0, "MEC1.Flow.DelayBeforeStartup", NULL, "%.0f", HU_FLAG_OK, NULL },
+  { "unmapped.mec1.flow.delaybeforeshutdown", 0, 0, "MEC1.Flow.DelayBeforeShutdown", NULL, "%.0f", HU_FLAG_OK, NULL },
+  { "unmapped.mec1.batterysystem.batterysystemid", 0, 0, "MEC1.BatterySystem.BatterySystemID", NULL, "%.0f", HU_FLAG_OK, NULL },
+  { "unmapped.mec1.batterysystem.presentstatus.used", 0, 0, "MEC1.BatterySystem.PresentStatus.Used", NULL, "%.0f", HU_FLAG_OK, NULL },
+  { "unmapped.mec1.batterysystem.presentstatus.good", 0, 0, "MEC1.BatterySystem.PresentStatus.Good", NULL, "%.0f", HU_FLAG_OK, NULL },
+  { "unmapped.mec1.batterysystem.voltage", 0, 0, "MEC1.BatterySystem.Voltage", NULL, "%.0f", HU_FLAG_OK, NULL },
+  { "unmapped.mec1.batterysystem.temperature", 0, 0, "MEC1.BatterySystem.Temperature", NULL, "%.0f", HU_FLAG_OK, NULL },
+  { "unmapped.mec1.batterysystem.test", 0, 0, "MEC1.BatterySystem.Test", NULL, "%.0f", HU_FLAG_OK, NULL },
+  { "unmapped.mec1.batterysystem.test", 0, 0, "MEC1.BatterySystem.Test", NULL, "%.0f", HU_FLAG_OK, NULL },
+  { "unmapped.mec1.powerconverter.powerconverterid", 0, 0, "MEC1.PowerConverter.PowerConverterID", NULL, "%.0f", HU_FLAG_OK, NULL },
+  { "unmapped.mec1.powerconverter.input.inputid", 0, 0, "MEC1.PowerConverter.Input.InputID", NULL, "%.0f", HU_FLAG_OK, NULL },
+  { "unmapped.mec1.powerconverter.input.flowid", 0, 0, "MEC1.PowerConverter.Input.FlowID", NULL, "%.0f", HU_FLAG_OK, NULL },
+  { "unmapped.mec1.powerconverter.input.presentstatus.good", 0, 0, "MEC1.PowerConverter.Input.PresentStatus.Good", NULL, "%.0f", HU_FLAG_OK, NULL },
+  { "unmapped.mec1.powerconverter.input.voltage", 0, 0, "MEC1.PowerConverter.Input.Voltage", NULL, "%.0f", HU_FLAG_OK, NULL },
+  { "unmapped.mec1.powerconverter.input.frequency", 0, 0, "MEC1.PowerConverter.Input.Frequency", NULL, "%.0f", HU_FLAG_OK, NULL },
+  { "unmapped.mec1.powerconverter.output.outputid", 0, 0, "MEC1.PowerConverter.Output.OutputID", NULL, "%.0f", HU_FLAG_OK, NULL },
+  { "unmapped.mec1.powerconverter.output.flowid", 0, 0, "MEC1.PowerConverter.Output.FlowID", NULL, "%.0f", HU_FLAG_OK, NULL },
+  { "unmapped.mec1.powerconverter.output.voltage", 0, 0, "MEC1.PowerConverter.Output.Voltage", NULL, "%.0f", HU_FLAG_OK, NULL },
+  { "unmapped.mec1.powerconverter.output.frequency", 0, 0, "MEC1.PowerConverter.Output.Frequency", NULL, "%.0f", HU_FLAG_OK, NULL },
+  { "unmapped.mec1.powerconverter.output.percentload", 0, 0, "MEC1.PowerConverter.Output.PercentLoad", NULL, "%.0f", HU_FLAG_OK, NULL },
+  { "unmapped.mec1.powerconverter.output.presentstatus.overload", 0, 0, "MEC1.PowerConverter.Output.PresentStatus.Overload", NULL, "%.0f", HU_FLAG_OK, NULL },
+  { "unmapped.mec1.powerconverter.output.presentstatus.boost", 0, 0, "MEC1.PowerConverter.Output.PresentStatus.Boost", NULL, "%.0f", HU_FLAG_OK, NULL },
+  { "unmapped.mec1.powerconverter.output.presentstatus.buck", 0, 0, "MEC1.PowerConverter.Output.PresentStatus.Buck", NULL, "%.0f", HU_FLAG_OK, NULL },
+
+  /* end of structure. */
+  { NULL, 0, 0, NULL, NULL, NULL, 0, NULL }
+};
+
+/* shutdown method for MEC */
+static int mec_shutdown(int ondelay, int offdelay) {
+	/* FIXME: ondelay, offdelay currently not used */
+	
+	/* Default method */
+	upsdebugx(2, "Trying load.off.");
+        if (instcmd("load.off", NULL) == STAT_INSTCMD_HANDLED) {
+                return 1;
+        }
+	upsdebugx(2, "Shutdown failed.");
+        return 0;
+}
+
+static char *mec_format_model(HIDDevice *hd) {
+	return hd->Product;
+}
+
+static char *mec_format_mfr(HIDDevice *hd) {
+	return hd->Vendor ? hd->Vendor : "MEC";
+}
+
+static char *mec_format_serial(HIDDevice *hd) {
+	return hd->Serial;
+}
+
+/* this function allows the subdriver to "claim" a device: return 1 if
+ * the device is supported by this subdriver, else 0. */
+static int mec_claim(HIDDevice *hd) {
+	if (hd->VendorID != MEC_VENDORID) {
+		return 0;
+	}
+	switch (hd->ProductID) {
+
+	/* accept any known UPS - add devices here as needed */
+	case 0000:
+		return 1;
+
+	/* by default, reject, unless the productid option is given */
+	default:
+		if (getval("productid")) {
+			return 1;
+		} else {
+			upsdebugx(1,
+"This particular mec device (%04x/%04x) is not (or perhaps not yet)\n"
+"supported by newhidups. Try running the driver with the '-x productid=%04x'\n"
+"option. Please report your results to the NUT developer's mailing list.\n",
+						 hd->VendorID, hd->ProductID, hd->ProductID);
+			return 0;
+		}
+	}
+}
+
+subdriver_t mec_subdriver = {
+	MEC_HID_VERSION,
+	mec_claim,
+	mec_utab,
+	mec_hid2nut,
+	mec_shutdown,
+	mec_format_model,
+	mec_format_mfr,
+	mec_format_serial,
+};
Index: drivers/mec-hid.h
===================================================================
--- drivers/mec-hid.h	(revision 0)
+++ drivers/mec-hid.h	(revision 0)
@@ -0,0 +1,32 @@
+/* mec-hid.h - subdriver to monitor MEC USB/HID devices with NUT
+ *
+ *  Copyright (C)
+ *  2003 - 2005 Arnaud Quette <arnaud.quette at free.fr>
+ *  2005 - 2006 Peter Selinger <selinger at users.sourceforge.net>         
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+
+#ifndef MEC_HID_H
+#define MEC_HID_H
+
+#include "newhidups.h"
+
+#define MEC_HID_VERSION	"MEC HID 0.1"
+
+extern subdriver_t mec_subdriver;
+
+#endif /* MEC_HID_H */
Index: drivers/newhidups.c
===================================================================
--- drivers/newhidups.c	(revision 528)
+++ drivers/newhidups.c	(working copy)
@@ -37,6 +37,7 @@
 	#include "apc-hid.h"
 	#include "belkin-hid.h"
 	#include "tripplite-hid.h"
+	#include "mec-hid.h"
 #endif
 
 /* master list of avaiable subdrivers */
@@ -49,6 +50,7 @@
 	&apc_subdriver,
 	&belkin_subdriver,
 	&tripplite_subdriver,
+	&mec_subdriver,
 	NULL
 #endif
 };
Index: drivers/Makefile.in
===================================================================
--- drivers/Makefile.in	(revision 525)
+++ drivers/Makefile.in	(working copy)
@@ -92,7 +92,7 @@
 # Special case: newhidups driver - development version
 
 NEWHIDUPS_SUBDRIVERS = generic-hid.o mge-hid.o apc-hid.o belkin-hid.o \
-  tripplite-hid.o
+  tripplite-hid.o mec-hid.o
 
 newhidups: newhidups.o main.o dstate.o ../common/state.o \
 		../common/upsconf.o ../common/parseconf.o $(LIBDEP) \


More information about the Nut-upsdev mailing list