apcupsd-commits Mailing List for Apcupsd UPS control software
Brought to you by:
adk0212
You can subscribe to this list here.
| 2005 |
Jan
|
Feb
(5) |
Mar
(93) |
Apr
(50) |
May
(40) |
Jun
(64) |
Jul
(26) |
Aug
(40) |
Sep
(88) |
Oct
(22) |
Nov
(85) |
Dec
(31) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2006 |
Jan
(64) |
Feb
(99) |
Mar
(64) |
Apr
(64) |
May
(89) |
Jun
(6) |
Jul
(109) |
Aug
(84) |
Sep
(46) |
Oct
(9) |
Nov
(20) |
Dec
(39) |
| 2007 |
Jan
(45) |
Feb
(41) |
Mar
(7) |
Apr
(16) |
May
(17) |
Jun
(84) |
Jul
(10) |
Aug
(28) |
Sep
(49) |
Oct
(66) |
Nov
(41) |
Dec
(1) |
| 2008 |
Jan
(37) |
Feb
(13) |
Mar
(1) |
Apr
(56) |
May
(146) |
Jun
(71) |
Jul
(21) |
Aug
(18) |
Sep
(5) |
Oct
(4) |
Nov
(3) |
Dec
|
| 2009 |
Jan
(6) |
Feb
(2) |
Mar
(12) |
Apr
(12) |
May
(86) |
Jun
(2) |
Jul
(19) |
Aug
(25) |
Sep
(63) |
Oct
(106) |
Nov
(10) |
Dec
|
| 2010 |
Jan
(87) |
Feb
(1) |
Mar
|
Apr
(2) |
May
(3) |
Jun
|
Jul
(3) |
Aug
(15) |
Sep
(49) |
Oct
|
Nov
|
Dec
|
| 2011 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
(3) |
Jun
|
Jul
(2) |
Aug
(8) |
Sep
(9) |
Oct
(3) |
Nov
(14) |
Dec
(2) |
| 2012 |
Jan
(1) |
Feb
|
Mar
(8) |
Apr
(3) |
May
|
Jun
(2) |
Jul
|
Aug
(5) |
Sep
|
Oct
(1) |
Nov
(1) |
Dec
|
| 2013 |
Jan
|
Feb
(9) |
Mar
|
Apr
(2) |
May
|
Jun
|
Jul
|
Aug
(8) |
Sep
|
Oct
|
Nov
(6) |
Dec
|
| 2014 |
Jan
(8) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: Adam K. <ad...@us...> - 2014-01-31 16:52:15
|
Update of /cvsroot/apcupsd/apcupsd/doc/home-page In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv25258 Modified Files: Tag: Branch-3_14 index.html Log Message: Update web site with 3.14.11 release info Index: index.html =================================================================== RCS file: /cvsroot/apcupsd/apcupsd/doc/home-page/index.html,v retrieving revision 1.39.2.21 retrieving revision 1.39.2.22 diff -u -d -r1.39.2.21 -r1.39.2.22 --- index.html 22 Sep 2011 22:22:41 -0000 1.39.2.21 +++ index.html 31 Jan 2014 16:52:13 -0000 1.39.2.22 @@ -50,59 +50,27 @@ consumption rates. Apcupsd is licensed under the GPL version 2. <p> <h2>Apcupsd Releases</h2> -<h3><i><u>Stable:</u></i> 3.14.10 (13 September 2011) -[ <a href="https://sourceforge.net/projects/apcupsd/files/apcupsd%20-%20Stable/3.14.10/">Source</a> ] +<h3><i><u>Stable:</u></i> 3.14.11 (31 January 2014) +[ <a href="https://sourceforge.net/projects/apcupsd/files/apcupsd%20-%20Stable/3.14.11/">Source</a> ] <!--[ <a href="https://sourceforge.net/projects/apcupsd/files/rpms%20-%20Stable/3.14.10/">RPMs</a> ]--> -[ <a href="https://sourceforge.net/projects/apcupsd/files/win-binaries%20-%20Stable/3.14.10/">Windows</a> ] -[ <a href="https://sourceforge.net/projects/apcupsd/files/osx-binaries%20-%20Stable/3.14.10/">OSX</a> ] +[ <a href="https://sourceforge.net/projects/apcupsd/files/win-binaries%20-%20Stable/3.14.11/">Windows</a> ] +[ <a href="https://sourceforge.net/projects/apcupsd/files/osx-binaries%20-%20Stable/3.14.11/">OSX</a> ] </h3> -Release 3.14.10 is a maintenance release containing only bug fixes. Most -notable are USB compatibility for Mac OS X Lion and a fix for missing and/or -spurrious status values on newer BackUPS CS USB models. -</ul> +Release 3.14.11 adds MODBUS protocol support for newer APC UPSes. It also +includes digital signatures on the Windows USB driver and the Windows installer +package which should make installation on recent versions of Windows easier. +<p> +The MODBUS protocol gives access to advanced UPS features on newer UPSes that +previously only supported Microlink. A firmware upgrade may be required to +enable MODBUS support on some UPSes. Please see the -<a href="http://apcupsd.cvs.sourceforge.net/viewvc/*checkout*/apcupsd/apcupsd/ReleaseNotes?pathrev=Release-3_14_10"> -ReleaseNotes</a> for details. +<a href="http://apcupsd.cvs.sourceforge.net/viewvc/*checkout*/apcupsd/apcupsd/ReleaseNotes?pathrev=Release-3_14_11"> +ReleaseNotes</a> for further details. <p> -Apcupsd 3.14.10 is the latest stable release, containing many bug fixes and +Apcupsd 3.14.11 is the latest stable release, containing many bug fixes and new features over previous releases. Users of all previous versions are encouraged to upgrade. <p> -<h2>Do Not Purchase The Following UPSes</h2> -Recently APC has begun shipping UPSes that utilize a new communication -protocol called "Microlink". To date, APC has refused to release details of -this protocol to the apcupsd team so that we can add support for it to -apcupsd. <b>Consequently, the apcupsd team recommends you DO NOT purchase the -following APC UPS models</b> (this list may be incomplete; please send any -additions to the <a href="lists.html">apcupsd-users mailing list</a>): -<ul> -<li>SmartUPS SMX/SMT 750, 1000, 1500 -<li>SmartUPS RT 3000XL, 5000XL -</ul> -These UPSes have the following restrictions with respect to compatibility -with apcupsd: -<ul> -<li>The serial (RS232) port <b>CANNOT</b> be used with apcupsd at all. -<li>The USB port will work with apcupsd but will only convey very basic -information such as on-battery/on-line and run time remaining. <b>Other readings -such as voltage, frequency, etc. are not available.</b> -</ul> -If you already own one of these models: -<ul> -<li>You can purchase an AP9620 Legacy Communication Card from APC that will -allow the UPS to communicate with apcupsd via USB or serial and this interface -will contain more data than the native USB interface. <b>However, the "green -energy" features of newer UPSes will NOT be accessible. Also, use of the AP9620 -may require a firmware upgrade to your UPS and the card is not compatible with -all Microlink UPSes.</b> Contact APC to find out if this is an option for your UPS. -<li>Alternatively you can purchase a Web/SNMP card from APC and utilize the SNMP -or PCNET protocols with apcupsd. Again these protocols will provide more data -than the native USB interface. -<li><b>You should notify APC that you are unhappy</b> with their policy requiring -you to purchase additional hardware in order to manage your UPS with open -source tools such as apcupsd. -</ul> -<p> <h2><a href="manual/manual.html" target="_top">Online Manual</a> or a <a href="manual/manual.pdf" target="_top">PDF Version of the Manual</a> </h2> If you want to learn a bit more about |
|
From: Adam K. <ad...@us...> - 2014-01-31 15:45:38
|
Update of /cvsroot/apcupsd/apcupsd In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv20421 Modified Files: Tag: Branch-3_14 ChangeLog Log Message: Update ChangeLog (again) Index: ChangeLog =================================================================== RCS file: /cvsroot/apcupsd/apcupsd/ChangeLog,v retrieving revision 1.76.2.26 retrieving revision 1.76.2.27 diff -u -d -r1.76.2.26 -r1.76.2.27 --- ChangeLog 29 Jan 2014 22:58:16 -0000 1.76.2.26 +++ ChangeLog 31 Jan 2014 15:45:36 -0000 1.76.2.27 @@ -8,6 +8,30 @@ /* http://sourceforge.net/projects/apcupsd */ /***************************************************************************/ +2014-01-31 10:44 adk0212 + + * ReleaseNotes, include/version.h: + + Bump release date + +2014-01-31 10:43 adk0212 + + * ReleaseNotes: + + Update ReleaseNotes for 3.14.11 + +2014-01-31 10:33 adk0212 + + * platforms/mingw/winusb/install.txt: + + Minor update to win32 USB driver installation notes + +2014-01-29 17:58 adk0212 + + * ChangeLog, include/version.h: + + Final prep for 3.14.11 + 2014-01-29 17:56 adk0212 * src/win32/installer/winapcupsd.nsi: |
|
From: Adam K. <ad...@us...> - 2014-01-31 15:44:50
|
Update of /cvsroot/apcupsd/apcupsd/include In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv20297/include Modified Files: Tag: Branch-3_14 version.h Log Message: Bump release date Index: version.h =================================================================== RCS file: /cvsroot/apcupsd/apcupsd/include/version.h,v retrieving revision 1.133.2.26 retrieving revision 1.133.2.27 diff -u -d -r1.133.2.26 -r1.133.2.27 --- version.h 29 Jan 2014 22:58:16 -0000 1.133.2.26 +++ version.h 31 Jan 2014 15:44:48 -0000 1.133.2.27 @@ -1,6 +1,6 @@ #define DEBUG 1 #define VERSION "3.14.11" -#define ADATE "29 January 2014" +#define ADATE "31 January 2014" #define APCUPSD_RELEASE VERSION |
|
From: Adam K. <ad...@us...> - 2014-01-31 15:43:27
|
Update of /cvsroot/apcupsd/apcupsd In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv19908 Modified Files: Tag: Branch-3_14 ReleaseNotes Log Message: Update ReleaseNotes for 3.14.11 Index: ReleaseNotes =================================================================== RCS file: /cvsroot/apcupsd/apcupsd/ReleaseNotes,v retrieving revision 1.41.2.18 retrieving revision 1.41.2.19 diff -u -d -r1.41.2.18 -r1.41.2.19 --- ReleaseNotes 14 Sep 2011 02:34:31 -0000 1.41.2.18 +++ ReleaseNotes 31 Jan 2014 15:43:24 -0000 1.41.2.19 @@ -9,6 +9,38 @@ 3.14.0 RELEASE NOTES BELOW. +3.14.11 -- 29 January 2014 (Maintenance Release) + +NEW FEATURES + + * MODBUS protocol support + + Over the summer, APC publicly released documentation[1] on a new UPS + control and monitoring protocol, loosely referred to as MODBUS (after the + historic industrial control protocol it is based on). The new protocol + operates over RS232 serial lines as well as USB connections and is intended + to supplement APC's proprietary Microlink protocol. Microlink is not going + away, but APC has realized that third parties require access to UPS status + and control information. Rather than publicly open Microlink, they have + created another protocol to operate along side it. + + Many existing Microlink UPSes can be upgraded to support MODBUS via a + firmware update. See [2]. Certain older models are not upgradeable. APC + support will be your best contact for determining if your UPS supports a + MODBUS upgrade the information linked below does not make it clear. + + For now, apcupsd supports MODBUS over RS232 serial only. It DOES NOT yet + support MODBUS over USB. See the apcupsd manual[3] for information on + setting up apcupsd.conf for MODBUS UPSes. + + [1] http://www.apc.com/whitepaper/?an=176 + [2] http://www.schneider-electric.us/support/index?page=content&country=ITB&lang=EN&id=FA164737 + [3] http://www.apcupsd.com/manual/manual.html + + * Windows USB driver is now digitally signed thanks to Jernej Simoncic + <jernej's-s...@et...> + + 3.14.10 -- 13 September 2011 (Maintenance Release) BUG FIXES |
|
From: Adam K. <ad...@us...> - 2014-01-31 15:33:40
|
Update of /cvsroot/apcupsd/apcupsd/platforms/mingw/winusb In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv18190/platforms/mingw/winusb Modified Files: Tag: Branch-3_14 install.txt Log Message: Minor update to win32 USB driver installation notes Index: install.txt =================================================================== RCS file: /cvsroot/apcupsd/apcupsd/platforms/mingw/winusb/Attic/install.txt,v retrieving revision 1.1.2.3 retrieving revision 1.1.2.4 diff -u -d -r1.1.2.3 -r1.1.2.4 --- install.txt 17 Aug 2012 19:53:45 -0000 1.1.2.3 +++ install.txt 31 Jan 2014 15:33:38 -0000 1.1.2.4 @@ -15,6 +15,7 @@ - Windows 7 (including 64 bit) - Windows 2008 Server (including 64 bit) - Windows 8 (including 64 bit) + - Windows 8.1 (including 64 bit) Notably, Windows 2000, Windows 98, and Windows ME are NOT supported. @@ -27,18 +28,9 @@ fix this, uninstall the driver from the device that is giving the error code, then do an update driver on the correct device. -- If you are running a 64-bit edition of Windows 8, you will need to disable - INF signature enforcement before installing the driver. To make this change, - follow these steps: - - - From right side charm menu click on "Settings" - - Choose "Change PC Settings" -> "General" -> "Advanced Startup" - - Select "Restart now" - - You should see a blue colored screen with additional selections - - Click on "Troubleshoot" -> "Advanced options" -> "Startup Settings" - - Click "Restart" to reboot - - Computer will restart and present a menu of startup options - - Select option 7 "Disable driver signature enforcement" +- The driver INF has now been signed with Authenticode thanks to Jernej Simoncic + <jernej's-s...@et...>. During driver installation you will be + asked to approve the signature. INSTALLATION |
|
From: Adam K. <ad...@us...> - 2014-01-29 22:58:18
|
Update of /cvsroot/apcupsd/apcupsd/include In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv7830/include Modified Files: Tag: Branch-3_14 version.h Log Message: Final prep for 3.14.11 Index: version.h =================================================================== RCS file: /cvsroot/apcupsd/apcupsd/include/version.h,v retrieving revision 1.133.2.25 retrieving revision 1.133.2.26 diff -u -d -r1.133.2.25 -r1.133.2.26 --- version.h 21 Nov 2013 00:13:31 -0000 1.133.2.25 +++ version.h 29 Jan 2014 22:58:16 -0000 1.133.2.26 @@ -1,6 +1,6 @@ #define DEBUG 1 #define VERSION "3.14.11" -#define ADATE "20 November 2013" +#define ADATE "29 January 2014" #define APCUPSD_RELEASE VERSION |
|
From: Adam K. <ad...@us...> - 2014-01-29 22:56:39
|
Update of /cvsroot/apcupsd/apcupsd/src/win32/installer In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv7660/installer Modified Files: Tag: Branch-3_14 winapcupsd.nsi Log Message: Add apcupsd.cat signature file to USB driver installation Index: winapcupsd.nsi =================================================================== RCS file: /cvsroot/apcupsd/apcupsd/src/win32/installer/winapcupsd.nsi,v retrieving revision 1.1.2.21 retrieving revision 1.1.2.22 diff -u -d -r1.1.2.21 -r1.1.2.22 --- winapcupsd.nsi 3 Sep 2010 18:40:59 -0000 1.1.2.21 +++ winapcupsd.nsi 29 Jan 2014 22:56:36 -0000 1.1.2.22 @@ -314,6 +314,7 @@ !else File ${TOPDIR}\platforms\mingw\winusb\install.txt File ${TOPDIR}\platforms\mingw\winusb\apcupsd.inf + File ${TOPDIR}\platforms\mingw\winusb\apcupsd.cat SetOutPath "$INSTDIR\driver\i386" File ${DEPKGS}\..\winddk\redist\wdf\x86\*.dll File ${DEPKGS}\..\winddk\redist\winusb\x86\*.dll |
|
From: Adam K. <ad...@us...> - 2014-01-29 22:54:24
|
Update of /cvsroot/apcupsd/apcupsd/platforms/mingw/winusb In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv7451 Modified Files: Tag: Branch-3_14 apcupsd.inf Added Files: Tag: Branch-3_14 apcupsd.cat Log Message: Commit signed winusb driver courtesy of Jernej Simoncic <jernej's-s...@et...> Index: apcupsd.inf =================================================================== RCS file: /cvsroot/apcupsd/apcupsd/platforms/mingw/winusb/Attic/apcupsd.inf,v retrieving revision 1.1.2.6 retrieving revision 1.1.2.7 diff -u -d -r1.1.2.6 -r1.1.2.7 --- apcupsd.inf 15 Oct 2011 03:41:07 -0000 1.1.2.6 +++ apcupsd.inf 29 Jan 2014 22:54:21 -0000 1.1.2.7 @@ -4,6 +4,7 @@ ClassGuid={72631e54-78a4-11d0-bcf7-00aa00b7b32a} Provider = %ProviderName% DriverVer = 01/10/2010,1.0.0.0 +CatalogFile = apcupsd.cat ; ================== Class section ================== [ClassInstall32] @@ -29,8 +30,6 @@ ; An SMX750 appears to use PID 5 even though its twin (the SMT1500 above) ; uses PID 3. Argh. %USB\MyDevice.DeviceDesc% =ApcupsdUSBDriver, USB\VID_051d&PID_0005 -; HP T1500 G3 is actually a re-badged APC unit -%USB\MyDevice.DeviceDesc% =ApcupsdUSBDriver, USB\VID_03F0&PID_1FE3 [Apcupsd_WinUSB.NTamd64] ; Normal APC UPSes use PID 0x0002 @@ -44,8 +43,6 @@ ; An SMX750 appears to use PID 5 even though its twin (the SMT1500 above) ; uses PID 3. Argh. %USB\MyDevice.DeviceDesc% =ApcupsdUSBDriver, USB\VID_051d&PID_0005 -; HP T1500 G3 is actually a re-badged APC unit -%USB\MyDevice.DeviceDesc% =ApcupsdUSBDriver, USB\VID_03F0&PID_1FE3 ; =================== Installation =================== [ApcupsdUSBDriver] --- NEW FILE: apcupsd.cat --- (This appears to be a binary file; contents omitted.) |
|
From: Adam K. <ad...@us...> - 2013-11-21 00:14:15
|
Update of /cvsroot/apcupsd/apcupsd In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv6698 Modified Files: Tag: Branch-3_14 ChangeLog Log Message: Update ChangeLog for 3.14.11 Index: ChangeLog =================================================================== RCS file: /cvsroot/apcupsd/apcupsd/ChangeLog,v retrieving revision 1.76.2.24 retrieving revision 1.76.2.25 diff -u -d -r1.76.2.24 -r1.76.2.25 --- ChangeLog 14 Sep 2011 02:34:31 -0000 1.76.2.24 +++ ChangeLog 21 Nov 2013 00:14:12 -0000 1.76.2.25 @@ -8,6 +8,416 @@ /* http://sourceforge.net/projects/apcupsd */ /***************************************************************************/ +2013-11-20 19:13 adk0212 + + * include/version.h: + + Update version info for 3.14.11 release + +2013-11-20 19:12 adk0212 + + * doc/apcupsd.conf.5: + + Add modbus info to DEVICE section + +2013-11-20 19:08 adk0212 + + * doc/manual/: manual.html, manual.rst: + + Add modbus information to the manual + +2013-11-20 18:28 adk0212 + + * src/drivers/modbus/: MPAO-99NQF6_R0_EN.pdf, + MPAO-99NQL2_R0_EN.pdf: + + Update cached copy of AN176, add AN177, AN178 + +2013-11-20 18:21 adk0212 + + * src/drivers/modbus/: mapping.cpp, mapping.h, modbus.cpp, + modbus.h: + + Add pointers to relevant APC app notes in modbus driver source + files. + +2013-08-19 21:23 adk0212 + + * src/apctest.c: + + Implement the modbus killpower test in apctest. Comment out the + other modbus tests that are not implemented (due to lack of MODBUS + mappings in the UPS for the relevant controls) + +2013-08-19 21:18 adk0212 + + * src/drivers/modbus/MPAO-98KJ7F_R0_EN.pdf: + + Add current rev of App Note 176 (June 2013) describing the MODBUS + implementation on APC UPSes + +2013-08-05 10:05 adk0212 + + * configure, autoconf/config.h.in, autoconf/configure.in, + autoconf/variables.mak.in, doc/apcupsd.conf.5, include/extern.h, + include/struct.h, platforms/etc/apcupsd.conf.in, + platforms/mingw/apcupsd.conf.in, src/apctest.c, + src/drivers/Makefile, src/drivers/drivers.c, + src/drivers/modbus/Makefile, src/drivers/modbus/mapping.cpp, + src/drivers/modbus/mapping.h, src/drivers/modbus/modbus.cpp, + src/drivers/modbus/modbus.h, src/lib/apcconfig.c, src/lib/apclog.c, + src/win32/Makefile.in: + + Initial rev of MODBUS support + +2013-04-18 21:12 adk0212 + + * src/win32/: apctray.cpp, balloonmgr.h, email.c, shutdown.c, + winevents.cpp, winmain.cpp, winservice.cpp, winstat.cpp, winups.h: + + Build fixes for gcc-4.2.4 + +2013-04-18 21:12 adk0212 + + * src/win32/build-win32-cross-tools: + + Upgrade cross-tools to more recent versions gcc-4.2.4 (latest + version which is easily built on RHEL5 due to gmp and mpfr + dependencies) binutils-2.23.1 (latest) mingw-3.20 (latest, aside + from 3.20-2 which is buggy) w32api-3.17-2 (latest) nsis-2.46 + (latest, unchanged) + +2013-02-18 19:25 adk0212 + + * src/apctest.c: + + Add lock file creation to apctest main() + +2013-02-18 19:24 adk0212 + + * src/apcupsd.c: + + Fix copy-paste error in main() + +2013-02-18 19:22 adk0212 + + * src/: apcupsd.c, device.c: + + Remove redundant creation of lock file from setup_device(). Lock + file was already being created in main(). Change error message in + main() to match the one we are removing because it is more + informative. + +2013-02-18 19:18 adk0212 + + * include/defines.h, include/struct.h, src/device.c: + + Get rid of UPS setup flag. This was a holdover from back when the + UPSINFO structure was held in sysv shmem. + +2013-02-11 10:21 adk0212 + + * include/amutex.h, include/defines.h, src/action.c, src/apcupsd.c, + src/device.c, src/options.c, src/smtp.c, src/drivers/drivers.c, + src/drivers/apcsmart/smart.c, src/drivers/net/net.c, + src/drivers/pcnet/pcnet.c, src/drivers/snmp/drv_powernet.c, + src/drivers/snmp/snmp.c, src/drivers/snmplite/apc-mib.cpp, + src/drivers/snmplite/mge-mib.cpp, + src/drivers/snmplite/rfc1628-mib.cpp, + src/drivers/snmplite/snmplite.cpp, src/drivers/usb/usb.c, + src/drivers/usb/bsd/bsd-usb.c, src/drivers/usb/bsd/hidutils.c, + src/drivers/usb/generic/generic-usb.c, + src/drivers/usb/generic/hidutils.c, + src/drivers/usb/linux/linux-usb.c, src/lib/apcconfig.c, + src/lib/apcexec.c, src/lib/apclog.c, src/lib/newups.c, + src/lib/sleep.c: + + Use variadic macros for Dmsg since we pretty much require gcc at + this point + +2012-08-19 22:29 adk0212 + + * src/drivers/snmplite/: snmp.cpp, snmp.h, snmplite.cpp: + + If SNMP trap catching cannot be enabled, log a warning and fall + back to polling instead of crashing. + +2012-08-19 22:07 adk0212 + + * src/drivers/usb/usb.c: + + Revert notch/spike LASTXFER change; UPS reporting is too ambiguous. + +2012-08-17 15:53 adk0212 + + * platforms/mingw/winusb/install.txt: + + Add info about disabling INF signature enforcement in Windows 8 + +2012-08-10 13:40 adk0212 + + * src/drivers/usb/usb.c: + + Recategorize notch/spike related LASTXFER values appropriately. + +2012-06-18 21:47 adk0212 + + * src/drivers/snmplite/snmplite.cpp: + + Make MIB (vendor) name search case insensitive in snmplite driver + +2012-03-30 23:48 adk0212 + + * src/drivers/usb/: usb.c, usb.h, bsd/bsd-usb.c, + generic/generic-usb.c, linux/linux-usb.c: + + Rename known_info -> _known_info + +2012-03-30 23:40 adk0212 + + * src/drivers/usb/bsd/: bsd-usb.c, bsd-usb.h: + + Convert BSD USB driver to UpsDriver derivative + +2012-03-30 19:45 adk0212 + + * configure, autoconf/configure.in, include/drivers.h, + include/extern.h, include/struct.h, src/apctest.c, src/apcupsd.c, + src/drivers/drivers.c, src/drivers/apcsmart/apcsmart.h, + src/drivers/apcsmart/smart.c, src/drivers/apcsmart/smarteeprom.c, + src/drivers/apcsmart/smartoper.c, + src/drivers/apcsmart/smartsetup.c, + src/drivers/apcsmart/smartsetup2.c, src/drivers/dumb/dumb.h, + src/drivers/dumb/dumboper.c, src/drivers/dumb/dumbsetup.c, + src/drivers/net/net.c, src/drivers/net/net.h, + src/drivers/pcnet/pcnet.c, src/drivers/pcnet/pcnet.h, + src/drivers/snmp/drv_powernet.c, src/drivers/snmp/drv_rfc1628.c, + src/drivers/snmp/snmp.c, src/drivers/snmp/snmp.h, + src/drivers/snmplite/apc-mib.cpp, src/drivers/snmplite/mibs.h, + src/drivers/snmplite/rfc1628-mib.cpp, + src/drivers/snmplite/snmplite-common.h, + src/drivers/snmplite/snmplite.cpp, src/drivers/snmplite/snmplite.h, + src/drivers/test/testdriver.c, src/drivers/test/testdriver.h, + src/drivers/usb/usb.c, src/drivers/usb/usb.h, + src/drivers/usb/usb_common.h, + src/drivers/usb/generic/generic-usb.c, + src/drivers/usb/generic/generic-usb.h, + src/drivers/usb/linux/linux-usb.c, + src/drivers/usb/linux/linux-usb.h, src/win32/winusb.h: + + Convert drivers to C++ classes derived from UpsDriver + +2012-03-26 20:48 adk0212 + + * src/drivers/apcsmart/smart.c: + + Break out of getline() if read() returns an error + +2012-03-06 12:04 adk0212 + + * src/drivers/pcnet/pcnet.c: + + Fix PCNET runtime remaining on Smart-UPS X and RT models. + +2012-03-04 22:40 adk0212 + + * src/drivers/pcnet/pcnet.c: + + Add missing debug for REG2 + +2012-01-26 21:23 adk0212 + + * platforms/mandrake/apcupsd.in: + + Apply some Mandrake patches, thanks to David Walser + <lui...@ya...> - + http://svn.mandriva.com/svn/packages/cooker/apcupsd/current/SOURCES/apcupsd-3.10.16-staleusb.patch + - + http://svn.mandriva.com/svn/packages/cooker/apcupsd/current/SOURCES/apcupsd-3.14.4-mdv_conf.diff + +2011-12-09 10:23 adk0212 + + * src/reports.c: + + Fix missing DATATIME report info for SNMPLITE_UPS + +2011-12-09 10:20 adk0212 + + * src/reports.c: + + Fix missing DATATIME report info for PCNET UPSes. Contributed by + Dan Swartzendruber <ds...@dr...>. + +2011-11-21 22:05 adk0212 + + * autoconf/aclocal.m4: + + Fix quoting around AC_LANG_PROGRAM to eliminate warning with + autoconf-2.68 + +2011-11-21 22:03 adk0212 + + * configure, autoconf/configure.in: + + Fix failure to compile when libsupc++ is not available. Need to + link using g++ when not linking libsupc++. If linking with + libsupc++ use gcc to avoid gettting libstdc++ linked by default. + Fixes build on stock Mandriva 2011. + +2011-11-21 21:23 adk0212 + + * src/: apcnis.c, drivers/apcsmart/smart.c: + + Remove set-but-unused variables pointed out by g++-4.6.1 + +2011-11-21 13:23 adk0212 + + * doc/manual/: manual.html, manual.rst: + + Fix smartups configuration example. "UPSTYPE smartups" should be + "UPSTYPE apcsmart". Reported by Moray Henderson + <mor...@om...> + +2011-11-10 08:06 adk0212 + + * src/drivers/snmplite/: apc-mib.cpp, rfc1628-mib.cpp, snmp.cpp, + snmp.h, snmplite.cpp: + + Fix ability to detect SNMP GET failures by adding a 'valid' flag to + data variables. Flag is defaulted to false when a GET is performed + and set to true when valid data is assigned to the variable. This + allows the caller to know if any of the OIDs did not fetch + successfully. + +2011-11-09 22:58 adk0212 + + * src/drivers/snmplite/snmplite.cpp: + + Tighten restriction to screen out bad CI_NOMBATTV. Add check for + invalid CI_BADBATTS. + +2011-11-09 15:12 adk0212 + + * src/action.c: + + Fix handling of UPS calibration by adding a dedicated state for + when UPS is performing calibration. + +2011-11-09 15:10 adk0212 + + * src/drivers/snmplite/snmplite.cpp: + + Fix self test detection in snmplite driver by implementing + snmplite_ups_entry_point() and adding support for + DEVICE_CMD_CHECK_SELFTEST + +2011-11-09 15:08 adk0212 + + * src/drivers/snmplite/apc-mib.cpp: + + Add missing debug print for C_WHY_BATT + +2011-11-07 22:02 adk0212 + + * src/drivers/snmplite/snmplite.cpp: + + Fix crash when snmplite_ups_open() fails due to SnmpEngine::Open() + failure. We need to exit directly rather than returning failure + code since caller stupidly ignores the return code and will blindly + continue on. + +2011-11-07 21:58 adk0212 + + * src/drivers/snmplite/snmp.cpp: + + Fix socket leaks on SnmpEngine::Open() failure paths + +2011-11-07 21:57 adk0212 + + * src/apcupsd.c: + + Remove NLS textdomain call since NLS has been removed long ago. + +2011-11-07 21:36 adk0212 + + * src/device.c: + + Strip unprintable characters from UPS model string. Pointed out by + Peter Henn <pet...@gm...> in the PCNET driver. Fix applied + globally since this issue could affect any driver. + +2011-11-07 21:23 adk0212 + + * doc/apcupsd.conf.5: + + Fix compatibility with mdoc(7) on OpenBSDD. From Ingo Schwarze + <sch...@op...> via Kirill Bychkov <ya...@li...>. + +2011-10-14 23:41 adk0212 + + * platforms/: darwin/Info.plist, mingw/winusb/apcupsd.inf: + + Add VID/PID for HP T1500 G3 UPS which is a rebadged APC unit + +2011-10-12 09:00 adk0212 + + * src/drivers/usb/: bsd/bsd-usb.c, generic/generic-usb.c: + + Remove vendor check from BSD and Generic USB drivers. HP OEMed some + UPSes from APC so they are compatible with apcupsd in spite of + carrying an HP vendor id. We might as well try to talk to anything + a user connects. We will still fail if the required UPS application + collection is not found and that is a better indicator of potential + compatiblity. + +2011-10-02 09:51 fleetworks + + * platforms/: contrib-rpm/build_rpm.sh, redhat/apcupsd.spec.in, + suse/apcupsd.spec.in: + + Release 3.14.10 + +2011-09-27 23:33 adk0212 + + * src/drivers/snmp/: drv_powernet.c, drv_rfc1628.c, snmp.c, snmp.h: + + Fix compile issue with newer net-snmp on CentOS 6. 'MIB' is + apparently a macro now, so need to avoid using it. + +2011-09-26 08:56 adk0212 + + * src/drivers/snmplite/snmplite.cpp: + + Filter out SNMP query results that have zero-length sequences. This + prevents a crash in the event that the SNMP request times out, as + it appears to do very occasionally on certain hardware. Thanks to + Lars Tauber <ta...@bb...> for reporting the issue and testing + the fix. + +2011-09-22 18:22 adk0212 + + * doc/home-page/: index.html, index.wml: + + Add list of UPSes to avoid + +2011-09-15 22:16 adk0212 + + * src/drivers/net/net.c: + + Fix MODEL reporting + +2011-09-13 22:57 adk0212 + + * doc/home-page/: index.html, index.wml: + + Update home page for 3.14.10 release + +2011-09-13 22:34 adk0212 + + * ChangeLog, ReleaseNotes, include/version.h: + + Prep for 3.14.10 release + 2011-09-02 15:17 adk0212 * platforms/: darwin/Info.plist, mingw/winusb/apcupsd.inf: @@ -625,11 +1035,7 @@ 2010-01-16 10:19 adk0212 - * platforms/mingw/winusb/amd64/WdfCoInstaller01009.dll, - platforms/mingw/winusb/amd64/winusbcoinstaller2.dll, - platforms/mingw/winusb/i386/WdfCoInstaller01009.dll, - platforms/mingw/winusb/i386/winusbcoinstaller2.dll, - src/win32/installer/winapcupsd.nsi: + * src/win32/installer/winapcupsd.nsi: Move winusb coinstallers to depkgs-win32 so they do not bloat the source tree. @@ -750,11 +1156,8 @@ 2010-01-09 13:35 adk0212 - * src/: drivers/usb/win/Makefile, drivers/usb/win/hidutils.c, - drivers/usb/win/hidutils.h, drivers/usb/win/win-usb.c, - drivers/usb/win/winusb.h, win32/Makefile.in, - win32/libusb-winusb-bridge.c, win32/libusb-winusb-bridge.h, - win32/winusb.h: + * src/win32/: Makefile.in, libusb-winusb-bridge.c, + libusb-winusb-bridge.h, winusb.h: Consolidate win-usb driver back into generic-usb by writing a simple libusb API adapter for winusb (libusb-winusb-bridge). This @@ -844,21 +1247,11 @@ 2010-01-03 10:29 adk0212 - * platforms/mingw/winusb/: apcupsd.inf, - amd64/WdfCoInstaller01009.dll, amd64/winusbcoinstaller2.dll, - i386/WdfCoInstaller01009.dll, i386/winusbcoinstaller2.dll: + * platforms/mingw/winusb/apcupsd.inf: WinUsb-based INF file customized for APCUPSD and driver coinstallers from Win7 DDK. -2010-01-03 10:22 adk0212 - - * src/drivers/usb/win/: Makefile, hidutils.c, hidutils.h, - win-usb.c, winusb.h: - - First rev of Windows-specific USB driver based on Microsoft's - WinUsb framework for user mode USB drivers. - 2010-01-02 16:28 adk0212 * src/drivers/snmp/drv_powernet.c: @@ -3673,6 +4066,26 @@ support writes on UPSes that offer the same usage in both types of reports. +2007-10-17 19:00 adk0212 + + * src/drivers/usb/generic/generic-usb.h: + + file generic-usb.h was added on branch Branch-3_14 on 2012-03-30 + 23:47:08 +0000 + +2007-10-17 19:00 adk0212 + + * src/drivers/usb/: linux/linux-usb.h, generic/generic-usb.h: + + Forgot to check these in before. + +2007-10-17 19:00 adk0212 + + * src/drivers/usb/linux/linux-usb.h: + + file linux-usb.h was added on branch Branch-3_14 on 2012-03-30 + 23:47:08 +0000 + 2007-10-15 18:13 adk0212 * src/lib/: amutex.cpp, astring.cpp, autil.cpp: |
|
From: Adam K. <ad...@us...> - 2013-11-21 00:13:33
|
Update of /cvsroot/apcupsd/apcupsd/include In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv6644/include Modified Files: Tag: Branch-3_14 version.h Log Message: Update version info for 3.14.11 release Index: version.h =================================================================== RCS file: /cvsroot/apcupsd/apcupsd/include/version.h,v retrieving revision 1.133.2.24 retrieving revision 1.133.2.25 diff -u -d -r1.133.2.24 -r1.133.2.25 --- version.h 14 Sep 2011 02:34:31 -0000 1.133.2.24 +++ version.h 21 Nov 2013 00:13:31 -0000 1.133.2.25 @@ -1,6 +1,6 @@ #define DEBUG 1 -#define VERSION "3.14.10" -#define ADATE "13 September 2011" +#define VERSION "3.14.11" +#define ADATE "20 November 2013" #define APCUPSD_RELEASE VERSION |
|
From: Adam K. <ad...@us...> - 2013-11-21 00:12:23
|
Update of /cvsroot/apcupsd/apcupsd/doc In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv6531 Modified Files: Tag: Branch-3_14 apcupsd.conf.5 Log Message: Add modbus info to DEVICE section Index: apcupsd.conf.5 =================================================================== RCS file: /cvsroot/apcupsd/apcupsd/doc/apcupsd.conf.5,v retrieving revision 1.1.2.4 retrieving revision 1.1.2.5 diff -u -d -r1.1.2.4 -r1.1.2.5 --- apcupsd.conf.5 5 Aug 2013 14:05:13 -0000 1.1.2.4 +++ apcupsd.conf.5 21 Nov 2013 00:12:21 -0000 1.1.2.5 @@ -61,6 +61,9 @@ .It pcnet : ipaddr:username:passphrase (AP9617 SmartSlot card) +.It +modbus +: /dev/tty** (serial connection) .El .Pp If you have problems, please see the apcupsd manual for more |
|
From: Adam K. <ad...@us...> - 2013-11-21 00:08:53
|
Update of /cvsroot/apcupsd/apcupsd/doc/manual In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv6324 Modified Files: Tag: Branch-3_14 manual.html manual.rst Log Message: Add modbus information to the manual Index: manual.rst =================================================================== RCS file: /cvsroot/apcupsd/apcupsd/doc/manual/manual.rst,v retrieving revision 1.1.2.28 retrieving revision 1.1.2.29 diff -u -d -r1.1.2.28 -r1.1.2.29 --- manual.rst 21 Nov 2011 18:23:53 -0000 1.1.2.28 +++ manual.rst 21 Nov 2013 00:08:50 -0000 1.1.2.29 @@ -14,7 +14,7 @@ | |date| |time| | This manual documents apcupsd version 3.14.x -| Copyright |(C)| 2004-2009 Adam Kropelin +| Copyright |(C)| 2004-2013 Adam Kropelin | Copyright |(C)| 1999-2005 Kern Sibbald *Copying and distribution of this file, with or without modification, @@ -245,28 +245,20 @@ computer. apcsmart - An APCSmart UPS and its computer communicate - through an RS232C serial connection. They use it as a character - channel (2400bps, 8 data bits, 1 stop bit, no parity) and pass + The 'apcsmart' protocol uses an RS232 serial connection to pass commands back and forth in a primitive language resembling - modem-control codes. The - different APC UPSes all use closely related firmware, so the - language doesn't vary much (later versions add more commands). This + modem-control codes. APC calls this language "UPS-Link". Originally + introduced for Smart-UPS models (thus the name 'apcsmart'), this class of UPS is in decline, rapidly being replaced in APC's product - line by USB UPSes. + line by USB and MODBUS UPSes. usb A USB UPS speaks a universal well defined control language over a USB wire. Most of APC's lineup now uses this method as of late 2003, and it seems likely to completely take over in - their low- and middle range. Other manufacturers (Belkin, - Tripp-Lite, etc.) are moving the same way, though with a different - control protocol for each manufacturer. As long as USB hardware can - be mass-produced more cheaply than an Ethernet card, most UPSes are - likely to go this design route. Please note that even if you have a - USB UPS, if you use a serial cable with it (as can be supplied by - APC), you will need to configure your UPS as ``apcsmart`` rather - than ``usb``. + their low- and middle range. The most recent APC UPSes support only a + limited set of data over the USB interface. MODBUS (see below) is required + in order to access the advanced data. net This is the keyword to specify if you are using your @@ -292,6 +284,12 @@ AP9617 family of smart slot modules. The protocol is much simpler and potentially more secure than SNMP. +modbus + MODBUS is the newest APC protocol and operates over RS232 links. (It is + also capable of operating over USB, but apcupsd does not support this yet.) + MODBUS is APC's replacement for the aging 'apcsmart' (aka UPS-Link) + protocol. MODBUS is the only way to access detailed control and status + information on newer (esp. SMT series) UPSes. Choosing a Configuration Type @@ -2140,6 +2138,47 @@ ...to make sure networking stays up. +MODBUS Driver +------------- + +As of 3.14.11, apcupsd supports the MODBUS protocol over RS232 serial +interfaces. MODBUS is APC's replacement for the aging 'apcsmart' (aka UPS-Link) +protocol. It is recommended for modern (ex: SMT series) Smart-UPS where an +RS232 connection is available. + +Not all APC UPSes support MODBUS. New 2013 year Smart-UPS models are likely to +support it out-of-the-box and firmware updates are available for some older +models. APC/Schneider tech support is your best point of contact for determining +if a certain model will support MODBUS. That said, APC knowledge base article +FA164737 indicates MODBUS support is available for the majority of the SMC, +SMT, and SMX model lines. + +The required apcupsd.conf settings for MODBUS are straightforward: + +:: + + ## apcupsd.conf v1.1 ## + UPSCABLE smart + UPSTYPE modbus + DEVICE /dev/ttyS0 + LOCKFILE /var/lock + UPSCLASS standalone + UPSMODE disable + +The ``DEVICE`` setting identifies the serial port to which the UPS is connected. +This can take the form of ``COM1``, etc. on Windows or ``/dev/XXX`` on UNIX +systems. + +You should use the APC-supplied serial cable (P/N 940-0625A) that ships with +the UPS. Other 'smart' type cables may work, but only 940-0625A has been +formally tested at this time. + +Note that *most UPSes ship with MODBUS support disabled by default*. You must +use the UPS's front panel menu to enable MODBUS protocol support before apcupsd +will be able to communicate with the UPS. You may need to enable the "Advanced" +menu option before the MODBUS protocol option will be visible. + + Testing Apcupsd =============== Index: manual.html =================================================================== RCS file: /cvsroot/apcupsd/apcupsd/doc/manual/manual.html,v retrieving revision 1.1.2.17 retrieving revision 1.1.2.18 diff -u -d -r1.1.2.17 -r1.1.2.18 --- manual.html 21 Nov 2011 18:23:53 -0000 1.1.2.17 +++ manual.html 21 Nov 2013 00:08:50 -0000 1.1.2.18 @@ -297,9 +297,9 @@ <p><strong>Apcupsd is a UPS control system that permits orderly shutdown of your computer in the event of a power failure.</strong></p> <div class="line-block"> -<div class="line">November 21, 2011 13:21:12</div> +<div class="line">November 20, 2013 19:07:39</div> <div class="line">This manual documents apcupsd version 3.14.x</div> -<div class="line">Copyright © 2004-2009 Adam Kropelin</div> +<div class="line">Copyright © 2004-2013 Adam Kropelin</div> <div class="line">Copyright © 1999-2005 Kern Sibbald</div> </div> <p><em>Copying and distribution of this file, with or without modification, [...1575 lines suppressed...] <img alt="./thanks.png" src="./thanks.png" /> <p>The success of apcupsd is due to the many people that helped in development, testing and in many other ways.</p> <p>Thank all the developers that worked hard to make APCUPSD one of the best piece of software for UPS management.</p> <div class="section" id="contributors"> -<h3><a class="toc-backref" href="#id247">Contributors</a></h3> +<h3><a class="toc-backref" href="#id248">Contributors</a></h3> <dl class="docutils"> <dt><strong>Current Code Maintainer and Project Manager</strong></dt> <dd>Adam Kropelin (<a class="reference external" href="mailto:akropel1@rochester.rr.com">akropel1@rochester.rr.com</a>)</dd> @@ -8318,7 +8350,7 @@ </div> <div class="footer"> <hr class="footer" /> -Generated on: 2011-11-21 18:21 UTC. +Generated on: 2013-11-21 00:07 UTC. Generated by <a class="reference external" href="http://docutils.sourceforge.net/">Docutils</a> from <a class="reference external" href="http://docutils.sourceforge.net/rst.html">reStructuredText</a> source. </div> |
|
From: Adam K. <ad...@us...> - 2013-11-20 23:28:16
|
Update of /cvsroot/apcupsd/apcupsd/src/drivers/modbus In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv3436 Added Files: Tag: Branch-3_14 MPAO-99NQF6_R0_EN.pdf MPAO-99NQL2_R0_EN.pdf Log Message: Update cached copy of AN176, add AN177, AN178 --- NEW FILE: MPAO-99NQL2_R0_EN.pdf --- (This appears to be a binary file; contents omitted.) --- NEW FILE: MPAO-99NQF6_R0_EN.pdf --- (This appears to be a binary file; contents omitted.) |
|
From: Adam K. <ad...@us...> - 2013-11-20 23:21:34
|
Update of /cvsroot/apcupsd/apcupsd/src/drivers/modbus In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv2971/src/drivers/modbus Modified Files: Tag: Branch-3_14 mapping.cpp mapping.h modbus.cpp modbus.h Log Message: Add pointers to relevant APC app notes in modbus driver source files. Index: mapping.cpp =================================================================== RCS file: /cvsroot/apcupsd/apcupsd/src/drivers/modbus/Attic/mapping.cpp,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -u -d -r1.1.2.1 -r1.1.2.2 --- mapping.cpp 5 Aug 2013 14:05:16 -0000 1.1.2.1 +++ mapping.cpp 20 Nov 2013 23:21:31 -0000 1.1.2.2 @@ -22,6 +22,23 @@ * MA 02111-1307, USA. */ +/* + * Register mapping information below was derived from APC/Schneider Electric + * Application Note #176 <http://www.apc.com/whitepaper/?an=176> + * + * Thanks go to APC/Scneider for providing the Apcupsd team with early access + * to MODBUS protocol information to facilitate an Apcupsd driver. + * + * Relevant application notes include: + * + * AN176: Modbus Implementation in APC Smart-UPS + * <http://www.apc.com/whitepaper/?an=176> + * AN177: Software interface for Switched Outlet and UPS Management in Smart-UPS + * <http://www.apc.com/whitepaper/?an=177> + * AN178: USB HID Implementation in Smart-UPS + * <http://www.apc.com/whitepaper/?an=178> + */ + #include "mapping.h" using namespace APCModbusMapping; Index: mapping.h =================================================================== RCS file: /cvsroot/apcupsd/apcupsd/src/drivers/modbus/Attic/mapping.h,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -u -d -r1.1.2.1 -r1.1.2.2 --- mapping.h 5 Aug 2013 14:05:16 -0000 1.1.2.1 +++ mapping.h 20 Nov 2013 23:21:31 -0000 1.1.2.2 @@ -22,6 +22,23 @@ * MA 02111-1307, USA. */ +/* + * Register mapping information below was derived from APC/Schneider Electric + * Application Note #176 <http://www.apc.com/whitepaper/?an=176> + * + * Thanks go to APC/Scneider for providing the Apcupsd team with early access + * to MODBUS protocol information to facilitate an Apcupsd driver. + * + * Relevant application notes include: + * + * AN176: Modbus Implementation in APC Smart-UPS + * <http://www.apc.com/whitepaper/?an=176> + * AN177: Software interface for Switched Outlet and UPS Management in Smart-UPS + * <http://www.apc.com/whitepaper/?an=177> + * AN178: USB HID Implementation in Smart-UPS + * <http://www.apc.com/whitepaper/?an=178> + */ + #ifndef __APCMODBUSMAPPING_H_ #define __APCMODBUSMAPPING_H_ Index: modbus.h =================================================================== RCS file: /cvsroot/apcupsd/apcupsd/src/drivers/modbus/Attic/modbus.h,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -u -d -r1.1.2.1 -r1.1.2.2 --- modbus.h 5 Aug 2013 14:05:16 -0000 1.1.2.1 +++ modbus.h 20 Nov 2013 23:21:31 -0000 1.1.2.2 @@ -22,6 +22,20 @@ * MA 02111-1307, USA. */ +/* + * Thanks go to APC/Scneider for providing the Apcupsd team with early access + * to MODBUS protocol information to facilitate an Apcupsd driver. + * + * Relevant application notes include: + * + * AN176: Modbus Implementation in APC Smart-UPS + * <http://www.apc.com/whitepaper/?an=176> + * AN177: Software interface for Switched Outlet and UPS Management in Smart-UPS + * <http://www.apc.com/whitepaper/?an=177> + * AN178: USB HID Implementation in Smart-UPS + * <http://www.apc.com/whitepaper/?an=178> + */ + #ifndef _MODBUS_H #define _MODBUS_H Index: modbus.cpp =================================================================== RCS file: /cvsroot/apcupsd/apcupsd/src/drivers/modbus/Attic/modbus.cpp,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -u -d -r1.1.2.1 -r1.1.2.2 --- modbus.cpp 5 Aug 2013 14:05:16 -0000 1.1.2.1 +++ modbus.cpp 20 Nov 2013 23:21:31 -0000 1.1.2.2 @@ -22,6 +22,20 @@ * MA 02111-1307, USA. */ +/* + * Thanks go to APC/Scneider for providing the Apcupsd team with early access + * to MODBUS protocol information to facilitate an Apcupsd driver. + * + * Relevant application notes include: + * + * AN176: Modbus Implementation in APC Smart-UPS + * <http://www.apc.com/whitepaper/?an=176> + * AN177: Software interface for Switched Outlet and UPS Management in Smart-UPS + * <http://www.apc.com/whitepaper/?an=177> + * AN178: USB HID Implementation in Smart-UPS + * <http://www.apc.com/whitepaper/?an=178> + */ + #include "apc.h" #include "modbus.h" #include "astring.h" |
|
From: Adam K. <ad...@us...> - 2013-08-20 01:23:14
|
Update of /cvsroot/apcupsd/apcupsd/src In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv19617/src Modified Files: Tag: Branch-3_14 apctest.c Log Message: Implement the modbus killpower test in apctest. Comment out the other modbus tests that are not implemented (due to lack of MODBUS mappings in the UPS for the relevant controls) Index: apctest.c =================================================================== RCS file: /cvsroot/apcupsd/apcupsd/src/apctest.c,v retrieving revision 1.38.2.22 retrieving revision 1.38.2.23 diff -u -d -r1.38.2.22 -r1.38.2.23 --- apctest.c 5 Aug 2013 14:05:15 -0000 1.38.2.22 +++ apctest.c 20 Aug 2013 01:23:12 -0000 1.38.2.23 @@ -109,13 +109,13 @@ static uint64_t modbus_get_battery_date(void); static void modbus_set_battery_date(void); static void modbus_get_manf_date(void); -static void modbus_set_alarm(void); -static void modbus_set_sens(void); -static void modbus_set_xferv(int lowhigh); +//static void modbus_set_alarm(void); +//static void modbus_set_sens(void); +//static void modbus_set_xferv(int lowhigh); static void modbus_calibration(); static void modbus_test_alarm(void); -static int modbus_get_self_test_interval(void); -static void modbus_set_self_test_interval(void); +//static int modbus_get_self_test_interval(void); +//static void modbus_set_self_test_interval(void); #endif static void strip_trailing_junk(char *cmd); @@ -2440,13 +2440,13 @@ "3) Read last self-test result\n" "4) View/Change battery date\n" "5) View manufacturing date\n" - "6) View/Change alarm behavior\n" - "7) View/Change sensitivity\n" - "8) View/Change low transfer voltage\n" - "9) View/Change high transfer voltage\n" + //"6) View/Change alarm behavior\n" + //"7) View/Change sensitivity\n" + //"8) View/Change low transfer voltage\n" + //"9) View/Change high transfer voltage\n" "10) Perform battery calibration\n" "11) Test alarm\n" - "12) View/Change self-test interval\n" + //"12) View/Change self-test interval\n" " Q) Quit\n\n"); cmd = get_cmd("Select function number: "); @@ -2454,9 +2454,9 @@ int item = atoi(cmd); switch (item) { - //case 1: - // modbus_kill_power_test(); - // break; + case 1: + modbus_kill_power_test(); + break; case 2: modbus_run_self_test(); break; @@ -2509,6 +2509,28 @@ } #ifdef HAVE_MODBUS_DRIVER +static void modbus_kill_power_test(void) +{ + pmsg("\nThis test will attempt to power down the UPS.\n" + "The MODBUS cable should be plugged in to the UPS, but the\n" + "AC power plug to the UPS should be DISCONNECTED.\n\n" + "PLEASE DO NOT RUN THIS TEST WITH A COMPUTER CONNECTED TO YOUR UPS!!!\n\n" + "Please enter any character when ready to continue: "); + + fgetc(stdin); + pmsg("\n"); + + ptime(); + pmsg("calling kill_power function.\n"); + + make_file(ups, ups->pwrfailpath); + initiate_hibernate(ups); + unlink(ups->pwrfailpath); + + ptime(); + pmsg("returned from kill_power function.\n"); +} + static void modbus_get_self_test_result(void) { uint64_t uint; |
|
From: Adam K. <ad...@us...> - 2013-08-20 01:19:01
|
Update of /cvsroot/apcupsd/apcupsd/src/drivers/modbus In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv19466 Added Files: Tag: Branch-3_14 MPAO-98KJ7F_R0_EN.pdf Log Message: Add current rev of App Note 176 (June 2013) describing the MODBUS implementation on APC UPSes --- NEW FILE: MPAO-98KJ7F_R0_EN.pdf --- (This appears to be a binary file; contents omitted.) |
|
From: Adam K. <ad...@us...> - 2013-08-05 14:05:46
|
Update of /cvsroot/apcupsd/apcupsd/include In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv28129/include Modified Files: Tag: Branch-3_14 extern.h struct.h Log Message: Initial rev of MODBUS support Index: extern.h =================================================================== RCS file: /cvsroot/apcupsd/apcupsd/include/extern.h,v retrieving revision 1.7.2.8 retrieving revision 1.7.2.9 diff -u -d -r1.7.2.8 -r1.7.2.9 --- extern.h 30 Mar 2012 23:47:08 -0000 1.7.2.8 +++ extern.h 5 Aug 2013 14:05:13 -0000 1.7.2.9 @@ -209,7 +209,7 @@ /* In apclog.c */ extern void log_event(const UPSINFO *ups, int level, const char *fmt, ...); extern void logf(const char *fmt, ...); -extern void hex_dump(int level, void *data, unsigned int len); +extern void hex_dump(int level, const void *data, unsigned int len); extern int format_date(time_t timestamp, char *dest, size_t destlen); /* In apcnetlib.c */ Index: struct.h =================================================================== RCS file: /cvsroot/apcupsd/apcupsd/include/struct.h,v retrieving revision 1.26.2.9 retrieving revision 1.26.2.10 diff -u -d -r1.26.2.9 -r1.26.2.10 --- struct.h 19 Feb 2013 00:18:17 -0000 1.26.2.9 +++ struct.h 5 Aug 2013 14:05:13 -0000 1.26.2.10 @@ -63,6 +63,7 @@ TEST_UPS, /* TEST UPS Driver */ PCNET_UPS, /* PCNET UPS Driver */ SNMPLITE_UPS, /* SNMP Lite UPS Driver */ + MODBUS_UPS, /* MODBUS UPS Driver */ } UpsMode; typedef enum { @@ -168,6 +169,7 @@ void set_boost() { Status |= UPS_boost; }; void set_boost(int val) { if (val) set_boost(); else clear_boost(); }; void set_calibration() { Status |= UPS_calibration; }; + void set_calibration(int val) { if (val) set_calibration(); else clear_calibration(); }; void set_commlost() { Status |= UPS_commlost; }; void set_fastpoll() { Status |= UPS_fastpoll; }; void set_onbatt_msg() { Status |= UPS_onbatt_msg; }; |
|
From: Adam K. <ad...@us...> - 2013-08-05 14:05:45
|
Update of /cvsroot/apcupsd/apcupsd In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv28129 Modified Files: Tag: Branch-3_14 configure Log Message: Initial rev of MODBUS support Index: configure =================================================================== RCS file: /cvsroot/apcupsd/apcupsd/configure,v retrieving revision 1.129.2.39 retrieving revision 1.129.2.40 diff -u -d -r1.129.2.39 -r1.129.2.40 --- configure 30 Mar 2012 23:45:06 -0000 1.129.2.39 +++ configure 5 Aug 2013 14:05:12 -0000 1.129.2.40 @@ -311,7 +311,7 @@ # include <unistd.h> #endif" -ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS ABSSRCDIR topdir TOP_DIR VERSION DATE TRUEPRG FALSEPRG build build_cpu build_vendor build_os host host_cpu host_vendor host_os CXX CXXFLAGS LDFLAGS CPPFLAGS ac_ct_CXX EXEEXT OBJEXT CC CFLAGS ac_ct_CC CPP INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA AWK HAVE_GCC_TRUE HAVE_GCC_FALSE DEBUG DRVLIBS APCDRVLIBS PTHREAD_CFLAGS PTHREAD_LFLAGS APCACCESS SMTP APCTEST SHUTDOWN APCUPSD_MAIL WALL SCRIPTSHELL RANLIB RM CP ECHO LN SED AR MV RST2HTML RST2PDF EGREP X_CFLAGS X_PRE_LIBS X_LIBS X_EXTRA_LIBS HALPOLICYDIR GDHEAD APCSMART_DRIVER DUMB_DRIVER LIBUSBHID LIBUSBHIDINC usbcfg LIBUSBH USB_DRIVER USB_TYPE NET_DRIVER SNMPLITE_DRIVER SNMP_DRIVER TEST_DRIVER PCNET_DRIVER NISIP PKG_CONFIG ac_pt_PKG_CONFIG GAPCMON_CFLAGS GAPCMON_LIBS GAPCMON APCAGENT POWERFLUTE POWERLIBS MAKE LD CGI GD_LIBS CGIBIN SYSCONFDIR MKINSTALLDIRS EXTRADEFS LIBEXTRAOBJ EXTRAOBJ DISTDIR DISTNAME DISTVER SERIALDEV PIDDIR LOGDIR nologdir PWRFAILDIR LOCKDIR NISPORT UPSTYPE UPSCABLE HOST LIBOBJS LTLIBOBJS' +ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS ABSSRCDIR topdir TOP_DIR VERSION DATE TRUEPRG FALSEPRG build build_cpu build_vendor build_os host host_cpu host_vendor host_os CXX CXXFLAGS LDFLAGS CPPFLAGS ac_ct_CXX EXEEXT OBJEXT CC CFLAGS ac_ct_CC CPP INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA AWK HAVE_GCC_TRUE HAVE_GCC_FALSE DEBUG DRVLIBS APCDRVLIBS PTHREAD_CFLAGS PTHREAD_LFLAGS APCACCESS SMTP APCTEST SHUTDOWN APCUPSD_MAIL WALL SCRIPTSHELL RANLIB RM CP ECHO LN SED AR MV RST2HTML RST2PDF EGREP X_CFLAGS X_PRE_LIBS X_LIBS X_EXTRA_LIBS HALPOLICYDIR GDHEAD APCSMART_DRIVER DUMB_DRIVER LIBUSBHID LIBUSBHIDINC usbcfg LIBUSBH USB_DRIVER USB_TYPE NET_DRIVER SNMPLITE_DRIVER SNMP_DRIVER TEST_DRIVER PCNET_DRIVER MODBUS_DRIVER NISIP PKG_CONFIG ac_pt_PKG_CONFIG GAPCMON_CFLAGS GAPCMON_LIBS GAPCMON APCAGENT POWERFLUTE POWERLIBS MAKE LD CGI GD_LIBS CGIBIN SYSCONFDIR MKINSTALLDIRS EXTRADEFS LIBEXTRAOBJ EXTRAOBJ DISTDIR DISTNAME DISTVER SERIALDEV PIDDIR LOGDIR nologdir PWRFAILDIR LOCKDIR NISPORT UPSTYPE UPSCABLE HOST LIBOBJS LTLIBOBJS' ac_subst_files='' # Initialize some variables set by options. @@ -897,6 +897,9 @@ --enable-pcnet Compile PCNET driver code (default) --disable-pcnet No PCNET driver + + --enable-modbus Compile MODBUS driver code (default) + --disable-modbus No MODBUS driver --enable-gapcmon Build GTK/GUI front-end to apcupsd (default=no) --enable-apcagent Build menubar app for Mac OS X (default=no) --enable-install-distdir @@ -9546,6 +9549,7 @@ enable_net_snmp=yes enable_test=yes enable_pcnet=yes + enable_modbus=yes enable_cgi=yes enable_gapcmon=yes fi @@ -11054,6 +11058,26 @@ fi; +# Check whether --enable-modbus or --disable-modbus was given. +if test "${enable_modbus+set}" = set; then + enableval="$enable_modbus" + if test "$enableval" = "yes" ; then + cat >>confdefs.h <<\_ACEOF +#define HAVE_MODBUS_DRIVER 1 +_ACEOF + + MODBUS_DRIVER="modbus" + + fi +else + cat >>confdefs.h <<\_ACEOF +#define HAVE_MODBUS_DRIVER 1 +_ACEOF + + MODBUS_DRIVER="modbus" + +fi; + cat >>confdefs.h <<\_ACEOF #define HAVE_NISSERVER 1 _ACEOF @@ -13326,6 +13350,7 @@ s,@SNMP_DRIVER@,$SNMP_DRIVER,;t t s,@TEST_DRIVER@,$TEST_DRIVER,;t t s,@PCNET_DRIVER@,$PCNET_DRIVER,;t t +s,@MODBUS_DRIVER@,$MODBUS_DRIVER,;t t s,@NISIP@,$NISIP,;t t s,@PKG_CONFIG@,$PKG_CONFIG,;t t s,@ac_pt_PKG_CONFIG@,$ac_pt_PKG_CONFIG,;t t @@ -13895,7 +13920,7 @@ UPSTYPE ${UPSTYPE} UPSCABLE ${UPSCABLE} - drivers (no-* are disabled): ${APCSMART_DRIVER:-no-apcsmart} ${DUMB_DRIVER:-no-dumb} ${NET_DRIVER:-no-net} ${DISPLAY_USB_DRIVER:-no-usb} ${DISPLAY_SNMP_DRIVER:-no-snmp} ${DISPLAY_NETSNMP_DRIVER:-no-net-snmp} ${PCNET_DRIVER:-no-pcnet} ${TEST_DRIVER:-no-test} + drivers (no-* are disabled): ${APCSMART_DRIVER:-no-apcsmart} ${DUMB_DRIVER:-no-dumb} ${NET_DRIVER:-no-net} ${DISPLAY_USB_DRIVER:-no-usb} ${DISPLAY_SNMP_DRIVER:-no-snmp} ${DISPLAY_NETSNMP_DRIVER:-no-net-snmp} ${PCNET_DRIVER:-no-pcnet} ${MODBUS_DRIVER:-no-modbus} ${TEST_DRIVER:-no-test} enable-nis: ${NISSRV_ENABLED} with-nisip: ${NISIP} |
|
From: Adam K. <ad...@us...> - 2013-08-05 14:05:19
|
Update of /cvsroot/apcupsd/apcupsd/src/drivers/modbus In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv28129/src/drivers/modbus Added Files: Tag: Branch-3_14 Makefile mapping.cpp mapping.h modbus.cpp modbus.h Log Message: Initial rev of MODBUS support --- NEW FILE: mapping.cpp --- /* * mapping.cpp * * APC MODBUS register mappings */ /* * Copyright (C) 2013 Adam Kropelin * * This program is free software; you can redistribute it and/or * modify it under the terms of version 2 of the GNU General * Public License as published by the Free Software Foundation. * * 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 "mapping.h" using namespace APCModbusMapping; // APC MODBUS Registers addr nr type scale const RegInfo APCModbusMapping::REG_UPS_STATUS = { 0, 2, DT_UINT }; const RegInfo APCModbusMapping::REG_UPS_STATUS_CHANGE_CAUSE = { 2, 1, DT_UINT }; const RegInfo APCModbusMapping::REG_MOG_OUTLET_STATUS = { 3, 2, DT_UINT }; const RegInfo APCModbusMapping::REG_SOG0_OUTLET_STATUS = { 6, 2, DT_UINT }; const RegInfo APCModbusMapping::REG_SOG1_OUTLET_STATUS = { 9, 2, DT_UINT }; const RegInfo APCModbusMapping::REG_SOG2_OUTLET_STATUS = { 12, 2, DT_UINT }; const RegInfo APCModbusMapping::REG_SOG3_OUTLET_STATUS = { 15, 2, DT_UINT }; const RegInfo APCModbusMapping::REG_SIMPLE_SIGNALLING_STATUS = { 18, 1, DT_UINT }; const RegInfo APCModbusMapping::REG_GENERAL_ERROR = { 19, 1, DT_UINT }; const RegInfo APCModbusMapping::REG_POWER_SYSTEM_ERROR = { 20, 2, DT_UINT }; const RegInfo APCModbusMapping::REG_BATTERY_SYSTEM_ERROR = { 22, 1, DT_UINT }; const RegInfo APCModbusMapping::REG_BATTERY_TEST_STATUS = { 23, 1, DT_UINT }; const RegInfo APCModbusMapping::REG_CALIBRATION_STATUS = { 24, 1, DT_UINT }; const RegInfo APCModbusMapping::REG_BATTERY_LIFETIME_STATUS = { 25, 1, DT_UINT }; const RegInfo APCModbusMapping::REG_USER_INTERFACE_STATUS = { 26, 1, DT_UINT }; const RegInfo APCModbusMapping::REG_RUNTIME_REMAINING = { 128, 2, DT_UINT }; const RegInfo APCModbusMapping::REG_STATE_OF_CHARGE_PCT = { 130, 1, DT_UINT, 9 }; const RegInfo APCModbusMapping::REG_BATTERY_VOLTAGE = { 131, 1, DT_INT, 5 }; const RegInfo APCModbusMapping::REG_BATTERY_DATE = { 133, 1, DT_UINT }; const RegInfo APCModbusMapping::REG_BATTERY_TEMPERATURE = { 135, 1, DT_INT, 7 }; const RegInfo APCModbusMapping::REG_OUTPUT_0_REAL_POWER = { 136, 1, DT_UINT, 8 }; const RegInfo APCModbusMapping::REG_OUTPUT_0_APPARENT_POWER = { 138, 1, DT_UINT, 8 }; const RegInfo APCModbusMapping::REG_OUTPUT_0_CURRENT = { 140, 1, DT_UINT, 5 }; const RegInfo APCModbusMapping::REG_OUTPUT_0_VOLTAGE = { 142, 1, DT_UINT, 6 }; const RegInfo APCModbusMapping::REG_OUTPUT_FREQUENCY = { 144, 1, DT_UINT, 7 }; const RegInfo APCModbusMapping::REG_OUTPUT_ENERGY = { 145, 2, DT_UINT }; const RegInfo APCModbusMapping::REG_INPUT_STATUS = { 150, 1, DT_UINT }; const RegInfo APCModbusMapping::REG_INPUT_0_VOLTAGE = { 151, 1, DT_UINT, 6 }; const RegInfo APCModbusMapping::REG_INPUT_EFFICIENCY = { 154, 1, DT_INT }; const RegInfo APCModbusMapping::REG_MOG_TURN_OFF_COUNTDOWN = { 155, 1, DT_INT }; const RegInfo APCModbusMapping::REG_MOG_TURN_ON_COUNTDOWN = { 156, 1, DT_INT }; const RegInfo APCModbusMapping::REG_MOG_STAY_OFF_COUNTDOWN = { 157, 2, DT_INT }; const RegInfo APCModbusMapping::REG_SOG0_TURN_OFF_COUNTDOWN = { 159, 1, DT_INT }; const RegInfo APCModbusMapping::REG_SOG0_TURN_ON_COUNTDOWN = { 160, 1, DT_INT }; const RegInfo APCModbusMapping::REG_SOG0_STAY_OFF_COUNTDOWN = { 161, 2, DT_INT }; const RegInfo APCModbusMapping::REG_SOG1_TURN_OFF_COUNTDOWN = { 163, 1, DT_INT }; const RegInfo APCModbusMapping::REG_SOG1_TURN_ON_COUNTDOWN = { 164, 1, DT_INT }; const RegInfo APCModbusMapping::REG_SOG1_STAY_OFF_COUNTDOWN = { 165, 2, DT_INT }; const RegInfo APCModbusMapping::REG_SOG2_TURN_OFF_COUNTDOWN = { 167, 1, DT_INT }; const RegInfo APCModbusMapping::REG_SOG2_TURN_ON_COUNTDOWN = { 168, 1, DT_INT }; const RegInfo APCModbusMapping::REG_SOG2_STAY_OFF_COUNTDOWN = { 169, 2, DT_INT }; const RegInfo APCModbusMapping::REG_SOG3_TURN_OFF_COUNTDOWN = { 171, 1, DT_INT }; const RegInfo APCModbusMapping::REG_SOG3_TURN_ON_COUNTDOWN = { 172, 1, DT_INT }; const RegInfo APCModbusMapping::REG_SOG3_STAY_OFF_COUNTDOWN = { 173, 2, DT_INT }; const RegInfo APCModbusMapping::REG_FW_VERSION = { 516, 8, DT_STRING }; const RegInfo APCModbusMapping::REG_MODEL = { 532, 16, DT_STRING }; const RegInfo APCModbusMapping::REG_SKU = { 548, 16, DT_STRING }; const RegInfo APCModbusMapping::REG_SERIAL_NUMBER = { 564, 8, DT_STRING }; const RegInfo APCModbusMapping::REG_BATTERY_SKU = { 572, 8, DT_STRING }; const RegInfo APCModbusMapping::REG_EXTERNAL_BATTERY_SKU = { 580, 8, DT_STRING }; const RegInfo APCModbusMapping::REG_OUTPUT_APPARENT_POWER_RATING = { 588, 1, DT_UINT }; const RegInfo APCModbusMapping::REG_OUTPUT_REAL_POWER_RATING = { 589, 1, DT_UINT }; const RegInfo APCModbusMapping::REG_SOG_RELAY_CONFIG = { 590, 1, DT_UINT }; const RegInfo APCModbusMapping::REG_MANUFACTURE_DATE = { 591, 1, DT_UINT }; const RegInfo APCModbusMapping::REG_OUTPUT_VOLTAGE_SETTING = { 592, 1, DT_UINT }; const RegInfo APCModbusMapping::REG_BATTERY_DATE_SETTING = { 595, 1, DT_UINT }; const RegInfo APCModbusMapping::REG_NAME = { 596, 8, DT_STRING }; const RegInfo APCModbusMapping::REG_MOG_TURN_OFF_COUNT_SETTING = { 1029, 1, DT_INT }; const RegInfo APCModbusMapping::REG_MOG_TURN_ON_COUNT_SETTING = { 1030, 1, DT_INT }; const RegInfo APCModbusMapping::REG_MOG_STAY_OFF_COUNT_SETTING = { 1031, 2, DT_INT }; const RegInfo APCModbusMapping::REG_SOG0_TURN_OFF_COUNT_SETTING = { 1033, 1, DT_INT }; const RegInfo APCModbusMapping::REG_SOG0_TURN_ON_COUNT_SETTING = { 1034, 1, DT_INT }; const RegInfo APCModbusMapping::REG_SOG0_STAY_OFF_COUNT_SETTING = { 1035, 2, DT_INT }; const RegInfo APCModbusMapping::REG_SOG1_TURN_OFF_COUNT_SETTING = { 1037, 1, DT_INT }; const RegInfo APCModbusMapping::REG_SOG1_TURN_ON_COUNT_SETTING = { 1038, 1, DT_INT }; const RegInfo APCModbusMapping::REG_SOG1_STAY_OFF_COUNT_SETTING = { 1039, 2, DT_INT }; const RegInfo APCModbusMapping::REG_SOG2_TURN_OFF_COUNT_SETTING = { 1041, 1, DT_INT }; const RegInfo APCModbusMapping::REG_SOG2_TURN_ON_COUNT_SETTING = { 1042, 1, DT_INT }; const RegInfo APCModbusMapping::REG_SOG2_STAY_OFF_COUNT_SETTING = { 1043, 2, DT_INT }; const RegInfo APCModbusMapping::REG_SOG3_TURN_OFF_COUNT_SETTING = { 1045, 1, DT_INT }; const RegInfo APCModbusMapping::REG_SOG3_TURN_ON_COUNT_SETTING = { 1046, 1, DT_INT }; const RegInfo APCModbusMapping::REG_SOG3_STAY_OFF_COUNT_SETTING = { 1047, 2, DT_INT }; const RegInfo APCModbusMapping::REG_UPS_CMD = { 1536, 2, DT_UINT }; const RegInfo APCModbusMapping::REG_OUTLET_CMD = { 1538, 2, DT_UINT }; const RegInfo APCModbusMapping::REG_SIMPLE_SIGNALLING_CMD = { 1540, 1, DT_UINT }; const RegInfo APCModbusMapping::REG_BATTERY_TEST_CMD = { 1541, 1, DT_UINT }; const RegInfo APCModbusMapping::REG_CALIBRATION_CMD = { 1542, 1, DT_UINT }; const RegInfo APCModbusMapping::REG_USER_INTERFACE_CMD = { 1543, 1, DT_UINT }; const RegInfo APCModbusMapping::REG_MODBUS_MAP_ID = { 2048, 2, DT_STRING }; const RegInfo APCModbusMapping::REG_TEST_STRING = { 2050, 4, DT_STRING }; const RegInfo APCModbusMapping::REG_TEST_4B_NUMBER_1 = { 2054, 2, DT_UINT }; const RegInfo APCModbusMapping::REG_TEST_4B_NUMBER_2 = { 2056, 2, DT_INT }; const RegInfo APCModbusMapping::REG_TEST_2B_NUMBER_1 = { 2058, 1, DT_UINT }; const RegInfo APCModbusMapping::REG_TEST_2B_NUMBER_2 = { 2059, 1, DT_INT }; const RegInfo APCModbusMapping::REG_TEST_BPI_NUMBER_1 = { 2060, 1, DT_INT, 6 }; const RegInfo APCModbusMapping::REG_TEST_BPI_NUMBER_2 = { 2061, 1, DT_INT, 6 }; --- NEW FILE: mapping.h --- /* * mapping.h * * APC MODBUS register mappings */ /* * Copyright (C) 2013 Adam Kropelin * * This program is free software; you can redistribute it and/or * modify it under the terms of version 2 of the GNU General * Public License as published by the Free Software Foundation. * * 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 __APCMODBUSMAPPING_H_ #define __APCMODBUSMAPPING_H_ #include <stdint.h> #include <time.h> namespace APCModbusMapping { enum DataType { DT_STRING, // ASCII string DT_UINT, // Unsigned integer or float DT_INT, // Signed integer or float }; struct RegInfo { // MODBUS address of first register uint16_t addr; // Number of consecutive registers that comprise this data element uint16_t nregs; // Type of the data DataType type; // Scaling to be applied to convert INT/UINT to float uint8_t scale; }; // Dates in APC MODBUS registers are expressed as number of days since // 1/1/2000. This constant represents 1/1/2000 (UTC) as UNIX timestamp. static const time_t MODBUS_BASE_TIMESTAMP = 946684800; inline time_t ModbusRegTotime_t(uint64_t reg) { return MODBUS_BASE_TIMESTAMP + reg * 60 * 60 * 24; } inline uint64_t time_tToModbusReg(time_t t) { return (t - MODBUS_BASE_TIMESTAMP) / 60 / 60 / 24; } // UPS_STATUS register bits static const uint32_t US_ONLINE = (1U << 1); static const uint32_t US_ONBATTERY = (1U << 2); static const uint32_t US_OUTPUTOFF = (1U << 4); static const uint32_t US_FAULT = (1U << 5); static const uint32_t US_INPUTBAD = (1U << 6); static const uint32_t US_TEST = (1U << 7); static const uint32_t US_PENDING_OUTPUTON = (1U << 8); static const uint32_t US_PENDING_OUTPUTOFF = (1U << 9); static const uint32_t US_HIGH_EFFICIENCY = (1U << 13); static const uint32_t US_INFO_ALERT = (1U << 14); // SIMPLE_SIGNALING_STATUS register bits static const uint32_t SSS_POWER_FAILURE = (1U << 0); static const uint32_t SSS_SHUTDOWN_IMMINENT = (1U << 1); // GENERAL_ERROR register bits static const uint32_t GE_SITE_WIRING = (1U << 0); static const uint32_t GE_EEPROM = (1U << 1); static const uint32_t GE_ADC = (1U << 2); static const uint32_t GE_LOGIC_PS = (1U << 3); static const uint32_t GE_INTERNAL_COMMS = (1U << 4); static const uint32_t GE_UI_BUTTON = (1U << 5); static const uint32_t GE_EPO_ACTIVE = (1U << 7); // POWER_SYSTEM_ERROR register bits static const uint32_t PSE_OUTPUT_OVERLOAD = (1U << 0); static const uint32_t PSE_OUTPUT_SHORT = (1U << 1); static const uint32_t PSE_OUTPUT_OVERVOLT = (1U << 2); static const uint32_t PSE_OUTPUT_OVERTEMP = (1U << 4); static const uint32_t PSE_BACKFEED_RELAY = (1U << 5); static const uint32_t PSE_AVR_RELAY = (1U << 6); static const uint32_t PSE_PFCINPUT_RELAY = (1U << 7); static const uint32_t PSE_OUTPUT_RELAY = (1U << 8); static const uint32_t PSE_BYPASS_RELAY = (1U << 9); static const uint32_t PSE_PFC = (1U << 11); static const uint32_t PSE_DC_BUS_OVERVOLT = (1U << 12); static const uint32_t PSE_INVERTER = (1U << 13); // BATTERY_SYSTEM_ERROR register bits static const uint32_t BSE_DISCONNECTED = (1U << 0); static const uint32_t BSE_OVERVOLT = (1U << 1); static const uint32_t BSE_NEEDS_REPLACEMENT = (1U << 2); static const uint32_t BSE_OVERTEMP = (1U << 3); static const uint32_t BSE_CHARGER = (1U << 4); static const uint32_t BSE_TEMP_SENSOR = (1U << 5); static const uint32_t BSE_BUS_SOFT_START = (1U << 6); // BATTERY_TEST_STATUS register bits static const uint32_t BTS_PENDING = (1U << 0); // result static const uint32_t BTS_IN_PROGRESS = (1U << 1); // result static const uint32_t BTS_PASSED = (1U << 2); // result static const uint32_t BTS_FAILED = (1U << 3); // result static const uint32_t BTS_REFUSED = (1U << 4); // result static const uint32_t BTS_ABORTED = (1U << 5); // result static const uint32_t BTS_SRC_PROTOCOL = (1U << 6); // source static const uint32_t BTS_SRC_LOCAL_UI = (1U << 7); // source static const uint32_t BTS_SRC_INTERNAL = (1U << 8); // source static const uint32_t BTS_INVALID_STATE = (1U << 9); // result modifier static const uint32_t BTS_INTERNAL_FAULT = (1U << 10); // result modifier static const uint32_t BTS_STATE_OF_CHARGE = (1U << 11); // result modifier // CALIBRATION_STATUS register bits static const uint32_t CS_PENDING = (1U << 0); // result static const uint32_t CS_IN_PROGRESS = (1U << 1); // result static const uint32_t CS_PASSED = (1U << 2); // result static const uint32_t CS_FAILED = (1U << 3); // result static const uint32_t CS_REFUSED = (1U << 4); // result static const uint32_t CS_ABORTED = (1U << 5); // result static const uint32_t CS_SRC_PROTOCOL = (1U << 6); // source static const uint32_t CS_SRC_LOCAL_UI = (1U << 7); // source static const uint32_t CS_SRC_INTERNAL = (1U << 8); // source static const uint32_t CS_INVALID_STATE = (1U << 9); // result modifier static const uint32_t CS_INTERNAL_FAULT = (1U << 10); // result modifier static const uint32_t CS_STATE_OF_CHARGE = (1U << 11); // result modifier static const uint32_t CS_LOAD_CHANGE = (1U << 12); // result modifier static const uint32_t CS_AC_INPUT_BAD = (1U << 13); // result modifier static const uint32_t CS_LOAD_TOO_LOW = (1U << 14); // result modifier static const uint32_t CS_OVER_CHARGE = (1U << 15); // result modifier // BATTERY_LIFETIME_STATUS register bits static const uint32_t BLS_OK = (1U << 0); static const uint32_t BLS_NEAR_END = (1U << 1); static const uint32_t BLS_EXCEEDED = (1U << 2); static const uint32_t BLS_NEAR_END_ACK = (1U << 3); static const uint32_t BLS_EXCEEDED_ACK = (1U << 4); // USER_INTERFACE_STATUS register bits static const uint32_t UIS_TEST_IN_PROGRESS = (1U << 0); static const uint32_t UIS_AUDIBLE_ALARM = (1U << 1); static const uint32_t UIS_ALARM_MUTED = (1U << 2); // INPUT_STATUS register bits static const uint32_t IS_ACCEPTABLE = (1U << 0); static const uint32_t IS_PENDING_ACCEPTABLE = (1U << 1); static const uint32_t IS_LOW_VOLTAGE = (1U << 2); static const uint32_t IS_HIGH_VOLTAGE = (1U << 3); static const uint32_t IS_DISTORTED = (1U << 4); static const uint32_t IS_BOOST = (1U << 5); static const uint32_t IS_TRIM = (1U << 6); static const uint32_t IS_LOW_FREQ = (1U << 7); static const uint32_t IS_HIGH_FREQ = (1U << 8); static const uint32_t IS_FREQ_PHASE_UNLOCKED = (1U << 9); // OUTPUT_VOLTAGE_SETTING register bits static const uint32_t OVS_120VAC = (1U << 1); // SIMPLE_SIGNALING_CMD register bits static const uint32_t SSC_REQUEST_SHUTDOWN = (1U << 0); static const uint32_t SSC_REMOTE_OFF = (1U << 1); static const uint32_t SSC_REMOTE_ON = (1U << 2); // BATTERY_TEST_CMD register bits static const uint32_t BTC_START_TEST = (1U << 0); // CALIBRATION_CMD register bits static const uint32_t CC_START_CALIBRATION = (1U << 0); static const uint32_t CC_ABORT_CALIBRATION = (1U << 1); // USER_INTERFACE_CMD register bits static const uint32_t UIC_SHORT_TEST = (1U << 0); static const uint32_t UIC_CONTINUOUS_TEST = (1U << 1); static const uint32_t UIC_MUTE_ALARMS = (1U << 2); static const uint32_t UIC_UNMUTE_ALARMS = (1U << 3); static const uint32_t UIC_ACK_BATTERY_ALARMS = (1U << 5); // OUTLET_STATUS register bits static const uint32_t OS_STATE_ON = (1U << 0); static const uint32_t OS_STATE_OFF = (1U << 1); static const uint32_t OS_PROCESS_REBOOT = (1U << 2); // modifier static const uint32_t OS_PROCESS_SHUTDOWN = (1U << 3); // modifier static const uint32_t OS_PROCESS_SLEEP = (1U << 4); // modifier static const uint32_t OS_PEND_OFF_DELAY = (1U << 7); // modifier static const uint32_t OS_PEND_ON_AC_PRESENCE = (1U << 8); // modifier static const uint32_t OS_PEND_ON_MIN_RUNTIME = (1U << 9); // modifier static const uint32_t OS_MEMBER_GROUP_PROC1 = (1U << 10); // modifier static const uint32_t OS_MEMBER_GROUP_PROC2 = (1U << 11); // modifier static const uint32_t OS_LOW_RUNTIME = (1U << 12); // modifier // OUTLET_COMMAND register bits static const uint32_t OC_CANCEL = (1U << 0); // command static const uint32_t OC_OUTPUT_ON = (1U << 1); // command static const uint32_t OC_OUTPUT_OFF = (1U << 2); // command static const uint32_t OC_OUTPUT_SHUTDOWN = (1U << 3); // command static const uint32_t OC_OUTPUT_REBOOT = (1U << 4); // command static const uint32_t OC_COLD_BOOT_ALLOWED = (1U << 5); // modifier static const uint32_t OC_USE_ON_DELAY = (1U << 6); // modifier static const uint32_t OC_USE_OFF_DELAY = (1U << 7); // modifier static const uint32_t OC_TARGET_UOG = (1U << 8); // target static const uint32_t OC_TARGET_SOG0 = (1U << 9); // target static const uint32_t OC_TARGET_SOG1 = (1U << 10); // target static const uint32_t OC_TARGET_SOG2 = (1U << 11); // target static const uint32_t OC_SRC_USB = (1U << 12); // source static const uint32_t OC_SRC_LOCAL_UI = (1U << 13); // source static const uint32_t OC_SRC_RJ45 = (1U << 14); // source static const uint32_t OC_SRC_SMARTSLOT1 = (1U << 15); // source // SOG_RELAY_CONFIG register bits static const uint32_t SRC_MOG_PRESENT = (1U << 0); static const uint32_t SRC_SOG0_PRESENT = (1U << 1); static const uint32_t SRC_SOG1_PRESENT = (1U << 2); static const uint32_t SRC_SOG2_PRESENT = (1U << 3); static const uint32_t SRC_SOG3_PRESENT = (1U << 4); // UPS_STATUS_CHANGE_CAUSE enum static const uint32_t USCC_SYSTEM_INIT = 0; static const uint32_t USCC_HIGH_INPUT_VOLTAGE = 1; static const uint32_t USCC_LOW_INPUT_VOLTAGE = 2; static const uint32_t USCC_DISTORTED_INPUT = 3; static const uint32_t USCC_RAPID_CHANGE = 4; static const uint32_t USCC_HIGH_INPUT_FREQ = 5; static const uint32_t USCC_LOW_INPUT_FREQ = 6; static const uint32_t USCC_FREQ_PHASE_DIFF = 7; static const uint32_t USCC_ACCEPTABLE_INPUT = 8; static const uint32_t USCC_AUTOMATIC_TEST = 9; static const uint32_t USCC_TEST_ENDED = 10; static const uint32_t USCC_LOCAL_UI_CMD = 11; static const uint32_t USCC_PROTOCOL_CMD = 12; static const uint32_t USCC_LOW_BATTERY_VOLTAGE = 13; static const uint32_t USCC_GENERAL_ERROR = 14; static const uint32_t USCC_POWER_SYSTEM_ERROR = 15; static const uint32_t USCC_BATTERY_SYSTEM_ERROR = 16; static const uint32_t USCC_ERROR_CLEARED = 17; static const uint32_t USCC_AUTO_RESTART = 18; static const uint32_t USCC_OUTPUT_DISTORTED = 19; static const uint32_t USCC_OUTPUT_ACCEPTABLE = 20; static const uint32_t USCC_EPO_INTERFACE = 21; static const uint32_t USCC_INPUT_PHASE_DELTA_OUT_OF_RANGE = 22; static const uint32_t USCC_INPUT_NEUTRAL_DISCONNECTED = 23; static const uint32_t USCC_ATS_TRANSFER = 24; static const uint32_t USCC_CONFIG_CHANGE = 25; static const uint32_t USCC_ALERT_ASSERTED = 26; static const uint32_t USCC_ALERT_CLEARED = 27; static const uint32_t USCC_PLUG_RATING_EXCEEDED = 28; static const uint32_t USCC_OUTLET_GRP_STATE_CHANGE = 29; static const uint32_t USCC_FAILURE_BYPASS_EXPIRED = 30; // Registers extern const RegInfo REG_UPS_STATUS; extern const RegInfo REG_UPS_STATUS_CHANGE_CAUSE; extern const RegInfo REG_MOG_OUTLET_STATUS; extern const RegInfo REG_SOG0_OUTLET_STATUS; extern const RegInfo REG_SOG1_OUTLET_STATUS; extern const RegInfo REG_SOG2_OUTLET_STATUS; extern const RegInfo REG_SOG3_OUTLET_STATUS; extern const RegInfo REG_SIMPLE_SIGNALLING_STATUS; extern const RegInfo REG_GENERAL_ERROR; extern const RegInfo REG_POWER_SYSTEM_ERROR; extern const RegInfo REG_BATTERY_SYSTEM_ERROR; extern const RegInfo REG_BATTERY_TEST_STATUS; extern const RegInfo REG_CALIBRATION_STATUS; extern const RegInfo REG_BATTERY_LIFETIME_STATUS; extern const RegInfo REG_USER_INTERFACE_STATUS; extern const RegInfo REG_RUNTIME_REMAINING; extern const RegInfo REG_STATE_OF_CHARGE_PCT; extern const RegInfo REG_BATTERY_VOLTAGE; extern const RegInfo REG_BATTERY_DATE; extern const RegInfo REG_BATTERY_TEMPERATURE; extern const RegInfo REG_OUTPUT_0_REAL_POWER; extern const RegInfo REG_OUTPUT_0_APPARENT_POWER; extern const RegInfo REG_OUTPUT_0_CURRENT; extern const RegInfo REG_OUTPUT_0_VOLTAGE; extern const RegInfo REG_OUTPUT_FREQUENCY; extern const RegInfo REG_OUTPUT_ENERGY; extern const RegInfo REG_INPUT_STATUS; extern const RegInfo REG_INPUT_0_VOLTAGE; extern const RegInfo REG_INPUT_EFFICIENCY; extern const RegInfo REG_MOG_TURN_OFF_COUNTDOWN; extern const RegInfo REG_MOG_TURN_ON_COUNTDOWN; extern const RegInfo REG_MOG_STAY_OFF_COUNTDOWN; extern const RegInfo REG_SOG0_TURN_OFF_COUNTDOWN; extern const RegInfo REG_SOG0_TURN_ON_COUNTDOWN; extern const RegInfo REG_SOG0_STAY_OFF_COUNTDOWN; extern const RegInfo REG_SOG1_TURN_OFF_COUNTDOWN; extern const RegInfo REG_SOG1_TURN_ON_COUNTDOWN; extern const RegInfo REG_SOG1_STAY_OFF_COUNTDOWN; extern const RegInfo REG_SOG2_TURN_OFF_COUNTDOWN; extern const RegInfo REG_SOG2_TURN_ON_COUNTDOWN; extern const RegInfo REG_SOG2_STAY_OFF_COUNTDOWN; extern const RegInfo REG_SOG3_TURN_OFF_COUNTDOWN; extern const RegInfo REG_SOG3_TURN_ON_COUNTDOWN; extern const RegInfo REG_SOG3_STAY_OFF_COUNTDOWN; extern const RegInfo REG_FW_VERSION; extern const RegInfo REG_MODEL; extern const RegInfo REG_SKU; extern const RegInfo REG_SERIAL_NUMBER; extern const RegInfo REG_BATTERY_SKU; extern const RegInfo REG_EXTERNAL_BATTERY_SKU; extern const RegInfo REG_OUTPUT_APPARENT_POWER_RATING; extern const RegInfo REG_OUTPUT_REAL_POWER_RATING; extern const RegInfo REG_SOG_RELAY_CONFIG; extern const RegInfo REG_MANUFACTURE_DATE; extern const RegInfo REG_OUTPUT_VOLTAGE_SETTING; extern const RegInfo REG_BATTERY_DATE_SETTING; extern const RegInfo REG_NAME; extern const RegInfo REG_MOG_TURN_OFF_COUNT_SETTING; extern const RegInfo REG_MOG_TURN_ON_COUNT_SETTING; extern const RegInfo REG_MOG_STAY_OFF_COUNT_SETTING; extern const RegInfo REG_SOG0_TURN_OFF_COUNT_SETTING; extern const RegInfo REG_SOG0_TURN_ON_COUNT_SETTING; extern const RegInfo REG_SOG0_STAY_OFF_COUNT_SETTING; extern const RegInfo REG_SOG1_TURN_OFF_COUNT_SETTING; extern const RegInfo REG_SOG1_TURN_ON_COUNT_SETTING; extern const RegInfo REG_SOG1_STAY_OFF_COUNT_SETTING; extern const RegInfo REG_SOG2_TURN_OFF_COUNT_SETTING; extern const RegInfo REG_SOG2_TURN_ON_COUNT_SETTING; extern const RegInfo REG_SOG2_STAY_OFF_COUNT_SETTING; extern const RegInfo REG_SOG3_TURN_OFF_COUNT_SETTING; extern const RegInfo REG_SOG3_TURN_ON_COUNT_SETTING; extern const RegInfo REG_SOG3_STAY_OFF_COUNT_SETTING; extern const RegInfo REG_UPS_CMD; extern const RegInfo REG_OUTLET_CMD; extern const RegInfo REG_SIMPLE_SIGNALLING_CMD; extern const RegInfo REG_BATTERY_TEST_CMD; extern const RegInfo REG_CALIBRATION_CMD; extern const RegInfo REG_USER_INTERFACE_CMD; extern const RegInfo REG_MODBUS_MAP_ID; extern const RegInfo REG_TEST_STRING; extern const RegInfo REG_TEST_4B_NUMBER_1; extern const RegInfo REG_TEST_4B_NUMBER_2; extern const RegInfo REG_TEST_2B_NUMBER_1; extern const RegInfo REG_TEST_2B_NUMBER_2; extern const RegInfo REG_TEST_BPI_NUMBER_1; extern const RegInfo REG_TEST_BPI_NUMBER_2; }; #endif // __APCMODBUSMAPPING_H_ --- NEW FILE: Makefile --- topdir:=../../.. include $(topdir)/autoconf/targets.mak SRCS = $(wildcard *.cpp) all-targets: $(OBJS) # Include dependencies -include $(DEPS) --- NEW FILE: modbus.h --- /* * modbus.h * * Public header file for the modbus driver. */ /* * Copyright (C) 2013 Adam Kropelin * * This program is free software; you can redistribute it and/or * modify it under the terms of version 2 of the GNU General * Public License as published by the Free Software Foundation. * * 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 _MODBUS_H #define _MODBUS_H #include <stdint.h> #include "mapping.h" class astring; class ModbusUpsDriver: public UpsDriver { public: ModbusUpsDriver(UPSINFO *ups); virtual ~ModbusUpsDriver() {} static UpsDriver *Factory(UPSINFO *ups) { return new ModbusUpsDriver(ups); } virtual bool get_capabilities(); virtual bool read_volatile_data(); virtual bool read_static_data(); virtual bool kill_power(); virtual bool shutdown(); virtual bool check_state(); virtual bool Open(); virtual bool Close(); virtual bool entry_point(int command, void *data); bool write_string_to_ups(const APCModbusMapping::RegInfo ®, const char *str); bool write_int_to_ups(const APCModbusMapping::RegInfo ®, uint64_t val); bool write_dbl_to_ups(const APCModbusMapping::RegInfo ®, double val); bool read_string_from_ups(const APCModbusMapping::RegInfo ®, astring *val); bool read_int_from_ups(const APCModbusMapping::RegInfo ®, uint64_t *val); bool read_dbl_from_ups(const APCModbusMapping::RegInfo ®, double *val); private: struct CiInfo { int ci; bool dynamic; const APCModbusMapping::RegInfo *reg; }; static const CiInfo CI_TABLE[]; const CiInfo *GetCiInfo(int ci); bool UpdateCis(bool dynamic); bool UpdateCi(const CiInfo *info); bool UpdateCi(int ci); // MODBUS constants static const uint8_t DEFAULT_SLAVE_ADDR = 1; // MODBUS timeouts static const unsigned int MODBUS_INTERCHAR_TIMEOUT_MS = 25; // Spec is 15, increase for compatibility with USB serial dongles static const unsigned int MODBUS_INTERFRAME_TIMEOUT_MS = 45; // Spec is 35, increase due to UPS missing messages occasionally static const unsigned int MODBUS_IDLE_WAIT_TIMEOUT_MS = 100; static const unsigned int MODBUS_RESPONSE_TIMEOUT_MS = 500; // MODBUS function codes static const uint8_t MODBUS_FC_ERROR = 0x80; static const uint8_t MODBUS_FC_READ_HOLDING_REGS = 0x03; static const uint8_t MODBUS_FC_WRITE_REG = 0x06; static const uint8_t MODBUS_FC_WRITE_MULTIPLE_REGS = 0x10; // MODBUS message sizes static const unsigned int MODBUS_MAX_FRAME_SZ = 256; static const unsigned int MODBUS_MAX_PDU_SZ = MODBUS_MAX_FRAME_SZ - 4; typedef uint8_t ModbusFrame[MODBUS_MAX_FRAME_SZ]; typedef uint8_t ModbusPdu[MODBUS_MAX_PDU_SZ]; uint8_t *ReadRegister(uint16_t addr, unsigned int nregs); bool WriteRegister(uint16_t reg, unsigned int nregs, const uint8_t *data); bool SendAndWait( uint8_t fc, const ModbusPdu *txpdu, unsigned int txsz, ModbusPdu *rxpdu, unsigned int rxsz); bool ModbusTx(const ModbusFrame *frm, unsigned int sz); bool ModbusRx(ModbusFrame *frm, unsigned int *sz); bool ModbusWaitIdle(); uint16_t ModbusCrc(const uint8_t *data, unsigned int sz); uint8_t _slaveaddr; struct termios _oldtio; struct termios _newtio; time_t _commlost_time; }; #endif /* _MODBUS_H */ --- NEW FILE: modbus.cpp --- /* * modbus.cpp * * Driver for APC MODBUS protocol */ /* * Copyright (C) 2013 Adam Kropelin * * This program is free software; you can redistribute it and/or * modify it under the terms of version 2 of the GNU General * Public License as published by the Free Software Foundation. * * 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 [...1133 lines suppressed...] if (!read_int_from_ups(reg, &uint)) return false; // Scale if (reg.type == DT_INT) { // Sign extend int64_t sint = uint; unsigned int nbytes = reg.nregs * sizeof(uint16_t); sint <<= (8 * (sizeof(uint) - nbytes)); sint >>= (8 * (sizeof(uint) - nbytes)); *val = (double)sint / (1ULL << reg.scale); } else { *val = (double)uint / (1ULL << reg.scale); } return true; } |
|
From: Adam K. <ad...@us...> - 2013-08-05 14:05:18
|
Update of /cvsroot/apcupsd/apcupsd/src/drivers In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv28129/src/drivers Modified Files: Tag: Branch-3_14 Makefile drivers.c Log Message: Initial rev of MODBUS support Index: drivers.c =================================================================== RCS file: /cvsroot/apcupsd/apcupsd/src/drivers/drivers.c,v retrieving revision 1.14.2.7 retrieving revision 1.14.2.8 diff -u -d -r1.14.2.7 -r1.14.2.8 --- drivers.c 11 Feb 2013 15:21:48 -0000 1.14.2.7 +++ drivers.c 5 Aug 2013 14:05:15 -0000 1.14.2.8 @@ -58,6 +58,10 @@ # include "pcnet/pcnet.h" #endif +#ifdef HAVE_MODBUS_DRIVER +# include "modbus/modbus.h" +#endif + static const UPSDRIVER drivers[] = { #ifdef HAVE_DUMB_DRIVER { "dumb", DumbUpsDriver::Factory }, @@ -91,6 +95,10 @@ { "pcnet", PcnetUpsDriver::Factory }, #endif /* HAVE_PCNET_DRIVER */ +#ifdef HAVE_MODBUS_DRIVER + { "modbus", ModbusUpsDriver::Factory }, +#endif /* HAVE_MODBUS_DRIVER */ + /* * The NULL driver: closes the drivers list. */ @@ -177,6 +185,10 @@ driver_name = "pcnet"; break; + case MODBUS_UPS: + driver_name = "modbus"; + break; + default: case NO_UPS: Dmsg(000, "Warning: no UPS driver found (ups->mode.type=%d).\n", Index: Makefile =================================================================== RCS file: /cvsroot/apcupsd/apcupsd/src/drivers/Makefile,v retrieving revision 1.1.2.2 retrieving revision 1.1.2.3 diff -u -d -r1.1.2.2 -r1.1.2.3 --- Makefile 25 Oct 2009 15:03:13 -0000 1.1.2.2 +++ Makefile 5 Aug 2013 14:05:15 -0000 1.1.2.3 @@ -1,7 +1,7 @@ topdir:=../.. SUBDIRS = $(SMARTDRV) $(DUMBDRV) $(NETDRV) $(PCNETDRV) $(USBDRV) \ - $(SNMPDRV) $(SNMPLTDRV) $(TESTDRV) + $(SNMPDRV) $(SNMPLTDRV) $(TESTDRV) $(MODBUSDRV) include $(topdir)/autoconf/targets.mak |
|
From: Adam K. <ad...@us...> - 2013-08-05 14:05:17
|
Update of /cvsroot/apcupsd/apcupsd/platforms/mingw In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv28129/platforms/mingw Modified Files: Tag: Branch-3_14 apcupsd.conf.in Log Message: Initial rev of MODBUS support Index: apcupsd.conf.in =================================================================== RCS file: /cvsroot/apcupsd/apcupsd/platforms/mingw/apcupsd.conf.in,v retrieving revision 1.4.2.3 retrieving revision 1.4.2.4 diff -u -d -r1.4.2.3 -r1.4.2.4 --- apcupsd.conf.in 10 Jan 2010 20:05:34 -0000 1.4.2.3 +++ apcupsd.conf.in 5 Aug 2013 14:05:15 -0000 1.4.2.4 @@ -24,7 +24,7 @@ # 940-0119A, 940-0127A, 940-0128A, 940-0020B, # 940-0020C, 940-0023A, 940-0024B, 940-0024C, # 940-1524C, 940-0024G, 940-0095A, 940-0095B, -# 940-0095C, M-04-02-2000 +# 940-0095C, 940-0625A, M-04-02-2000 # UPSCABLE usb @@ -74,6 +74,9 @@ # passphrase are the credentials for which the card # has been configured. # +# modbus COMx Serial device for use with newest SmartUPS models +# supporting the MODBUS protocol. +# UPSTYPE usb DEVICE |
|
From: Adam K. <ad...@us...> - 2013-08-05 13:59:51
|
Update of /cvsroot/apcupsd/apcupsd/src/drivers/modbus In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv27691/modbus Log Message: Directory /cvsroot/apcupsd/apcupsd/src/drivers/modbus added to the repository --> Using per-directory sticky tag `Branch-3_14' |
|
From: Adam K. <ad...@us...> - 2013-04-19 01:12:49
|
Update of /cvsroot/apcupsd/apcupsd/src/win32 In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv21374 Modified Files: Tag: Branch-3_14 apctray.cpp balloonmgr.h email.c shutdown.c winevents.cpp winmain.cpp winservice.cpp winstat.cpp winups.h Log Message: Build fixes for gcc-4.2.4 Index: winevents.cpp =================================================================== RCS file: /cvsroot/apcupsd/apcupsd/src/win32/winevents.cpp,v retrieving revision 1.4.2.13 retrieving revision 1.4.2.14 diff -u -d -r1.4.2.13 -r1.4.2.14 --- winevents.cpp 12 Oct 2009 22:35:31 -0000 1.4.2.13 +++ winevents.cpp 19 Apr 2013 01:12:46 -0000 1.4.2.14 @@ -98,11 +98,13 @@ return TRUE; case WM_GETMINMAXINFO: + { // Restrict minimum size to initial window size MINMAXINFO *mmi = (MINMAXINFO*)lParam; mmi->ptMinTrackSize.x = _rect.right - _rect.left; mmi->ptMinTrackSize.y = _rect.bottom - _rect.top; return TRUE; + } case WM_SIZE: { Index: apctray.cpp =================================================================== RCS file: /cvsroot/apcupsd/apcupsd/src/win32/apctray.cpp,v retrieving revision 1.1.2.34 retrieving revision 1.1.2.35 diff -u -d -r1.1.2.34 -r1.1.2.35 --- apctray.cpp 1 Jan 2010 16:12:16 -0000 1.1.2.34 +++ apctray.cpp 19 Apr 2013 01:12:45 -0000 1.1.2.35 @@ -160,7 +160,8 @@ // Create global exit event and allow Adminstrator access to it so any // member of the Administrators group can signal it. exitevt = CreateEvent(NULL, TRUE, FALSE, APCTRAY_STOP_EVENT_NAME); - GrantAccess(exitevt, EVENT_MODIFY_STATE, TRUSTEE_IS_GROUP, "Administrators"); + TCHAR name[] = "Administrators"; + GrantAccess(exitevt, EVENT_MODIFY_STATE, TRUSTEE_IS_GROUP, name); // Wait for event to be signaled or for an error DWORD rc = WaitForSingleObject(exitevt, INFINITE); Index: winups.h =================================================================== RCS file: /cvsroot/apcupsd/apcupsd/src/win32/winups.h,v retrieving revision 1.5.2.9 retrieving revision 1.5.2.10 diff -u -d -r1.5.2.9 -r1.5.2.10 --- winups.h 7 Oct 2009 23:10:02 -0000 1.5.2.9 +++ winups.h 19 Apr 2013 01:12:46 -0000 1.5.2.10 @@ -42,7 +42,7 @@ #define APCTRAY_WINDOW_NAME "apctray" // Command line option to start in service mode -#define ApcupsdRunService "/service" +extern char ApcupsdRunService[]; // Names of various global events #define APCUPSD_STOP_EVENT_NAME "Global\\ApcupsdStopEvent" Index: balloonmgr.h =================================================================== RCS file: /cvsroot/apcupsd/apcupsd/src/win32/balloonmgr.h,v retrieving revision 1.1.2.2 retrieving revision 1.1.2.3 diff -u -d -r1.1.2.2 -r1.1.2.3 --- balloonmgr.h 12 Oct 2009 22:35:31 -0000 1.1.2.2 +++ balloonmgr.h 19 Apr 2013 01:12:45 -0000 1.1.2.3 @@ -31,7 +31,7 @@ ~BalloonMgr(); void PostBalloon(HWND hwnd, const char *title, const char *text); - static DWORD WINAPI BalloonMgr::Thread(LPVOID param); + static DWORD WINAPI Thread(LPVOID param); private: Index: winmain.cpp =================================================================== RCS file: /cvsroot/apcupsd/apcupsd/src/win32/winmain.cpp,v retrieving revision 1.17.2.8 retrieving revision 1.17.2.9 diff -u -d -r1.17.2.8 -r1.17.2.9 --- winmain.cpp 31 Jul 2009 14:21:58 -0000 1.17.2.8 +++ winmain.cpp 19 Apr 2013 01:12:46 -0000 1.17.2.9 @@ -27,13 +27,13 @@ #include "compat.h" // Standard command-line flag definitions -#define ApcupsdRunService "/service" -#define ApcupsdRunAsUserApp "/run" -#define ApcupsdInstallService "/install" -#define ApcupsdRemoveService "/remove" -#define ApcupsdKillRunningCopy "/kill" -#define ApcupsdShowHelp "/help" -#define ApcupsdQuiet "/quiet" +char ApcupsdRunService[] = "/service"; +char ApcupsdRunAsUserApp[] = "/run"; +char ApcupsdInstallService[] = "/install"; +char ApcupsdRemoveService[] = "/remove"; +char ApcupsdKillRunningCopy[] = "/kill"; +char ApcupsdShowHelp[] = "/help"; +char ApcupsdQuiet[] = "/quiet"; // Usage string static const char *ApcupsdUsageText = @@ -44,7 +44,8 @@ // Command line argument storage #define MAX_COMMAND_ARGS 100 -static char *command_args[MAX_COMMAND_ARGS] = { "apcupsd", NULL }; +static char apcupsd_name[] = "apcupsd"; +static char *command_args[MAX_COMMAND_ARGS] = { apcupsd_name, NULL }; static int num_command_args = 1; static char *winargs[MAX_COMMAND_ARGS]; static int num_winargs = 0; @@ -200,7 +201,8 @@ // Create global exit event and allow Adminstrator access to it so any // member of the Administrators group can signal it. exitevt = CreateEvent(NULL, TRUE, FALSE, APCUPSD_STOP_EVENT_NAME); - GrantAccess(exitevt, EVENT_MODIFY_STATE, TRUSTEE_IS_GROUP, "Administrators"); + TCHAR name[] = "Administrators"; + GrantAccess(exitevt, EVENT_MODIFY_STATE, TRUSTEE_IS_GROUP, name); // Wait for event to be signaled while (runthread) Index: shutdown.c =================================================================== RCS file: /cvsroot/apcupsd/apcupsd/src/win32/shutdown.c,v retrieving revision 1.7 retrieving revision 1.7.2.1 diff -u -d -r1.7 -r1.7.2.1 --- shutdown.c 28 Jul 2006 23:06:35 -0000 1.7 +++ shutdown.c 19 Apr 2013 01:12:46 -0000 1.7.2.1 @@ -28,7 +28,8 @@ int mode = MODE_HALT; int timeout = 0; int force = 1; - char* message; + char default_msg[] = "Power failure system going down!"; + char* message = default_msg; // Process command line args while ((ch = getopt(argc, argv, "+chrf")) != -1) { @@ -58,10 +59,8 @@ if (optind < argc) { message = argv[optind]; - } else { - message = "Power failure system going down!"; } - + // Get the current OS version OSVERSIONINFO ver; ver.dwOSVersionInfoSize = sizeof(ver); Index: email.c =================================================================== RCS file: /cvsroot/apcupsd/apcupsd/src/win32/email.c,v retrieving revision 1.5.2.1 retrieving revision 1.5.2.2 diff -u -d -r1.5.2.1 -r1.5.2.2 --- email.c 17 Jun 2007 12:54:10 -0000 1.5.2.1 +++ email.c 19 Apr 2013 01:12:46 -0000 1.5.2.2 @@ -22,16 +22,20 @@ ULONG err; MapiRecipDesc recip; char addr[100]; + char default_msg[] = "Apcupsd message"; + char default_text[] = "No text specified.\n"; MapiMessage emsg = {0, - "Apcupsd message", /* default subject */ - "No text specified.\n", /* default message text */ + default_msg, /* default subject */ + default_text, /* default message text */ NULL, NULL, NULL, 0, NULL, 1, &recip, 0, NULL}; + char default_name[] = "root"; + char default_addr[] = "SMTP:root"; recip.ulReserved = 0; recip.ulRecipClass = MAPI_TO; - recip.lpszName = "root"; /* default name */ - recip.lpszAddress = "SMTP:root"; /* default address */ + recip.lpszName = default_name; /* default name */ + recip.lpszAddress = default_addr; /* default address */ recip.ulEIDSize = 0; recip.lpEntryID = NULL; Index: winservice.cpp =================================================================== RCS file: /cvsroot/apcupsd/apcupsd/src/win32/winservice.cpp,v retrieving revision 1.20.2.6 retrieving revision 1.20.2.7 diff -u -d -r1.20.2.6 -r1.20.2.7 --- winservice.cpp 9 Sep 2010 13:12:49 -0000 1.20.2.6 +++ winservice.cpp 19 Apr 2013 01:12:46 -0000 1.20.2.7 @@ -16,7 +16,7 @@ #include "winservice.h" // Error message logging -void LogErrorMsg(char *msg, char *fname, int lineno); +void LogErrorMsg(const char *msg, const char *fname, int lineno); #define log_error_message(msg) LogErrorMsg((msg), __FILE__, __LINE__) // No internationalization support @@ -32,10 +32,15 @@ typedef DWORD (* RegisterServiceProcessFunc)(DWORD, DWORD); // Internal service name -#define SERVICE_NAME "Apcupsd" +static char SERVICE_NAME[] = "Apcupsd"; // Displayed service name -#define SERVICE_DISPLAYNAME "Apcupsd UPS Monitor" +static const char SERVICE_DISPLAYNAME[] = "Apcupsd UPS Monitor"; + +// Service description +static char APCUPSD_SERVICE_DESCRIPTION[] = + "Apcupsd provides shutdown of your computer " + "in the event of a power failure."; // List other required serves #define SERVICE_DEPENDENCIES __TEXT("tcpip\0afd\0+File System\0") @@ -49,7 +54,8 @@ // Windows 95/98/Me case VER_PLATFORM_WIN32_WINDOWS: // Obtain a handle to the kernel library - HINSTANCE kerneldll = LoadLibrary("KERNEL32.DLL"); + HINSTANCE kerneldll; + kerneldll = LoadLibrary("KERNEL32.DLL"); if (kerneldll == NULL) { MessageBox(NULL, "KERNEL32.DLL not found: Apcupsd service not started", @@ -58,7 +64,8 @@ } // And find the RegisterServiceProcess function - RegisterServiceProcessFunc RegisterServiceProcess = + RegisterServiceProcessFunc RegisterServiceProcess; + RegisterServiceProcess = (RegisterServiceProcessFunc)GetProcAddress( kerneldll, "RegisterServiceProcess"); if (RegisterServiceProcess == NULL) { @@ -241,7 +248,8 @@ // Windows NT, Win2K, WinXP case VER_PLATFORM_WIN32_NT: // Open the default, local Service Control Manager database - SC_HANDLE hsrvmanager = OpenSCManager(NULL, NULL, SC_MANAGER_ALL_ACCESS); + SC_HANDLE hsrvmanager; + hsrvmanager = OpenSCManager(NULL, NULL, SC_MANAGER_ALL_ACCESS); if (hsrvmanager == NULL) { MessageBox(NULL, _("The Service Control Manager could not be contacted - " @@ -251,7 +259,8 @@ } // Create an entry for the Apcupsd service - SC_HANDLE hservice = CreateService( + SC_HANDLE hservice; + hservice = CreateService( hsrvmanager, // SCManager database SERVICE_NAME, // name of service SERVICE_DISPLAYNAME, // name to display @@ -276,9 +285,7 @@ break; } - SetServiceDescription(hservice, - _("Apcupsd provides shutdown of your computer in the " - "event of a power failure.")); + SetServiceDescription(hservice, APCUPSD_SERVICE_DESCRIPTION); CloseServiceHandle(hservice); CloseServiceHandle(hsrvmanager); @@ -448,7 +455,7 @@ } // Error reporting -void LogErrorMsg(char *message, char *fname, int lineno) +void LogErrorMsg(const char *message, const char *fname, int lineno) { // Get the error code LPTSTR msg; @@ -471,7 +478,7 @@ snprintf(msgbuff, sizeof(msgbuff), "\n\n%s error: %ld at %s:%d", SERVICE_NAME, error, fname, lineno); - char *strings[3]; + const char *strings[3]; strings[0] = msgbuff; strings[1] = message; strings[2] = msg; Index: winstat.cpp =================================================================== RCS file: /cvsroot/apcupsd/apcupsd/src/win32/winstat.cpp,v retrieving revision 1.4.2.21 retrieving revision 1.4.2.22 diff -u -d -r1.4.2.21 -r1.4.2.22 --- winstat.cpp 12 Oct 2009 22:35:31 -0000 1.4.2.21 +++ winstat.cpp 19 Apr 2013 01:12:46 -0000 1.4.2.22 @@ -102,11 +102,13 @@ return TRUE; case WM_GETMINMAXINFO: + { // Restrict minimum size to initial window size MINMAXINFO *mmi = (MINMAXINFO*)lParam; mmi->ptMinTrackSize.x = _rect.right - _rect.left; mmi->ptMinTrackSize.y = _rect.bottom - _rect.top; return TRUE; + } case WM_SIZE: { |
|
From: Adam K. <ad...@us...> - 2013-04-19 01:12:17
|
Update of /cvsroot/apcupsd/apcupsd/src/win32 In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv21141 Modified Files: Tag: Branch-3_14 build-win32-cross-tools Log Message: Upgrade cross-tools to more recent versions gcc-4.2.4 (latest version which is easily built on RHEL5 due to gmp and mpfr dependencies) binutils-2.23.1 (latest) mingw-3.20 (latest, aside from 3.20-2 which is buggy) w32api-3.17-2 (latest) nsis-2.46 (latest, unchanged) Index: build-win32-cross-tools =================================================================== RCS file: /cvsroot/apcupsd/apcupsd/src/win32/build-win32-cross-tools,v retrieving revision 1.4.2.12 retrieving revision 1.4.2.13 diff -u -d -r1.4.2.12 -r1.4.2.13 --- build-win32-cross-tools 3 Jan 2010 17:27:54 -0000 1.4.2.12 +++ build-win32-cross-tools 19 Apr 2013 01:12:11 -0000 1.4.2.13 @@ -8,26 +8,13 @@ # based partly on Ray Kelm's script, which in turn was built on # Mo Dejong's script for doing the same, but with some added fixes. # -# My changes: -# 1. Adapted the script to the new packaging of MinGW GCC, which is -# currently split into core and auxiliary components. -# 2. The script now determines the GCC and BINUTILS directory name -# directly from the tar file contents. This gets around common -# problems due to the directory names not always following the -# expected patterns. -# 3. Grouped together and simplified the macros that users need to -# define. -# 4. Made optional components truly optional -- leave the -# corresponding archive names blank and they will be ignored. -# 5. Included an option to purge the installation directory before -# installing the current cross-compiler. -# # NOTE: If you choose a destination directory for the installation (set # in the macro PREFIX) for which you do not have write access, you will # need to run this script with root (or equivalent) privileges. # # # Updated by Igor Mikolic-Torreira <ig...@al...> +# Updated by Adam Kropelin <akr...@ro...> @@ -81,30 +68,29 @@ # and the exact name of the individual component files. MINGW_URL="http://heanet.dl.sourceforge.net/sourceforge/mingw" +MINGW_ARCHIVE="mingwrt-3.20-mingw32-dev.tar.gz" +MINGW_DLL_ARCHIVE="mingwrt-3.20-mingw32-dll.tar.gz" +W32API_ARCHIVE="w32api-3.17-2-mingw32-dev.tar.lzma" # GCC_CORE is required; the other components are optional. # Set any you don't want to "". You need binutils, # mingw runtime and w32api; do not ever set those to "". +GNU_URL="ftp://ftp.gnu.org/gnu" +GCC_VER="4.2.4" +BINUTILS_VER="2.23.1" -GCC_CORE_ARCHIVE="gcc-core-3.4.5-20060117-1-src.tar.gz" -GCC_GPP_ARCHIVE="gcc-g++-3.4.5-20060117-1-src.tar.gz" +BINUTILS_URL="$GNU_URL/binutils" +BINUTILS_ARCHIVE="binutils-$BINUTILS_VER.tar.bz2" + +GCC_URL="$GNU_URL/gcc/gcc-$GCC_VER" +GCC_CORE_ARCHIVE="gcc-core-$GCC_VER.tar.bz2" +GCC_GPP_ARCHIVE="gcc-g++-$GCC_VER.tar.bz2" GCC_G77_ARCHIVE="" GCC_OBJC_ARCHIVE="" GCC_JAVA_ARCHIVE="" GCC_ADA_ARCHIVE="" GCC_PATCH="" -# GCC_G77_ARCHIVE="gcc-g77-3.4.2-20040916-1-src.tar.gz" -# GCC_OBJC_ARCHIVE="gcc-objc-3.4.2-20040916-1-src.tar.gz" -# GCC_JAVA_ARCHIVE="gcc-java-3.4.2-20040916-1-src.tar.gz" - -BINUTILS_ARCHIVE="binutils-2.16.91-20060119-1-src.tar.gz" - -MINGW_ARCHIVE="mingw-runtime-3.9.tar.gz" - -W32API_ARCHIVE="w32api-3.14-mingw32-dev.tar.gz" - - # These are the files from the SDL website # These are optional, set them to "" if you don't want them) @@ -167,25 +153,27 @@ echo "You need to install wget." exit 1 fi - download_file "$GCC_CORE_ARCHIVE" "$MINGW_URL" + + download_file "$GCC_CORE_ARCHIVE" "$GCC_URL" if [ "x$GCC_GPP_ARCHIVE" != "x" ]; then - download_file "$GCC_GPP_ARCHIVE" "$MINGW_URL" + download_file "$GCC_GPP_ARCHIVE" "$GCC_URL" fi if [ "x$GCC_G77_ARCHIVE" != "x" ]; then - download_file "$GCC_G77_ARCHIVE" "$MINGW_URL" + download_file "$GCC_G77_ARCHIVE" "$GCC_URL" fi if [ "x$GCC_OBJC_ARCHIVE" != "x" ]; then - download_file "$GCC_OBJC_ARCHIVE" "$MINGW_URL" + download_file "$GCC_OBJC_ARCHIVE" "$GCC_URL" fi if [ "x$GCC_JAVA_ARCHIVE" != "x" ]; then - download_file "$GCC_JAVA_ARCHIVE" "$MINGW_URL" + download_file "$GCC_JAVA_ARCHIVE" "$GCC_URL" fi if [ "x$GCC_ADA_ARCHIVE" != "x" ]; then - download_file "$GCC_ADA_ARCHIVE" "$MINGW_URL" + download_file "$GCC_ADA_ARCHIVE" "$GCC_URL" fi - download_file "$BINUTILS_ARCHIVE" "$MINGW_URL" + download_file "$BINUTILS_ARCHIVE" "$BINUTILS_URL" download_file "$MINGW_ARCHIVE" "$MINGW_URL" + download_file "$MINGW_DLL_ARCHIVE" "$MINGW_URL" download_file "$W32API_ARCHIVE" "$MINGW_URL" if [ "x$OPENGL_ARCHIVE" != "x" ]; then @@ -231,7 +219,8 @@ cd "$PREFIX/$TARGET" tar -xzf "$SRCDIR/$MINGW_ARCHIVE" - tar -xzf "$SRCDIR/$W32API_ARCHIVE" + tar -xzf "$SRCDIR/$MINGW_DLL_ARCHIVE" + lzma -dc "$SRCDIR/$W32API_ARCHIVE" | tar -x if [ "x$OPENGL_ARCHIVE" != "x" ]; then tar -xzf "$SRCDIR/$OPENGL_ARCHIVE" @@ -248,12 +237,10 @@ function extract_binutils { cd "$SRCDIR" - BINUTILS=`tar -tzf "$SRCDIR/$BINUTILS_ARCHIVE" | head -n 1` - if [ "x${BINUTILS}" != "x./" ]; then - rm -rf "$BINUTILS" - fi + BINUTILS="binutils-$BINUTILS_VER" + rm -rf "$BINUTILS" echo "Extracting binutils" - tar -xzf "$SRCDIR/$BINUTILS_ARCHIVE" + tar -xjf "$SRCDIR/$BINUTILS_ARCHIVE" cd "$BUILDDIR" } @@ -300,30 +287,30 @@ function extract_gcc { cd "$SRCDIR" - GCC=`tar -tzf "$SRCDIR/$GCC_CORE_ARCHIVE" | head -n 1` -# rm -rf "$GCC" + GCC="gcc-$GCC_VER" + rm -rf "$GCC" echo "====== GCC ${GCC} =========" echo "Extracting gcc" - tar -xzf "$SRCDIR/$GCC_CORE_ARCHIVE" + tar -xjf "$SRCDIR/$GCC_CORE_ARCHIVE" if [ "x$GCC_GPP_ARCHIVE" != "x" ]; then GCC_LANGS=${GCC_LANGS}",c++" - tar -xzf "$SRCDIR/$GCC_GPP_ARCHIVE" + tar -xjf "$SRCDIR/$GCC_GPP_ARCHIVE" fi if [ "x$GCC_G77_ARCHIVE" != "x" ]; then GCC_LANGS=${GCC_LANGS}",f77" - tar -xzf "$SRCDIR/$GCC_G77_ARCHIVE" + tar -xjf "$SRCDIR/$GCC_G77_ARCHIVE" fi if [ "x$GCC_OBJC_ARCHIVE" != "x" ]; then GCC_LANGS=${GCC_LANGS}",objc" - tar -xzf "$SRCDIR/$GCC_OBJC_ARCHIVE" + tar -xjf "$SRCDIR/$GCC_OBJC_ARCHIVE" fi if [ "x$GCC_JAVA_ARCHIVE" != "x" ]; then GCC_LANGS=${GCC_LANGS}",java" - tar -xzf "$SRCDIR/$GCC_JAVA_ARCHIVE" + tar -xjf "$SRCDIR/$GCC_JAVA_ARCHIVE" fi if [ "x$GCC_ADA_ARCHIVE" != "x" ]; then GCC_LANGS=${GCC_LANGS}",ada" - tar -xzf "$SRCDIR/$GCC_ADA_ARCHIVE" + tar -xjf "$SRCDIR/$GCC_ADA_ARCHIVE" fi cd "$BUILDDIR" } |
|
From: Adam K. <ad...@us...> - 2013-02-19 00:25:45
|
Update of /cvsroot/apcupsd/apcupsd/src In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv1549/src Modified Files: Tag: Branch-3_14 apctest.c Log Message: Add lock file creation to apctest main() Index: apctest.c =================================================================== RCS file: /cvsroot/apcupsd/apcupsd/src/apctest.c,v retrieving revision 1.38.2.20 retrieving revision 1.38.2.21 diff -u -d -r1.38.2.20 -r1.38.2.21 --- apctest.c 30 Mar 2012 23:47:08 -0000 1.38.2.20 +++ apctest.c 19 Feb 2013 00:25:43 -0000 1.38.2.21 @@ -293,7 +293,11 @@ pmsg("cable.type = %s\n", ups->cable.long_name); pmsg("mode.type = %s\n", ups->mode.long_name); - delete_lockfile(ups); + if (create_lockfile(ups) == LCKERROR) { + Error_abort0("Unable to create UPS lock file.\n" + " If apcupsd or apctest is already running,\n" + " please stop it and run this program again.\n"); + } pmsg("Setting up the port ...\n"); setup_device(ups); |