blob: 1142fb057610e2841233380db29db9b90ce1b16c [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}
xf.li6c8fc1e2023-08-12 00:11:09 -070089void wlan_entry(char *arg)
90{
91 wlan_main(0,NULL);
92 return;
93}
lh9ed821d2023-04-07 01:36:19 -070094void fota_dm_entry(char *arg)
95{
96 fota_dm_main(0,NULL);
97 //return; //kw 3
98}
99
100int main(int argc, char *argv[])
101{
102 /* nvserver */
103 pthread_t nvserver_thread_tid;
104 pthread_create(&nvserver_thread_tid, NULL, (void *)nvserver_entry, NULL);
105
106 /* zte_drv_serial_ctrl */
107 pthread_t zte_drv_serial_ctrl_thread_tid;
108 pthread_create(&zte_drv_serial_ctrl_thread_tid, NULL, (void *)zte_drv_serial_ctrl_entry, NULL);
109 /* zte_drv_usb_ctrl */
110 pthread_t zte_drv_usb_ctrl_thread_tid;
111 pthread_create(&zte_drv_usb_ctrl_thread_tid, NULL, (void *)zte_drv_usb_ctrl_entry, NULL);
112
113 if (0 != strcmp(argv[2], "amt")) { //³äµç»òÕý³£¿ª»úģʽ
114 /* zte_hotplug */
115 pthread_t zte_hotplug_thread_tid;
116 pthread_create(&zte_hotplug_thread_tid, NULL, (void *)zte_hotplug_entry, NULL);
117
118#if(PRODUCT_TYPE != PRODUCT_TH)
119 /* at_ctl */
120 pthread_t at_ctl_thread_tid;
121 pthread_create(&at_ctl_thread_tid, NULL, (void *)at_ctl_entry, argv[1]);
122 /* rtc_service */
123 pthread_t rtc_service_thread_tid;
124 pthread_create(&rtc_service_thread_tid, NULL, (void *)rtc_service_entry, NULL);
125 /* zte_mainctrl */
126 pthread_t zte_mainctrl_thread_tid;
127 pthread_create(&zte_mainctrl_thread_tid, NULL, (void *)zte_mainctrl_entry, NULL);
128#endif
129
xf.li6c8fc1e2023-08-12 00:11:09 -0700130#ifdef _USE_VEHICLE_DC_REF
131 /* wifi_manager */
132 pthread_t wlan_thread_tid;
133 pthread_create(&wlan_thread_tid, NULL, (void *)wlan_entry, NULL);
134#endif
135
lh9ed821d2023-04-07 01:36:19 -0700136 /* zte_audio_res_ctrl */
137 pthread_t zte_audio_res_ctrl_thread_tid;
138 pthread_create(&zte_audio_res_ctrl_thread_tid, NULL, (void *)zte_audio_res_ctrl_entry, NULL);
139
140 /* sntp */
141 //pthread_t sntp_thread_tid;
142 //pthread_create(&sntp_thread_tid, NULL, (void *)sntp_entry, NULL);
143 /* zte_fota */
144 pthread_t fota_dm_thread_tid;
145 pthread_create(&fota_dm_thread_tid, NULL, (void *)fota_dm_entry, NULL);
146
147 }
148 while(1)
149 {
150 sleep(20);
xf.libdd93d52023-05-12 07:10:14 -0700151 //printf("app test -1 \n");
lh9ed821d2023-04-07 01:36:19 -0700152 }
153
154 return 0;
155}
156