 /* File:   Version.h
 * Author: Mike Quelly
 *
 * Created on September 25, 2014
 * Copyright 2014 by Michael Quelly
 * This software is the property of Phoenix Broadband Technologies, LLC.
 * Unauthorized reproduction or use is prohibited by Federal law.

This file contains the SC4 software version number.
*/
#ifndef VERSION_H
#define VERSION_H

#define VERSION_MAX_LEN 12		// changing this length will modify the common memory structure.
#define VERSION "1.44"
#endif
/*

Revision Log

12/05/2023 MP         See git for all future change notes
11/30/2023 MP 1.39.6  SC-144 Runtime Estimator virtual string support
11/20/2023 MP 1.39.5  SC-144 Runtime Estimator virtual string support
10/24/2023 MP 1.39.4  SC-134 hotfix for Runtime Estimator not working with two strings and one discharge sensor
10/13/2023 MP 1.39.3  Increment revision for release
09/21/2023 MP 1.39.2  Fix for SC-126 - admittance error on high capacity jars
09/05/2023 MP 1.39.1  Version change for rebuild
09/05/2023 MQ 1.38.5  Corrected a bug in dnp3 that was missing the jar values for
                      all but the last string.
08/25/2023 MP 1.39    Rev change for release
08/15/2023 MQ 1.38.4  Move Inter Message Delay default, minimum, and maximum values
                      to dnp3.h.
08/15/2023 MQ 1.38.3  Added Inter Message Delay time to dnp3 Configuration.
08/08/2023 MQ 1.38.2  Modified DNP3 to fix problems with Hydro-One's big database and
                      corrected bugs in Group20 and Group 110.
                      Added 100 mS delay after sending each message segment to limit
                      the through put to about 500 points per second which is the most
                      the Eaton Gateway can handle.
08/02/2023 MQ 1.38.1  Modified DNP3 to fix a bug that was not handling the additional
                      Application Fragments correctly when the first Application
                      Fragment was filled.  This corrected the customer problem.
07/25/2023 MP 1.38    Increment revision for release
07/18/2023 MP 1.37.2  Fix for SC-103 - loaddefaultconfs.sh permissions
07/06/2023 MP 1.37.1  Fixes for SC-86, SC-94, SC-93, and SC-91.  DisableEthReset default changed to set. Apache updated to 2.4.57. CSP headers added to httpd.conf.
04/13/2023 MP 1.37    Minor rev change for release. Also removed /home/admin/upgrade dir (cleanup)
04/10/2023 MP 1.36.12 Removed admin/admin from upgrade dir
04/06/2023 MP 1.36.11 Merge mainline DNP3 fixes into Security Fixes branch.
04/04/2023 MQ 1.36.10 Fixed the Group 60 Class 1/2/3/0 bug.  The Count in the object
                      header was broken when there was a class 1 event and class 0 data
                      in the same message.  Modified ReloadShort(), ReloadInt(),
                      GetShort() and GetInt().
03/29/2023 MQ 1.36.9  Corrected a DMP3 bug in AddDNP3EventToQueue() that was not handling
                      the Current Sensor Communications (CMI) alarm correctly.
03/15/2023 MP 1.36.9  Rebuild after merge
03/08/2023 MQ 1.36.8  Corrected DNP3 bug in HandleAnalogInputValue() that was causing
                      zero values to be sent.
03/06/2023 MQ 1.36.7  Moved 4 values Transport from common memory to DNP3connectionContext.
03/07/2023 MP 1.36.7  Fix for SC-59 - httpd and dropbear security fixes.
			New scripts run from sc4start.sh:
			- admin/bin/new/patches/patches.install -- installs httpd and dropbear files
			- admin/bin/loaddefaultconfs.sh -- loads default conf files if missing
02/02/2023 MP 1.36.6  Rebuild from MP dev env. No functional changes from MQs last commit.
12/22/2022 MQ 1.36.5  Corrected dnp3 bug for group 60 class 1/2/3/0 poll.
12/16/2022 MQ 1.36.4  Corrected dnp3 bug with group 60 class 1/2/3 poll.
12/09/2022 MQ/MP 1.36.4  Fixes for SC-13 and SC-7
11/29/2022 MQ 1.36.3  Cleaned up some ripple voltage issues.
                      cleaned up somw Site Viewer coloring issues.
10/28/2022 MQ 1.36 	  Release.
10/24/2022 MQ 1.35.22 Release Candidate.
10/20/2022 MQ 1.35.21 Fixed SNMP VirtualString current so it does not display zero when
                      there is not current sensor.  Now reading is not displayed in SNMP
                      when there is no current sensor assigned,
                      Added items to the FCS table so we can save the measurements here
                      for use by split strings.
10/17/2022 MP 1.35.20 Fix for Darpa database (large system) causing reboots on init in 1.35, was not an issue in 1.34.
10/11/2022 MP 1.35.19 Fix for SC-3 (fix ftp config file) and SC-4 added a few MIB objects
10/12/2022 MQ 1.35.18 Added ucPbtBatControllerStatus, controllerStatus.c,
                      and the support code to the alarm checking functions.
10/06/2022 MQ 1.35.17 BatteryPackAlarm Relay control is working.
09/22/2022 MQ 1.35.16 SCmini-XC Release.
09/12/2022 MQ 1.35.15 Release candidate.
08/23/2022 MQ 1.35.14 Improved error checking for miscData file.
					  Modified databaseUtils() to fix delete all data files from config menu.
					  Added SNMP objects to the virtual string table for
					  ucPbtBatVirtualStringCurrentSensor and ucPbtBatVirtualStringUGM.
08/22/2022 MQ 1.35.13 Modified DNP3systemInit() so we do not read the DNP3 Map file when disabled.
08/18/2022 MQ 1.35.12 Corrected a bug in ModBudTCP Data Validation.
08/17/2022 MQ 1.35.11 Added additional ModBus TCP Data Validation.
                      Added size check in ShowBuffer)_.
08/16/2022 MQ 1.35.10 Version sent to Mike P. for onsite debug
08/15/2022 MQ 1.35.9  Removed some (maybe) unneccessary mallocs() from ModBusTCP().
08/12/2022 MQ 1.35.8  Field Test Version.
08/12/2022 MQ 1.35.7  Added additional debug messages to ModBus code.  Use a
                      fixed tx buffer in place of the pool.
08/11/2022 MQ 1.35.6  Modified ModBusTCPConnection to handle error return from Send ModBUsTCPResponse().
08/11/2022 MQ 1.35.5  Beefed up error handling in ModBusTCP().
07/22/2022 MQ 1.35.4  Tree coloring is working for the Aggregate Admittance Alarm.
07/21/2022 MQ 1.35.3  Aggregate Low Admittance Alarm is working.
07/07/2022 MQ 1.35.2  Begin adding code for the Aggregate Low Admittance Alarm.
07/01/2022 MQ 1.35.1  Adding debug code to web to help Bryan fix some Site Viewer problems.
06/29/2022 MQ 1.35    Release
06/10/2022 MQ 1.34.18 Changed breaks to continues in ModBusTCP().
06/09/2022 MQ 1.34.17 Added more debug messages to ModBusTCPconnection().
06/09/2022 MQ 1.34.16 Enabled Debug in ModBusTCP().
06/07/2022 MQ 1.34.15 Modified ModBusTCPconnection().
06/02/2022 MQ 1.34.14 Added attempt to fix ModBus crashing problem.
04/29/2022 MQ 1.34.13 Modified GetEth0IPv4Address() so that if we disconnect and reconnect the
                      Ethernet cable and we loose our IP Addresss we will reset and recover.  We do
                      not know why we loose the IP Address when the cable is disconnected and reconnected.
04/14/2022 MQ 1.34.12 Shellinabox is working.  Requires OS rev ...0A16
03/07/2022 MQ 1.34.11 Modified dnp3 Group80() so it can reset all the IINI bits.
03/03/2022 MQ 1.34.10 Modified modBus to fix the bug that was making the DNP3 time load continuously.
02/24/2022 MQ 1.34.9  Corrected the virtual string voltage and delta voltage alarm index for
                      combined virtual strings.
02/09/2022 MQ 1.34.8  Make sure a current sensor is present before assigning it to a split string.
01/19/2022 MQ 1.34.7  Added Delta Battery Pack interface.
12/10/2021 MQ 1.34.6  Modified dnp3 Group 60 response.
12/01/2021 MQ 1.34.5  Rebuild to clean up a few errors from sc4 work.
11/16/2021 MQ 1.34.4  MBI is working.
11/04/2021 MQ 1.34.3  Pulled UpdateSubstring() out of UpdateSplitVirtualStrings so we
                      could use it in remcom for the lithium battey packs.
11/01/2021 MQ 1.34.2  Modified the MBI database for 8 devices per MBI.
10/29/2021 MQ 1.34.1  Begin work on virtual ports.
10/28/2021 MQ 1.34    Release
                      Added logging messages to SetLinuxTimeFromRTCchip().
                      Added startup logging message to SC4main.main().
10/27/2021 MQ 1.33.19 Release Candidate
                      Removed log message in  ReadRTCTimeWithRetrys().
10/26/2021 MQ 1.33.18 Release Candidate.
                      Reduce the Select log messages  and the Battery Spec error messages.
10/21/2021 MQ 1.33.17 Release candidate.
                      Modified GetEth0IPv4Address() to fix a crashing problem when the IPv4 address
                      was set to 0.0.0.0
10/20/2021 MQ 1.33.16 Release Candidate
                      Worked on FCS control of output relays.
10/18/2021 MQ 1.33.15 Release candidate.
10/18/2021 MQ 1.33.14 Added poll and error counters and Battery Manuf Name to the MIB.
                      Temporaily removed MBI polling.
                      Added NTP enable/diable startup log message.
10/14/2021 MQ 1.33.13 Additional modifications for the ModBus battery pack.
09/28/2021 MQ 1.33.12 Increase size of Virtual String Table.  This change is incompatible
                      with previous versions. This was needed for ModBus Battery Pack data.
09/08/2021 MQ 1.33.11 Relocated vsftpd.conf, added backup.
08/30/2021 MQ 1.33.10 Abandon https work because of higher priorities.
08/17/2021 MQ 1.33.09 Attempt to make https work.
08/11/2021 MQ 1.33.08 Cleaned up unused modbus files.
08/10/2021 MQ 1.33.07 ModBus Beta for SENS.
08/05/2021 MQ 1.33.06 ModBus testing.
07/09/2021 MQ 1.33.05 Cleaned up some bugs in the ModBus Site registers.
07/09/2021 MQ 1.33.04 Changed the discharge current threshold from -1 to -3 amps.
07/08/2021 MQ 1.33.03 Added ModBus process to the process monitor.
06/16/2021 MQ 1.33.02 Added usPbtRaFcsFloatSensorStatus and
                      ptrPbtRaFcsFloatSensorStatusDP[fcsRow].enumDiscreteAlarmState
                      to the virtual string web message.
05/24/2021 MQ 1.33.01 Added ModBusTCP interface and MBI Module.
04/26/2021 MQ 1.33    Release
04/22/2021 MQ 1.32.02 Release candidate
                      Fixed the time offset when setting the time from the PC.
04/14/2021 MQ 1.32.01 Continue testing
04/14/2021 MQ 1.32    Release
04/14/2021 MQ 1.31.15 Release Candidate
                      Additional work on the BS1B-2 discovery problem.
04/05/2021 MQ 1.31.14 Release Candidate
                      Fixed the BS1B-2 intermitent discovery problems.
02/11/2021 MQ 1.31.13 Release Candidate
                      Rebuilt after fixing the DiscreteTable walk and the trap problems for the SCMini-XC.
02/04/2021 MQ 1.31.12 Release Candidate.
                      Added Battery Energy embedded sensor.
01/20/2021 MQ 1.31.11 Release candidate.
                      Moved polling functions from virtualstrings.c to updateVirtualStrings.c.
                      Modified equalize.c to make balancing work for split strings.
01/15/2021 MQ 1.31.10 Release candidate.
                      Modified ReadRTCTimeWithRetrys() and WriteRTCTimeWithRetrys() to always log.
01/12/2021 MQ 1.31.9  Get NTP status in commonMemory following reset.  Modified GetValuesFromXMLFile().
                      Do not write to RTC if NTP is disabled.  Assume that the RTC has the correct time.
01/08/2021 MQ 1.31.8  Cleaned up some logging issues for Virtual Strings that would have caused
                      "log now" to not work properly and intermitent crashing durring automatic logging
                      for Virtual Strings.
01/06/2021 MQ 1.31.7  Completed testing of the Current Alarms Table modifications.
                      Corrected a bug in logFileAccess.c that was truncating log files.
12/17/2020 MQ 1.31.6  Modified RemovePropertyEntry() to remove any alarms in the CurrentAlarmsTable
              	  	  for the property that was removed.
12/14/2020 MQ 1.31.5  Added forceUpdate to SetTimeInRTCchip() so the web page time update request
                      happens without reguard to the present RTC time.
12/11/2020 MQ 1.31.4  Made major improvements in reading and writting from the RTC to improve
                      the reliability of the time.
12/03/2020 MQ 1.31.3  Fixed a missing reference to product.h that was crashing main durring initialization.
11/23/2020 MQ 1.31.2  Added additinal error checking to GetTimeFromRTCchip() in time.c before
                      setting the Linux time from the RTC.
11/20/2020 MQ 1.31.1  Corrected a bug in CurrentAlarmTableUpdate() that was not updating the
                      value when the alarm state changed.  From SC3.
11/13/2020 MQ 1.31    Release
11/12/2020 MQ 1.30.32 Modified how the pending admittance measurements are handled so we
                      do not measure continuously forever.
11/04/2020 MQ 1.30.31 Fixed a DNP3 bug that was not sending group 1 objects 22 thru 32.
11/03/2020 MQ 1.30.30 Modified admittance measuremment so the measurement time displayed
                      is the time of the last good measurement, not the attempted time.
11/02/2020 MQ 1.30.29 Modified GetStringPresent() to hopefully reduce the occurance of
                      phantom strings.  We are looking for a good place, where phantom
                      strings occur with some regularity so we can test this change.
10/22/2020 MQ 1.30.28 Corrected a DNP3 Group 30 response problem.  This bug was in 1.30.
10/14/2020 MQ 1.30.27 Modified SelectPort() to reduce the number of error message that may
                      have been been overruning the error log queue.
10/13/2020 MQ 1.30.26 Release Candidate.
                      Fixed the alarm controls for the combined string electrilyte sensor.
                      Delete the associated CCS file when we delete a string.
                      Fixed the battery balanceing enable for combined strings.
                      Replace commas in the string and battery names with spaces.
                      Fixed the measure all button operation for string 6.
10/08/2020 MQ 1.30.25 Cleaned up the runtime algorithm.
10/06/2020 MQ 1.30.24 Renamed sc4_options.h and sc4_version.h to options.h and version.h
08/26/2020 MQ 1.30.23 For testing mModifications to RunTime().
08/24/2020 MQ 1.30.22 Added delay to main shutdown to fix the bug where stopall did not
                      always stop all the processes.
08/21/2020 MQ 1.30.21 Allow manual admittance measurements durring a discharge for testing.
08/19/2020 MQ 1.30.21 Revise the runTime estimator to use the measured current.
08/17/2020 MQ 1.30.20 RunTime test on real batteries.
08/07/2020 MQ 1.30.19 Modified discrete and analog alarm initialization to prevent premature delayed alarms
                      during discovery.
07/31/2020 MQ 1.30.18 Added FCS sensor alarm to summary alarm status to fix a web page button coloring problem.
			          Working on the run time estimator.
06/24/2020 MQ 1.30.17 Allow anonymous DNP3 master when the master IP is set to "0.0.0.0".
05/05/2020 MQ 1.30.16 Fixed the crash, hopefully.
05/04/2020 MQ 1.30.15 Hydro One debug version.
04/29/2020 MQ 1.30.14 Hydro One release candidate.
04/20/2020 MQ 1.30.13 Hydro One adding dnp3 Group 2.
03/23/2020 MQ 1.30.12 Hydro One dnp3 trial release.
03/20/2020 MQ 1.30.11 Hydro One dnp3 trial release.
03/10/2020 MQ 1.30.10 Working on changing the dnp3 events queues to a FIFO.
01/28/2020 MQ 1.30.9  Modified DNP3 so we only set NEED_TIME and DEVICE_RESTART when the DNP3 process starts.
02/28/2020 MQ 1.30.8  Fixed a problem recovering in DNP3 after the ethernet cable was unpluggeg.
02/27/2020 MQ 1.30.7  Fixed a crash in DNP3 Group 1 virtual string message processing.
02/26/2020 MQ 1.30.6  Changed DNP3 Config program range check on Master and
                      Outstation Address to allow 0 to 65535.
02/20/2020 MQ 1.30.5  Continued revising DNP3 to use the Group 1 map file.
02/11/2019 MQ 1.30.4  Added Group 1 Binary Inputs to DNP3, Extensive DNP3 Testing.
                      Used for the Hydro one test
12/03/2019 MQ 1.30.3  Added code to make sure the green string button switches off on
                      the Classic web page during a discharge.
11/25/2019 MQ 1.30.2  Expanded string table in shared memory, added batteryBank table.
06/26/2019 MQ 1.30.1  Added new battery sensor hardware type 7.5 for low admittance jars.
04/02/2019 MQ 1.30	  Release
02/27/2019 MQ 1.29.7  Modified snmp_bat.c to prevent bailing out of the battery table
                      when we reach a pending object.
02/20/2019 MQ 1.29.6  Worked on cleaning up equalize.c, eliminated the local variables.
02/14/2019 MQ 1.29.5  Modified process monitor to detect BS Com failures during startup.
                      Fixed the Equaization coloring of the string buttons.
02/07/2019 MQ 1.29.4  Added "All Strings Button" to ripple current alarm.
01/31/2019 MQ 1.29.3  Fixed a bug that was preventing downloading firmware to battery sensors.
01/30/2019 MQ 1.29.3  Added NiCad sensor. Modified web page so the disable no ethernet reset checkbox
                      appears only in PBT mode.
01/25/2019 MQ 1.29.2  Added "Group60 includes Group20" to the dnp3 config menu.
01/24/2019 MQ 1.29.1  Experiments with improving symlink between admin/logfiles and the flash drive.
01/18/2019 MQ 1.29    Release
01/16/2019 MQ 1.28.13 Release candidate.
01/16/2019 MQ 1.28.12 Modified the upload web page display to clear the P-BUS device version
                      during the upload.
01/15/2019 MQ 1.28.12 Modified GetStringPresent() to increase sampling delay and load registers
                      between samples.
01/15/2019 MQ 1.28.11 Added AdjustXMLlineConfiguration() to initialize the XML file as required 
                      our P-BUS and BS communications.  called from main() in the main process.
01/14/2019 MQ 1.28.10 Added additional register initialization to SendAndReceivePBusData().
                      This change follows a test that revieled reinitializing the UART corrected
                      the CMI communications problem. 
01/14/2019 MQ 1.28.9  Revised logging message for select port errors.  
                      Increased SelectPort() timeout.
01/10/2019 MQ 1.28.9  Trial release.
01/10/2019 MQ 1.28.8  Added additional error messages to PbusUARTinit() and BsUARTinit().
01/09/2019 MQ 1.28.8  Disabled PIO Interrupts in SelectPBusPort().
01/08/2019 MQ 1.28.8  Modified PIOinit() so it would reinitialize.
01/07/2019 MQ 1.28.7  Added P-BUS UART and PIO reinitialization with test buttons.
01/04/2019 MQ 1.28.6  Modified operation 42 in webset() to do a better job cleaning up the string
                      data when changing the virtual string configuration.
12/28/2018 MQ 1.28.5  Adjusted main.main() main loop timing so we update the SPI more often.
12/28/2018 MQ 1.28.4  Added Watchdog Reset Count and Process Restarts to DNP3.
12/21/2018 MQ 1.28.3  Cleaned up the P-BUS and BS hardware com functions.
                      Added uiBatterySensorPolls and uiBatterySensorErrors.
12/19/2018 MQ 1.28.2  Corrected a bug in ComputeDNP3StringStartingIndexes() that was not accounting
                      for the site indexes.  This could change the customer's indexes if they were
                      requesting site data.
12/18/2018 MQ 1.28.2  Added pull-ups for UART transmit data lines.  Reset the receiver at the
                      start of each UART Tx message.  Combined sme of the P-BUS register statements.
12/14/2018 MQ 1.28.1  Added a disable for the No Ethernet reset. DisableEthReset.
12/13/2018 MQ 1.28.1  Working on DNP3 get all group30 without using group 60.
12/12/2018 MQ 1.28.1  Start the next round of changes.
12/06/2018 MQ 1.28    Released.
12/06/2018 MQ 1.27.14 Modified cellMetrixGroupProcessing() to fix the Circuit Breaker Control button
                      coloring on the web page when the selected ROM does not exit.
12/06/2018 MQ 1.27.14 Modified SendAndReceiveBatterySensorData() to reduce the timeout errors.
12/06/2018 MQ 1.27.14 Corrected a bug where when the files were deleted with an 81 command, the files were
                      being rewritten before the reset.
12/06/2018 MQ 1.27.14 More changes to the PBUS timeout code in  SendAndReceivePBusData().
12/05/2018 MQ 1.27.13 Modified buffer allocation for PBUS.  There was a bug after stoping and restarting
                      the SC4remcom process the buffer pointers got messed up.
                      Modified timeouts for P-BUS com.
                      This appears to have fixed the CMI com problems on Don's system.
12/04/2018 MQ 1.27.12 Fixed the automatic file rewrite for MiscData, RIM, ROM, CCS,
                      and UGM files.
12/04/2018 MQ 1.27.11 Modified P-Bus polling order to increase polling speed.
                      Removed the CMI temperature from the SNMP response because we have
                      eliminated the temperature sensor.
12/03/2018 MQ 1.27.11 Setup changes to initialize the current alarms when there is no string
                      connected.
11/30/2018 MQ 1.27.10 Added the CleanUp.... functions for the hardware components PIO,
                      PMC, TWI, UARTS, DMA.
11/29/2018 MQ 1.27.9  Renamed pbtBatStringVoltage to usPbtBatStringVoltage everywhere.
11/28/2018 MQ 1.27.8  Started work on CellMetrix logging.
11/27/2018 MQ 1.27.8  Modified BackupDatabaseToFlashDrive() so it creates the .../backup/...
                      folder, if it does not exist.
11/21/2018 MQ 1.27.8  Removed hardwareSPI.c from sc4bscom so the only SPI control
                      comes from main.
11/21/2018 MQ 1.27.7  Added the closed loop port selection mechanism.
11/20/2018 MQ 1.27.6  Created a seperate PIO Map for each process.
11/20/2018 MQ 1.27.5  Advanced the version number
11/19/2018 MQ 1.27.4  Corrected address for PIO_ODR in hardware.h
11/19/2018 MQ 1.27.4  Modifications to the hardware... files in an attempt to fix the phantom
                      string problem.
11/14/2018 MQ 1.27.3  Advanced the version number.
11/14/2018 MQ 1.27.2  Raised the threshold for string detection from 5 to 8.  See GetStringPresent()
                      in hardwareBS.c
11/14/2018 MQ 1.27.2  Cleaned up some logging problems that was causing extra logging headers to be written.
11/13/2018 MQ 1.27.2  Fixed intermittent CMI upload problems in hardwarePBUS().
11/08/2018 MQ 1.27.2  Corrected a bug that was not coloring the LED correctly when there was a faulted
                      sensor.
11/06/2018 MQ 1.27.1  Corrected a bug that was causing the discharge end message to be missed
                      in the physical string records for a combined virtual string.
11/06/2018 MQ 1.27.1  Added sync() to CloseLogFile() so the data is written to the flash drive.
11/02/2018 MQ 1.27.1  Detect when eth0 does not have an ipv4 address, when it should, and reset the
                      controller.
11/02/2018 MQ 1.27.1  Start on the next revision.
11/02/2018 MQ 1.27    Release.
11/01/2018 MQ 1.26.16 Added AdjustXMLconfiguration() to disable upnp and telnet on startup if enabled.
10/31/2018 MQ 1.26.16 Cleaned up the discharge debug logging messages for srings and combined
                      virtual strings.
10/30/2018 MQ 1.26.16 Corrected a bug where the virtual string emailed alarms were sometimes missing
                      the string letter in the subject.
10/30/2018 MQ 1.26.16 Changed the discharge times to 32 bits.  Save the string records to update the
                      discharge time totals durring a discharge. Modified the discharge time handiling
                      so that the combined string time tracks more closly with the included strings.
10/24/2018 MQ 1.26.16 Fixed the global firmware upload for the P-BUS. The individual CMI download was
                      working, the global was not.
10/22/2018 MQ 1.26.15 Advanced version before field test.
10/18/2018 MQ 1.26.14 Made changes to SendAndReceiveBatterySensorData() to prevent long message
                      from crashing the SC4.
10/18/2018 MQ 1.26.14 Changed watchdog back to 90 seconds.
10/16/2018 MQ 1.26.13 Added wait for reset to config command 81.
10/16/2018 MQ 1.26.13 Working on CMI communications bug.  Made changes to PbusUARTinit() and BsUARTinit().
10/11/2018 MQ 1.26.12 Added #include "universalDefs.h" to all files that do file access, and eventually
                      all files.  Contains a define that forces 64 bit file offsets to support large
                      file systems.  This makes statvfs() read the size of the 8G flash drive correctly.
10/08/2018 MQ 1.26.11 Added the USB flash drive status alarm.
10/04/2018 MQ 1.26.10 Modified the serial buffer masking to be consistant with the 256 byte buffer size.
10/03/2018 MQ 1.26.9  Split hardware into multilpe files.
10/02/2018 MQ 1.26.8  Fixed a phantom string problem.  See hardwareBS.c GetStringPresent().
10/02/2018 MQ 1.26.8  Added new battery sensor HW version 8.1 for EnerSys.
10/01/2018 MQ 1.26.7  Modified the reboot so that all of the process (execpt main.main()) are
                      shutdown before rebooting.
09/28/2018 MQ 1.26.6  Fixed a bug in setup for combined strings.  All the strings were not
                      being combined.
09/28/2018 MQ 1.26.6  Modified the reboot process so we shutdown all the process before rebooting.
09/25/2018 MQ 1.26.6  Additional modification to the P-BUS driver.  Do not modify RCR
                      durring the message.
09/21/2018 MQ 1.26.5  Added Log File Archive.
09/18/2018 MQ 1.26.4  Added additional debug messages and error checking to logging.
08/30/2018 MQ 1.26.3  Rewrote the P-BUS driver attempting to fix the intermitent
                      P-BUS communications errors that we have seen a few times
                      in the field.  This is difficult to test since we have not
                      found a way to reliably reproduce this problem in the lab.
08/14/2018 MQ 1.26.2  Attempt to fix the RIM/ROM button coloring error that we
                      could not reproduce.
                      Worked on InitUnit() and Delete...() in createRim.c.
                      Always clear memory to 0, not 0xFF as we did for the SC3.
08/09/2018 MQ 1.26.2  Convert commas to spaces then coping the string name to a
                      log file to prevent messing up the CSV file.
08/09/2018 MQ 1.26.1  Fixed the error that comes up at the end of sc4config by
                      correcting a bug in DetachAllSharedMemory().
08/07/2018 MQ 1.26.1  Fixed the update all float sensor status button operation.
08/06/2018 MQ 1.26.1  Fixed the meter notes field on the system setup web page.
08/03/2018 MQ 1.26.1  Start on the next version.
08/02/2018 MQ 1.26    Released
08/01/2018 MQ 1.25.4  Disabled UPnP in the .XML file.  Added default config files.
                      Moved the ftp log file to /home/admin/log/vsftpd/
                      Removed /home/admin/conf/ntp.conf since it is not used.
07/31/2018 MQ 1.25.3  Move the admittance measurement code to a new file admittance.c
                      Fix the "pending" bug.
07/31/2018 MQ 1.25.3  Fixed the admittance measurement countdown timer on the web page.
07/27/2018 MQ 1.25.3  Fixed a bug that was causing traps to fail after receiving a GetNext from an
                      unsupported enterprise.
07/23/2018 MQ 1.25.2  Increase the watchdog time to 60 sec.  setup was failing with 6 strings
                      of 40 jars.
07/12/2018 MQ 1.25.1  Start next version.
07/12/2018 MQ 1.25    Release.
07/12/2018 MQ 1.25    Added startup message to event and error log.  Added setup message to debug log.
07/12/2018 MQ 1.24.5  Modified I2C Write and Read Error logging to limit the messages.
07/11/2018 MQ 1.24.5  Corrected a bug in snmpMain.c that was crashing cbxagent when the first trap is sent.
06/28/2018 MQ 1.24.4  Added CellMetrix activation to the setup file version 2.6
06/25/2018 MQ 1.24.4  Changed the watchdog time from 90 sec to 30 sec to help with the CE test.
                      See TWIinit() in hardware.c
06/25/2018 MQ 1.24.3  Second attempt to fix the Upload problem described below.
                      Moved upload initialization to main.main().
06/21/2018 MQ 1.24.2  Modified upload so it does not accidentally load the CMI firmware to the battery sensor.
06/08/2018 MQ 1.24.1  Added Birth Certificate data tables and Web access.  Add the framework to collect the
                      birth certificate from the battery sensor.
05/31/2018 MQ 1.24.1  Added ucPbtBatStringDischargeCurrentRim, ucPbtBatStringDischargeCurrentInput,
                      ucPbtBatVirtualStringDischargeCurrentRim, and ucPbtBatVirtualStringDischargeCurrentInput
                      to the BatteryAgent MIB.
05/30/2018 MQ 1.24.1  Added the SC4 MIB.
05/14/2018 MQ 1.24.1  Start on the next version.
05/14/2018 MQ 1.24	  Released.
05/11/2018 MQ 1.23.5  Modfied setup.c, main.c, and webset.c so that the combined strings file is
                      deleted when all the boxes for the combined string in Manage Virtual Strings
                      are unchecked.
05/10/2018 MQ 1.23.5  Modified setup.c to fix a bug that was incorrectly
                      creating combined strings.
05/07/2018 MQ 1.23.4  Modified websocket.c to prevent a sc4web crash when a socket request is
                      received without a security key.  This fixed a crash that was occuring
                      several times a day on our SC4 that is on the internet.
04/27/2018 MQ 1.23.3  Modified IndexColumnDisplay() so it displays in sorted order not memory order.
04/19/2018 MQ 1.23.3  Corrected a bug that was displaying zero for admittance readings on new
                      battery strings, before the measurement was made.
04/18/2018 MQ 1.23.3  Modified SNMPmain.C so we do not answer HMS or PBT MIB requests until
                      initialization is complete.
04/13/2018 MQ 1.23.2  Modified AnalogTable() to fix a bug that was skipping the first
                      deadband entry on a MIB walk.
04/11/2018 MQ 1.23.1  Stop the flasher if CellMetrix ix not activated.
04/10/2018 MQ 1.23    Released
04/09/2018 MQ 1.22.2  Modified some parameters for the 16 volt sensor to match the SC3-XL.
04/04/2018 MQ 1.22.1  Fixed the cell metrix alarm annunciator so it does not go off following a reset
                      when disabled.
04/02/2018 MQ 1.22.1  Start on the next round of changes.
03/29/2018 MQ 1.22    Release
03/28/2018 MQ 1.21.3  Modified UpdateBatteryData() to compute the low resolution jar voltage from
                      the averaged high resolution voltage.  This is an attempt to fix the problem
                      where the hi-res and lo-res values are too far apart.
03/28/2018 MQ 1.21.2  Corrected a bug in CreateVirtualString() that resulted in the current sensor selection
                      for a Combined Virtual Srting being set to zero following a reset.
03/22/2018 MQ 1.21.1  Modified ProcessCellMetrixGroup() to correct the CellMetrix web page coloring when a
                      current sensor is not installed in a group.
03/21/2018 MQ 1.21.1  Fixed the port LED coloring problems.
                      Created ProcessCellMetrixGroup() and modified the battery Sensor polling process so
                      we process the CellMetrix group when we process the battery sensors rather than making
                      a second passe thru all the ports.
03/19/2018 MQ 1.21.1  Next version
03/16/2018 MQ 1.21    Release.
03/14/2018 MQ 1.20.1  It appears that the ocasional sensor com fault has been corrected by fixing a
                      read-modify-write bug that ossurs while setting the port number in the SPI data.
                      See hardware.c
                      Made some improvement in the operation of the Flash drive.  See flashDrive.c
02/09/2018 MQ 1.20.1  Fixed the setup file processing for the CellMetrix temperature alarms.
02/09/2018 MQ 1.20    Released.
02/08/2018 MQ 1.19    Improved the error handling in setup so old files without cellmetrix would still work.
                      Added error handling to setup so that blank fields are ignored in cellMetrix.
01/20/2018 MQ 1.19    Modified CellMetrix so the SystemStatus includes the Current alarm from the CMI.
01/29/2018 MQ 1.19    Modified "Reset String" so only a single string is reset and discovered.
01/25/2018 MQ 1.19    Setup now supports CellMetrix.
01/24/2018 MQ 1.19    Added alarm Annunciator control so the Cellmetrix alarm Annunciator can be
                      disabled when the 12V output is needed for something else, such as current sensor power.
01/18/2018 MQ 1.19    Changed version.
01/18/2018 MQ 1.18    Released.
01/12/2018 MQ 1.18    Fixed the sc4config 81 (deleteAllFiles) command so it includes CellMetrix and
                      miscData File.
01/12/2018 MQ 1.18    Corrected a bug that was showing a discharge current when there was no RIM
                      assigned for the discharge sensor.
01/05/2018 MQ 1.18    Added Discover for an individual port.
                      Modified HV Discovery for improve intermitent discovery problems and added debug logging.
12/29/2017 MQ 1.18    Fixed a bug that was not updating the Flash drive status on the web page when running
                      CellMetrix and there are no battery sensors,
                      Fixed a bug in that was not disabling the "use battery sensor temperature" function in
                      the CellMetrix group when a string was deleted.
12/28/2017 MQ 1.18    Improved the error handling in the I2C functions to eliminate most of the I2C errors.
12/19/2017 MQ 1.18    Changed version to 1.18.
12/18/2017 MQ 1.17    Release
12/06/2017 MQ 1.17    Added DNP3EventQueue.
12/01/2017 MQ 1.17    Many changes to DNP3 to handle the classes properly.
11/??/2017 MQ 1.17    Modified CopyDiscreteStringAlarms() to fix a crash when the the discharge alarm
                      was modified for all strings.
11/02/2017 MQ 1.17    Added code to CellMetrix to handle the Group LED when no jars are present.
11/01/2017 MQ 1.17    Started work on the next version.
10/31/2017 MQ 1.16    Release
10/31/2017 MQ 1.16    Added some MIB objects, see the MIB for details.
                      Made some changes to the CMI polling to reduce the overlap in measurements and
                      allow for longer P-BUS cables.
10/18/2017 MQ 1.16    Changed version number and started work on cellMetrix changes.
                      1.15 was not officially released but is was put in an Excelon and BRT controller.
10/17/2017 MQ 1.15    Modified Set initial cell admittance so it works properly for split strings.
                      Modified Copy cell admittance so it works properly for split strings.
                      Modified Set string name also.
                      These fixes require web version 1.05 or newer.
10/09/2017 MQ 1.15    Fixed CellMetrix Activation so it take the first time.
09/25/2017 MQ 1.15    Started work on the next version.
09/20/2017 MQ 1.14    Modified check for eth0 slightly in sc4main.main.CheckLink()
09/20/2017 MQ 1.14    Temporarily disabled starting dnp3 to eliminate the possibility this is
                      involved in internet crashing problem.
09/19/2017 MQ 1.14    Beefed up the error checking for the 30704 UDP port processing in main.sc4web().
09/08/2017 MQ 1.14    Modified low voltage discovery so it will not get stuck when a defective
                      sensor returns an invalid string voltage.
09/04/2017 MQ 1.14    Started work on the next version.
09/04/2017 MQ 1.13    Released.
08/30/2017 MQ 1.13    Removed some delays from LV discovery that were not there in the SC3-XL.
                      This is an attempt to make LV discovery more reliable.
08/28/2017 MQ 1.13    Started work on the next version.
08/28/2017 MQ 1.12    Released.
08/28/2017 MQ 1.12    Made some changed to the CellMetrix Group MIB Code that appeared to fix a
                      problem problem where the group mib walk stoped after 1 group.
08/23/2017 MQ 1.12    Fixed a bug in webset.c that was crashing the web process when an invalid
                      entityRow was while changing the Site Name.
                      Modified the CellMetrix initialization process so the CellMetrix Status will
                      appear on the web page during initialization.
08/22/2017 MQ 1.12    Modified CellMetrix so it will make thermal runaway alarms with only
                      an ambient temperature sensor and the battery sensor temperatures, and
                      will not indicate a system failure when there are no Group temperature
                      sensors.
08/19/2017 MQ 1.12    Added some checks to validate the setup file before processing it.
08/19/2017 MQ 1.12    Start work on the next version.
08/14/2017 MQ 1.11    Fixed a bug that was preventing discovery frm running muliple times
                      durring initialization.  Adjusted the HV discovery timing.
08/12/2017 MQ 1.11    Fixed a bug that was preving the string files from being written
                      following the loading of a setup.csv file.
08/11/2017 MQ 1.11    Start a new version.
08/08/2017 MQ 1.10    Corrected a bug that was causing a SNMP MIB walk error on the 14 Virtual
                      SubString.
07/28/2017 MQ 1.10    Fixed a bug that was disabling discovery on a string following a reset
                      of that string.
                      Increased the battery Sensor communications timeouts by 1 byte period
                      to possibly help with discovery issues.
                      Modified webset.c so the Reset All Sensors button on the web page works.
                      Fixed a problem in LvSensorDiscovery() where the sensor address was being
                      duplicated at the low end of short (6 jars or less) positive 2V strings.
07/27/2017 MQ 1.10    Added usSiteControllerInitComplete check to CheckAllAlarms() to block
                      CellMetrix alarms that were occurring on startup.
07/26/2017 MQ 1.10    Start a discovry after a string polarity change.
07/26/2017 MQ 1.10    Umount the flash drive before reboot.
07/25/2017 MQ 1.10    Extended reboot time by 10 sec to allow more time to save the
                      database files.
07/21/2017 MQ 1.10    Incrimented the version number.
07/18/2017 MQ 1.09    Increased wait for Ethernet cable from 60 to 120 seconds.
                      Modified DiscoverNow so it discovers on strings with discovery disabled.
07/13/2017 MQ 1.09    Advanced the version number.
07/13/2017 MQ 1.08    Modified webset.c and createStrings.c to prevent the stringName from
                      overwritting the communications options and blocling string communications.
07/12/2017 MQ 1.08    Modified sc4config to fix adding keys to the SNMP config file.
06/07/2017 MQ 1.08    Testing automatic reset following setup.
                      Fixxed CellMetrix deactivation.
06/02/2017 MQ 1.07    Proper release with the SNMP fix.  For reasons I don't understand the 1.06
                      release had the 1.05 cbxagent file.
05/31/2017 MQ 1.06    Tested SNMP fix for Cox.
05/23/2017 MQ 1.05    Always enable Discovery in setup.c setuopString().
                      Always initialize the paret string in InitializeVirtualString().
                      Modified HandleVirtualStringDischarge() so we do not report a discharge if the
                      string voltage is zero.
05/18/2017 MQ 1.05    Modified the RTC Read at startup so we always initialize the local time
                      from the RTC.
                      Modified HandleIntegerIndex() to correct a problem with GetNext on
                      objects with no response.  Lost {} in linux conversion.
05/16/2017 MQ 1.04    Do not create strings without jars from setup.csv.
                      Fixed a bug in split string discrete alarms copy to all strings.
                      Fixed a bug in split strings analog alarms copy to all jars.
                      Fixed a bug in split string write all sring names.
05/11/2017 MQ 1.03    Working on the SPI timing.
05/08/2017 MQ 1.02    Fixed a bug SNMP in that was resetting the controller when walking the Virtual String Mib.
05/05/2017 MQ 1.02    Removed the 1.01 change.
05/04/2017 MQ 1.01    Adjusted SPI clock phase to fix Aux port problems on a few units.
05/04/2017 MQ 1.00    First official release.  Sent to Charter.
05/02/2017 MQ 0.27    Cleaned up a couple discharge detection bugs on split strings.
04/27/2017 MQ 0.26    Added the ability to get the discharge current from a CR Magnetics
				      current sensor on a RIM.
				      Added a varbind to the Trap with the Site Name from the entity MIB.
04/19/2017 MQ 0.26    Modified setup.c to force 24 jar strings of low voltage sensors make
                      jar 1 most positive.
				      Modified polling.c so the test fixture would display the correct
				      sequential string voltages.
03/03/2017 MQ 0.26    Force the Reset indicator that lights all the port LEDs in updateSPI().
02/17/2017 MQ 0.25    Handle out of range for the CMI current measurement.
                      Fixed the set time from PC operation.
02/15/2017 MQ 0.24    Modified the RIM, ROM, and UGM summaryAlarm calculation so the value is
                      updated even when the device has a communication fault.  This corrects the problem
                      where the web page buttons are not updated whne ther is a communication fault.
02/08/2017 MQ 0.23    Fixed the Admittance Measurement.
                      Wait for the E-Net cable to be connected before starting the DHCP server.
01/26/2017 MQ 0.22    Set ipv4 to enabled when the button is pushed.
01/19/2017 MQ 0.21    Functioning dnp3, fixed a bug in the default IP setup,
                      changed default net-mask to 255.255.0.0.
01/04/2017 MQ 0.20    Fixed split virtual string current update bug, fixed RIM slope Web page bug.
12/29/2016 MQ 0.19    Fixed logging headers and other misc issues.
12/08/2016 MQ 0.18    CellMetrix is ready to testing. Battery Sensor calibration is working.
12/02/2016 MQ 0.17    Fixed the CellMetrix Thermal Runaway Alarm enable not saved to database bug.
10/25/2016 MQ 0.16    Just before the comcast HVAC Demo
08/11/2016 MQ 0.15    Rearranged the jar table to facilitate making the admitance measurement
                      persistant across resets.
07/28/2016 MQ 0.14    Modified EntityStatus Database to fix the RIM faulting alarm that
                      occurs the main process is restarted.
06/27/2016 MQ 0.13    Includes CellMetrix.  Not throughly tested.
05/11/2016 MQ 0.12    New UDP messaging is working, Tested all alarma on REM devices.
                      Last rev before adding CellMetrix.
05/03/2016 MQ 0.11    Fixed a bunch of problems in logging for split virtual strings.
                      Modified logging so it no longer needs the index in the records
                      to find the header.
03/29/2016 MQ 0.10    Build with new version of the OS 7.10.0.0A15
03/18/2015 MQ 0.08    Added New string fields for Telus requiring modification
                      of the String table, VirtualString table and Web page java code.
02/02/2016 MQ 0.07    Rebuild with new version of Linux, Net-SNMP etc.
02/02/2016 MQ 0.06    Added version display to debug.
01/26/2016 MQ 0.05    Fixed the logging bugs pointed out by C&C.
                      Web server is using http: on port 8080
10/15/2015 MQ 0.04    Plain email authentication is working.
07/24/2015 MQ 0.02    First field test version.
09/26/2014 MQ 0.01    New file.
*/



