修复温度不能获取负值
Change-Id: I5f1ee70905f9c5ae33e10e2a9faeede0a349449e
diff --git a/mbtk/mbtk_rild/src/mbtk_info_server.c b/mbtk/mbtk_rild/src/mbtk_info_server.c
index 78938dc..4379fc0 100755
--- a/mbtk/mbtk_rild/src/mbtk_info_server.c
+++ b/mbtk/mbtk_rild/src/mbtk_info_server.c
@@ -1329,7 +1329,7 @@
OK
*/
-static int req_temp_get(int type, int *temp, int *cme_err)
+static int req_temp_get(int type, mbtk_thermal_info_t *temp, int *cme_err)
{
ATResponse *response = NULL;
int err = -1;
@@ -1363,9 +1363,11 @@
{
goto exit;
}
- *temp = tmp_int;
+ temp->ther = tmp_int;
} else {
- *temp = tmp_int / 1000;
+ tmp_int = tmp_int / 1000;
+ temp->ther = tmp_int;
+ //LOG(" >>>temp =%d",temp->ther);
}
exit:
@@ -4351,7 +4353,8 @@
case MBTK_INFO_ID_DEV_TEMP_REQ: // <string> Temperature
{
if(pack->data_len == sizeof(uint8) && pack->data) {
- int temp;
+ mbtk_thermal_info_t temp;
+ memset(&temp, 0, sizeof(mbtk_thermal_info_t));
if(req_temp_get(*(pack->data), &temp, &cme_err) || cme_err != MBTK_INFO_ERR_CME_NON)
{
if(cme_err != MBTK_INFO_ERR_CME_NON) {
@@ -4363,7 +4366,7 @@
}
else
{
- pack_rsp_send(cli_info->fd, MBTK_INFO_ID_DEV_TEMP_RSP, &temp, sizeof(uint8));
+ pack_rsp_send(cli_info->fd, MBTK_INFO_ID_DEV_TEMP_RSP, &temp, sizeof(mbtk_thermal_info_t));
}
} else {
err = MBTK_INFO_ERR_FORMAT;