[T106][ZXW-22]7520V3SCV2.01.01.02P42U09_VEC_V0.8_AP_VEC origin source commit
Change-Id: Ic6e05d89ecd62fc34f82b23dcf306c93764aec4b
diff --git a/ap/app/zte_cpe/Makefile b/ap/app/zte_cpe/Makefile
new file mode 100755
index 0000000..816aaf8
--- /dev/null
+++ b/ap/app/zte_cpe/Makefile
@@ -0,0 +1,262 @@
+#*******************************************************************************
+# include ZTE application makefile
+#*******************************************************************************
+include $(zte_app_mak)
+#include ../net_team.mk
+include $(COMMON_MK)
+
+CPU_PUB_ROOT=$(TOPDIR_AP)/../pub
+##############USER COMIZE BEGIN################
+EXEC = zte_cpe
+EXEC1 = zte-rtc-clock
+EXEC2 = router_msg_proxy
+OBJS = zte_cpe.o ../zte_comm/nvserver/nvserver.o ../zte_comm/nvserver/nvupdate.o \
+ $(patsubst %.c,%.o,$(wildcard ../zte_comm/at_ctl/src/atctrl/*.c ../zte_comm/at_ctl/src/atconfig/*.c ../zte_comm/at_ctl/src/phone/*.c ../zte_comm/at_ctl/src/phone/src/*.c)) \
+ ../zte_comm/rtc-service/rtc-service.o \
+ $(filter-out ../zte_comm/zte_mainctrl/router_msg_proxy.o,$(patsubst %.c,%.o,$(wildcard ../zte_comm/zte_mainctrl/*.c))) \
+ ../zte_comm/zte_hotplug/hotplug.o ../zte_comm/zte_hotplug/netdev_plug.o ../zte_comm/zte_hotplug/drv_plug.o \
+ $(patsubst %.c,%.o,$(wildcard ../zte_comm/zte_drv_ctrl/usb/*.c ../zte_comm/zte_drv_ctrl/serial/*.c)) \
+ ../zte_comm/fluxstat/fluxstat.o \
+ ../zte_comm/sntp/sntp.o \
+ ../zte_comm/sd_hotplug/sd_hotplug.o ../zte_comm/sd_hotplug/sd_httpshare.o \
+ $(patsubst %.c,%.o,$(wildcard ../zte_comm/sms/src/*.c )) \
+ $(patsubst %.c,%.o,$(wildcard ../zte_comm/fota_dm/src/*.c )) \
+ $(patsubst %.c,%.o,$(wildcard ../zte_comm/phonebook/src/*.c )) ../zte_comm/zte_audio_ctrl/audio_res_ctrl.o
+
+OBJS1 = ../zte_comm/rtc-service/zte-rtc-clock.o
+OBJS2 = ../zte_comm/zte_mainctrl/router_msg_proxy.o
+
+ZTE_MMI_DEP = zte_mmi_app
+ZTE_MMI_TOBJS = mmi_adapter.o mmi.o mmi_battery.o mmi_net.o mmi_wifi.o mmi_tip.o mmi_sms.o mmi_lcd_page.o mmi_lcd.o mmi_lcd_init.o mmi_ctrl.o \
+ mmi_keystrokes.o mmi_lcd_timer.o mmi_led.o mmi_led_init.o mmi_led_adapter.o mmi_poweroff_charger.o mmi_traffic.o mmi_fota.o mmi_msg.o \
+ mmi_cfg.o mmi_poweroff.o mmi_battery_adapter.o mmi_mo.o mmi_mo_en.o mmi_mo_zh.o mmi_voip.o mmi_plat_adapter.o
+ZTE_MMI_OBJS = $(addprefix ../zte_comm/zte_mmi/,$(ZTE_MMI_TOBJS))
+
+ZTE_LOCKNET_DEP = zte_locknet_app
+ZTE_LOCKNET_OBJS = $(patsubst %.c,%.o,$(wildcard ../zte_comm/zte_locknet/src/*.c ))
+
+ZTE_WATCHDOG_DEP = zte_watchdog_app
+ZTE_WATCHDOG_TOBJS = watchdog.o watchdog_adapter.o watchdog_battery.o
+ZTE_WATCHDOG_OBJS = $(addprefix ../zte_comm/zte_watchdog/,$(ZTE_WATCHDOG_TOBJS))
+
+#wifi
+ifeq ($(CONFIG_WIFI_MODULE),realtek)
+CFLAGS += -D__REALTEK_8192_CHIP__
+ifeq ($(CONFIG_WIFI_RTL_WPA2),yes)
+tools_dir += ../zte_comm/wlan/realtek_tools_wpa2/auth ../zte_comm/wlan/realtek_tools_wpa2/mini_upnp ../zte_comm/wlan/realtek_tools_wpa2/utility
+tools_dir += ../zte_comm/wlan/realtek_tools_wpa2/wsc ../zte_comm/wlan/realtek_tools_wpa2/wireless_tools.25
+else
+tools_dir += ../zte_comm/wlan/realtek_tools/auth ../zte_comm/wlan/realtek_tools/mini_upnp ../zte_comm/wlan/realtek_tools/utility
+tools_dir += ../zte_comm/wlan/realtek_tools/wsc ../zte_comm/wlan/realtek_tools/wireless_tools.25
+endif
+else ifeq ($(CONFIG_WIFI_MODULE),rda5995)
+CFLAGS += -D__RDA_5995_CHIP__
+tools_dir += ../zte_comm/wlan/rda_tools
+else ifeq ($(CONFIG_WIFI_MODULE),esp8089)
+CFLAGS += -D__ESP_8089_CHIP__
+tools_dir += ../zte_comm/wlan/esp_tools/eagle_test ../zte_comm/wlan/esp_tools/fcctest
+else ifeq ($(CONFIG_WIFI_MODULE),xr819)
+CFLAGS += -D__XR_819_CHIP__
+#tools_dir +=
+endif
+
+$(warning CONFIG_WIFI_FUNCTION=$(CONFIG_WIFI_FUNCTION))
+
+ifeq ($(findstring sta,$(CONFIG_WIFI_FUNCTION)), sta)
+WLAN_STA_FUNC=yes
+endif
+
+ifeq ($(findstring ap,$(CONFIG_WIFI_FUNCTION)), ap)
+WLAN_AP_FUNC=yes
+endif
+
+CFLAGS += -D__QRCODE_WIFI__
+CFLAGS += -D__USE_AES__
+
+ifeq ($(WLAN_STA_FUNC),yes)
+CFLAGS += -D__STA_FUNC__
+CFLAGS += -I$(zte_app_path)/wpa_supplicant-2.6/src/common
+LDLIBS += -lwpa_client -L$(zte_app_path)/wpa_supplicant-2.6/wpa_supplicant
+endif
+ifeq ($(WLAN_AP_FUNC),yes)
+CFLAGS += -D__AP_FUNC__
+CFLAGS += -I$(zte_app_path)/hostapd-2.6/src/common
+LDLIBS += -lwpa_client -L$(zte_app_path)/hostapd-2.6/hostapd
+endif
+
+OBJS += ../zte_comm/wlan/src/wlan_main.o ../zte_comm/wlan/src/wifi_socket.o ../zte_comm/wlan/src/wlan_rtc_sleep.o ../zte_comm/wlan/src/wifi_drv_ko.o \
+ ../zte_comm/wlan/src/wifi_sta_ctrl.o ../zte_comm/wlan/src/wifi_util.o ../zte_comm/wlan/src/wlan_config_ssid.o ../zte_comm/wlan/src/wlan_netlink.o ../zte_comm/wlan/src/Vector.o
+ifeq ($(CONFIG_WIFI_MODULE),realtek)
+OBJS += ../zte_comm/wlan/src/wifi_hal.o
+ ifeq ($(WLAN_STA_FUNC),yes)
+ OBJS += ../zte_comm/wlan/src/wlan-station.o
+ endif
+LDLIBS += -lwlan_interface
+LDLIBS += -L$(zte_lib_path)/libwlan_interface
+else ifeq ($(CONFIG_WIFI_MODULE),rda5995)
+ ifeq ($(WLAN_STA_FUNC),yes)
+ OBJS += ../zte_comm/wlan/src/wlan_sta_manager.o ../zte_comm/wlan/src/wlan_sm.o
+ endif
+
+ ifeq ($(WLAN_AP_FUNC),yes)
+ OBJS += ../zte_comm/wlan/src/wifi_ap_ctrl.o
+LDLIBS += -lwlan_interface
+LDLIBS += -L$(zte_lib_path)/libwlan_interface
+ endif
+else ifeq ($(CONFIG_WIFI_MODULE),esp8089)
+ ifeq ($(WLAN_STA_FUNC),yes)
+ OBJS += ../zte_comm/wlan/src/wlan_sta_manager.o ../zte_comm/wlan/src/wlan_sm.o
+ endif
+
+ ifeq ($(WLAN_AP_FUNC),yes)
+ OBJS += ../zte_comm/wlan/src/wifi_ap_ctrl.o
+LDLIBS += -lwlan_interface
+LDLIBS += -L$(zte_lib_path)/libwlan_interface
+ endif
+else ifeq ($(CONFIG_WIFI_MODULE),xr819)
+ ifeq ($(WLAN_STA_FUNC),yes)
+ OBJS += ../zte_comm/wlan/src/wlan_sta_manager.o ../zte_comm/wlan/src/wlan_sm.o
+ endif
+
+ ifeq ($(WLAN_AP_FUNC),yes)
+ OBJS += ../zte_comm/wlan/src/wifi_ap_ctrl.o
+LDLIBS += -lwlan_interface
+LDLIBS += -L$(zte_lib_path)/libwlan_interface
+ endif
+endif
+#aes
+CFLAGS += -I$(zte_lib_path)/libssl/install/include
+LDLIBS += -L$(zte_lib_path)/libssl/install/lib -lcrypto
+
+ifeq ($(CONFIG_USE_WEBUI_SECURITY),yes)
+CFLAGS += -DWEBS_SECURITY
+endif
+#*******************************************************************************
+# include path
+#*******************************************************************************
+CFLAGS += -I./
+CFLAGS += -I../include
+CFLAGS += -I../zte_comm/nvserver
+CFLAGS += -I$(LIB_DIR)/libnvram
+CFLAGS += -I$(APP_DIR)/include
+CFLAGS += -g -Werror=implicit-function-declaration
+
+CFLAGS += -I../zte_comm/zte_hotplug
+CFLAGS += -I../zte_comm/at_ctl/inc
+CFLAGS += -I../zte_comm/at_ctl/src/phone/inc
+CFLAGS += -I$(zte_app_path)/include
+CFLAGS += -I$(zte_lib_path)/libatext
+CFLAGS += -I$(zte_lib_path)/libsqlite
+CFLAGS += -I$(zte_lib_path)/libnvram
+CFLAGS += -I$(LINUX_DIR)
+CFLAGS += -I$(zte_lib_path)/libzcore/std/inc/zCore/bl
+CFLAGS += -I$(zte_lib_path)/libzcore/std/inc/zCore/gui
+CFLAGS += -I$(CPU_PUB_ROOT)/project/zx297520v3/include/nv
+CFLAGS += -O -Dlinux=1 -DHIGH_SPEED=1
+
+
+CFLAGS += -I$(zte_lib_path)/libsoftap
+#CFLAGS += -I.
+
+
+CFLAGS += -I$(zte_lib_path)/libsoft_timer
+
+CFLAGS += -I../zte_comm/sms/inc
+CFLAGS += -I../zte_comm/phonebook/inc
+
+CFLAGS += -I../zte_comm/wlan/inc
+
+
+CFLAGS += -I../zte_comm/fota_dm/inc
+#CFLAGS += -I../zte_comm/fota_dm/gs_lib
+CFLAGS += -I../zte_comm/fota_dm/rs_lib
+CFLAGS += -I$(zte_lib_path)/libzte_dmapp/inc
+
+#*******************************************************************************
+# library
+#*******************************************************************************
+LDLIBS += -lnvram_sc -L$(zte_lib_path)/libnvram -lpthread
+ifeq ($(LINUX_TYPE),uClinux)
+LDFLAGS += -Wl,--allow-multiple-definition,-elf2flt=-s131072
+endif
+
+
+LDLIBS += -lsoftap -L$(zte_lib_path)/libsoftap
+LDLIBS += -lsoft_timer_sc -L$(zte_lib_path)/libsoft_timer
+LDLIBS += -latutils -L$(zte_lib_path)/libatutils
+LDLIBS += -lsqlite -L$(zte_lib_path)/libsqlite
+LDLIBS += -latext -L$(zte_lib_path)/libatext
+LDLIBS += -lm
+#LDLIBS += -ltinyalsa -L$(zte_lib_path)/libtinyalsa
+LDLIBS += -lcpnv -L$(zte_lib_path)/libcpnv
+LDLIBS += -lamt -L$(zte_lib_path)/libamt
+LDLIBS += -lkey -L$(zte_lib_path)/libkey
+
+LDLIBS += -lcurl -L$(zte_lib_path)/libcurl/install/lib
+
+ifneq ($(CONFIG_MMI_LCD),no)
+LDLIBS += -lzcore
+LDLIBS += -lrt
+LDLIBS += -L$(zte_lib_path)/libzcore/min
+endif
+
+LDLIBS += -lztedmapp -L$(zte_lib_path)/libzte_dmapp
+#LIBSHARE_GS = ../zte_comm/fota_dm/gs_lib/libdmgr.so.1
+#LDLIBS += -L../zte_comm/fota_dm/gs_lib -ldmgr
+
+LIBSHARE_GS = ../zte_comm/fota_dm/rs_lib/librsdlsdk.so
+LDLIBS += -L../zte_comm/fota_dm/rs_lib -lrsdlsdk
+LDLIBS1 += -lnvram_sc -L$(zte_lib_path)/libnvram -lpthread
+LDLIBS1 += -lsoftap -L$(zte_lib_path)/libsoftap
+LDLIBS1 += -lsoft_timer_sc -L$(zte_lib_path)/libsoft_timer
+
+##############USER COMIZE END##################
+
+all: $(EXEC) $(EXEC1) $(EXEC2)
+ifneq ($(tools_dir), )
+ for i in $(tools_dir) ; do $(MAKE) -C $$i || exit $?; done
+endif
+ (cd ../zte_comm/fota_dm/gs_lib;rm libdmgr.so;ln -s libdmgr.so.1 libdmgr.so; cd ../../../zte_comm)
+
+$(EXEC): $(OBJS) $(ZTE_MMI_DEP) $(ZTE_LOCKNET_DEP) $(ZTE_WATCHDOG_DEP)
+ $(CC) $(LDFLAGS) -o $@ $(OBJS) $(ZTE_MMI_OBJS) $(ZTE_LOCKNET_OBJS) $(ZTE_WATCHDOG_OBJS) -Wl,--start-group $(LDLIBS) -Wl,--end-group
+ @cp $@ $@.elf
+
+$(EXEC1): $(OBJS1)
+ $(CC) $(CFLAGS) -o $@ $(OBJS1) -Wl,--start-group $(LDLIBS1) -Wl,--end-group
+ @cp $@ $@.elf
+
+$(EXEC2): $(OBJS2)
+ $(CC) $(CFLAGS) -o $@ $(OBJS2) -Wl,--start-group $(LDLIBS1) -Wl,--end-group
+ @cp $@ $@.elf
+
+romfs:
+ $(ROMFSINST) /sbin/$(EXEC)
+ $(ROMFSINST) /sbin/$(EXEC1)
+ $(ROMFSINST) /sbin/$(EXEC2)
+ $(ROMFSINST) $(LIBSHARE_GS) /lib/
+ifneq ($(tools_dir), )
+ for i in $(tools_dir) ; do $(MAKE) -C $$i romfs || exit $?; done
+endif
+
+clean:
+ -rm -f $(EXEC) *.elf *.gdb *.o
+ -rm -f $(EXEC1) *.elf *.gdb *.o
+ -rm -f $(EXEC2) *.elf *.gdb *.o
+ -find ../zte_comm/ -name \*.o -exec rm -rf {} \;
+ -find . -name \*.o -exec rm -rf {} \;
+ifneq ($(tools_dir), )
+ for i in $(tools_dir) ; do $(MAKE) -C $$i clean || exit $?; done
+endif
+ifeq ($(CONFIG_USER_SINGLE_DM), zx)
+ rm -rf $(ROOTFS_DIR)//bin/$(EXEC_GS)
+endif
+
+$(ZTE_MMI_DEP):
+ ${MAKE} -C ../zte_comm/zte_mmi lib
+
+$(ZTE_LOCKNET_DEP):
+ ${MAKE} -C ../zte_comm/zte_locknet lib
+
+$(ZTE_WATCHDOG_DEP):
+ ${MAKE} -C ../zte_comm/zte_watchdog lib
diff --git a/ap/app/zte_cpe/zte_cpe.c b/ap/app/zte_cpe/zte_cpe.c
new file mode 100755
index 0000000..7afa751
--- /dev/null
+++ b/ap/app/zte_cpe/zte_cpe.c
@@ -0,0 +1,305 @@
+#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_cpe.h>
+#include "softap_api.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)
+{
+ if (0 == strcmp(arg, "2")) {
+ char *argv[2];
+ argv[0] = NULL;
+ argv[1] = "poweroff_charger";
+
+ zte_mainctrl_main(2, argv);
+ } else {
+ 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)
+{
+ if(arg)
+ zte_drv_usb_ctrl_main(3,NULL);
+ else
+ zte_drv_usb_ctrl_main(0,NULL);
+ return;
+}
+
+void zte_mmi_entry(char *arg)
+{
+ //printf("zte_mmi_entry boot:%s\n", arg);
+ if (0 == strcmp(arg, "2")) {
+ char *argv[2];
+ argv[0] = NULL;
+ argv[1] = "poweroff_charger";
+
+ zte_mmi_main(2, argv);
+ } else {
+ zte_mmi_main(0,NULL);
+ }
+ return;
+}
+
+void zte_locknet_entry(char *arg)
+{
+ zte_locknet_main(0,NULL);
+ //return; //klocwork
+}
+
+void zte_watchdog_entry(char *arg)
+{
+ zte_watchdog_main(0,NULL);
+ return;
+}
+
+void fluxstat_entry(char *arg)
+{
+ fluxstat_main(0,NULL);
+ return;
+}
+
+void sntp_entry(char *arg)
+{
+ sntp_main(0,NULL);
+ return;
+}
+
+void sd_hotplug_entry(char *arg)
+{
+ sd_hotplug_main(0,NULL);
+ return;
+}
+
+void sms_entry(char *arg)
+{
+ sms_main(0,NULL);
+}
+
+void phonebook_entry(char *arg)
+{
+ phonebook_main(0,NULL);
+ return;
+}
+
+void wlan_entry(char *arg)
+{
+ wlan_main(0,NULL);
+ return;
+}
+
+void fota_dm_entry(char *arg)
+{
+ fota_dm_main(0,NULL);
+}
+
+
+int main(int argc, char *argv[])
+{
+ int ret = 0;
+ /* nvserver */
+ pthread_t nvserver_thread_tid;
+ pthread_create(&nvserver_thread_tid, NULL, (void *)nvserver_entry, NULL);
+
+ /* zte_hotplug */
+ pthread_t zte_hotplug_thread_tid;
+ pthread_create(&zte_hotplug_thread_tid, NULL, (void *)zte_hotplug_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;
+#ifdef WEBS_SECURITY
+ {
+ char rstr[24] = {0};
+
+ sc_cfg_get("dbinfo", rstr, sizeof(rstr));
+ if(strlen(rstr) == 0)
+ {
+ unsigned int rnum = 0;
+
+ system("rm -rf /etc_rw/pbm.*");
+ system("rm -rf /etc_rw/sms.*");
+ srand( (unsigned)time( NULL ) );
+ rnum = (rand()|0xf000000);
+ snprintf((char *)rstr, sizeof(rstr), "%ld", rnum);
+ sc_cfg_set("dbinfo", rstr);
+ sc_cfg_save();
+ }
+ {
+ unsigned char i = 0;
+ char nstr[24] = {0};
+ for(i = 0; i < 22; i++)
+ {
+ if(rstr[i] >= 0x30)
+ {
+ nstr[i] = rstr[i] + (((i&0x7)|0x18)+1)*(2>>(i%3));
+ }
+ else
+ {
+ nstr[i] = (i%10) + 0x30 + (((i&0x7)|0x18)+1)*(2>>(i%3));
+ }
+ }
+ sc_cfg_set("rnum_at", nstr);
+ }
+ }
+#endif
+ if (0 == strcmp(argv[2], "amt")) {
+ ret = sc_cfg_set("ver_mode", "0");
+ if(ret < 0)
+ printf("zte_cpe set vermode fail\n");
+ else
+ sc_cfg_save();
+ printf("---set ver mode to 0\n");
+ }
+
+ if (0 != strcmp(argv[2], "amt")) { //³äµç»òÕý³£¿ª»úģʽ
+ char LanEnable[10] = {0};
+ /* 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, argv[1]);
+
+ /* 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);
+
+ sc_cfg_get("LanEnable", LanEnable, sizeof(LanEnable));
+ if(atoi(LanEnable) == 1) { //mifiÐÎ̬
+ /* zte_mmi */
+ pthread_t zte_mmi_thread_tid;
+ pthread_create(&zte_mmi_thread_tid, NULL, (void *)zte_mmi_entry, argv[1]);
+ }
+ if (0 != strcmp(argv[1], "2")) { //·Ç³äµçģʽ
+
+ pthread_create(&zte_drv_usb_ctrl_thread_tid, NULL, (void *)zte_drv_usb_ctrl_entry, NULL);
+ if(atoi(LanEnable) == 1) { //mifiÐÎ̬
+ /* zte_locknet */
+ pthread_t zte_locknet_thread_tid;
+ pthread_create(&zte_locknet_thread_tid, NULL, (void *)zte_locknet_entry, NULL);
+ /* fluxstat */
+
+ pthread_t fluxstat_thread_tid;
+ pthread_create(&fluxstat_thread_tid, NULL, (void *)fluxstat_entry, NULL);
+ /* sntp */
+ pthread_t sntp_thread_tid;
+ pthread_create(&sntp_thread_tid, NULL, (void *)sntp_entry, NULL);
+ /* sd_hotplug */
+ //pthread_t sd_hotplug_thread_tid;
+ //pthread_create(&sd_hotplug_thread_tid, NULL, (void *)sd_hotplug_entry, NULL);
+ sd_hotplug_init();
+ /* sms */
+ pthread_t sms_thread_tid;
+ pthread_create(&sms_thread_tid, NULL, (void *)sms_entry, NULL);
+ /* phonebook */
+ pthread_t phonebook_thread_tid;
+ pthread_create(&phonebook_thread_tid, NULL, (void *)phonebook_entry, NULL);
+ /* wifi_manager */
+ pthread_t wlan_thread_tid;
+ pthread_create(&wlan_thread_tid, NULL, (void *)wlan_entry, NULL);
+ }
+
+ /* fota_dm */
+ pthread_t fota_dm_thread_tid;
+ pthread_create(&fota_dm_thread_tid, NULL, (void *)fota_dm_entry, NULL);
+ }else{
+
+ pthread_create(&zte_drv_usb_ctrl_thread_tid, NULL, (void *)zte_drv_usb_ctrl_entry, "poweroff_charger");
+
+ }
+
+
+ /* zte_watchdog */
+ pthread_t zte_watchdog_thread_tid;
+ pthread_create(&zte_watchdog_thread_tid, NULL, (void *)zte_watchdog_entry, NULL);
+
+ }
+ else
+ {
+ pthread_create(&zte_drv_usb_ctrl_thread_tid, NULL, (void *)zte_drv_usb_ctrl_entry, NULL);
+ }
+
+
+ while(1)
+ {
+ sleep(20);
+ //printf("zte app test -1 \n");
+ }
+
+ return 0;
+}
+
diff --git a/ap/app/zte_cpe/zte_cpe.h b/ap/app/zte_cpe/zte_cpe.h
new file mode 100755
index 0000000..fe895d6
--- /dev/null
+++ b/ap/app/zte_cpe/zte_cpe.h
@@ -0,0 +1,59 @@
+/*******************************************************************************
+* °æÈ¨ËùÓÐ (C)2016, ÖÐÐËͨѶ¹É·ÝÓÐÏÞ¹«Ë¾¡£
+*
+* ÎļþÃû³Æ: zte_mifi.h
+* Îļþ±êʶ: zte_mifi.h
+* ÄÚÈÝÕªÒª: mifiºÏ²¢Ó¦ÓÃÍ·Îļþ
+* ʹÓ÷½·¨: #include <zte_mifi.h>
+*
+*
+*******************************************************************************/
+#ifndef _ZTE_MIFI_H
+#define _ZTE_MIFI_H
+
+/*******************************************************************************
+* Í·Îļþ *
+*******************************************************************************/
+
+
+/*******************************************************************************
+* ºê¶¨Òå *
+*******************************************************************************/
+
+
+/*******************************************************************************
+* Êý¾ÝÀàÐͶ¨Òå *
+*******************************************************************************/
+
+
+/*******************************************************************************
+* È«¾Ö±äÁ¿ÉùÃ÷ *
+*******************************************************************************/
+
+
+/*******************************************************************************
+* È«¾Öº¯ÊýÉùÃ÷ *
+*******************************************************************************/
+int nvserver_main(int argc, char *argv[]);
+int at_ctl_main(int argc, char * argv[]);
+int rtc_service_main(int argc, char **argv);
+int zte_mainctrl_main(int argc, char * argv[]);
+int zte_hotplug_main(int argc, char * argv[]);
+int zte_audio_res_ctrl_main(int argc, char * argv[]);
+int zte_drv_serial_ctrl_main();
+int zte_drv_usb_ctrl_main(int argc, char* argv[]);
+int zte_mmi_main(int argc, char* argv[]);
+int zte_locknet_main(int argc, char* argv[]);
+int zte_watchdog_main(int argc, char * argv[]);
+int fluxstat_main(int argc, char * argv[]);
+int sntp_main(int argc, char * argv[]);
+int sd_hotplug_init(viod);
+int sd_hotplug_main(int argc, char* argv[]);
+int sms_main(int argc, char* argv[]);
+int phonebook_main(int argc, char* argv[]);
+int wlan_main (int argc, char *argv[]);
+int fota_dm_main(int argc, char**argv);
+
+
+#endif
+