T108 sim Voie data network sms 支持双卡 ql 接口第一版
Change-Id: If5a9fb81971258bb5a3d811f3e4562b2df351853
diff --git a/mbtk/test/libql_lib_v2/ql_voice_test.c b/mbtk/test/libql_lib_v2/ql_voice_test.c
index 61a6cc3..132e7ea 100755
--- a/mbtk/test/libql_lib_v2/ql_voice_test.c
+++ b/mbtk/test/libql_lib_v2/ql_voice_test.c
@@ -30,7 +30,7 @@
int main(int argc, char *argv[])
{
- char operator[10];
+
int opt;
int ret;
int voice;
@@ -51,14 +51,12 @@
"\t7 voice answer\n"
"\t8 voice get records\n"
"\t9 voice send dtmf char\n"
+ "\t10 voice set sim card\n"
"operator: >> \n");
while(1)
{
- memset(operator, 0, sizeof(operator));
- fgets(operator, sizeof(operator), stdin);
- fflush(stdin);
- opt = atoi(operator);
+ scanf("%d",&opt);
switch (opt)
{
case 0:
@@ -132,7 +130,10 @@
printf(">>>>>Input ql_voice_dial<<<<<\n");
uint32_t id = 0;
- ret = ql_voice_dial("13388257090", 11, &id);
+ char phone_num[16] = {0};
+ printf("Please input dial number\n");
+ scanf("%s",phone_num);
+ ret = ql_voice_dial(phone_num,11, &id);
printf("id:%d", id);
if(ret < 0)
{
@@ -222,9 +223,60 @@
}
}
break;
-
-
-
+
+ case 10:
+ {
+ int ret = -1;
+ int choice = -1;
+ printf("1:sim card 1, 2:sim card 2\n");
+ while (1)
+ {
+ if (scanf("%d", &choice) == 1)
+ {
+ if (choice == 1 || choice == 2)
+ {
+ break;
+ }
+ else
+ {
+ printf("invlid input \n");
+ }
+ }
+ else
+ {
+
+ int c;
+ while ((c = getchar()) != '\n' && c != EOF);
+ printf("invalid input \n");
+ }
+
+ }
+ if (choice == 1)
+ {
+ ret = ql_set_sms_slot(QL_SIM_SLOT_1);
+ if(ret != 0)
+ {
+ printf("ql_set_sms_slot failed %d\n",ret);
+ }
+ else
+ {
+ printf("ql_set_sms_slot success \n");
+ }
+ }
+ else if (choice == 2)
+ {
+ ret = ql_set_sms_slot(QL_SIM_SLOT_2);
+ if(ret != 0)
+ {
+ printf("ql_set_sms_slot failed %d\n",ret);
+ }
+ else
+ {
+ printf("ql_set_sms_slot success \n");
+ }
+ }
+ break;
+ }
default:
break;
}