return get_max_value(sensors, SENSOR_TYPE_TEMP);
}
-struct psensor **get_all_sensors(int use_libatasmart, int values_max_length)
-{
- struct psensor **psensors;
-
- psensors = NULL;
-
- if (!use_libatasmart)
- hddtemp_psensor_list_append(&psensors, values_max_length);
-
-#ifdef HAVE_ATASMART
- else
- atasmart_psensor_list_append(&psensors, values_max_length);
-#endif
-
- if (!psensors) { /* there is no detected sensors */
- psensors = malloc(sizeof(struct psensor *));
- *psensors = NULL;
- }
-
- return psensors;
-}
-
const char *psensor_type_to_str(unsigned int type)
{
if (type & SENSOR_TYPE_NVCTRL) {
#include "config.h"
#include "cfg.h"
+#include <hdd.h>
#include "psensor.h"
#include "graph.h"
#include "ui.h"
#ifdef HAVE_GTOP
gtop2_psensor_list_update(sensors);
#endif
+#ifdef HAVE_ATASMART
+ atasmart_psensor_list_update(sensors);
+#endif
+
+ hddtemp_psensor_list_update(sensors);
psensor_log_measures(sensors);
* Creates the list of sensors.
*
* 'url': remote psensor server url, null for local monitoring.
- * 'use_libatasmart': whether the libatasmart must be used.
*/
-static struct psensor **create_sensors_list(const char *url,
- unsigned int use_libatasmart)
+static struct psensor **create_sensors_list(const char *url)
{
struct psensor **sensors;
exit(EXIT_FAILURE);
#endif
} else {
- sensors = get_all_sensors(use_libatasmart, 600);
+ sensors = malloc(sizeof(struct psensor *));
+ *sensors = NULL;
if (config_is_lmsensor_enabled())
lmsensor_psensor_list_append(&sensors, 600);
+ if (config_is_hddtemp_enabled())
+ hddtemp_psensor_list_append(&sensors, 600);
+
+#ifdef HAVE_ATASMART
+ if (config_is_libatasmart_enabled())
+ atasmart_psensor_list_append(&sensors, 600);
+#endif
+
#ifdef HAVE_NVIDIA
if (config_is_nvctrl_enabled())
nvidia_psensor_list_append(&sensors, 600);
{
struct ui_psensor ui;
pthread_t thread;
- int optc, cmdok, opti, use_libatasmart, new_instance, ret;
+ int optc, cmdok, opti, new_instance, ret;
char *url = NULL;
GApplication *app;
textdomain(PACKAGE);
#endif
- use_libatasmart = new_instance = 0;
+ new_instance = 0;
cmdok = 1;
while ((optc = getopt_long(argc, argv, "vhd:u:n", long_options,
&opti)) != -1) {
switch (optc) {
- case 0:
- if (!strcmp(long_options[opti].name, "use-libatasmart"))
- use_libatasmart = 1;
- break;
case 'u':
if (optarg)
url = strdup(optarg);
psensor_init();
- ui.sensors = create_sensors_list(url, use_libatasmart);
+ ui.sensors = create_sensors_list(url);
associate_cb_alarm_raised(ui.sensors, &ui);
if (ui.config->slog_enabled)