Fix IMS set error
Change-Id: I0085e8bc553092c821bea9e46aabd1a9bd484366
diff --git a/mbtk/libmbtk_ril/mbtk_info.h b/mbtk/libmbtk_ril/mbtk_info.h
index 9d90690..573ba84 100755
--- a/mbtk/libmbtk_ril/mbtk_info.h
+++ b/mbtk/libmbtk_ril/mbtk_info.h
@@ -151,6 +151,9 @@
MBTK_INFO_ID_NET_IMS_REQ,
MBTK_INFO_ID_NET_IMS_RSP,
+ MBTK_INFO_ID_NET_IMS_REG_STATE_REQ,
+ MBTK_INFO_ID_NET_IMS_REG_STATE_RSP,
+
MBTK_INFO_ID_NET_END,
diff --git a/mbtk/libmbtk_ril/mbtk_info_api.c b/mbtk/libmbtk_ril/mbtk_info_api.c
old mode 100644
new mode 100755
index ce9cc9c..608f9b0
--- a/mbtk/libmbtk_ril/mbtk_info_api.c
+++ b/mbtk/libmbtk_ril/mbtk_info_api.c
@@ -1590,9 +1590,9 @@
}
/*
-* Get current network IMS information.
+* Get current IMS enable or not.
*/
-int mbtk_net_ims_get(mbtk_info_handle_t* handle, int* reg)
+int mbtk_net_ims_get(mbtk_info_handle_t* handle, int* enable)
{
uint8 state;
if(handle == NULL)
@@ -1601,8 +1601,8 @@
return -1;
}
if(info_item_process(handle, MBTK_INFO_ID_NET_IMS_REQ, NULL, 0, &state) > 0) {
- LOG("reg type : %d", state);
- *reg = state;
+ LOG("IMS enable : %d", state);
+ *enable = state;
return 0;
} else {
return handle->info_err;
@@ -1611,9 +1611,9 @@
}
/*
-* Set current network IMS information.
+* Set IMS enable or not. This function takes effect after starting the device.
*/
-int mbtk_net_ims_set(mbtk_info_handle_t* handle, int reg)
+int mbtk_net_ims_set(mbtk_info_handle_t* handle, int enable)
{
if(handle == NULL)
{
@@ -1621,10 +1621,30 @@
return -1;
}
- return info_item_process(handle, MBTK_INFO_ID_NET_IMS_REQ, (uint8*)®, sizeof(uint8), NULL) ? handle->info_err : 0;
+ return info_item_process(handle, MBTK_INFO_ID_NET_IMS_REQ, (uint8*)&enable, sizeof(uint8), NULL) ? handle->info_err : 0;
}
+/*
+* Get current network IMS register state.
+*/
+int mbtk_net_ims_reg_state_get(mbtk_info_handle_t* handle, int* reg)
+{
+ uint8 state;
+ if(handle == NULL)
+ {
+ LOGE("ARG error.");
+ return -1;
+ }
+ if(info_item_process(handle, MBTK_INFO_ID_NET_IMS_REG_STATE_REQ, NULL, 0, &state) > 0) {
+ LOG("reg type : %d", state);
+ *reg = state;
+ return 0;
+ } else {
+ return handle->info_err;
+ }
+}
+
/*
* Get radio state.