优化demo代码和api接口
Change-Id: I094570a31d63204aaa5da809751e27acd60f60d8
diff --git a/mbtk/test/liblynq_lib/lynq_call_test.c b/mbtk/test/liblynq_lib/lynq_call_test.c
index c68d92e..670eb10 100755
--- a/mbtk/test/liblynq_lib/lynq_call_test.c
+++ b/mbtk/test/liblynq_lib/lynq_call_test.c
@@ -300,22 +300,23 @@
voice_client_handle_type handle = -1;
int voice_call_id = 0;
mbtk_log_init("radio", "CALL_TEST");
-
+
+ printf("=========call main=========\n"
+ "\t0 exit\n"
+ "\t1 call init\n"
+ "\t2 call add register handle\n"
+ "\t3 call start\n"
+ "\t4 call end\n"
+ "\t5 call answer\n"
+ "\t6 call remove register handle\n"
+ "\t7 call set volume level 0-5\n"
+ "\t8 call get volume\n"
+ "\t9 call dtmf\n"
+ "\t10 call deinit\n"
+ "operator: >> \n");
+
while(1)
{
- printf("=========call main=========\n"
- "\t0 exit\n"
- "\t1 call init\n"
- "\t2 call add register handle\n"
- "\t3 call start\n"
- "\t4 call end\n"
- "\t5 call answer\n"
- "\t6 call remove register handle\n"
- "\t7 call set volume level 0-5\n"
- "\t8 call get volume\n"
- "\t9 call deinit\n"
- "operator: >> \n");
-
fgets(operator, sizeof(operator), stdin);
fflush(stdin);
opt = atoi(operator);
@@ -362,6 +363,20 @@
printf("volume level = %d\n",lv_voll);
break;
case 9:
+ {
+ char inputChar;
+
+ printf("Enter set dtmf\n");
+ scanf(" %c", &inputChar);
+ printf("inputChar is %c\n", inputChar);
+
+ if (qser_voice_set_dtmf(inputChar) != 0)
+ {
+ printf("qser set voice dtmf failed\n");
+ }
+ }
+ break;
+ case 10:
qser_voice_call_client_deinit(handle);
break;
default:
diff --git a/mbtk/test/liblynq_lib/lynq_nw_test.c b/mbtk/test/liblynq_lib/lynq_nw_test.c
index 82cd6d8..32ffc94 100755
--- a/mbtk/test/liblynq_lib/lynq_nw_test.c
+++ b/mbtk/test/liblynq_lib/lynq_nw_test.c
@@ -47,26 +47,31 @@
char operator[10];
int opt;
int lv_voll = 0;
+ int ret;
nw_client_handle_type handle = -1;
mbtk_log_init("radio", "NW_TEST");
+ printf("=========network main=========\n"
+ "\t0 exit\n"
+ "\t1 network init\n"
+ "\t2 network add rx msg handle\n"
+ "\t3 network band set config\n"
+ "\t4 network get operator name\n"
+ "\t5 network get reg status\n"
+ "\t6 network get signal strength\n"
+ "\t7 network set oos config\n"
+ "\t8 network get oos config\n"
+ "\t9 network set rf config\n"
+ "\t10 network get rf config\n"
+ "\t11 network set ims config\n"
+ "\t12 network get ims config\n"
+ "\t13 network deinit\n"
+ "operator: >> ");
+
while(1)
{
- printf("=========network main=========\n"
- "\t0 exit\n"
- "\t1 network init\n"
- "\t2 network add rx msg handle\n"
- "\t3 network band set config\n"
- "\t4 network get operator name\n"
- "\t5 network get reg status\n"
- "\t6 network get signal strength\n"
- "\t7 network set oos config\n"
- "\t8 network get oos config\n"
- "\t9 network set rf config\n"
- "\t10 network get rf config\n"
- "\t11 network deinit\n"
- "operator: >> ");
+ opt = -1;
fgets(operator, sizeof(operator), stdin);
fflush(stdin);
opt = atoi(operator);
@@ -76,10 +81,12 @@
printf("main exit\n");
return 0;
case 1:
- qser_nw_client_init(&handle);
+ ret = qser_nw_client_init(&handle);
+ printf("qser_nw_client_init ret = %d\n", ret);
break;
case 2:
- qser_nw_add_rx_msg_handler(handle, nw_event_ind_handler, NULL);
+ ret = qser_nw_add_rx_msg_handler(handle, nw_event_ind_handler, NULL);
+ printf("qser_nw_add_rx_msg_handler ret = %d\n", ret);
break;
case 3:
{
@@ -121,7 +128,8 @@
t_info.preferred_nw_mode = QSER_NW_MODE_LTE;//4G
break;
}
- qser_nw_set_config(handle, &t_info);
+ ret = qser_nw_set_config(handle, &t_info);
+ printf("qser_nw_set_config ret = %d\n", ret);
}
break;
case 4:
@@ -220,7 +228,8 @@
}
printf("set OOS %d %d %d \n",pt_info_s.u.full_band_scan_info.t_min, pt_info_s.u.full_band_scan_info.t_step, pt_info_s.u.full_band_scan_info.t_max);
//pt_info_s.type = QSER_NW_OOS_CFG_TYPE_FAST_SCAN;平台本身有历史频点优先处理的逻辑(无接口不需要我们进行处理)
- qser_nw_set_oos_config(handle, &pt_info_s);
+ ret = qser_nw_set_oos_config(handle, &pt_info_s);
+ printf("qser_nw_set_oos_config ret = %d\n", ret);
}
break;
case 8:
@@ -241,7 +250,8 @@
fflush(stdin);
opt = atoi(operator);
printf("rf_mode: [%d]\n",opt);
- qser_nw_set_rf_mode(handle, opt);
+ ret = qser_nw_set_rf_mode(handle, opt);
+ printf("qser_nw_set_rf_mode ret = %d\n", ret);
}
break;
case 10:
@@ -252,6 +262,27 @@
}
break;
case 11:
+ {
+ E_QSER_NW_IMS_MODE_TYPE_T ims_mode;
+ printf("please input you want set ims mode (0: off; 1: volte enable \n");
+ scanf("%d", &ims_mode);
+ ret = qser_nw_set_ims_enable(handle, ims_mode);
+ printf("qser_nw_set_ims_enable %d ret = %d\n",ims_mode, ret);
+ }
+ break;
+ case 12:
+ {
+ QSER_NW_IMS_REG_STATUS_INFO_T t_info;
+ memset(&t_info, 0, sizeof(QSER_NW_IMS_REG_STATUS_INFO_T));
+ ret = qser_nw_get_ims_reg_status(handle, &t_info);
+ printf("qser_nw_get_ims_reg_status ret = %d, detail info:\n", ret);
+ if(ret == 0)
+ {
+ printf("ims_registration: registration_state=%d\n", t_info.registration_state);
+ }
+ }
+ break;
+ case 13:
qser_nw_client_deinit(handle);
break;
default:
diff --git a/mbtk/test/liblynq_lib/lynq_qser_sms_test.c b/mbtk/test/liblynq_lib/lynq_qser_sms_test.c
index 9128cf0..a2d1795 100755
--- a/mbtk/test/liblynq_lib/lynq_qser_sms_test.c
+++ b/mbtk/test/liblynq_lib/lynq_qser_sms_test.c
@@ -274,20 +274,21 @@
QSER_sms_storage_info_t test_sms_storage;
mbtk_log_init("radio", "SMS_TEST");
+ printf("=========sms main=========\n"
+ "\t0 exit\n"
+ "\t1 sms init\n"
+ "\t2 send text sms\n"
+ "\t3 wait receive new sms\n"
+ "\t4 send PDU sms\n"
+ "\t5 //delete sms list\n"
+ "\t6 delete sms\n"
+ "\t7 query service number\n"
+ "\t8 set service number\n"
+ "\t9 deinit sms\n"
+ "operator: >> \n");
+
while(1)
{
- printf("=========sms main=========\n"
- "\t0 exit\n"
- "\t1 sms init\n"
- "\t2 send text sms\n"
- "\t3 wait receive new sms\n"
- "\t4 send PDU sms\n"
- "\t5 //delete sms list\n"
- "\t6 delete sms\n"
- "\t7 query service number\n"
- "\t8 set service number\n"
- "\t9 deinit sms\n"
- "operator: >> \n");
fgets(operator, sizeof(operator), stdin);
fflush(stdin);
opt = atoi(operator);
diff --git a/mbtk/test/liblynq_lib/lynq_sleep_test.c b/mbtk/test/liblynq_lib/lynq_sleep_test.c
index 34b7412..4bfbf40 100755
--- a/mbtk/test/liblynq_lib/lynq_sleep_test.c
+++ b/mbtk/test/liblynq_lib/lynq_sleep_test.c
@@ -45,20 +45,21 @@
int fd_t;
mbtk_log_init("radio", "SLEEP_TEST");
+ printf("=========sleep main=========\n"
+ "\t0 exit\n"
+ "\t1 autosuspend enable\n"
+ "\t2 wakelock create\n"
+ "\t3 wakelock lock\n"
+ "\t4 wakelock unlock\n"
+ "\t5 wakelock destroy\n"
+ "\t6 whitelist set\n"
+ "\t7 whitelist get\n"
+ "\t8 lpm init\n"
+ "\t9 lpm destroy\n"
+ "operator: >> \n");
+
while(1)
{
- printf("=========sleep main=========\n"
- "\t0 exit\n"
- "\t1 autosuspend enable\n"
- "\t2 wakelock create\n"
- "\t3 wakelock lock\n"
- "\t4 wakelock unlock\n"
- "\t5 wakelock destroy\n"
- "\t6 whitelist set\n"
- "\t7 whitelist get\n"
- "\t8 lpm init\n"
- "\t9 lpm destroy\n"
- "operator: >> \n");
fgets(operator, sizeof(operator), stdin);
fflush(stdin);