thermal plugin: Updated the submit function to the new infrastructure.
authorFlorian Forster <octo@huhu.verplant.org>
Thu, 12 Jun 2008 08:23:49 +0000 (10:23 +0200)
committerFlorian Forster <octo@huhu.verplant.org>
Thu, 12 Jun 2008 08:23:49 +0000 (10:23 +0200)
src/thermal.c

index a6ebe4e..f7f2a59 100644 (file)
@@ -42,18 +42,23 @@ enum dev_type {
        COOLING_DEV
 };
 
-static void thermal_submit (const char *plugin_instance, enum dev_type dt, double value)
+static void thermal_submit (const char *plugin_instance, enum dev_type dt,
+               gauge_t value)
 {
-       value_list_t vl = dt == TEMP ? vl_temp_template : vl_state_template;
+       value_list_t vl = (dt == TEMP) ? vl_temp_template : vl_state_template;
        value_t vt;
 
        vt.gauge = value;
 
        vl.values = &vt;
        vl.time = time (NULL);
-       sstrncpy (vl.plugin_instance, plugin_instance, sizeof(vl.plugin_instance));
+       sstrncpy (vl.plugin, "thermal", sizeof(vl.plugin));
+       sstrncpy (vl.plugin_instance, plugin_instance,
+                       sizeof(vl.plugin_instance));
+       sstrncpy (vl.type, (dt == TEMP) ? "temperature" : "gauge",
+                       sizeof (vl.type));
 
-       plugin_dispatch_values (dt == TEMP ? "temperature" : "gauge", &vl);
+       plugin_dispatch_values (&vl);
 }
 
 static int read_file_contents (const char *filename, char *buf, int bufsize)