修复温度不能获取负值
Change-Id: I5f1ee70905f9c5ae33e10e2a9faeede0a349449e
diff --git a/mbtk/libmbtk_ril/mbtk_info_api.c b/mbtk/libmbtk_ril/mbtk_info_api.c
index 608f9b0..0e4043b 100755
--- a/mbtk/libmbtk_ril/mbtk_info_api.c
+++ b/mbtk/libmbtk_ril/mbtk_info_api.c
@@ -2169,23 +2169,23 @@
* temp[OUT]:
* temperature in celsius.
*/
-int mbtk_temp_get(mbtk_info_handle_t* handle, int type, int* temp)
+int mbtk_temp_get(mbtk_info_handle_t* handle, int type, mbtk_thermal_info_t* temp)
{
if(handle == NULL)
{
LOGE("ARG error.");
return -1;
}
- if(type != 0 && type != 1 || temp == NULL)
+ if(type != 0 && type != 1)
{
return -1;
}
uint8 temp_type = (uint8)type;
- uint8 temp_ptr;
- if(info_item_process(handle, MBTK_INFO_ID_DEV_TEMP_REQ, &temp_type, sizeof(uint8), &temp_ptr) > 0) {
- *temp = temp_ptr;
- LOG("Temperature : %d", *temp);
+
+ if(info_item_process(handle, MBTK_INFO_ID_DEV_TEMP_REQ, &temp_type, sizeof(uint8), temp) > 0) {
+
+ LOG("Temperature : %d", temp->ther);
return 0;
} else {
return handle->info_err;