[T106][ZXW-22]7520V3SCV2.01.01.02P42U09_VEC_V0.8_AP_VEC origin source commit
Change-Id: Ic6e05d89ecd62fc34f82b23dcf306c93764aec4b
diff --git a/ap/app/zte_mdl/zte_mdl.c b/ap/app/zte_mdl/zte_mdl.c
new file mode 100755
index 0000000..cc43ce2
--- /dev/null
+++ b/ap/app/zte_mdl/zte_mdl.c
@@ -0,0 +1,145 @@
+#define _GNU_SOURCE /**/
+
+#include <string.h>
+#include <stdio.h>
+#include <stdarg.h>
+#include <stdlib.h>
+#include <time.h>
+#include <syslog.h>
+#include <unistd.h>
+#include <errno.h>
+#include <signal.h>
+#include <netdb.h>
+#include <sys/types.h>
+#include <sys/ioctl.h>
+#include <sys/socket.h>
+#include <sys/time.h>
+#include <sys/uio.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <sys/sysctl.h>
+#include <net/if.h>
+#include <poll.h>
+#include <stddef.h>
+#include <linux/if_packet.h>
+#include <netinet/ether.h>
+#include <netinet/if_ether.h>
+#include <arpa/inet.h>
+#include <pthread.h>
+#include <zte_mdl.h>
+
+void nvserver_entry(void)
+{
+ nvserver_main(0,NULL);
+ return;
+}
+
+void at_ctl_entry(char *arg)
+{
+ //printf("at_ctl_entry boot:%s\n", arg);
+ char *argv[2];
+ argv[0] = NULL;
+ argv[1] = arg;
+
+ at_ctl_main(2, argv);
+ return;
+}
+
+void rtc_service_entry(char *arg)
+{
+ rtc_service_main(0,NULL);
+ return;
+}
+
+void zte_mainctrl_entry(char *arg)
+{
+ zte_mainctrl_main(0,NULL);
+ return;
+}
+
+void zte_hotplug_entry(char *arg)
+{
+ zte_hotplug_main(0,NULL);
+ return;
+}
+
+void zte_audio_res_ctrl_entry(char *arg)
+{
+ zte_audio_res_ctrl_main(0,NULL);
+ return;
+}
+
+void zte_drv_serial_ctrl_entry(char *arg)
+{
+ zte_drv_serial_ctrl_main();
+ return;
+}
+
+void zte_drv_usb_ctrl_entry(char *arg)
+{
+ zte_drv_usb_ctrl_main(0,NULL);
+ return;
+}
+
+void sntp_entry(char *arg)
+{
+ sntp_main(0,NULL);
+ return;
+}
+void fota_dm_entry(char *arg)
+{
+ fota_dm_main(0,NULL);
+ //return; //kw 3
+}
+
+int main(int argc, char *argv[])
+{
+ /* nvserver */
+ pthread_t nvserver_thread_tid;
+ pthread_create(&nvserver_thread_tid, NULL, (void *)nvserver_entry, NULL);
+
+ /* zte_drv_serial_ctrl */
+ pthread_t zte_drv_serial_ctrl_thread_tid;
+ pthread_create(&zte_drv_serial_ctrl_thread_tid, NULL, (void *)zte_drv_serial_ctrl_entry, NULL);
+ /* zte_drv_usb_ctrl */
+ pthread_t zte_drv_usb_ctrl_thread_tid;
+ pthread_create(&zte_drv_usb_ctrl_thread_tid, NULL, (void *)zte_drv_usb_ctrl_entry, NULL);
+
+ if (0 != strcmp(argv[2], "amt")) { //³äµç»òÕý³£¿ª»úģʽ
+ /* zte_hotplug */
+ pthread_t zte_hotplug_thread_tid;
+ pthread_create(&zte_hotplug_thread_tid, NULL, (void *)zte_hotplug_entry, NULL);
+
+#if(PRODUCT_TYPE != PRODUCT_TH)
+ /* at_ctl */
+ pthread_t at_ctl_thread_tid;
+ pthread_create(&at_ctl_thread_tid, NULL, (void *)at_ctl_entry, argv[1]);
+ /* rtc_service */
+ pthread_t rtc_service_thread_tid;
+ pthread_create(&rtc_service_thread_tid, NULL, (void *)rtc_service_entry, NULL);
+ /* zte_mainctrl */
+ pthread_t zte_mainctrl_thread_tid;
+ pthread_create(&zte_mainctrl_thread_tid, NULL, (void *)zte_mainctrl_entry, NULL);
+#endif
+
+ /* zte_audio_res_ctrl */
+ pthread_t zte_audio_res_ctrl_thread_tid;
+ pthread_create(&zte_audio_res_ctrl_thread_tid, NULL, (void *)zte_audio_res_ctrl_entry, NULL);
+
+ /* sntp */
+ //pthread_t sntp_thread_tid;
+ //pthread_create(&sntp_thread_tid, NULL, (void *)sntp_entry, NULL);
+ /* zte_fota */
+ pthread_t fota_dm_thread_tid;
+ pthread_create(&fota_dm_thread_tid, NULL, (void *)fota_dm_entry, NULL);
+
+ }
+ while(1)
+ {
+ sleep(20);
+ //printf("zte app test -1 \n");
+ }
+
+ return 0;
+}
+