diff options
-rwxr-xr-x[-rw-r--r--] | hw/thermal.h | 19 | ||||
-rwxr-xr-x | unittest/device_haltests.cpp | 8 |
2 files changed, 7 insertions, 20 deletions
diff --git a/hw/thermal.h b/hw/thermal.h index 8262a38..08dd056 100644..100755 --- a/hw/thermal.h +++ b/hw/thermal.h @@ -32,22 +32,9 @@ */ #define THERMAL_HARDWARE_DEVICE_VERSION MAKE_VERSION(0,1) -typedef enum _thermal_state { - THERMAL_STATE_LOW, - THERMAL_STATE_NORMAL, - THERMAL_STATE_HIGH, -} thermal_state_e; - -typedef enum _thermal_level { - THERMAL_LEVEL_NORMAL = 1001, - THERMAL_LEVEL_WARNING, - THERMAL_LEVEL_CRITICAL, - THERMAL_LEVEL_POWEROFF, -} thermal_level_e; - struct thermal_info { - thermal_state_e state; - thermal_level_e level; + int temp; + int adc; }; typedef void (*ThermalUpdated)(struct thermal_info *info, void *data); @@ -56,7 +43,7 @@ struct thermal_device { struct hw_common common; /* Get thermal state */ - int (*get_state)(struct thermal_info *info); + int (*get_info)(struct thermal_info *info); /* Register thermal event */ int (*register_changed_event)(ThermalUpdated updated_cb, void *data); diff --git a/unittest/device_haltests.cpp b/unittest/device_haltests.cpp index 71d189f..9a7dea1 100755 --- a/unittest/device_haltests.cpp +++ b/unittest/device_haltests.cpp @@ -763,12 +763,12 @@ TEST_F(THERMALHalTest, GetStateP) struct thermal_info thermal; int ret; - if (!thermal_dev || !thermal_dev->get_state) { - cout << "There is no function for get_state" << endl; + if (!thermal_dev || !thermal_dev->get_info) { + cout << "There is no function for get_info" << endl; return; } - ret = thermal_dev->get_state(&thermal); - EXPECT_EQ(ret, 0) << "Fail to get_state (" << ret << ")"; + ret = thermal_dev->get_info(&thermal); + EXPECT_EQ(ret, 0) << "Fail to get_info (" << ret << ")"; } static void thermal_updated_cb(struct thermal_info *info, void *data) |