diff --git a/Makefile.common b/Makefile.common deleted file mode 100644 index a4a2e5f..0000000 --- a/Makefile.common +++ /dev/null @@ -1,4 +0,0 @@ -LIB_BUILD_COMMON_LIB := -ldbus-1 -luv -lcrypto -lcjson -luvdbus -lsqlite3 -ls2json -lpthread -lcurl -lz -lquickmail -luuid -lconfig -LIB_MAKE_COMMON_DEPEND := +uthash +dbus +libuv +libpthread +libs2json +libcjson +libsqlite3 +libopenssl +libcurl +libquickmail +libz +libuuid +libconfig +libcutils -BUILD_COMMON_LIB := $(LIB_BUILD_COMMON_LIB) -luvdbus -MAKE_COMMON_DEPEND := $(LIB_MAKE_COMMON_DEPEND) +libuvdbus diff --git a/Makefile.common.submodule b/Makefile.common.submodule new file mode 100644 index 0000000..2d1ba34 --- /dev/null +++ b/Makefile.common.submodule @@ -0,0 +1,30 @@ +# r16-pv1 + +HARDWARE_VERSION:=DVT +HARDWARE_ALIAS:=r16-pv1 + +ifeq ('$(CONFIG_BOARD_HARDWARE_VERSION_DVT)', 'y') + HARDWARE_VERSION=DVT + HARDWARE_ALIAS=r16-pv1 +endif + +ifeq ('$(CONFIG_BOARD_HARDWARE_VERSION_EVT)', 'y') + HARDWARE_VERSION=EVT + HARDWARE_ALIAS=r16-pv1 +endif + +ifeq ('$(CONFIG_BOARD_HARDWARE_VERSION_R311_PV1)', 'y') + HARDWARE_VERSION=r311-pv1 + HARDWARE_ALIAS=r311-pv1 +endif + +ifeq ('$(CONFIG_BOARD_HARDWARE_VERSION_R311_PV2)', 'y') + HARDWARE_VERSION=r311-pv2 + HARDWARE_ALIAS=r311-pv2 +endif + +GIT_TAG:=$(shell cd $(TOPDIR) && git describe --tags `git rev-list --tags --max-count=1`) +COMMIT_HASH:=$(shell cd $(TOPDIR) && git rev-parse HEAD 2>/dev/null) +BUILD_DATE:=$(shell TZ='Asia/Shanghai' date '+%Y-%m-%d_%H:%M:%S') + +$(info HARDWARE_VERSION: $(HARDWARE_VERSION) HARDWARE_ALIAS: $(HARDWARE_ALIAS) GIT_TAG: $(GIT_TAG) BUILD_DATE:$(BUILD_DATE) COMMIT_HASH:$(COMMIT_HASH)) diff --git a/app/InitScript/Makefile b/app/InitScript/Makefile new file mode 100644 index 0000000..087dc53 --- /dev/null +++ b/app/InitScript/Makefile @@ -0,0 +1,54 @@ +include $(TOPDIR)/rules.mk +include $(TINA_BUILD_TOP)/package/netease/submodules/Makefile.common.submodule + +# Name and release number of this package +PKG_NAME:=NeteaseInitScript +PKG_VERSION:=1 + +PKG_BUILD_DIR:=$(COMPILE_DIR)/$(PKG_NAME) + +include $(BUILD_DIR)/package.mk + +define Package/$(PKG_NAME) + SECTION:=utils + CATEGORY:=Netease + TITLE:=Netease init script +endef + +define Package/$(PKG_NAME)/description + Netease app start up scripts! +endef + +define Build/Prepare +endef + +define Build/Configure +endef + +define Build/Compile +endef + +define Build/InstallDev +endef + +define Package/$(PKG_NAME)/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_DIR) $(1)/usr/share/golang + $(INSTALL_DIR) $(1)/usr/share/golang/mcu + $(INSTALL_DIR) $(1)/etc/ssl/certs + + $(INSTALL_BIN) ./common/backuplocalfiles.sh $(1)/usr/sbin/ + + $(INSTALL_BIN) ./$(HARDWARE_ALIAS)/netease.init $(1)/etc/init.d/netease_services + $(INSTALL_BIN) ./$(HARDWARE_ALIAS)/neteasewifi.init $(1)/etc/init.d/netease_wifi_service + $(INSTALL_BIN) ./$(HARDWARE_ALIAS)/neteasevoice.init $(1)/etc/init.d/netease_voice_service + $(INSTALL_BIN) ./$(HARDWARE_ALIAS)/neteaseplayer.init $(1)/etc/init.d/netease_player_service + $(INSTALL_BIN) ./$(HARDWARE_ALIAS)/neteasemanufacture_cc.init $(1)/etc/init.d/netease_cc_manufacture_service + $(INSTALL_BIN) ./$(HARDWARE_ALIAS)/neteasemanufacture_mcu.init $(1)/etc/init.d/netease_mcu_manufacture_service + $(INSTALL_BIN) ./$(HARDWARE_ALIAS)/neteasemanufacture_rf.init $(1)/etc/init.d/netease_rf_manufacture_service + $(INSTALL_BIN) ./$(HARDWARE_ALIAS)/neteasecc.init $(1)/etc/init.d/netease_cc_service + $(INSTALL_BIN) ./$(HARDWARE_ALIAS)/neteasebt.init $(1)/etc/init.d/netease_bt_service +endef + +$(eval $(call BuildPackage,$(PKG_NAME))) diff --git a/app/netease_control_center_common_module/backuplocalfiles.sh b/app/InitScript/common/backuplocalfiles.sh similarity index 100% rename from app/netease_control_center_common_module/backuplocalfiles.sh rename to app/InitScript/common/backuplocalfiles.sh diff --git a/app/netease_control_center_common_module/netease.init b/app/InitScript/r16-pv1/netease.init similarity index 100% rename from app/netease_control_center_common_module/netease.init rename to app/InitScript/r16-pv1/netease.init diff --git a/app/netease_control_center_common_module/neteasebt.init b/app/InitScript/r16-pv1/neteasebt.init similarity index 100% rename from app/netease_control_center_common_module/neteasebt.init rename to app/InitScript/r16-pv1/neteasebt.init diff --git a/app/netease_control_center_common_module/neteasecc.init b/app/InitScript/r16-pv1/neteasecc.init similarity index 100% rename from app/netease_control_center_common_module/neteasecc.init rename to app/InitScript/r16-pv1/neteasecc.init diff --git a/app/netease_control_center_common_module/neteasedbus.init b/app/InitScript/r16-pv1/neteasedbus.init similarity index 100% rename from app/netease_control_center_common_module/neteasedbus.init rename to app/InitScript/r16-pv1/neteasedbus.init diff --git a/app/netease_control_center_common_module/neteasemanufacture_cc.init b/app/InitScript/r16-pv1/neteasemanufacture_cc.init similarity index 100% rename from app/netease_control_center_common_module/neteasemanufacture_cc.init rename to app/InitScript/r16-pv1/neteasemanufacture_cc.init diff --git a/app/netease_control_center_common_module/neteasemanufacture_mcu.init b/app/InitScript/r16-pv1/neteasemanufacture_mcu.init similarity index 100% rename from app/netease_control_center_common_module/neteasemanufacture_mcu.init rename to app/InitScript/r16-pv1/neteasemanufacture_mcu.init diff --git a/app/netease_control_center_common_module/neteasemanufacture_rf.init b/app/InitScript/r16-pv1/neteasemanufacture_rf.init similarity index 100% rename from app/netease_control_center_common_module/neteasemanufacture_rf.init rename to app/InitScript/r16-pv1/neteasemanufacture_rf.init diff --git a/app/netease_control_center_common_module/neteaseplayer.init b/app/InitScript/r16-pv1/neteaseplayer.init similarity index 100% rename from app/netease_control_center_common_module/neteaseplayer.init rename to app/InitScript/r16-pv1/neteaseplayer.init diff --git a/app/netease_control_center_common_module/neteasevoice.init b/app/InitScript/r16-pv1/neteasevoice.init similarity index 100% rename from app/netease_control_center_common_module/neteasevoice.init rename to app/InitScript/r16-pv1/neteasevoice.init diff --git a/app/netease_control_center_common_module/neteasewifi.init b/app/InitScript/r16-pv1/neteasewifi.init similarity index 100% rename from app/netease_control_center_common_module/neteasewifi.init rename to app/InitScript/r16-pv1/neteasewifi.init diff --git a/app/InitScript/r311-pv1/netease.init b/app/InitScript/r311-pv1/netease.init new file mode 100755 index 0000000..f8c83c2 --- /dev/null +++ b/app/InitScript/r311-pv1/netease.init @@ -0,0 +1,164 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2006-2011 OpenWrt.org + +START=120 +STOP=120 +USE_PROCD=1 +DEPEND=netease_wifi_service,netease_voice_service,boot,netease_player_service + +PROG_VOICE=/bin/netease_voice +PROG_CC=/usr/sbin/netease_control_center +PROG_PLAYER=/usr/bin/ihwplayer +PROG_LE_APP=/usr/bin/app_nevsps_bt +PROG_WIFI_APP=/bin/app_wifi_manager +PROG_OTA=/usr/bin/ota +PROG_ALARMER=/usr/bin/alarmer +PROG_KPLAYER=/usr/bin/KPlayer +PROG_SPLAYER=/usr/bin/SPlayer + +OOM_ADJ=2 +LOG=/tmp/netease.init.log +GOROOT=/usr/share/golang/ + +init_dbus() { + echo "init dbus" >> $LOG +if [ -x /tmp/dbus_env.sh ] +then + DBUS_DAEMON_ON=`ps | grep "dbus-daemon --fork" | grep -v grep | wc -l` + if [ "$DBUS_DAEMON_ON" == "1" ] + then + source /tmp/dbus_env.sh + else + echo "-----------------" >> /mnt/UDISK/reboot.log + date -R >> /mnt/UDISK/reboot.log + reboot -f + fi +else + export $(dbus-launch) + echo "export DBUS_SESSION_BUS_ADDRESS=\"$DBUS_SESSION_BUS_ADDRESS\"" > /tmp/dbus_env.sh + echo "export DBUS_SESSION_BUS_PID=\"$DBUS_SESSION_BUS_PID\"" >> /tmp/dbus_env.sh + chmod +x /tmp/dbus_env.sh +fi + +echo "wzj: DBUS_SESSION_BUS_ADDRESS=\"$DBUS_SESSION_BUS_ADDRESS\"" >> $LOG +} + +start_voice() { + echo "start voice" >> $LOG + echo $DBUS_SESSION_BUS_ADDRESS >> $LOG + procd_open_instance + procd_set_param oom_adj $OOM_ADJ + procd_set_param command $PROG_VOICE -D >> /tmp/voicelog 2>&1 + procd_set_param respawn + procd_append_param limits core=unlimited + procd_set_param env DBUS_SESSION_BUS_ADDRESS=$DBUS_SESSION_BUS_ADDRESS + procd_close_instance +} + +start_cc() { + echo "start cc" >> $LOG + echo $DBUS_SESSION_BUS_ADDRESS >> $LOG + procd_open_instance + procd_set_param oom_adj $OOM_ADJ + procd_set_param command $PROG_CC + procd_set_param respawn + procd_append_param limits core=unlimited + procd_set_param env DBUS_SESSION_BUS_ADDRESS=$DBUS_SESSION_BUS_ADDRESS + procd_close_instance + +} + +start_player() { + echo "start player" >> $LOG + echo $DBUS_SESSION_BUS_ADDRESS >> $LOG + procd_open_instance + procd_set_param oom_adj $OOM_ADJ + procd_set_param command $PROG_PLAYER -D + procd_set_param respawn + procd_append_param limits core=unlimited + procd_set_param env DBUS_SESSION_BUS_ADDRESS=$DBUS_SESSION_BUS_ADDRESS GOROOT=$GOROOT + procd_close_instance +} + +start_wifi() { + echo "start wifi" >> $LOG + procd_open_instance + procd_set_param oom_adj $OOM_ADJ + procd_set_param command $PROG_WIFI_APP -D >> /tmp/wifilog + procd_set_param respawn + procd_append_param limits core=unlimited + procd_set_param env DBUS_SESSION_BUS_ADDRESS=$DBUS_SESSION_BUS_ADDRESS GOROOT=$GOROOT + procd_close_instance +} + +start_ble() { + echo "start ble" >> $LOG + procd_open_instance + procd_set_param oom_adj $OOM_ADJ + procd_set_param command $PROG_LE_APP -D >> /tmp/blelog + procd_set_param respawn + procd_append_param limits core=unlimited + procd_set_param env DBUS_SESSION_BUS_ADDRESS=$DBUS_SESSION_BUS_ADDRESS GOROOT=$GOROOT + procd_close_instance +} + +start_ota() { + echo "start ota" >> $LOG + procd_open_instance + procd_set_param oom_adj $OOM_ADJ + procd_set_param command $PROG_OTA -D >> /tmp/otalog + procd_set_param respawn + procd_append_param limits core=unlimited + procd_set_param env DBUS_SESSION_BUS_ADDRESS=$DBUS_SESSION_BUS_ADDRESS GOROOT=$GOROOT + procd_close_instance +} + +start_alarmer() { + echo "start ota" >> $LOG + procd_open_instance + procd_set_param oom_adj $OOM_ADJ + procd_set_param command $PROG_ALARMER -D >> /tmp/otalog + procd_set_param respawn + procd_append_param limits core=unlimited + procd_set_param env DBUS_SESSION_BUS_ADDRESS=$DBUS_SESSION_BUS_ADDRESS GOROOT=$GOROOT + procd_close_instance +} + +start_dlna() { + echo "start dlna" >> $LOG + procd_open_instance + procd_set_param oom_adj $OOM_ADJ + procd_set_param command $PROG_KPLAYER -D >> /tmp/dlnalog + procd_set_param respawn + procd_append_param limits core=unlimited + procd_set_param env DBUS_SESSION_BUS_ADDRESS=$DBUS_SESSION_BUS_ADDRESS GOROOT=$GOROOT + procd_close_instance +} + +start_airplay() { + echo "start airplay" >> $LOG + procd_open_instance + procd_set_param oom_adj $OOM_ADJ + procd_set_param command $PROG_SPLAYER -D >> /tmp/airplaylog + procd_set_param respawn + procd_append_param limits core=unlimited + procd_set_param env DBUS_SESSION_BUS_ADDRESS=$DBUS_SESSION_BUS_ADDRESS GOROOT=$GOROOT + procd_close_instance +} + +start_all() { + echo "start all" >> $LOG + $PROG_CC > /dev/null 2>&1 & + $PROG_PLAYER -D > /dev/null 2>&1 & + $PROG_VOICE -D > /dev/null 2>&1 & +} + +start_service() { +#/etc/bluetooth/btenable.sh on + init_dbus + start_dlna + start_airplay + #start_ble + start_ota + start_alarmer +} diff --git a/app/InitScript/r311-pv1/neteasebt.init b/app/InitScript/r311-pv1/neteasebt.init new file mode 100755 index 0000000..de6c923 --- /dev/null +++ b/app/InitScript/r311-pv1/neteasebt.init @@ -0,0 +1,58 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2006-2011 OpenWrt.org + +START=110 +STOP=110 +USE_PROCD=1 +DEPEND=boot + +PROG_VOICE=/bin/netease_voice +PROG_CC=/usr/sbin/netease_control_center +PROG_PLAYER=/usr/bin/ihwplayer +PROG_BT_APP=/usr/bin/app_nevsps_bt +PROG_WIFI_APP=/bin/app_wifi_manager +PROG_OTA=/usr/bin/ota +PROG_ALARMER=/usr/bin/alarmer + +OOM_ADJ=2 +LOG=/tmp/netease.init.log +GOROOT=/usr/share/golang/ + +init_dbus() { + echo "init dbus" >> $LOG +if [ -x /tmp/dbus_env.sh ] +then + DBUS_DAEMON_ON=`ps | grep "dbus-daemon --fork" | grep -v grep | wc -l` + if [ "$DBUS_DAEMON_ON" == "1" ] + then + source /tmp/dbus_env.sh + else + echo "-----------------" >> /mnt/UDISK/reboot.log + date -R >> /mnt/UDISK/reboot.log + reboot -f + fi +else + export $(dbus-launch) + echo "export DBUS_SESSION_BUS_ADDRESS=\"$DBUS_SESSION_BUS_ADDRESS\"" > /tmp/dbus_env.sh + echo "export DBUS_SESSION_BUS_PID=\"$DBUS_SESSION_BUS_PID\"" >> /tmp/dbus_env.sh + chmod +x /tmp/dbus_env.sh +fi + +echo "bt_service: DBUS_SESSION_BUS_ADDRESS=\"$DBUS_SESSION_BUS_ADDRESS\"" >> $LOG +} + +start_bt() { + echo "start bt" >> $LOG + procd_open_instance + procd_set_param oom_adj $OOM_ADJ + procd_set_param command $PROG_BT_APP -D >> /tmp/btlog + procd_set_param respawn + procd_append_param limits core=unlimited + procd_set_param env DBUS_SESSION_BUS_ADDRESS=$DBUS_SESSION_BUS_ADDRESS GOROOT=$GOROOT + procd_close_instance +} + +start_service() { + init_dbus + start_bt +} diff --git a/app/InitScript/r311-pv1/neteasecc.init b/app/InitScript/r311-pv1/neteasecc.init new file mode 100644 index 0000000..ec20bb6 --- /dev/null +++ b/app/InitScript/r311-pv1/neteasecc.init @@ -0,0 +1,61 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2006-2011 OpenWrt.org + +#START=121 +STOP=121 +USE_PROCD=1 +DEPEND=netease_wifi_service,netease_voice_service,boot,netease_player_service,netease_service + +PROG_VOICE=/bin/netease_voice +PROG_CC=/usr/sbin/netease_control_center +PROG_PLAYER=/usr/bin/ihwplayer +PROG_LE_APP=/usr/bin/app_nevsps_bt +PROG_WIFI_APP=/bin/app_wifi_manager +PROG_OTA=/usr/bin/ota +PROG_ALARMER=/usr/bin/alarmer +PROG_KPLAYER=/usr/bin/KPlayer +PROG_SPLAYER=/usr/bin/SPlayer + +OOM_ADJ=2 +LOG=/tmp/netease.init.log +GOROOT=/usr/share/golang/ + +init_dbus() { + echo "init dbus" >> $LOG +if [ -x /tmp/dbus_env.sh ] +then + DBUS_DAEMON_ON=`ps | grep "dbus-daemon --fork" | grep -v grep | wc -l` + if [ "$DBUS_DAEMON_ON" == "1" ] + then + source /tmp/dbus_env.sh + else + echo "-----------------" >> /mnt/UDISK/reboot.log + date -R >> /mnt/UDISK/reboot.log + reboot -f + fi +else + export $(dbus-launch) + echo "export DBUS_SESSION_BUS_ADDRESS=\"$DBUS_SESSION_BUS_ADDRESS\"" > /tmp/dbus_env.sh + echo "export DBUS_SESSION_BUS_PID=\"$DBUS_SESSION_BUS_PID\"" >> /tmp/dbus_env.sh + chmod +x /tmp/dbus_env.sh +fi + +echo "wzj: DBUS_SESSION_BUS_ADDRESS=\"$DBUS_SESSION_BUS_ADDRESS\"" >> $LOG +} + +start_cc() { + echo "start cc" >> $LOG + echo $DBUS_SESSION_BUS_ADDRESS >> $LOG + procd_open_instance + procd_set_param oom_adj $OOM_ADJ + procd_set_param command $PROG_CC + procd_set_param respawn + procd_append_param limits core=unlimited + procd_set_param env DBUS_SESSION_BUS_ADDRESS=$DBUS_SESSION_BUS_ADDRESS GOROOT=$GOROOT + procd_close_instance +} + +start_service() { + init_dbus + start_cc +} diff --git a/app/InitScript/r311-pv1/neteasedbus.init b/app/InitScript/r311-pv1/neteasedbus.init new file mode 100644 index 0000000..3269fb7 --- /dev/null +++ b/app/InitScript/r311-pv1/neteasedbus.init @@ -0,0 +1,18 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2006-2011 OpenWrt.org + +START=60 +STOP=60 +USE_PROCD=1 + +LOG=/tmp/netease.init.log +DBUS_SESSION_FILE=/tmp/dbus-session.env + +create_dbus_env() { + dbus-daemon --session --print-address >> $DBUS_SESSION_FILE & + sync +} + +start_service() { + create_dbus_env +} diff --git a/app/InitScript/r311-pv1/neteasemanufacture_cc.init b/app/InitScript/r311-pv1/neteasemanufacture_cc.init new file mode 100644 index 0000000..aa17ee7 --- /dev/null +++ b/app/InitScript/r311-pv1/neteasemanufacture_cc.init @@ -0,0 +1,89 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2006-2011 OpenWrt.org + +STOP=121 +USE_PROCD=1 + +PROG_VOICE=/bin/netease_voice +PROG_CC=/usr/sbin/netease_control_center +PROG_PLAYER=/usr/bin/ihwplayer +PROG_LE_APP=/usr/bin/app_nevsps_bt +PROG_WIFI_APP=/bin/app_wifi_manager +PROG_OTA=/usr/bin/ota +PROG_ALARMER=/usr/bin/alarmer +PROG_KPLAYER=/usr/bin/KPlayer +PROG_SPLAYER=/usr/bin/SPlayer + +PROG_WIRELESS_TEST=/usr/bin/wirelessTest +PROG_MCU_OTA=/usr/bin/mcu_ota + +OOM_ADJ=2 +LOG=/tmp/netease.init.log +GOROOT=/usr/share/golang/ + +init_dbus() { + echo "init dbus" >> $LOG +if [ -x /tmp/dbus_env.sh ] +then + DBUS_DAEMON_ON=`ps | grep "dbus-daemon --fork" | grep -v grep | wc -l` + if [ "$DBUS_DAEMON_ON" == "1" ] + then + source /tmp/dbus_env.sh + else + echo "-----------------" >> /mnt/UDISK/reboot.log + date -R >> /mnt/UDISK/reboot.log + reboot -f + fi +else + export $(dbus-launch) + echo "export DBUS_SESSION_BUS_ADDRESS=\"$DBUS_SESSION_BUS_ADDRESS\"" > /tmp/dbus_env.sh + echo "export DBUS_SESSION_BUS_PID=\"$DBUS_SESSION_BUS_PID\"" >> /tmp/dbus_env.sh + chmod +x /tmp/dbus_env.sh +fi + +echo "wzj: DBUS_SESSION_BUS_ADDRESS=\"$DBUS_SESSION_BUS_ADDRESS\"" >> $LOG +} + +start_cc() { + echo "start cc manufacture mode" >> $LOG + echo $DBUS_SESSION_BUS_ADDRESS >> $LOG + procd_open_instance + procd_set_param oom_adj $OOM_ADJ + procd_set_param command $PROG_CC + procd_set_param respawn + procd_append_param limits core=unlimited + procd_set_param env DBUS_SESSION_BUS_ADDRESS=$DBUS_SESSION_BUS_ADDRESS ccmode=manufacture GOROOT=$GOROOT + procd_close_instance + +} + +start_wirelessTest() { + echo "start cc manufacture mode" >> $LOG + echo $DBUS_SESSION_BUS_ADDRESS >> $LOG + procd_open_instance + procd_set_param oom_adj $OOM_ADJ + procd_set_param command $PROG_WIRELESS_TEST + procd_set_param respawn + procd_append_param limits core=unlimited + procd_set_param env DBUS_SESSION_BUS_ADDRESS=$DBUS_SESSION_BUS_ADDRESS ccmode=manufacture GOROOT=$GOROOT + procd_close_instance + +} +start_mcu_ota() { + echo "start cc manufacture mode" >> $LOG + echo $DBUS_SESSION_BUS_ADDRESS >> $LOG + procd_open_instance + procd_set_param oom_adj $OOM_ADJ + procd_set_param command $PROG_MCU_OTA + procd_set_param respawn + procd_append_param limits core=unlimited + procd_set_param env DBUS_SESSION_BUS_ADDRESS=$DBUS_SESSION_BUS_ADDRESS ccmode=manufacture GOROOT=$GOROOT + procd_close_instance + +} + +start_service() { + init_dbus + + start_cc +} diff --git a/app/InitScript/r311-pv1/neteasemanufacture_mcu.init b/app/InitScript/r311-pv1/neteasemanufacture_mcu.init new file mode 100644 index 0000000..9faaf68 --- /dev/null +++ b/app/InitScript/r311-pv1/neteasemanufacture_mcu.init @@ -0,0 +1,89 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2006-2011 OpenWrt.org + +STOP=121 +USE_PROCD=1 + +PROG_VOICE=/bin/netease_voice +PROG_CC=/usr/sbin/netease_control_center +PROG_PLAYER=/usr/bin/ihwplayer +PROG_LE_APP=/usr/bin/app_nevsps_bt +PROG_WIFI_APP=/bin/app_wifi_manager +PROG_OTA=/usr/bin/ota +PROG_ALARMER=/usr/bin/alarmer +PROG_KPLAYER=/usr/bin/KPlayer +PROG_SPLAYER=/usr/bin/SPlayer + +PROG_WIRELESS_TEST=/usr/bin/wirelessTest +PROG_MCU_OTA=/usr/bin/mcu_ota + +OOM_ADJ=2 +LOG=/tmp/netease.init.log +GOROOT=/usr/share/golang/ + +init_dbus() { + echo "init dbus" >> $LOG +if [ -x /tmp/dbus_env.sh ] +then + DBUS_DAEMON_ON=`ps | grep "dbus-daemon --fork" | grep -v grep | wc -l` + if [ "$DBUS_DAEMON_ON" == "1" ] + then + source /tmp/dbus_env.sh + else + echo "-----------------" >> /mnt/UDISK/reboot.log + date -R >> /mnt/UDISK/reboot.log + reboot -f + fi +else + export $(dbus-launch) + echo "export DBUS_SESSION_BUS_ADDRESS=\"$DBUS_SESSION_BUS_ADDRESS\"" > /tmp/dbus_env.sh + echo "export DBUS_SESSION_BUS_PID=\"$DBUS_SESSION_BUS_PID\"" >> /tmp/dbus_env.sh + chmod +x /tmp/dbus_env.sh +fi + +echo "wzj: DBUS_SESSION_BUS_ADDRESS=\"$DBUS_SESSION_BUS_ADDRESS\"" >> $LOG +} + +start_cc() { + echo "start cc manufacture mode" >> $LOG + echo $DBUS_SESSION_BUS_ADDRESS >> $LOG + procd_open_instance + procd_set_param oom_adj $OOM_ADJ + procd_set_param command $PROG_CC + procd_set_param respawn + procd_append_param limits core=unlimited + procd_set_param env DBUS_SESSION_BUS_ADDRESS=$DBUS_SESSION_BUS_ADDRESS ccmode=manufacture GOROOT=$GOROOT + procd_close_instance + +} + +start_wirelessTest() { + echo "start cc manufacture mode" >> $LOG + echo $DBUS_SESSION_BUS_ADDRESS >> $LOG + procd_open_instance + procd_set_param oom_adj $OOM_ADJ + procd_set_param command $PROG_WIRELESS_TEST + procd_set_param respawn + procd_append_param limits core=unlimited + procd_set_param env DBUS_SESSION_BUS_ADDRESS=$DBUS_SESSION_BUS_ADDRESS ccmode=manufacture GOROOT=$GOROOT + procd_close_instance + +} +start_mcu_ota() { + echo "start cc manufacture mode" >> $LOG + echo $DBUS_SESSION_BUS_ADDRESS >> $LOG + procd_open_instance + procd_set_param oom_adj $OOM_ADJ + procd_set_param command $PROG_MCU_OTA + procd_set_param respawn + procd_append_param limits core=unlimited + procd_set_param env DBUS_SESSION_BUS_ADDRESS=$DBUS_SESSION_BUS_ADDRESS ccmode=manufacture GOROOT=$GOROOT + procd_close_instance + +} + +start_service() { + init_dbus + + start_mcu_ota +} diff --git a/app/InitScript/r311-pv1/neteasemanufacture_rf.init b/app/InitScript/r311-pv1/neteasemanufacture_rf.init new file mode 100755 index 0000000..2604d95 --- /dev/null +++ b/app/InitScript/r311-pv1/neteasemanufacture_rf.init @@ -0,0 +1,89 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2006-2011 OpenWrt.org + +STOP=121 +USE_PROCD=1 + +PROG_VOICE=/bin/netease_voice +PROG_CC=/usr/sbin/netease_control_center +PROG_PLAYER=/usr/bin/ihwplayer +PROG_LE_APP=/usr/bin/app_nevsps_bt +PROG_WIFI_APP=/bin/app_wifi_manager +PROG_OTA=/usr/bin/ota +PROG_ALARMER=/usr/bin/alarmer +PROG_KPLAYER=/usr/bin/KPlayer +PROG_SPLAYER=/usr/bin/SPlayer + +PROG_WIRELESS_TEST=/usr/bin/wirelessTest +PROG_MCU_OTA=/usr/bin/mcu_ota + +OOM_ADJ=2 +LOG=/tmp/netease.init.log +GOROOT=/usr/share/golang/ + +init_dbus() { + echo "init dbus" >> $LOG +if [ -x /tmp/dbus_env.sh ] +then + DBUS_DAEMON_ON=`ps | grep "dbus-daemon --fork" | grep -v grep | wc -l` + if [ "$DBUS_DAEMON_ON" == "1" ] + then + source /tmp/dbus_env.sh + else + echo "-----------------" >> /mnt/UDISK/reboot.log + date -R >> /mnt/UDISK/reboot.log + reboot -f + fi +else + export $(dbus-launch) + echo "export DBUS_SESSION_BUS_ADDRESS=\"$DBUS_SESSION_BUS_ADDRESS\"" > /tmp/dbus_env.sh + echo "export DBUS_SESSION_BUS_PID=\"$DBUS_SESSION_BUS_PID\"" >> /tmp/dbus_env.sh + chmod +x /tmp/dbus_env.sh +fi + +echo "wzj: DBUS_SESSION_BUS_ADDRESS=\"$DBUS_SESSION_BUS_ADDRESS\"" >> $LOG +} + +start_cc() { + echo "start cc manufacture mode" >> $LOG + echo $DBUS_SESSION_BUS_ADDRESS >> $LOG + procd_open_instance + procd_set_param oom_adj $OOM_ADJ + procd_set_param command $PROG_CC + procd_set_param respawn + procd_append_param limits core=unlimited + procd_set_param env DBUS_SESSION_BUS_ADDRESS=$DBUS_SESSION_BUS_ADDRESS ccmode=manufacture GOROOT=$GOROOT + procd_close_instance + +} + +start_wirelessTest() { + echo "start cc manufacture mode" >> $LOG + echo $DBUS_SESSION_BUS_ADDRESS >> $LOG + procd_open_instance + procd_set_param oom_adj $OOM_ADJ + procd_set_param command $PROG_WIRELESS_TEST + procd_set_param respawn + procd_append_param limits core=unlimited + procd_set_param env DBUS_SESSION_BUS_ADDRESS=$DBUS_SESSION_BUS_ADDRESS ccmode=manufacture GOROOT=$GOROOT + procd_close_instance + +} +start_mcu_ota() { + echo "start cc manufacture mode" >> $LOG + echo $DBUS_SESSION_BUS_ADDRESS >> $LOG + procd_open_instance + procd_set_param oom_adj $OOM_ADJ + procd_set_param command $PROG_MCU_OTA + procd_set_param respawn + procd_append_param limits core=unlimited + procd_set_param env DBUS_SESSION_BUS_ADDRESS=$DBUS_SESSION_BUS_ADDRESS ccmode=manufacture GOROOT=$GOROOT + procd_close_instance + +} + +start_service() { + init_dbus + + start_wirelessTest +} diff --git a/app/InitScript/r311-pv1/neteaseplayer.init b/app/InitScript/r311-pv1/neteaseplayer.init new file mode 100644 index 0000000..7b9cddf --- /dev/null +++ b/app/InitScript/r311-pv1/neteaseplayer.init @@ -0,0 +1,151 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2006-2011 OpenWrt.org + +START=110 +STOP=110 +USE_PROCD=1 +DEPEND=netease_voice_service,boot + +PROG_VOICE=/bin/netease_voice +PROG_CC=/usr/sbin/netease_control_center +PROG_PLAYER=/usr/bin/ihwplayer +PROG_LE_APP=/usr/bin/app_nevsps +PROG_WIFI_APP=/bin/app_wifi_manager +PROG_OTA=/usr/bin/ota +PROG_ALARMER=/usr/bin/alarmer +PROG_KPLAYER=/usr/bin/KPlayer + +OOM_ADJ=2 +LOG=/tmp/netease.init.log +GOROOT=/usr/share/golang/ + +init_dbus() { + echo "init dbus" >> $LOG +if [ -x /tmp/dbus_env.sh ] +then + DBUS_DAEMON_ON=`ps | grep "dbus-daemon --fork" | grep -v grep | wc -l` + if [ "$DBUS_DAEMON_ON" == "1" ] + then + source /tmp/dbus_env.sh + else + echo "-----------------" >> /mnt/UDISK/reboot.log + date -R >> /mnt/UDISK/reboot.log + reboot -f + fi +else + export $(dbus-launch) + echo "export DBUS_SESSION_BUS_ADDRESS=\"$DBUS_SESSION_BUS_ADDRESS\"" > /tmp/dbus_env.sh + echo "export DBUS_SESSION_BUS_PID=\"$DBUS_SESSION_BUS_PID\"" >> /tmp/dbus_env.sh + chmod +x /tmp/dbus_env.sh +fi + +echo "wzj: DBUS_SESSION_BUS_ADDRESS=\"$DBUS_SESSION_BUS_ADDRESS\"" >> $LOG +} + +enable_soundcard() { + echo "set r311 audio pass through" + amixer cset numid=20 1 + amixer cset numid=46 1 + amixer cset numid=50 1 + echo 4 > /sys/netease/cpld_control/cpld_init + adau1761 2 0 + adau1761 0 8 +} + +start_voice() { + echo "start voice" >> $LOG + echo $DBUS_SESSION_BUS_ADDRESS >> $LOG + procd_open_instance + procd_set_param oom_adj $OOM_ADJ + procd_set_param command $PROG_VOICE -D >> /tmp/voicelog 2>&1 + procd_set_param respawn + procd_append_param limits core=unlimited + procd_set_param env DBUS_SESSION_BUS_ADDRESS=$DBUS_SESSION_BUS_ADDRESS + procd_close_instance +} + +start_cc() { + echo "start cc" >> $LOG + echo $DBUS_SESSION_BUS_ADDRESS >> $LOG + procd_open_instance + procd_set_param oom_adj $OOM_ADJ + procd_set_param command $PROG_CC + procd_set_param respawn + procd_append_param limits core=unlimited + procd_set_param env DBUS_SESSION_BUS_ADDRESS=$DBUS_SESSION_BUS_ADDRESS + procd_close_instance + +} + +start_player() { + echo "start player" >> $LOG + echo $DBUS_SESSION_BUS_ADDRESS >> $LOG + procd_open_instance + procd_set_param oom_adj $OOM_ADJ + procd_set_param command $PROG_PLAYER -D + procd_set_param respawn + procd_append_param limits core=unlimited + procd_set_param env DBUS_SESSION_BUS_ADDRESS=$DBUS_SESSION_BUS_ADDRESS GOROOT=$GOROOT + procd_close_instance +} + +start_wifi() { + echo "start wifi" >> $LOG + procd_open_instance + procd_set_param oom_adj $OOM_ADJ + procd_set_param command $PROG_WIFI_APP -D >> /tmp/wifilog + procd_set_param respawn + procd_append_param limits core=unlimited + procd_set_param env DBUS_SESSION_BUS_ADDRESS=$DBUS_SESSION_BUS_ADDRESS GOROOT=$GOROOT + procd_close_instance +} + +start_ble() { + echo "start ble" >> $LOG + procd_open_instance + procd_set_param oom_adj $OOM_ADJ + procd_set_param command $PROG_LE_APP -D >> /tmp/blelog + procd_set_param respawn + procd_append_param limits core=unlimited + procd_set_param env DBUS_SESSION_BUS_ADDRESS=$DBUS_SESSION_BUS_ADDRESS GOROOT=$GOROOT + procd_close_instance +} + +start_ota() { + echo "start ota" >> $LOG + procd_open_instance + procd_set_param oom_adj $OOM_ADJ + procd_set_param command $PROG_OTA -D >> /tmp/otalog + procd_set_param respawn + procd_append_param limits core=unlimited + procd_set_param env DBUS_SESSION_BUS_ADDRESS=$DBUS_SESSION_BUS_ADDRESS GOROOT=$GOROOT + procd_close_instance +} + +start_alarmer() { + echo "start ota" >> $LOG + procd_open_instance + procd_set_param oom_adj $OOM_ADJ + procd_set_param command $PROG_ALARMER -D >> /tmp/otalog + procd_set_param respawn + procd_append_param limits core=unlimited + procd_set_param env DBUS_SESSION_BUS_ADDRESS=$DBUS_SESSION_BUS_ADDRESS GOROOT=$GOROOT + procd_close_instance +} + +start_dlna() { + echo "start dlna" >> $LOG + procd_open_instance + procd_set_param oom_adj $OOM_ADJ + procd_set_param command $PROG_KPLAYER -D >> /tmp/dlnalog + procd_set_param respawn + procd_append_param limits core=unlimited + procd_set_param env DBUS_SESSION_BUS_ADDRESS=$DBUS_SESSION_BUS_ADDRESS GOROOT=$GOROOT + procd_close_instance +} + +start_service() { + enable_soundcard + init_dbus + start_player +} diff --git a/app/InitScript/r311-pv1/neteasevoice.init b/app/InitScript/r311-pv1/neteasevoice.init new file mode 100644 index 0000000..7b9a0e5 --- /dev/null +++ b/app/InitScript/r311-pv1/neteasevoice.init @@ -0,0 +1,60 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2006-2011 OpenWrt.org + +START=109 +STOP=109 +USE_PROCD=1 +DEPEND=boot + +PROG_VOICE=/bin/netease_voice +PROG_CC=/usr/sbin/netease_control_center +PROG_PLAYER=/usr/bin/ihwplayer +PROG_LE_APP=/usr/bin/app_nevsps +PROG_WIFI_APP=/bin/app_wifi_manager +PROG_OTA=/usr/bin/ota +PROG_ALARMER=/usr/bin/alarmer +PROG_KPLAYER=/usr/bin/KPlayer + +OOM_ADJ=2 +LOG=/tmp/netease.init.log +GOROOT=/usr/share/golang/ + +init_dbus() { + echo "init dbus" >> $LOG +if [ -x /tmp/dbus_env.sh ] +then + DBUS_DAEMON_ON=`ps | grep "dbus-daemon --fork" | grep -v grep | wc -l` + if [ "$DBUS_DAEMON_ON" == "1" ] + then + source /tmp/dbus_env.sh + else + echo "-----------------" >> /mnt/UDISK/reboot.log + date -R >> /mnt/UDISK/reboot.log + reboot -f + fi +else + export $(dbus-launch) + echo "export DBUS_SESSION_BUS_ADDRESS=\"$DBUS_SESSION_BUS_ADDRESS\"" > /tmp/dbus_env.sh + echo "export DBUS_SESSION_BUS_PID=\"$DBUS_SESSION_BUS_PID\"" >> /tmp/dbus_env.sh + chmod +x /tmp/dbus_env.sh +fi + +echo "netease_voice: DBUS_SESSION_BUS_ADDRESS=\"$DBUS_SESSION_BUS_ADDRESS\"" >> $LOG +} + +start_voice() { + echo "start voice" >> $LOG + echo $DBUS_SESSION_BUS_ADDRESS >> $LOG + procd_open_instance + procd_set_param oom_adj $OOM_ADJ + procd_set_param command $PROG_VOICE -D >> /tmp/voicelog 2>&1 + procd_set_param respawn + procd_append_param limits core=unlimited + procd_set_param env DBUS_SESSION_BUS_ADDRESS=$DBUS_SESSION_BUS_ADDRESS --work-mode=0 + procd_close_instance +} + +start_service() { + init_dbus + start_voice +} diff --git a/app/InitScript/r311-pv1/neteasewifi.init b/app/InitScript/r311-pv1/neteasewifi.init new file mode 100755 index 0000000..ea9f359 --- /dev/null +++ b/app/InitScript/r311-pv1/neteasewifi.init @@ -0,0 +1,58 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2006-2011 OpenWrt.org + +START=110 +STOP=110 +USE_PROCD=1 +DEPEND=boot + +PROG_VOICE=/bin/netease_voice +PROG_CC=/usr/sbin/netease_control_center +PROG_PLAYER=/usr/bin/ihwplayer +PROG_LE_APP=/usr/bin/app_nevsps +PROG_WIFI_APP=/bin/app_wifi_manager +PROG_OTA=/usr/bin/ota +PROG_ALARMER=/usr/bin/alarmer + +OOM_ADJ=2 +LOG=/tmp/netease.init.log +GOROOT=/usr/share/golang/ + +init_dbus() { + echo "init dbus" >> $LOG +if [ -x /tmp/dbus_env.sh ] +then + DBUS_DAEMON_ON=`ps | grep "dbus-daemon --fork" | grep -v grep | wc -l` + if [ "$DBUS_DAEMON_ON" == "1" ] + then + source /tmp/dbus_env.sh + else + echo "-----------------" >> /mnt/UDISK/reboot.log + date -R >> /mnt/UDISK/reboot.log + reboot -f + fi +else + export $(dbus-launch) + echo "export DBUS_SESSION_BUS_ADDRESS=\"$DBUS_SESSION_BUS_ADDRESS\"" > /tmp/dbus_env.sh + echo "export DBUS_SESSION_BUS_PID=\"$DBUS_SESSION_BUS_PID\"" >> /tmp/dbus_env.sh + chmod +x /tmp/dbus_env.sh +fi + +echo "wifi_service: DBUS_SESSION_BUS_ADDRESS=\"$DBUS_SESSION_BUS_ADDRESS\"" >> $LOG +} + +start_wifi() { + echo "start wifi" >> $LOG + procd_open_instance + procd_set_param oom_adj $OOM_ADJ + procd_set_param command $PROG_WIFI_APP -D >> /tmp/wifilog + procd_set_param respawn + procd_append_param limits core=unlimited + procd_set_param env DBUS_SESSION_BUS_ADDRESS=$DBUS_SESSION_BUS_ADDRESS GOROOT=$GOROOT + procd_close_instance +} + +start_service() { + init_dbus + start_wifi +} diff --git a/app/netease_control_center_common_module/Makefile b/app/netease_control_center_common_module/Makefile index 45e3fac..0bdb84f 100755 --- a/app/netease_control_center_common_module/Makefile +++ b/app/netease_control_center_common_module/Makefile @@ -1,31 +1,14 @@ include $(TOPDIR)/rules.mk +include $(TINA_BUILD_TOP)/package/netease/submodules/Makefile.common.submodule -PKG_NAME:=submodule_netease_control_center +PKG_NAME:=netease_control_center PKG_RELEASE:=2 PKG_VERSION:=0.0.2 -COMMIT_HASH:=$(shell git rev-parse HEAD 2>/dev/null) -BUILD_DATE:=$(shell TZ='Asia/Shanghai' date '+%Y-%m-%d_%H:%M:%S') -GIT_TAG:=$(shell git describe --tags `git rev-list --tags --max-count=1`) PKG_BUILD_DIR := $(COMPILE_DIR)/$(PKG_NAME) -HARDWARE_VERSION:=DVT - include $(BUILD_DIR)/package.mk -ifeq ('$(CONFIG_BOARD_HARDWARE_VERSION_DVT)', 'y') - HARDWARE_VERSION=DVT -else - -ifeq ('$(CONFIG_BOARD_HARDWARE_VERSION_EVT)', 'y') - HARDWARE_VERSION=EVT -else - HARDWARE_VERSION=NA -endif - -endif - - define Package/$(PKG_NAME) SECTION:=utils CATEGORY:=Netease @@ -59,7 +42,7 @@ define Build/Compile CXX="$(TARGET_CXX)" \ CGO_CFLAGS="$(TARGET_CFLAGS) -I$(CONFIG_TOOLCHAIN_ROOT)/include -I$(STAGING_DIR)/usr/include -I$(STAGING_DIR)/include" \ CGO_LDFLAGS="$(TARGET_LDFLAGS)" \ - GOPATH=$(PKG_BUILD_DIR) GOOS=linux GOARCH=arm CGO_ENABLED=1 go build -tags "netcgo json1" \ + GOPATH=$(PKG_BUILD_DIR) GOOS=linux GOARCH=arm CGO_ENABLED=1 go build --tags "netcgo sqlite_json sqlite_trace" \ -ldflags "-X \"main.Hv=$(HARDWARE_VERSION)\" -X \"main.BuildVersion=$(COMMIT_HASH)\" -X \"main.BuildDate=$(BUILD_DATE)\" -X \"main.Tag=$(GIT_TAG)\"" cd $(PKG_BUILD_DIR)/src/$(PKG_NAME)/modules/hardware/mcu_leds && \ @@ -85,19 +68,10 @@ define Package/$(PKG_NAME)/install $(INSTALL_DIR) $(1)/usr/share/golang $(INSTALL_DIR) $(1)/usr/share/golang/mcu $(INSTALL_DIR) $(1)/etc/ssl/certs + $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/$(PKG_NAME)/$(PKG_NAME) $(1)/usr/sbin/ - $(INSTALL_BIN) ./backuplocalfiles.sh $(1)/usr/sbin/ - $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/$(PKG_NAME)/modules/hardware/mcu_leds/mcu_ota $(TOPDIR)/prebuilt/r16/ +# $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/$(PKG_NAME)/modules/hardware/mcu_leds/mcu_ota $(TOPDIR)/prebuilt/r16/ $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/$(PKG_NAME)/nembd/evdev/bin/netease_keytest $(1)/usr/sbin/ - $(INSTALL_BIN) ./netease.init $(1)/etc/init.d/netease_services - $(INSTALL_BIN) ./neteasewifi.init $(1)/etc/init.d/netease_wifi_service - $(INSTALL_BIN) ./neteasevoice.init $(1)/etc/init.d/netease_voice_service - $(INSTALL_BIN) ./neteaseplayer.init $(1)/etc/init.d/netease_player_service - $(INSTALL_BIN) ./neteasemanufacture_cc.init $(1)/etc/init.d/netease_cc_manufacture_service - $(INSTALL_BIN) ./neteasemanufacture_mcu.init $(1)/etc/init.d/netease_mcu_manufacture_service - $(INSTALL_BIN) ./neteasemanufacture_rf.init $(1)/etc/init.d/netease_rf_manufacture_service - $(INSTALL_BIN) ./neteasecc.init $(1)/etc/init.d/netease_cc_service - $(INSTALL_BIN) ./neteasebt.init $(1)/etc/init.d/netease_bt_service $(INSTALL_DATA) mcu/* $(1)/usr/share/golang/mcu/ $(INSTALL_DATA) vol_adc.config $(1)/usr/share/golang/ # $(INSTALL_DATA) ./ca-certificates.crt $(1)/etc/ssl/certs/ diff --git a/app/netease_control_center_common_module/src/netease_control_center/globals/platformConfig.go b/app/netease_control_center_common_module/src/netease_control_center/globals/platformConfig.go new file mode 100644 index 0000000..b9a764a --- /dev/null +++ b/app/netease_control_center_common_module/src/netease_control_center/globals/platformConfig.go @@ -0,0 +1,30 @@ +package globals + +type PlatformConfig struct { + MicAdc bool +} +var ( + platformConfigs = map[string]PlatformConfig{ + "default": PlatformConfig{MicAdc:false}, + "EVT":PlatformConfig{MicAdc:true}, + "r311-pv1":PlatformConfig{MicAdc:false}, + } + curPlatformConfig *PlatformConfig +) + +func GetCurPlatformConfig() PlatformConfig { + if curPlatformConfig != nil { + return *curPlatformConfig + } + + if Hv == nil { + return platformConfigs["default"] + } + + if tmp,ok := platformConfigs[*Hv]; ok { + curPlatformConfig = &tmp + return tmp + } else { + return platformConfigs["default"] + } +} \ No newline at end of file diff --git a/app/netease_control_center_common_module/src/netease_control_center/interfaces/eventPoint/ep.go b/app/netease_control_center_common_module/src/netease_control_center/interfaces/eventPoint/ep.go index 1aadee0..e10640c 100755 --- a/app/netease_control_center_common_module/src/netease_control_center/interfaces/eventPoint/ep.go +++ b/app/netease_control_center_common_module/src/netease_control_center/interfaces/eventPoint/ep.go @@ -51,7 +51,7 @@ func EpRecord(eventId string, args map[string]interface{}) { log.Println(log.ErrorLog, err) } }() - + return var tmp EventPoint tmp.Base = http.Reqbase args["event"] = eventId diff --git a/app/netease_control_center_common_module/src/netease_control_center/interfaces/vui/cvui/vuifiles.go b/app/netease_control_center_common_module/src/netease_control_center/interfaces/vui/cvui/vuifiles.go index 174d080..f739361 100644 --- a/app/netease_control_center_common_module/src/netease_control_center/interfaces/vui/cvui/vuifiles.go +++ b/app/netease_control_center_common_module/src/netease_control_center/interfaces/vui/cvui/vuifiles.go @@ -19,12 +19,15 @@ import ( ) func Init() { + return log.Println(log.DebugLog, "Begin init skin!") C.SkinInit() log.Println(log.DebugLog, "Init skin end!") } func GetSkinRes(key string) (path string) { + return + jump := time.Now() defer func() { log.Println(log.DebugLog, "Get skin key:", key, " val:", path, " coast time:", time.Now().Sub(jump)) @@ -45,6 +48,8 @@ func GetSkinRes(key string) (path string) { } func UpdateRes(jsonStr string) { + return + cjsonstring := C.CString(jsonStr) if uintptr(unsafe.Pointer(cjsonstring)) != uintptr(0) { log.Println(log.DebugLog, "Begin update res!") @@ -54,6 +59,8 @@ func UpdateRes(jsonStr string) { } func UpdateResFromServer() { + return + log.Println(log.DebugLog, "Begin to update res from server!") var req http.HttpReqHotfix var rsp http.HttpRspHotfix diff --git a/app/netease_control_center_common_module/src/netease_control_center/modules/hardware/misc/voladc.go b/app/netease_control_center_common_module/src/netease_control_center/modules/hardware/misc/voladc.go index 244c336..6718528 100755 --- a/app/netease_control_center_common_module/src/netease_control_center/modules/hardware/misc/voladc.go +++ b/app/netease_control_center_common_module/src/netease_control_center/modules/hardware/misc/voladc.go @@ -9,6 +9,7 @@ import ( "os" "sync/atomic" "time" + "netease_control_center/globals" ) var ( @@ -86,30 +87,35 @@ func adauMute(isMute bool) { func VolTrigeMicAdc() { adauMute(false) vol, _ := adau1761.GetVol() - if (lasttrigvol >= -1 && lasttrigvol <= 12 && vol <= 12) || (lasttrigvol == vol) { - lasttrigvol = vol - return - } else { - lasttrigvol = vol - } - if v, ok := voladcMap[vol]; ok { - log.Println(log.ErrorLog, "Write vol:", vol, v) - v.Write2Adc() - } else { - log.Println(log.ErrorLog, "Can not find vol adc regs:", vol) + if globals.GetCurPlatformConfig().MicAdc == true { + if (lasttrigvol >= -1 && lasttrigvol <= 12 && vol <= 12) || (lasttrigvol == vol) { + lasttrigvol = vol + return + } else { + lasttrigvol = vol + } + if v, ok := voladcMap[vol]; ok { + log.Println(log.ErrorLog, "Write vol:", vol, v) + v.Write2Adc() + } else { + log.Println(log.ErrorLog, "Can not find vol adc regs:", vol) + } } } func IdleMicAdc() { adauMute(true) - if lasttrigvol >= -1 && lasttrigvol <= 12 { - return - } else { - lasttrigvol = -1 + + if globals.GetCurPlatformConfig().MicAdc == true { + if lasttrigvol >= -1 && lasttrigvol <= 12 { + return + } else { + lasttrigvol = -1 + } + + adcval := AdcChanel{Adc0: []AdcReg{AdcReg{Addr: 0xbc, Val: 0x38}, AdcReg{Addr: 0xbd, Val: 0x38}, AdcReg{Addr: 0xbe, Val: 0x38}, AdcReg{Addr: 0xbf, Val: 0x38}}, + Adc1: []AdcReg{AdcReg{Addr: 0xbc, Val: 0x38}, AdcReg{Addr: 0xbd, Val: 0x38}, AdcReg{Addr: 0xbe, Val: 0x38}, AdcReg{Addr: 0xbf, Val: 0x38}}} + + adcval.Write2Adc() } - - adcval := AdcChanel{Adc0: []AdcReg{AdcReg{Addr: 0xbc, Val: 0x38}, AdcReg{Addr: 0xbd, Val: 0x38}, AdcReg{Addr: 0xbe, Val: 0x38}, AdcReg{Addr: 0xbf, Val: 0x38}}, - Adc1: []AdcReg{AdcReg{Addr: 0xbc, Val: 0x38}, AdcReg{Addr: 0xbd, Val: 0x38}, AdcReg{Addr: 0xbe, Val: 0x38}, AdcReg{Addr: 0xbf, Val: 0x38}}} - - adcval.Write2Adc() } diff --git a/app/netease_control_center_common_module/src/netease_control_center/modules/storage/sqlite3.go b/app/netease_control_center_common_module/src/netease_control_center/modules/storage/sqlite3.go index 675debf..ddc3ee7 100644 --- a/app/netease_control_center_common_module/src/netease_control_center/modules/storage/sqlite3.go +++ b/app/netease_control_center_common_module/src/netease_control_center/modules/storage/sqlite3.go @@ -12,7 +12,7 @@ import ( ) const ( - DB_PATH = "/mnt/UDISK/golangsql.db" + DB_PATH = "file:/mnt/UDISK/golangsql.db?cache=shared&mode=memory" SQLTABLENAME_CONFIG = "config" SQLFMT_CREATE_CONFIG = `CREATE TABLE IF NOT EXISTS ` + SQLTABLENAME_CONFIG + ` ( "id" INTEGER PRIMARY KEY AUTOINCREMENT, @@ -55,11 +55,12 @@ func sqlInit() error { if initDriver == false { dumpUdisk() log.Println(log.DebugLog, "Begin to init sql") - db, err = sql.Open("sqlite3", DB_PATH) + db, err = sql.Open("sqlite3",DB_PATH) if err != nil { log.Println(log.ErrorLog, "db open fail", err) return err } else { + db.SetMaxOpenConns(1) log.Println(log.DebugLog, "Init sqlite success!") initDriver = true } @@ -68,7 +69,7 @@ func sqlInit() error { if initTable == false { rst, err := db.Exec(SQLFMT_CREATE_CONFIG) if err != nil { - fmt.Println("Create table err", err) + log.Println(log.ErrorLog, "Create table err ", SQLFMT_CREATE_CONFIG, err) return err } //fmt.Println(SQLFMT_CREATE_CONFIG) diff --git a/app/netease_control_center_common_module/src/netease_control_center/nembd/controller/adau1761/adau1761.go b/app/netease_control_center_common_module/src/netease_control_center/nembd/controller/adau1761/adau1761.go index 1aa7494..126fe19 100755 --- a/app/netease_control_center_common_module/src/netease_control_center/nembd/controller/adau1761/adau1761.go +++ b/app/netease_control_center_common_module/src/netease_control_center/nembd/controller/adau1761/adau1761.go @@ -133,6 +133,7 @@ func DecVol(step int) (int, error) { } func setEq(eq int) (err error) { + return fd, err := os.Open(devpath) if err != nil { return err diff --git a/app/netease_voice_common_module/Makefile b/app/netease_voice_common_module/Makefile index 2486a2a..3580ce7 100644 --- a/app/netease_voice_common_module/Makefile +++ b/app/netease_voice_common_module/Makefile @@ -1,7 +1,7 @@ include $(TOPDIR)/rules.mk include $(TINA_BUILD_TOP)/package/netease/Makefile.common -PKG_NAME:=submodule_netease_voice +PKG_NAME:=netease_voice PKG_RELEASE:=1 PKG_VERSION:=0.0.1 @@ -19,7 +19,7 @@ $(info CONFIG_USED_DC_SDK=$(CONFIG_USED_DC_SDK)) define Package/$(PKG_NAME) SECTION:=utils CATEGORY:=Netease - TITLE:=Netease voice main program + TITLE:=Netease voice main program in submodule MAINTAINER:=Wang zijiao DEPENDS:= +libduilite +libjansson +libspeex +alsa-lib +libuws +libjson-c +libyunxin +libcutils $(MAKE_COMMON_DEPEND)