T108 sim Voie data network sms 支持双卡 ql 接口第一版
Change-Id: If5a9fb81971258bb5a3d811f3e4562b2df351853
diff --git a/mbtk/test/libql_lib_v2/ql_sms_test.c b/mbtk/test/libql_lib_v2/ql_sms_test.c
index 1ebdde2..e4ecaf9 100755
--- a/mbtk/test/libql_lib_v2/ql_sms_test.c
+++ b/mbtk/test/libql_lib_v2/ql_sms_test.c
@@ -30,7 +30,7 @@
int main(int argc, char *argv[])
{
- char operator[10];
+ //char operator[10];
int opt;
int ret;
// int sms;
@@ -47,15 +47,12 @@
"\t3 sms set msg recv cb\n"
"\t4 sms set ser error cb\n"
"\t5 sms send msg async\n"
+ "\t6 sms set slot to send msg\n"
"operator: >> \n");
while(1)
{
- memset(operator, 0, sizeof(operator));
- if(NULL == fgets(operator, sizeof(operator), stdin))
- break;
- fflush(stdin);
- opt = atoi(operator);
+ scanf("%d",&opt);
switch (opt)
{
case 0:
@@ -149,7 +146,60 @@
}
}
break;
-
+ case 6:
+ {
+ 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;