Add ims test
Change-Id: I27337d36052888bc5a982f9c27571de87ca2bcc7
diff --git a/mbtk/test/libmbtk_ril/mbtk_info_test.c b/mbtk/test/libmbtk_ril/mbtk_info_test.c
index 143ff1e..2ee0f58 100755
--- a/mbtk/test/libmbtk_ril/mbtk_info_test.c
+++ b/mbtk/test/libmbtk_ril/mbtk_info_test.c
@@ -199,6 +199,9 @@
printf("mute 0: Close mute.\n");
printf("mute 1: Open mute.\n");
printf("dtmf : Set dtmf character[0, 1, 2, ..., A, B, C, D, *, #], duration [300-600].\n Such as: dtmf 0 300\n");
+ printf("ims_en 0/1 : Close/Open IMS(Restart takes effect).\n");
+ printf("ims_state : Get IMS open or not?\n");
+ printf("ims_reg: Get IMS register state.\n");
}
static void sig_process(int sig)
@@ -1267,6 +1270,37 @@
}
}
}
+ else if(!strncasecmp(cmd, "ims_en", 6)){ // ims_en 0/1
+ char enable[10] = {0};
+ if(1 == sscanf(cmd, "ims_en %s", enable)) {
+ err = mbtk_net_ims_set(info_handle, atoi(enable) ? 1 : 0);
+ if(err) {
+ printf("Set IMS fail : %d\n", err);
+ } else {
+ printf("Set IMS success\n");
+ }
+ } else {
+ printf("ARG error\n");
+ }
+ }
+ else if(!strncasecmp(cmd, "ims_state", 9)){ // ims_state
+ int enable = 0;
+ err = mbtk_net_ims_get(info_handle, &enable);
+ if(err) {
+ printf("Get IMS state fail : %d\n", err);
+ } else {
+ printf("IMS state : %d\n", enable);
+ }
+ }
+ else if(!strncasecmp(cmd, "ims_reg", 7)){ // ims_reg
+ int reg = 0;
+ err = mbtk_net_ims_reg_state_get(info_handle, ®);
+ if(err) {
+ printf("Get IMS register state fail : %d\n", err);
+ } else {
+ printf("IMS register state : %d\n", reg);
+ }
+ }
else if(!strcasecmp(cmd, "h") || !strcasecmp(cmd, "help")) {
help();
} else if(!strcasecmp(cmd, "q")) {