Imported Upstream version 2.7.2
This commit is contained in:
parent
0121794af9
commit
a356b56d11
263 changed files with 6039 additions and 8151 deletions
|
|
@ -5,7 +5,6 @@
|
|||
#FIXME: SERLIBS is only useful for LDADD_DRIVERS_SERIAL not for LDADD_COMMON
|
||||
LDADD_COMMON = ../common/libcommon.la ../common/libparseconf.la
|
||||
LDADD_DRIVERS = $(LDADD_COMMON) main.o dstate.o
|
||||
LDADD_HAL_DRIVERS = $(LDADD_COMMON) libnuthalmain.a
|
||||
LDADD_DRIVERS_SERIAL = $(LDADD_DRIVERS) $(SERLIBS) serial.o
|
||||
|
||||
# most targets are drivers, so make this the default
|
||||
|
|
@ -14,9 +13,6 @@ LDADD = $(LDADD_DRIVERS_SERIAL)
|
|||
# files. In any case, CFLAGS are only -I options, so there is no harm,
|
||||
# but only add them if we really use the target.
|
||||
AM_CFLAGS = -I$(top_srcdir)/include
|
||||
if WITH_HAL
|
||||
AM_CFLAGS += $(LIBHAL_CFLAGS)
|
||||
endif
|
||||
if WITH_USB
|
||||
AM_CFLAGS += $(LIBUSB_CFLAGS)
|
||||
endif
|
||||
|
|
@ -42,11 +38,10 @@ SERIAL_DRIVERLIST = al175 bcmxcp belkin belkinunv bestfcom \
|
|||
nutdrv_qx
|
||||
SNMP_DRIVERLIST = snmp-ups
|
||||
USB_LIBUSB_DRIVERLIST = usbhid-ups bcmxcp_usb tripplite_usb \
|
||||
blazer_usb richcomm_usb riello_usb nutdrv_qx
|
||||
blazer_usb richcomm_usb riello_usb \
|
||||
nutdrv_atcl_usb \
|
||||
nutdrv_qx
|
||||
USB_DRIVERLIST = $(USB_LIBUSB_DRIVERLIST)
|
||||
HAL_DRIVERLIST = hald-addon-usbhid-ups hald-addon-bcmxcp_usb \
|
||||
hald-addon-tripplite_usb hald-addon-blazer_usb hald-addon-riello_usb \
|
||||
hald-addon-nutdrv_qx
|
||||
NEONXML_DRIVERLIST = netxml-ups
|
||||
MACOSX_DRIVERLIST = macosx-ups
|
||||
|
||||
|
|
@ -67,10 +62,6 @@ endif
|
|||
if WITH_USB
|
||||
driverexec_PROGRAMS += $(USB_LIBUSB_DRIVERLIST)
|
||||
endif
|
||||
if WITH_HAL
|
||||
halexecdir = $(HAL_CALLOUTS_PATH)
|
||||
halexec_PROGRAMS = $(HAL_DRIVERLIST)
|
||||
endif
|
||||
if WITH_NEON
|
||||
driverexec_PROGRAMS += $(NEONXML_DRIVERLIST)
|
||||
endif
|
||||
|
|
@ -88,7 +79,7 @@ else
|
|||
endif
|
||||
|
||||
# always build upsdrvctl
|
||||
driverexec_PROGRAMS += upsdrvctl
|
||||
sbin_PROGRAMS = upsdrvctl
|
||||
|
||||
# ==========================================================================
|
||||
# Driver build details
|
||||
|
|
@ -185,12 +176,16 @@ bcmxcp_usb_LDADD = $(LDADD_DRIVERS) $(LIBUSB_LIBS)
|
|||
blazer_usb_SOURCES = blazer.c blazer_usb.c libusb.c usb-common.c
|
||||
blazer_usb_LDADD = $(LDADD_DRIVERS) $(LIBUSB_LIBS) -lm
|
||||
|
||||
nutdrv_atcl_usb_SOURCES = nutdrv_atcl_usb.c usb-common.c
|
||||
nutdrv_atcl_usb_LDADD = $(LDADD_DRIVERS) $(LIBUSB_LIBS)
|
||||
|
||||
richcomm_usb_SOURCES = richcomm_usb.c usb-common.c
|
||||
richcomm_usb_LDADD = $(LDADD_DRIVERS) $(LIBUSB_LIBS)
|
||||
|
||||
riello_usb_SOURCES = riello.c riello_usb.c libusb.c usb-common.c
|
||||
riello_usb_LDADD = $(LDADD_DRIVERS) $(LIBUSB_LIBS) -lm
|
||||
|
||||
|
||||
# HID-over-serial
|
||||
mge_shut_SOURCES = usbhid-ups.c libshut.c libhid.c hidparser.c mge-hid.c
|
||||
# per-target CFLAGS are necessary here
|
||||
|
|
@ -200,30 +195,10 @@ mge_shut_LDADD = $(LDADD)
|
|||
# SNMP
|
||||
snmp_ups_SOURCES = snmp-ups.c apc-mib.c baytech-mib.c compaq-mib.c eaton-mib.c \
|
||||
ietf-mib.c mge-mib.c netvision-mib.c powerware-mib.c raritan-pdu-mib.c \
|
||||
bestpower-mib.c cyberpower-mib.c delta_ups-mib.c
|
||||
bestpower-mib.c cyberpower-mib.c delta_ups-mib.c \
|
||||
xppc-mib.c
|
||||
snmp_ups_LDADD = $(LDADD_DRIVERS) $(LIBNETSNMP_LIBS)
|
||||
|
||||
# HAL
|
||||
hald_addon_usbhid_ups_SOURCES = usbhid-ups.c libhid.c libusb.c hidparser.c \
|
||||
$(USBHID_UPS_SUBDRIVERS)
|
||||
hald_addon_usbhid_ups_LDADD = $(LDADD_HAL_DRIVERS) $(LIBUSB_LIBS) $(LIBHAL_LIBS)
|
||||
|
||||
hald_addon_tripplite_usb_SOURCES = tripplite_usb.c libusb.c
|
||||
hald_addon_tripplite_usb_LDADD = $(LDADD_HAL_DRIVERS) $(LIBUSB_LIBS) $(LIBHAL_LIBS) -lm
|
||||
|
||||
hald_addon_bcmxcp_usb_SOURCES = bcmxcp_usb.c bcmxcp.c
|
||||
hald_addon_bcmxcp_usb_LDADD = $(LDADD_HAL_DRIVERS) $(LIBUSB_LIBS) $(LIBHAL_LIBS)
|
||||
|
||||
hald_addon_blazer_usb_SOURCES = blazer.c blazer_usb.c libusb.c
|
||||
hald_addon_blazer_usb_LDADD = $(LDADD_HAL_DRIVERS) $(LIBUSB_LIBS) $(LIBHAL_LIBS) -lm
|
||||
|
||||
hald_addon_riello_usb_SOURCES = riello.c riello_usb.c libusb.c
|
||||
hald_addon_riello_usb_LDADD = $(LDADD_HAL_DRIVERS) $(LIBUSB_LIBS) $(LIBHAL_LIBS) -lm
|
||||
|
||||
hald_addon_nutdrv_qx_SOURCES = nutdrv_qx.c libusb.c $(NUTDRV_QX_SUBDRIVERS)
|
||||
hald_addon_nutdrv_qx_LDADD = $(LDADD_HAL_DRIVERS) $(LIBUSB_LIBS) $(LIBHAL_LIBS) -lm
|
||||
hald_addon_nutdrv_qx_CFLAGS = $(AM_CFLAGS) -DQX_USB
|
||||
|
||||
# NEON XML/HTTP
|
||||
netxml_ups_SOURCES = netxml-ups.c mge-xml.c
|
||||
netxml_ups_LDADD = $(LDADD_DRIVERS) $(LIBNEON_LIBS)
|
||||
|
|
@ -259,7 +234,7 @@ nutdrv_qx_LDADD += $(LIBUSB_LIBS)
|
|||
endif
|
||||
NUTDRV_QX_SUBDRIVERS = nutdrv_qx_blazer-common.c nutdrv_qx_mecer.c \
|
||||
nutdrv_qx_megatec.c nutdrv_qx_megatec-old.c nutdrv_qx_mustek.c \
|
||||
nutdrv_qx_voltronic.c nutdrv_qx_zinto.c
|
||||
nutdrv_qx_q1.c nutdrv_qx_voltronic.c nutdrv_qx_voltronic-qs.c nutdrv_qx_zinto.c
|
||||
nutdrv_qx_SOURCES += $(NUTDRV_QX_SUBDRIVERS)
|
||||
|
||||
# ----------------------------------------------------------------------
|
||||
|
|
@ -269,30 +244,20 @@ nutdrv_qx_SOURCES += $(NUTDRV_QX_SUBDRIVERS)
|
|||
|
||||
dist_noinst_HEADERS = apc-mib.h apc-hid.h baytech-mib.h bcmxcp.h \
|
||||
bcmxcp_io.h belkin.h belkin-hid.h bestpower-mib.h blazer.h cps-hid.h dstate.h \
|
||||
dstate-hal.h dummy-ups.h eaton-mib.h explore-hid.h gamatronic.h genericups.h \
|
||||
dummy-ups.h eaton-mib.h explore-hid.h gamatronic.h genericups.h \
|
||||
hidparser.h hidtypes.h ietf-mib.h libhid.h libshut.h libusb.h liebert-hid.h \
|
||||
main.h main-hal.h mge-hid.h mge-mib.h mge-shut.h mge-utalk.h \
|
||||
main.h mge-hid.h mge-mib.h mge-shut.h mge-utalk.h \
|
||||
mge-xml.h microdowell.h netvision-mib.h netxml-ups.h nut-ipmi.h oneac.h \
|
||||
powercom.h powerpanel.h powerp-bin.h powerp-txt.h powerware-mib.h raritan-pdu-mib.h \
|
||||
safenet.h serial.h snmp-ups.h solis.h tripplite.h tripplite-hid.h \
|
||||
upshandler.h usb-common.h usbhid-ups.h powercom-hid.h compaq-mib.h idowell-hid.h \
|
||||
apcsmart.h apcsmart_tabs.h apcsmart-old.h apcupsd-ups.h cyberpower-mib.h riello.h openups-hid.h \
|
||||
delta_ups-mib.h nutdrv_qx.h nutdrv_qx_blazer-common.h nutdrv_qx_mecer.h \
|
||||
nutdrv_qx_megatec.h nutdrv_qx_megatec-old.h nutdrv_qx_mustek.h nutdrv_qx_voltronic.h \
|
||||
nutdrv_qx_zinto.h
|
||||
nutdrv_qx_megatec.h nutdrv_qx_megatec-old.h nutdrv_qx_mustek.h nutdrv_qx_q1.h \
|
||||
nutdrv_qx_voltronic.h nutdrv_qx_voltronic-qs.h nutdrv_qx_zinto.h \
|
||||
xppc-mib.h
|
||||
|
||||
# Define a dummy library so that Automake builds rules for the
|
||||
# corresponding object files. This library is not actually built,
|
||||
EXTRA_LIBRARIES = libdummy.a
|
||||
libdummy_a_SOURCES = main.c dstate.c serial.c
|
||||
|
||||
# the nuthalmain library combines the code for main-hal.c and
|
||||
# dstate-hal.c. It is necessary for Automake-technical reasons,
|
||||
# because per-object CFLAGS can only be specified for libraries, not
|
||||
# for object files. This library is used during the build process,
|
||||
# and is not meant to be installed.
|
||||
|
||||
EXTRA_LIBRARIES += libnuthalmain.a
|
||||
libnuthalmain_a_SOURCES = main-hal.c dstate-hal.c usb-common.c
|
||||
|
||||
MOSTLYCLEANFILES = libnuthalmain.a
|
||||
|
|
|
|||
|
|
@ -55,42 +55,38 @@ POST_UNINSTALL = :
|
|||
build_triplet = @build@
|
||||
host_triplet = @host@
|
||||
target_triplet = @target@
|
||||
@WITH_HAL_TRUE@am__append_1 = $(LIBHAL_CFLAGS)
|
||||
@WITH_USB_TRUE@am__append_2 = $(LIBUSB_CFLAGS)
|
||||
@WITH_SNMP_TRUE@am__append_3 = $(LIBNETSNMP_CFLAGS)
|
||||
@WITH_NEON_TRUE@am__append_4 = $(LIBNEON_CFLAGS)
|
||||
@WITH_LIBPOWERMAN_TRUE@am__append_5 = $(LIBPOWERMAN_CFLAGS)
|
||||
@WITH_IPMI_TRUE@am__append_6 = $(LIBIPMI_CFLAGS)
|
||||
@WITH_USB_TRUE@am__append_1 = $(LIBUSB_CFLAGS)
|
||||
@WITH_SNMP_TRUE@am__append_2 = $(LIBNETSNMP_CFLAGS)
|
||||
@WITH_NEON_TRUE@am__append_3 = $(LIBNEON_CFLAGS)
|
||||
@WITH_LIBPOWERMAN_TRUE@am__append_4 = $(LIBPOWERMAN_CFLAGS)
|
||||
@WITH_IPMI_TRUE@am__append_5 = $(LIBIPMI_CFLAGS)
|
||||
EXTRA_PROGRAMS = $(am__EXEEXT_1) $(am__EXEEXT_2) $(am__EXEEXT_4) \
|
||||
$(am__EXEEXT_5) $(am__EXEEXT_6)
|
||||
@SOME_DRIVERS_FALSE@driverexec_PROGRAMS = $(am__EXEEXT_7) \
|
||||
@SOME_DRIVERS_FALSE@ $(am__EXEEXT_8) $(am__EXEEXT_9) \
|
||||
@SOME_DRIVERS_FALSE@ $(am__EXEEXT_10) $(am__EXEEXT_11) \
|
||||
@SOME_DRIVERS_FALSE@ $(am__EXEEXT_12) $(am__EXEEXT_13) \
|
||||
@SOME_DRIVERS_FALSE@ upsdrvctl$(EXEEXT)
|
||||
@SOME_DRIVERS_FALSE@ $(am__EXEEXT_12) $(am__EXEEXT_13)
|
||||
@SOME_DRIVERS_TRUE@driverexec_PROGRAMS = $(DRIVER_BUILD_LIST) \
|
||||
@SOME_DRIVERS_TRUE@ $(am__EXEEXT_7) $(am__EXEEXT_8) \
|
||||
@SOME_DRIVERS_TRUE@ $(am__EXEEXT_9) $(am__EXEEXT_10) \
|
||||
@SOME_DRIVERS_TRUE@ $(am__EXEEXT_11) $(am__EXEEXT_12) \
|
||||
@SOME_DRIVERS_TRUE@ $(am__EXEEXT_13) skel$(EXEEXT) \
|
||||
@SOME_DRIVERS_TRUE@ upsdrvctl$(EXEEXT)
|
||||
@SOME_DRIVERS_FALSE@@WITH_SERIAL_TRUE@am__append_7 = $(SERIAL_DRIVERLIST)
|
||||
@SOME_DRIVERS_FALSE@@WITH_SNMP_TRUE@am__append_8 = $(SNMP_DRIVERLIST)
|
||||
@SOME_DRIVERS_FALSE@@WITH_USB_TRUE@am__append_9 = $(USB_LIBUSB_DRIVERLIST)
|
||||
@SOME_DRIVERS_FALSE@@WITH_HAL_TRUE@halexec_PROGRAMS = \
|
||||
@SOME_DRIVERS_FALSE@@WITH_HAL_TRUE@ $(am__EXEEXT_14)
|
||||
@SOME_DRIVERS_FALSE@@WITH_NEON_TRUE@am__append_10 = $(NEONXML_DRIVERLIST)
|
||||
@SOME_DRIVERS_FALSE@@WITH_LIBPOWERMAN_TRUE@am__append_11 = powerman-pdu
|
||||
@SOME_DRIVERS_FALSE@@WITH_IPMI_TRUE@am__append_12 = nut-ipmipsu
|
||||
@SOME_DRIVERS_FALSE@@WITH_MACOSX_TRUE@am__append_13 = $(MACOSX_DRIVERLIST)
|
||||
@WITH_SSL_TRUE@am__append_14 = $(LIBSSL_CFLAGS)
|
||||
@WITH_SSL_TRUE@am__append_15 = $(LIBSSL_LIBS)
|
||||
@WITH_FREEIPMI_TRUE@am__append_16 = nut-libfreeipmi.c
|
||||
@WITH_SERIAL_TRUE@am__append_17 = -DQX_SERIAL
|
||||
@WITH_SERIAL_TRUE@am__append_18 = $(SERLIBS) serial.o
|
||||
@WITH_USB_TRUE@am__append_19 = -DQX_USB
|
||||
@WITH_USB_TRUE@am__append_20 = libusb.c usb-common.c
|
||||
@WITH_USB_TRUE@am__append_21 = $(LIBUSB_LIBS)
|
||||
@SOME_DRIVERS_TRUE@ $(am__EXEEXT_13) skel$(EXEEXT)
|
||||
@SOME_DRIVERS_FALSE@@WITH_SERIAL_TRUE@am__append_6 = $(SERIAL_DRIVERLIST)
|
||||
@SOME_DRIVERS_FALSE@@WITH_SNMP_TRUE@am__append_7 = $(SNMP_DRIVERLIST)
|
||||
@SOME_DRIVERS_FALSE@@WITH_USB_TRUE@am__append_8 = $(USB_LIBUSB_DRIVERLIST)
|
||||
@SOME_DRIVERS_FALSE@@WITH_NEON_TRUE@am__append_9 = $(NEONXML_DRIVERLIST)
|
||||
@SOME_DRIVERS_FALSE@@WITH_LIBPOWERMAN_TRUE@am__append_10 = powerman-pdu
|
||||
@SOME_DRIVERS_FALSE@@WITH_IPMI_TRUE@am__append_11 = nut-ipmipsu
|
||||
@SOME_DRIVERS_FALSE@@WITH_MACOSX_TRUE@am__append_12 = $(MACOSX_DRIVERLIST)
|
||||
sbin_PROGRAMS = upsdrvctl$(EXEEXT)
|
||||
@WITH_SSL_TRUE@am__append_13 = $(LIBSSL_CFLAGS)
|
||||
@WITH_SSL_TRUE@am__append_14 = $(LIBSSL_LIBS)
|
||||
@WITH_FREEIPMI_TRUE@am__append_15 = nut-libfreeipmi.c
|
||||
@WITH_SERIAL_TRUE@am__append_16 = -DQX_SERIAL
|
||||
@WITH_SERIAL_TRUE@am__append_17 = $(SERLIBS) serial.o
|
||||
@WITH_USB_TRUE@am__append_18 = -DQX_USB
|
||||
@WITH_USB_TRUE@am__append_19 = libusb.c usb-common.c
|
||||
@WITH_USB_TRUE@am__append_20 = $(LIBUSB_LIBS)
|
||||
subdir = drivers
|
||||
DIST_COMMON = $(dist_noinst_HEADERS) $(srcdir)/Makefile.am \
|
||||
$(srcdir)/Makefile.in
|
||||
|
|
@ -104,7 +100,6 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/ax_compare_version.m4 \
|
|||
$(top_srcdir)/m4/nut_check_libavahi.m4 \
|
||||
$(top_srcdir)/m4/nut_check_libfreeipmi.m4 \
|
||||
$(top_srcdir)/m4/nut_check_libgd.m4 \
|
||||
$(top_srcdir)/m4/nut_check_libhal.m4 \
|
||||
$(top_srcdir)/m4/nut_check_libltdl.m4 \
|
||||
$(top_srcdir)/m4/nut_check_libneon.m4 \
|
||||
$(top_srcdir)/m4/nut_check_libnetsnmp.m4 \
|
||||
|
|
@ -114,10 +109,9 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/ax_compare_version.m4 \
|
|||
$(top_srcdir)/m4/nut_check_libusb.m4 \
|
||||
$(top_srcdir)/m4/nut_check_libwrap.m4 \
|
||||
$(top_srcdir)/m4/nut_check_os.m4 \
|
||||
$(top_srcdir)/m4/nut_config_libhal.m4 \
|
||||
$(top_srcdir)/m4/nut_report_feature.m4 \
|
||||
$(top_srcdir)/m4/nut_type_socklen_t.m4 \
|
||||
$(top_srcdir)/configure.in
|
||||
$(top_srcdir)/configure.ac
|
||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||
$(ACLOCAL_M4)
|
||||
mkinstalldirs = $(install_sh) -d
|
||||
|
|
@ -130,11 +124,6 @@ libdummy_a_LIBADD =
|
|||
am_libdummy_a_OBJECTS = main.$(OBJEXT) dstate.$(OBJEXT) \
|
||||
serial.$(OBJEXT)
|
||||
libdummy_a_OBJECTS = $(am_libdummy_a_OBJECTS)
|
||||
libnuthalmain_a_AR = $(AR) $(ARFLAGS)
|
||||
libnuthalmain_a_LIBADD =
|
||||
am_libnuthalmain_a_OBJECTS = main-hal.$(OBJEXT) dstate-hal.$(OBJEXT) \
|
||||
usb-common.$(OBJEXT)
|
||||
libnuthalmain_a_OBJECTS = $(am_libnuthalmain_a_OBJECTS)
|
||||
am__EXEEXT_1 = al175$(EXEEXT) bcmxcp$(EXEEXT) belkin$(EXEEXT) \
|
||||
belkinunv$(EXEEXT) bestfcom$(EXEEXT) bestfortress$(EXEEXT) \
|
||||
bestuferrups$(EXEEXT) bestups$(EXEEXT) dummy-ups$(EXEEXT) \
|
||||
|
|
@ -153,7 +142,8 @@ am__EXEEXT_1 = al175$(EXEEXT) bcmxcp$(EXEEXT) belkin$(EXEEXT) \
|
|||
am__EXEEXT_2 = snmp-ups$(EXEEXT)
|
||||
am__EXEEXT_3 = usbhid-ups$(EXEEXT) bcmxcp_usb$(EXEEXT) \
|
||||
tripplite_usb$(EXEEXT) blazer_usb$(EXEEXT) \
|
||||
richcomm_usb$(EXEEXT) riello_usb$(EXEEXT) nutdrv_qx$(EXEEXT)
|
||||
richcomm_usb$(EXEEXT) riello_usb$(EXEEXT) \
|
||||
nutdrv_atcl_usb$(EXEEXT) nutdrv_qx$(EXEEXT)
|
||||
am__EXEEXT_4 = $(am__EXEEXT_3)
|
||||
am__EXEEXT_5 = netxml-ups$(EXEEXT)
|
||||
am__EXEEXT_6 = macosx-ups$(EXEEXT)
|
||||
|
|
@ -165,14 +155,8 @@ am__EXEEXT_6 = macosx-ups$(EXEEXT)
|
|||
@SOME_DRIVERS_FALSE@@WITH_IPMI_TRUE@am__EXEEXT_12 = \
|
||||
@SOME_DRIVERS_FALSE@@WITH_IPMI_TRUE@ nut-ipmipsu$(EXEEXT)
|
||||
@SOME_DRIVERS_FALSE@@WITH_MACOSX_TRUE@am__EXEEXT_13 = $(am__EXEEXT_6)
|
||||
am__installdirs = "$(DESTDIR)$(driverexecdir)" \
|
||||
"$(DESTDIR)$(halexecdir)"
|
||||
am__EXEEXT_14 = hald-addon-usbhid-ups$(EXEEXT) \
|
||||
hald-addon-bcmxcp_usb$(EXEEXT) \
|
||||
hald-addon-tripplite_usb$(EXEEXT) \
|
||||
hald-addon-blazer_usb$(EXEEXT) hald-addon-riello_usb$(EXEEXT) \
|
||||
hald-addon-nutdrv_qx$(EXEEXT)
|
||||
PROGRAMS = $(driverexec_PROGRAMS) $(halexec_PROGRAMS)
|
||||
am__installdirs = "$(DESTDIR)$(driverexecdir)" "$(DESTDIR)$(sbindir)"
|
||||
PROGRAMS = $(driverexec_PROGRAMS) $(sbin_PROGRAMS)
|
||||
am_al175_OBJECTS = al175.$(OBJEXT)
|
||||
al175_OBJECTS = $(am_al175_OBJECTS)
|
||||
al175_LDADD = $(LDADD)
|
||||
|
|
@ -264,56 +248,6 @@ am_genericups_OBJECTS = genericups.$(OBJEXT)
|
|||
genericups_OBJECTS = $(am_genericups_OBJECTS)
|
||||
genericups_LDADD = $(LDADD)
|
||||
genericups_DEPENDENCIES = $(am__DEPENDENCIES_2)
|
||||
am_hald_addon_bcmxcp_usb_OBJECTS = bcmxcp_usb.$(OBJEXT) \
|
||||
bcmxcp.$(OBJEXT)
|
||||
hald_addon_bcmxcp_usb_OBJECTS = $(am_hald_addon_bcmxcp_usb_OBJECTS)
|
||||
hald_addon_bcmxcp_usb_DEPENDENCIES = $(LDADD_HAL_DRIVERS) \
|
||||
$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
|
||||
am_hald_addon_blazer_usb_OBJECTS = blazer.$(OBJEXT) \
|
||||
blazer_usb.$(OBJEXT) libusb.$(OBJEXT)
|
||||
hald_addon_blazer_usb_OBJECTS = $(am_hald_addon_blazer_usb_OBJECTS)
|
||||
hald_addon_blazer_usb_DEPENDENCIES = $(LDADD_HAL_DRIVERS) \
|
||||
$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
|
||||
am__objects_1 = \
|
||||
hald_addon_nutdrv_qx-nutdrv_qx_blazer-common.$(OBJEXT) \
|
||||
hald_addon_nutdrv_qx-nutdrv_qx_mecer.$(OBJEXT) \
|
||||
hald_addon_nutdrv_qx-nutdrv_qx_megatec.$(OBJEXT) \
|
||||
hald_addon_nutdrv_qx-nutdrv_qx_megatec-old.$(OBJEXT) \
|
||||
hald_addon_nutdrv_qx-nutdrv_qx_mustek.$(OBJEXT) \
|
||||
hald_addon_nutdrv_qx-nutdrv_qx_voltronic.$(OBJEXT) \
|
||||
hald_addon_nutdrv_qx-nutdrv_qx_zinto.$(OBJEXT)
|
||||
am_hald_addon_nutdrv_qx_OBJECTS = \
|
||||
hald_addon_nutdrv_qx-nutdrv_qx.$(OBJEXT) \
|
||||
hald_addon_nutdrv_qx-libusb.$(OBJEXT) $(am__objects_1)
|
||||
hald_addon_nutdrv_qx_OBJECTS = $(am_hald_addon_nutdrv_qx_OBJECTS)
|
||||
hald_addon_nutdrv_qx_DEPENDENCIES = $(LDADD_HAL_DRIVERS) \
|
||||
$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
|
||||
hald_addon_nutdrv_qx_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
|
||||
$(LIBTOOLFLAGS) --mode=link $(CCLD) \
|
||||
$(hald_addon_nutdrv_qx_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
|
||||
$(LDFLAGS) -o $@
|
||||
am_hald_addon_riello_usb_OBJECTS = riello.$(OBJEXT) \
|
||||
riello_usb.$(OBJEXT) libusb.$(OBJEXT)
|
||||
hald_addon_riello_usb_OBJECTS = $(am_hald_addon_riello_usb_OBJECTS)
|
||||
hald_addon_riello_usb_DEPENDENCIES = $(LDADD_HAL_DRIVERS) \
|
||||
$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
|
||||
am_hald_addon_tripplite_usb_OBJECTS = tripplite_usb.$(OBJEXT) \
|
||||
libusb.$(OBJEXT)
|
||||
hald_addon_tripplite_usb_OBJECTS = \
|
||||
$(am_hald_addon_tripplite_usb_OBJECTS)
|
||||
hald_addon_tripplite_usb_DEPENDENCIES = $(LDADD_HAL_DRIVERS) \
|
||||
$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
|
||||
am__objects_2 = apc-hid.$(OBJEXT) belkin-hid.$(OBJEXT) \
|
||||
cps-hid.$(OBJEXT) explore-hid.$(OBJEXT) liebert-hid.$(OBJEXT) \
|
||||
mge-hid.$(OBJEXT) powercom-hid.$(OBJEXT) \
|
||||
tripplite-hid.$(OBJEXT) idowell-hid.$(OBJEXT) \
|
||||
openups-hid.$(OBJEXT)
|
||||
am_hald_addon_usbhid_ups_OBJECTS = usbhid-ups.$(OBJEXT) \
|
||||
libhid.$(OBJEXT) libusb.$(OBJEXT) hidparser.$(OBJEXT) \
|
||||
$(am__objects_2)
|
||||
hald_addon_usbhid_ups_OBJECTS = $(am_hald_addon_usbhid_ups_OBJECTS)
|
||||
hald_addon_usbhid_ups_DEPENDENCIES = $(LDADD_HAL_DRIVERS) \
|
||||
$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
|
||||
am_isbmex_OBJECTS = isbmex.$(OBJEXT)
|
||||
isbmex_OBJECTS = $(am_isbmex_OBJECTS)
|
||||
isbmex_DEPENDENCIES = $(am__DEPENDENCIES_3)
|
||||
|
|
@ -363,25 +297,32 @@ am_netxml_ups_OBJECTS = netxml-ups.$(OBJEXT) mge-xml.$(OBJEXT)
|
|||
netxml_ups_OBJECTS = $(am_netxml_ups_OBJECTS)
|
||||
netxml_ups_DEPENDENCIES = $(LDADD_DRIVERS) $(am__DEPENDENCIES_1)
|
||||
am__nut_ipmipsu_SOURCES_DIST = nut-ipmipsu.c nut-libfreeipmi.c
|
||||
@WITH_FREEIPMI_TRUE@am__objects_3 = nut-libfreeipmi.$(OBJEXT)
|
||||
am_nut_ipmipsu_OBJECTS = nut-ipmipsu.$(OBJEXT) $(am__objects_3)
|
||||
@WITH_FREEIPMI_TRUE@am__objects_1 = nut-libfreeipmi.$(OBJEXT)
|
||||
am_nut_ipmipsu_OBJECTS = nut-ipmipsu.$(OBJEXT) $(am__objects_1)
|
||||
nut_ipmipsu_OBJECTS = $(am_nut_ipmipsu_OBJECTS)
|
||||
nut_ipmipsu_DEPENDENCIES = $(am__DEPENDENCIES_3) $(am__DEPENDENCIES_1)
|
||||
am_nutdrv_atcl_usb_OBJECTS = nutdrv_atcl_usb.$(OBJEXT) \
|
||||
usb-common.$(OBJEXT)
|
||||
nutdrv_atcl_usb_OBJECTS = $(am_nutdrv_atcl_usb_OBJECTS)
|
||||
nutdrv_atcl_usb_DEPENDENCIES = $(LDADD_DRIVERS) $(am__DEPENDENCIES_1)
|
||||
am__nutdrv_qx_SOURCES_DIST = nutdrv_qx.c libusb.c usb-common.c \
|
||||
nutdrv_qx_blazer-common.c nutdrv_qx_mecer.c \
|
||||
nutdrv_qx_megatec.c nutdrv_qx_megatec-old.c nutdrv_qx_mustek.c \
|
||||
nutdrv_qx_voltronic.c nutdrv_qx_zinto.c
|
||||
@WITH_USB_TRUE@am__objects_4 = nutdrv_qx-libusb.$(OBJEXT) \
|
||||
nutdrv_qx_q1.c nutdrv_qx_voltronic.c nutdrv_qx_voltronic-qs.c \
|
||||
nutdrv_qx_zinto.c
|
||||
@WITH_USB_TRUE@am__objects_2 = nutdrv_qx-libusb.$(OBJEXT) \
|
||||
@WITH_USB_TRUE@ nutdrv_qx-usb-common.$(OBJEXT)
|
||||
am__objects_5 = nutdrv_qx-nutdrv_qx_blazer-common.$(OBJEXT) \
|
||||
am__objects_3 = nutdrv_qx-nutdrv_qx_blazer-common.$(OBJEXT) \
|
||||
nutdrv_qx-nutdrv_qx_mecer.$(OBJEXT) \
|
||||
nutdrv_qx-nutdrv_qx_megatec.$(OBJEXT) \
|
||||
nutdrv_qx-nutdrv_qx_megatec-old.$(OBJEXT) \
|
||||
nutdrv_qx-nutdrv_qx_mustek.$(OBJEXT) \
|
||||
nutdrv_qx-nutdrv_qx_q1.$(OBJEXT) \
|
||||
nutdrv_qx-nutdrv_qx_voltronic.$(OBJEXT) \
|
||||
nutdrv_qx-nutdrv_qx_voltronic-qs.$(OBJEXT) \
|
||||
nutdrv_qx-nutdrv_qx_zinto.$(OBJEXT)
|
||||
am_nutdrv_qx_OBJECTS = nutdrv_qx-nutdrv_qx.$(OBJEXT) $(am__objects_4) \
|
||||
$(am__objects_5)
|
||||
am_nutdrv_qx_OBJECTS = nutdrv_qx-nutdrv_qx.$(OBJEXT) $(am__objects_2) \
|
||||
$(am__objects_3)
|
||||
nutdrv_qx_OBJECTS = $(am_nutdrv_qx_OBJECTS)
|
||||
@WITH_SERIAL_TRUE@am__DEPENDENCIES_5 = $(am__DEPENDENCIES_1) serial.o
|
||||
@WITH_USB_TRUE@am__DEPENDENCIES_6 = $(am__DEPENDENCIES_1)
|
||||
|
|
@ -438,7 +379,7 @@ am_snmp_ups_OBJECTS = snmp-ups.$(OBJEXT) apc-mib.$(OBJEXT) \
|
|||
ietf-mib.$(OBJEXT) mge-mib.$(OBJEXT) netvision-mib.$(OBJEXT) \
|
||||
powerware-mib.$(OBJEXT) raritan-pdu-mib.$(OBJEXT) \
|
||||
bestpower-mib.$(OBJEXT) cyberpower-mib.$(OBJEXT) \
|
||||
delta_ups-mib.$(OBJEXT)
|
||||
delta_ups-mib.$(OBJEXT) xppc-mib.$(OBJEXT)
|
||||
snmp_ups_OBJECTS = $(am_snmp_ups_OBJECTS)
|
||||
snmp_ups_DEPENDENCIES = $(LDADD_DRIVERS) $(am__DEPENDENCIES_1)
|
||||
am_solis_OBJECTS = solis.$(OBJEXT)
|
||||
|
|
@ -462,9 +403,14 @@ upscode2_DEPENDENCIES = $(am__DEPENDENCIES_3)
|
|||
am_upsdrvctl_OBJECTS = upsdrvctl.$(OBJEXT)
|
||||
upsdrvctl_OBJECTS = $(am_upsdrvctl_OBJECTS)
|
||||
upsdrvctl_DEPENDENCIES = $(LDADD_COMMON)
|
||||
am__objects_4 = apc-hid.$(OBJEXT) belkin-hid.$(OBJEXT) \
|
||||
cps-hid.$(OBJEXT) explore-hid.$(OBJEXT) liebert-hid.$(OBJEXT) \
|
||||
mge-hid.$(OBJEXT) powercom-hid.$(OBJEXT) \
|
||||
tripplite-hid.$(OBJEXT) idowell-hid.$(OBJEXT) \
|
||||
openups-hid.$(OBJEXT)
|
||||
am_usbhid_ups_OBJECTS = usbhid-ups.$(OBJEXT) libhid.$(OBJEXT) \
|
||||
libusb.$(OBJEXT) hidparser.$(OBJEXT) usb-common.$(OBJEXT) \
|
||||
$(am__objects_2)
|
||||
$(am__objects_4)
|
||||
usbhid_ups_OBJECTS = $(am_usbhid_ups_OBJECTS)
|
||||
usbhid_ups_DEPENDENCIES = $(LDADD_DRIVERS) $(am__DEPENDENCIES_1)
|
||||
am_victronups_OBJECTS = victronups.$(OBJEXT)
|
||||
|
|
@ -484,25 +430,20 @@ CCLD = $(CC)
|
|||
LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
|
||||
--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
|
||||
$(LDFLAGS) -o $@
|
||||
SOURCES = $(libdummy_a_SOURCES) $(libnuthalmain_a_SOURCES) \
|
||||
$(al175_SOURCES) $(apcsmart_SOURCES) $(apcsmart_old_SOURCES) \
|
||||
$(apcupsd_ups_SOURCES) $(bcmxcp_SOURCES) $(bcmxcp_usb_SOURCES) \
|
||||
$(belkin_SOURCES) $(belkinunv_SOURCES) $(bestfcom_SOURCES) \
|
||||
bestfortress.c $(bestuferrups_SOURCES) $(bestups_SOURCES) \
|
||||
SOURCES = $(libdummy_a_SOURCES) $(al175_SOURCES) $(apcsmart_SOURCES) \
|
||||
$(apcsmart_old_SOURCES) $(apcupsd_ups_SOURCES) \
|
||||
$(bcmxcp_SOURCES) $(bcmxcp_usb_SOURCES) $(belkin_SOURCES) \
|
||||
$(belkinunv_SOURCES) $(bestfcom_SOURCES) bestfortress.c \
|
||||
$(bestuferrups_SOURCES) $(bestups_SOURCES) \
|
||||
$(blazer_ser_SOURCES) $(blazer_usb_SOURCES) $(clone_SOURCES) \
|
||||
$(clone_outlet_SOURCES) $(dummy_ups_SOURCES) $(etapro_SOURCES) \
|
||||
$(everups_SOURCES) $(gamatronic_SOURCES) $(genericups_SOURCES) \
|
||||
$(hald_addon_bcmxcp_usb_SOURCES) \
|
||||
$(hald_addon_blazer_usb_SOURCES) \
|
||||
$(hald_addon_nutdrv_qx_SOURCES) \
|
||||
$(hald_addon_riello_usb_SOURCES) \
|
||||
$(hald_addon_tripplite_usb_SOURCES) \
|
||||
$(hald_addon_usbhid_ups_SOURCES) $(isbmex_SOURCES) \
|
||||
$(ivtscd_SOURCES) $(liebert_SOURCES) $(liebert_esp2_SOURCES) \
|
||||
$(macosx_ups_SOURCES) $(masterguard_SOURCES) \
|
||||
$(metasys_SOURCES) $(mge_shut_SOURCES) $(mge_utalk_SOURCES) \
|
||||
$(microdowell_SOURCES) $(netxml_ups_SOURCES) \
|
||||
$(nut_ipmipsu_SOURCES) $(nutdrv_qx_SOURCES) \
|
||||
$(isbmex_SOURCES) $(ivtscd_SOURCES) $(liebert_SOURCES) \
|
||||
$(liebert_esp2_SOURCES) $(macosx_ups_SOURCES) \
|
||||
$(masterguard_SOURCES) $(metasys_SOURCES) $(mge_shut_SOURCES) \
|
||||
$(mge_utalk_SOURCES) $(microdowell_SOURCES) \
|
||||
$(netxml_ups_SOURCES) $(nut_ipmipsu_SOURCES) \
|
||||
$(nutdrv_atcl_usb_SOURCES) $(nutdrv_qx_SOURCES) \
|
||||
$(oldmge_shut_SOURCES) $(oneac_SOURCES) $(optiups_SOURCES) \
|
||||
$(powercom_SOURCES) $(powerman_pdu_SOURCES) \
|
||||
$(powerpanel_SOURCES) $(rhino_SOURCES) $(richcomm_usb_SOURCES) \
|
||||
|
|
@ -512,25 +453,20 @@ SOURCES = $(libdummy_a_SOURCES) $(libnuthalmain_a_SOURCES) \
|
|||
$(tripplitesu_SOURCES) $(upscode2_SOURCES) \
|
||||
$(upsdrvctl_SOURCES) $(usbhid_ups_SOURCES) \
|
||||
$(victronups_SOURCES)
|
||||
DIST_SOURCES = $(libdummy_a_SOURCES) $(libnuthalmain_a_SOURCES) \
|
||||
$(al175_SOURCES) $(apcsmart_SOURCES) $(apcsmart_old_SOURCES) \
|
||||
DIST_SOURCES = $(libdummy_a_SOURCES) $(al175_SOURCES) \
|
||||
$(apcsmart_SOURCES) $(apcsmart_old_SOURCES) \
|
||||
$(apcupsd_ups_SOURCES) $(bcmxcp_SOURCES) $(bcmxcp_usb_SOURCES) \
|
||||
$(belkin_SOURCES) $(belkinunv_SOURCES) $(bestfcom_SOURCES) \
|
||||
bestfortress.c $(bestuferrups_SOURCES) $(bestups_SOURCES) \
|
||||
$(blazer_ser_SOURCES) $(blazer_usb_SOURCES) $(clone_SOURCES) \
|
||||
$(clone_outlet_SOURCES) $(dummy_ups_SOURCES) $(etapro_SOURCES) \
|
||||
$(everups_SOURCES) $(gamatronic_SOURCES) $(genericups_SOURCES) \
|
||||
$(hald_addon_bcmxcp_usb_SOURCES) \
|
||||
$(hald_addon_blazer_usb_SOURCES) \
|
||||
$(hald_addon_nutdrv_qx_SOURCES) \
|
||||
$(hald_addon_riello_usb_SOURCES) \
|
||||
$(hald_addon_tripplite_usb_SOURCES) \
|
||||
$(hald_addon_usbhid_ups_SOURCES) $(isbmex_SOURCES) \
|
||||
$(ivtscd_SOURCES) $(liebert_SOURCES) $(liebert_esp2_SOURCES) \
|
||||
$(macosx_ups_SOURCES) $(masterguard_SOURCES) \
|
||||
$(metasys_SOURCES) $(mge_shut_SOURCES) $(mge_utalk_SOURCES) \
|
||||
$(microdowell_SOURCES) $(netxml_ups_SOURCES) \
|
||||
$(am__nut_ipmipsu_SOURCES_DIST) $(am__nutdrv_qx_SOURCES_DIST) \
|
||||
$(isbmex_SOURCES) $(ivtscd_SOURCES) $(liebert_SOURCES) \
|
||||
$(liebert_esp2_SOURCES) $(macosx_ups_SOURCES) \
|
||||
$(masterguard_SOURCES) $(metasys_SOURCES) $(mge_shut_SOURCES) \
|
||||
$(mge_utalk_SOURCES) $(microdowell_SOURCES) \
|
||||
$(netxml_ups_SOURCES) $(am__nut_ipmipsu_SOURCES_DIST) \
|
||||
$(nutdrv_atcl_usb_SOURCES) $(am__nutdrv_qx_SOURCES_DIST) \
|
||||
$(oldmge_shut_SOURCES) $(oneac_SOURCES) $(optiups_SOURCES) \
|
||||
$(powercom_SOURCES) $(powerman_pdu_SOURCES) \
|
||||
$(powerpanel_SOURCES) $(rhino_SOURCES) $(richcomm_usb_SOURCES) \
|
||||
|
|
@ -591,10 +527,6 @@ EGREP = @EGREP@
|
|||
EXEEXT = @EXEEXT@
|
||||
FGREP = @FGREP@
|
||||
GREP = @GREP@
|
||||
HAL_CALLOUTS_PATH = @HAL_CALLOUTS_PATH@
|
||||
HAL_DEVICE_MATCH_KEY = @HAL_DEVICE_MATCH_KEY@
|
||||
HAL_FDI_PATH = @HAL_FDI_PATH@
|
||||
HAL_USER = @HAL_USER@
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
|
|
@ -606,8 +538,6 @@ LIBAVAHI_CFLAGS = @LIBAVAHI_CFLAGS@
|
|||
LIBAVAHI_LIBS = @LIBAVAHI_LIBS@
|
||||
LIBGD_CFLAGS = @LIBGD_CFLAGS@
|
||||
LIBGD_LDFLAGS = @LIBGD_LDFLAGS@
|
||||
LIBHAL_CFLAGS = @LIBHAL_CFLAGS@
|
||||
LIBHAL_LIBS = @LIBHAL_LIBS@
|
||||
LIBIPMI_CFLAGS = @LIBIPMI_CFLAGS@
|
||||
LIBIPMI_LIBS = @LIBIPMI_LIBS@
|
||||
LIBLTDL_CFLAGS = @LIBLTDL_CFLAGS@
|
||||
|
|
@ -693,6 +623,7 @@ builddir = @builddir@
|
|||
cgiexecdir = @cgiexecdir@
|
||||
datadir = @datadir@
|
||||
datarootdir = @datarootdir@
|
||||
devddir = @devddir@
|
||||
docdir = @docdir@
|
||||
driverexecdir = @driverexecdir@
|
||||
dvidir = @dvidir@
|
||||
|
|
@ -740,7 +671,6 @@ udevdir = @udevdir@
|
|||
#FIXME: SERLIBS is only useful for LDADD_DRIVERS_SERIAL not for LDADD_COMMON
|
||||
LDADD_COMMON = ../common/libcommon.la ../common/libparseconf.la
|
||||
LDADD_DRIVERS = $(LDADD_COMMON) main.o dstate.o
|
||||
LDADD_HAL_DRIVERS = $(LDADD_COMMON) libnuthalmain.a
|
||||
LDADD_DRIVERS_SERIAL = $(LDADD_DRIVERS) $(SERLIBS) serial.o
|
||||
|
||||
# most targets are drivers, so make this the default
|
||||
|
|
@ -749,8 +679,7 @@ LDADD = $(LDADD_DRIVERS_SERIAL)
|
|||
# files. In any case, CFLAGS are only -I options, so there is no harm,
|
||||
# but only add them if we really use the target.
|
||||
AM_CFLAGS = -I$(top_srcdir)/include $(am__append_1) $(am__append_2) \
|
||||
$(am__append_3) $(am__append_4) $(am__append_5) \
|
||||
$(am__append_6)
|
||||
$(am__append_3) $(am__append_4) $(am__append_5)
|
||||
SERIAL_DRIVERLIST = al175 bcmxcp belkin belkinunv bestfcom \
|
||||
bestfortress bestuferrups bestups dummy-ups etapro everups \
|
||||
gamatronic genericups isbmex liebert liebert-esp2 masterguard metasys \
|
||||
|
|
@ -761,16 +690,13 @@ SERIAL_DRIVERLIST = al175 bcmxcp belkin belkinunv bestfcom \
|
|||
|
||||
SNMP_DRIVERLIST = snmp-ups
|
||||
USB_LIBUSB_DRIVERLIST = usbhid-ups bcmxcp_usb tripplite_usb \
|
||||
blazer_usb richcomm_usb riello_usb nutdrv_qx
|
||||
blazer_usb richcomm_usb riello_usb \
|
||||
nutdrv_atcl_usb \
|
||||
nutdrv_qx
|
||||
|
||||
USB_DRIVERLIST = $(USB_LIBUSB_DRIVERLIST)
|
||||
HAL_DRIVERLIST = hald-addon-usbhid-ups hald-addon-bcmxcp_usb \
|
||||
hald-addon-tripplite_usb hald-addon-blazer_usb hald-addon-riello_usb \
|
||||
hald-addon-nutdrv_qx
|
||||
|
||||
NEONXML_DRIVERLIST = netxml-ups
|
||||
MACOSX_DRIVERLIST = macosx-ups
|
||||
@SOME_DRIVERS_FALSE@@WITH_HAL_TRUE@halexecdir = $(HAL_CALLOUTS_PATH)
|
||||
|
||||
# ==========================================================================
|
||||
# Driver build details
|
||||
|
|
@ -830,9 +756,9 @@ riello_ser_LDADD = $(LDADD) -lm
|
|||
# dummy
|
||||
dummy_ups_SOURCES = dummy-ups.c
|
||||
dummy_ups_CFLAGS = $(AM_CFLAGS) -I$(top_srcdir)/clients \
|
||||
$(am__append_14)
|
||||
$(am__append_13)
|
||||
dummy_ups_LDADD = $(LDADD_DRIVERS) ../clients/libupsclient.la \
|
||||
$(am__append_15)
|
||||
$(am__append_14)
|
||||
|
||||
# Clone drivers
|
||||
clone_SOURCES = clone.c
|
||||
|
|
@ -862,6 +788,8 @@ bcmxcp_usb_SOURCES = bcmxcp_usb.c bcmxcp.c usb-common.c
|
|||
bcmxcp_usb_LDADD = $(LDADD_DRIVERS) $(LIBUSB_LIBS)
|
||||
blazer_usb_SOURCES = blazer.c blazer_usb.c libusb.c usb-common.c
|
||||
blazer_usb_LDADD = $(LDADD_DRIVERS) $(LIBUSB_LIBS) -lm
|
||||
nutdrv_atcl_usb_SOURCES = nutdrv_atcl_usb.c usb-common.c
|
||||
nutdrv_atcl_usb_LDADD = $(LDADD_DRIVERS) $(LIBUSB_LIBS)
|
||||
richcomm_usb_SOURCES = richcomm_usb.c usb-common.c
|
||||
richcomm_usb_LDADD = $(LDADD_DRIVERS) $(LIBUSB_LIBS)
|
||||
riello_usb_SOURCES = riello.c riello_usb.c libusb.c usb-common.c
|
||||
|
|
@ -876,27 +804,11 @@ mge_shut_LDADD = $(LDADD)
|
|||
# SNMP
|
||||
snmp_ups_SOURCES = snmp-ups.c apc-mib.c baytech-mib.c compaq-mib.c eaton-mib.c \
|
||||
ietf-mib.c mge-mib.c netvision-mib.c powerware-mib.c raritan-pdu-mib.c \
|
||||
bestpower-mib.c cyberpower-mib.c delta_ups-mib.c
|
||||
bestpower-mib.c cyberpower-mib.c delta_ups-mib.c \
|
||||
xppc-mib.c
|
||||
|
||||
snmp_ups_LDADD = $(LDADD_DRIVERS) $(LIBNETSNMP_LIBS)
|
||||
|
||||
# HAL
|
||||
hald_addon_usbhid_ups_SOURCES = usbhid-ups.c libhid.c libusb.c hidparser.c \
|
||||
$(USBHID_UPS_SUBDRIVERS)
|
||||
|
||||
hald_addon_usbhid_ups_LDADD = $(LDADD_HAL_DRIVERS) $(LIBUSB_LIBS) $(LIBHAL_LIBS)
|
||||
hald_addon_tripplite_usb_SOURCES = tripplite_usb.c libusb.c
|
||||
hald_addon_tripplite_usb_LDADD = $(LDADD_HAL_DRIVERS) $(LIBUSB_LIBS) $(LIBHAL_LIBS) -lm
|
||||
hald_addon_bcmxcp_usb_SOURCES = bcmxcp_usb.c bcmxcp.c
|
||||
hald_addon_bcmxcp_usb_LDADD = $(LDADD_HAL_DRIVERS) $(LIBUSB_LIBS) $(LIBHAL_LIBS)
|
||||
hald_addon_blazer_usb_SOURCES = blazer.c blazer_usb.c libusb.c
|
||||
hald_addon_blazer_usb_LDADD = $(LDADD_HAL_DRIVERS) $(LIBUSB_LIBS) $(LIBHAL_LIBS) -lm
|
||||
hald_addon_riello_usb_SOURCES = riello.c riello_usb.c libusb.c
|
||||
hald_addon_riello_usb_LDADD = $(LDADD_HAL_DRIVERS) $(LIBUSB_LIBS) $(LIBHAL_LIBS) -lm
|
||||
hald_addon_nutdrv_qx_SOURCES = nutdrv_qx.c libusb.c $(NUTDRV_QX_SUBDRIVERS)
|
||||
hald_addon_nutdrv_qx_LDADD = $(LDADD_HAL_DRIVERS) $(LIBUSB_LIBS) $(LIBHAL_LIBS) -lm
|
||||
hald_addon_nutdrv_qx_CFLAGS = $(AM_CFLAGS) -DQX_USB
|
||||
|
||||
# NEON XML/HTTP
|
||||
netxml_ups_SOURCES = netxml-ups.c mge-xml.c
|
||||
netxml_ups_LDADD = $(LDADD_DRIVERS) $(LIBNEON_LIBS)
|
||||
|
|
@ -906,7 +818,7 @@ powerman_pdu_SOURCES = powerman-pdu.c
|
|||
powerman_pdu_LDADD = $(LDADD) $(LIBPOWERMAN_LIBS)
|
||||
|
||||
# IPMI PSU
|
||||
nut_ipmipsu_SOURCES = nut-ipmipsu.c $(am__append_16)
|
||||
nut_ipmipsu_SOURCES = nut-ipmipsu.c $(am__append_15)
|
||||
nut_ipmipsu_LDADD = $(LDADD) $(LIBIPMI_LIBS)
|
||||
|
||||
# Mac OS X metadriver
|
||||
|
|
@ -915,14 +827,14 @@ macosx_ups_LDFLAGS = $(LDFLAGS) -framework IOKit -framework CoreFoundation
|
|||
macosx_ups_SOURCES = macosx-ups.c
|
||||
|
||||
# nutdrv_qx USB/Serial
|
||||
nutdrv_qx_SOURCES = nutdrv_qx.c $(am__append_20) \
|
||||
nutdrv_qx_SOURCES = nutdrv_qx.c $(am__append_19) \
|
||||
$(NUTDRV_QX_SUBDRIVERS)
|
||||
nutdrv_qx_LDADD = $(LDADD_DRIVERS) -lm $(am__append_18) \
|
||||
$(am__append_21)
|
||||
nutdrv_qx_CFLAGS = $(AM_CFLAGS) $(am__append_17) $(am__append_19)
|
||||
nutdrv_qx_LDADD = $(LDADD_DRIVERS) -lm $(am__append_17) \
|
||||
$(am__append_20)
|
||||
nutdrv_qx_CFLAGS = $(AM_CFLAGS) $(am__append_16) $(am__append_18)
|
||||
NUTDRV_QX_SUBDRIVERS = nutdrv_qx_blazer-common.c nutdrv_qx_mecer.c \
|
||||
nutdrv_qx_megatec.c nutdrv_qx_megatec-old.c nutdrv_qx_mustek.c \
|
||||
nutdrv_qx_voltronic.c nutdrv_qx_zinto.c
|
||||
nutdrv_qx_q1.c nutdrv_qx_voltronic.c nutdrv_qx_voltronic-qs.c nutdrv_qx_zinto.c
|
||||
|
||||
|
||||
# ----------------------------------------------------------------------
|
||||
|
|
@ -931,31 +843,24 @@ NUTDRV_QX_SUBDRIVERS = nutdrv_qx_blazer-common.c nutdrv_qx_mecer.c \
|
|||
# distributed by "make dist".
|
||||
dist_noinst_HEADERS = apc-mib.h apc-hid.h baytech-mib.h bcmxcp.h \
|
||||
bcmxcp_io.h belkin.h belkin-hid.h bestpower-mib.h blazer.h cps-hid.h dstate.h \
|
||||
dstate-hal.h dummy-ups.h eaton-mib.h explore-hid.h gamatronic.h genericups.h \
|
||||
dummy-ups.h eaton-mib.h explore-hid.h gamatronic.h genericups.h \
|
||||
hidparser.h hidtypes.h ietf-mib.h libhid.h libshut.h libusb.h liebert-hid.h \
|
||||
main.h main-hal.h mge-hid.h mge-mib.h mge-shut.h mge-utalk.h \
|
||||
main.h mge-hid.h mge-mib.h mge-shut.h mge-utalk.h \
|
||||
mge-xml.h microdowell.h netvision-mib.h netxml-ups.h nut-ipmi.h oneac.h \
|
||||
powercom.h powerpanel.h powerp-bin.h powerp-txt.h powerware-mib.h raritan-pdu-mib.h \
|
||||
safenet.h serial.h snmp-ups.h solis.h tripplite.h tripplite-hid.h \
|
||||
upshandler.h usb-common.h usbhid-ups.h powercom-hid.h compaq-mib.h idowell-hid.h \
|
||||
apcsmart.h apcsmart_tabs.h apcsmart-old.h apcupsd-ups.h cyberpower-mib.h riello.h openups-hid.h \
|
||||
delta_ups-mib.h nutdrv_qx.h nutdrv_qx_blazer-common.h nutdrv_qx_mecer.h \
|
||||
nutdrv_qx_megatec.h nutdrv_qx_megatec-old.h nutdrv_qx_mustek.h nutdrv_qx_voltronic.h \
|
||||
nutdrv_qx_zinto.h
|
||||
nutdrv_qx_megatec.h nutdrv_qx_megatec-old.h nutdrv_qx_mustek.h nutdrv_qx_q1.h \
|
||||
nutdrv_qx_voltronic.h nutdrv_qx_voltronic-qs.h nutdrv_qx_zinto.h \
|
||||
xppc-mib.h
|
||||
|
||||
|
||||
# Define a dummy library so that Automake builds rules for the
|
||||
# corresponding object files. This library is not actually built,
|
||||
|
||||
# the nuthalmain library combines the code for main-hal.c and
|
||||
# dstate-hal.c. It is necessary for Automake-technical reasons,
|
||||
# because per-object CFLAGS can only be specified for libraries, not
|
||||
# for object files. This library is used during the build process,
|
||||
# and is not meant to be installed.
|
||||
EXTRA_LIBRARIES = libdummy.a libnuthalmain.a
|
||||
EXTRA_LIBRARIES = libdummy.a
|
||||
libdummy_a_SOURCES = main.c dstate.c serial.c
|
||||
libnuthalmain_a_SOURCES = main-hal.c dstate-hal.c usb-common.c
|
||||
MOSTLYCLEANFILES = libnuthalmain.a
|
||||
all: all-am
|
||||
|
||||
.SUFFIXES:
|
||||
|
|
@ -994,10 +899,6 @@ libdummy.a: $(libdummy_a_OBJECTS) $(libdummy_a_DEPENDENCIES) $(EXTRA_libdummy_a_
|
|||
-rm -f libdummy.a
|
||||
$(libdummy_a_AR) libdummy.a $(libdummy_a_OBJECTS) $(libdummy_a_LIBADD)
|
||||
$(RANLIB) libdummy.a
|
||||
libnuthalmain.a: $(libnuthalmain_a_OBJECTS) $(libnuthalmain_a_DEPENDENCIES) $(EXTRA_libnuthalmain_a_DEPENDENCIES)
|
||||
-rm -f libnuthalmain.a
|
||||
$(libnuthalmain_a_AR) libnuthalmain.a $(libnuthalmain_a_OBJECTS) $(libnuthalmain_a_LIBADD)
|
||||
$(RANLIB) libnuthalmain.a
|
||||
install-driverexecPROGRAMS: $(driverexec_PROGRAMS)
|
||||
@$(NORMAL_INSTALL)
|
||||
@list='$(driverexec_PROGRAMS)'; test -n "$(driverexecdir)" || list=; \
|
||||
|
|
@ -1044,12 +945,12 @@ clean-driverexecPROGRAMS:
|
|||
list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
|
||||
echo " rm -f" $$list; \
|
||||
rm -f $$list
|
||||
install-halexecPROGRAMS: $(halexec_PROGRAMS)
|
||||
install-sbinPROGRAMS: $(sbin_PROGRAMS)
|
||||
@$(NORMAL_INSTALL)
|
||||
@list='$(halexec_PROGRAMS)'; test -n "$(halexecdir)" || list=; \
|
||||
@list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \
|
||||
if test -n "$$list"; then \
|
||||
echo " $(MKDIR_P) '$(DESTDIR)$(halexecdir)'"; \
|
||||
$(MKDIR_P) "$(DESTDIR)$(halexecdir)" || exit 1; \
|
||||
echo " $(MKDIR_P) '$(DESTDIR)$(sbindir)'"; \
|
||||
$(MKDIR_P) "$(DESTDIR)$(sbindir)" || exit 1; \
|
||||
fi; \
|
||||
for p in $$list; do echo "$$p $$p"; done | \
|
||||
sed 's/$(EXEEXT)$$//' | \
|
||||
|
|
@ -1067,23 +968,23 @@ install-halexecPROGRAMS: $(halexec_PROGRAMS)
|
|||
while read type dir files; do \
|
||||
if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
|
||||
test -z "$$files" || { \
|
||||
echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(halexecdir)$$dir'"; \
|
||||
$(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(halexecdir)$$dir" || exit $$?; \
|
||||
echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(sbindir)$$dir'"; \
|
||||
$(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(sbindir)$$dir" || exit $$?; \
|
||||
} \
|
||||
; done
|
||||
|
||||
uninstall-halexecPROGRAMS:
|
||||
uninstall-sbinPROGRAMS:
|
||||
@$(NORMAL_UNINSTALL)
|
||||
@list='$(halexec_PROGRAMS)'; test -n "$(halexecdir)" || list=; \
|
||||
@list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \
|
||||
files=`for p in $$list; do echo "$$p"; done | \
|
||||
sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
|
||||
-e 's/$$/$(EXEEXT)/' `; \
|
||||
test -n "$$list" || exit 0; \
|
||||
echo " ( cd '$(DESTDIR)$(halexecdir)' && rm -f" $$files ")"; \
|
||||
cd "$(DESTDIR)$(halexecdir)" && rm -f $$files
|
||||
echo " ( cd '$(DESTDIR)$(sbindir)' && rm -f" $$files ")"; \
|
||||
cd "$(DESTDIR)$(sbindir)" && rm -f $$files
|
||||
|
||||
clean-halexecPROGRAMS:
|
||||
@list='$(halexec_PROGRAMS)'; test -n "$$list" || exit 0; \
|
||||
clean-sbinPROGRAMS:
|
||||
@list='$(sbin_PROGRAMS)'; test -n "$$list" || exit 0; \
|
||||
echo " rm -f" $$list; \
|
||||
rm -f $$list || exit $$?; \
|
||||
test -n "$(EXEEXT)" || exit 0; \
|
||||
|
|
@ -1153,24 +1054,6 @@ gamatronic$(EXEEXT): $(gamatronic_OBJECTS) $(gamatronic_DEPENDENCIES) $(EXTRA_ga
|
|||
genericups$(EXEEXT): $(genericups_OBJECTS) $(genericups_DEPENDENCIES) $(EXTRA_genericups_DEPENDENCIES)
|
||||
@rm -f genericups$(EXEEXT)
|
||||
$(LINK) $(genericups_OBJECTS) $(genericups_LDADD) $(LIBS)
|
||||
hald-addon-bcmxcp_usb$(EXEEXT): $(hald_addon_bcmxcp_usb_OBJECTS) $(hald_addon_bcmxcp_usb_DEPENDENCIES) $(EXTRA_hald_addon_bcmxcp_usb_DEPENDENCIES)
|
||||
@rm -f hald-addon-bcmxcp_usb$(EXEEXT)
|
||||
$(LINK) $(hald_addon_bcmxcp_usb_OBJECTS) $(hald_addon_bcmxcp_usb_LDADD) $(LIBS)
|
||||
hald-addon-blazer_usb$(EXEEXT): $(hald_addon_blazer_usb_OBJECTS) $(hald_addon_blazer_usb_DEPENDENCIES) $(EXTRA_hald_addon_blazer_usb_DEPENDENCIES)
|
||||
@rm -f hald-addon-blazer_usb$(EXEEXT)
|
||||
$(LINK) $(hald_addon_blazer_usb_OBJECTS) $(hald_addon_blazer_usb_LDADD) $(LIBS)
|
||||
hald-addon-nutdrv_qx$(EXEEXT): $(hald_addon_nutdrv_qx_OBJECTS) $(hald_addon_nutdrv_qx_DEPENDENCIES) $(EXTRA_hald_addon_nutdrv_qx_DEPENDENCIES)
|
||||
@rm -f hald-addon-nutdrv_qx$(EXEEXT)
|
||||
$(hald_addon_nutdrv_qx_LINK) $(hald_addon_nutdrv_qx_OBJECTS) $(hald_addon_nutdrv_qx_LDADD) $(LIBS)
|
||||
hald-addon-riello_usb$(EXEEXT): $(hald_addon_riello_usb_OBJECTS) $(hald_addon_riello_usb_DEPENDENCIES) $(EXTRA_hald_addon_riello_usb_DEPENDENCIES)
|
||||
@rm -f hald-addon-riello_usb$(EXEEXT)
|
||||
$(LINK) $(hald_addon_riello_usb_OBJECTS) $(hald_addon_riello_usb_LDADD) $(LIBS)
|
||||
hald-addon-tripplite_usb$(EXEEXT): $(hald_addon_tripplite_usb_OBJECTS) $(hald_addon_tripplite_usb_DEPENDENCIES) $(EXTRA_hald_addon_tripplite_usb_DEPENDENCIES)
|
||||
@rm -f hald-addon-tripplite_usb$(EXEEXT)
|
||||
$(LINK) $(hald_addon_tripplite_usb_OBJECTS) $(hald_addon_tripplite_usb_LDADD) $(LIBS)
|
||||
hald-addon-usbhid-ups$(EXEEXT): $(hald_addon_usbhid_ups_OBJECTS) $(hald_addon_usbhid_ups_DEPENDENCIES) $(EXTRA_hald_addon_usbhid_ups_DEPENDENCIES)
|
||||
@rm -f hald-addon-usbhid-ups$(EXEEXT)
|
||||
$(LINK) $(hald_addon_usbhid_ups_OBJECTS) $(hald_addon_usbhid_ups_LDADD) $(LIBS)
|
||||
isbmex$(EXEEXT): $(isbmex_OBJECTS) $(isbmex_DEPENDENCIES) $(EXTRA_isbmex_DEPENDENCIES)
|
||||
@rm -f isbmex$(EXEEXT)
|
||||
$(LINK) $(isbmex_OBJECTS) $(isbmex_LDADD) $(LIBS)
|
||||
|
|
@ -1207,6 +1090,9 @@ netxml-ups$(EXEEXT): $(netxml_ups_OBJECTS) $(netxml_ups_DEPENDENCIES) $(EXTRA_ne
|
|||
nut-ipmipsu$(EXEEXT): $(nut_ipmipsu_OBJECTS) $(nut_ipmipsu_DEPENDENCIES) $(EXTRA_nut_ipmipsu_DEPENDENCIES)
|
||||
@rm -f nut-ipmipsu$(EXEEXT)
|
||||
$(LINK) $(nut_ipmipsu_OBJECTS) $(nut_ipmipsu_LDADD) $(LIBS)
|
||||
nutdrv_atcl_usb$(EXEEXT): $(nutdrv_atcl_usb_OBJECTS) $(nutdrv_atcl_usb_DEPENDENCIES) $(EXTRA_nutdrv_atcl_usb_DEPENDENCIES)
|
||||
@rm -f nutdrv_atcl_usb$(EXEEXT)
|
||||
$(LINK) $(nutdrv_atcl_usb_OBJECTS) $(nutdrv_atcl_usb_LDADD) $(LIBS)
|
||||
nutdrv_qx$(EXEEXT): $(nutdrv_qx_OBJECTS) $(nutdrv_qx_DEPENDENCIES) $(EXTRA_nutdrv_qx_DEPENDENCIES)
|
||||
@rm -f nutdrv_qx$(EXEEXT)
|
||||
$(nutdrv_qx_LINK) $(nutdrv_qx_OBJECTS) $(nutdrv_qx_LDADD) $(LIBS)
|
||||
|
|
@ -1308,7 +1194,6 @@ distclean-compile:
|
|||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cps-hid.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cyberpower-mib.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/delta_ups-mib.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dstate-hal.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dstate.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dummy_ups-dummy-ups.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eaton-mib.Po@am__quote@
|
||||
|
|
@ -1317,15 +1202,6 @@ distclean-compile:
|
|||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/explore-hid.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gamatronic.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/genericups.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hald_addon_nutdrv_qx-libusb.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hald_addon_nutdrv_qx-nutdrv_qx.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hald_addon_nutdrv_qx-nutdrv_qx_blazer-common.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hald_addon_nutdrv_qx-nutdrv_qx_mecer.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hald_addon_nutdrv_qx-nutdrv_qx_megatec-old.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hald_addon_nutdrv_qx-nutdrv_qx_megatec.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hald_addon_nutdrv_qx-nutdrv_qx_mustek.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hald_addon_nutdrv_qx-nutdrv_qx_voltronic.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hald_addon_nutdrv_qx-nutdrv_qx_zinto.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hidparser.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/idowell-hid.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ietf-mib.Po@am__quote@
|
||||
|
|
@ -1337,7 +1213,6 @@ distclean-compile:
|
|||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liebert-hid.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liebert.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/macosx-ups.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/main-hal.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/main.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/masterguard.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/metasys.Po@am__quote@
|
||||
|
|
@ -1356,6 +1231,7 @@ distclean-compile:
|
|||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/netxml-ups.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nut-ipmipsu.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nut-libfreeipmi.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nutdrv_atcl_usb.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nutdrv_qx-libusb.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nutdrv_qx-nutdrv_qx.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nutdrv_qx-nutdrv_qx_blazer-common.Po@am__quote@
|
||||
|
|
@ -1363,6 +1239,8 @@ distclean-compile:
|
|||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nutdrv_qx-nutdrv_qx_megatec-old.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nutdrv_qx-nutdrv_qx_megatec.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nutdrv_qx-nutdrv_qx_mustek.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nutdrv_qx-nutdrv_qx_q1.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nutdrv_qx-nutdrv_qx_voltronic-qs.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nutdrv_qx-nutdrv_qx_voltronic.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nutdrv_qx-nutdrv_qx_zinto.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nutdrv_qx-usb-common.Po@am__quote@
|
||||
|
|
@ -1396,6 +1274,7 @@ distclean-compile:
|
|||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/usb-common.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/usbhid-ups.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/victronups.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xppc-mib.Po@am__quote@
|
||||
|
||||
.c.o:
|
||||
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
|
||||
|
|
@ -1446,132 +1325,6 @@ dummy_ups-dummy-ups.obj: dummy-ups.c
|
|||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(dummy_ups_CFLAGS) $(CFLAGS) -c -o dummy_ups-dummy-ups.obj `if test -f 'dummy-ups.c'; then $(CYGPATH_W) 'dummy-ups.c'; else $(CYGPATH_W) '$(srcdir)/dummy-ups.c'; fi`
|
||||
|
||||
hald_addon_nutdrv_qx-nutdrv_qx.o: nutdrv_qx.c
|
||||
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(hald_addon_nutdrv_qx_CFLAGS) $(CFLAGS) -MT hald_addon_nutdrv_qx-nutdrv_qx.o -MD -MP -MF $(DEPDIR)/hald_addon_nutdrv_qx-nutdrv_qx.Tpo -c -o hald_addon_nutdrv_qx-nutdrv_qx.o `test -f 'nutdrv_qx.c' || echo '$(srcdir)/'`nutdrv_qx.c
|
||||
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/hald_addon_nutdrv_qx-nutdrv_qx.Tpo $(DEPDIR)/hald_addon_nutdrv_qx-nutdrv_qx.Po
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nutdrv_qx.c' object='hald_addon_nutdrv_qx-nutdrv_qx.o' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(hald_addon_nutdrv_qx_CFLAGS) $(CFLAGS) -c -o hald_addon_nutdrv_qx-nutdrv_qx.o `test -f 'nutdrv_qx.c' || echo '$(srcdir)/'`nutdrv_qx.c
|
||||
|
||||
hald_addon_nutdrv_qx-nutdrv_qx.obj: nutdrv_qx.c
|
||||
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(hald_addon_nutdrv_qx_CFLAGS) $(CFLAGS) -MT hald_addon_nutdrv_qx-nutdrv_qx.obj -MD -MP -MF $(DEPDIR)/hald_addon_nutdrv_qx-nutdrv_qx.Tpo -c -o hald_addon_nutdrv_qx-nutdrv_qx.obj `if test -f 'nutdrv_qx.c'; then $(CYGPATH_W) 'nutdrv_qx.c'; else $(CYGPATH_W) '$(srcdir)/nutdrv_qx.c'; fi`
|
||||
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/hald_addon_nutdrv_qx-nutdrv_qx.Tpo $(DEPDIR)/hald_addon_nutdrv_qx-nutdrv_qx.Po
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nutdrv_qx.c' object='hald_addon_nutdrv_qx-nutdrv_qx.obj' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(hald_addon_nutdrv_qx_CFLAGS) $(CFLAGS) -c -o hald_addon_nutdrv_qx-nutdrv_qx.obj `if test -f 'nutdrv_qx.c'; then $(CYGPATH_W) 'nutdrv_qx.c'; else $(CYGPATH_W) '$(srcdir)/nutdrv_qx.c'; fi`
|
||||
|
||||
hald_addon_nutdrv_qx-libusb.o: libusb.c
|
||||
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(hald_addon_nutdrv_qx_CFLAGS) $(CFLAGS) -MT hald_addon_nutdrv_qx-libusb.o -MD -MP -MF $(DEPDIR)/hald_addon_nutdrv_qx-libusb.Tpo -c -o hald_addon_nutdrv_qx-libusb.o `test -f 'libusb.c' || echo '$(srcdir)/'`libusb.c
|
||||
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/hald_addon_nutdrv_qx-libusb.Tpo $(DEPDIR)/hald_addon_nutdrv_qx-libusb.Po
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libusb.c' object='hald_addon_nutdrv_qx-libusb.o' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(hald_addon_nutdrv_qx_CFLAGS) $(CFLAGS) -c -o hald_addon_nutdrv_qx-libusb.o `test -f 'libusb.c' || echo '$(srcdir)/'`libusb.c
|
||||
|
||||
hald_addon_nutdrv_qx-libusb.obj: libusb.c
|
||||
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(hald_addon_nutdrv_qx_CFLAGS) $(CFLAGS) -MT hald_addon_nutdrv_qx-libusb.obj -MD -MP -MF $(DEPDIR)/hald_addon_nutdrv_qx-libusb.Tpo -c -o hald_addon_nutdrv_qx-libusb.obj `if test -f 'libusb.c'; then $(CYGPATH_W) 'libusb.c'; else $(CYGPATH_W) '$(srcdir)/libusb.c'; fi`
|
||||
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/hald_addon_nutdrv_qx-libusb.Tpo $(DEPDIR)/hald_addon_nutdrv_qx-libusb.Po
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libusb.c' object='hald_addon_nutdrv_qx-libusb.obj' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(hald_addon_nutdrv_qx_CFLAGS) $(CFLAGS) -c -o hald_addon_nutdrv_qx-libusb.obj `if test -f 'libusb.c'; then $(CYGPATH_W) 'libusb.c'; else $(CYGPATH_W) '$(srcdir)/libusb.c'; fi`
|
||||
|
||||
hald_addon_nutdrv_qx-nutdrv_qx_blazer-common.o: nutdrv_qx_blazer-common.c
|
||||
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(hald_addon_nutdrv_qx_CFLAGS) $(CFLAGS) -MT hald_addon_nutdrv_qx-nutdrv_qx_blazer-common.o -MD -MP -MF $(DEPDIR)/hald_addon_nutdrv_qx-nutdrv_qx_blazer-common.Tpo -c -o hald_addon_nutdrv_qx-nutdrv_qx_blazer-common.o `test -f 'nutdrv_qx_blazer-common.c' || echo '$(srcdir)/'`nutdrv_qx_blazer-common.c
|
||||
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/hald_addon_nutdrv_qx-nutdrv_qx_blazer-common.Tpo $(DEPDIR)/hald_addon_nutdrv_qx-nutdrv_qx_blazer-common.Po
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nutdrv_qx_blazer-common.c' object='hald_addon_nutdrv_qx-nutdrv_qx_blazer-common.o' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(hald_addon_nutdrv_qx_CFLAGS) $(CFLAGS) -c -o hald_addon_nutdrv_qx-nutdrv_qx_blazer-common.o `test -f 'nutdrv_qx_blazer-common.c' || echo '$(srcdir)/'`nutdrv_qx_blazer-common.c
|
||||
|
||||
hald_addon_nutdrv_qx-nutdrv_qx_blazer-common.obj: nutdrv_qx_blazer-common.c
|
||||
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(hald_addon_nutdrv_qx_CFLAGS) $(CFLAGS) -MT hald_addon_nutdrv_qx-nutdrv_qx_blazer-common.obj -MD -MP -MF $(DEPDIR)/hald_addon_nutdrv_qx-nutdrv_qx_blazer-common.Tpo -c -o hald_addon_nutdrv_qx-nutdrv_qx_blazer-common.obj `if test -f 'nutdrv_qx_blazer-common.c'; then $(CYGPATH_W) 'nutdrv_qx_blazer-common.c'; else $(CYGPATH_W) '$(srcdir)/nutdrv_qx_blazer-common.c'; fi`
|
||||
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/hald_addon_nutdrv_qx-nutdrv_qx_blazer-common.Tpo $(DEPDIR)/hald_addon_nutdrv_qx-nutdrv_qx_blazer-common.Po
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nutdrv_qx_blazer-common.c' object='hald_addon_nutdrv_qx-nutdrv_qx_blazer-common.obj' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(hald_addon_nutdrv_qx_CFLAGS) $(CFLAGS) -c -o hald_addon_nutdrv_qx-nutdrv_qx_blazer-common.obj `if test -f 'nutdrv_qx_blazer-common.c'; then $(CYGPATH_W) 'nutdrv_qx_blazer-common.c'; else $(CYGPATH_W) '$(srcdir)/nutdrv_qx_blazer-common.c'; fi`
|
||||
|
||||
hald_addon_nutdrv_qx-nutdrv_qx_mecer.o: nutdrv_qx_mecer.c
|
||||
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(hald_addon_nutdrv_qx_CFLAGS) $(CFLAGS) -MT hald_addon_nutdrv_qx-nutdrv_qx_mecer.o -MD -MP -MF $(DEPDIR)/hald_addon_nutdrv_qx-nutdrv_qx_mecer.Tpo -c -o hald_addon_nutdrv_qx-nutdrv_qx_mecer.o `test -f 'nutdrv_qx_mecer.c' || echo '$(srcdir)/'`nutdrv_qx_mecer.c
|
||||
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/hald_addon_nutdrv_qx-nutdrv_qx_mecer.Tpo $(DEPDIR)/hald_addon_nutdrv_qx-nutdrv_qx_mecer.Po
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nutdrv_qx_mecer.c' object='hald_addon_nutdrv_qx-nutdrv_qx_mecer.o' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(hald_addon_nutdrv_qx_CFLAGS) $(CFLAGS) -c -o hald_addon_nutdrv_qx-nutdrv_qx_mecer.o `test -f 'nutdrv_qx_mecer.c' || echo '$(srcdir)/'`nutdrv_qx_mecer.c
|
||||
|
||||
hald_addon_nutdrv_qx-nutdrv_qx_mecer.obj: nutdrv_qx_mecer.c
|
||||
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(hald_addon_nutdrv_qx_CFLAGS) $(CFLAGS) -MT hald_addon_nutdrv_qx-nutdrv_qx_mecer.obj -MD -MP -MF $(DEPDIR)/hald_addon_nutdrv_qx-nutdrv_qx_mecer.Tpo -c -o hald_addon_nutdrv_qx-nutdrv_qx_mecer.obj `if test -f 'nutdrv_qx_mecer.c'; then $(CYGPATH_W) 'nutdrv_qx_mecer.c'; else $(CYGPATH_W) '$(srcdir)/nutdrv_qx_mecer.c'; fi`
|
||||
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/hald_addon_nutdrv_qx-nutdrv_qx_mecer.Tpo $(DEPDIR)/hald_addon_nutdrv_qx-nutdrv_qx_mecer.Po
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nutdrv_qx_mecer.c' object='hald_addon_nutdrv_qx-nutdrv_qx_mecer.obj' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(hald_addon_nutdrv_qx_CFLAGS) $(CFLAGS) -c -o hald_addon_nutdrv_qx-nutdrv_qx_mecer.obj `if test -f 'nutdrv_qx_mecer.c'; then $(CYGPATH_W) 'nutdrv_qx_mecer.c'; else $(CYGPATH_W) '$(srcdir)/nutdrv_qx_mecer.c'; fi`
|
||||
|
||||
hald_addon_nutdrv_qx-nutdrv_qx_megatec.o: nutdrv_qx_megatec.c
|
||||
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(hald_addon_nutdrv_qx_CFLAGS) $(CFLAGS) -MT hald_addon_nutdrv_qx-nutdrv_qx_megatec.o -MD -MP -MF $(DEPDIR)/hald_addon_nutdrv_qx-nutdrv_qx_megatec.Tpo -c -o hald_addon_nutdrv_qx-nutdrv_qx_megatec.o `test -f 'nutdrv_qx_megatec.c' || echo '$(srcdir)/'`nutdrv_qx_megatec.c
|
||||
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/hald_addon_nutdrv_qx-nutdrv_qx_megatec.Tpo $(DEPDIR)/hald_addon_nutdrv_qx-nutdrv_qx_megatec.Po
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nutdrv_qx_megatec.c' object='hald_addon_nutdrv_qx-nutdrv_qx_megatec.o' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(hald_addon_nutdrv_qx_CFLAGS) $(CFLAGS) -c -o hald_addon_nutdrv_qx-nutdrv_qx_megatec.o `test -f 'nutdrv_qx_megatec.c' || echo '$(srcdir)/'`nutdrv_qx_megatec.c
|
||||
|
||||
hald_addon_nutdrv_qx-nutdrv_qx_megatec.obj: nutdrv_qx_megatec.c
|
||||
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(hald_addon_nutdrv_qx_CFLAGS) $(CFLAGS) -MT hald_addon_nutdrv_qx-nutdrv_qx_megatec.obj -MD -MP -MF $(DEPDIR)/hald_addon_nutdrv_qx-nutdrv_qx_megatec.Tpo -c -o hald_addon_nutdrv_qx-nutdrv_qx_megatec.obj `if test -f 'nutdrv_qx_megatec.c'; then $(CYGPATH_W) 'nutdrv_qx_megatec.c'; else $(CYGPATH_W) '$(srcdir)/nutdrv_qx_megatec.c'; fi`
|
||||
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/hald_addon_nutdrv_qx-nutdrv_qx_megatec.Tpo $(DEPDIR)/hald_addon_nutdrv_qx-nutdrv_qx_megatec.Po
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nutdrv_qx_megatec.c' object='hald_addon_nutdrv_qx-nutdrv_qx_megatec.obj' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(hald_addon_nutdrv_qx_CFLAGS) $(CFLAGS) -c -o hald_addon_nutdrv_qx-nutdrv_qx_megatec.obj `if test -f 'nutdrv_qx_megatec.c'; then $(CYGPATH_W) 'nutdrv_qx_megatec.c'; else $(CYGPATH_W) '$(srcdir)/nutdrv_qx_megatec.c'; fi`
|
||||
|
||||
hald_addon_nutdrv_qx-nutdrv_qx_megatec-old.o: nutdrv_qx_megatec-old.c
|
||||
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(hald_addon_nutdrv_qx_CFLAGS) $(CFLAGS) -MT hald_addon_nutdrv_qx-nutdrv_qx_megatec-old.o -MD -MP -MF $(DEPDIR)/hald_addon_nutdrv_qx-nutdrv_qx_megatec-old.Tpo -c -o hald_addon_nutdrv_qx-nutdrv_qx_megatec-old.o `test -f 'nutdrv_qx_megatec-old.c' || echo '$(srcdir)/'`nutdrv_qx_megatec-old.c
|
||||
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/hald_addon_nutdrv_qx-nutdrv_qx_megatec-old.Tpo $(DEPDIR)/hald_addon_nutdrv_qx-nutdrv_qx_megatec-old.Po
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nutdrv_qx_megatec-old.c' object='hald_addon_nutdrv_qx-nutdrv_qx_megatec-old.o' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(hald_addon_nutdrv_qx_CFLAGS) $(CFLAGS) -c -o hald_addon_nutdrv_qx-nutdrv_qx_megatec-old.o `test -f 'nutdrv_qx_megatec-old.c' || echo '$(srcdir)/'`nutdrv_qx_megatec-old.c
|
||||
|
||||
hald_addon_nutdrv_qx-nutdrv_qx_megatec-old.obj: nutdrv_qx_megatec-old.c
|
||||
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(hald_addon_nutdrv_qx_CFLAGS) $(CFLAGS) -MT hald_addon_nutdrv_qx-nutdrv_qx_megatec-old.obj -MD -MP -MF $(DEPDIR)/hald_addon_nutdrv_qx-nutdrv_qx_megatec-old.Tpo -c -o hald_addon_nutdrv_qx-nutdrv_qx_megatec-old.obj `if test -f 'nutdrv_qx_megatec-old.c'; then $(CYGPATH_W) 'nutdrv_qx_megatec-old.c'; else $(CYGPATH_W) '$(srcdir)/nutdrv_qx_megatec-old.c'; fi`
|
||||
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/hald_addon_nutdrv_qx-nutdrv_qx_megatec-old.Tpo $(DEPDIR)/hald_addon_nutdrv_qx-nutdrv_qx_megatec-old.Po
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nutdrv_qx_megatec-old.c' object='hald_addon_nutdrv_qx-nutdrv_qx_megatec-old.obj' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(hald_addon_nutdrv_qx_CFLAGS) $(CFLAGS) -c -o hald_addon_nutdrv_qx-nutdrv_qx_megatec-old.obj `if test -f 'nutdrv_qx_megatec-old.c'; then $(CYGPATH_W) 'nutdrv_qx_megatec-old.c'; else $(CYGPATH_W) '$(srcdir)/nutdrv_qx_megatec-old.c'; fi`
|
||||
|
||||
hald_addon_nutdrv_qx-nutdrv_qx_mustek.o: nutdrv_qx_mustek.c
|
||||
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(hald_addon_nutdrv_qx_CFLAGS) $(CFLAGS) -MT hald_addon_nutdrv_qx-nutdrv_qx_mustek.o -MD -MP -MF $(DEPDIR)/hald_addon_nutdrv_qx-nutdrv_qx_mustek.Tpo -c -o hald_addon_nutdrv_qx-nutdrv_qx_mustek.o `test -f 'nutdrv_qx_mustek.c' || echo '$(srcdir)/'`nutdrv_qx_mustek.c
|
||||
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/hald_addon_nutdrv_qx-nutdrv_qx_mustek.Tpo $(DEPDIR)/hald_addon_nutdrv_qx-nutdrv_qx_mustek.Po
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nutdrv_qx_mustek.c' object='hald_addon_nutdrv_qx-nutdrv_qx_mustek.o' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(hald_addon_nutdrv_qx_CFLAGS) $(CFLAGS) -c -o hald_addon_nutdrv_qx-nutdrv_qx_mustek.o `test -f 'nutdrv_qx_mustek.c' || echo '$(srcdir)/'`nutdrv_qx_mustek.c
|
||||
|
||||
hald_addon_nutdrv_qx-nutdrv_qx_mustek.obj: nutdrv_qx_mustek.c
|
||||
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(hald_addon_nutdrv_qx_CFLAGS) $(CFLAGS) -MT hald_addon_nutdrv_qx-nutdrv_qx_mustek.obj -MD -MP -MF $(DEPDIR)/hald_addon_nutdrv_qx-nutdrv_qx_mustek.Tpo -c -o hald_addon_nutdrv_qx-nutdrv_qx_mustek.obj `if test -f 'nutdrv_qx_mustek.c'; then $(CYGPATH_W) 'nutdrv_qx_mustek.c'; else $(CYGPATH_W) '$(srcdir)/nutdrv_qx_mustek.c'; fi`
|
||||
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/hald_addon_nutdrv_qx-nutdrv_qx_mustek.Tpo $(DEPDIR)/hald_addon_nutdrv_qx-nutdrv_qx_mustek.Po
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nutdrv_qx_mustek.c' object='hald_addon_nutdrv_qx-nutdrv_qx_mustek.obj' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(hald_addon_nutdrv_qx_CFLAGS) $(CFLAGS) -c -o hald_addon_nutdrv_qx-nutdrv_qx_mustek.obj `if test -f 'nutdrv_qx_mustek.c'; then $(CYGPATH_W) 'nutdrv_qx_mustek.c'; else $(CYGPATH_W) '$(srcdir)/nutdrv_qx_mustek.c'; fi`
|
||||
|
||||
hald_addon_nutdrv_qx-nutdrv_qx_voltronic.o: nutdrv_qx_voltronic.c
|
||||
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(hald_addon_nutdrv_qx_CFLAGS) $(CFLAGS) -MT hald_addon_nutdrv_qx-nutdrv_qx_voltronic.o -MD -MP -MF $(DEPDIR)/hald_addon_nutdrv_qx-nutdrv_qx_voltronic.Tpo -c -o hald_addon_nutdrv_qx-nutdrv_qx_voltronic.o `test -f 'nutdrv_qx_voltronic.c' || echo '$(srcdir)/'`nutdrv_qx_voltronic.c
|
||||
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/hald_addon_nutdrv_qx-nutdrv_qx_voltronic.Tpo $(DEPDIR)/hald_addon_nutdrv_qx-nutdrv_qx_voltronic.Po
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nutdrv_qx_voltronic.c' object='hald_addon_nutdrv_qx-nutdrv_qx_voltronic.o' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(hald_addon_nutdrv_qx_CFLAGS) $(CFLAGS) -c -o hald_addon_nutdrv_qx-nutdrv_qx_voltronic.o `test -f 'nutdrv_qx_voltronic.c' || echo '$(srcdir)/'`nutdrv_qx_voltronic.c
|
||||
|
||||
hald_addon_nutdrv_qx-nutdrv_qx_voltronic.obj: nutdrv_qx_voltronic.c
|
||||
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(hald_addon_nutdrv_qx_CFLAGS) $(CFLAGS) -MT hald_addon_nutdrv_qx-nutdrv_qx_voltronic.obj -MD -MP -MF $(DEPDIR)/hald_addon_nutdrv_qx-nutdrv_qx_voltronic.Tpo -c -o hald_addon_nutdrv_qx-nutdrv_qx_voltronic.obj `if test -f 'nutdrv_qx_voltronic.c'; then $(CYGPATH_W) 'nutdrv_qx_voltronic.c'; else $(CYGPATH_W) '$(srcdir)/nutdrv_qx_voltronic.c'; fi`
|
||||
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/hald_addon_nutdrv_qx-nutdrv_qx_voltronic.Tpo $(DEPDIR)/hald_addon_nutdrv_qx-nutdrv_qx_voltronic.Po
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nutdrv_qx_voltronic.c' object='hald_addon_nutdrv_qx-nutdrv_qx_voltronic.obj' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(hald_addon_nutdrv_qx_CFLAGS) $(CFLAGS) -c -o hald_addon_nutdrv_qx-nutdrv_qx_voltronic.obj `if test -f 'nutdrv_qx_voltronic.c'; then $(CYGPATH_W) 'nutdrv_qx_voltronic.c'; else $(CYGPATH_W) '$(srcdir)/nutdrv_qx_voltronic.c'; fi`
|
||||
|
||||
hald_addon_nutdrv_qx-nutdrv_qx_zinto.o: nutdrv_qx_zinto.c
|
||||
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(hald_addon_nutdrv_qx_CFLAGS) $(CFLAGS) -MT hald_addon_nutdrv_qx-nutdrv_qx_zinto.o -MD -MP -MF $(DEPDIR)/hald_addon_nutdrv_qx-nutdrv_qx_zinto.Tpo -c -o hald_addon_nutdrv_qx-nutdrv_qx_zinto.o `test -f 'nutdrv_qx_zinto.c' || echo '$(srcdir)/'`nutdrv_qx_zinto.c
|
||||
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/hald_addon_nutdrv_qx-nutdrv_qx_zinto.Tpo $(DEPDIR)/hald_addon_nutdrv_qx-nutdrv_qx_zinto.Po
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nutdrv_qx_zinto.c' object='hald_addon_nutdrv_qx-nutdrv_qx_zinto.o' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(hald_addon_nutdrv_qx_CFLAGS) $(CFLAGS) -c -o hald_addon_nutdrv_qx-nutdrv_qx_zinto.o `test -f 'nutdrv_qx_zinto.c' || echo '$(srcdir)/'`nutdrv_qx_zinto.c
|
||||
|
||||
hald_addon_nutdrv_qx-nutdrv_qx_zinto.obj: nutdrv_qx_zinto.c
|
||||
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(hald_addon_nutdrv_qx_CFLAGS) $(CFLAGS) -MT hald_addon_nutdrv_qx-nutdrv_qx_zinto.obj -MD -MP -MF $(DEPDIR)/hald_addon_nutdrv_qx-nutdrv_qx_zinto.Tpo -c -o hald_addon_nutdrv_qx-nutdrv_qx_zinto.obj `if test -f 'nutdrv_qx_zinto.c'; then $(CYGPATH_W) 'nutdrv_qx_zinto.c'; else $(CYGPATH_W) '$(srcdir)/nutdrv_qx_zinto.c'; fi`
|
||||
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/hald_addon_nutdrv_qx-nutdrv_qx_zinto.Tpo $(DEPDIR)/hald_addon_nutdrv_qx-nutdrv_qx_zinto.Po
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nutdrv_qx_zinto.c' object='hald_addon_nutdrv_qx-nutdrv_qx_zinto.obj' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(hald_addon_nutdrv_qx_CFLAGS) $(CFLAGS) -c -o hald_addon_nutdrv_qx-nutdrv_qx_zinto.obj `if test -f 'nutdrv_qx_zinto.c'; then $(CYGPATH_W) 'nutdrv_qx_zinto.c'; else $(CYGPATH_W) '$(srcdir)/nutdrv_qx_zinto.c'; fi`
|
||||
|
||||
mge_shut-usbhid-ups.o: usbhid-ups.c
|
||||
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mge_shut_CFLAGS) $(CFLAGS) -MT mge_shut-usbhid-ups.o -MD -MP -MF $(DEPDIR)/mge_shut-usbhid-ups.Tpo -c -o mge_shut-usbhid-ups.o `test -f 'usbhid-ups.c' || echo '$(srcdir)/'`usbhid-ups.c
|
||||
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/mge_shut-usbhid-ups.Tpo $(DEPDIR)/mge_shut-usbhid-ups.Po
|
||||
|
|
@ -1754,6 +1507,20 @@ nutdrv_qx-nutdrv_qx_mustek.obj: nutdrv_qx_mustek.c
|
|||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nutdrv_qx_CFLAGS) $(CFLAGS) -c -o nutdrv_qx-nutdrv_qx_mustek.obj `if test -f 'nutdrv_qx_mustek.c'; then $(CYGPATH_W) 'nutdrv_qx_mustek.c'; else $(CYGPATH_W) '$(srcdir)/nutdrv_qx_mustek.c'; fi`
|
||||
|
||||
nutdrv_qx-nutdrv_qx_q1.o: nutdrv_qx_q1.c
|
||||
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nutdrv_qx_CFLAGS) $(CFLAGS) -MT nutdrv_qx-nutdrv_qx_q1.o -MD -MP -MF $(DEPDIR)/nutdrv_qx-nutdrv_qx_q1.Tpo -c -o nutdrv_qx-nutdrv_qx_q1.o `test -f 'nutdrv_qx_q1.c' || echo '$(srcdir)/'`nutdrv_qx_q1.c
|
||||
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/nutdrv_qx-nutdrv_qx_q1.Tpo $(DEPDIR)/nutdrv_qx-nutdrv_qx_q1.Po
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nutdrv_qx_q1.c' object='nutdrv_qx-nutdrv_qx_q1.o' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nutdrv_qx_CFLAGS) $(CFLAGS) -c -o nutdrv_qx-nutdrv_qx_q1.o `test -f 'nutdrv_qx_q1.c' || echo '$(srcdir)/'`nutdrv_qx_q1.c
|
||||
|
||||
nutdrv_qx-nutdrv_qx_q1.obj: nutdrv_qx_q1.c
|
||||
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nutdrv_qx_CFLAGS) $(CFLAGS) -MT nutdrv_qx-nutdrv_qx_q1.obj -MD -MP -MF $(DEPDIR)/nutdrv_qx-nutdrv_qx_q1.Tpo -c -o nutdrv_qx-nutdrv_qx_q1.obj `if test -f 'nutdrv_qx_q1.c'; then $(CYGPATH_W) 'nutdrv_qx_q1.c'; else $(CYGPATH_W) '$(srcdir)/nutdrv_qx_q1.c'; fi`
|
||||
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/nutdrv_qx-nutdrv_qx_q1.Tpo $(DEPDIR)/nutdrv_qx-nutdrv_qx_q1.Po
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nutdrv_qx_q1.c' object='nutdrv_qx-nutdrv_qx_q1.obj' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nutdrv_qx_CFLAGS) $(CFLAGS) -c -o nutdrv_qx-nutdrv_qx_q1.obj `if test -f 'nutdrv_qx_q1.c'; then $(CYGPATH_W) 'nutdrv_qx_q1.c'; else $(CYGPATH_W) '$(srcdir)/nutdrv_qx_q1.c'; fi`
|
||||
|
||||
nutdrv_qx-nutdrv_qx_voltronic.o: nutdrv_qx_voltronic.c
|
||||
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nutdrv_qx_CFLAGS) $(CFLAGS) -MT nutdrv_qx-nutdrv_qx_voltronic.o -MD -MP -MF $(DEPDIR)/nutdrv_qx-nutdrv_qx_voltronic.Tpo -c -o nutdrv_qx-nutdrv_qx_voltronic.o `test -f 'nutdrv_qx_voltronic.c' || echo '$(srcdir)/'`nutdrv_qx_voltronic.c
|
||||
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/nutdrv_qx-nutdrv_qx_voltronic.Tpo $(DEPDIR)/nutdrv_qx-nutdrv_qx_voltronic.Po
|
||||
|
|
@ -1768,6 +1535,20 @@ nutdrv_qx-nutdrv_qx_voltronic.obj: nutdrv_qx_voltronic.c
|
|||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nutdrv_qx_CFLAGS) $(CFLAGS) -c -o nutdrv_qx-nutdrv_qx_voltronic.obj `if test -f 'nutdrv_qx_voltronic.c'; then $(CYGPATH_W) 'nutdrv_qx_voltronic.c'; else $(CYGPATH_W) '$(srcdir)/nutdrv_qx_voltronic.c'; fi`
|
||||
|
||||
nutdrv_qx-nutdrv_qx_voltronic-qs.o: nutdrv_qx_voltronic-qs.c
|
||||
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nutdrv_qx_CFLAGS) $(CFLAGS) -MT nutdrv_qx-nutdrv_qx_voltronic-qs.o -MD -MP -MF $(DEPDIR)/nutdrv_qx-nutdrv_qx_voltronic-qs.Tpo -c -o nutdrv_qx-nutdrv_qx_voltronic-qs.o `test -f 'nutdrv_qx_voltronic-qs.c' || echo '$(srcdir)/'`nutdrv_qx_voltronic-qs.c
|
||||
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/nutdrv_qx-nutdrv_qx_voltronic-qs.Tpo $(DEPDIR)/nutdrv_qx-nutdrv_qx_voltronic-qs.Po
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nutdrv_qx_voltronic-qs.c' object='nutdrv_qx-nutdrv_qx_voltronic-qs.o' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nutdrv_qx_CFLAGS) $(CFLAGS) -c -o nutdrv_qx-nutdrv_qx_voltronic-qs.o `test -f 'nutdrv_qx_voltronic-qs.c' || echo '$(srcdir)/'`nutdrv_qx_voltronic-qs.c
|
||||
|
||||
nutdrv_qx-nutdrv_qx_voltronic-qs.obj: nutdrv_qx_voltronic-qs.c
|
||||
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nutdrv_qx_CFLAGS) $(CFLAGS) -MT nutdrv_qx-nutdrv_qx_voltronic-qs.obj -MD -MP -MF $(DEPDIR)/nutdrv_qx-nutdrv_qx_voltronic-qs.Tpo -c -o nutdrv_qx-nutdrv_qx_voltronic-qs.obj `if test -f 'nutdrv_qx_voltronic-qs.c'; then $(CYGPATH_W) 'nutdrv_qx_voltronic-qs.c'; else $(CYGPATH_W) '$(srcdir)/nutdrv_qx_voltronic-qs.c'; fi`
|
||||
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/nutdrv_qx-nutdrv_qx_voltronic-qs.Tpo $(DEPDIR)/nutdrv_qx-nutdrv_qx_voltronic-qs.Po
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nutdrv_qx_voltronic-qs.c' object='nutdrv_qx-nutdrv_qx_voltronic-qs.obj' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nutdrv_qx_CFLAGS) $(CFLAGS) -c -o nutdrv_qx-nutdrv_qx_voltronic-qs.obj `if test -f 'nutdrv_qx_voltronic-qs.c'; then $(CYGPATH_W) 'nutdrv_qx_voltronic-qs.c'; else $(CYGPATH_W) '$(srcdir)/nutdrv_qx_voltronic-qs.c'; fi`
|
||||
|
||||
nutdrv_qx-nutdrv_qx_zinto.o: nutdrv_qx_zinto.c
|
||||
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nutdrv_qx_CFLAGS) $(CFLAGS) -MT nutdrv_qx-nutdrv_qx_zinto.o -MD -MP -MF $(DEPDIR)/nutdrv_qx-nutdrv_qx_zinto.Tpo -c -o nutdrv_qx-nutdrv_qx_zinto.o `test -f 'nutdrv_qx_zinto.c' || echo '$(srcdir)/'`nutdrv_qx_zinto.c
|
||||
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/nutdrv_qx-nutdrv_qx_zinto.Tpo $(DEPDIR)/nutdrv_qx-nutdrv_qx_zinto.Po
|
||||
|
|
@ -1874,7 +1655,7 @@ check-am: all-am
|
|||
check: check-am
|
||||
all-am: Makefile $(PROGRAMS) $(HEADERS)
|
||||
installdirs:
|
||||
for dir in "$(DESTDIR)$(driverexecdir)" "$(DESTDIR)$(halexecdir)"; do \
|
||||
for dir in "$(DESTDIR)$(driverexecdir)" "$(DESTDIR)$(sbindir)"; do \
|
||||
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
|
||||
done
|
||||
install: install-am
|
||||
|
|
@ -1897,7 +1678,6 @@ install-strip:
|
|||
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
|
||||
fi
|
||||
mostlyclean-generic:
|
||||
-test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
|
||||
|
||||
clean-generic:
|
||||
|
||||
|
|
@ -1910,8 +1690,8 @@ maintainer-clean-generic:
|
|||
@echo "it deletes files that may require special tools to rebuild."
|
||||
clean: clean-am
|
||||
|
||||
clean-am: clean-driverexecPROGRAMS clean-generic clean-halexecPROGRAMS \
|
||||
clean-libtool mostlyclean-am
|
||||
clean-am: clean-driverexecPROGRAMS clean-generic clean-libtool \
|
||||
clean-sbinPROGRAMS mostlyclean-am
|
||||
|
||||
distclean: distclean-am
|
||||
-rm -rf ./$(DEPDIR)
|
||||
|
|
@ -1937,7 +1717,7 @@ install-dvi: install-dvi-am
|
|||
|
||||
install-dvi-am:
|
||||
|
||||
install-exec-am: install-driverexecPROGRAMS install-halexecPROGRAMS
|
||||
install-exec-am: install-driverexecPROGRAMS install-sbinPROGRAMS
|
||||
|
||||
install-html: install-html-am
|
||||
|
||||
|
|
@ -1977,25 +1757,25 @@ ps: ps-am
|
|||
|
||||
ps-am:
|
||||
|
||||
uninstall-am: uninstall-driverexecPROGRAMS uninstall-halexecPROGRAMS
|
||||
uninstall-am: uninstall-driverexecPROGRAMS uninstall-sbinPROGRAMS
|
||||
|
||||
.MAKE: install-am install-strip
|
||||
|
||||
.PHONY: CTAGS GTAGS all all-am check check-am clean \
|
||||
clean-driverexecPROGRAMS clean-generic clean-halexecPROGRAMS \
|
||||
clean-libtool ctags distclean distclean-compile \
|
||||
clean-driverexecPROGRAMS clean-generic clean-libtool \
|
||||
clean-sbinPROGRAMS ctags distclean distclean-compile \
|
||||
distclean-generic distclean-libtool distclean-tags distdir dvi \
|
||||
dvi-am html html-am info info-am install install-am \
|
||||
install-data install-data-am install-driverexecPROGRAMS \
|
||||
install-dvi install-dvi-am install-exec install-exec-am \
|
||||
install-halexecPROGRAMS install-html install-html-am \
|
||||
install-info install-info-am install-man install-pdf \
|
||||
install-pdf-am install-ps install-ps-am install-strip \
|
||||
installcheck installcheck-am installdirs maintainer-clean \
|
||||
install-html install-html-am install-info install-info-am \
|
||||
install-man install-pdf install-pdf-am install-ps \
|
||||
install-ps-am install-sbinPROGRAMS install-strip installcheck \
|
||||
installcheck-am installdirs maintainer-clean \
|
||||
maintainer-clean-generic mostlyclean mostlyclean-compile \
|
||||
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
|
||||
tags uninstall uninstall-am uninstall-driverexecPROGRAMS \
|
||||
uninstall-halexecPROGRAMS
|
||||
uninstall-sbinPROGRAMS
|
||||
|
||||
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ typedef uint8_t byte_t;
|
|||
|
||||
|
||||
#define DRIVER_NAME "Eltek AL175/COMLI driver"
|
||||
#define DRIVER_VERSION "0.11"
|
||||
#define DRIVER_VERSION "0.12"
|
||||
|
||||
/* driver description structure */
|
||||
upsdrv_info_t upsdrv_info = {
|
||||
|
|
@ -462,7 +462,7 @@ static int al_parse_reply_head(io_head_t *io, const raw_data_t raw_reply_head)
|
|||
const byte_t *reply_head = raw_reply_head.begin - 1;
|
||||
|
||||
if ( (raw_reply_head.end - raw_reply_head.begin) != 10) {
|
||||
upsdebugx(3, "%s: wrong size\t(%i != 10)", __func__, (raw_reply_head.end - raw_reply_head.begin));
|
||||
upsdebugx(3, "%s: wrong size\t(%i != 10)", __func__, (int)(raw_reply_head.end - raw_reply_head.begin));
|
||||
return -1; /* wrong size */
|
||||
}
|
||||
|
||||
|
|
@ -549,7 +549,7 @@ static int al_parse_reply(io_head_t *io_head, raw_data_t *io_buf, /*const*/ raw_
|
|||
|
||||
if ( (raw_reply.end - raw_reply.begin) != (ptrdiff_t)(10 + io_head->len)) {
|
||||
upsdebugx(3, "%s: corrupt sentence\t(%i != %i)",
|
||||
__func__, raw_reply.end - raw_reply.begin, 10 + io_head->len);
|
||||
__func__, (int)(raw_reply.end - raw_reply.begin), 10 + io_head->len);
|
||||
return -1; /* corrupt sentence */
|
||||
}
|
||||
|
||||
|
|
@ -597,7 +597,7 @@ static int al_check_ack(/*const*/ raw_data_t raw_ack)
|
|||
const byte_t *ack = raw_ack.begin - 1;
|
||||
|
||||
if ( (raw_ack.end - raw_ack.begin) !=5) {
|
||||
upsdebugx(3, "%s: wrong size\t(%i != 5)", __func__, raw_ack.end - raw_ack.begin);
|
||||
upsdebugx(3, "%s: wrong size\t(%i != 5)", __func__, (int)(raw_ack.end - raw_ack.begin));
|
||||
return -1; /* wrong size */
|
||||
}
|
||||
|
||||
|
|
@ -965,7 +965,8 @@ static int al175_read(byte_t *dst, unsigned addr, size_t count)
|
|||
|
||||
if ( (io.addr != addr) || (io.len != count) ) {
|
||||
upsdebugx(3, "%s: io_head mismatch\t(%x,%x != %x,%x)",
|
||||
__func__, io.addr, io.len, addr, count);
|
||||
__func__, io.addr, io.len, addr,
|
||||
(unsigned int)count);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@ static info_lkp_t apcc_pwr_info[] = {
|
|||
{ 1, "" }, /* unknown */
|
||||
{ 2, "OL" }, /* onLine */
|
||||
{ 3, "OB" }, /* onBattery */
|
||||
{ 4, "BOOST" }, /* onSmartBoost */
|
||||
{ 4, "OL BOOST" }, /* onSmartBoost */
|
||||
{ 5, "OFF" }, /* timedSleeping */
|
||||
{ 6, "OFF" }, /* softwareBypass */
|
||||
{ 7, "OFF" }, /* off */
|
||||
|
|
@ -80,7 +80,7 @@ static info_lkp_t apcc_pwr_info[] = {
|
|||
{ 9, "BYPASS" }, /* switchedBypass */
|
||||
{ 10, "BYPASS" }, /* hardwareFailureBypass */
|
||||
{ 11, "OFF" }, /* sleepingUntilPowerReturn */
|
||||
{ 12, "TRIM" }, /* onSmartTrim */
|
||||
{ 12, "OL TRIM" }, /* onSmartTrim */
|
||||
{ 0, "NULL" }
|
||||
} ;
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
* Copyright (C)
|
||||
* 2003 - 2008 Arnaud Quette <arnaud.quette@free.fr>
|
||||
* 2005 Peter Selinger <selinger@users.sourceforge.net>
|
||||
* 2011 Charles Lepple <clepple+nut@gmail>
|
||||
* 2011, 2014 Charles Lepple <clepple+nut@gmail>
|
||||
*
|
||||
* Sponsored by MGE UPS SYSTEMS <http://www.mgeups.com>
|
||||
*
|
||||
|
|
@ -29,7 +29,7 @@
|
|||
#include "belkin-hid.h"
|
||||
#include "usb-common.h"
|
||||
|
||||
#define BELKIN_HID_VERSION "Belkin HID 0.15"
|
||||
#define BELKIN_HID_VERSION "Belkin HID 0.16"
|
||||
|
||||
/* Belkin */
|
||||
#define BELKIN_VENDORID 0x050d
|
||||
|
|
@ -65,6 +65,8 @@ static usb_device_id_t belkin_usb_device_table[] = {
|
|||
|
||||
/* Liebert PowerSure PSA UPS */
|
||||
{ USB_DEVICE(LIEBERT_VENDORID, 0x0001), NULL },
|
||||
/* Liebert PowerSure PSI 1440 */
|
||||
{ USB_DEVICE(LIEBERT_VENDORID, 0x0004), NULL },
|
||||
|
||||
/* Terminating entry */
|
||||
{ -1, -1, NULL }
|
||||
|
|
|
|||
|
|
@ -100,7 +100,7 @@ int blazer_command(const char *cmd, char *buf, size_t buflen)
|
|||
|
||||
void upsdrv_help(void)
|
||||
{
|
||||
printf("Read The Fine Manual ('man 8 blazer')\n");
|
||||
printf("Read The Fine Manual ('man 8 blazer_ser')\n");
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@
|
|||
#include "blazer.h"
|
||||
|
||||
#define DRIVER_NAME "Megatec/Q1 protocol USB driver"
|
||||
#define DRIVER_VERSION "0.10"
|
||||
#define DRIVER_VERSION "0.11"
|
||||
|
||||
/* driver description structure */
|
||||
upsdrv_info_t upsdrv_info = {
|
||||
|
|
@ -176,7 +176,7 @@ static int phoenix_command(const char *cmd, char *buf, size_t buflen)
|
|||
static int ippon_command(const char *cmd, char *buf, size_t buflen)
|
||||
{
|
||||
char tmp[64];
|
||||
int ret;
|
||||
int ret, len;
|
||||
size_t i;
|
||||
|
||||
snprintf(tmp, sizeof(tmp), "%s", cmd);
|
||||
|
|
@ -207,10 +207,19 @@ static int ippon_command(const char *cmd, char *buf, size_t buflen)
|
|||
return ret;
|
||||
}
|
||||
|
||||
snprintf(buf, buflen, "%.*s", ret, tmp);
|
||||
|
||||
upsdebugx(3, "read: %.*s", (int)strcspn(buf, "\r"), buf);
|
||||
return ret;
|
||||
/*
|
||||
* As Ippon will always return 64 bytes in response, we have to
|
||||
* calculate and return length of actual response data here.
|
||||
* Empty response will look like 0x00 0x0D, otherwise it will be
|
||||
* data string terminated by 0x0D.
|
||||
*/
|
||||
len = (int)strcspn(tmp, "\r");
|
||||
upsdebugx(3, "read: %.*s", len, tmp);
|
||||
if (len > 0) {
|
||||
len ++;
|
||||
}
|
||||
snprintf(buf, buflen, "%.*s", len, tmp);
|
||||
return len;
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -443,7 +452,9 @@ int blazer_command(const char *cmd, char *buf, size_t buflen)
|
|||
|
||||
case -ETIMEDOUT: /* Connection timed out */
|
||||
case -EOVERFLOW: /* Value too large for defined data type */
|
||||
#ifdef EPROTO
|
||||
case -EPROTO: /* Protocol error */
|
||||
#endif
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
|
@ -480,7 +491,7 @@ int blazer_command(const char *cmd, char *buf, size_t buflen)
|
|||
|
||||
void upsdrv_help(void)
|
||||
{
|
||||
printf("Read The Fine Manual ('man 8 blazer')\n");
|
||||
printf("Read The Fine Manual ('man 8 blazer_usb')\n");
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -585,7 +596,7 @@ void upsdrv_initups(void)
|
|||
"and make sure you have an up-to-date version of NUT. If this does not help,\n"
|
||||
"try running the driver with at least 'subdriver', 'vendorid' and 'productid'\n"
|
||||
"options specified. Please refer to the man page for details about these options\n"
|
||||
"(man 8 blazer).\n");
|
||||
"(man 8 blazer_usb).\n");
|
||||
}
|
||||
|
||||
if (!subdriver_command) {
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@
|
|||
|
||||
#include "compaq-mib.h"
|
||||
|
||||
#define CPQPOWER_MIB_VERSION "1.5"
|
||||
#define CPQPOWER_MIB_VERSION "1.6"
|
||||
|
||||
#define DEFAULT_ONDELAY 30
|
||||
#define DEFAULT_OFFDELAY 20
|
||||
|
|
@ -188,9 +188,10 @@ static snmp_info_t cpqpower_mib[] = {
|
|||
{ "ups.L3.realpower", 0, 0.1, CPQPOWER_OID_OUT_POWER ".3", "", SU_OUTPUT_3, NULL },
|
||||
{ "ups.status", ST_FLAG_STRING, SU_INFOSIZE, CPQPOWER_OID_POWER_STATUS, "OFF", SU_STATUS_PWR, cpqpower_pwr_info },
|
||||
{ "ups.status", ST_FLAG_STRING, SU_INFOSIZE, CPQPOWER_OID_BATT_STATUS, "", SU_STATUS_PWR, cpqpower_battery_abm_status },
|
||||
{ "ups.status", ST_FLAG_STRING, SU_INFOSIZE, CPQPOWER_OID_ALARM_OB, "", SU_STATUS_BATT, cpqpower_alarm_ob },
|
||||
{ "ups.status", ST_FLAG_STRING, SU_INFOSIZE, CPQPOWER_OID_ALARM_LB, "", SU_STATUS_BATT, cpqpower_alarm_lb },
|
||||
/* { "ups.status", ST_FLAG_STRING, SU_INFOSIZE, IETF_OID_BATT_STATUS, "", SU_STATUS_BATT, ietf_batt_info }, */
|
||||
/* The next two lines are no longer supported by MIB ver. 1.76 (Github issue 118)
|
||||
* { "ups.status", ST_FLAG_STRING, SU_INFOSIZE, CPQPOWER_OID_ALARM_OB, "", SU_STATUS_BATT, cpqpower_alarm_ob },
|
||||
* { "ups.status", ST_FLAG_STRING, SU_INFOSIZE, CPQPOWER_OID_ALARM_LB, "", SU_STATUS_BATT, cpqpower_alarm_lb }, */
|
||||
/* { "ups.status", ST_FLAG_STRING, SU_INFOSIZE, IETF_OID_BATT_STATUS, "", SU_STATUS_BATT, ietf_batt_info }, */
|
||||
/* FIXME: this should use either .1.3.6.1.4.1.232.165.3.11.1.0 (upsTopologyType)
|
||||
* or .1.3.6.1.4.1.232.165.3.11.2.0 (upsTopoMachineCode) */
|
||||
{ "ups.type", ST_FLAG_STRING, SU_INFOSIZE, CPQPOWER_OID_POWER_STATUS, "", SU_STATUS_PWR, cpqpower_mode_info },
|
||||
|
|
|
|||
|
|
@ -1,710 +0,0 @@
|
|||
/* dstate-hal.c - Network UPS Tools driver-side state management
|
||||
This is a compatibility interface that encapsulate the HAL bridge
|
||||
into the NUT dstate API for NUT drivers
|
||||
|
||||
Copyright (C) 2006-2007 Arnaud Quette <aquette.dev@gmail.com>
|
||||
|
||||
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 <stdio.h>
|
||||
#include <stdarg.h>
|
||||
#include <sys/stat.h>
|
||||
#include <pwd.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/un.h>
|
||||
|
||||
#include "common.h"
|
||||
#include "config.h"
|
||||
#include "dstate-hal.h"
|
||||
#include "extstate.h"
|
||||
/* #include "state.h"
|
||||
#include "parseconf.h" */
|
||||
|
||||
#include <hal/libhal.h>
|
||||
|
||||
/* FIXME: export command and RW variables (using the HAL example: addon-cpufreq and macbook addon) */
|
||||
/* beeper.enable, beeper.disable => SetBeeper(bool)
|
||||
beeper.toggle => ToggleBeeper(void)
|
||||
|
||||
org.freedesktop.Hal.Device.UPS.SetSounder (bool)
|
||||
|
||||
|
||||
Shutdown() or ShutOff()
|
||||
shutdown.return
|
||||
shutdown.stayoff
|
||||
shutdown.reboot
|
||||
shutdown.reboot.graceful
|
||||
|
||||
#define UPS_ERROR_GENERAL "GeneralError"
|
||||
#define UPS_ERROR_UNSUPPORTED_FEATURE "FeatureNotSupported"
|
||||
#define UPS_ERROR_PERMISSION_DENIED "PermissionDenied"
|
||||
|
||||
****** implementation *******
|
||||
|
||||
#define DBUS_INTERFACE "org.freedesktop.Hal.Device.UPS"
|
||||
|
||||
if (!libhal_device_claim_interface(halctx, udi, DBUS_INTERFACE,
|
||||
|
||||
" <method name=\"Shutdown\">\n"
|
||||
" <arg name=\"shutdown_type\" direction=\"in\" type=\"s\"/>\n"
|
||||
" <arg name=\"return_code\" direction=\"out\" type=\"i\"/>\n"
|
||||
" </method>\n"
|
||||
|
||||
&dbus_dbus_error)) {
|
||||
fprintf(stderr, "Cannot claim interface: %s", dbus_dbus_error.message);
|
||||
goto Error;
|
||||
}
|
||||
|
||||
|
||||
*/
|
||||
|
||||
/*
|
||||
* static int sockfd = -1, stale = 1, alarm_active = 0;
|
||||
* static struct st_tree_t *dtree_root = NULL;
|
||||
* static struct conn_t *connhead = NULL;
|
||||
* static struct cmdlist_t *cmdhead = NULL;
|
||||
* static char *sockfn = NULL;
|
||||
* static char status_buf[ST_MAX_VALUE_LEN],
|
||||
* alarm_buf[ST_MAX_VALUE_LEN];
|
||||
*/
|
||||
|
||||
struct ups_handler upsh;
|
||||
|
||||
LibHalContext *halctx = NULL;
|
||||
char *udi;
|
||||
int ac_present = 0; /* 0 = false ; 1 = true */
|
||||
extern char *dbus_methods_introspection;
|
||||
|
||||
static void* runtime_handler(LibHalChangeSet *cs, char* runtime);
|
||||
static void* level_handler(LibHalChangeSet *cs, char* critical_level);
|
||||
static void* battery_type_handler(LibHalChangeSet *cs, char* battery_type);
|
||||
|
||||
/* Structure to lookup between NUT and HAL data */
|
||||
typedef struct {
|
||||
const char *nut_name; /* NUT variable name */
|
||||
const char *hal_name; /* HAL variable name */
|
||||
int hal_type; /* HAL variable type */
|
||||
void *(*fun)(LibHalChangeSet *cs,
|
||||
char *value); /* conversion function. */
|
||||
} info_lkp_t;
|
||||
|
||||
enum hal_type_t
|
||||
{
|
||||
NONE = 0,
|
||||
HAL_TYPE_INT,
|
||||
HAL_TYPE_BOOL,
|
||||
HAL_TYPE_STRING
|
||||
};
|
||||
|
||||
/* Structure to lookup between NUT commands and HAL/DBus methods */
|
||||
typedef struct {
|
||||
char *nut_name; /* NUT command name */
|
||||
char *hal_name; /* HAL/DBus method name */
|
||||
char *xml_introspection; /* HAL/DBus method introspection */
|
||||
/* FIXME: how to lookup param values between HAL and NUT?? */
|
||||
/* void *(*fun)(LibHalChangeSet *cs,
|
||||
char *value);*/ /* NUT function */
|
||||
} method_lkp_t;
|
||||
|
||||
#if 0
|
||||
/* Data to lookup between NUT commands and HAL/DBus methods
|
||||
* for dstate_addcmd() */
|
||||
static method_lkp_t nut2hal_cmd[] =
|
||||
{
|
||||
/* ups.status is handled by status_set() calls */
|
||||
{
|
||||
"beeper.enable",
|
||||
"SetBeeper",
|
||||
" <method name=\"SetBeeper\">\n"
|
||||
" <arg name=\"beeper_mode\" direction=\"in\" type=\"b\"/>\n"
|
||||
" <arg name=\"return_code\" direction=\"out\" type=\"i\"/>\n"
|
||||
" </method>\n"
|
||||
},
|
||||
|
||||
/* Terminating element */
|
||||
{ NULL, NULL, NULL }
|
||||
};
|
||||
#endif
|
||||
|
||||
/* Data to lookup between NUT and HAL for dstate_setinfo() */
|
||||
static info_lkp_t nut2hal_info[] =
|
||||
{
|
||||
/* ups.status is handled by status_set() calls */
|
||||
{ "battery.charge.low", "battery.charge_level.low", HAL_TYPE_INT, *level_handler },
|
||||
/* { "battery.charge.low", "battery.reporting.low", HAL_TYPE_INT, NULL }, */
|
||||
{ "battery.charge.low", "battery.alarm.design", HAL_TYPE_INT, NULL },
|
||||
|
||||
{ "battery.charge", "battery.charge_level.current", HAL_TYPE_INT, NULL },
|
||||
{ "battery.charge", "battery.charge_level.percentage", HAL_TYPE_INT, NULL },
|
||||
{ "battery.charge", "battery.reporting.current", HAL_TYPE_INT, NULL },
|
||||
{ "battery.charge", "battery.reporting.percentage", HAL_TYPE_INT, NULL },
|
||||
{ "battery.runtime", "battery.remaining_time", HAL_TYPE_INT, *runtime_handler },
|
||||
/* raw version (PbAc) */
|
||||
{ "battery.type", "battery.reporting.technology", HAL_TYPE_STRING, NULL },
|
||||
/* Human readable version */
|
||||
{ "battery.type", "battery.technology", HAL_TYPE_STRING, *battery_type_handler },
|
||||
|
||||
/* AQ note: Not sure it fits! */
|
||||
/* HAL marked as mandatory! */
|
||||
{ "battery.voltage", "battery.voltage.current", HAL_TYPE_INT, NULL },
|
||||
{ "battery.voltage.nominal", "battery.voltage.design", HAL_TYPE_INT, NULL },
|
||||
|
||||
{ "ups.mfr", "battery.vendor", HAL_TYPE_STRING, NULL },
|
||||
{ "ups.model", "battery.model", HAL_TYPE_STRING, NULL },
|
||||
{ "ups.serial", "battery.serial", HAL_TYPE_STRING, NULL },
|
||||
|
||||
/* Terminating element */
|
||||
{ NULL, NULL, NONE, NULL }
|
||||
};
|
||||
|
||||
/* Functions to lookup between NUT and HAL */
|
||||
static info_lkp_t *find_nut_info(const char *nut_varname, info_lkp_t *prev_info_item);
|
||||
|
||||
/* HAL accessors wrappers */
|
||||
void hal_set_string(LibHalChangeSet *cs, const char *key, const char *value);
|
||||
void hal_set_int(LibHalChangeSet *cs, const char *key, const int value);
|
||||
void hal_set_bool(LibHalChangeSet *cs, const char *key, const dbus_bool_t value);
|
||||
int hal_get_int(const char *key);
|
||||
char *hal_get_string(const char *key);
|
||||
|
||||
/* Handle warning charge level according to the critical level */
|
||||
static void* level_handler(LibHalChangeSet *cs, char* critical_level)
|
||||
{
|
||||
/* Magic formula to generate the warning level */
|
||||
int int_critical_level = atoi(critical_level);
|
||||
/* warning level = critical + 1/3 of (100 % - critical level), approx at the leat mod 10 */
|
||||
int int_warning_level = int_critical_level + ((100 - int_critical_level) / 3);
|
||||
int_warning_level -= (int_warning_level % 10);
|
||||
|
||||
/* Set the critical level value */
|
||||
hal_set_int (cs, "battery.charge_level.low", int_critical_level);
|
||||
hal_set_int (cs, "battery.reporting.low", int_critical_level);
|
||||
|
||||
/* Set the warning level value (FIXME: set to 50 % for now) */
|
||||
hal_set_int (cs, "battery.charge_level.warning", int_warning_level);
|
||||
hal_set_int (cs, "battery.reporting.warning", int_warning_level);
|
||||
|
||||
return NULL; /* Nothing to return */
|
||||
}
|
||||
|
||||
/* Handle runtime exposition according to the AC status */
|
||||
static void* runtime_handler(LibHalChangeSet *cs, char* runtime)
|
||||
{
|
||||
if (ac_present == 0) {
|
||||
/* unSet the runtime auto computation and rely upon NUT.battery.runtime*/
|
||||
hal_set_bool (cs, "battery.remaining_time.calculate_per_time", FALSE);
|
||||
|
||||
/* Set the runtime value */
|
||||
hal_set_int (cs, "battery.remaining_time", atoi(runtime));
|
||||
}
|
||||
else {
|
||||
/* Set the runtime auto computation */
|
||||
hal_set_bool (cs, "battery.remaining_time.calculate_per_time", TRUE);
|
||||
|
||||
/* Set the runtime value */
|
||||
hal_set_int (cs, "battery.remaining_time", 0);
|
||||
}
|
||||
return NULL; /* Nothing to return */
|
||||
}
|
||||
|
||||
/* Handle the battery technology reporting */
|
||||
static void* battery_type_handler(LibHalChangeSet *cs, char* battery_type)
|
||||
{
|
||||
if (!strncmp (battery_type, "PbAc", 4)) {
|
||||
hal_set_string(cs, "battery.technology", "lead-acid");
|
||||
}
|
||||
/* FIXME: manage other types (lithium-ion, lithium-polymer,
|
||||
* nickel-metal-hydride, unknown */
|
||||
|
||||
return NULL; /* Nothing to return */
|
||||
}
|
||||
|
||||
/********************************************************************
|
||||
* dstate compatibility interface
|
||||
*******************************************************************/
|
||||
void dstate_init(const char *prog, const char *port)
|
||||
{
|
||||
DBusError dbus_error;
|
||||
LibHalChangeSet *cs;
|
||||
|
||||
dbus_error_init (&dbus_error);
|
||||
|
||||
cs = libhal_device_new_changeset (udi);
|
||||
if (cs == NULL) {
|
||||
fatalx (EXIT_FAILURE, "Cannot initialize changeset");
|
||||
}
|
||||
|
||||
/* UPS always report charge as percent */
|
||||
hal_set_string (cs, "battery.charge_level.unit", "percent");
|
||||
hal_set_string (cs, "battery.reporting.unit", "percent");
|
||||
hal_set_string (cs, "battery.alarm.unit", "percent");
|
||||
|
||||
/* Various UPSs assumptions */
|
||||
/****************************/
|
||||
/* UPS are always rechargeable! */
|
||||
/* FIXME: Check for NUT extension however: ie HID->UPS.PowerSummary.Rechargeable
|
||||
* into battery.rechargeable
|
||||
* or always expose it?
|
||||
*/
|
||||
hal_set_bool (cs, "battery.is_rechargeable", TRUE);
|
||||
|
||||
/* UPS always has a max battery charge of 100 % */
|
||||
hal_set_int (cs, "battery.charge_level.design", 100);
|
||||
hal_set_int (cs, "battery.charge_level.last_full", 100);
|
||||
hal_set_int (cs, "battery.reporting.design", 100);
|
||||
hal_set_int (cs, "battery.reporting.last_full", 100);
|
||||
|
||||
/* NUT always express Voltage in Volts "V" */
|
||||
/* But not all UPSs provide the data
|
||||
* battery.voltage.{design,current} */
|
||||
hal_set_string (cs, "battery.voltage.unit", "V");
|
||||
|
||||
/* UPS always have a battery! */
|
||||
/* Note(AQU): wrong with some solar panel usage, where the UPS */
|
||||
/* is just an energy source switch! */
|
||||
/* FIXME: to be processed (need possible NUT extension) */
|
||||
hal_set_bool (cs, "battery.present", TRUE);
|
||||
|
||||
/* FIXME: can be improved?! (implies "info.recall.vendor") */
|
||||
hal_set_bool (cs, "info.is_recalled", FALSE);
|
||||
|
||||
/* Set generic properties */
|
||||
hal_set_string (cs, "battery.type", "ups");
|
||||
libhal_device_add_capability (halctx, udi, "battery", &dbus_error);
|
||||
libhal_device_add_capability (halctx, udi, "ac_adaptor", &dbus_error);
|
||||
|
||||
/* FIXME: can be improved?! Set granularity (1 %)*/
|
||||
hal_set_int (cs, "battery.charge_level.granularity_1", 1);
|
||||
hal_set_int (cs, "battery.charge_level.granularity_2", 1);
|
||||
hal_set_int (cs, "battery.reporting.granularity_1", 1);
|
||||
hal_set_int (cs, "battery.reporting.granularity_2", 1);
|
||||
|
||||
dbus_error_init (&dbus_error);
|
||||
/* NOTE: commit_changeset won't do IPC if set is empty */
|
||||
libhal_device_commit_changeset (halctx, cs, &dbus_error);
|
||||
libhal_device_free_changeset (cs);
|
||||
|
||||
if (dbus_error_is_set (&dbus_error))
|
||||
dbus_error_free (&dbus_error);
|
||||
}
|
||||
|
||||
|
||||
const char *dstate_getinfo(const char *var)
|
||||
{
|
||||
info_lkp_t *nut2hal_info = find_nut_info(var, NULL);
|
||||
|
||||
/* FIXME: use the data exposed by NUT on the DBus when available */
|
||||
|
||||
if (nut2hal_info != NULL) {
|
||||
|
||||
switch (nut2hal_info->hal_type)
|
||||
{
|
||||
/* case HAL_TYPE_INT:
|
||||
static char value[8];
|
||||
snprintf(value, sizeof(value), "%i", hal_get_int(nut2hal_info->hal_name));
|
||||
return value;
|
||||
case HAL_TYPE_BOOL:
|
||||
hal_set_bool(cs, nut2hal_info->hal_name, TRUE);
|
||||
break;
|
||||
*/
|
||||
case HAL_TYPE_STRING:
|
||||
return hal_get_string(nut2hal_info->hal_name);
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int dstate_setinfo(const char *var, const char *fmt, ...)
|
||||
{
|
||||
va_list ap;
|
||||
int ret = 1;
|
||||
LibHalChangeSet *cs;
|
||||
DBusError dbus_error;
|
||||
char value[ST_MAX_VALUE_LEN];
|
||||
info_lkp_t *nut2hal_info = NULL, *prev_nut2hal_info = NULL;
|
||||
|
||||
va_start(ap, fmt);
|
||||
vsnprintf(value, sizeof(value), fmt, ap);
|
||||
va_end(ap);
|
||||
|
||||
cs = libhal_device_new_changeset (udi);
|
||||
if (cs == NULL) {
|
||||
fatalx (EXIT_FAILURE, "Cannot initialize changeset");
|
||||
}
|
||||
|
||||
/* Loop on getting HAL variable(s) matching this NUT variable */
|
||||
while ( (nut2hal_info = find_nut_info(var, prev_nut2hal_info)) != NULL)
|
||||
{
|
||||
upsdebugx(2, "dstate_setinfo: %s => %s (%s)\n", var, nut2hal_info->hal_name, value);
|
||||
|
||||
if (nut2hal_info->fun != NULL)
|
||||
nut2hal_info->fun(cs, value);
|
||||
else {
|
||||
switch (nut2hal_info->hal_type)
|
||||
{
|
||||
case HAL_TYPE_INT:
|
||||
hal_set_int(cs, nut2hal_info->hal_name, atoi(value));
|
||||
break;
|
||||
case HAL_TYPE_BOOL:
|
||||
/* FIXME: howto lookup TRUE/FALSE? */
|
||||
hal_set_bool(cs, nut2hal_info->hal_name, TRUE);
|
||||
break;
|
||||
case HAL_TYPE_STRING:
|
||||
hal_set_string(cs, nut2hal_info->hal_name, value);
|
||||
break;
|
||||
}
|
||||
}
|
||||
prev_nut2hal_info = nut2hal_info;
|
||||
}
|
||||
|
||||
dbus_error_init (&dbus_error);
|
||||
/* NOTE: commit_changeset won't do IPC if set is empty */
|
||||
libhal_device_commit_changeset(halctx,cs,&dbus_error);
|
||||
libhal_device_free_changeset (cs);
|
||||
|
||||
if (dbus_error_is_set (&dbus_error))
|
||||
dbus_error_free (&dbus_error);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
int dstate_addenum(const char *var, const char *fmt, ...)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int dstate_addrange(const char *var, const int min, const int max)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
const st_tree_t *dstate_getroot(void)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int dstate_delinfo(const char *var)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int dstate_delcmd(const char *var)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
void dstate_setflags(const char *var, int flags)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
void dstate_setaux(const char *var, int aux)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
void dstate_dataok(void)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
void dstate_datastale(void)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
void dstate_free(void)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
/* extrafd: provided for waking up based on the driver's UPS fd */
|
||||
int dstate_poll_fds(struct timeval timeout, int extrafd)
|
||||
{
|
||||
/* drivers expect us to limit the polling rate here */
|
||||
sleep(timeout.tv_sec);
|
||||
|
||||
/* the timeout expired */
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* clean out the temp space for a new pass */
|
||||
void status_init(void)
|
||||
{
|
||||
/* Nothing to do */
|
||||
return;
|
||||
}
|
||||
|
||||
/* ups.status element conversion */
|
||||
void status_set(const char *buf)
|
||||
{
|
||||
upsdebugx(2, "status_set: %s", buf);
|
||||
|
||||
/* Note: only usbhid-ups supported devices expose [DIS]CHRG status */
|
||||
/* along with the standard OL (online) / OB (on battery) status! */
|
||||
if ( (strcmp(buf, "DISCHRG") == 0) || (strcmp(buf, "OB") == 0) )
|
||||
{
|
||||
ac_present = 0;
|
||||
}
|
||||
else if ( (strcmp(buf, "CHRG") == 0) || (strcmp(buf, "OL") == 0) )
|
||||
{
|
||||
ac_present = 1;
|
||||
}
|
||||
else
|
||||
upsdebugx(2, "status_set: dropping status %s (not managed)\n", buf);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/* write the status_buf into the externally visible dstate storage */
|
||||
void status_commit(void)
|
||||
{
|
||||
LibHalChangeSet *cs;
|
||||
DBusError dbus_error;
|
||||
int curlevel, warnlevel, lowlevel;
|
||||
|
||||
upsdebugx(2, "status_commit");
|
||||
|
||||
cs = libhal_device_new_changeset (udi);
|
||||
if (cs == NULL) {
|
||||
fatalx (EXIT_FAILURE, "Cannot initialize changeset");
|
||||
}
|
||||
|
||||
/* Retrieve the levels */
|
||||
curlevel = hal_get_int ("battery.charge_level.current");
|
||||
warnlevel = hal_get_int ("battery.charge_level.warning");
|
||||
lowlevel = hal_get_int ("battery.charge_level.low");
|
||||
|
||||
/* Set AC present status */
|
||||
/* Note: UPSs are also AC adaptors! */
|
||||
hal_set_bool (cs, "ac_adaptor.present", (ac_present == 0)?FALSE:TRUE);
|
||||
|
||||
/* Set discharging status */
|
||||
hal_set_bool (cs, "battery.rechargeable.is_discharging", (ac_present == 0)?TRUE:FALSE);
|
||||
|
||||
/* Set charging status */
|
||||
if (curlevel != 100)
|
||||
hal_set_bool (cs, "battery.rechargeable.is_charging", (ac_present == 0)?FALSE:TRUE);
|
||||
|
||||
/* Set the battery status (FIXME: are these values valid?) */
|
||||
if (curlevel <= lowlevel)
|
||||
hal_set_string(cs, "battery.charge_level.capacity_state", "critical");
|
||||
else if (curlevel <= warnlevel)
|
||||
hal_set_string(cs, "battery.charge_level.capacity_state", "warning"); /*low?*/
|
||||
else
|
||||
hal_set_string(cs, "battery.charge_level.capacity_state", "ok");
|
||||
|
||||
dbus_error_init (&dbus_error);
|
||||
/* NOTE: commit_changeset won't do IPC if set is empty */
|
||||
libhal_device_commit_changeset (halctx, cs, &dbus_error);
|
||||
libhal_device_free_changeset (cs);
|
||||
|
||||
if (dbus_error_is_set (&dbus_error))
|
||||
dbus_error_free (&dbus_error);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/* similar functions for ups.alarm */
|
||||
void alarm_init(void)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
void alarm_set(const char *buf)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
void alarm_commit(void)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
/* FIXME: complete and use nut2hal_cmd */
|
||||
/* Register DBus methods, by feeling the methods buffer */
|
||||
void dstate_addcmd(const char *cmdname)
|
||||
{
|
||||
DBusError dbus_error;
|
||||
dbus_error_init (&dbus_error);
|
||||
|
||||
upsdebugx(2, "dstate_addcmd: %s\n", cmdname);
|
||||
|
||||
/* beeper.{on,off} */
|
||||
/* FIXME: how to deal with beeper.toggle */
|
||||
if (!strncasecmp(cmdname, "beeper.disable", 14))
|
||||
{
|
||||
strcat(dbus_methods_introspection,
|
||||
" <method name=\"SetBeeper\">\n"
|
||||
" <arg name=\"beeper_mode\" direction=\"in\" type=\"b\"/>\n"
|
||||
" <arg name=\"return_code\" direction=\"out\" type=\"i\"/>\n"
|
||||
" </method>\n");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*******************************************************************
|
||||
* internal functions
|
||||
*******************************************************************/
|
||||
|
||||
/****************
|
||||
* HAL wrappers *
|
||||
****************/
|
||||
/* Only update HAL string values if there are real changes */
|
||||
void hal_set_string(LibHalChangeSet *cs, const char *key, const char *value)
|
||||
{
|
||||
DBusError dbus_error;
|
||||
char *new_value = NULL;
|
||||
|
||||
upsdebugx(2, "hal_set_string: %s => %s", key, value);
|
||||
|
||||
dbus_error_init(&dbus_error);
|
||||
|
||||
/* Check if the property already exists */
|
||||
if (libhal_device_property_exists (halctx, udi, key, &dbus_error) == TRUE) {
|
||||
|
||||
new_value = libhal_device_get_property_string (halctx, udi,
|
||||
key, &dbus_error);
|
||||
|
||||
/* Check if the value has really changed */
|
||||
if (strcmp(value, new_value))
|
||||
libhal_changeset_set_property_string (cs, key, value);
|
||||
|
||||
/* Free the new_value string */
|
||||
if (new_value != NULL)
|
||||
libhal_free_string (new_value);
|
||||
}
|
||||
else {
|
||||
libhal_changeset_set_property_string (cs, key, value);
|
||||
}
|
||||
}
|
||||
|
||||
/* Only update HAL int values if there are real changes */
|
||||
void hal_set_int(LibHalChangeSet *cs, const char *key, const int value)
|
||||
{
|
||||
DBusError dbus_error;
|
||||
int new_value;
|
||||
|
||||
upsdebugx(2, "hal_set_int: %s => %i", key, value);
|
||||
|
||||
dbus_error_init(&dbus_error);
|
||||
|
||||
/* Check if the property already exists */
|
||||
if (libhal_device_property_exists (halctx, udi, key, &dbus_error) == TRUE) {
|
||||
|
||||
new_value = libhal_device_get_property_int (halctx, udi,
|
||||
key, &dbus_error);
|
||||
|
||||
/* Check if the value has really changed */
|
||||
if (value != new_value)
|
||||
libhal_changeset_set_property_int (cs, key, value);
|
||||
}
|
||||
else {
|
||||
libhal_changeset_set_property_int (cs, key, value);
|
||||
}
|
||||
}
|
||||
|
||||
char *hal_get_string(const char *key)
|
||||
{
|
||||
DBusError dbus_error;
|
||||
char *value = NULL;
|
||||
|
||||
upsdebugx(2, "hal_get_string: %s", key);
|
||||
|
||||
dbus_error_init(&dbus_error);
|
||||
|
||||
/* Check if the property already exists */
|
||||
if (libhal_device_property_exists (halctx, udi, key, &dbus_error) == TRUE) {
|
||||
|
||||
value = libhal_device_get_property_string (halctx, udi,
|
||||
key, &dbus_error);
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
int hal_get_int(const char *key)
|
||||
{
|
||||
DBusError dbus_error;
|
||||
int value = -1;
|
||||
|
||||
upsdebugx(2, "hal_get_int: %s", key);
|
||||
|
||||
dbus_error_init(&dbus_error);
|
||||
|
||||
/* Check if the property already exists */
|
||||
if (libhal_device_property_exists (halctx, udi, key, &dbus_error) == TRUE) {
|
||||
|
||||
value = libhal_device_get_property_int (halctx, udi,
|
||||
key, &dbus_error);
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
/* Only update HAL int values if there are real changes */
|
||||
void hal_set_bool(LibHalChangeSet *cs, const char *key, const dbus_bool_t value)
|
||||
{
|
||||
DBusError dbus_error;
|
||||
dbus_bool_t new_value;
|
||||
|
||||
upsdebugx(2, "hal_set_bool: %s => %s", key, (value==TRUE)?"true":"false");
|
||||
|
||||
dbus_error_init(&dbus_error);
|
||||
|
||||
/* Check if the property already exists */
|
||||
if (libhal_device_property_exists (halctx, udi, key, &dbus_error) == TRUE) {
|
||||
|
||||
new_value = libhal_device_get_property_bool (halctx, udi,
|
||||
key, &dbus_error);
|
||||
|
||||
/* Check if the value has really changed */
|
||||
if (value != new_value)
|
||||
libhal_changeset_set_property_bool (cs, key, value);
|
||||
}
|
||||
else {
|
||||
libhal_changeset_set_property_bool (cs, key, value);
|
||||
}
|
||||
}
|
||||
|
||||
/* find the next info element definition in info array
|
||||
* that matches nut_varname, and that is after prev_info_item
|
||||
* if specified.
|
||||
* Note that 1 nut item can matches several HAL items
|
||||
*/
|
||||
static info_lkp_t *find_nut_info(const char *nut_varname, info_lkp_t *prev_info_item)
|
||||
{
|
||||
info_lkp_t *info_item;
|
||||
|
||||
upsdebugx(2, "find_nut_info: looking up => %s\n", nut_varname);
|
||||
|
||||
if (prev_info_item != NULL) {
|
||||
/* Start from the item following prev_info_item */
|
||||
info_item = ++prev_info_item;
|
||||
}
|
||||
else {
|
||||
info_item = nut2hal_info;
|
||||
}
|
||||
|
||||
for ( ; info_item != NULL && info_item->nut_name != NULL ; info_item++) {
|
||||
|
||||
if (!strcasecmp(info_item->nut_name, nut_varname))
|
||||
return info_item;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
|
@ -1,94 +0,0 @@
|
|||
/* dstate-hal.h - Network UPS Tools driver-side state management
|
||||
|
||||
Copyright (C) 2006 Arnaud Quette <aquette.dev@gmail.com>
|
||||
|
||||
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 DSTATE_HAL_H_SEEN
|
||||
#define DSTATE_HAL_H_SEEN 1
|
||||
|
||||
#include "state.h"
|
||||
#include "attribute.h"
|
||||
|
||||
/*#include "parseconf.h"*/
|
||||
#include "upshandler.h"
|
||||
|
||||
#include <glib.h>
|
||||
#include <dbus/dbus-glib.h>
|
||||
#include <dbus/dbus-glib-lowlevel.h>
|
||||
#include <hal/libhal.h>
|
||||
|
||||
#define DS_LISTEN_BACKLOG 16
|
||||
#define DS_MAX_READ 256 /* don't read forever from upsd */
|
||||
|
||||
/* HAL specific */
|
||||
#define DBUS_INTERFACE "org.freedesktop.Hal.Device.UPS"
|
||||
|
||||
DBusHandlerResult dbus_filter_function(DBusConnection *connection,
|
||||
DBusMessage *message,
|
||||
void *user_data);
|
||||
|
||||
gboolean dbus_init_local (void);
|
||||
|
||||
#define HAL_WARNING
|
||||
|
||||
/* track client connections */
|
||||
/* typedef struct conn_s {
|
||||
* int fd;
|
||||
* PCONF_CTX_t ctx;
|
||||
* struct conn_s *next;
|
||||
*} conn_t;
|
||||
*/
|
||||
extern struct ups_handler upsh;
|
||||
|
||||
void dstate_init(const char *prog, const char *port);
|
||||
int dstate_poll_fds(struct timeval timeout, int extrafd);
|
||||
int dstate_setinfo(const char *var, const char *fmt, ...)
|
||||
__attribute__ ((__format__ (__printf__, 2, 3)));
|
||||
int dstate_addenum(const char *var, const char *fmt, ...)
|
||||
__attribute__ ((__format__ (__printf__, 2, 3)));
|
||||
int dstate_addrange(const char *var, const int min, const int max);
|
||||
void dstate_setflags(const char *var, int flags);
|
||||
void dstate_setaux(const char *var, int aux);
|
||||
const char *dstate_getinfo(const char *var);
|
||||
void dstate_addcmd(const char *cmdname);
|
||||
int dstate_delinfo(const char *var);
|
||||
int dstate_delenum(const char *var, const char *val);
|
||||
int dstate_delcmd(const char *cmd);
|
||||
void dstate_free(void);
|
||||
const st_tree_t *dstate_getroot(void);
|
||||
const cmdlist_t *dstate_getcmdlist(void);
|
||||
|
||||
void dstate_dataok(void);
|
||||
void dstate_datastale(void);
|
||||
|
||||
int dstate_is_stale(void);
|
||||
|
||||
/* clean out the temp space for a new pass */
|
||||
void status_init(void);
|
||||
|
||||
/* add a status element */
|
||||
void status_set(const char *buf);
|
||||
|
||||
/* write the temporary status_buf into ups.status */
|
||||
void status_commit(void);
|
||||
|
||||
/* similar functions for ups.alarm */
|
||||
void alarm_init(void);
|
||||
void alarm_set(const char *buf);
|
||||
void alarm_commit(void);
|
||||
|
||||
#endif /* DSTATE_HAL_H_SEEN */
|
||||
|
|
@ -312,7 +312,7 @@ int libshut_open(int *upsfd, SHUTDevice_t *curDevice, char *device_path,
|
|||
/* FIXME: add variable baudrate detection */
|
||||
*upsfd = ser_open(device_path);
|
||||
ser_set_speed(*upsfd, device_path, B2400);
|
||||
setline(*upsfd, 0);
|
||||
setline(*upsfd, 1);
|
||||
|
||||
/* initialise communication */
|
||||
if (!shut_synchronise(*upsfd))
|
||||
|
|
|
|||
|
|
@ -33,9 +33,6 @@
|
|||
#include "usb-common.h"
|
||||
#include "libusb.h"
|
||||
|
||||
/* USB standard timeout */
|
||||
#define USB_TIMEOUT 5000
|
||||
|
||||
#define USB_DRIVER_NAME "USB communication driver"
|
||||
#define USB_DRIVER_VERSION "0.32"
|
||||
|
||||
|
|
@ -375,7 +372,9 @@ static int libusb_strerror(const int ret, const char *desc)
|
|||
return 0;
|
||||
|
||||
case -EOVERFLOW: /* Value too large for defined data type */
|
||||
#ifdef EPROTO
|
||||
case -EPROTO: /* Protocol error */
|
||||
#endif
|
||||
upsdebugx(2, "%s: %s", desc, usb_strerror());
|
||||
return 0;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,571 +0,0 @@
|
|||
/* main-hal.c - Network UPS Tools driver core for HAL
|
||||
|
||||
Copyright (C) 2006 Arnaud Quette <aquette.dev@gmail.com>
|
||||
Copyright (C) 1999 Russell Kroll <rkroll@exploits.org>
|
||||
|
||||
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
|
||||
*/
|
||||
|
||||
/* TODO list:
|
||||
* -more cleanup
|
||||
* - dstate-hal: expose all data on org.freedesktop.NUT to prepare
|
||||
* a full HAL/DBus enabled nut (remove the need of {d,s}state layer
|
||||
* - use HAL logging functions
|
||||
*/
|
||||
|
||||
#include "main-hal.h"
|
||||
#include "dstate-hal.h"
|
||||
#include <hal/libhal.h>
|
||||
|
||||
#ifdef HAVE_POLKIT
|
||||
#include <libpolkit.h>
|
||||
#endif
|
||||
|
||||
/* HAL specific */
|
||||
extern LibHalContext *halctx;
|
||||
extern char *udi;
|
||||
|
||||
/* data which may be useful to the drivers */
|
||||
int upsfd = -1;
|
||||
char *device_path = NULL;
|
||||
const char *progname = NULL, *upsname = NULL,
|
||||
*device_name = NULL;
|
||||
|
||||
/* may be set by the driver to wake up while in dstate_poll_fds */
|
||||
int extrafd = -1;
|
||||
|
||||
/* for ser_open */
|
||||
int do_lock_port = 1;
|
||||
|
||||
/* set by the drivers */
|
||||
int experimental_driver = 0;
|
||||
int broken_driver = 0;
|
||||
|
||||
static vartab_t *vartab_h = NULL;
|
||||
|
||||
/* variables possibly set by the global part of ups.conf */
|
||||
unsigned int poll_interval = 2;
|
||||
static char *chroot_path = NULL;
|
||||
|
||||
/* signal handling */
|
||||
int exit_flag = 0;
|
||||
|
||||
/* everything else */
|
||||
static char *pidfn = NULL;
|
||||
GMainLoop *gmain;
|
||||
char *dbus_methods_introspection;
|
||||
|
||||
/* retrieve the value of variable <var> if possible */
|
||||
char *getval(const char *var)
|
||||
{
|
||||
vartab_t *tmp = vartab_h;
|
||||
|
||||
while (tmp) {
|
||||
if (!strcasecmp(tmp->var, var))
|
||||
return(tmp->val);
|
||||
tmp = tmp->next;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* see if <var> has been defined, even if no value has been given to it */
|
||||
int testvar(const char *var)
|
||||
{
|
||||
vartab_t *tmp = vartab_h;
|
||||
|
||||
while (tmp) {
|
||||
if (!strcasecmp(tmp->var, var))
|
||||
return tmp->found;
|
||||
tmp = tmp->next;
|
||||
}
|
||||
|
||||
return 0; /* not found */
|
||||
}
|
||||
|
||||
/* callback from driver - create the table for -x/conf entries */
|
||||
void addvar(int vartype, const char *name, const char *desc)
|
||||
{
|
||||
vartab_t *tmp, *last;
|
||||
|
||||
tmp = last = vartab_h;
|
||||
|
||||
while (tmp) {
|
||||
last = tmp;
|
||||
tmp = tmp->next;
|
||||
}
|
||||
|
||||
tmp = xmalloc(sizeof(vartab_t));
|
||||
|
||||
tmp->vartype = vartype;
|
||||
tmp->var = xstrdup(name);
|
||||
tmp->val = NULL;
|
||||
tmp->desc = xstrdup(desc);
|
||||
tmp->found = 0;
|
||||
tmp->next = NULL;
|
||||
|
||||
if (last)
|
||||
last->next = tmp;
|
||||
else
|
||||
vartab_h = tmp;
|
||||
}
|
||||
|
||||
static void vartab_free(void)
|
||||
{
|
||||
vartab_t *tmp, *next;
|
||||
|
||||
tmp = vartab_h;
|
||||
|
||||
while (tmp) {
|
||||
next = tmp->next;
|
||||
|
||||
free(tmp->var);
|
||||
free(tmp->val);
|
||||
free(tmp->desc);
|
||||
free(tmp);
|
||||
|
||||
tmp = next;
|
||||
}
|
||||
}
|
||||
|
||||
static void exit_cleanup(int sig)
|
||||
{
|
||||
upsdebugx(2, "exit_cleanup(%i", sig);
|
||||
|
||||
exit_flag = sig;
|
||||
|
||||
upsdrv_cleanup();
|
||||
|
||||
free(chroot_path);
|
||||
free(device_path);
|
||||
|
||||
if (pidfn) {
|
||||
unlink(pidfn);
|
||||
free(pidfn);
|
||||
}
|
||||
|
||||
dstate_free();
|
||||
vartab_free();
|
||||
|
||||
/* break the main loop */
|
||||
g_main_loop_quit(gmain);
|
||||
}
|
||||
|
||||
static void setup_signals(void)
|
||||
{
|
||||
struct sigaction sa;
|
||||
|
||||
sigemptyset(&sa.sa_mask);
|
||||
sa.sa_flags = SA_RESTART | SA_NOCLDSTOP;
|
||||
|
||||
sa.sa_handler = exit_cleanup;
|
||||
sigaction(SIGTERM, &sa, NULL);
|
||||
sigaction(SIGINT, &sa, NULL);
|
||||
sigaction(SIGQUIT, &sa, NULL);
|
||||
|
||||
/* sa.sa_handler = SIG_IGN;
|
||||
sigaction(SIGHUP, &sa, NULL);
|
||||
sigaction(SIGPIPE, &sa, NULL);*/
|
||||
}
|
||||
|
||||
/* (*GSourceFunc) wrapper */
|
||||
static gboolean update_data (gpointer data)
|
||||
{
|
||||
upsdrv_updateinfo();
|
||||
return (exit_flag == 0);
|
||||
}
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
DBusError dbus_error;
|
||||
DBusConnection *dbus_connection;
|
||||
struct passwd *new_uid = NULL;
|
||||
char *hal_debug_level;
|
||||
/* int i, do_forceshutdown = 0; */
|
||||
|
||||
if (experimental_driver) {
|
||||
printf("Warning: This is an experimental driver.\n");
|
||||
printf("Some features may not function correctly.\n\n");
|
||||
}
|
||||
|
||||
progname = xbasename(argv[0]);
|
||||
open_syslog(progname);
|
||||
|
||||
dbus_methods_introspection = xmalloc(1024);
|
||||
|
||||
/* Register the basic supported method (Shutdown)
|
||||
* Leave other methods registration to driver core calls to
|
||||
* dstate_addcmd(), at initinfo() time
|
||||
*/
|
||||
snprintf(dbus_methods_introspection, 1024, "%s",
|
||||
" <method name=\"Shutdown\">\n"
|
||||
/* " <arg name=\"shutdown_type\" direction=\"in\" type=\"s\"/>\n" */
|
||||
" <arg name=\"return_code\" direction=\"out\" type=\"i\"/>\n"
|
||||
" </method>\n");
|
||||
|
||||
/* initialise HAL and DBus interface*/
|
||||
halctx = NULL;
|
||||
udi = getenv ("UDI");
|
||||
if (udi == NULL) {
|
||||
fprintf(stderr, "Error: UDI is null.\n");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
dbus_error_init (&dbus_error);
|
||||
if ((halctx = libhal_ctx_init_direct (&dbus_error)) == NULL) {
|
||||
fprintf(stderr, "Error: can't initialise libhal.\n");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
if (dbus_error_is_set (&dbus_error))
|
||||
{
|
||||
fatalx(EXIT_FAILURE, "Error in context creation: %s\n", dbus_error.message);
|
||||
dbus_error_free (&dbus_error);
|
||||
}
|
||||
|
||||
if ((dbus_connection = libhal_ctx_get_dbus_connection(halctx)) == NULL) {
|
||||
fprintf(stderr, "Error: can't get DBus connection.\n");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
/* FIXME: rework HAL param interface! or get path/regex from UDI
|
||||
* Example:
|
||||
* /org/freedesktop/Hal/devices/usb_device_463_ffff_1H2E300AH
|
||||
* => linux.device_file = /dev/bus/usb/002/065
|
||||
*/
|
||||
/* FIXME: the naming should be abstracted to os.device_file! */
|
||||
device_path = xstrdup("auto");
|
||||
|
||||
/* FIXME: bridge debug/warning on HAL equivalent (need them
|
||||
* to externalize these in a lib... */
|
||||
hal_debug_level = getenv ("NUT_HAL_DEBUG");
|
||||
if (hal_debug_level == NULL)
|
||||
nut_debug_level = 0;
|
||||
else
|
||||
nut_debug_level = atoi(hal_debug_level);
|
||||
|
||||
/* Sleep 2 seconds to be able to view the device through usbfs! */
|
||||
sleep(2);
|
||||
|
||||
/* build the driver's extra (-x) variable table */
|
||||
upsdrv_makevartable();
|
||||
|
||||
/* Switch to the HAL user */
|
||||
new_uid = get_user_pwent(HAL_USER);
|
||||
become_user(new_uid);
|
||||
|
||||
/* Only switch to statepath if we're not powering off */
|
||||
/* This avoid case where ie /var is umounted */
|
||||
/* ?! Not needed for HAL !?
|
||||
if (!do_forceshutdown)
|
||||
if (chdir(dflt_statepath()))
|
||||
fatal_with_errno(EXIT_FAILURE, "Can't chdir to %s", dflt_statepath());
|
||||
*/
|
||||
setup_signals();
|
||||
|
||||
/* clear out callback handler data */
|
||||
memset(&upsh, '\0', sizeof(upsh));
|
||||
|
||||
upsdrv_initups();
|
||||
|
||||
#if 0
|
||||
if (do_forceshutdown)
|
||||
forceshutdown();
|
||||
#endif
|
||||
|
||||
/* get the supported data and commands before allowing connections */
|
||||
upsdrv_initinfo();
|
||||
upsdrv_updateinfo();
|
||||
|
||||
/* now we can start servicing requests */
|
||||
dstate_init(NULL, NULL);
|
||||
|
||||
/* Commit DBus methods */
|
||||
if (!libhal_device_claim_interface(halctx, udi, DBUS_INTERFACE,
|
||||
dbus_methods_introspection, &dbus_error)) {
|
||||
fprintf(stderr, "Cannot claim interface: %s\n", dbus_error.message);
|
||||
}
|
||||
else
|
||||
fprintf(stdout, "Claimed the following DBus interfaces on %s:\n%s",
|
||||
DBUS_INTERFACE, dbus_methods_introspection);
|
||||
|
||||
/* Complete DBus binding */
|
||||
dbus_connection_setup_with_g_main(dbus_connection, NULL);
|
||||
dbus_connection_add_filter(dbus_connection, dbus_filter_function, NULL, NULL);
|
||||
dbus_connection_set_exit_on_disconnect(dbus_connection, 0);
|
||||
|
||||
dbus_init_local();
|
||||
/* end of HAL init */
|
||||
|
||||
#if 0
|
||||
/* publish the top-level data: version number, driver name */
|
||||
dstate_setinfo("driver.version", "%s", UPS_VERSION);
|
||||
dstate_setinfo("driver.name", "%s", progname);
|
||||
|
||||
/* The poll_interval may have been changed from the default */
|
||||
dstate_setinfo("driver.parameter.pollinterval", "%d", poll_interval);
|
||||
|
||||
/* FIXME: needed? */
|
||||
if (nut_debug_level == 0) {
|
||||
background();
|
||||
writepid(pidfn);
|
||||
}
|
||||
#endif
|
||||
/* End HAL init */
|
||||
dbus_error_init (&dbus_error);
|
||||
if (!libhal_device_addon_is_ready (halctx, udi, &dbus_error)) {
|
||||
fprintf(stderr, "Error (libhal): device addon is not ready\n");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
/* add a timer for data update */
|
||||
#ifdef HAVE_G_TIMEOUT_ADD_SECONDS
|
||||
g_timeout_add_seconds (poll_interval,
|
||||
#else
|
||||
g_timeout_add (1000 * poll_interval, /* seconds */
|
||||
#endif
|
||||
(GSourceFunc)update_data,
|
||||
NULL);
|
||||
|
||||
/* setup and run the main loop */
|
||||
gmain = g_main_loop_new(NULL, FALSE);
|
||||
g_main_loop_run(gmain);
|
||||
|
||||
/* reached upon addon exit */
|
||||
upslogx(LOG_INFO, "Signal %d: exiting", exit_flag);
|
||||
exit(EXIT_SUCCESS);
|
||||
}
|
||||
|
||||
/********************************************************************
|
||||
* DBus interface functions and data
|
||||
*******************************************************************/
|
||||
|
||||
static DBusHandlerResult dbus_filter_function_local(DBusConnection *connection,
|
||||
DBusMessage *message,
|
||||
void *user_data)
|
||||
{
|
||||
if (dbus_message_is_signal(message, DBUS_INTERFACE_LOCAL, "Disconnected")) {
|
||||
upsdebugx(1, "DBus daemon disconnected. Trying to reconnect...");
|
||||
dbus_connection_unref(connection);
|
||||
g_timeout_add(5000, (GSourceFunc)dbus_init_local, NULL);
|
||||
}
|
||||
return DBUS_HANDLER_RESULT_HANDLED;
|
||||
}
|
||||
|
||||
/* returns FALSE on success because it's used as a callback */
|
||||
gboolean dbus_init_local(void)
|
||||
{
|
||||
DBusConnection *dbus_connection;
|
||||
DBusError dbus_error;
|
||||
|
||||
dbus_error_init(&dbus_error);
|
||||
|
||||
dbus_connection = dbus_bus_get(DBUS_BUS_SYSTEM, &dbus_error);
|
||||
if (dbus_error_is_set(&dbus_error)) {
|
||||
upsdebugx(1, "Cannot get D-Bus connection");
|
||||
/* dbus_error_free (&dbus_error); */
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
dbus_connection_setup_with_g_main(dbus_connection, NULL);
|
||||
dbus_connection_add_filter(dbus_connection, dbus_filter_function_local,
|
||||
NULL, NULL);
|
||||
dbus_connection_set_exit_on_disconnect(dbus_connection, 0);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
#ifdef HAVE_POLKIT
|
||||
/**
|
||||
* dbus_is_privileged:
|
||||
* @connection: connection to D-Bus
|
||||
* @message: Message
|
||||
* @error: the error
|
||||
*
|
||||
* Returns: TRUE if the caller is privileged
|
||||
*
|
||||
* checks if caller of message possesses the CPUFREQ_POLKIT_PRIVILGE
|
||||
*/
|
||||
static gboolean
|
||||
dbus_is_privileged (DBusConnection *connection, DBusMessage *message, DBusError *error)
|
||||
{
|
||||
gboolean ret;
|
||||
char *polkit_result;
|
||||
const char *invoked_by_syscon_name;
|
||||
|
||||
ret = FALSE;
|
||||
polkit_result = NULL;
|
||||
/* FIXME: CPUFREQ_POLKIT_PRIVILEGE, CPUFREQ_ERROR_GENERAL */
|
||||
invoked_by_syscon_name = dbus_message_get_sender (message);
|
||||
|
||||
polkit_result = libhal_device_is_caller_privileged (halctx,
|
||||
udi,
|
||||
CPUFREQ_POLKIT_PRIVILEGE,
|
||||
invoked_by_syscon_name,
|
||||
error);
|
||||
if (polkit_result == NULL) {
|
||||
dbus_raise_error (connection, message, CPUFREQ_ERROR_GENERAL,
|
||||
"Cannot determine if caller is privileged");
|
||||
}
|
||||
else {
|
||||
if (strcmp (polkit_result, "yes") != 0) {
|
||||
|
||||
dbus_raise_error (connection, message,
|
||||
"org.freedesktop.Hal.Device.PermissionDeniedByPolicy",
|
||||
"%s %s <-- (action, result)",
|
||||
CPUFREQ_POLKIT_PRIVILEGE, polkit_result);
|
||||
}
|
||||
else
|
||||
ret = TRUE;
|
||||
}
|
||||
|
||||
if (polkit_result != NULL)
|
||||
libhal_free_string (polkit_result);
|
||||
return ret;
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* dbus_send_reply:
|
||||
* @connection: connection to D-Bus
|
||||
* @message: Message
|
||||
* @type: the type of data param
|
||||
* @data: data to send
|
||||
*
|
||||
* Returns: TRUE/FALSE
|
||||
*
|
||||
* sends a reply to message with the given data and its dbus_type
|
||||
*/
|
||||
static gboolean dbus_send_reply(DBusConnection *connection, DBusMessage *message,
|
||||
int dbus_type, void *data)
|
||||
{
|
||||
DBusMessage *reply;
|
||||
|
||||
if ((reply = dbus_message_new_method_return(message)) == NULL) {
|
||||
upslogx(LOG_WARNING, "Could not allocate memory for the DBus reply");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (data != NULL)
|
||||
dbus_message_append_args(reply, dbus_type, data, DBUS_TYPE_INVALID);
|
||||
|
||||
if (!dbus_connection_send(connection, reply, NULL)) {
|
||||
upslogx(LOG_WARNING, "Could not sent reply");
|
||||
return FALSE;
|
||||
}
|
||||
dbus_connection_flush(connection);
|
||||
dbus_message_unref(reply);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* dbus_get_argument:
|
||||
* @connection: connection to D-Bus
|
||||
* @message: Message
|
||||
* @dbus_error: the D-Bus error
|
||||
* @type: the type of arg param
|
||||
* @arg: the value to get from the message
|
||||
*
|
||||
* Returns: TRUE/FALSE
|
||||
*
|
||||
* gets one argument from message with the given dbus_type and stores it in arg
|
||||
*/
|
||||
static gboolean dbus_get_argument(DBusConnection *connection, DBusMessage *message,
|
||||
DBusError *dbus_error, int dbus_type, void *arg)
|
||||
{
|
||||
dbus_message_get_args(message, dbus_error, dbus_type, arg,
|
||||
DBUS_TYPE_INVALID);
|
||||
if (dbus_error_is_set(dbus_error)) {
|
||||
upslogx(LOG_WARNING, "Could not get argument of DBus message: %s",
|
||||
dbus_error->message);
|
||||
dbus_error_free(dbus_error);
|
||||
return FALSE;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* dbus_filter_function:
|
||||
* @connection: connection to D-Bus
|
||||
* @message: message
|
||||
* @user_data: pointer to the data
|
||||
*
|
||||
* Returns: the result
|
||||
*
|
||||
* @raises UnknownMethod
|
||||
*
|
||||
* D-Bus filter function
|
||||
*/
|
||||
DBusHandlerResult dbus_filter_function(DBusConnection *connection,
|
||||
DBusMessage *message,
|
||||
void *user_data)
|
||||
{
|
||||
DBusError dbus_error;
|
||||
int retcode = -1;
|
||||
const char *member = dbus_message_get_member(message);
|
||||
const char *path = dbus_message_get_path(message);
|
||||
/* int ret = DBUS_HANDLER_RESULT_NOT_YET_HANDLED; */
|
||||
|
||||
/* upsdebugx(2, "Received DBus message with member %s path %s", member, path); */
|
||||
fprintf(stdout, "Received DBus message with member %s on path %s\n", member, path);
|
||||
|
||||
dbus_error_init(&dbus_error);
|
||||
if (dbus_error_is_set (&dbus_error))
|
||||
{
|
||||
fprintf (stderr, "an error occurred: %s\n", dbus_error.message);
|
||||
/* dbus_error_free (&dbus_error); */
|
||||
}
|
||||
else
|
||||
{
|
||||
#ifdef HAVE_POLKIT
|
||||
if (!dbus_is_privileged(connection, message, &dbus_error))
|
||||
return DBUS_HANDLER_RESULT_HANDLED;
|
||||
#endif
|
||||
|
||||
if (dbus_message_is_method_call(message, DBUS_INTERFACE, "Shutdown")) {
|
||||
|
||||
fprintf(stdout, "executing Shutdown\n");
|
||||
upsdrv_shutdown();
|
||||
dbus_send_reply(connection, message, DBUS_TYPE_INVALID, NULL);
|
||||
|
||||
} else if (dbus_message_is_method_call(message,
|
||||
DBUS_INTERFACE, "SetBeeper")) {
|
||||
fprintf(stdout, "executing SetBeeper\n");
|
||||
gboolean b_enable;
|
||||
if (!dbus_get_argument(connection, message, &dbus_error,
|
||||
DBUS_TYPE_BOOLEAN, &b_enable)) {
|
||||
fprintf(stderr, "Error receiving boolean argument\n");
|
||||
return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
|
||||
}
|
||||
fprintf(stdout, "Received argument: %s\n", (b_enable==TRUE)?"true":"false");
|
||||
|
||||
if (b_enable==TRUE) {
|
||||
if (upsh.instcmd("beeper.enable", NULL) != STAT_INSTCMD_HANDLED) {
|
||||
dbus_send_reply(connection, message, DBUS_TYPE_INT32, &retcode);
|
||||
return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (upsh.instcmd("beeper.disable", NULL) != STAT_INSTCMD_HANDLED) {
|
||||
dbus_send_reply(connection, message, DBUS_TYPE_INT32, &retcode);
|
||||
return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
|
||||
}
|
||||
}
|
||||
dbus_send_reply(connection, message, DBUS_TYPE_INVALID, NULL);
|
||||
return DBUS_HANDLER_RESULT_HANDLED;
|
||||
}
|
||||
|
|
@ -1,51 +0,0 @@
|
|||
#include "common.h"
|
||||
#include "config.h"
|
||||
/* #include "upsconf.h" */
|
||||
#include "dstate.h"
|
||||
#include "extstate.h"
|
||||
|
||||
/* public functions & variables from main.c */
|
||||
extern const char *progname;
|
||||
extern char *device_path;
|
||||
extern const char *device_name;
|
||||
extern int upsfd, extrafd, broken_driver, experimental_driver, exit_flag;
|
||||
extern unsigned int poll_interval;
|
||||
|
||||
/* functions & variables required in each driver */
|
||||
void upsdrv_initups(void); /* open connection to UPS, fail if not found */
|
||||
void upsdrv_initinfo(void); /* prep data, settings for UPS monitoring */
|
||||
void upsdrv_updateinfo(void); /* update state data if possible */
|
||||
void upsdrv_shutdown(void); /* make the UPS power off the load */
|
||||
void upsdrv_help(void); /* tack on anything useful for the -h text */
|
||||
void upsdrv_banner(void); /* print your version information */
|
||||
void upsdrv_cleanup(void); /* free any resources before shutdown */
|
||||
|
||||
/* --- details for the variable/value sharing --- */
|
||||
|
||||
/* main calls this driver function - it needs to call addvar */
|
||||
void upsdrv_makevartable(void);
|
||||
|
||||
/* retrieve the value of variable <var> if possible */
|
||||
char *getval(const char *var);
|
||||
|
||||
/* see if <var> has been defined, even if no value has been given to it */
|
||||
int testvar(const char *var);
|
||||
|
||||
/* extended variable table - used for -x defines/flags */
|
||||
typedef struct vartab_s {
|
||||
int vartype; /* VAR_* value, below */
|
||||
char *var; /* left side of =, or whole word if none */
|
||||
char *val; /* right side of = */
|
||||
char *desc; /* 40 character description for -h text */
|
||||
int found; /* set once encountered, for testvar() */
|
||||
struct vartab_s *next;
|
||||
} vartab_t;
|
||||
|
||||
/* flags to define types in the vartab */
|
||||
|
||||
#define VAR_FLAG 0x0001 /* argument is a flag (no value needed) */
|
||||
#define VAR_VALUE 0x0002 /* argument requires a value setting */
|
||||
#define VAR_SENSITIVE 0x0004 /* do not publish in driver.parameter */
|
||||
|
||||
/* callback from driver - create the table for future -x entries */
|
||||
void addvar(int vartype, const char *name, const char *desc);
|
||||
|
|
@ -36,7 +36,7 @@
|
|||
#include "usbhid-ups.h"
|
||||
#include "mge-hid.h"
|
||||
|
||||
#define MGE_HID_VERSION "MGE HID 1.32"
|
||||
#define MGE_HID_VERSION "MGE HID 1.33"
|
||||
|
||||
/* (prev. MGE Office Protection Systems, prev. MGE UPS SYSTEMS) */
|
||||
/* Eaton */
|
||||
|
|
@ -98,7 +98,8 @@ typedef enum {
|
|||
MGE_PULSAR_M = 0x400, /* MGE Pulsar M series */
|
||||
MGE_PULSAR_M_2200,
|
||||
MGE_PULSAR_M_3000,
|
||||
MGE_PULSAR_M_3000_XL
|
||||
MGE_PULSAR_M_3000_XL,
|
||||
EATON_5P = 0x500 /* Eaton 5P / 5PX series */
|
||||
} models_type_t;
|
||||
|
||||
/* Default to line-interactive or online (ie, not offline).
|
||||
|
|
@ -211,6 +212,7 @@ static const char *mge_battery_voltage_nominal_fun(double value)
|
|||
break;
|
||||
|
||||
case MGE_PULSAR_M:
|
||||
case EATON_5P:
|
||||
break;
|
||||
|
||||
default:
|
||||
|
|
@ -234,6 +236,7 @@ static const char *mge_battery_voltage_fun(double value)
|
|||
{
|
||||
case MGE_EVOLUTION:
|
||||
case MGE_PULSAR_M:
|
||||
case EATON_5P:
|
||||
break;
|
||||
|
||||
default:
|
||||
|
|
@ -774,6 +777,12 @@ static models_name_t mge_model_names [] =
|
|||
{ "Evolution", "S 2500", MGE_EVOLUTION_S_2500, NULL },
|
||||
{ "Evolution", "S 3000", MGE_EVOLUTION_S_3000, NULL },
|
||||
|
||||
/* Eaton 5P */
|
||||
{ "Eaton 5P", "650", EATON_5P, "5P 650" },
|
||||
{ "Eaton 5P", "850", EATON_5P, "5P 850" },
|
||||
{ "Eaton 5P", "1150", EATON_5P, "5P 1150" },
|
||||
{ "Eaton 5P", "1550", EATON_5P, "5P 1550" },
|
||||
|
||||
/* Pulsar M models */
|
||||
{ "PULSAR M", "2200", MGE_PULSAR_M_2200, NULL },
|
||||
{ "PULSAR M", "3000", MGE_PULSAR_M_3000, NULL },
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@
|
|||
#include "netxml-ups.h"
|
||||
#include "mge-xml.h"
|
||||
|
||||
#define MGE_XML_VERSION "MGEXML/0.22"
|
||||
#define MGE_XML_VERSION "MGEXML/0.23"
|
||||
#define MGE_XML_INITUPS "/"
|
||||
#define MGE_XML_INITINFO "/mgeups/product.xml /product.xml /ws/product.xml"
|
||||
|
||||
|
|
@ -1489,7 +1489,7 @@ char *vvalue_mge_xml2nut(const char *name, const char *value, size_t len) {
|
|||
|
||||
/* Convert */
|
||||
if (NULL != info->convert) {
|
||||
char *vconv = info->convert(vcpy);
|
||||
char *vconv = (char *)info->convert(vcpy);
|
||||
|
||||
free(vcpy);
|
||||
|
||||
|
|
@ -1510,7 +1510,7 @@ void vname_register_rw(void) {
|
|||
xml_info_t *info = mge_xml2nut + i;
|
||||
|
||||
if (NULL != info->nutname && info->nutflags & ST_FLAG_RW) {
|
||||
dstate_setinfo(info->nutname, "");
|
||||
dstate_setinfo(info->nutname, "%s", "");
|
||||
dstate_setflags(info->nutname, ST_FLAG_RW);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
498
drivers/nutdrv_atcl_usb.c
Normal file
498
drivers/nutdrv_atcl_usb.c
Normal file
|
|
@ -0,0 +1,498 @@
|
|||
/*
|
||||
* nutdrv_atcl_usb.c - driver for generic-brand "ATCL FOR UPS"
|
||||
*
|
||||
* Copyright (C) 2013-2014 Charles Lepple <clepple+nut@gmail.com>
|
||||
*
|
||||
* Loosely based on richcomm_usb.c,
|
||||
* Copyright (C) 2007 Peter van Valderen <p.v.valderen@probu.nl>
|
||||
* Dirk Teurlings <dirk@upexia.nl>
|
||||
*
|
||||
* 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 "main.h"
|
||||
#include "usb-common.h"
|
||||
|
||||
/* driver version */
|
||||
#define DRIVER_NAME "'ATCL FOR UPS' USB driver"
|
||||
#define DRIVER_VERSION "1.1"
|
||||
|
||||
/* driver description structure */
|
||||
upsdrv_info_t upsdrv_info = {
|
||||
DRIVER_NAME,
|
||||
DRIVER_VERSION,
|
||||
"Charles Lepple <clepple+nut@gmail.com>",
|
||||
DRV_EXPERIMENTAL,
|
||||
{ NULL }
|
||||
};
|
||||
|
||||
#define STATUS_ENDPOINT (USB_ENDPOINT_IN | 1)
|
||||
#define SHUTDOWN_ENDPOINT (USB_ENDPOINT_OUT | 2)
|
||||
#define STATUS_PACKETSIZE 8
|
||||
#define SHUTDOWN_PACKETSIZE 8
|
||||
|
||||
/* Probably can reduce this, since the pcap file shows mostly 1050-ish ms response times */
|
||||
#define ATCL_USB_TIMEOUT USB_TIMEOUT
|
||||
|
||||
/* limit the amount of spew that goes in the syslog when we lose the UPS (from nut_usb.h) */
|
||||
#define USB_ERR_LIMIT 10 /* start limiting after 10 in a row */
|
||||
#define USB_ERR_RATE 10 /* then only print every 10th error */
|
||||
|
||||
#define USB_VENDOR_STRING "ATCL FOR UPS"
|
||||
|
||||
static usb_device_id_t atcl_usb_id[] = {
|
||||
/* ATCL FOR UPS */
|
||||
{ USB_DEVICE(0x0001, 0x0000), NULL },
|
||||
|
||||
/* end of list */
|
||||
{-1, -1, NULL}
|
||||
};
|
||||
|
||||
static usb_dev_handle *udev = NULL;
|
||||
static USBDevice_t usbdevice;
|
||||
static unsigned int comm_failures = 0;
|
||||
|
||||
static int device_match_func(USBDevice_t *device, void *privdata)
|
||||
{
|
||||
char *requested_vendor;
|
||||
switch (is_usb_device_supported(atcl_usb_id, device))
|
||||
{
|
||||
case SUPPORTED:
|
||||
if(!device->Vendor) {
|
||||
upsdebugx(1, "Couldn't retrieve USB string descriptor for vendor. Check permissions?");
|
||||
requested_vendor = getval("vendor");
|
||||
if(requested_vendor) {
|
||||
if(!strcmp("NULL", requested_vendor)) {
|
||||
upsdebugx(3, "Matched device with NULL vendor string.");
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
upsdebugx(1, "To keep trying (in case your device does not have a vendor string), use vendor=NULL");
|
||||
return 0;
|
||||
}
|
||||
|
||||
if(!strcmp(device->Vendor, USB_VENDOR_STRING)) {
|
||||
upsdebugx(4, "Matched expected vendor='%s'.", USB_VENDOR_STRING);
|
||||
return 1;
|
||||
}
|
||||
/* Didn't match, but the user provided an alternate vendor ID: */
|
||||
requested_vendor = getval("vendor");
|
||||
if(requested_vendor) {
|
||||
if(!strcmp(device->Vendor, requested_vendor)) {
|
||||
upsdebugx(3, "Matched device with vendor='%s'.", requested_vendor);
|
||||
return 1;
|
||||
} else {
|
||||
upsdebugx(2, "idVendor=%04x and idProduct=%04x, but provided vendor '%s' does not match device: '%s'.",
|
||||
device->VendorID, device->ProductID, requested_vendor, device->Vendor);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
/* TODO: automatic way of suggesting other drivers? */
|
||||
upsdebugx(2, "idVendor=%04x and idProduct=%04x, but device vendor string '%s' does not match expected string '%s'. "
|
||||
"Have you tried the nutdrv_qx driver?",
|
||||
device->VendorID, device->ProductID, device->Vendor, USB_VENDOR_STRING);
|
||||
return 0;
|
||||
|
||||
case POSSIBLY_SUPPORTED:
|
||||
case NOT_SUPPORTED:
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
static USBDeviceMatcher_t device_matcher = {
|
||||
&device_match_func,
|
||||
NULL,
|
||||
NULL
|
||||
};
|
||||
|
||||
static int query_ups(char *reply)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = usb_interrupt_read(udev, STATUS_ENDPOINT, reply, STATUS_PACKETSIZE, ATCL_USB_TIMEOUT);
|
||||
|
||||
if (ret <= 0) {
|
||||
upsdebugx(2, "status interrupt read: %s", ret ? usb_strerror() : "timeout");
|
||||
return ret;
|
||||
}
|
||||
|
||||
upsdebug_hex(3, "read", reply, ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void usb_comm_fail(const char *fmt, ...)
|
||||
{
|
||||
int ret;
|
||||
char why[SMALLBUF];
|
||||
va_list ap;
|
||||
|
||||
/* this means we're probably here because select was interrupted */
|
||||
if (exit_flag != 0) {
|
||||
return; /* ignored, since we're about to exit anyway */
|
||||
}
|
||||
|
||||
comm_failures++;
|
||||
|
||||
if ((comm_failures == USB_ERR_LIMIT) || ((comm_failures % USB_ERR_RATE) == 0)) {
|
||||
upslogx(LOG_WARNING, "Warning: excessive comm failures, limiting error reporting");
|
||||
}
|
||||
|
||||
/* once it's past the limit, only log once every USB_ERR_LIMIT calls */
|
||||
if ((comm_failures > USB_ERR_LIMIT) && ((comm_failures % USB_ERR_LIMIT) != 0)) {
|
||||
return;
|
||||
}
|
||||
|
||||
/* generic message if the caller hasn't elaborated */
|
||||
if (!fmt) {
|
||||
upslogx(LOG_WARNING, "Communications with UPS lost - check cabling");
|
||||
return;
|
||||
}
|
||||
|
||||
va_start(ap, fmt);
|
||||
ret = vsnprintf(why, sizeof(why), fmt, ap);
|
||||
va_end(ap);
|
||||
|
||||
if ((ret < 1) || (ret >= (int) sizeof(why))) {
|
||||
upslogx(LOG_WARNING, "usb_comm_fail: vsnprintf needed more than %d bytes", (int)sizeof(why));
|
||||
}
|
||||
|
||||
upslogx(LOG_WARNING, "Communications with UPS lost: %s", why);
|
||||
}
|
||||
|
||||
static void usb_comm_good(void)
|
||||
{
|
||||
if (comm_failures == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
upslogx(LOG_NOTICE, "Communications with UPS re-established");
|
||||
comm_failures = 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Callback that is called by usb_device_open() that handles USB device
|
||||
* settings prior to accepting the devide. At the very least claim the
|
||||
* device here. Detaching the kernel driver will be handled by the
|
||||
* caller, don't do this here. Return < 0 on error, 0 or higher on
|
||||
* success.
|
||||
*/
|
||||
static int driver_callback(usb_dev_handle *handle, USBDevice_t *device)
|
||||
{
|
||||
if (usb_set_configuration(handle, 1) < 0) {
|
||||
upslogx(LOG_WARNING, "Can't set USB configuration: %s", usb_strerror());
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (usb_claim_interface(handle, 0) < 0) {
|
||||
upslogx(LOG_WARNING, "Can't claim USB interface: %s", usb_strerror());
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* TODO: HID SET_IDLE to 0 (not necessary?) */
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int usb_device_close(usb_dev_handle *handle)
|
||||
{
|
||||
if (!handle) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* usb_release_interface() sometimes blocks and goes
|
||||
into uninterruptible sleep. So don't do it. */
|
||||
/* usb_release_interface(handle, 0); */
|
||||
return usb_close(handle);
|
||||
}
|
||||
|
||||
static int usb_device_open(usb_dev_handle **handlep, USBDevice_t *device, USBDeviceMatcher_t *matcher,
|
||||
int (*callback)(usb_dev_handle *handle, USBDevice_t *device))
|
||||
{
|
||||
struct usb_bus *bus;
|
||||
|
||||
/* libusb base init */
|
||||
usb_init();
|
||||
usb_find_busses();
|
||||
usb_find_devices();
|
||||
|
||||
#ifndef __linux__ /* SUN_LIBUSB (confirmed to work on Solaris and FreeBSD) */
|
||||
/* Causes a double free corruption in linux if device is detached! */
|
||||
usb_device_close(*handlep);
|
||||
#endif
|
||||
|
||||
for (bus = usb_busses; bus; bus = bus->next) {
|
||||
|
||||
struct usb_device *dev;
|
||||
usb_dev_handle *handle;
|
||||
|
||||
for (dev = bus->devices; dev; dev = dev->next) {
|
||||
|
||||
int i, ret;
|
||||
USBDeviceMatcher_t *m;
|
||||
|
||||
upsdebugx(3, "Checking USB device [%04x:%04x] (%s/%s)", dev->descriptor.idVendor,
|
||||
dev->descriptor.idProduct, bus->dirname, dev->filename);
|
||||
|
||||
/* supported vendors are now checked by the supplied matcher */
|
||||
|
||||
/* open the device */
|
||||
*handlep = handle = usb_open(dev);
|
||||
if (!handle) {
|
||||
upsdebugx(4, "Failed to open USB device, skipping: %s", usb_strerror());
|
||||
continue;
|
||||
}
|
||||
|
||||
/* collect the identifying information of this
|
||||
device. Note that this is safe, because
|
||||
there's no need to claim an interface for
|
||||
this (and therefore we do not yet need to
|
||||
detach any kernel drivers). */
|
||||
|
||||
free(device->Vendor);
|
||||
free(device->Product);
|
||||
free(device->Serial);
|
||||
free(device->Bus);
|
||||
|
||||
memset(device, 0, sizeof(*device));
|
||||
|
||||
device->VendorID = dev->descriptor.idVendor;
|
||||
device->ProductID = dev->descriptor.idProduct;
|
||||
device->Bus = strdup(bus->dirname);
|
||||
|
||||
if (dev->descriptor.iManufacturer) {
|
||||
char buf[SMALLBUF];
|
||||
ret = usb_get_string_simple(handle, dev->descriptor.iManufacturer,
|
||||
buf, sizeof(buf));
|
||||
if (ret > 0) {
|
||||
device->Vendor = strdup(buf);
|
||||
}
|
||||
}
|
||||
|
||||
if (dev->descriptor.iProduct) {
|
||||
char buf[SMALLBUF];
|
||||
ret = usb_get_string_simple(handle, dev->descriptor.iProduct,
|
||||
buf, sizeof(buf));
|
||||
if (ret > 0) {
|
||||
device->Product = strdup(buf);
|
||||
}
|
||||
}
|
||||
|
||||
if (dev->descriptor.iSerialNumber) {
|
||||
char buf[SMALLBUF];
|
||||
ret = usb_get_string_simple(handle, dev->descriptor.iSerialNumber,
|
||||
buf, sizeof(buf));
|
||||
if (ret > 0) {
|
||||
device->Serial = strdup(buf);
|
||||
}
|
||||
}
|
||||
|
||||
upsdebugx(4, "- VendorID : %04x", device->VendorID);
|
||||
upsdebugx(4, "- ProductID : %04x", device->ProductID);
|
||||
upsdebugx(4, "- Manufacturer : %s", device->Vendor ? device->Vendor : "unknown");
|
||||
upsdebugx(4, "- Product : %s", device->Product ? device->Product : "unknown");
|
||||
upsdebugx(4, "- Serial Number: %s", device->Serial ? device->Serial : "unknown");
|
||||
upsdebugx(4, "- Bus : %s", device->Bus ? device->Bus : "unknown");
|
||||
|
||||
for (m = matcher; m; m = m->next) {
|
||||
|
||||
switch (m->match_function(device, m->privdata))
|
||||
{
|
||||
case 0:
|
||||
upsdebugx(4, "Device does not match - skipping");
|
||||
goto next_device;
|
||||
case -1:
|
||||
fatal_with_errno(EXIT_FAILURE, "matcher");
|
||||
goto next_device;
|
||||
case -2:
|
||||
upsdebugx(4, "matcher: unspecified error");
|
||||
goto next_device;
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < 3; i++) {
|
||||
|
||||
ret = callback(handle, device);
|
||||
if (ret >= 0) {
|
||||
upsdebugx(3, "USB device [%04x:%04x] opened", device->VendorID, device->ProductID);
|
||||
return ret;
|
||||
}
|
||||
#ifdef HAVE_USB_DETACH_KERNEL_DRIVER_NP
|
||||
/* this method requires at least libusb 0.1.8:
|
||||
* it forces device claiming by unbinding
|
||||
* attached driver... From libhid */
|
||||
if (usb_detach_kernel_driver_np(handle, 0) < 0) {
|
||||
upsdebugx(1, "failed to detach kernel driver from USB device: %s", usb_strerror());
|
||||
} else {
|
||||
upsdebugx(4, "detached kernel driver from USB device...");
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
fatalx(EXIT_FAILURE, "USB device [%04x:%04x] matches, but driver callback failed: %s",
|
||||
device->VendorID, device->ProductID, usb_strerror());
|
||||
|
||||
next_device:
|
||||
usb_close(handle);
|
||||
}
|
||||
}
|
||||
|
||||
*handlep = NULL;
|
||||
upsdebugx(3, "No matching USB device found");
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
/*
|
||||
* Initialise the UPS
|
||||
*/
|
||||
void upsdrv_initups(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
upsdebugx(1, "Searching for USB device...");
|
||||
|
||||
for (i = 0; usb_device_open(&udev, &usbdevice, &device_matcher, &driver_callback) < 0; i++) {
|
||||
|
||||
if ((i < 3) && (sleep(5) == 0)) {
|
||||
usb_comm_fail("Can't open USB device, retrying ...");
|
||||
continue;
|
||||
}
|
||||
|
||||
fatalx(EXIT_FAILURE,
|
||||
"Unable to find ATCL FOR UPS\n\n"
|
||||
|
||||
"Things to try:\n"
|
||||
" - Connect UPS device to USB bus\n"
|
||||
" - Run this driver as another user (upsdrvctl -u or 'user=...' in ups.conf).\n"
|
||||
" See upsdrvctl(8) and ups.conf(5).\n\n"
|
||||
|
||||
"Fatal error: unusable configuration");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void upsdrv_cleanup(void)
|
||||
{
|
||||
usb_device_close(udev);
|
||||
|
||||
free(usbdevice.Vendor);
|
||||
free(usbdevice.Product);
|
||||
free(usbdevice.Serial);
|
||||
free(usbdevice.Bus);
|
||||
}
|
||||
|
||||
void upsdrv_initinfo(void)
|
||||
{
|
||||
dstate_setinfo("ups.mfr", "%s", usbdevice.Vendor ? usbdevice.Vendor : "unknown");
|
||||
dstate_setinfo("ups.model", "%s", usbdevice.Product ? usbdevice.Product : "unknown");
|
||||
if(usbdevice.Serial && usbdevice.Product && strcmp(usbdevice.Serial, usbdevice.Product)) {
|
||||
/* Only set "ups.serial" if it isn't the same as "ups.model": */
|
||||
dstate_setinfo("ups.serial", "%s", usbdevice.Serial);
|
||||
}
|
||||
|
||||
dstate_setinfo("ups.vendorid", "%04x", usbdevice.VendorID);
|
||||
dstate_setinfo("ups.productid", "%04x", usbdevice.ProductID);
|
||||
}
|
||||
|
||||
void upsdrv_updateinfo(void)
|
||||
{
|
||||
char reply[STATUS_PACKETSIZE];
|
||||
int ret;
|
||||
|
||||
if (!udev) {
|
||||
ret = usb_device_open(&udev, &usbdevice, &device_matcher, &driver_callback);
|
||||
|
||||
if (ret < 0) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
ret = query_ups(reply);
|
||||
|
||||
if (ret != STATUS_PACKETSIZE) {
|
||||
usb_comm_fail("Query to UPS failed");
|
||||
dstate_datastale();
|
||||
|
||||
usb_device_close(udev);
|
||||
udev = NULL;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
usb_comm_good();
|
||||
dstate_dataok();
|
||||
|
||||
status_init();
|
||||
|
||||
switch(reply[0]) {
|
||||
case 3:
|
||||
upsdebugx(2, "reply[0] = 0x%02x -> OL", reply[0]);
|
||||
status_set("OL");
|
||||
break;
|
||||
case 2:
|
||||
upsdebugx(2, "reply[0] = 0x%02x -> LB", reply[0]);
|
||||
status_set("LB");
|
||||
/* fall through */
|
||||
case 1:
|
||||
upsdebugx(2, "reply[0] = 0x%02x -> OB", reply[0]);
|
||||
status_set("OB");
|
||||
break;
|
||||
default:
|
||||
upslogx(LOG_ERR, "Unknown status: 0x%02x", reply[0]);
|
||||
}
|
||||
if(strnlen(reply + 1, 7) != 0) {
|
||||
upslogx(LOG_NOTICE, "Status bytes 1-7 are not all zero");
|
||||
}
|
||||
|
||||
status_commit();
|
||||
}
|
||||
|
||||
/* If the UPS is on battery, it should shut down about 30 seconds after
|
||||
* receiving this packet.
|
||||
*/
|
||||
void upsdrv_shutdown(void)
|
||||
{
|
||||
const char shutdown_packet[SHUTDOWN_PACKETSIZE] = { 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
|
||||
int ret;
|
||||
|
||||
upslogx(LOG_DEBUG, "%s: attempting to call usb_interrupt_write(01 00 00 00 00 00 00 00)", __func__);
|
||||
|
||||
ret = usb_interrupt_write(udev, SHUTDOWN_ENDPOINT, (char *)shutdown_packet, SHUTDOWN_PACKETSIZE, ATCL_USB_TIMEOUT);
|
||||
|
||||
if (ret <= 0) {
|
||||
upslogx(LOG_NOTICE, "%s: first usb_interrupt_write() failed: %s", __func__, ret ? usb_strerror() : "timeout");
|
||||
}
|
||||
|
||||
/* Totally guessing from the .pcap file here. TODO: configurable delay? */
|
||||
usleep(170*1000);
|
||||
|
||||
ret = usb_interrupt_write(udev, SHUTDOWN_ENDPOINT, (char *)shutdown_packet, SHUTDOWN_PACKETSIZE, ATCL_USB_TIMEOUT);
|
||||
|
||||
if (ret <= 0) {
|
||||
upslogx(LOG_ERR, "%s: second usb_interrupt_write() failed: %s", __func__, ret ? usb_strerror() : "timeout");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void upsdrv_help(void)
|
||||
{
|
||||
}
|
||||
|
||||
void upsdrv_makevartable(void)
|
||||
{
|
||||
addvar(VAR_VALUE, "vendor", "USB vendor string (or NULL if none)");
|
||||
}
|
||||
|
|
@ -33,7 +33,7 @@
|
|||
*
|
||||
*/
|
||||
|
||||
#define DRIVER_VERSION "0.01"
|
||||
#define DRIVER_VERSION "0.06"
|
||||
|
||||
#include "main.h"
|
||||
|
||||
|
|
@ -66,17 +66,22 @@
|
|||
#include "nutdrv_qx_megatec.h"
|
||||
#include "nutdrv_qx_megatec-old.h"
|
||||
#include "nutdrv_qx_mustek.h"
|
||||
#include "nutdrv_qx_q1.h"
|
||||
#include "nutdrv_qx_voltronic.h"
|
||||
#include "nutdrv_qx_voltronic-qs.h"
|
||||
#include "nutdrv_qx_zinto.h"
|
||||
|
||||
/* Master list of avaiable subdrivers */
|
||||
static subdriver_t *subdriver_list[] = {
|
||||
&voltronic_subdriver,
|
||||
&voltronic_qs_subdriver,
|
||||
&mustek_subdriver,
|
||||
&megatec_old_subdriver,
|
||||
&megatec_subdriver,
|
||||
&mecer_subdriver,
|
||||
&megatec_subdriver,
|
||||
&zinto_subdriver,
|
||||
/* Fallback Q1 subdriver */
|
||||
&q1_subdriver,
|
||||
NULL
|
||||
};
|
||||
|
||||
|
|
@ -534,7 +539,7 @@ static int phoenix_command(const char *cmd, char *buf, size_t buflen)
|
|||
static int ippon_command(const char *cmd, char *buf, size_t buflen)
|
||||
{
|
||||
char tmp[64];
|
||||
int ret;
|
||||
int ret, len;
|
||||
size_t i;
|
||||
|
||||
/* Send command */
|
||||
|
|
@ -562,10 +567,19 @@ static int ippon_command(const char *cmd, char *buf, size_t buflen)
|
|||
return ret;
|
||||
}
|
||||
|
||||
snprintf(buf, buflen, "%.*s", ret, tmp);
|
||||
|
||||
upsdebugx(3, "read: %.*s", (int)strcspn(buf, "\r"), buf);
|
||||
return ret;
|
||||
/*
|
||||
* As Ippon will always return 64 bytes in response, we have to
|
||||
* calculate and return length of actual response data here.
|
||||
* Empty response will look like 0x00 0x0D, otherwise it will be
|
||||
* data string terminated by 0x0D.
|
||||
*/
|
||||
len = (int)strcspn(tmp, "\r");
|
||||
upsdebugx(3, "read: %.*s", len, tmp);
|
||||
if (len > 0) {
|
||||
len ++;
|
||||
}
|
||||
snprintf(buf, buflen, "%.*s", len, tmp);
|
||||
return len;
|
||||
}
|
||||
|
||||
/* Krauler communication subdriver */
|
||||
|
|
@ -1759,7 +1773,9 @@ static int qx_command(const char *cmd, char *buf, size_t buflen)
|
|||
|
||||
case -ETIMEDOUT: /* Connection timed out */
|
||||
case -EOVERFLOW: /* Value too large for defined data type */
|
||||
#ifdef EPROTO
|
||||
case -EPROTO: /* Protocol error */
|
||||
#endif
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -45,7 +45,11 @@
|
|||
#define DEFAULT_OFFDELAY "30" /* Delay before power off, in seconds */
|
||||
#define DEFAULT_POLLFREQ 30 /* Polling interval between full updates, in seconds; the driver will do quick polls in the meantime */
|
||||
|
||||
#ifndef TRUE
|
||||
typedef enum { FALSE, TRUE } bool_t;
|
||||
#else
|
||||
typedef int bool_t;
|
||||
#endif
|
||||
|
||||
/* Structure for rw vars */
|
||||
typedef struct {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* nutdrv_qx_blazer-common.c - Common functions/settings for nutdrv_qx_{mecer,megatec,megatec-old,mustek,zinto}.{c,h}
|
||||
/* nutdrv_qx_blazer-common.c - Common functions/settings for nutdrv_qx_{mecer,megatec,megatec-old,mustek,q1,voltronic-qs,zinto}.{c,h}
|
||||
*
|
||||
* Copyright (C)
|
||||
* 2013 Daniele Pezzini <hyouko@gmail.com>
|
||||
|
|
@ -88,6 +88,30 @@ int blazer_claim(void) {
|
|||
|
||||
}
|
||||
|
||||
/* This function allows the subdriver to "claim" a device: return 1 if the device is supported by this subdriver, else 0.
|
||||
* NOTE: this 'light' version only checks for status (Q1/QS/D/..) */
|
||||
int blazer_claim_light(void) {
|
||||
|
||||
/* To tell whether the UPS is supported or not, we'll check just status (Q1/QS/D/..). */
|
||||
|
||||
item_t *item = find_nut_info("input.voltage", 0, 0);
|
||||
|
||||
/* Don't know what happened */
|
||||
if (!item)
|
||||
return 0;
|
||||
|
||||
/* No reply/Unable to get value */
|
||||
if (qx_process(item, NULL))
|
||||
return 0;
|
||||
|
||||
/* Unable to process value */
|
||||
if (ups_infoval_set(item) != 1)
|
||||
return 0;
|
||||
|
||||
return 1;
|
||||
|
||||
}
|
||||
|
||||
/* Subdriver-specific flags/vars */
|
||||
void blazer_makevartable(void)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* nutdrv_qx_blazer-common.h - Common functions/settings for nutdrv_qx_{mecer,megatec,megatec-old,mustek,zinto}.{c,h}
|
||||
/* nutdrv_qx_blazer-common.h - Common functions/settings for nutdrv_qx_{mecer,megatec,megatec-old,mustek,q1,voltronic-qs,zinto}.{c,h}
|
||||
*
|
||||
* Copyright (C)
|
||||
* 2013 Daniele Pezzini <hyouko@gmail.com>
|
||||
|
|
@ -28,6 +28,7 @@
|
|||
void blazer_makevartable(void);
|
||||
void blazer_initups(item_t *qx2nut);
|
||||
int blazer_claim(void);
|
||||
int blazer_claim_light(void);
|
||||
|
||||
/* Preprocess functions */
|
||||
int blazer_process_command(item_t *item, char *value, size_t valuelen);
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* nutdrv_qx_mecer.c - Subdriver for Mecer UPSes
|
||||
/* nutdrv_qx_mecer.c - Subdriver for Mecer/Voltronic Power P98 UPSes
|
||||
*
|
||||
* Copyright (C)
|
||||
* 2013 Daniele Pezzini <hyouko@gmail.com>
|
||||
|
|
@ -25,11 +25,29 @@
|
|||
|
||||
#include "nutdrv_qx_mecer.h"
|
||||
|
||||
#define MECER_VERSION "Mecer 0.01"
|
||||
#define MECER_VERSION "Mecer 0.02"
|
||||
|
||||
/* qx2nut lookup table */
|
||||
/* Support functions */
|
||||
static int mecer_claim(void);
|
||||
static void mecer_initups(void);
|
||||
|
||||
/* Preprocess functions */
|
||||
static int voltronic_p98_protocol(item_t *item, char *value, size_t valuelen);
|
||||
static int mecer_process_test_battery(item_t *item, char *value, size_t valuelen);
|
||||
|
||||
|
||||
/* == qx2nut lookup table == */
|
||||
static item_t mecer_qx2nut[] = {
|
||||
|
||||
/* Query UPS for protocol (Voltronic Power UPSes)
|
||||
* > [QPI\r]
|
||||
* < [(PI98\r]
|
||||
* 012345
|
||||
* 0
|
||||
*/
|
||||
|
||||
{ "ups.firmware.aux", 0, NULL, "QPI\r", "", 6, '(', "", 1, 4, "%s", QX_FLAG_STATIC, voltronic_p98_protocol },
|
||||
|
||||
/*
|
||||
* > [Q1\r]
|
||||
* < [(226.0 195.0 226.0 014 49.0 27.5 30.0 00001000\r]
|
||||
|
|
@ -87,7 +105,7 @@ static item_t mecer_qx2nut[] = {
|
|||
{ "shutdown.return", 0, NULL, "S%s\r", "", 5, '(', "", 1, 3, NULL, QX_FLAG_CMD, blazer_process_command },
|
||||
{ "shutdown.stayoff", 0, NULL, "S%sR0000\r", "", 5, '(', "", 1, 3, NULL, QX_FLAG_CMD, blazer_process_command },
|
||||
{ "shutdown.stop", 0, NULL, "C\r", "", 5, '(', "", 1, 3, NULL, QX_FLAG_CMD, NULL },
|
||||
{ "test.battery.start", 0, NULL, "T%02d\r", "", 5, '(', "", 1, 3, NULL, QX_FLAG_CMD, blazer_process_command },
|
||||
{ "test.battery.start", 0, NULL, "T%s\r", "", 5, '(', "", 1, 3, NULL, QX_FLAG_CMD, mecer_process_test_battery },
|
||||
{ "test.battery.start.deep", 0, NULL, "TL\r", "", 5, '(', "", 1, 3, NULL, QX_FLAG_CMD, NULL },
|
||||
{ "test.battery.start.quick", 0, NULL, "T\r", "", 5, '(', "", 1, 3, NULL, QX_FLAG_CMD, NULL },
|
||||
{ "test.battery.stop", 0, NULL, "CT\r", "", 5, '(', "", 1, 3, NULL, QX_FLAG_CMD, NULL },
|
||||
|
|
@ -100,10 +118,12 @@ static item_t mecer_qx2nut[] = {
|
|||
{ NULL, 0, NULL, NULL, "", 0, 0, "", 0, 0, NULL, 0, NULL }
|
||||
};
|
||||
|
||||
/* Testing table */
|
||||
|
||||
/* == Testing table == */
|
||||
#ifdef TESTING
|
||||
static testing_t mecer_testing[] = {
|
||||
{ "Q1\r", "(215.0 195.0 230.0 014 49.0 22.7 30.0 00000000\r" },
|
||||
{ "QPI\r", "(PI98\r" },
|
||||
{ "F\r", "#230.0 000 024.0 50.0\r" },
|
||||
{ "I\r", "#NOT_A_LIVE_UPS TESTING TESTING \r" },
|
||||
{ "Q\r", "(ACK\r" },
|
||||
|
|
@ -119,6 +139,68 @@ static testing_t mecer_testing[] = {
|
|||
};
|
||||
#endif /* TESTING */
|
||||
|
||||
|
||||
/* == Support functions == */
|
||||
|
||||
/* This function allows the subdriver to "claim" a device: return 1 if the device is supported by this subdriver, else 0. */
|
||||
static int mecer_claim(void)
|
||||
{
|
||||
|
||||
/* Apart from status (Q1), try to identify protocol (QPI, for Voltronic Power P98 units) or whether the UPS uses '(ACK\r'/'(NAK\r' replies */
|
||||
|
||||
item_t *item = find_nut_info("input.voltage", 0, 0);
|
||||
|
||||
/* Don't know what happened */
|
||||
if (!item)
|
||||
return 0;
|
||||
|
||||
/* No reply/Unable to get value */
|
||||
if (qx_process(item, NULL))
|
||||
return 0;
|
||||
|
||||
/* Unable to process value */
|
||||
if (ups_infoval_set(item) != 1)
|
||||
return 0;
|
||||
|
||||
/* UPS Protocol */
|
||||
item = find_nut_info("ups.firmware.aux", 0, 0);
|
||||
|
||||
/* Don't know what happened */
|
||||
if (!item) {
|
||||
dstate_delinfo("input.voltage");
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* No reply/Unable to get value/Command rejected */
|
||||
if (qx_process(item, NULL)) {
|
||||
|
||||
/* No reply/Command echoed back or rejected with something other than '(NAK\r' -> Not a '(ACK/(NAK' unit */
|
||||
if (!strlen(item->answer) || strcasecmp(item->answer, "(NAK\r")) {
|
||||
dstate_delinfo("input.voltage");
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Command rejected with '(NAK\r' -> '(ACK/(NAK' unit */
|
||||
|
||||
/* Skip protocol query from now on */
|
||||
item->qxflags |= QX_FLAG_SKIP;
|
||||
|
||||
} else {
|
||||
|
||||
/* Unable to process value/Command echoed back or rejected with something other than '(NAK\r'/Protocol not supported */
|
||||
if (ups_infoval_set(item) != 1) {
|
||||
dstate_delinfo("input.voltage");
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Voltronic Power P98 unit */
|
||||
|
||||
}
|
||||
|
||||
return 1;
|
||||
|
||||
}
|
||||
|
||||
/* Subdriver-specific initups */
|
||||
static void mecer_initups(void)
|
||||
{
|
||||
|
|
@ -127,10 +209,72 @@ static void mecer_initups(void)
|
|||
|
||||
}
|
||||
|
||||
/* Subdriver interface */
|
||||
|
||||
/* == Preprocess functions == */
|
||||
|
||||
/* Protocol used by the UPS */
|
||||
static int voltronic_p98_protocol(item_t *item, char *value, size_t valuelen)
|
||||
{
|
||||
if (strcasecmp(item->value, "PI98")) {
|
||||
upslogx(LOG_ERR, "Protocol [%s] is not supported by this driver", item->value);
|
||||
return -1;
|
||||
}
|
||||
|
||||
snprintf(value, valuelen, item->dfl, "Voltronic Power P98");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* *CMD* Preprocess 'test.battery.start' instant command */
|
||||
static int mecer_process_test_battery(item_t *item, char *value, size_t valuelen)
|
||||
{
|
||||
const char *protocol = dstate_getinfo("ups.firmware.aux");
|
||||
char buf[SMALLBUF] = "";
|
||||
int min, test_time;
|
||||
|
||||
/* Voltronic P98 units -> Accepted values for test time: .2 -> .9 (.2=12sec ..), 01 -> 99 (minutes) -> range = [12..5940] */
|
||||
if (protocol && !strcasecmp(protocol, "Voltronic Power P98"))
|
||||
min = 12;
|
||||
/* Other units: 01 -> 99 (minutes) -> [60..5940] */
|
||||
else
|
||||
min = 60;
|
||||
|
||||
if (strlen(value) != strspn(value, "0123456789")) {
|
||||
upslogx(LOG_ERR, "%s: non numerical value [%s]", item->info_type, value);
|
||||
return -1;
|
||||
}
|
||||
|
||||
test_time = strlen(value) > 0 ? strtol(value, NULL, 10) : 600;
|
||||
|
||||
if ((test_time < min) || (test_time > 5940)) {
|
||||
upslogx(LOG_ERR, "%s: battery test time '%d' out of range [%d..5940] seconds", item->info_type, test_time, min);
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* test time < 1 minute */
|
||||
if (test_time < 60) {
|
||||
|
||||
test_time = test_time / 6;
|
||||
snprintf(buf, sizeof(buf), ".%d", test_time);
|
||||
|
||||
/* test time > 1 minute */
|
||||
} else {
|
||||
|
||||
test_time = test_time / 60;
|
||||
snprintf(buf, sizeof(buf), "%02d", test_time);
|
||||
|
||||
}
|
||||
|
||||
snprintf(value, valuelen, item->command, buf);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/* == Subdriver interface == */
|
||||
subdriver_t mecer_subdriver = {
|
||||
MECER_VERSION,
|
||||
blazer_claim,
|
||||
mecer_claim,
|
||||
mecer_qx2nut,
|
||||
mecer_initups,
|
||||
NULL,
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* nutdrv_qx_mecer.h - Subdriver for Mecer UPSes
|
||||
/* nutdrv_qx_mecer.h - Subdriver for Mecer/Voltronic Power P98 UPSes
|
||||
*
|
||||
* Copyright (C)
|
||||
* 2013 Daniele Pezzini <hyouko@gmail.com>
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@
|
|||
|
||||
#include "nutdrv_qx_megatec-old.h"
|
||||
|
||||
#define MEGATEC_OLD_VERSION "Megatec/old 0.01"
|
||||
#define MEGATEC_OLD_VERSION "Megatec/old 0.02"
|
||||
|
||||
/* qx2nut lookup table */
|
||||
static item_t megatec_old_qx2nut[] = {
|
||||
|
|
@ -128,7 +128,7 @@ static void megatec_old_initups(void)
|
|||
/* Subdriver interface */
|
||||
subdriver_t megatec_old_subdriver = {
|
||||
MEGATEC_OLD_VERSION,
|
||||
blazer_claim,
|
||||
blazer_claim_light,
|
||||
megatec_old_qx2nut,
|
||||
megatec_old_initups,
|
||||
NULL,
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@
|
|||
|
||||
#include "nutdrv_qx_mustek.h"
|
||||
|
||||
#define MUSTEK_VERSION "Mustek 0.01"
|
||||
#define MUSTEK_VERSION "Mustek 0.02"
|
||||
|
||||
/* qx2nut lookup table */
|
||||
static item_t mustek_qx2nut[] = {
|
||||
|
|
@ -128,7 +128,7 @@ static void mustek_initups(void)
|
|||
/* Subdriver interface */
|
||||
subdriver_t mustek_subdriver = {
|
||||
MUSTEK_VERSION,
|
||||
blazer_claim,
|
||||
blazer_claim_light,
|
||||
mustek_qx2nut,
|
||||
mustek_initups,
|
||||
NULL,
|
||||
|
|
|
|||
118
drivers/nutdrv_qx_q1.c
Normal file
118
drivers/nutdrv_qx_q1.c
Normal file
|
|
@ -0,0 +1,118 @@
|
|||
/* nutdrv_qx_q1.c - Subdriver for Q1 protocol based UPSes
|
||||
*
|
||||
* Copyright (C)
|
||||
* 2013 Daniele Pezzini <hyouko@gmail.com>
|
||||
*
|
||||
* 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
|
||||
*
|
||||
* NOTE:
|
||||
* This subdriver implements the same protocol as the one used by the 'megatec' subdriver minus the vendor (I) and ratings (F) queries.
|
||||
* In the claim function:
|
||||
* - it doesn't even try to get 'vendor' informations (I)
|
||||
* - it checks only status (Q1), through 'input.voltage' variable
|
||||
* Therefore it should be able to work even if the UPS doesn't support vendor/ratings *and* the user doesn't use the 'novendor'/'norating' flags, as long as:
|
||||
* - the UPS replies a Q1-compliant answer (i.e. not necessary filled with all of the Q1-required data, but at least of the right length and with not available data filled with some replacement character)
|
||||
* - the UPS reports a valid input.voltage (used in the claim function)
|
||||
* - the UPS reports valid status bits (1st, 2nd, 3rd, 6th, 7th are the mandatory ones)
|
||||
*
|
||||
*/
|
||||
|
||||
#include "main.h"
|
||||
#include "nutdrv_qx.h"
|
||||
#include "nutdrv_qx_blazer-common.h"
|
||||
|
||||
#include "nutdrv_qx_q1.h"
|
||||
|
||||
#define Q1_VERSION "Q1 0.02"
|
||||
|
||||
/* qx2nut lookup table */
|
||||
static item_t q1_qx2nut[] = {
|
||||
|
||||
/*
|
||||
* > [Q1\r]
|
||||
* < [(226.0 195.0 226.0 014 49.0 27.5 30.0 00001000\r]
|
||||
* 01234567890123456789012345678901234567890123456
|
||||
* 0 1 2 3 4
|
||||
*/
|
||||
|
||||
{ "input.voltage", 0, NULL, "Q1\r", "", 47, '(', "", 1, 5, "%.1f", 0, NULL },
|
||||
{ "input.voltage.fault", 0, NULL, "Q1\r", "", 47, '(', "", 7, 11, "%.1f", 0, NULL },
|
||||
{ "output.voltage", 0, NULL, "Q1\r", "", 47, '(', "", 13, 17, "%.1f", 0, NULL },
|
||||
{ "ups.load", 0, NULL, "Q1\r", "", 47, '(', "", 19, 21, "%.0f", 0, NULL },
|
||||
{ "input.frequency", 0, NULL, "Q1\r", "", 47, '(', "", 23, 26, "%.1f", 0, NULL },
|
||||
{ "battery.voltage", 0, NULL, "Q1\r", "", 47, '(', "", 28, 31, "%.2f", 0, NULL },
|
||||
{ "ups.temperature", 0, NULL, "Q1\r", "", 47, '(', "", 33, 36, "%.1f", 0, NULL },
|
||||
/* Status bits */
|
||||
{ "ups.status", 0, NULL, "Q1\r", "", 47, '(', "", 38, 38, NULL, QX_FLAG_QUICK_POLL, blazer_process_status_bits }, /* Utility Fail (Immediate) */
|
||||
{ "ups.status", 0, NULL, "Q1\r", "", 47, '(', "", 39, 39, NULL, QX_FLAG_QUICK_POLL, blazer_process_status_bits }, /* Battery Low */
|
||||
{ "ups.status", 0, NULL, "Q1\r", "", 47, '(', "", 40, 40, NULL, QX_FLAG_QUICK_POLL, blazer_process_status_bits }, /* Bypass/Boost or Buck Active */
|
||||
{ "ups.alarm", 0, NULL, "Q1\r", "", 47, '(', "", 41, 41, NULL, 0, blazer_process_status_bits }, /* UPS Failed */
|
||||
{ "ups.type", 0, NULL, "Q1\r", "", 47, '(', "", 42, 42, "%s", QX_FLAG_STATIC, blazer_process_status_bits }, /* UPS Type */
|
||||
{ "ups.status", 0, NULL, "Q1\r", "", 47, '(', "", 43, 43, NULL, QX_FLAG_QUICK_POLL, blazer_process_status_bits }, /* Test in Progress */
|
||||
{ "ups.alarm", 0, NULL, "Q1\r", "", 47, '(', "", 44, 44, NULL, 0, blazer_process_status_bits }, /* Shutdown Active */
|
||||
{ "ups.status", 0, NULL, "Q1\r", "", 47, '(', "", 44, 44, NULL, QX_FLAG_QUICK_POLL, blazer_process_status_bits }, /* Shutdown Active */
|
||||
{ "ups.beeper.status", 0, NULL, "Q1\r", "", 47, '(', "", 45, 45, "%s", 0, blazer_process_status_bits }, /* Beeper status */
|
||||
|
||||
/* Instant commands */
|
||||
{ "beeper.toggle", 0, NULL, "Q\r", "", 0, 0, "", 0, 0, NULL, QX_FLAG_CMD, NULL },
|
||||
{ "load.off", 0, NULL, "S00R0000\r", "", 0, 0, "", 0, 0, NULL, QX_FLAG_CMD, NULL },
|
||||
{ "load.on", 0, NULL, "C\r", "", 0, 0, "", 0, 0, NULL, QX_FLAG_CMD, NULL },
|
||||
{ "shutdown.return", 0, NULL, "S%s\r", "", 0, 0, "", 0, 0, NULL, QX_FLAG_CMD, blazer_process_command },
|
||||
{ "shutdown.stayoff", 0, NULL, "S%sR0000\r", "", 0, 0, "", 0, 0, NULL, QX_FLAG_CMD, blazer_process_command },
|
||||
{ "shutdown.stop", 0, NULL, "C\r", "", 0, 0, "", 0, 0, NULL, QX_FLAG_CMD, NULL },
|
||||
{ "test.battery.start", 0, NULL, "T%02d\r", "", 0, 0, "", 0, 0, NULL, QX_FLAG_CMD, blazer_process_command },
|
||||
{ "test.battery.start.deep", 0, NULL, "TL\r", "", 0, 0, "", 0, 0, NULL, QX_FLAG_CMD, NULL },
|
||||
{ "test.battery.start.quick", 0, NULL, "T\r", "", 0, 0, "", 0, 0, NULL, QX_FLAG_CMD, NULL },
|
||||
{ "test.battery.stop", 0, NULL, "CT\r", "", 0, 0, "", 0, 0, NULL, QX_FLAG_CMD, NULL },
|
||||
|
||||
/* Server-side settable vars */
|
||||
{ "ups.delay.start", ST_FLAG_RW, blazer_r_ondelay, NULL, "", 0, 0, "", 0, 0, DEFAULT_ONDELAY, QX_FLAG_ABSENT | QX_FLAG_SETVAR | QX_FLAG_RANGE, blazer_process_setvar },
|
||||
{ "ups.delay.shutdown", ST_FLAG_RW, blazer_r_offdelay, NULL, "", 0, 0, "", 0, 0, DEFAULT_OFFDELAY, QX_FLAG_ABSENT | QX_FLAG_SETVAR | QX_FLAG_RANGE, blazer_process_setvar },
|
||||
|
||||
/* End of structure. */
|
||||
{ NULL, 0, NULL, NULL, "", 0, 0, "", 0, 0, NULL, 0, NULL }
|
||||
};
|
||||
|
||||
/* Testing table */
|
||||
#ifdef TESTING
|
||||
static testing_t q1_testing[] = {
|
||||
{ "Q1\r", "(215.0 195.0 230.0 014 49.0 22.7 30.0 00000000\r" },
|
||||
{ "Q\r", "" },
|
||||
{ "S03\r", "" },
|
||||
{ "C\r", "" },
|
||||
{ "S02R0005\r", "" },
|
||||
{ "S.5R0000\r", "" },
|
||||
{ "T04\r", "" },
|
||||
{ "TL\r", "" },
|
||||
{ "T\r", "" },
|
||||
{ "CT\r", "" },
|
||||
{ NULL }
|
||||
};
|
||||
#endif /* TESTING */
|
||||
|
||||
/* Subdriver interface */
|
||||
subdriver_t q1_subdriver = {
|
||||
Q1_VERSION,
|
||||
blazer_claim_light,
|
||||
q1_qx2nut,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
"ACK",
|
||||
NULL,
|
||||
#ifdef TESTING
|
||||
q1_testing,
|
||||
#endif /* TESTING */
|
||||
};
|
||||
39
drivers/nutdrv_qx_q1.h
Normal file
39
drivers/nutdrv_qx_q1.h
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
/* nutdrv_qx_q1.h - Subdriver for Q1 protocol based UPSes
|
||||
*
|
||||
* Copyright (C)
|
||||
* 2013 Daniele Pezzini <hyouko@gmail.com>
|
||||
*
|
||||
* 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
|
||||
*
|
||||
* NOTE:
|
||||
* This subdriver implements the same protocol as the one used by the 'megatec' subdriver minus the vendor (I) and ratings (F) queries.
|
||||
* In the claim function:
|
||||
* - it doesn't even try to get 'vendor' informations (I)
|
||||
* - it checks only status (Q1), through 'input.voltage' variable
|
||||
* Therefore it should be able to work even if the UPS doesn't support vendor/ratings *and* the user doesn't use the 'novendor'/'norating' flags, as long as:
|
||||
* - the UPS replies a Q1-compliant answer (i.e. not necessary filled with all of the Q1-required data, but at least of the right length and with not available data filled with some replacement character)
|
||||
* - the UPS reports a valid input.voltage (used in the claim function)
|
||||
* - the UPS reports valid status bits (1st, 2nd, 3rd, 6th, 7th are the mandatory ones)
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef NUTDRV_QX_Q1_H
|
||||
#define NUTDRV_QX_Q1_H
|
||||
|
||||
#include "nutdrv_qx.h"
|
||||
|
||||
extern subdriver_t q1_subdriver;
|
||||
|
||||
#endif /* NUTDRV_QX_Q1_H */
|
||||
214
drivers/nutdrv_qx_voltronic-qs.c
Normal file
214
drivers/nutdrv_qx_voltronic-qs.c
Normal file
|
|
@ -0,0 +1,214 @@
|
|||
/* nutdrv_qx_voltronic-qs.c - Subdriver for Voltronic Power UPSes with QS protocol
|
||||
*
|
||||
* Copyright (C)
|
||||
* 2013 Daniele Pezzini <hyouko@gmail.com>
|
||||
*
|
||||
* 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 "main.h"
|
||||
#include "nutdrv_qx.h"
|
||||
#include "nutdrv_qx_blazer-common.h"
|
||||
|
||||
#include "nutdrv_qx_voltronic-qs.h"
|
||||
|
||||
#define VOLTRONIC_QS_VERSION "Voltronic-QS 0.01"
|
||||
|
||||
/* Support functions */
|
||||
static int voltronic_qs_claim(void);
|
||||
|
||||
/* Preprocess functions */
|
||||
static int voltronic_qs_protocol(item_t *item, char *value, size_t valuelen);
|
||||
|
||||
|
||||
/* == Ranges == */
|
||||
|
||||
/* Range for ups.delay.start */
|
||||
static info_rw_t voltronic_qs_r_ondelay[] = {
|
||||
{ "60", 0 },
|
||||
{ "599940", 0 },
|
||||
{ "", 0 }
|
||||
};
|
||||
|
||||
/* Range for ups.delay.shutdown */
|
||||
static info_rw_t voltronic_qs_r_offdelay[] = {
|
||||
{ "12", 0 },
|
||||
{ "540", 0 },
|
||||
{ "", 0 }
|
||||
};
|
||||
|
||||
|
||||
/* == qx2nut lookup table == */
|
||||
static item_t voltronic_qs_qx2nut[] = {
|
||||
|
||||
/* Query UPS for protocol
|
||||
* > [M\r]
|
||||
* < [V\r]
|
||||
* 01
|
||||
* 0
|
||||
*/
|
||||
|
||||
{ "ups.firmware.aux", 0, NULL, "M\r", "", 2, 0, "", 0, 0, "%s", QX_FLAG_STATIC, voltronic_qs_protocol },
|
||||
|
||||
/* Query UPS for status
|
||||
* > [QS\r]
|
||||
* < [(226.0 195.0 226.0 014 49.0 27.5 30.0 00001000\r]
|
||||
* 01234567890123456789012345678901234567890123456
|
||||
* 0 1 2 3 4
|
||||
*/
|
||||
|
||||
{ "input.voltage", 0, NULL, "QS\r", "", 47, '(', "", 1, 5, "%.1f", 0, NULL },
|
||||
{ "input.voltage.fault", 0, NULL, "QS\r", "", 47, '(', "", 7, 11, "%.1f", 0, NULL },
|
||||
{ "output.voltage", 0, NULL, "QS\r", "", 47, '(', "", 13, 17, "%.1f", 0, NULL },
|
||||
{ "ups.load", 0, NULL, "QS\r", "", 47, '(', "", 19, 21, "%.0f", 0, NULL },
|
||||
{ "input.frequency", 0, NULL, "QS\r", "", 47, '(', "", 23, 26, "%.1f", 0, NULL },
|
||||
{ "battery.voltage", 0, NULL, "QS\r", "", 47, '(', "", 28, 31, "%.2f", 0, NULL },
|
||||
{ "ups.temperature", 0, NULL, "QS\r", "", 47, '(', "", 33, 36, "%.1f", 0, NULL },
|
||||
/* Status bits */
|
||||
{ "ups.status", 0, NULL, "QS\r", "", 47, '(', "", 38, 38, NULL, QX_FLAG_QUICK_POLL, blazer_process_status_bits }, /* Utility Fail (Immediate) */
|
||||
{ "ups.status", 0, NULL, "QS\r", "", 47, '(', "", 39, 39, NULL, QX_FLAG_QUICK_POLL, blazer_process_status_bits }, /* Battery Low */
|
||||
{ "ups.status", 0, NULL, "QS\r", "", 47, '(', "", 40, 40, NULL, QX_FLAG_QUICK_POLL, blazer_process_status_bits }, /* Bypass/Boost or Buck Active */
|
||||
{ "ups.alarm", 0, NULL, "QS\r", "", 47, '(', "", 41, 41, NULL, 0, blazer_process_status_bits }, /* UPS Failed */
|
||||
{ "ups.type", 0, NULL, "QS\r", "", 47, '(', "", 42, 42, "%s", QX_FLAG_STATIC, blazer_process_status_bits }, /* UPS Type */
|
||||
{ "ups.status", 0, NULL, "QS\r", "", 47, '(', "", 43, 43, NULL, QX_FLAG_QUICK_POLL, blazer_process_status_bits }, /* Test in Progress */
|
||||
{ "ups.alarm", 0, NULL, "QS\r", "", 47, '(', "", 44, 44, NULL, 0, blazer_process_status_bits }, /* Shutdown Active */
|
||||
{ "ups.status", 0, NULL, "QS\r", "", 47, '(', "", 44, 44, NULL, QX_FLAG_QUICK_POLL, blazer_process_status_bits }, /* Shutdown Active */
|
||||
{ "ups.beeper.status", 0, NULL, "QS\r", "", 47, '(', "", 45, 45, "%s", 0, blazer_process_status_bits }, /* Beeper status */
|
||||
|
||||
/* Query UPS for ratings
|
||||
* > [F\r]
|
||||
* < [#220.0 000 024.0 50.0\r]
|
||||
* 0123456789012345678901
|
||||
* 0 1 2
|
||||
*/
|
||||
|
||||
{ "input.voltage.nominal", 0, NULL, "F\r", "", 22, '#', "", 1, 5, "%.0f", QX_FLAG_STATIC, NULL },
|
||||
{ "input.current.nominal", 0, NULL, "F\r", "", 22, '#', "", 7, 9, "%.1f", QX_FLAG_STATIC, NULL },
|
||||
{ "battery.voltage.nominal", 0, NULL, "F\r", "", 22, '#', "", 11, 15, "%.1f", QX_FLAG_STATIC, NULL },
|
||||
{ "input.frequency.nominal", 0, NULL, "F\r", "", 22, '#', "", 17, 20, "%.0f", QX_FLAG_STATIC, NULL },
|
||||
|
||||
/* Instant commands */
|
||||
{ "beeper.toggle", 0, NULL, "Q\r", "", 0, 0, "", 1, 3, NULL, QX_FLAG_CMD, NULL },
|
||||
{ "load.off", 0, NULL, "S00R0000\r", "", 0, 0, "", 1, 3, NULL, QX_FLAG_CMD, NULL },
|
||||
{ "load.on", 0, NULL, "C\r", "", 0, 0, "", 1, 3, NULL, QX_FLAG_CMD, NULL },
|
||||
{ "shutdown.return", 0, NULL, "S%s\r", "", 0, 0, "", 1, 3, NULL, QX_FLAG_CMD, blazer_process_command },
|
||||
{ "shutdown.stayoff", 0, NULL, "S%sR0000\r", "", 0, 0, "", 1, 3, NULL, QX_FLAG_CMD, blazer_process_command },
|
||||
{ "shutdown.stop", 0, NULL, "C\r", "", 0, 0, "", 1, 3, NULL, QX_FLAG_CMD, NULL },
|
||||
{ "test.battery.start.quick", 0, NULL, "T\r", "", 0, 0, "", 1, 3, NULL, QX_FLAG_CMD, NULL },
|
||||
|
||||
/* Server-side settable vars */
|
||||
{ "ups.delay.start", ST_FLAG_RW, voltronic_qs_r_ondelay, NULL, "", 0, 0, "", 0, 0, DEFAULT_ONDELAY, QX_FLAG_ABSENT | QX_FLAG_SETVAR | QX_FLAG_RANGE, blazer_process_setvar },
|
||||
{ "ups.delay.shutdown", ST_FLAG_RW, voltronic_qs_r_offdelay, NULL, "", 0, 0, "", 0, 0, DEFAULT_OFFDELAY, QX_FLAG_ABSENT | QX_FLAG_SETVAR | QX_FLAG_RANGE, blazer_process_setvar },
|
||||
|
||||
/* End of structure. */
|
||||
{ NULL, 0, NULL, NULL, "", 0, 0, "", 0, 0, NULL, 0, NULL }
|
||||
};
|
||||
|
||||
|
||||
/* == Testing table == */
|
||||
#ifdef TESTING
|
||||
static testing_t voltronic_qs_testing[] = {
|
||||
{ "QS\r", "(215.0 195.0 230.0 014 49.0 22.7 30.0 00000000\r" },
|
||||
{ "F\r", "#230.0 000 024.0 50.0\r" },
|
||||
{ "M\r", "V\r" },
|
||||
{ "Q\r", "" },
|
||||
{ "C\r", "" },
|
||||
{ "S02R0005\r", "" },
|
||||
{ "S.5R0000\r", "" },
|
||||
{ "T\r", "" },
|
||||
{ NULL }
|
||||
};
|
||||
#endif /* TESTING */
|
||||
|
||||
|
||||
/* == Support functions == */
|
||||
|
||||
/* This function allows the subdriver to "claim" a device: return 1 if the device is supported by this subdriver, else 0. */
|
||||
static int voltronic_qs_claim(void)
|
||||
{
|
||||
|
||||
/* We need at least M and QS to run this subdriver */
|
||||
|
||||
/* UPS Protocol */
|
||||
item_t *item = find_nut_info("ups.firmware.aux", 0, 0);
|
||||
|
||||
/* Don't know what happened */
|
||||
if (!item)
|
||||
return 0;
|
||||
|
||||
/* No reply/Unable to get value */
|
||||
if (qx_process(item, NULL))
|
||||
return 0;
|
||||
|
||||
/* Unable to process value/Protocol not supported */
|
||||
if (ups_infoval_set(item) != 1)
|
||||
return 0;
|
||||
|
||||
item = find_nut_info("input.voltage", 0, 0);
|
||||
|
||||
/* Don't know what happened */
|
||||
if (!item) {
|
||||
dstate_delinfo("ups.firmware.aux");
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* No reply/Unable to get value */
|
||||
if (qx_process(item, NULL)) {
|
||||
dstate_delinfo("ups.firmware.aux");
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Unable to process value */
|
||||
if (ups_infoval_set(item) != 1) {
|
||||
dstate_delinfo("ups.firmware.aux");
|
||||
return 0;
|
||||
}
|
||||
|
||||
return 1;
|
||||
|
||||
}
|
||||
|
||||
|
||||
/* == Preprocess functions == */
|
||||
|
||||
/* Protocol used by the UPS */
|
||||
static int voltronic_qs_protocol(item_t *item, char *value, size_t valuelen)
|
||||
{
|
||||
if (strcasecmp(item->value, "V")) {
|
||||
upsdebugx(2, "%s: invalid protocol [%s]", __func__, item->value);
|
||||
return -1;
|
||||
}
|
||||
|
||||
snprintf(value, valuelen, item->dfl, "PMV");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/* == Subdriver interface == */
|
||||
subdriver_t voltronic_qs_subdriver = {
|
||||
VOLTRONIC_QS_VERSION,
|
||||
voltronic_qs_claim,
|
||||
voltronic_qs_qx2nut,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
"ACK",
|
||||
"(NAK\r",
|
||||
#ifdef TESTING
|
||||
voltronic_qs_testing,
|
||||
#endif /* TESTING */
|
||||
};
|
||||
29
drivers/nutdrv_qx_voltronic-qs.h
Normal file
29
drivers/nutdrv_qx_voltronic-qs.h
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
/* nutdrv_qx_voltronic-qs.h - Subdriver for Voltronic Power UPSes with QS protocol
|
||||
*
|
||||
* Copyright (C)
|
||||
* 2013 Daniele Pezzini <hyouko@gmail.com>
|
||||
*
|
||||
* 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 NUTDRV_QX_VOLTRONIC_QS_H
|
||||
#define NUTDRV_QX_VOLTRONIC_QS_H
|
||||
|
||||
#include "nutdrv_qx.h"
|
||||
|
||||
extern subdriver_t voltronic_qs_subdriver;
|
||||
|
||||
#endif /* NUTDRV_QX_VOLTRONIC_QS_H */
|
||||
|
|
@ -6,8 +6,10 @@
|
|||
* See http://www.advice.co.il/product/inter/ups.html for its specifications.
|
||||
* This model is based on PowerCom (www.powercom.com) models.
|
||||
* -Socomec Sicon Egys 420
|
||||
* -OptiUPS VS 575C
|
||||
*
|
||||
* Copyrights:
|
||||
* (C) 2013 Florian Bruhin <nut@the-compiler.org>
|
||||
* (C) 2002 Simon Rozman <simon@rozman.net>
|
||||
* (C) 1999 Peter Bieringer <pb@bieringer.de>
|
||||
*
|
||||
|
|
@ -58,6 +60,10 @@
|
|||
*
|
||||
* Tested on: BNT-1500A
|
||||
*
|
||||
* rev 0.14: Florian Bruhin (The Compiler) <nut@the-compiler.org>
|
||||
* - Added support for OptiUPS VS 575C
|
||||
* This probably also works with others, but I don't have their model numbers.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "main.h"
|
||||
|
|
@ -66,7 +72,7 @@
|
|||
#include "math.h"
|
||||
|
||||
#define DRIVER_NAME "PowerCom protocol UPS driver"
|
||||
#define DRIVER_VERSION "0.13"
|
||||
#define DRIVER_VERSION "0.14"
|
||||
|
||||
/* driver description structure */
|
||||
upsdrv_info_t upsdrv_info = {
|
||||
|
|
@ -74,7 +80,8 @@ upsdrv_info_t upsdrv_info = {
|
|||
DRIVER_VERSION,
|
||||
"Simon Rozman <simon@rozman.net>\n" \
|
||||
"Peter Bieringer <pb@bieringer.de>\n" \
|
||||
"Alexey Sidorov <alexsid@altlinux.org>",
|
||||
"Alexey Sidorov <alexsid@altlinux.org>\n" \
|
||||
"Florian Bruhin <nut@the-compiler.org>",
|
||||
DRV_STABLE,
|
||||
{ NULL }
|
||||
};
|
||||
|
|
@ -199,6 +206,17 @@ static struct type types[] = {
|
|||
{ 1.0000, 0.0000, 0.0000, 1.0000, 0.0000 },
|
||||
{ 2.0000, 0.0000, 2.0000, 0.0000 },
|
||||
},
|
||||
{
|
||||
"OPTI",
|
||||
16,
|
||||
{ "no_flow_control", no_flow_control },
|
||||
{ { 5U, 0xFFU }, { 7U, 0U }, { 8U, 0U } },
|
||||
{ { 1U, 30U }, 'y' },
|
||||
{ 0.0000, 0.0000 },
|
||||
{ 1.0000, 0.0000, 1.0000, 0.0000 },
|
||||
{ 1.0000, 0.0000, 0.0000, 1.0000, 0.0000 },
|
||||
{ 2.0000, 0.0000, 2.0000, 0.0000 },
|
||||
},
|
||||
};
|
||||
|
||||
/* values for sending to UPS */
|
||||
|
|
@ -249,6 +267,7 @@ unsigned int voltages[]={100,110,115,120,0,0,0,200,220,230,240,0,0,0,0,0};
|
|||
unsigned int BNTmodels[]={0,400,500,600,800,801,1000,1200,1500,2000,0,0,0,0,0,0};
|
||||
unsigned int KINmodels[]={0,425,500,525,625,800,1000,1200,1500,1600,2200,2200,2500,3000,5000,0};
|
||||
unsigned int IMPmodels[]={0,425,525,625,825,1025,1200,1500,2000,0,0,0,0,0,0,0};
|
||||
unsigned int OPTImodels[]={0,0,0,575,0,0,0,0,0,0,0,0,0,0,0,0};
|
||||
|
||||
/*
|
||||
* local used functions
|
||||
|
|
@ -398,7 +417,7 @@ static float input_voltage(void)
|
|||
} else {
|
||||
tmp=1.625*raw_data[INPUT_VOLTAGE];
|
||||
}
|
||||
} else if ( !strcmp(types[type].name, "IMP")) {
|
||||
} else if ( !strcmp(types[type].name, "IMP") || !strcmp(types[type].name, "OPTI")) {
|
||||
tmp=raw_data[INPUT_VOLTAGE]*2.0;
|
||||
} else {
|
||||
tmp=linevoltage >= 220 ?
|
||||
|
|
@ -489,7 +508,7 @@ static float output_voltage(void)
|
|||
tmp=sqrt(tmp)*rdatay;
|
||||
}
|
||||
}
|
||||
} else if ( !strcmp(types[type].name, "IMP")) {
|
||||
} else if ( !strcmp(types[type].name, "IMP") || !strcmp(types[type].name, "OPTI")) {
|
||||
tmp=raw_data[OUTPUT_VOLTAGE]*2.0;
|
||||
} else {
|
||||
tmp= linevoltage >= 220 ?
|
||||
|
|
@ -506,7 +525,7 @@ static float input_freq(void)
|
|||
{
|
||||
if ( !strcmp(types[type].name, "BNT") || !strcmp(types[type].name, "KIN"))
|
||||
return 4807.0/raw_data[INPUT_FREQUENCY];
|
||||
else if ( !strcmp(types[type].name, "IMP"))
|
||||
else if ( !strcmp(types[type].name, "IMP") || !strcmp(types[type].name, "OPTI"))
|
||||
return raw_data[INPUT_FREQUENCY];
|
||||
return raw_data[INPUT_FREQUENCY] ?
|
||||
1.0 / (types[type].freq[0] *
|
||||
|
|
@ -518,7 +537,7 @@ static float output_freq(void)
|
|||
{
|
||||
if ( !strcmp(types[type].name, "BNT") || !strcmp(types[type].name, "KIN"))
|
||||
return 4807.0/raw_data[OUTPUT_FREQUENCY];
|
||||
else if ( !strcmp(types[type].name, "IMP"))
|
||||
else if ( !strcmp(types[type].name, "IMP") || !strcmp(types[type].name, "OPTI"))
|
||||
return raw_data[OUTPUT_FREQUENCY];
|
||||
return raw_data[OUTPUT_FREQUENCY] ?
|
||||
1.0 / (types[type].freq[0] *
|
||||
|
|
@ -588,7 +607,7 @@ static float load_level(void)
|
|||
if (model<2000) return raw_data[UPS_LOAD]*1.66;
|
||||
if (model>=2000) return raw_data[UPS_LOAD]*110.0/load2ki[voltage];
|
||||
}
|
||||
} else if ( !strcmp(types[type].name, "IMP")) {
|
||||
} else if ( !strcmp(types[type].name, "IMP") || !strcmp(types[type].name, "OPTI")) {
|
||||
return raw_data[UPS_LOAD];
|
||||
}
|
||||
return raw_data[STATUS_A] & MAINS_FAILURE ?
|
||||
|
|
@ -644,7 +663,7 @@ static float batt_level(void)
|
|||
return 30.0+(battval-bat29)*70.0/(bat100-bat29);
|
||||
return 100;
|
||||
}
|
||||
if ( !strcmp(types[type].name, "IMP"))
|
||||
if ( !strcmp(types[type].name, "IMP") || !strcmp(types[type].name, "OPTI"))
|
||||
return raw_data[BATTERY_CHARGE];
|
||||
return raw_data[STATUS_A] & ONLINE ? /* Are we on battery power? */
|
||||
/* Yes */
|
||||
|
|
@ -885,10 +904,10 @@ void upsdrv_initups(void)
|
|||
types[type].flowControl.setup_flow_control();
|
||||
|
||||
/* Setup Model and LineVoltage */
|
||||
if (!strncmp(types[type].name, "BNT",3) || !strcmp(types[type].name, "KIN") || !strcmp(types[type].name, "IMP")){
|
||||
if (!strncmp(types[type].name, "BNT",3) || !strcmp(types[type].name, "KIN") || !strcmp(types[type].name, "IMP") || !strcmp(types[type].name, "OPTI")) {
|
||||
if (!ups_getinfo()) return;
|
||||
/* Give "BNT-other" a chance! */
|
||||
if (raw_data[MODELNAME]==0x42 || raw_data[MODELNAME]==0x4B){
|
||||
if (raw_data[MODELNAME]==0x42 || raw_data[MODELNAME]==0x4B || raw_data[MODELNAME]==0x4F){
|
||||
model=BNTmodels[raw_data[MODELNUMBER]/16];
|
||||
if (!strcmp(types[type].name, "BNT-other"))
|
||||
types[type].name="BNT-other";
|
||||
|
|
@ -897,6 +916,9 @@ void upsdrv_initups(void)
|
|||
else if (raw_data[MODELNAME]==0x4B){
|
||||
types[type].name="KIN";
|
||||
model=KINmodels[raw_data[MODELNUMBER]/16];
|
||||
} else if (raw_data[MODELNAME]==0x4F){
|
||||
types[type].name="OPTI";
|
||||
model=OPTImodels[raw_data[MODELNUMBER]/16];
|
||||
}
|
||||
}
|
||||
else if (raw_data[UPSVERSION]==0xFF){
|
||||
|
|
@ -904,7 +926,11 @@ void upsdrv_initups(void)
|
|||
model=IMPmodels[raw_data[MODELNUMBER]/16];
|
||||
}
|
||||
linevoltage=voltages[raw_data[MODELNUMBER]%16];
|
||||
snprintf(buf,sizeof(buf),"%s-%dAP",types[type].name,model);
|
||||
if (!strcmp(types[type].name, "OPTI")) {
|
||||
snprintf(buf,sizeof(buf),"%s-%d",types[type].name,model);
|
||||
} else {
|
||||
snprintf(buf,sizeof(buf),"%s-%dAP",types[type].name,model);
|
||||
}
|
||||
if (!strcmp(modelname, "Unknown"))
|
||||
modelname=buf;
|
||||
upsdebugx(1,"Detected: %s , %dV",buf,linevoltage);
|
||||
|
|
@ -962,7 +988,7 @@ void upsdrv_help(void)
|
|||
printf("\n");
|
||||
printf("Specify UPS information in the ups.conf file.\n");
|
||||
printf(" type: Type of UPS: 'Trust','Egys','KP625AP','IMP','KIN','BNT',\n");
|
||||
printf(" 'BNT-other' (default: 'Trust')\n");
|
||||
printf(" 'BNT-other', 'OPTI' (default: 'Trust')\n");
|
||||
printf(" 'BNT-other' is a special type intended for BNT 100-120V models,\n");
|
||||
printf(" but can be used to override ALL models.\n");
|
||||
printf("You can additional specify these variables:\n");
|
||||
|
|
@ -1042,7 +1068,7 @@ void upsdrv_makevartable(void)
|
|||
// 1 2 3 4 5 6 7 8
|
||||
//2345678901234567890123456789012345678901234567890123456789012345678901234567890 MAX
|
||||
addvar(VAR_VALUE, "type",
|
||||
"Type of UPS: 'Trust','Egys','KP625AP','IMP','KIN','BNT','BNT-other'\n"
|
||||
"Type of UPS: 'Trust','Egys','KP625AP','IMP','KIN','BNT','BNT-other','OPTI'\n"
|
||||
" (default: 'Trust')");
|
||||
addvar(VAR_VALUE, "manufacturer",
|
||||
"Manufacturer name (default: 'PowerCom')");
|
||||
|
|
|
|||
|
|
@ -355,7 +355,9 @@ int riello_command(uint8_t *cmd, uint8_t *buf, uint16_t length, uint16_t buflen)
|
|||
|
||||
case -ETIMEDOUT: /* Connection timed out */
|
||||
case -EOVERFLOW: /* Value too large for defined data type */
|
||||
#ifdef EPROTO
|
||||
case -EPROTO: /* Protocol error */
|
||||
#endif
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
* Based on NetSNMP API (Simple Network Management Protocol V1-2)
|
||||
*
|
||||
* Copyright (C)
|
||||
* 2002 - 2012 Arnaud Quette <arnaud.quette@free.fr>
|
||||
* 2002 - 2014 Arnaud Quette <arnaud.quette@free.fr>
|
||||
* 2002 - 2006 Dmitry Frolov <frolov@riss-telecom.ru>
|
||||
* J.W. Hoogervorst <jeroen@hoogervorst.net>
|
||||
* Niels Baggesen <niels@baggesen.net>
|
||||
|
|
@ -49,6 +49,7 @@
|
|||
#include "cyberpower-mib.h"
|
||||
#include "delta_ups-mib.h"
|
||||
#include "ietf-mib.h"
|
||||
#include "xppc-mib.h"
|
||||
|
||||
/* Address API change */
|
||||
#ifndef usmAESPrivProtocol
|
||||
|
|
@ -71,6 +72,7 @@ static mib2nut_info_t *mib2nut[] = {
|
|||
&bestpower,
|
||||
&cyberpower,
|
||||
&delta_ups,
|
||||
&xppc,
|
||||
/*
|
||||
* Prepend vendor specific MIB mappings before IETF, so that
|
||||
* if a device supports both IETF and vendor specific MIB,
|
||||
|
|
@ -98,7 +100,7 @@ const char *mibvers;
|
|||
static void disable_transfer_oids(void);
|
||||
|
||||
#define DRIVER_NAME "Generic SNMP UPS driver"
|
||||
#define DRIVER_VERSION "0.70"
|
||||
#define DRIVER_VERSION "0.72"
|
||||
|
||||
/* driver description structure */
|
||||
upsdrv_info_t upsdrv_info = {
|
||||
|
|
@ -586,6 +588,9 @@ struct snmp_pdu *nut_snmp_get(const char *OID)
|
|||
struct snmp_pdu ** pdu_array;
|
||||
struct snmp_pdu * ret_pdu;
|
||||
|
||||
if (OID == NULL)
|
||||
return NULL;
|
||||
|
||||
upsdebugx(3, "nut_snmp_get(%s)", OID);
|
||||
|
||||
pdu_array = nut_snmp_walk(OID,1);
|
||||
|
|
|
|||
|
|
@ -45,6 +45,12 @@ static int maxsdorder = 0, testmode = 0, exec_error = 0;
|
|||
/* timer - keeps us from getting stuck if a driver hangs */
|
||||
static int maxstartdelay = 45;
|
||||
|
||||
/* counter - retry that many time(s) to start the driver if it fails to */
|
||||
static int maxretry = 1;
|
||||
|
||||
/* timer - delay between each restart attempt of the driver(s) */
|
||||
static int retrydelay = 5;
|
||||
|
||||
/* Directory where driver executables live */
|
||||
static char *driverpath = NULL;
|
||||
|
||||
|
|
@ -65,6 +71,12 @@ void do_upsconf_args(char *upsname, char *var, char *val)
|
|||
driverpath = xstrdup(val);
|
||||
}
|
||||
|
||||
if (!strcmp(var, "maxretry"))
|
||||
maxretry = atoi(val);
|
||||
|
||||
if (!strcmp(var, "retrydelay"))
|
||||
retrydelay = atoi(val);
|
||||
|
||||
/* ignore anything else - it's probably for main */
|
||||
|
||||
return;
|
||||
|
|
@ -248,6 +260,7 @@ static void start_driver(const ups_t *ups)
|
|||
char *argv[8];
|
||||
char dfn[SMALLBUF];
|
||||
int ret, arg = 0;
|
||||
int initial_exec_error = exec_error, drv_maxretry = maxretry;
|
||||
struct stat fs;
|
||||
|
||||
upsdebugx(1, "Starting UPS: %s", ups->upsname);
|
||||
|
|
@ -276,10 +289,28 @@ static void start_driver(const ups_t *ups)
|
|||
/* tie it off */
|
||||
argv[arg++] = NULL;
|
||||
|
||||
debugcmdline(2, "exec: ", argv);
|
||||
|
||||
if (!testmode) {
|
||||
forkexec(argv, ups);
|
||||
while (drv_maxretry > 0) {
|
||||
int cur_exec_error = exec_error;
|
||||
|
||||
upsdebugx(2, "%i remaining attempts", drv_maxretry);
|
||||
debugcmdline(2, "exec: ", argv);
|
||||
drv_maxretry--;
|
||||
|
||||
if (!testmode) {
|
||||
forkexec(argv, ups);
|
||||
}
|
||||
|
||||
/* driver command succeeded */
|
||||
if (cur_exec_error == exec_error) {
|
||||
drv_maxretry = 0;
|
||||
exec_error = initial_exec_error;
|
||||
}
|
||||
else {
|
||||
/* otherwise, retry if still needed */
|
||||
if (drv_maxretry > 0)
|
||||
sleep (retrydelay);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -25,6 +25,9 @@
|
|||
#include <regex.h>
|
||||
#include <usb.h>
|
||||
|
||||
/* USB standard timeout [ms] */
|
||||
#define USB_TIMEOUT 5000
|
||||
|
||||
/*!
|
||||
* USBDevice_t: Describe a USB device. This structure contains exactly
|
||||
* the 5 pieces of information by which a USB device identifies
|
||||
|
|
|
|||
|
|
@ -1269,7 +1269,9 @@ static bool_t hid_ups_walk(walkmode_t mode)
|
|||
|
||||
case -ETIMEDOUT: /* Connection timed out */
|
||||
case -EOVERFLOW: /* Value too large for defined data type */
|
||||
#ifdef EPROTO
|
||||
case -EPROTO: /* Protocol error */
|
||||
#endif
|
||||
case -EPIPE: /* Broken pipe */
|
||||
default:
|
||||
/* Don't know what happened, try again later... */
|
||||
|
|
|
|||
126
drivers/xppc-mib.c
Normal file
126
drivers/xppc-mib.c
Normal file
|
|
@ -0,0 +1,126 @@
|
|||
/* xppc-mib.c - subdriver to monitor XPPC SNMP devices with NUT
|
||||
*
|
||||
* Copyright (C)
|
||||
* 2011 - 2012 Arnaud Quette <arnaud.quette@free.fr>
|
||||
* 2014 Charles Lepple <clepple+nut@gmail.com>
|
||||
*
|
||||
* Note: this subdriver was initially generated as a "stub" by the
|
||||
* scripts/subdriver/gen-snmp-subdriver.sh script.
|
||||
*
|
||||
* 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 "xppc-mib.h"
|
||||
|
||||
#define XPPC_MIB_VERSION "0.2"
|
||||
|
||||
#define XPPC_SYSOID ".1.3.6.1.4.1.935"
|
||||
|
||||
/* To create a value lookup structure (as needed on the 2nd line of the example
|
||||
* below), use the following kind of declaration, outside of the present snmp_info_t[]:
|
||||
* static info_lkp_t onbatt_info[] = {
|
||||
* { 1, "OB" },
|
||||
* { 2, "OL" },
|
||||
* { 0, "NULL" }
|
||||
* };
|
||||
*/
|
||||
|
||||
/* upsBaseBatteryStatus */
|
||||
static info_lkp_t xpcc_onbatt_info[] = {
|
||||
{ 1, "" }, /* unknown */
|
||||
{ 2, "" }, /* batteryNormal */
|
||||
{ 3, "LB" } /* batteryLow */
|
||||
};
|
||||
|
||||
/*
|
||||
upsBaseOutputStatus OBJECT-TYPE
|
||||
SYNTAX INTEGER {
|
||||
unknown(1),
|
||||
onLine(2),
|
||||
onBattery(3),
|
||||
onBoost(4),
|
||||
sleeping(5),
|
||||
onBypass(6),
|
||||
rebooting(7),
|
||||
standBy(8),
|
||||
onBuck(9) }
|
||||
*/
|
||||
static info_lkp_t xpcc_power_info[] = {
|
||||
{ 1, "" }, /* unknown */
|
||||
{ 2, "OL" }, /* onLine */
|
||||
{ 3, "OB" }, /* onBattery */
|
||||
{ 4, "OL BOOST" }, /* onBoost */
|
||||
{ 5, "OFF" }, /* sleeping */
|
||||
{ 6, "BYPASS"}, /* onBypass */
|
||||
{ 7, "" }, /* rebooting */
|
||||
{ 8, "OFF" }, /* standBy */
|
||||
{ 9, "OL TRIM"} /* onBuck */
|
||||
};
|
||||
|
||||
/* XPPC Snmp2NUT lookup table */
|
||||
static snmp_info_t xppc_mib[] = {
|
||||
|
||||
/* Data format:
|
||||
* { info_type, info_flags, info_len, OID, dfl, flags, oid2info, setvar },
|
||||
*
|
||||
* info_type: NUT INFO_ or CMD_ element name
|
||||
* info_flags: flags to set in addinfo
|
||||
* info_len: length of strings if STR
|
||||
* cmd value if CMD, multiplier otherwise
|
||||
* OID: SNMP OID or NULL
|
||||
* dfl: default value
|
||||
* flags: snmp-ups internal flags (FIXME: ...)
|
||||
* oid2info: lookup table between OID and NUT values
|
||||
* setvar: variable to set for SU_FLAG_SETINT
|
||||
*
|
||||
* Example:
|
||||
* { "input.voltage", 0, 0.1, ".1.3.6.1.4.1.705.1.6.2.1.2.1", "", SU_INPUT_1, NULL },
|
||||
* { "ups.status", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.705.1.7.3.0", "", SU_FLAG_OK | SU_STATUS_BATT, onbatt_info },
|
||||
*
|
||||
* To create a value lookup structure (as needed on the 2nd line), use the
|
||||
* following kind of declaration, outside of the present snmp_info_t[]:
|
||||
* static info_lkp_t onbatt_info[] = {
|
||||
* { 1, "OB" },
|
||||
* { 2, "OL" },
|
||||
* { 0, "NULL" }
|
||||
* };
|
||||
*/
|
||||
{ "ups.mfr", ST_FLAG_STRING, SU_INFOSIZE, NULL, "Tripp Lite / Phoenixtec",
|
||||
SU_FLAG_STATIC | SU_FLAG_ABSENT | SU_FLAG_OK, NULL },
|
||||
|
||||
/* upsBaseIdentModel.0 = STRING: "Intelligent" */
|
||||
{ "ups.model", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.935.1.1.1.1.1.1.0", "Generic Phoenixtec SNMP device", SU_FLAG_OK, NULL },
|
||||
/* upsBaseBatteryStatus.0 = INTEGER: batteryNormal(2) */
|
||||
{ "ups.status", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.935.1.1.1.2.1.1.0", "", SU_STATUS_BATT | SU_TYPE_INT | SU_FLAG_OK, xpcc_onbatt_info },
|
||||
/* upsSmartBatteryCapacity.0 = INTEGER: 100 */
|
||||
{ "battery.charge", 0, 1, ".1.3.6.1.4.1.935.1.1.1.2.2.1.0", NULL, SU_TYPE_INT | SU_FLAG_OK, NULL },
|
||||
/* upsSmartBatteryTemperature.0 = INTEGER: 260 */
|
||||
{ "ups.temperature", 0, 0.1, ".1.3.6.1.4.1.935.1.1.1.2.2.3.0", NULL, SU_TYPE_INT | SU_FLAG_OK, NULL },
|
||||
/* upsSmartInputLineVoltage.0 = INTEGER: 1998 */
|
||||
{ "input.voltage", 0, 0.1, ".1.3.6.1.4.1.935.1.1.1.3.2.1.0", NULL, SU_TYPE_INT | SU_FLAG_OK, NULL },
|
||||
/* upsBaseOutputStatus.0 = INTEGER: onLine(2) */
|
||||
{ "ups.status", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.935.1.1.1.4.1.1.0", "", SU_TYPE_INT | SU_STATUS_PWR, xpcc_power_info },
|
||||
/* upsSmartOutputVoltage.0 = INTEGER: 2309 */
|
||||
{ "output.voltage", 0, 0.1, ".1.3.6.1.4.1.935.1.1.1.4.2.1.0", NULL, SU_TYPE_INT | SU_FLAG_OK, NULL },
|
||||
/* upsSmartOutputFrequency.0 = INTEGER: 500 */
|
||||
{ "output.frequency", 0, 0.1, ".1.3.6.1.4.1.935.1.1.1.4.2.2.0", NULL, SU_TYPE_INT | SU_FLAG_OK, NULL },
|
||||
/* upsSmartOutputLoad.0 = INTEGER: 7 */
|
||||
{ "ups.load", 0, 1, ".1.3.6.1.4.1.935.1.1.1.4.2.3.0", NULL, SU_TYPE_INT | SU_FLAG_OK, NULL },
|
||||
|
||||
/* end of structure. */
|
||||
{ NULL, 0, 0, NULL, NULL, 0, NULL }
|
||||
};
|
||||
|
||||
mib2nut_info_t xppc = { "xppc", XPPC_MIB_VERSION, NULL, NULL, xppc_mib, XPPC_SYSOID };
|
||||
29
drivers/xppc-mib.h
Normal file
29
drivers/xppc-mib.h
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
/* xppc-mib.h - subdriver to monitor XPPC SNMP devices with NUT
|
||||
*
|
||||
* Copyright (C)
|
||||
* 2011 - 2012 Arnaud Quette <arnaud.quette@free.fr>
|
||||
*
|
||||
* 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 XPPC_MIB_H
|
||||
#define XPPC_MIB_H
|
||||
|
||||
#include "main.h"
|
||||
#include "snmp-ups.h"
|
||||
|
||||
extern mib2nut_info_t xppc;
|
||||
|
||||
#endif /* XPPC_MIB_H */
|
||||
Loading…
Add table
Add a link
Reference in a new issue