blob: 2d07d8008bcbfb4c0392945badd57ce4e5c8f361 [file] [log] [blame]
liubin281ac462023-07-19 14:22:54 +08001/**
2 * \file dtmf_test.c
3 * \brief A Documented file.
4 *
5 * Detailed description
6 * \Author: jinLuo
7 * \Version: 1.0.0
8 * \Date: 2022-12-1
9 */
10
11/******************************************************************************\
12 * Include files
13\******************************************************************************/
14#include <pthread.h>
15#include <time.h>
16#include <sys/ioctl.h>
17#include <fcntl.h>
18#include <unistd.h>
19#include <sys/types.h>
20#include <sys/stat.h>
21#include <fcntl.h>
22#include <string.h>
23#include <stdio.h>
24#include <signal.h>
25#include <unistd.h>
26#include <fcntl.h>
27#include <errno.h>
28#include <string.h>
29#include <stdlib.h>
30#include <poll.h>
31#include <stdlib.h>
32
33#include <sys/ioctl.h>
34#include <sys/types.h>
35#include <sys/stat.h>
36#include "ql/ql_sms.h"
37
38
39int main(int argc, char *argv[])
40{
41 char operator[10];
42 char serNum[50] = {0};
43 char phonenumter[20] ={0};
44 int opt;
45 int ret, uToken;
46
47 while(1)
48 {
49 printf("=========audio main=========\n"
50 "\t0 exit\n"
51 "\t1 sms init\n"
52 "\t2 send sms\n"
53 "\t3 wait receive new sms\n"
54 "\t4 delete sms(int index);\n"
55 "\t5 list sms\n"
56 "\t6 query sms storage status\n"
57 "\t7 query service number\n"
58 "\t8 set service number\n"
59 "\t9 deinit sms\n"
60 "operator: >> ");
61 fgets(operator, sizeof(operator), stdin);
62 fflush(stdin);
63 opt = atoi(operator);
64 switch (opt)
65 {
66 case 0:
67 printf("main exit\n");
68 return 0;
69 case 1:
70 ql_sms_init();
71 break;
72 case 2:
73 ql_sms_send_text_msg("+8615775690697", "hello world", 1);
74 break;
75 case 3:
76 ql_sms_add_event_handler(NULL, NULL);
77 break;
78 case 4:
79 ql_sms_send_pdu_msg("+8615775690697","你好",1);
80 break;
81 // printf("please input volume (0~100): \n");
82 // fgets(operator, sizeof(operator), stdin);
83 // fflush(stdin);
84 // opt = atoi(operator);
85 // lynq_delete_sms(opt);
86 break;
87 case 5:
88 printf("please input index (0~50): \n");
89 fgets(operator, sizeof(operator), stdin);
90 fflush(stdin);
91 opt = atoi(operator);
92 // lynq_list_sms(1, opt, "ALL" );
93 break;
94 case 6:
95 // lynq_query_sms_storage_status();
96 break;
97 case 7:
98 ret = ql_sms_get_sms_center_address(serNum);
99 if(!ret)
100 printf("get_smsc:%s\n", serNum);
101 break;
102 case 8:
103 // printf("please input service num: \n");
104 // fgets(phonenumter, sizeof(phonenumter), stdin);
105 // fflush(stdin);
106 // memcpy(phonenumter, "+8613800280500", "+8613800280500");
107
108 // ret= ql_sms_set_sms_center_address(phonenumter);
109 ret= ql_sms_set_sms_center_address("+8613800280500");
110 break;
111 case 9:
112 ql_sms_release();
113 break;
114 default:
115 break;
116 }
117 }
118
119 return 0;
120}