--- mythtv/programs/mythbackend/httpstatus.cpp.old 2007-08-23 17:09:51.000000000 +0100 +++ mythtv/programs/mythbackend/httpstatus.cpp 2007-11-27 22:03:20.000000000 +0000 @@ -4,7 +4,11 @@ // Purpose - Html & XML status HttpServerExtension // // Created By : David Blain Created On : Oct. 24, 2005 -// Modified By : Modified On: +// Modified By : Stephen Lewis Modified On: Nov. 27, 2007 +// +// Changes: +// Updated to support lm_sensors API v4. +// Retained backwards compatibility with v3 on compile. // ////////////////////////////////////////////////////////////////////////////// @@ -26,7 +30,9 @@ #ifdef HAVE_LMSENSORS #define LMSENSOR_DEFAULT_CONFIG_FILE "/etc/sensors.conf" #include +#if ( SENSORS_API_VERSION < 0x400 ) #include +#endif #endif ///////////////////////////////////////////////////////////////////////////// @@ -428,6 +434,7 @@ } #ifdef HAVE_LMSENSORS +#if ( SENSORS_API_VERSION < 0x400 ) m_settingLock.lock(); if (!found_acpi) @@ -464,7 +471,46 @@ sensors_cleanup(); } m_settingLock.unlock(); -#endif +#endif // ( SENSORS_API_VERSION < 0x400 ) + m_settingLock.lock(); + + if (!found_acpi) + { + int chip_nr, a, b; + char *label = NULL; + double value; + const sensors_chip_name *chip; + const sensors_feature *data; + const sensors_subfeature *sdata; + char* lmsensorConfigName = LMSENSOR_DEFAULT_CONFIG_FILE; + a = b = 0; + FILE *lmsensorConfigFile = fopen(lmsensorConfigName, "r"); + sensors_init(lmsensorConfigFile); + fclose(lmsensorConfigFile); + for (chip_nr = 0 ; (chip = sensors_get_detected_chips(NULL, &chip_nr)) ; ) + { + while ((data = sensors_get_features(chip, &a))) + { + if (data->type == SENSORS_FEATURE_TEMP) + { + while ((sdata = sensors_get_all_subfeatures(chip, data, &b))) + { + if (sdata->type == SENSORS_SUBFEATURE_TEMP_INPUT) + { + sensors_get_value(chip, sdata->number, &value); + QString temp = QString("%1").arg(value); + temp += " ℃"; + mInfo.appendChild(thermal); + thermal.setAttribute("temperature", temp); + } + } + } + } + } + sensors_cleanup(); + } + m_settingLock.unlock(); +#endif // Guide Data --------------------- --- mythtv/programs/mythbackend/mythxml.cpp.old 2007-08-23 17:09:51.000000000 +0100 +++ mythtv/programs/mythbackend/mythxml.cpp 2007-11-27 22:03:36.000000000 +0000 @@ -4,7 +4,11 @@ // Purpose - Html & XML status HttpServerExtension // // Created By : David Blain Created On : Oct. 24, 2005 -// Modified By : Modified On: +// Modified By : Stephen Lewis Modified On: Nov. 27, 2007 +// +// Changes: +// Updated to support lm_sensors API v4. +// Retained backwards compatibility with v3 on compile. // ////////////////////////////////////////////////////////////////////////////// @@ -25,7 +29,9 @@ #ifdef HAVE_LMSENSORS #define LMSENSOR_DEFAULT_CONFIG_FILE "/etc/sensors.conf" #include +#if ( SENSORS_API_VERSION < 0x400 ) #include +#endif #endif ///////////////////////////////////////////////////////////////////////////// --- mythtv/programs/mythbackend/mainserver.cpp.old 2007-08-28 02:22:44.000000000 +0100 +++ mythtv/programs/mythbackend/mainserver.cpp 2007-11-27 22:04:32.000000000 +0000 @@ -1,3 +1,17 @@ +////////////////////////////////////////////////////////////////////////////// +// Program Name: mainserver.cpp +// +// Purpose - Main Backend Server +// +// Created By : David Blain Created On : Oct. 24, 2005 +// Modified By : Stephen Lewis Modified On: Nov. 27, 2007 +// +// Changes: +// Updated to support lm_sensors API v4. +// Retained backwards compatibility with v3 on compile. +// +////////////////////////////////////////////////////////////////////////////// + #include #include #include @@ -44,11 +58,13 @@ #include "jobqueue.h" #include "autoexpire.h" #include "previewgenerator.h" -#ifdef HAVE_LMSENSORS - #define LMSENSOR_DEFAULT_CONFIG_FILE "/etc/sensors.conf" - #include - #include +#ifdef HAVE_LMSENSORS + #define LMSENSOR_DEFAULT_CONFIG_FILE "/etc/sensors.conf" + #include +#if ( SENSORS_API_VERSION < 0x400 ) + #include #endif +#endif /** Milliseconds to wait for an existing thread from