blob: 2beb93f9e802f50f0b9340a1b6b4a5d8b24c5172 [file] [log] [blame]
lh9ed821d2023-04-07 01:36:19 -07001#define _GNU_SOURCE /**/
2
3#include <string.h>
4#include <stdio.h>
5#include <stdarg.h>
6#include <stdlib.h>
7#include <time.h>
8#include <syslog.h>
9#include <unistd.h>
10#include <errno.h>
11#include <signal.h>
12#include <netdb.h>
13#include <sys/types.h>
14#include <sys/ioctl.h>
15#include <sys/socket.h>
16#include <sys/time.h>
17#include <sys/uio.h>
18#include <sys/stat.h>
19#include <fcntl.h>
20#include <sys/sysctl.h>
21#include <net/if.h>
22#include <poll.h>
23#include <stddef.h>
24#include <linux/if_packet.h>
25#include <netinet/ether.h>
26#include <netinet/if_ether.h>
27#include <arpa/inet.h>
28#include <pthread.h>
29#include <zte_mdl.h>
30
31void nvserver_entry(void)
32{
33 nvserver_main(0,NULL);
34 return;
35}
36
37void at_ctl_entry(char *arg)
38{
39 //printf("at_ctl_entry boot:%s\n", arg);
40 char *argv[2];
41 argv[0] = NULL;
42 argv[1] = arg;
43
44 at_ctl_main(2, argv);
45 return;
46}
47
48void rtc_service_entry(char *arg)
49{
50 rtc_service_main(0,NULL);
51 return;
52}
53
54void zte_mainctrl_entry(char *arg)
55{
56 zte_mainctrl_main(0,NULL);
57 return;
58}
59
60void zte_hotplug_entry(char *arg)
61{
62 zte_hotplug_main(0,NULL);
63 return;
64}
65
66void zte_audio_res_ctrl_entry(char *arg)
67{
68 zte_audio_res_ctrl_main(0,NULL);
69 return;
70}
71
72void zte_drv_serial_ctrl_entry(char *arg)
73{
74 zte_drv_serial_ctrl_main();
75 return;
76}
77
78void zte_drv_usb_ctrl_entry(char *arg)
79{
80 zte_drv_usb_ctrl_main(0,NULL);
81 return;
82}
83
84void sntp_entry(char *arg)
85{
86 sntp_main(0,NULL);
87 return;
88}
89void fota_dm_entry(char *arg)
90{
91 fota_dm_main(0,NULL);
92 //return; //kw 3
93}
94
95int main(int argc, char *argv[])
96{
97 /* nvserver */
98 pthread_t nvserver_thread_tid;
99 pthread_create(&nvserver_thread_tid, NULL, (void *)nvserver_entry, NULL);
100
101 /* zte_drv_serial_ctrl */
102 pthread_t zte_drv_serial_ctrl_thread_tid;
103 pthread_create(&zte_drv_serial_ctrl_thread_tid, NULL, (void *)zte_drv_serial_ctrl_entry, NULL);
104 /* zte_drv_usb_ctrl */
105 pthread_t zte_drv_usb_ctrl_thread_tid;
106 pthread_create(&zte_drv_usb_ctrl_thread_tid, NULL, (void *)zte_drv_usb_ctrl_entry, NULL);
107
108 if (0 != strcmp(argv[2], "amt")) { //³äµç»òÕý³£¿ª»úģʽ
109 /* zte_hotplug */
110 pthread_t zte_hotplug_thread_tid;
111 pthread_create(&zte_hotplug_thread_tid, NULL, (void *)zte_hotplug_entry, NULL);
112
113#if(PRODUCT_TYPE != PRODUCT_TH)
114 /* at_ctl */
115 pthread_t at_ctl_thread_tid;
116 pthread_create(&at_ctl_thread_tid, NULL, (void *)at_ctl_entry, argv[1]);
117 /* rtc_service */
118 pthread_t rtc_service_thread_tid;
119 pthread_create(&rtc_service_thread_tid, NULL, (void *)rtc_service_entry, NULL);
120 /* zte_mainctrl */
121 pthread_t zte_mainctrl_thread_tid;
122 pthread_create(&zte_mainctrl_thread_tid, NULL, (void *)zte_mainctrl_entry, NULL);
123#endif
124
125 /* zte_audio_res_ctrl */
126 pthread_t zte_audio_res_ctrl_thread_tid;
127 pthread_create(&zte_audio_res_ctrl_thread_tid, NULL, (void *)zte_audio_res_ctrl_entry, NULL);
128
129 /* sntp */
130 //pthread_t sntp_thread_tid;
131 //pthread_create(&sntp_thread_tid, NULL, (void *)sntp_entry, NULL);
132 /* zte_fota */
133 pthread_t fota_dm_thread_tid;
134 pthread_create(&fota_dm_thread_tid, NULL, (void *)fota_dm_entry, NULL);
135
136 }
137 while(1)
138 {
139 sleep(20);
xf.libdd93d52023-05-12 07:10:14 -0700140 //printf("app test -1 \n");
lh9ed821d2023-04-07 01:36:19 -0700141 }
142
143 return 0;
144}
145