blob: e3d50ce0aa6e71f65036032b5135e69a8e7a1da5 [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{
jb.qi5532c6f2024-02-29 23:55:54 -080091#if (defined _USE_VEHICLE_DC_REF)&&(defined _USE_VEHICLE_DC_REF_MMC0) //jb.qi add for wifi config on 20240301
xf.li6c8fc1e2023-08-12 00:11:09 -070092 wlan_main(0,NULL);
jb.qi5532c6f2024-02-29 23:55:54 -080093#endif
xf.li6c8fc1e2023-08-12 00:11:09 -070094 return;
95}
lh9ed821d2023-04-07 01:36:19 -070096void fota_dm_entry(char *arg)
97{
98 fota_dm_main(0,NULL);
99 //return; //kw 3
100}
101
102int main(int argc, char *argv[])
103{
104 /* nvserver */
105 pthread_t nvserver_thread_tid;
106 pthread_create(&nvserver_thread_tid, NULL, (void *)nvserver_entry, NULL);
107
108 /* zte_drv_serial_ctrl */
109 pthread_t zte_drv_serial_ctrl_thread_tid;
110 pthread_create(&zte_drv_serial_ctrl_thread_tid, NULL, (void *)zte_drv_serial_ctrl_entry, NULL);
111 /* zte_drv_usb_ctrl */
112 pthread_t zte_drv_usb_ctrl_thread_tid;
113 pthread_create(&zte_drv_usb_ctrl_thread_tid, NULL, (void *)zte_drv_usb_ctrl_entry, NULL);
114
115 if (0 != strcmp(argv[2], "amt")) { //³äµç»òÕý³£¿ª»úģʽ
116 /* zte_hotplug */
117 pthread_t zte_hotplug_thread_tid;
118 pthread_create(&zte_hotplug_thread_tid, NULL, (void *)zte_hotplug_entry, NULL);
119
120#if(PRODUCT_TYPE != PRODUCT_TH)
121 /* at_ctl */
122 pthread_t at_ctl_thread_tid;
123 pthread_create(&at_ctl_thread_tid, NULL, (void *)at_ctl_entry, argv[1]);
124 /* rtc_service */
125 pthread_t rtc_service_thread_tid;
126 pthread_create(&rtc_service_thread_tid, NULL, (void *)rtc_service_entry, NULL);
127 /* zte_mainctrl */
128 pthread_t zte_mainctrl_thread_tid;
129 pthread_create(&zte_mainctrl_thread_tid, NULL, (void *)zte_mainctrl_entry, NULL);
130#endif
131
xf.li6c8fc1e2023-08-12 00:11:09 -0700132#ifdef _USE_VEHICLE_DC_REF
133 /* wifi_manager */
134 pthread_t wlan_thread_tid;
135 pthread_create(&wlan_thread_tid, NULL, (void *)wlan_entry, NULL);
136#endif
137
lh9ed821d2023-04-07 01:36:19 -0700138 /* zte_audio_res_ctrl */
139 pthread_t zte_audio_res_ctrl_thread_tid;
140 pthread_create(&zte_audio_res_ctrl_thread_tid, NULL, (void *)zte_audio_res_ctrl_entry, NULL);
141
142 /* sntp */
143 //pthread_t sntp_thread_tid;
144 //pthread_create(&sntp_thread_tid, NULL, (void *)sntp_entry, NULL);
145 /* zte_fota */
146 pthread_t fota_dm_thread_tid;
147 pthread_create(&fota_dm_thread_tid, NULL, (void *)fota_dm_entry, NULL);
148
149 }
150 while(1)
151 {
152 sleep(20);
xf.libdd93d52023-05-12 07:10:14 -0700153 //printf("app test -1 \n");
lh9ed821d2023-04-07 01:36:19 -0700154 }
155
156 return 0;
157}
158