Revert "[Feature][T106_eSDK]update from T106-V2.01.01.02P56U06.AP.15.11_CAP.15.11.01 to T106-V2.01.01.02P56U06.AP.16.08_CAP.16.08.01 -- code"

This reverts commit 39d99118f249054d01992819702e0612dfdfe3b9.

Reason for revert:revert 16.08_patch

Change-Id: Ib9848be6d113db9be3378524981a30d0c3a0c1a5
diff --git a/esdk/layers/meta-zxic-custom/conf/distro/vehicle_dc_ref.conf b/esdk/layers/meta-zxic-custom/conf/distro/vehicle_dc_ref.conf
index a6e5075..55ad19c 100755
--- a/esdk/layers/meta-zxic-custom/conf/distro/vehicle_dc_ref.conf
+++ b/esdk/layers/meta-zxic-custom/conf/distro/vehicle_dc_ref.conf
@@ -85,7 +85,7 @@
 #DISTRO_FEATURES += "MMI_LCD"
 #语音控制
 DISTRO_FEATURES += "voice_alsa"
-DISTRO_FEATURES += "use_voice_buffer"
+#DISTRO_FEATURES += "use_voice_buffer"
 
 #cap_oem.img
 DISTRO_FEATURES += " oemfs "
@@ -140,7 +140,6 @@
 CUSTOM_MACRO += "${@bb.utils.contains('DISTRO_FEATURES', 'use_voice_buffer', '-D_USE_VOICE_BUFFER', '', d)}"
 #CONFIG_VB_TRANSMIT_INTF = "RTP"
 #CONFIG_VB_TRANSMIT_INTF = "USB"
-CONFIG_VB_TRANSMIT_INTF = "NULL"
 CUSTOM_MACRO += "${@bb.utils.contains('CONFIG_VB_TRANSMIT_INTF', 'RTP', '-D_VB_TRANSMIT_INTF_RTP', '', d)}"
 CUSTOM_MACRO += "${@bb.utils.contains('CONFIG_VB_TRANSMIT_INTF', 'USB', '-D_VB_TRANSMIT_INTF_USB', '', d)}"
 #wifi 配置
@@ -154,8 +153,6 @@
 CONFIG_TEL_API_SUPPORT = "RIL"
 
 CUSTOM_MACRO  		+= "${@bb.utils.contains('CONFIG_TEL_API_SUPPORT', 'BL', '-D_USE_BL', '', d)}"
-
-#RIL AT通道支持RPMSG模式
 CUSTOM_MACRO  		+= "${@bb.utils.contains('CONFIG_TEL_API_SUPPORT', 'RIL', '-DZXIC_ATCHN_RPMSG_MODE', '', d)}"
 CUSTOM_MACRO  		+= "${@bb.utils.contains('CONFIG_TEL_API_SUPPORT', 'RIL', '-DUSE_CUSTOM_YK', '', d)}"
 
@@ -457,11 +454,11 @@
 MOBILETEK_ADB_LOGIN = "NO"
 
 #cz.li@20240221 add for MOBILETEK_GNSS_UPDATE_ENABLE value: "yes","no"
-MOBILETEK_GNSS_UPDATE_ENABLE = "yes"
+MOBILETEK_GNSS_UPDATE_ENABLE = "no"
 
 #xf.li@20240716 add for MOBILETEK_LOG_ENCRYPT value: "enable","disable"
 MOBILETEK_LOG_ENCRYPT = "disable"
 
 LYNQ_CONFIG_COMMITID = "e2a3410390ff0ad762462ccb6af8faa5e16dcd61"
-LYNQ_CONFIG_VERSION = "T106-V2.01.01.02P56U06.AP.16.08_CAP.16.08"
-LYNQ_CONFIG_SW_VERSION = "T106-V2.01.01.02P56U06.AP.16.08_CAP.16.08.01"
+LYNQ_CONFIG_VERSION = "T106-V2.01.01.02P56U06.AP.15.11_CAP.15.11"
+LYNQ_CONFIG_SW_VERSION = "T106-V2.01.01.02P56U06.AP.15.11_CAP.15.11.01"
diff --git a/esdk/layers/meta-zxic-custom/conf/lynq_base.conf b/esdk/layers/meta-zxic-custom/conf/lynq_base.conf
index 1089da7..be8f374 100755
--- a/esdk/layers/meta-zxic-custom/conf/lynq_base.conf
+++ b/esdk/layers/meta-zxic-custom/conf/lynq_base.conf
@@ -67,6 +67,6 @@
 #OEMAPP_CFG value:"PLATFORM","GSW"
 MOBILETEK_OEMAPP_CFG = "PLATFORM"
 
-LYNQ_CONFIG_COMMITID = "179d1bff319d3731925c0eb4f425f156604a0a62"
-LYNQ_CONFIG_VERSION = "T106-V2.01.01.02P56U06.AP.16.08_CAP.16.08"
-LYNQ_CONFIG_SW_VERSION = "T106-V2.01.01.02P56U06.AP.16.08_CAP.16.08.01"
+LYNQ_CONFIG_COMMITID = "7495f7cb5c99259bdcbb21cdf89b9e0324ac444b"
+LYNQ_CONFIG_VERSION = "T106-V2.01.01.02P56U06.AP.15.11_CAP.15.11"
+LYNQ_CONFIG_SW_VERSION = "T106-V2.01.01.02P56U06.AP.15.11_CAP.15.11.01"
diff --git a/esdk/layers/meta-zxic-custom/recipes-core/images/files/zx297520v3/vehicle_dc/fs/normal/rootfs/etc_ro/default/default_parameter_sys b/esdk/layers/meta-zxic-custom/recipes-core/images/files/zx297520v3/vehicle_dc/fs/normal/rootfs/etc_ro/default/default_parameter_sys
index eade5dc..636cedd 100755
--- a/esdk/layers/meta-zxic-custom/recipes-core/images/files/zx297520v3/vehicle_dc/fs/normal/rootfs/etc_ro/default/default_parameter_sys
+++ b/esdk/layers/meta-zxic-custom/recipes-core/images/files/zx297520v3/vehicle_dc/fs/normal/rootfs/etc_ro/default/default_parameter_sys
@@ -439,6 +439,7 @@
 NGECALL_FORTEST=0
 CUSTOMER_FLAG=0
 #for volte end
+DEBUG_INFO_DISABLE=0
 DEBUG_INFO_FILE_PATH=/mnt/userdata
 DEBUG_INFO_FILE_NUM=2
 DEBUG_INFO_FILE_TOTAL_SIZE=1
diff --git a/esdk/layers/meta-zxic-custom/recipes-core/images/files/zx297520v3/vehicle_dc/fs/normal/rootfs/etc_ro/default/default_parameter_user b/esdk/layers/meta-zxic-custom/recipes-core/images/files/zx297520v3/vehicle_dc/fs/normal/rootfs/etc_ro/default/default_parameter_user
index 32508c8..7839262 100755
--- a/esdk/layers/meta-zxic-custom/recipes-core/images/files/zx297520v3/vehicle_dc/fs/normal/rootfs/etc_ro/default/default_parameter_user
+++ b/esdk/layers/meta-zxic-custom/recipes-core/images/files/zx297520v3/vehicle_dc/fs/normal/rootfs/etc_ro/default/default_parameter_user
@@ -78,10 +78,6 @@
 br_ipchange_flag=
 br_node=usblan0+zvnet0
 br_node_cap=zvnet0
-br_node_num=
-br_node0=
-br_node1=
-br_node2=
 clat_fake_subnet=192.0.168.0
 clat_frag_collect_timeout=300
 clat_local_mapping_timeout=300
@@ -494,7 +490,7 @@
 gw_in_cap=0
 #yes-on  no-off
 cc_at_debug=no
-xlat_enable=1
+xlat_enable=0
 ecallmode=2
 telog_path_cap=
 telog_path=
diff --git a/esdk/layers/meta-zxic-custom/recipes-core/images/files/zx297520v3/vehicle_dc_4Gb/fs/normal/rootfs/etc_ro/default/default_parameter_sys b/esdk/layers/meta-zxic-custom/recipes-core/images/files/zx297520v3/vehicle_dc_4Gb/fs/normal/rootfs/etc_ro/default/default_parameter_sys
index 014d309..57c1ad7 100755
--- a/esdk/layers/meta-zxic-custom/recipes-core/images/files/zx297520v3/vehicle_dc_4Gb/fs/normal/rootfs/etc_ro/default/default_parameter_sys
+++ b/esdk/layers/meta-zxic-custom/recipes-core/images/files/zx297520v3/vehicle_dc_4Gb/fs/normal/rootfs/etc_ro/default/default_parameter_sys
@@ -439,6 +439,7 @@
 NGECALL_FORTEST=0
 CUSTOMER_FLAG=0
 #for volte end
+DEBUG_INFO_DISABLE=0
 DEBUG_INFO_FILE_PATH=/mnt/userdata
 DEBUG_INFO_FILE_NUM=2
 DEBUG_INFO_FILE_TOTAL_SIZE=1
diff --git a/esdk/layers/meta-zxic-custom/recipes-core/images/files/zx297520v3/vehicle_dc_4Gb/fs/normal/rootfs/etc_ro/default/default_parameter_user b/esdk/layers/meta-zxic-custom/recipes-core/images/files/zx297520v3/vehicle_dc_4Gb/fs/normal/rootfs/etc_ro/default/default_parameter_user
index 8dc2533..dc03706 100755
--- a/esdk/layers/meta-zxic-custom/recipes-core/images/files/zx297520v3/vehicle_dc_4Gb/fs/normal/rootfs/etc_ro/default/default_parameter_user
+++ b/esdk/layers/meta-zxic-custom/recipes-core/images/files/zx297520v3/vehicle_dc_4Gb/fs/normal/rootfs/etc_ro/default/default_parameter_user
@@ -78,10 +78,6 @@
 br_ipchange_flag=
 br_node=usblan0+zvnet0
 br_node_cap=zvnet0
-br_node_num=
-br_node0=
-br_node1=
-br_node2=
 clat_fake_subnet=192.0.168.0
 clat_frag_collect_timeout=300
 clat_local_mapping_timeout=300
@@ -494,6 +490,6 @@
 gw_in_cap=0
 #yes-on  no-off
 cc_at_debug=no
-xlat_enable=1
+xlat_enable=0
 telog_path_cap=
 telog_path=
diff --git a/esdk/layers/meta-zxic-custom/recipes-core/images/files/zx297520v3/vehicle_dc_ref/fs/normal/rootfs/etc/init.d/rcS b/esdk/layers/meta-zxic-custom/recipes-core/images/files/zx297520v3/vehicle_dc_ref/fs/normal/rootfs/etc/init.d/rcS
index 0cb2386..e7959fe 100755
--- a/esdk/layers/meta-zxic-custom/recipes-core/images/files/zx297520v3/vehicle_dc_ref/fs/normal/rootfs/etc/init.d/rcS
+++ b/esdk/layers/meta-zxic-custom/recipes-core/images/files/zx297520v3/vehicle_dc_ref/fs/normal/rootfs/etc/init.d/rcS
@@ -35,6 +35,5 @@
 
 .  /etc/rc.local
 
-sh /etc/lynq_monitor.sh &
 exit 0
 
diff --git a/esdk/layers/meta-zxic-custom/recipes-core/images/files/zx297520v3/vehicle_dc_ref/fs/normal/rootfs/etc/init.d/zcatlog_config.sh b/esdk/layers/meta-zxic-custom/recipes-core/images/files/zx297520v3/vehicle_dc_ref/fs/normal/rootfs/etc/init.d/zcatlog_config.sh
index 0d099dd..5c6648f 100755
--- a/esdk/layers/meta-zxic-custom/recipes-core/images/files/zx297520v3/vehicle_dc_ref/fs/normal/rootfs/etc/init.d/zcatlog_config.sh
+++ b/esdk/layers/meta-zxic-custom/recipes-core/images/files/zx297520v3/vehicle_dc_ref/fs/normal/rootfs/etc/init.d/zcatlog_config.sh
@@ -1,31 +1,5 @@
 #!/bin/sh
 
-#jb.qi add for uci check start
-check_copy_file() {
-	if [ $# -ne 2 ];then
-		return
-	fi
-	
-	diff $1 $2 > /dev/null
-	if [ $? -ne 0 ]; then
-		echo "cp $1 $2" > /dev/kmsg
-		cp $1 $2
-	fi
-}
-
-check_uci()
-{
-    uci get lynq_uci.lynq_ril > /dev/null
-    if [ $? -ne 0 ]; then
-        echo "$TAG: lynq_uci config cant get" > /dev/kmsg
-        cp /etc/config/lynq_uci /mnt/userdata/config/lynq_uci
-    fi
-}
-mkdir /mnt/userdata/config
-check_uci
-check_copy_file /etc/config/lynq_uci_ro /mnt/userdata/config/lynq_uci_ro
-
-#jb.qi add for uci check end
 ramdump_mode=`nv get ramdump_mode`
 
 if [ -e /proc/sys/ramdump_ap/ramdump_start_addr ]; then
diff --git a/esdk/layers/meta-zxic-custom/recipes-core/images/files/zx297520v3/vehicle_dc_ref/fs/normal/rootfs/etc/lynq_monitor.sh b/esdk/layers/meta-zxic-custom/recipes-core/images/files/zx297520v3/vehicle_dc_ref/fs/normal/rootfs/etc/lynq_monitor.sh
deleted file mode 100755
index 72e61c7..0000000
--- a/esdk/layers/meta-zxic-custom/recipes-core/images/files/zx297520v3/vehicle_dc_ref/fs/normal/rootfs/etc/lynq_monitor.sh
+++ /dev/null
@@ -1,60 +0,0 @@
-#!/bin/sh
-while true
-do
-    sleep 30
-    ps -ef|grep lynq-sdk-ready |grep -v "grep" > /dev/null
-    if [ $? -ne 0 ]; then
-        echo "lynq-sdk-ready no exist" > /dev/kmsg
-        sh /etc/init.d/lynq-sdk-ready.sh start
-    else
-        ps -A -ostat,pid,comm |grep lynq-sdk-ready| grep Z > /dev/null
-        if [ $? -eq 0 ]; then
-            echo "lynq-sdk-ready state is Z" > /dev/kmsg
-            pid=$(ps -A -ostat,pid,comm |grep lynq-sdk-ready|grep Z|awk '{print $2}')
-            kill -9 $pid
-            sh /etc/init.d/lynq-sdk-ready.sh start
-        fi
-    fi
-
-    ps -ef|grep lynq-atcid |grep -v "grep" > /dev/null
-    if [ $? -ne 0 ]; then
-        echo "lynq-atcid no exist" > /dev/kmsg
-        sh /etc/init.d/lynq-atcid.sh start
-    else
-        ps -A -ostat,pid,comm |grep lynq-atcid| grep Z > /dev/null
-        if [ $? -eq 0 ]; then
-            echo "lynq-atcid state is Z" > /dev/kmsg
-            pid=$(ps -A -ostat,pid,comm |grep lynq-atcid|grep Z|awk '{print $2}')
-            kill -9 $pid
-            sh /etc/init.d/lynq-atcid.sh start
-        fi
-    fi
-
-    ps -ef|grep lynq-ril-service |grep -v "grep" > /dev/null
-    if [ $? -ne 0 ]; then
-        echo "lynq-ril-service no exist" > /dev/kmsg
-        sh /etc/init.d/lynq-ril-service.sh start
-    else
-        ps -A -ostat,pid,comm |grep lynq-ril-service| grep Z > /dev/null
-        if [ $? -eq 0 ]; then
-            echo "lynq-ril-service state is Z" > /dev/kmsg
-            pid=$(ps -A -ostat,pid,comm |grep lynq-ril-service|grep Z|awk '{print $2}')
-            kill -9 $pid
-            sh /etc/init.d/lynq-ril-service.sh start
-        fi
-    fi
-
-    ps -ef|grep autosuspend |grep -v "grep" > /dev/null
-    if [ $? -ne 0 ]; then
-        echo "lynq-autosuspend no exist" > /dev/kmsg
-        sh /etc/init.d/lynq-autosuspend.sh start
-    else
-        ps -A -ostat,pid,comm |grep autosuspend| grep Z > /dev/null
-        if [ $? -eq 0 ]; then
-            echo "lynq-autosuspend state is Z" > /dev/kmsg
-            pid=$(ps -A -ostat,pid,comm |grep autosuspend|grep Z|awk '{print $2}')
-            kill -9 $pid
-            sh /etc/init.d/lynq-autosuspend.sh start
-        fi   
-    fi
-done
diff --git a/esdk/layers/meta-zxic-custom/recipes-core/images/files/zx297520v3/vehicle_dc_ref/fs/normal/rootfs/etc/profile b/esdk/layers/meta-zxic-custom/recipes-core/images/files/zx297520v3/vehicle_dc_ref/fs/normal/rootfs/etc/profile
index ba1dfaf..d8cbfdf 100755
--- a/esdk/layers/meta-zxic-custom/recipes-core/images/files/zx297520v3/vehicle_dc_ref/fs/normal/rootfs/etc/profile
+++ b/esdk/layers/meta-zxic-custom/recipes-core/images/files/zx297520v3/vehicle_dc_ref/fs/normal/rootfs/etc/profile
@@ -1,2 +1,2 @@
 
-PATH="/sbin:/usr/sbin:/bin:/usr/bin"
+PATH="/sbin:/bin:/usr/sbin:/usr/bin:/mnt/oem/bin"
diff --git a/esdk/layers/meta-zxic-custom/recipes-core/images/files/zx297520v3/vehicle_dc_ref/fs/normal/rootfs/etc_ro/default/default_parameter_sys b/esdk/layers/meta-zxic-custom/recipes-core/images/files/zx297520v3/vehicle_dc_ref/fs/normal/rootfs/etc_ro/default/default_parameter_sys
index d5b8bbf..da7ced4 100755
--- a/esdk/layers/meta-zxic-custom/recipes-core/images/files/zx297520v3/vehicle_dc_ref/fs/normal/rootfs/etc_ro/default/default_parameter_sys
+++ b/esdk/layers/meta-zxic-custom/recipes-core/images/files/zx297520v3/vehicle_dc_ref/fs/normal/rootfs/etc_ro/default/default_parameter_sys
@@ -451,6 +451,7 @@
 NGECALL_FORTEST=0
 CUSTOMER_FLAG=0
 #for volte end
+DEBUG_INFO_DISABLE=0
 DEBUG_INFO_FILE_PATH=/mnt/userdata
 DEBUG_INFO_FILE_NUM=2
 DEBUG_INFO_FILE_TOTAL_SIZE=1
diff --git a/esdk/layers/meta-zxic-custom/recipes-core/images/files/zx297520v3/vehicle_dc_ref/fs/normal/rootfs/etc_ro/default/default_parameter_user b/esdk/layers/meta-zxic-custom/recipes-core/images/files/zx297520v3/vehicle_dc_ref/fs/normal/rootfs/etc_ro/default/default_parameter_user
index d7267f8..d43a308 100755
--- a/esdk/layers/meta-zxic-custom/recipes-core/images/files/zx297520v3/vehicle_dc_ref/fs/normal/rootfs/etc_ro/default/default_parameter_user
+++ b/esdk/layers/meta-zxic-custom/recipes-core/images/files/zx297520v3/vehicle_dc_ref/fs/normal/rootfs/etc_ro/default/default_parameter_user
@@ -78,10 +78,6 @@
 br_ipchange_flag=
 br_node=usblan0+zvnet0
 br_node_cap=zvnet0
-br_node_num=
-br_node0=
-br_node1=
-br_node2=
 clat_fake_subnet=192.0.168.0
 clat_frag_collect_timeout=300
 clat_local_mapping_timeout=300
@@ -350,7 +346,7 @@
 ACL_mode=0
 AuthMode=WPA2PSK
 Channel=0
-wifi_acs_num=3
+wifi_acs_num=5
 closeEnable=0
 closeTime=
 CountryCode=CN
@@ -469,9 +465,7 @@
 wifi_11n_cap_5g=1
 WirelessMode_5g=6
 Channel_5g=0
-# zw.wang [wifi] If the 5G hotspot is enabled, the country code cannot be obtained by calling qser_wifi_ap_channel_get on 20240829 start
 CountryCode_5g=CN
-# zw.wang [wifi] If the 5G hotspot is enabled, the country code cannot be obtained by calling qser_wifi_ap_channel_get on 20240829 end
 MAX_Access_num_5g=32
 m_MAX_Access_num_5g=0
 ACL_mode_5g=0
@@ -517,7 +511,7 @@
 at_at_d=
 at_ptsnum=
 quick_dial=1
-cap_port_name=/dev/ttyGS0+/dev/ttyGS1
+cap_port_name=/dev/ttyGS0
 customIndCmdList=
 defrt_cid=1
 MaxRtrAdvInterval=1800
@@ -525,7 +519,7 @@
 gw_in_cap=0
 #yes-on  no-off
 cc_at_debug=no
-xlat_enable=1
+xlat_enable=0
 ecallmode=2
 telog_path_cap=
 telog_path=
diff --git a/esdk/layers/meta-zxic-custom/recipes-core/images/files/zx297520v3/vehicle_dc_ref/fs/normal/rootfs/sbin/fdisk_emmc.sh b/esdk/layers/meta-zxic-custom/recipes-core/images/files/zx297520v3/vehicle_dc_ref/fs/normal/rootfs/sbin/fdisk_emmc.sh
index ad96881..492f934 100755
--- a/esdk/layers/meta-zxic-custom/recipes-core/images/files/zx297520v3/vehicle_dc_ref/fs/normal/rootfs/sbin/fdisk_emmc.sh
+++ b/esdk/layers/meta-zxic-custom/recipes-core/images/files/zx297520v3/vehicle_dc_ref/fs/normal/rootfs/sbin/fdisk_emmc.sh
@@ -15,7 +15,7 @@
 p
 1 
 
-+256M
++200M
 n
 p
 2
diff --git a/esdk/layers/meta-zxic-custom/recipes-core/images/files/zx297520v3/vehicle_dc_systemd/fs/normal/rootfs/etc_ro/default/default_parameter_sys b/esdk/layers/meta-zxic-custom/recipes-core/images/files/zx297520v3/vehicle_dc_systemd/fs/normal/rootfs/etc_ro/default/default_parameter_sys
index 014d309..57c1ad7 100755
--- a/esdk/layers/meta-zxic-custom/recipes-core/images/files/zx297520v3/vehicle_dc_systemd/fs/normal/rootfs/etc_ro/default/default_parameter_sys
+++ b/esdk/layers/meta-zxic-custom/recipes-core/images/files/zx297520v3/vehicle_dc_systemd/fs/normal/rootfs/etc_ro/default/default_parameter_sys
@@ -439,6 +439,7 @@
 NGECALL_FORTEST=0
 CUSTOMER_FLAG=0
 #for volte end
+DEBUG_INFO_DISABLE=0
 DEBUG_INFO_FILE_PATH=/mnt/userdata
 DEBUG_INFO_FILE_NUM=2
 DEBUG_INFO_FILE_TOTAL_SIZE=1
diff --git a/esdk/layers/meta-zxic-custom/recipes-core/images/files/zx297520v3/vehicle_dc_systemd/fs/normal/rootfs/etc_ro/default/default_parameter_user b/esdk/layers/meta-zxic-custom/recipes-core/images/files/zx297520v3/vehicle_dc_systemd/fs/normal/rootfs/etc_ro/default/default_parameter_user
index 92191d4..3fbb096 100755
--- a/esdk/layers/meta-zxic-custom/recipes-core/images/files/zx297520v3/vehicle_dc_systemd/fs/normal/rootfs/etc_ro/default/default_parameter_user
+++ b/esdk/layers/meta-zxic-custom/recipes-core/images/files/zx297520v3/vehicle_dc_systemd/fs/normal/rootfs/etc_ro/default/default_parameter_user
@@ -78,10 +78,6 @@
 br_ipchange_flag=
 br_node=usblan0+zvnet0
 br_node_cap=zvnet0
-br_node_num=
-br_node0=
-br_node1=
-br_node2=
 clat_fake_subnet=192.0.168.0
 clat_frag_collect_timeout=300
 clat_local_mapping_timeout=300
@@ -492,6 +488,6 @@
 MaxRtrAdvInterval=1800
 dhcps_in_cap=1
 gw_in_cap=0
-xlat_enable=1
+xlat_enable=0
 telog_path_cap=
 telog_path=
diff --git a/esdk/layers/meta-zxic-custom/recipes-lynq/liblynq-qser-gnss/liblynq-qser-gnss.bb b/esdk/layers/meta-zxic-custom/recipes-lynq/liblynq-qser-gnss/liblynq-qser-gnss.bb
index dd600c2..2eb9488 100755
--- a/esdk/layers/meta-zxic-custom/recipes-lynq/liblynq-qser-gnss/liblynq-qser-gnss.bb
+++ b/esdk/layers/meta-zxic-custom/recipes-lynq/liblynq-qser-gnss/liblynq-qser-gnss.bb
@@ -50,11 +50,11 @@
     fi

     if [ "${MOBILETEK_GNSS_UPDATE_ENABLE}" = "yes" ]; then

         install -d ${D}/data/gnss_update

-        install -m 644 ${WORKONSRC}HD8122.YF.GN3.115200.10038.c8069.53ef0.231110R2.GALQS.PPS9.CFG.EPHSave.bin ${D}/data/gnss_update

-        install -m 644 ${WORKONSRC}HD8122.YIKE.GN3.115200.0041.a8fb4.53ef0.GAQBS.B1C.ANT.EPH.CFG.PPS13.240912R1.bin ${D}/data/gnss_update

+        install -m 644 ${WORKONSRC}HD8122.YIKE.GN3.115200.0035.720e5.53ef0.GQALS.ANT.EPH.CFG.PPS13.240115R1.bin ${D}/data/gnss_update

+        install -m 644 ${WORKONSRC}HD8122.YIKE.GN3.115200.0037.dbd12.53ef0.GAQBS.B1C.ANT.EPH.CFG.PPS13.240416R1.bin ${D}/data/gnss_update

         install -m 644 ${WORKONSRC}agps.conf ${D}/data/gnss_update

-        ln -sf ./HD8122.YF.GN3.115200.10038.c8069.53ef0.231110R2.GALQS.PPS9.CFG.EPHSave.bin ${D}/data/gnss_update/HD.bin

-        ln -sf ./HD8122.YIKE.GN3.115200.0041.a8fb4.53ef0.GAQBS.B1C.ANT.EPH.CFG.PPS13.240912R1.bin ${D}/data/gnss_update/HD_BD.bin

+        ln -sf ./HD8122.YIKE.GN3.115200.0035.720e5.53ef0.GQALS.ANT.EPH.CFG.PPS13.240115R1.bin ${D}/data/gnss_update/HD.bin

+        ln -sf ./HD8122.YIKE.GN3.115200.0037.dbd12.53ef0.GAQBS.B1C.ANT.EPH.CFG.PPS13.240416R1.bin ${D}/data/gnss_update/HD_BD.bin

     fi

 }

 

diff --git a/esdk/layers/meta-zxic-custom/recipes-lynq/lynq-autosuspend/files/LICENSE b/esdk/layers/meta-zxic-custom/recipes-lynq/lynq-autosuspend/files/LICENSE
new file mode 100755
index 0000000..1b15bd2
--- /dev/null
+++ b/esdk/layers/meta-zxic-custom/recipes-lynq/lynq-autosuspend/files/LICENSE
@@ -0,0 +1,31 @@
+opyright Statement:
+
+This software/firmware and related documentation ("MobileTek Software") are
+protected under relevant copyright laws. The information contained herein is
+confidential and proprietary to MobileTek Inc. and/or its licensors. Without
+the prior written permission of MobileTek inc. and/or its licensors, any
+reproduction, modification, use or disclosure of MobileTek Software, and
+information contained herein, in whole or in part, shall be strictly
+prohibited.
+
+MobileTek Inc. (C) 2015. All rights reserved.
+
+BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MobileTek SOFTWARE")
+RECEIVED FROM MobileTek AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER
+ON AN "AS-IS" BASIS ONLY. MobileTek EXPRESSLY DISCLAIMS ANY AND ALL
+WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
+WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR
+NONINFRINGEMENT. NEITHER DOES MobileTek PROVIDE ANY WARRANTY WHATSOEVER WITH
+RESPECT TO THE SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY,
+INCORPORATED IN, OR SUPPLIED WITH THE MobileTek SOFTWARE, AND RECEIVER AGREES
+TO LOOK ONLY TO SUCH THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO.
+RECEIVER EXPRESSLY ACKNOWLEDGES THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO
+OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES CONTAINED IN MobileTek
+SOFTWARE. MobileTek SHALL ALSO NOT BE RESPONSIBLE FOR ANY MobileTek SOFTWARE
+RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR
+STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MobileTek'S
+ENTIRE AND CUMULATIVE LIABILITY WITH RESPECT TO THE MobileTek SOFTWARE
+RELEASED HEREUNDER WILL BE, AT MobileTek'S OPTION, TO REVISE OR REPLACE THE
+MobileTek SOFTWARE AT ISSUE, OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE
+CHARGE PAID BY RECEIVER TO MobileTek FOR SUCH MobileTek SOFTWARE AT ISSUE.
diff --git a/esdk/layers/meta-zxic-custom/recipes-lynq/lynq-autosuspend/files/autosuspend.c b/esdk/layers/meta-zxic-custom/recipes-lynq/lynq-autosuspend/files/autosuspend.c
new file mode 100755
index 0000000..ff653f6
--- /dev/null
+++ b/esdk/layers/meta-zxic-custom/recipes-lynq/lynq-autosuspend/files/autosuspend.c
@@ -0,0 +1,101 @@
+/*
+ * Copyright (C) 2012 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#define LOG_TAG "AUTOSUSPEND"
+
+#include <stdbool.h>
+
+#include <log/log.h>
+#include <liblog/lynq_deflog.h>
+
+#include "autosuspend.h"
+
+#include "autosuspend_ops.h"
+
+static struct autosuspend_ops *autosuspend_ops;
+static bool autosuspend_enabled;
+static bool autosuspend_inited;
+
+static int autosuspend_init(void)
+{
+    if (autosuspend_inited) {
+        return 0;
+    }
+
+    autosuspend_ops = autosuspend_wakeup_count_init();
+    if (autosuspend_ops) {
+        goto out;
+    }
+
+    if (!autosuspend_ops) {
+        ALOGI("failed to initialize autosuspend\n");
+        return -1;
+    }
+
+out:
+    autosuspend_inited = true;
+
+    ALOGI("autosuspend initialized\n");
+    return 0;
+}
+
+int autosuspend_enable(void)
+{
+    int ret;
+
+    ret = autosuspend_init();
+    if (ret) {
+        return ret;
+    }
+
+    ALOGI("autosuspend_enable\n");
+
+    if (autosuspend_enabled) {
+        return 0;
+    }
+
+    ret = autosuspend_ops->enable();
+    if (ret) {
+        return ret;
+    }
+
+    autosuspend_enabled = true;
+    return 0;
+}
+
+int autosuspend_disable(void)
+{
+    int ret;
+
+    ret = autosuspend_init();
+    if (ret) {
+        return ret;
+    }
+
+    ALOGI("autosuspend_disable\n");
+
+    if (!autosuspend_enabled) {
+        return 0;
+    }
+
+    ret = autosuspend_ops->disable();
+    if (ret) {
+        return ret;
+    }
+
+    autosuspend_enabled = false;
+    return 0;
+}
diff --git a/esdk/layers/meta-zxic-custom/recipes-lynq/lynq-autosuspend/files/autosuspend.h b/esdk/layers/meta-zxic-custom/recipes-lynq/lynq-autosuspend/files/autosuspend.h
new file mode 100755
index 0000000..59188a8
--- /dev/null
+++ b/esdk/layers/meta-zxic-custom/recipes-lynq/lynq-autosuspend/files/autosuspend.h
@@ -0,0 +1,58 @@
+/*
+ * Copyright (C) 2012 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _LIBSUSPEND_AUTOSUSPEND_H_
+#define _LIBSUSPEND_AUTOSUSPEND_H_
+
+#include <sys/cdefs.h>
+#include <stdbool.h>
+
+__BEGIN_DECLS
+
+/*
+ * autosuspend_enable
+ *
+ * Turn on autosuspend in the kernel, allowing it to enter suspend if no
+ * wakelocks/wakeup_sources are held.
+ *
+ *
+ *
+ * Returns 0 on success, -1 if autosuspend was not enabled.
+ */
+int autosuspend_enable(void);
+
+/*
+ * autosuspend_disable
+ *
+ * Turn off autosuspend in the kernel, preventing suspend and synchronizing
+ * with any in-progress resume.
+ *
+ * Returns 0 on success, -1 if autosuspend was not disabled.
+ */
+int autosuspend_disable(void);
+
+/*
+ * set_wakeup_callback
+ *
+ * Set a function to be called each time the device returns from suspend.
+ * success is true if the suspend was sucessful and false if the suspend
+ * aborted due to some reason.
+ */
+void set_wakeup_callback(void (*func)(bool success));
+
+__END_DECLS
+
+#endif
diff --git a/esdk/layers/meta-zxic-custom/recipes-lynq/lynq-autosuspend/files/autosuspend.service b/esdk/layers/meta-zxic-custom/recipes-lynq/lynq-autosuspend/files/autosuspend.service
new file mode 100755
index 0000000..3cbb46c
--- /dev/null
+++ b/esdk/layers/meta-zxic-custom/recipes-lynq/lynq-autosuspend/files/autosuspend.service
@@ -0,0 +1,10 @@
+[Unit]
+Description=lynq-autosuspend-service
+
+[Service]
+ExecStart=/usr/bin/autosuspend
+Type=simple
+
+[Install]
+WantedBy=multi-user.target
+
diff --git a/esdk/layers/meta-zxic-custom/recipes-lynq/lynq-autosuspend/files/autosuspend_ops.h b/esdk/layers/meta-zxic-custom/recipes-lynq/lynq-autosuspend/files/autosuspend_ops.h
new file mode 100755
index 0000000..698e25b
--- /dev/null
+++ b/esdk/layers/meta-zxic-custom/recipes-lynq/lynq-autosuspend/files/autosuspend_ops.h
@@ -0,0 +1,29 @@
+/*
+ * Copyright (C) 2012 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _LIBSUSPEND_AUTOSUSPEND_OPS_H_
+#define _LIBSUSPEND_AUTOSUSPEND_OPS_H_
+
+struct autosuspend_ops {
+    int (*enable)(void);
+    int (*disable)(void);
+};
+
+struct autosuspend_ops *autosuspend_autosleep_init(void);
+struct autosuspend_ops *autosuspend_earlysuspend_init(void);
+struct autosuspend_ops *autosuspend_wakeup_count_init(void);
+
+#endif
diff --git a/esdk/layers/meta-zxic-custom/recipes-lynq/lynq-autosuspend/files/autosuspend_wakeup_count.c b/esdk/layers/meta-zxic-custom/recipes-lynq/lynq-autosuspend/files/autosuspend_wakeup_count.c
new file mode 100755
index 0000000..c7cc274
--- /dev/null
+++ b/esdk/layers/meta-zxic-custom/recipes-lynq/lynq-autosuspend/files/autosuspend_wakeup_count.c
@@ -0,0 +1,765 @@
+/*
+ * Copyright (C) 2012 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#define LOG_TAG "AUTOSUSPEND"
+//#define LOG_NDEBUG 0
+
+#include <errno.h>
+#include <fcntl.h>
+#include <pthread.h>
+#include <semaphore.h>
+#include <stddef.h>
+#include <stdbool.h>
+#include <string.h>
+#include <sys/param.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <sys/time.h>
+#include <libsim/lynq_sim.h>
+
+#include <unistd.h>
+#include <dlfcn.h>
+//#include <cutils/properties.h>
+#define USER_LOG_TAG "PMS"
+#include <liblog/lynq_deflog.h>
+#include <include/lynq_uci.h>
+
+#include <log/log.h>
+#include <stdlib.h>
+#include "autosuspend_ops.h"
+#include <sc_mnet_whitelist.h>
+#include <sc_at.h>
+#define SYS_POWER_STATE "/sys/power/state"
+
+#define SYS_POWER_WAKEUP_COUNT "/sys/power/wakeup_count"
+#define SYS_POWER_SPM_SUSPEND_CRTL "/sys/power/spm/suspend_ctrl"
+
+#define BASE_SLEEP_TIME 100000
+#define POSSIBLE_MAX_SLEEP_TIME 60000000
+#define LOG_UCI_MODULE "lynq_autosuspend"
+#define LOG_UCI_FILE "lynq_uci"
+
+static int state_fd;
+static int wakeup_count_fd;
+static int suspend_ctrl_fd;
+static pthread_t suspend_thread;
+static sem_t suspend_lockout;
+extern pthread_cond_t feedback_cond;
+extern pthread_mutex_t feedback_mutex;
+extern pthread_mutex_t time_info_mutex;
+static const char *sleep_state = "mem";
+#ifdef MOBILETEK_SUSPEND_CFG
+static const char *reg_netsys[5] = {"reg_netsys_srcclkena_mask_b 0",
+                                    "reg_netsys_infra_req_mask_b 0",
+                                    "reg_netsys_apsrc_req_mask_b 0",
+                                    "reg_netsys_vrf18_req_mask_b 0",
+                                    "reg_netsys_ddr_en_mask_b 0"};
+#endif
+static void (*wakeup_func)(bool success) = NULL;
+static int sleep_time = BASE_SLEEP_TIME;
+static int possible_max_sleep_time = POSSIBLE_MAX_SLEEP_TIME;
+
+extern int adb_debug_mode;
+
+static long start_time;  // 出错点:time_info_t 结构体两个成员都是long,因此这两个变量必须是long型,不能定义成int
+static long end_time; 
+
+
+
+# define TEMP_FAILURE_RETRY(expression) \
+  (__extension__							      \
+    ({ long int __result;						      \
+       do __result = (long int) (expression);				      \
+       while (__result == -1L && errno == EINTR);			      \
+       __result; }))
+
+
+pid_t pid = 0;
+
+enum {
+    PARTIAL_WAKE_LOCK = 1,  // the cpu stays on, but the screen is off
+    FULL_WAKE_LOCK = 2      // the screen is also on
+};
+
+// while you have a lock held, the device will stay on at least at the
+// level you request.
+
+struct time_info_t
+{
+    long sleep_start_time;
+    long wakeup_time;
+};
+
+extern struct time_info_t time_info;
+
+struct timeval tv;
+
+#ifdef MOBILETEK_SUSPEND_CFG
+void *dlHandle_wakelock;
+void *dlHandle_log;
+void *dlHandle_network;
+static void* dlHandle_sim;
+
+int (*lynq_screen)(int num);
+int (*lynq_sim_init)(int utoken);
+int (*acquire_wake_lock)(int lock, const char* id);
+int (*release_wake_lock)(const char* id);
+int (*lynq_query_registration_state)(const char *type,int* regState,int* imsRegState,char * LAC,char * CID,int *
+netType,int *radioTechFam,int *errorCode);
+int (*lynq_network_init)(int utoken);
+
+void init_wakelock_func(void)
+{
+    const char *lynqLibPath_WakeLock = "/usr/lib64/libpower.so";
+    const char *lynqLibPath_Log = "/lib64/liblynq-log.so";
+
+    dlHandle_wakelock = dlopen(lynqLibPath_WakeLock, RTLD_NOW);
+    if (dlHandle_wakelock == NULL) 
+    {
+        ALOGI("dlopen lynqLibPath_WakeLock failed: %s", dlerror());
+        exit(EXIT_FAILURE);
+    }
+    dlHandle_log = dlopen(lynqLibPath_Log, RTLD_NOW);
+    if (dlHandle_log == NULL) 
+    {
+        ALOGI("dlopen dlHandle_log failed: %s", dlerror());
+        exit(EXIT_FAILURE);
+    }
+    acquire_wake_lock = (int(*)(int,const char*))dlsym(dlHandle_wakelock, "acquire_wake_lock");
+    if (acquire_wake_lock == NULL) {
+        ALOGI("acquire_wake_lock not defined or exported in %s", lynqLibPath_WakeLock);
+        exit(EXIT_FAILURE);
+    }
+    release_wake_lock = (int(*)( const char*))dlsym(dlHandle_wakelock, "release_wake_lock");
+    if (release_wake_lock == NULL) {
+        ALOGI("release_wake_lock not defined or exported in %s", lynqLibPath_WakeLock);
+        exit(EXIT_FAILURE);
+    }
+    dlerror(); // Clear any previous dlerror
+
+  return;
+}
+
+ void init_sim_func()
+{
+    int res;
+    const char *lynqLibPath_Sim = "/lib64/liblynq-sim.so";
+
+    pid = getpid();
+    dlHandle_sim = dlopen(lynqLibPath_Sim, RTLD_NOW);
+    if (dlHandle_sim == NULL) 
+    {
+        ALOGI("dlopen lynqLibPath_Sim failed: %s", dlerror());
+        exit(EXIT_FAILURE);
+    }
+
+    lynq_screen = (int(*)(int))dlsym(dlHandle_sim, "lynq_screen");
+    if (lynq_screen == NULL) {
+        ALOGI("lynq_screen not defined or exported in %s", lynqLibPath_Sim);
+        exit(EXIT_FAILURE);
+    }
+
+    lynq_sim_init = (int(*)(int utoken))dlsym(dlHandle_sim,"lynq_sim_init");
+    if (lynq_sim_init == NULL) {
+        ALOGI("lynq_sim_init not defined or exported in %s", lynqLibPath_Sim);
+        exit(EXIT_FAILURE);
+    }
+    dlerror(); // Clear any previous dlerror
+
+    res = lynq_sim_init((int)pid);
+    if(res == 0)
+    {
+        ALOGI("Run lynq_sim_init\n");
+    }else{
+        ALOGI("lynq sim init error\n");
+    }
+    sleep(1);    
+
+    return;
+}
+
+
+void init_network_func()
+{
+    int res;
+    const char *lynqLibPath_Network = "/lib64/liblynq-network.so";
+    dlHandle_network = dlopen(lynqLibPath_Network, RTLD_NOW);
+    if (dlHandle_network == NULL) 
+    {
+        ALOGI("dlopen lynqLibPath_Network failed: %s", dlerror());
+        exit(EXIT_FAILURE);
+    }
+
+    lynq_query_registration_state = (int(*)(const char*,int*,int*,char *,char *,int *,int *,int*))dlsym(
+dlHandle_network, "lynq_query_registration_state");
+    if (lynq_query_registration_state == NULL) {
+        ALOGI("lynq_query_registration_state not defined or exported in %s", lynqLibPath_Network);
+        exit(EXIT_FAILURE);
+    }
+
+    lynq_network_init = (int(*)(int))dlsym(dlHandle_network, "lynq_network_init");
+    if (lynq_network_init == NULL) {
+        ALOGI("lynq_network_init not defined or exported in %s", lynqLibPath_Network);
+        exit(EXIT_FAILURE);
+    }
+
+    ALOGI("start lynq_network_init\n");
+    printf("start lynq_network_init\n");
+    res = lynq_network_init(2);
+    sleep(10);
+
+    if(res == 0)
+    {
+        ALOGI("Run lynq_network_init\n");
+        printf("Run lynq_network_init\n");
+    }else{
+        ALOGI("lynq_network_init error\n");
+        printf("lynq_network_init error\n");
+    }       
+
+    dlerror(); // Clear any previous dlerror
+    return;
+}
+#endif
+
+#ifdef MOBILETEK_TARGET_PLATFORM_T106
+int t106_set_lowpwr(int state)
+{
+    int ret;
+    char rsp[128];
+    char cmdstr[32];
+    if(state == 0)
+    {
+        strcpy(cmdstr, "AT+ZLOWPWR=0\r\n");
+    }
+    else
+    {
+        strcpy(cmdstr, "AT+ZLOWPWR=1\r\n");
+    }
+    ret = sc_at_send(1,cmdstr,rsp,sizeof(rsp));
+    printf("AT+ZLOWPWR result:%d %s\n",ret,rsp);
+    return ret;
+}
+
+int t106_set_blacklist(int blacklist_state)
+{
+    int ret;
+    char rsp[128];
+    char cmdstr[128];
+    if(blacklist_state == 0)
+    {
+        strcpy(cmdstr, "AT+SHELL=echo \"+CREG:+CGREG:+CEREG:^MODE:\" > /sys/module/at_io/parameters/at_psm_filter\r\n");
+    }
+    else
+    {
+        strcpy(cmdstr, "AT+SHELL=echo \"\" > /sys/module/at_io/parameters/at_psm_filter\r\n");
+    }
+    ret = sc_at_send(1,cmdstr,rsp,sizeof(rsp));
+    printf("AT+SHELL=echo result:%d %s\n",ret,rsp);
+    return ret;
+
+}
+int t106_set_whitelist(void)
+{
+    char tmp[8];
+    int ret;
+    lynq_get_value(LOG_UCI_FILE, LOG_UCI_MODULE, "whitelist_state", tmp);
+    if(strlen(tmp) != 4)
+    {
+        RLOGD("the whitelist len is error\n");
+        return 0;
+    }
+    if(tmp[0] == '1')
+    {
+        ret = sc_mnet_whitelist_add(1);
+        if(ret)
+        {
+            RLOGD("sc_mnet_whitelist_add 1 fail\n");
+            return ret;
+        }
+        ret = sc_mnet_whitelist_add(5);
+        if(ret)
+        {
+            RLOGD("sc_mnet_whitelist_add 5 fail\n");
+            return ret;
+        }
+    }
+    if(tmp[1] == '1')
+    {
+        ret =  sc_mnet_whitelist_add(2);
+        if(ret)
+        {
+            RLOGD("sc_mnet_whitelist_add 2 fail\n");
+            return ret;
+        }
+    }
+    if(tmp[2] == '1')
+    {
+        ret =  sc_mnet_whitelist_add(3);
+        if(ret)
+        {
+            RLOGD("sc_mnet_whitelist_add 3 fail\n");
+            return ret;
+        }
+    }
+    if(tmp[3] == '1')
+    {
+        ret =  sc_mnet_whitelist_add(4);
+        if(ret)
+        {
+            RLOGD("sc_mnet_whitelist_add 4 fail\n");
+            return ret;
+        }
+    }
+
+    return 0;
+
+}
+int t106_early_suspend(void)
+{
+    int ret;
+
+    RLOGD("t106_early_suspend start\n");
+    ret=lynq_sleep_status(0);
+    RLOGD("lynq_get_sleep_status ret=%d\n", ret);
+    ret = t106_set_lowpwr(1);
+    RLOGD("t106_set_lowpwr status ret=%d\n", ret);
+    system("zlog_nvctrl -m 1");
+    ret = t106_set_whitelist();
+    if(ret)
+    {
+        RLOGD("t106_set_whitelist ret=%d\n", ret);
+        return ret;
+    }
+    ret = t106_set_blacklist(0);
+    if(ret)
+    {
+        RLOGD("t106_set_blacklist ret=%d\n", ret);
+        return ret;
+    }
+    return 0;
+}
+
+void t106_early_resume(void)
+{
+    int ret;
+    RLOGD("t106_early_resume start\n");
+    ret = t106_set_blacklist(1);
+    if(ret)
+    {
+        RLOGD("t106_set_whitelist ret=%d\n", ret);
+    }
+    ret = sc_mnet_whitelist_clear();
+    if(ret)
+    {
+        RLOGD("sc_mnet_whitelist_clear ret=%d\n", ret);
+    }
+    system("zlog_nvctrl -m 0");
+    ret = t106_set_lowpwr(0);
+    RLOGD("t106_set_lowpwr status ret=%d\n", ret);
+    ret=lynq_sleep_status(1);
+    RLOGD("lynq_get_sleep_status ret=%d\n", ret);
+
+    return NULL;
+}
+#endif
+
+#ifdef MOBILETEK_SUSPEND_CFG
+int t800_early_suspend(char *wakeup_count, int wakeup_count_len)
+{
+    char buf[80];
+    system("echo \"Sys standby mode\" >/dev/console");
+    // sleep(1);
+    system("echo 7 | emdlogger_ctrl");
+    // sleep(1);
+
+    if (lynq_screen(0) != 0)  //notify ril for screen off
+    {
+        ALOGI("lynq_screen off fail\n");
+        return -1;
+    }
+    system("echo mode 4 0 >/sys/devices/platform/10005000.pinctrl/mt_gpio");
+    system("echo out 4 1 >/sys/devices/platform/10005000.pinctrl/mt_gpio");
+    RLOGD("ring GPIO PASS\n");
+    system("hwclock -w");
+    RLOGD("TIME: sys to rtc\n");
+    lseek(wakeup_count_fd, 0, SEEK_SET);
+    system("echo \"autosuspend:Sys seek\" >/dev/console");
+    wakeup_count_len = TEMP_FAILURE_RETRY(read(wakeup_count_fd, wakeup_count,
+               200));
+    ALOGE("%s: %d, write %s to wakeup_count\n", __func__, wakeup_count_len, wakeup_count);
+    if (wakeup_count_len < 0) {
+            strerror_r(errno, buf, sizeof(buf));
+            ALOGE("Error reading from %s: %s\n", SYS_POWER_WAKEUP_COUNT, buf);
+            wakeup_count_len = 0;
+            return -1;
+     }
+
+    for(int i = 0;i < 5;i++)  //notify spm (other core) to handle pre-sleep configuration
+    {
+        if(TEMP_FAILURE_RETRY(write(suspend_ctrl_fd,reg_netsys[i],strlen(reg_netsys[i]))) < 0)
+        {
+            strerror_r(errno, buf, sizeof(buf));
+            ALOGI("Error writing to %s: %s\n", SYS_POWER_SPM_SUSPEND_CRTL, buf);
+            return -1;
+        }    
+    }
+    return 0;
+}
+
+void t800_early_resume(bool success)
+{
+    system("hwclock -s");
+    RLOGD("TIME: rtc to sys\n");
+    if (!success)
+    {
+
+       system("mdlogctl start");
+
+       system("echo 8 | emdlogger_ctrl");
+    
+       usleep(200000); 
+       ALOGI("Log on with failure\n");
+       return ;
+    }
+    
+    if (lynq_screen(1) != 0)  // notify ril for screen on
+    {
+        ALOGI("lynq_screen on fail\n");
+    }
+
+    system("mdlogctl start");
+
+    system("echo 8 | emdlogger_ctrl");
+    usleep(300000); //delay 2s for ril handling screen on,at least 70ms
+
+    return NULL;
+}
+#endif
+
+
+static int suspend_ctrl(char *wakeup_count,int wakeup_count_len)
+{
+
+
+    char buf[80];
+    int ret = 0;
+#ifdef MOBILETEK_SUSPEND_CFG
+    ret = t800_early_suspend(char *wakeup_count, wakeup_count_len);
+    if(ret != 0)
+    {
+	ALOGD("t800_early_suspend fail\n");
+        return -1;
+    }
+#endif
+
+
+#ifdef MOBILETEK_TARGET_PLATFORM_T106
+    ret = t106_early_suspend();
+    if(ret != 0)
+    {
+        ALOGD("t106_early_suspend fail\n");
+        return -1;
+    }
+#endif
+
+    system("echo \"autosuspend:Sys suspend\" >/dev/console");
+    if(TEMP_FAILURE_RETRY(write(state_fd, sleep_state, strlen(sleep_state))) < 0) //enter suspend procedures in kernel
+    {
+        strerror_r(errno, buf, sizeof(buf));
+        ALOGI("Error writing to %s: %s\n", SYS_POWER_STATE, buf);
+        return -1;
+    }
+
+    return 0;
+}
+
+
+void wakeup_feedback(bool success)
+{
+
+    char buf[80];
+    long sleeptime = 0;
+
+#ifdef MOBILETEK_SUSPEND_CFG
+    t800_early_resume(bool success);
+#endif
+
+
+#ifdef MOBILETEK_TARGET_PLATFORM_T106
+    t106_early_resume();
+#endif
+
+    pthread_mutex_lock(&time_info_mutex);
+    memset(&tv,0,sizeof(struct timeval));
+    gettimeofday(&tv,NULL);
+    // time_info.wakeup_time = tv.tv_sec * 1000 + tv.tv_usec / 1000;
+    end_time = tv.tv_sec * 1000 + tv.tv_usec / 1000;
+    ALOGI("%s: wake up time: %ld ms\n", __func__,end_time);
+
+    memset(&time_info,0,sizeof(struct time_info_t));
+
+    time_info.sleep_start_time = start_time;
+    time_info.wakeup_time = end_time;
+    sleeptime = end_time -start_time;
+    RLOGD("sleep time is %ld ms\n", sleeptime);
+    pthread_mutex_unlock(&time_info_mutex);
+
+    if (pthread_cond_broadcast(&feedback_cond) != 0) {
+        strerror_r(errno, buf, sizeof(buf));
+        ALOGI("Error broadcast cond: %s\n", buf);
+    }
+
+    return ;
+
+}
+
+static void update_sleep_time(bool success) {
+    if (success) {
+        sleep_time = BASE_SLEEP_TIME;
+        return;
+    }
+    // double sleep time after each failure up to one minute
+    sleep_time = MIN(sleep_time * 2, possible_max_sleep_time);
+}
+
+static void *suspend_thread_func(void *arg __attribute__((unused)))
+{
+    char buf[80];
+    char wakeup_count[20];
+    int wakeup_count_len;
+    int ret;
+    bool success = true;
+
+    while (1) {
+        update_sleep_time(success);
+        usleep(sleep_time);
+        success = false;
+
+        ALOGI("%s: wait\n", __func__);
+        ret = sem_wait(&suspend_lockout);
+        if (ret < 0) {
+            strerror_r(errno, buf, sizeof(buf));
+            ALOGI("Error waiting on semaphore: %s\n", buf);
+            continue;
+        }
+
+        ALOGV("%s: read wakeup_count\n", __func__);
+        lseek(wakeup_count_fd, 0, SEEK_SET);
+        wakeup_count_len = TEMP_FAILURE_RETRY(read(wakeup_count_fd, wakeup_count,
+                sizeof(wakeup_count)));
+        if (wakeup_count_len < 0) {
+            strerror_r(errno, buf, sizeof(buf));
+            ALOGE("Error reading from %s: %s\n", SYS_POWER_WAKEUP_COUNT, buf);
+            wakeup_count_len = 0;
+            continue;
+        }
+        if (!wakeup_count_len) {
+            ALOGE("Empty wakeup count\n");
+            continue;
+        }
+
+        ALOGI("%s: start suspend_ctrl\n", __func__);
+        memset(&tv,0,sizeof(struct timeval));
+        // memset(&time_info,0 ,sizeof(struct time_info_t));
+        gettimeofday(&tv,NULL);
+
+        start_time = tv.tv_sec * 1000 + tv.tv_usec / 1000;
+        ALOGI("%s: suspend start time: %ld ms\n", __func__,start_time);
+        // time_info.sleep_start_time = tv.tv_sec * 1000 + tv.tv_usec / 1000;
+
+        ret = suspend_ctrl(wakeup_count,wakeup_count_len);
+
+        if (ret >= 0) {
+                ALOGI("suspend_ctrl success.\n");
+                success = true;
+         }
+         else
+         {
+                ALOGI("suspend_ctrl false.\n");
+                success = false;
+         }
+
+         void (*func)(bool success) = wakeup_func;
+         if (func != NULL) {
+                (*func)(success); //handling resume event for other libs /apps
+            }
+
+         ALOGI("%s: release sem\n", __func__);
+         ret = sem_post(&suspend_lockout);
+         if (ret < 0) {
+            strerror_r(errno, buf, sizeof(buf));
+            ALOGI("Error releasing semaphore: %s\n", buf);
+         } 
+
+         if(adb_debug_mode == 1) // it's neccessary to wait for autosuspend_disable function calling in debug mode when finish resume procedure.
+         {
+           sleep(40);
+         }
+         else
+         {
+            ALOGI("%s: adb_debug unsupported\n", __func__);
+         }
+
+         ALOGI("%s: END SLEEP\n", __func__);
+    }
+    return NULL;
+}
+
+static int autosuspend_wakeup_count_enable(void)
+{
+    char buf[80];
+    int ret;
+
+    ALOGI("autosuspend_wakeup_count_enable\n");
+
+    ret = sem_post(&suspend_lockout);
+
+    if (ret < 0) {
+        strerror_r(errno, buf, sizeof(buf));
+        ALOGI("Error changing semaphore: %s\n", buf);
+    }
+
+    ALOGI("autosuspend_wakeup_count_enable done\n");
+
+    return ret;
+}
+
+static int autosuspend_wakeup_count_disable(void)
+{
+    char buf[80];
+    int ret;
+
+    ALOGI("autosuspend_wakeup_count_disable\n");
+
+    ret = sem_wait(&suspend_lockout);
+
+    if (ret < 0) {
+        strerror_r(errno, buf, sizeof(buf));
+        ALOGI("Error changing semaphore: %s\n", buf);
+    }
+
+    ALOGI("autosuspend_wakeup_count_disable done\n");
+
+    return ret;
+}
+
+void set_wakeup_callback(void (*func)(bool success))
+{
+    if (wakeup_func != NULL) {
+        ALOGI("Duplicate wakeup callback applied, keeping original");
+        return;
+    }
+    wakeup_func = func;
+}
+
+struct autosuspend_ops autosuspend_wakeup_count_ops = {
+        .enable = autosuspend_wakeup_count_enable,
+        .disable = autosuspend_wakeup_count_disable,
+};
+
+struct autosuspend_ops *autosuspend_wakeup_count_init(void)
+{
+    int ret;
+    char buf[80];
+    char timeout_str[100]="100000";
+    pid = getpid();
+    char cmdstr[32];
+    char rsp[128];
+    //if (property_get("sys.autosuspend.timeout", timeout_str, NULL))
+    {
+        possible_max_sleep_time = atoi(timeout_str);
+        ALOGI("autosuspend timeout is %d\n", possible_max_sleep_time);
+    }
+
+    state_fd = TEMP_FAILURE_RETRY(open(SYS_POWER_STATE, O_RDWR));
+    if (state_fd < 0) {
+        strerror_r(errno, buf, sizeof(buf));
+        ALOGI("Error opening %s: %s\n", SYS_POWER_STATE, buf);
+        goto err_open_state;
+    }
+
+    wakeup_count_fd = TEMP_FAILURE_RETRY(open(SYS_POWER_WAKEUP_COUNT, O_RDWR));
+    if (wakeup_count_fd < 0) {
+        strerror_r(errno, buf, sizeof(buf));
+        ALOGI("Error opening %s: %s\n", SYS_POWER_WAKEUP_COUNT, buf);
+        goto err_open_wakeup_count;
+    }
+#ifdef MOBILETEK_SUSPEND_CFG
+    suspend_ctrl_fd = TEMP_FAILURE_RETRY(open(SYS_POWER_SPM_SUSPEND_CRTL, O_RDWR));
+    if (suspend_ctrl_fd < 0) {
+        strerror_r(errno, buf, sizeof(buf));
+        ALOGI("Error opening %s: %s\n", SYS_POWER_SPM_SUSPEND_CRTL, buf);
+        goto err_open_suspend_ctrl;
+    }
+#endif
+    ret = sem_init(&suspend_lockout, 0, 0);
+    if (ret < 0) {
+        strerror_r(errno, buf, sizeof(buf));
+        ALOGI("Error creating semaphore: %s\n", buf);
+        goto err_sem_init;
+    }
+#ifdef MOBILETEK_TARGET_PLATFORM_T106
+    if(sc_at_init(1)){
+        ALOGD("sc_at_init failed.\n");
+        return NULL;
+    }
+    else
+    {
+        strcpy(cmdstr, "AT+ZPOWSTAT=1\r\n");
+        printf("AUTOSUSPEND: cmd:%s\n",cmdstr);
+        ret = sc_at_send(1,cmdstr,rsp,sizeof(rsp));
+        printf("AUTOSUSPEND: sc_at_send result:%d %s\n",ret,rsp);
+        
+    }
+    if(sc_mnet_whitelist_init() != 0)
+    {
+        ALOGD("sc_mnet_whitelist_init failed.\n");
+        return NULL;
+    }
+#endif
+    ret = lynq_sim_init((int)pid);
+    if(ret == 0)
+    {
+        ALOGD("Run lynq_sim_init\n");
+    }
+    else
+    {
+        return NULL;
+    }
+    ret = pthread_create(&suspend_thread, NULL, suspend_thread_func, NULL);
+    if (ret) {
+        strerror_r(ret, buf, sizeof(buf));
+        ALOGI("Error creating thread: %s\n", buf);
+        goto err_pthread_create;
+    }
+
+    ALOGI("Selected wakeup count\n");
+    return &autosuspend_wakeup_count_ops;
+
+err_pthread_create:
+    sem_destroy(&suspend_lockout);
+err_sem_init:
+    close(wakeup_count_fd);
+err_open_wakeup_count:
+    close(state_fd);
+#ifdef MOBILETEK_SUSPEND_CFG
+err_open_suspend_ctrl:
+    close(suspend_ctrl_fd);
+#endif
+err_open_state:
+    return NULL;
+}
diff --git a/esdk/layers/meta-zxic-custom/recipes-lynq/lynq-autosuspend/files/lynq-autosuspend.sh b/esdk/layers/meta-zxic-custom/recipes-lynq/lynq-autosuspend/files/lynq-autosuspend.sh
new file mode 100755
index 0000000..8e96831
--- /dev/null
+++ b/esdk/layers/meta-zxic-custom/recipes-lynq/lynq-autosuspend/files/lynq-autosuspend.sh
@@ -0,0 +1,39 @@
+#!/bin/sh
+#
+# Run the daemon
+#
+
+DAEMON="lynq-autosuspend-service"
+PIDFILE="/var/run/$DAEMON.pid"
+EXEC="/usr/bin/autosuspend"
+EXEC_ARGS=""
+
+
+start() {
+        echo -n "Starting $DAEMON... "
+        start-stop-daemon --no-close -S -b -m -p $PIDFILE -x $EXEC -- $EXEC_ARGS
+        [ $? -eq 0 ] && echo "OK" || echo "ERROR"
+}
+
+stop() {
+        echo -n "Stopping $DAEMON... "
+        start-stop-daemon -K -p $PIDFILE
+        [ $? -eq 0 ] && echo "OK" || echo "ERROR"
+}
+
+restart() {
+        stop
+        start
+}
+
+case "$1" in
+  start|stop|restart)
+        "$1"
+        ;;
+  *)
+        echo "Usage: $0 {start|stop|restart}"
+        exit 1
+esac
+
+exit $?
+
diff --git a/esdk/layers/meta-zxic-custom/recipes-lynq/lynq-autosuspend/files/main.c b/esdk/layers/meta-zxic-custom/recipes-lynq/lynq-autosuspend/files/main.c
new file mode 100755
index 0000000..f706c9f
--- /dev/null
+++ b/esdk/layers/meta-zxic-custom/recipes-lynq/lynq-autosuspend/files/main.c
@@ -0,0 +1,494 @@
+/* //device/system/rild/rild.c
+**
+** Copyright 2006 The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+**     http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdbool.h>
+#include <dlfcn.h>
+#include <string.h>
+#include <pthread.h>
+#include <stdint.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <errno.h>
+#include <log/log.h>
+#include <liblog/lynq_deflog.h>
+#include <include/lynq_uci.h>
+#include <sys/socket.h>
+#include <sys/un.h>
+#include <signal.h>
+
+
+#define LOG_UCI_MODULE "lynq_autosuspend"
+#define LOG_UCI_FILE "lynq_uci"
+
+#define LOG_TAG "AUTOSUSPEND"
+
+#define USER_LOG_TAG "PMS"
+
+#define SOCK_PATH  "/tmp/autosuspend.cmd.server"  //不能在当前这个目录创建socket文件,否则报错找不到文件(可能是因为这是在共享文件夹下,不支持创建socket文件)
+
+#define SOCK_DATA_PATH  "/tmp/autosuspend.data.server"
+
+// #define LYINFLOG(X...)  lynq_log_global_output(LOG_INFO,X)
+
+#define TIME_OUT_TIME 30
+
+
+#define MAX_LIB_ARGS        16
+
+int adb_debug_mode = 0;
+
+
+pthread_cond_t feedback_cond = PTHREAD_COND_INITIALIZER;
+pthread_mutex_t feedback_mutex = PTHREAD_MUTEX_INITIALIZER;
+pthread_mutex_t time_info_mutex = PTHREAD_MUTEX_INITIALIZER;
+
+extern int autosuspend_enable(void);
+extern int autosuspend_disable(void);
+extern void init_wakelock_func(void);
+extern void init_sim_func();
+extern void init_network_func();
+extern void set_wakeup_callback(void (*func)(bool success));
+extern void wakeup_feedback(bool success);
+extern int (*lynq_screen)(int num);
+
+struct time_info_t
+{
+    long sleep_start_time;
+    long wakeup_time;
+};
+
+struct time_info_t time_info; 
+
+static void usage(const char *argv0) {
+    fprintf(stderr, "Usage: %s -l <possible_max_sleep_time> [-- <args for Autosuspend Service>]\n", argv0);
+    exit(EXIT_FAILURE);
+}
+
+
+
+static int make_argv(char * args, char ** argv) {
+    // Note: reserve argv[0]
+    int count = 1;
+    char * tok;
+    char * s = args;
+
+    while ((tok = strtok(s, " \0"))) {
+        argv[count] = tok;
+        s = NULL;
+        count++;
+    }
+    return count;
+}
+
+static int Accept(int fd, struct sockaddr *sa, socklen_t *salenptr)
+{
+    int n;
+
+    while((n = accept(fd, sa, salenptr)) < 0)
+    {
+        if((errno == ECONNABORTED) || (errno == EINTR))
+            continue;
+        else
+        {
+            ALOGI("accept error\n");
+            return -1;
+        }
+    }
+    return n;
+}
+
+static int Bind(int fd, const struct sockaddr *sa, socklen_t salen)
+{
+    if(bind(fd, sa, salen) < 0)
+    {
+        // ALOGI("bind error\n");
+        perror("bind error");
+        return -1;
+    }
+	return 0;
+}
+
+
+static int Socket(int family, int type, int protocol)
+{
+    int n;
+
+    if ( (n = socket(family, type, protocol)) < 0)
+    {
+        ALOGI("socket error\n");
+        return -1;
+    }
+    return n;
+}
+
+static int Listen(int fd, int backlog)
+{
+    if(listen(fd, backlog) < 0)
+    {
+        ALOGI("listen error\n");
+        return -1;
+    }
+	return 0;
+}
+
+
+static int listen_port(struct sockaddr_un *addr, char *sockpath)
+{
+    int listenfd;
+    listenfd = Socket(AF_UNIX,SOCK_STREAM,0);
+    if(listenfd == -1)
+        return -1;
+    memset(addr, 0, sizeof(struct sockaddr_un));
+    addr->sun_family = AF_UNIX;
+    strcpy(addr->sun_path,sockpath);
+    // int opt = 1;
+	// if(setsockopt(listenfd, SOL_SOCKET,SO_REUSEADDR, (const void *)&opt, sizeof(opt)) == -1)
+    // {
+    //     perror("setsockopt error");
+    //     return -1;
+    // }
+
+// 以上方法对非网络的本地socket无效,应该用unlink函数避免Address already in use的错误
+
+
+    unlink(sockpath);
+    if(Bind(listenfd,(struct sockaddr *)addr,sizeof(*addr)) == -1)
+        return -1;
+
+    if(Listen(listenfd,20) == -1)
+        return -1;
+
+    return listenfd; 
+}
+
+static ssize_t Read(int fd, void *ptr, size_t nbytes)
+{
+    ssize_t n;
+    
+    while((n = read(fd, ptr, nbytes)) == -1)
+    {
+       //printf("READ,%d\n",fd);
+        if (errno == EINTR)
+		{	
+			ALOGI("read error eintr\n");
+            continue;
+		}
+        else if(errno == EAGAIN || errno == EWOULDBLOCK)
+        {
+            ALOGI("read time out\n");
+            return -1;
+        }
+        else
+        {
+            ALOGI("read error\n");
+            return -1;
+        }
+    }
+    //sleep(2);
+    //printf("READ1,%d\n", fd);
+    return n;
+}
+
+static ssize_t Write(int fd, const void *ptr, size_t nbytes)
+{
+    ssize_t n;
+
+    while((n = write(fd, ptr, nbytes)) == -1)
+    {
+        if (errno == EINTR)
+            continue;
+        else if(errno == EPIPE)
+		{
+			ALOGI("write error epipe\n");
+			return -1;
+		}  
+		else
+			return -1;
+    }
+    return n;
+}
+
+static int Close(int fd)
+{
+    if (close(fd) == -1)
+    {
+        ALOGI("close error\n");
+        return -1;
+    }
+	return 0;
+}
+
+
+void *deal_autosuspend(void *sockfd)
+{
+    int commfd = *((int *)sockfd);
+    char buf[20];
+    char res[15];
+
+    while(1)
+    {
+        memset(buf,0,sizeof(buf));
+        ALOGI("deal_autosuspend start to read.\n");
+        // 错误点:read函数在对端关闭后,也会直接返回0,不会阻塞,因此要判断是否返回0,返回0表示对端已经关闭,此时要跳出while循环不再监听
+        // 为什么对端会关闭?因为在客户端没有用nohup方式打开的情况下,系统睡眠后客户端进行会直接被杀死,对端会关闭,所以会导致read不阻塞,且总是返回0的现象
+        if(Read(commfd,buf,sizeof(buf)) <= 0) 
+        {
+            ALOGI("service receive suspend_cmd fail or client is closed.\n");
+            Close(commfd);
+            break;
+        }
+        if(strcmp(buf,"enable") == 0)
+        {
+            if(autosuspend_enable() < 0)
+            {
+                ALOGI("autosuspend_enable fail.\n");
+            }
+            else
+            {
+                ALOGI("autosuspend_enable success.\n");
+            }        
+        }
+        else if(strcmp(buf,"disable") == 0)
+        {
+            if(autosuspend_disable() < 0)
+            {
+                ALOGI("autosuspend_disable fail.\n");
+            }
+            else
+            {
+                ALOGI("autosuspend_disable success.\n");
+
+            }        
+        }
+
+        else
+        {
+            ALOGI("Unknown cmd : %s\n",buf);
+        }
+
+    }
+
+
+
+}
+
+#ifdef GSW_SUSPEND_CFG
+/*jb.qi add for service send when DTR is low on 20221111 start */
+void *dtr_wakeup()
+{
+    FILE *fp;
+    int ret;
+    bool success = true;
+    char buf[30];
+    char dtr_buffer[25];
+    RLOGD("dtr_wakeup start\n");
+    while(1)
+    {
+        fp = popen("cat /sys/devices/platform/10005000.pinctrl/mt_gpio |grep 006:","r");
+        fgets(dtr_buffer, sizeof(dtr_buffer), fp);
+        if(dtr_buffer[7] == '0')
+        {
+            time_info.sleep_start_time = 123;
+            time_info.wakeup_time = 123;
+            if (pthread_cond_broadcast(&feedback_cond) != 0) 
+            {
+                strerror_r(errno, buf, sizeof(buf));
+                ALOGI("Error broadcast cond: %s\n", buf);
+            }   
+            RLOGD("dtr_wakeup success!\n");
+            sleep(3);
+        }
+        usleep(500);
+        pclose(fp);
+    }
+}
+/*jb.qi add for service send when DTR is low on 20221111 end */
+#endif
+
+void *send_feedback(void *sockfd)
+{
+    int commfd = *((int *)sockfd);
+    char buf[80];
+
+    while (1)
+    {
+        memset(buf,0,sizeof(buf));
+        ALOGI("send_feedback thread wait to send.\n");
+        pthread_mutex_lock(&feedback_mutex);
+        pthread_cond_wait(&feedback_cond,&feedback_mutex);
+
+        ALOGI("send_feedback thread is now sending the feedback to client.\n");
+        pthread_mutex_lock(&time_info_mutex);
+        if(Write(commfd,&time_info,sizeof(struct time_info_t)) <= 0) 
+        {
+            ALOGI("service send wakeup_feedback struct fail.\n");
+            Close(commfd);
+            pthread_mutex_unlock(&time_info_mutex);
+            pthread_mutex_unlock(&feedback_mutex);
+#ifdef GSW_SUSPEND_CFG
+            continue ;//jb.qi add for service send when DTR is low on 20221111 
+#endif
+
+#ifdef MOBILETEK_SUSPEND_CFG
+            break ;
+#endif
+        }        
+        pthread_mutex_unlock(&time_info_mutex);
+
+        pthread_mutex_unlock(&feedback_mutex);
+
+
+
+    }
+
+}
+
+
+int main(int argc, char **argv) {
+
+
+    // int i = 0;
+    // RLOGD("**Autosuspend Service Daemon Started**");
+    // RLOGD("**Autosuspend Service param count=%d**", argc);
+    char tmp[20];
+
+    int commfd, commfd_data, server_sock, server_data_sock,len, len_data;
+
+    struct sockaddr_un server_sockaddr;
+    struct sockaddr_un server_data_sockaddr;
+    struct sockaddr_un client_sockaddr;
+
+    len = sizeof(server_sockaddr);
+
+
+    pthread_t tid;
+#ifdef GSW_SUSPEND_CFG
+	pthread_t tid_1;//jb.qi add for service send when DTR is low on 20221111 
+#endif
+    
+    LYLOGEINIT(USER_LOG_TAG);
+    LYLOGSET(LOG_DEBUG);    
+    // LYLOGSET(LOG_ERROR);
+
+    int auto_enable = 0;
+
+    lynq_get_value(LOG_UCI_FILE, LOG_UCI_MODULE, "debug", tmp); // 即获取系统层面的环境变量
+    ALOGI("Autosuspend Service Daemon. debug %s\n",tmp);
+    adb_debug_mode=atoi(tmp);
+    lynq_get_value(LOG_UCI_FILE, LOG_UCI_MODULE, "auto_enable", tmp);
+    auto_enable=atoi(tmp);
+    ALOGI("Autosuspend Service Daemon. auto_enable %s\n",tmp);
+#ifdef MOBILETEK_SUSPEND_CFG
+    init_wakelock_func();
+    init_sim_func();
+#endif
+    signal(SIGPIPE,SIG_IGN); // 忽略SIGPIPE信号,防止由于客户端关闭,继续往客户端write,会导致服务端收到SIGPIPE信号而Broken pipe
+
+    
+    // init_network_func();
+
+    // if(pthread_cond_init(&feedback_cond,NULL) != 0)
+    // {
+    //     strerror_r(errno, buf, sizeof(buf));
+    //     ALOGI("Error creating cond: %s\n", buf);
+    //     return -1;
+    // }
+
+    set_wakeup_callback(wakeup_feedback);
+    // 注册回调函数
+
+   if(auto_enable==0)
+   {
+      if(autosuspend_disable() < 0)
+     {
+       ALOGI("autosuspend_disable fail.\n");
+     }
+     else
+     {
+       ALOGI("autosuspend_disable success.\n");
+     }
+   }
+   if(auto_enable==1)
+   {
+      if(autosuspend_enable() < 0)
+     {
+       ALOGI("autosuspend_enable fail.\n");
+     }
+     else
+     {
+       ALOGI("autosuspend_enable success.\n");
+     }
+   }
+
+
+    server_sock = listen_port(&server_sockaddr,SOCK_PATH);
+    if(server_sock == -1)
+        return -1;
+
+    server_data_sock = listen_port(&server_data_sockaddr,SOCK_DATA_PATH);
+    if(server_data_sock == -1)
+        return -1;
+#ifdef GSW_SUSPEND_CFG
+    /*jb.qi add for service send when DTR is low on 20221111 start*/
+    pthread_create(&tid_1,NULL,dtr_wakeup,NULL);
+    pthread_detach(tid_1);
+    /*jb.qi add for service send when DTR is low on 20221111 end*/
+#endif
+
+    while (1)
+    {
+        ALOGI("service socket listening...\n");
+        commfd = Accept(server_sock,(struct sockaddr *)&client_sockaddr,&len);
+        if(commfd == -1)
+        {
+            return -1;
+        }
+        if(getpeername(commfd, (struct sockaddr *)&client_sockaddr, &len) == -1)
+        {
+            ALOGI("GETPEERNAME ERROR.\n");
+            // Close(server_sock);
+            Close(commfd);
+            continue;
+        }
+        else
+        {
+            ALOGI("Client socket filepath: %s\n", client_sockaddr.sun_path);
+        }
+
+        commfd_data = Accept(server_data_sock,NULL,NULL);
+        if(commfd_data == -1)
+        {
+            return -1;
+        }
+        ALOGI("data channel connected.\n");
+        
+        pthread_create(&tid,NULL,deal_autosuspend,(void*)&commfd);//这里很容易错,最后一个参数要取地址,这是一个指针
+        pthread_detach(tid);   
+
+        pthread_create(&tid,NULL,send_feedback,(void*)&commfd_data);
+        pthread_detach(tid); 
+
+
+    }
+    
+ 
+}
+
+DEFINE_LYNQ_LIB_LOG(LYNQ_AUTOSUSPEND)
+
diff --git a/esdk/layers/meta-zxic-custom/recipes-lynq/lynq-autosuspend/files/makefile b/esdk/layers/meta-zxic-custom/recipes-lynq/lynq-autosuspend/files/makefile
new file mode 100755
index 0000000..ca263bf
--- /dev/null
+++ b/esdk/layers/meta-zxic-custom/recipes-lynq/lynq-autosuspend/files/makefile
@@ -0,0 +1,71 @@
+SHELL = /bin/sh
+RM = rm -f
+
+LOCAL_CFLAGS := -Wall \
+                -g -Os \
+                -flto \
+                -DRIL_SHLIB \
+                -DATCI_PARSE \
+                -DKEEP_ALIVE \
+                -D__LINUX_OS__ \
+                -DECALL_SUPPORT
+
+
+
+ifeq ($(strip $(TARGET_PLATFORM)), T106)
+LOCAL_CFLAGS += -DHAVE_SYS_UIO_H -DRIL_TIME_CB
+endif
+
+ifeq ($(strip $(TARGET_PLATFORM)), T106)
+    LOCAL_CFLAGS += -DMOBILETEK_TARGET_PLATFORM_T106
+endif
+
+ifeq ($(strip $(MOBILETEK_SUSPEND_CFG)), GSW)
+    LOCAL_CFLAGS += -DGSW_SUSPEND_CFG
+
+endif
+
+ifeq ($(strip $(MOBILETEK_SUSPEND_CFG)), PLATFORM)
+    LOCAL_CFLAGS += -DMOBILETEK_SUSPEND_CFG
+
+endif
+
+
+LOCAL_PATH   = .
+
+LOCAL_C_INCLUDES = \
+  -I.   -I$(ROOT)$(includedir)/liblog -I$(ROOT)$(includedir) \
+
+
+
+
+LOCAL_LIBS := \
+    -L. \
+    -ldl \
+    -lpthread \
+    -llynq-log \
+    -llynq-uci \
+    -llog \
+    -lbsp \
+    -lsctel \
+    -latutils \
+    -latreg \
+    -llynq-sim \
+
+
+SOURCES = $(wildcard *.c )
+
+EXECUTABLE = autosuspend
+
+OBJECTS=$(SOURCES:.c=.o)
+all: $(EXECUTABLE)
+
+$(EXECUTABLE): $(OBJECTS)
+	$(CXX) $(OBJECTS) $(LOCAL_LIBS) $(LOCAL_CFLAGS) $(LOCAL_C_INCLUDES) -o $@
+
+%.o : %.c
+	$(CC) $(LOCAL_C_INCLUDES) $(LOCAL_CFLAGS) $(LOCAL_LIBS) -o $@ -c $<
+
+.PHONY: clean
+clean:
+	$(RM) $(OBJECTS) $(EXECUTABLE)
diff --git a/esdk/layers/meta-zxic-custom/recipes-lynq/lynq-autosuspend/lynq-autosuspend.bb b/esdk/layers/meta-zxic-custom/recipes-lynq/lynq-autosuspend/lynq-autosuspend.bb
index f4e38fc..a3df67f 100755
--- a/esdk/layers/meta-zxic-custom/recipes-lynq/lynq-autosuspend/lynq-autosuspend.bb
+++ b/esdk/layers/meta-zxic-custom/recipes-lynq/lynq-autosuspend/lynq-autosuspend.bb
@@ -1,48 +1,68 @@
 inherit externalsrc package systemd
 
 DESCRIPTION = "autosuspend.service"
-LICENSE = "CLOSED"
 
+LICENSE = "MobileTekProprietary"
 LIC_FILES_CHKSUM = "file://${WORKDIR}/LICENSE;md5=44d8d2b6296ca24bcd4894bb7155bf27"
-DEPENDS += "${@bb.utils.contains('TARGET_PLATFORM', 'mt2735', 'audio-mixer-ctrl streamer1.0', '', d)} liblynq-log liblynq-uci libbsp libsctel libatutils libatreg liblynq-sim"
 
-WORKONSRC = "${TOPDIR}/../src/lynq/framework/lynq-autosuspend"
-FILESEXTRAPATHS_prepend :="${TOPDIR}/../src/lynq/framework/:"
-SRC_URI = " \
-          file://lynq-autosuspend \
-          "
-SRC-DIR = "${S}/../lynq-autosuspend"
+SRC_URI = "file://autosuspend.c file://LICENSE \
+           file://autosuspend.h \
+           file://autosuspend_ops.h \
+           file://autosuspend_wakeup_count.c \
+           file://main.c \
+           file://autosuspend.service \
+           file://lynq-autosuspend.sh \
+           file://makefile \
+"
+
 EXTRA_OEMAKE = "'TARGET_PLATFORM = ${TARGET_PLATFORM}'"
 
 TARGET_CC_ARCH += "${LDFLAGS}"
+
+LOCAL_C_INCLUDES = "-I. "
+
+DEPENDS = "liblynq-log liblynq-uci"
+DEPENDS += "${@bb.utils.contains('TARGET_PLATFORM', 'mt2735', 'audio-mixer-ctrl streamer1.0', '', d)} liblynq-log liblynq-uci libbsp libsctel libatutils libatreg liblynq-sim"
+LOCAL_LIBS = "-L. -ldl -lstdc++ -lpthread -llog"
+SOURCES = "$(wildcard *.c )"
+
+OBJECTS = "$(SOURCES:.c=.o)"
+
+EXECUTABLE = "autosuspend"
+S = "${WORKDIR}"
+TARGET_CC_ARCH += "${LDFLAGS}"
 SYSTEMD_PACKAGES = "${PN}"
 SYSTEMD_SERVICE_${PN} = "autosuspend.service"
 FILES_${PN} += "${systemd_unitdir}/system/autosuspend.service"
-
 #INHIBIT_PACKAGE_STRIP = "1"
 do_compile () {
 
 	#${CXX} -Wall ${LOCAL_C_INCLUDES} autosuspend.c autosuspend_wakeup_count.c main.c ${LOCAL_LIBS} -o ${EXECUTABLE}
 	if test "${PACKAGE_ARCH}" = "cortexa7hf-vfp-vfpv4-neon" || test "${PACKAGE_ARCH}" = "cortexa7hf-neon-vfpv4"; then
-		oe_runmake all -C ${SRC-DIR} ROOT=${STAGING_DIR_HOST} OFLAGS="--sysroot=${STAGING_DIR_HOST} -mhard-float"
+		oe_runmake all ROOT=${STAGING_DIR_HOST} OFLAGS="--sysroot=${STAGING_DIR_HOST} -mhard-float"
 	else
-		oe_runmake all -C ${SRC-DIR} ROOT=${STAGING_DIR_HOST} OFLAGS="--sysroot=${STAGING_DIR_HOST}"
+		oe_runmake all ROOT=${STAGING_DIR_HOST} OFLAGS="--sysroot=${STAGING_DIR_HOST}"
 	fi
 }
 
 do_install() {
 	install -d ${D}${bindir}/
-	install -m 0755 ${SRC-DIR}/autosuspend ${D}${bindir}/
+	echo "Installing image PN ${PN}"
+	echo "Installing image systemd_unitdir ${systemd_unitdir}"
+	echo "Installing image D ${D}"
+	echo "Installing image B ${B}"
 	if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
 		install -d ${D}${systemd_unitdir}/system/
 		install -m 0644 ${B}/autosuspend.service ${D}${systemd_unitdir}/system
-        else
+    else
 		install -d ${D}${sysconfdir}/init.d
-        	install -m 0755  ${SRC-DIR}/lynq-autosuspend.sh ${D}${sysconfdir}/init.d/
-        	install -d ${D}${sysconfdir}/rcS.d
-        	ln -s ../init.d/lynq-autosuspend.sh ${D}${sysconfdir}/rcS.d/S82lynq-autosuspend-service
+        install -m 0755  ${S}/lynq-autosuspend.sh ${D}${sysconfdir}/init.d/
+        install -d ${D}${sysconfdir}/rcS.d
+        ln -s ../init.d/lynq-autosuspend.sh ${D}${sysconfdir}/rcS.d/S82lynq-autosuspend-service
 	fi
 
+	install -m 0755 ${S}/autosuspend ${D}${bindir}/
+	install -d ${D}${includedir}
 }
 
 
diff --git a/esdk/layers/meta-zxic-custom/recipes-lynq/lynq-fota-backup/files/LICENSE b/esdk/layers/meta-zxic-custom/recipes-lynq/lynq-fota-backup/files/LICENSE
new file mode 100755
index 0000000..0489348
--- /dev/null
+++ b/esdk/layers/meta-zxic-custom/recipes-lynq/lynq-fota-backup/files/LICENSE
@@ -0,0 +1,31 @@
+opyright Statement:
+
+This software/firmware and related documentation ("MobileTek Software") are
+protected under relevant copyright laws. The information contained herein is
+confidential and proprietary to MobileTek Inc. and/or its licensors. Without
+the prior written permission of MobileTek inc. and/or its licensors, any
+reproduction, modification, use or disclosure of MobileTek Software, and
+information contained herein, in whole or in part, shall be strictly
+prohibited.
+
+Mobiletek Inc. (C) 2015. All rights reserved.
+
+BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MobileTek SOFTWARE")
+RECEIVED FROM MobileTek AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER
+ON AN "AS-IS" BASIS ONLY. MobileTek EXPRESSLY DISCLAIMS ANY AND ALL
+WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
+WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR
+NONINFRINGEMENT. NEITHER DOES MobileTek PROVIDE ANY WARRANTY WHATSOEVER WITH
+RESPECT TO THE SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY,
+INCORPORATED IN, OR SUPPLIED WITH THE MobileTek SOFTWARE, AND RECEIVER AGREES
+TO LOOK ONLY TO SUCH THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO.
+RECEIVER EXPRESSLY ACKNOWLEDGES THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO
+OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES CONTAINED IN MobileTek
+SOFTWARE. MobileTek SHALL ALSO NOT BE RESPONSIBLE FOR ANY MobileTek SOFTWARE
+RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR
+STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MobileTek'S
+ENTIRE AND CUMULATIVE LIABILITY WITH RESPECT TO THE MobileTek SOFTWARE
+RELEASED HEREUNDER WILL BE, AT MobileTek'S OPTION, TO REVISE OR REPLACE THE
+MobileTek SOFTWARE AT ISSUE, OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE
+CHARGE PAID BY RECEIVER TO MobileTek FOR SUCH MobileTek SOFTWARE AT ISSUE.
diff --git a/esdk/layers/meta-zxic-custom/recipes-lynq/lynq-fota-backup/files/lynq-fota-backup.cpp b/esdk/layers/meta-zxic-custom/recipes-lynq/lynq-fota-backup/files/lynq-fota-backup.cpp
new file mode 100755
index 0000000..c2e7d1d
--- /dev/null
+++ b/esdk/layers/meta-zxic-custom/recipes-lynq/lynq-fota-backup/files/lynq-fota-backup.cpp
@@ -0,0 +1,259 @@
+/*******************************************************

+* 

+* @brief:

+* @details:  add fota A/B backup service 

+* @author:   l.yang

+* @date:     2023.8.29

+* @version:  V1.0

+* @copyright:Copyright (c) MobileTek 

+*

+*********************************************/

+

+

+#include <stdio.h>

+#include <stdlib.h>

+#include <stdbool.h>

+#include <dlfcn.h>

+#include <string.h>

+#include <pthread.h>

+#include <stdint.h>

+#include <unistd.h>

+#include <fcntl.h>

+#include <errno.h>

+#include <liblog/lynq_deflog.h>

+

+

+#ifdef __cplusplus

+extern "C" {

+#endif

+

+#define FOTA_REBOOT_FLAG "/mnt/userdata/.fota_reboot_flag"

+#define FOTA_FLAG_FILE "/mnt/userdata/.back_up_flag"

+#define FOTA_SYNC_FLAG    1

+#define FOTA_CURRENT_SYS  "/mnt/userdata/.fota_current_sys"

+

+#define USER_LOG_TAG "LYNQ_FOTA_BACKUP"

+

+extern int lynq_sync_system();

+extern int lynq_fota_get_addr_value(char *tmp_value);

+extern int lynq_fota_set_addr_value(char        *value,int size);

+extern int lynq_fota_nrestart(void);

+extern int lynq_get_current_system();

+

+

+#define REBOOT_DONE  1

+

+void set_upgrade_reboot_flag(void)

+{

+    FILE *fp = NULL;

+    int reboot_flag = REBOOT_DONE;

+    fp = fopen(FOTA_REBOOT_FLAG,"w+");

+    if(fp == NULL)

+    {

+        LYERRLOG("Open reboot flag file failed\n");

+        return;

+    }

+    

+    fwrite(&reboot_flag,sizeof(int),1,fp);

+    fclose(fp);

+    system("sync");

+    return ;

+}

+

+int check_need_sync()

+{

+    int current_sys = 0;

+    int record_sys = 0;

+    int ret = 0;

+    char tmp_sys[8] = {0};

+    FILE *fp = NULL;

+

+    //not fota 

+    if(access(FOTA_FLAG_FILE, F_OK) == -1)

+    {

+        LYINFLOG("Fota flag file no exist\n");

+

+        //file no exist,get current sys write to file

+        if(access(FOTA_CURRENT_SYS,F_OK) == -1)

+        {

+            LYINFLOG("Record current sys file no exist\n");

+            

+            fp = fopen(FOTA_CURRENT_SYS,"w");

+            if(fp == NULL)

+             {

+                LYERRLOG("creat  record current file failed\n");

+                return -1;

+            }

+            current_sys = lynq_get_current_system();

+            if(current_sys < 0)

+            {

+                LYERRLOG("Get current system failed %d\n",current_sys);

+                fclose(fp);

+                return -1;

+            }

+            else

+            {

+                

+                LYINFLOG("Get current system success  %d\n",current_sys);

+                fprintf(fp, "%d", current_sys);

+                fclose(fp);

+                system("sync");

+                

+                return 0;

+            }

+        }

+        else

+        {

+            current_sys = lynq_get_current_system();

+            if(current_sys < 0)

+            {

+                LYERRLOG("Get current system failed %d\n",current_sys);

+                return -1;

+            }

+

+            LYINFLOG("Get current system success  %d\n",current_sys);

+            

+            fp = fopen(FOTA_CURRENT_SYS,"r");

+            if(fp == NULL)

+            {

+                LYERRLOG("read file failed \n");

+                return -1;

+            }

+        

+            if(fgets(tmp_sys, sizeof(tmp_sys), fp) != NULL)

+            {

+                record_sys = atoi(tmp_sys);

+            }

+            else

+            {

+                LYERRLOG("tmp_sys is NULL");

+                fclose(fp);

+                return -1;

+            }

+            

+            if( record_sys == current_sys)

+            {

+                LYINFLOG("System not need sync \n");

+                fclose(fp);

+                return 0;

+            }

+            else 

+            {

+                LYINFLOG("System need sync \n");

+                ret = lynq_sync_system();

+                if(ret < 0 )

+                {

+                    LYERRLOG("A/B sync system failed \n");

+                    fclose(fp);

+                    return -1;

+                }

+                LYINFLOG("A/B sync system success,record current sys \n");

+                fclose(fp);

+                fp = fopen(FOTA_CURRENT_SYS,"w");

+                if(fp == NULL)

+                {

+                    LYERRLOG("creat file failed  \n");

+                    return -1;

+                }

+                

+                fprintf(fp,"%d",current_sys);

+                fclose(fp);

+                system("sync");

+                

+                return 0;

+            }

+        }

+            

+        

+    }

+    else

+    {

+        fp = fopen(FOTA_CURRENT_SYS,"w");

+        if(fp == NULL)

+        {

+            LYERRLOG("Creat file failed \n");

+            return -1;

+        }

+        LYINFLOG("fota flag file exist,record current sys \n");

+        current_sys = lynq_get_current_system();

+        if(current_sys < 0)

+        {

+            LYERRLOG("Get current system failed %d\n",current_sys);

+            fclose(fp);

+            return -1;

+        }

+        

+        fprintf(fp,"%d",current_sys);

+        fclose(fp);

+        system("sync");

+        return 0;

+    }

+           

+

+}

+

+int main()

+{

+    int ret = 0 ;

+    int sync_flag = 0;

+    char tmp_addr[128] = {0};

+    FILE *fp = NULL;

+

+    check_need_sync();

+

+    fp = fopen(FOTA_FLAG_FILE,"r");

+    if(fp == NULL)

+    {

+        LYERRLOG("No need fota sync\n");

+        return -1;

+

+    }

+

+    fread(&sync_flag,sizeof(int),1,fp);

+    fclose(fp);

+    

+    set_upgrade_reboot_flag();

+    

+    if(sync_flag == FOTA_SYNC_FLAG)

+    {

+        ret = lynq_sync_system();

+        if(ret != 0)

+        {

+            LYERRLOG("sync faild\n");

+        }

+       system("rm -rf /mnt/userdata/.back_up_flag");

+        

+    }

+    else if(sync_flag != FOTA_SYNC_FLAG)

+    {

+        ret = lynq_fota_get_addr_value(tmp_addr);

+        if(ret != 0)

+        {

+            LYERRLOG("Get addr failed\n");

+            return -1;

+        }

+        LYINFLOG("tmp_addr is %s\n",tmp_addr);

+        ret = lynq_fota_set_addr_value(tmp_addr,10);

+        if(ret != 0)

+        {

+            LYERRLOG("Set addr failed\n");

+            return -1;

+        }

+        ret = lynq_fota_nrestart();

+        if(ret != 0)

+        {

+            LYERRLOG("Upgrade failed\n");

+            return -1;

+        }

+        

+    }

+   

+    return 0;

+

+}

+DEFINE_LYNQ_LIB_LOG(LYNQ_FOTA_BACKUP)

+

+#ifdef __cplusplus

+}

+#endif

+

diff --git a/esdk/layers/meta-zxic-custom/recipes-lynq/lynq-fota-backup/files/lynq-fota-backup.service b/esdk/layers/meta-zxic-custom/recipes-lynq/lynq-fota-backup/files/lynq-fota-backup.service
new file mode 100755
index 0000000..28851ff
--- /dev/null
+++ b/esdk/layers/meta-zxic-custom/recipes-lynq/lynq-fota-backup/files/lynq-fota-backup.service
@@ -0,0 +1,10 @@
+[Unit]
+Description=lynq-fota-backup-service
+
+[Service]
+ExecStart=/usr/bin/lynq-fota-backup
+Type=simple
+
+[Install]
+WantedBy=multi-user.target
+
diff --git a/esdk/layers/meta-zxic-custom/recipes-lynq/lynq-fota-backup/files/lynq-fota-backup.sh b/esdk/layers/meta-zxic-custom/recipes-lynq/lynq-fota-backup/files/lynq-fota-backup.sh
new file mode 100755
index 0000000..53eb20f
--- /dev/null
+++ b/esdk/layers/meta-zxic-custom/recipes-lynq/lynq-fota-backup/files/lynq-fota-backup.sh
@@ -0,0 +1,39 @@
+#!/bin/sh
+#
+# Run the daemon
+#
+
+DAEMON="lynq-fota-backup-service"
+PIDFILE="/var/run/$DAEMON.pid"
+EXEC="/usr/bin/lynq-fota-backup"
+EXEC_ARGS=""
+
+
+start() {
+        echo -n "Starting $DAEMON... "
+        start-stop-daemon --no-close -S -b -m -p $PIDFILE -x $EXEC -- $EXEC_ARGS
+        [ $? -eq 0 ] && echo "OK" || echo "ERROR"
+}
+
+stop() {
+        echo -n "Stopping $DAEMON... "
+        start-stop-daemon -K -p $PIDFILE
+        [ $? -eq 0 ] && echo "OK" || echo "ERROR"
+}
+
+restart() {
+        stop
+        start
+}
+
+case "$1" in
+  start|stop|restart)
+        "$1"
+        ;;
+  *)
+        echo "Usage: $0 {start|stop|restart}"
+        exit 1
+esac
+
+exit $?
+
diff --git a/esdk/layers/meta-zxic-custom/recipes-lynq/lynq-fota-backup/files/makefile b/esdk/layers/meta-zxic-custom/recipes-lynq/lynq-fota-backup/files/makefile
new file mode 100755
index 0000000..0a349d3
--- /dev/null
+++ b/esdk/layers/meta-zxic-custom/recipes-lynq/lynq-fota-backup/files/makefile
@@ -0,0 +1,57 @@
+SHELL = /bin/sh

+RM = rm -f

+

+LOCAL_CFLAGS := -Wall \

+                -std=gnu++14 \

+                -g -Os \

+                -flto \

+                -fPIC \

+    

+                

+ 

+ifeq ($(strip $(TARGET_PLATFORM)), T106)

+LOCAL_CFLAGS += -DBINDER_IPC_32BIT=1 -DHAVE_ENDIAN_H -DHAVE_PTHREADS -DHAVE_SYS_UIO_H -DHAVE_POSIX_FILEMAP -DHAVE_STRLCPY -DHAVE_PRCTL -DHAVE_MEMSET16 -DHAVE_MEMSET32 -DANDROID_SMP=0

+endif

+

+LOCAL_CFLAGS += -Werror=format-security

+

+$(warning ################# rock ROOT: $(ROOT),includedir:$(includedir),)

+

+LOCAL_PATH   = .

+

+LOCAL_C_INCLUDES = \

+  -I. \

+  -I$(LOCAL_PATH)/include \

+  -I$(ROOT)$(includedir)/logger \

+  -I$(ROOT)$(includedir)/liblog \

+  -I$(ROOT)$(includedir)/glib-2.0 \

+  -I$(ROOT)$(libdir)/glib-2.0/include \

+  -I$(ROOT)$(includedir)  \

+

+

+

+LOCAL_LIBS := \

+    -L. \

+    -ldl \

+    -lstdc++ \

+    -llynq-log \

+    -llynq-fota \

+

+SOURCES = lynq-fota-backup.cpp

+

+EXECUTABLE = lynq-fota-backup

+

+OBJECTS=$(SOURCES:.cpp=.o)

+

+all: $(EXECUTABLE) 

+$(EXECUTABLE): $(OBJECTS)

+	$(CXX) $(OBJECTS) $(LOCAL_LIBS) $(LOCAL_CFLAGS) $(LOCAL_C_INCLUDES) -o $@

+

+%.o : %.cpp

+	$(CXX) $(LOCAL_C_INCLUDES) $(LOCAL_CFLAGS) $(LOCAL_LIBS) -o $@ -c $< 

+

+.PHONY: clean

+clean:

+	$(RM) $(OBJECTS) $(EXECUTABLE)

+	$(RM) $(OBJECTS_TOOL) $(EXECUTABLE)

+

diff --git a/esdk/layers/meta-zxic-custom/recipes-lynq/lynq-fota-backup/lynq-fota-backup.bb b/esdk/layers/meta-zxic-custom/recipes-lynq/lynq-fota-backup/lynq-fota-backup.bb
index 89ed7f6..b89f7ab 100755
--- a/esdk/layers/meta-zxic-custom/recipes-lynq/lynq-fota-backup/lynq-fota-backup.bb
+++ b/esdk/layers/meta-zxic-custom/recipes-lynq/lynq-fota-backup/lynq-fota-backup.bb
@@ -2,28 +2,31 @@
 
 DESCRIPTION = "lynq-fota-backup.service"
 
-LICENSE = "CLOSED"
+LICENSE = "MIT"
 ##License checksum file is always required
 LIC_FILES_CHKSUM = "file://${WORKDIR}/LICENSE;md5=c794e8ff1acd3b7f156a6497e780dd54"
 
-WORKONSRC = "${TOPDIR}/../src/lynq/framework/lynq-fota-backup"
+SRC_URI = "file://lynq-fota-backup.cpp \
+	   file://lynq-fota-backup.sh \
+	   file://makefile \
+	   file://lynq-fota-backup.service \
+	   file://LICENSE \
+"
 
-FILESEXTRAPATHS_prepend :="${TOPDIR}/../src/lynq/framework/:"
-SRC_URI = " \
-          file://lynq-fota-backup \
-          "
-SRC-DIR = "${S}/../lynq-fota-backup"
+
 TARGET_CC_ARCH += "${LDFLAGS}"
-DEPENDS += "liblynq-log liblynq-uci liblynq-qser-fota"
 
+
+DEPENDS += "liblynq-log liblynq-uci liblynq-qser-fota"
+S = "${WORKDIR}"
 #INHIBIT_PACKAGE_STRIP = "1"
 do_compile () {
 
 	
 	if test "${PACKAGE_ARCH}" = "cortexa7hf-vfp-vfpv4-neon" || test "${PACKAGE_ARCH}" = "cortexa7hf-neon-vfpv4"; then
-		oe_runmake all -C ${SRC-DIR} ROOT=${STAGING_DIR_HOST} OFLAGS="--sysroot=${STAGING_DIR_HOST} -mhard-float"
+		oe_runmake all ROOT=${STAGING_DIR_HOST} OFLAGS="--sysroot=${STAGING_DIR_HOST} -mhard-float"
 	else
-		oe_runmake all -C ${SRC-DIR} ROOT=${STAGING_DIR_HOST} OFLAGS="--sysroot=${STAGING_DIR_HOST}"
+		oe_runmake all ROOT=${STAGING_DIR_HOST} OFLAGS="--sysroot=${STAGING_DIR_HOST}"
 	fi
 }
 #INHIBIT_PACKAGE_STRIP = "1"
@@ -31,16 +34,21 @@
 
 do_install() {
 	install -d ${D}${bindir}/
-	install -m 0755 ${SRC-DIR}/lynq-fota-backup ${D}${bindir}/
+	echo "Installing image PN ${PN}"
+	echo "Installing image systemd_unitdir ${systemd_unitdir}"
+	echo "Installing image D ${D}"
+	echo "Installing image B ${B}"
 
 	if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
 		install -d ${D}${systemd_unitdir}/system/
 		install -m 0644 ${B}/lynq-fota-backup.service ${D}${systemd_unitdir}/system
     else
 		install -d ${D}${sysconfdir}/init.d
-        	install -m 0755  ${SRC-DIR}/lynq-fota-backup.sh ${D}${sysconfdir}/init.d/
+        	install -m 0755  ${S}/lynq-fota-backup.sh ${D}${sysconfdir}/init.d/
         	install -d ${D}${sysconfdir}/rcS.d
         	ln -s ../init.d/lynq-fota-backup.sh ${D}${sysconfdir}/rcS.d/S82lynq-fota-backup-service
 	fi
 
+	install -m 0755 ${S}/lynq-fota-backup ${D}${bindir}/
+	install -d ${D}${includedir}
 }
diff --git a/esdk/layers/meta-zxic-custom/recipes-lynq/lynq-gnss-update/files/main.c b/esdk/layers/meta-zxic-custom/recipes-lynq/lynq-gnss-update/files/main.c
index c7752c6..6b9fddd 100755
--- a/esdk/layers/meta-zxic-custom/recipes-lynq/lynq-gnss-update/files/main.c
+++ b/esdk/layers/meta-zxic-custom/recipes-lynq/lynq-gnss-update/files/main.c
@@ -203,9 +203,6 @@
     }

 

     /*go to boot-mode need change pin status*/

-    lynq_gpio_init(84,1,0,0);

-    lynq_gpio_value_set(84,1);

-    usleep(500000);//500ms

     lynq_gpio_init(15,1,0,0);

     lynq_gpio_value_set(15, 0);

     usleep(100000);//100ms

@@ -216,7 +213,6 @@
     usleep(100000);//100ms

     lynq_gpio_direction_set(15, 0);

     lynq_gpio_pullsel_set(15, 0);

-    lynq_gpio_deinit(84);

     lynq_gpio_deinit(15);

     lynq_gpio_deinit(126);

 

diff --git a/esdk/layers/meta-zxic-custom/recipes-lynq/lynq-qser-voice-demo/files/lynq-qser-voice-demo.cpp b/esdk/layers/meta-zxic-custom/recipes-lynq/lynq-qser-voice-demo/files/lynq-qser-voice-demo.cpp
index e7eebc3..41c5c97 100755
--- a/esdk/layers/meta-zxic-custom/recipes-lynq/lynq-qser-voice-demo/files/lynq-qser-voice-demo.cpp
+++ b/esdk/layers/meta-zxic-custom/recipes-lynq/lynq-qser-voice-demo/files/lynq-qser-voice-demo.cpp
@@ -29,8 +29,6 @@
     {7,   "qser_voice_set_test_num"},

     {8,   "qser_voice_fast_ecall"},

 #endif

-    {9,   "qser_voice_set_audio_mode"},

-    {10,  "qser_voice_get_audio_mode"},

     {-1,    NULL}

 };

 

@@ -53,9 +51,6 @@
 int (*qser_voice_set_speech_volume)(const int volume);

 int (*qser_voice_get_speech_volume)(int *volume);

 int (*qser_voice_set_dtmf)(const char callnum);

-int (*qser_voice_set_audio_mode)(const int audio_mode);

-int (*qser_voice_get_audio_mode)(int* audio_mode);

-

 

 #ifdef ECALL_SUPPORT

 int (*qser_voice_set_test_num)(voice_client_handle_type*       h_voice,E_QSER_VOICE_ECALL_SET_TYPE_T type, const char *test_num, int test_num_length);

@@ -124,7 +119,6 @@
     int ret    = 0;

     int  voice_call_id = 0;

     voice_client_handle_type    h_voice     = 0;

-    int audio_mode = 0;

     

     const char *lynqLibPath_Call = "/lib/liblynq-qser-voice.so";

     dlHandle_call = dlopen(lynqLibPath_Call, RTLD_NOW);

@@ -236,23 +230,7 @@
             printf("qser_voice_add_ecall_indhandler not defined or exported in %s\n", lynqLibPath_Call);

             return -1;

     }

-#endif    

-

-    qser_voice_set_audio_mode = (int(*)(const int audio_mode))dlsym(dlHandle_call, "qser_voice_set_audio_mode");

-    if(qser_voice_set_audio_mode == NULL) 

-    {

-        printf("qser_voice_set_audio_mode not defined or exported in %s\n", lynqLibPath_Call);

-        return -1;

-    }

-

-    

-    qser_voice_get_audio_mode = (int(*)(int* audio_mode))dlsym(dlHandle_call, "qser_voice_get_audio_mode");

-    if(qser_voice_get_audio_mode == NULL) 

-    {

-        printf("qser_voice_get_audio_mode not defined or exported in %s\n", lynqLibPath_Call);

-        return -1;

-    }

-    

+#endif

     

     ret = qser_voice_call_client_init(&h_voice);

     if(ret != 0 )

@@ -371,12 +349,8 @@
             case 7:

             {                

                 char PhoneNum[32] = {0};                 

-                printf("please input test phone number(input null means \"\"): \n");

-                scanf("%s", PhoneNum);     

-                if(0 == strcmp(PhoneNum, "null"))

-                {

-                    PhoneNum[0]='\0';

-                }

+                printf("please input test phone number: \n");

+                scanf("%s", PhoneNum);                            

                 ret = qser_voice_set_test_num(&h_voice, E_QSER_VOICE_ECALL_SET_NUMBER, PhoneNum, strlen(PhoneNum)+1);

                 printf("qser_voice_set_test_num ret = %d\n", ret);

                 break;

@@ -404,22 +378,6 @@
                 break;

             }            

 #endif

-            case 9:

-            {   

-                

-                printf("please input voice audio mode: 0 codec, 1 rtp\n");

-                scanf("%d", &audio_mode);

-                ret = qser_voice_set_audio_mode(audio_mode);

-                printf("qser_voice_set_audio_mode ret = %d, audio_mode is %d\n", ret, audio_mode);

-                break;

-            }            

-            case 10:

-            {  

-                ret = qser_voice_get_audio_mode(&audio_mode);

-                printf("qser_voice_get_audio_mode ret = %d, audio_mode is %d\n", ret, audio_mode);

-                break;

-            }            

-

             default:

                 print_help();

                 break;

diff --git a/esdk/layers/meta-zxic-custom/recipes-lynq/lynq-vb-demo/files/lynq_vb_demo.c b/esdk/layers/meta-zxic-custom/recipes-lynq/lynq-vb-demo/files/lynq_vb_demo.c
deleted file mode 100755
index fc94d2a..0000000
--- a/esdk/layers/meta-zxic-custom/recipes-lynq/lynq-vb-demo/files/lynq_vb_demo.c
+++ /dev/null
@@ -1,770 +0,0 @@
-#include <stdio.h>

-#include <unistd.h>

-#include <string.h>

-#include <stdlib.h>

-#include <stdint.h>

-#include <sys/ioctl.h>

-#include <fcntl.h>

-//#include "voice_ipc.h"

-

-#define _USE_VOICE_BUFFER

-#include "voice_lib.h"

-#include <fcntl.h>

-#include <signal.h>

-#include <semaphore.h>

-#include <sys/types.h>

-#include <pthread.h>

-

-/*command max len*/

-#define VOICE_CMD_MAX_LEN 64

-

-#define EXIT_CMD_STOP	"stop\n"

-#define EXIT_CMD_Q	"q\n"

-#define EXIT_CMD_EXIT   "exit\n"

-

-#define REQ_VOICE_BUFFER_TEST_START        "voice_buffer_test_start"

-#define REQ_VOICE_BUFFER_TEST_STOP         "voice_buffer_test_stop"

-#define REQ_VOICE_BUFFER_LOOP_TEST_START        "voice_buffer_loop_test_start"

-#define REQ_VOICE_BUFFER_LOOP_TEST_STOP         "voice_buffer_loop_test_stop"

-#define REQ_VOICE_BUFFER_RTP_TEST_START        "voice_buffer_rtp_test_start"

-#define REQ_VOICE_BUFFER_RTP_TEST_STOP         "voice_buffer_rtp_test_stop"

-

-

-  

-#define VBUFFER_TX_FILE_NAME "/mnt/userdata/tx.pcm"

-#define VBUFFER_RX_FILE_NAME "/mnt/userdata/rx.pcm"

-#define VBUFFER_TX16_FILE_NAME "/mnt/userdata/tx16.pcm"

-#define VBUFFER_RX16_FILE_NAME "/mnt/userdata/rx16.pcm"

-

-

-

-#define VB_MAX_INT	     0x7fffffff

-#define VB_MIN_INT        0 

-#define VB_INT_OVERFLOW(x) if((x < VB_MIN_INT)||(x > VB_MAX_INT))  x = 0;

- 

-#define RX_FILE_LEN_MAX 0x100000  

-

-

-

-typedef int (vb_thread_proc)(void*);

-struct vbuf_info_t

-{

-	int fd;

-    pthread_t	    rx_test_thread;	

-    pthread_t	    tx_test_thread;

-	pthread_t	    loop_test_thread;

-	int quit;

-	char        	*tx_buf;

-    char        	*rx_buf;

-	int buf_size;

-	char *tx_filename;

-	char *rx_filename;

-    FILE *tx_file;

-	FILE *rx_file;

-    int tx_filesize;

-	int rx_filesize;		

-	int fs;	 	

-};

-

-static struct vbuf_info_t vbuf_rec;

-

-static void printUsage(const char *Opt)

-{

-    printf("Usage: %s\n", Opt);

-     

-    printf("voice_buffer_test_start                      value: 8000,16000\n");

-    printf("voice_buffer_test_stop                       no value input\n");

-	printf("voice_buffer_loop_test_start                      value: 8000,16000\n");

-    printf("voice_buffer_loop_test_stop                       no value input\n");

-    printf("\n");

-}

-

-static int vbuffer_start_flag = 0;

-static int tx_optcount = 0;

-static int rx_optcount = 0;	

-static int first_rderr_flag = 0;

-static int first_wrerr_flag = 0;

-

-static int vb_close_fd_release_buf()

-{    

-    int ret = voice_buffer_close(vbuf_rec.fd); 

-    if(ret != 0) 

-    {

-		printf("%s : vb close fail \n",__func__);

-    }

-	vbuf_rec.fd = -1;

-

-    if(vbuf_rec.rx_buf)

-    {

-	    free(vbuf_rec.rx_buf);

-    	vbuf_rec.rx_buf = NULL;

-    }

-

-    if(vbuf_rec.tx_buf)

-    {

-        free(vbuf_rec.tx_buf);

-    	vbuf_rec.tx_buf = NULL;

-    }

-

-	vbuffer_start_flag = 0;	

-    printf("close buf fd and release buf end\n");

-    return ret;

-}

-

-

-

-//whole rx path

-static int vb_rx_test_thread_func(void *arg)

-{

-    int ret;

-

-    char* buf = vbuf_rec.rx_buf;

-    int size = vbuf_rec.buf_size;

-    int bytes_read = 0;

-    int r_size;

-

- 

-    printf( "%s: start size=%d! \n",__func__,size);

-    memset (buf,0, size);

-    

-    while (!vbuf_rec.quit) 

-    {

-		rx_optcount ++;	

-		VB_INT_OVERFLOW(rx_optcount);

-		if((rx_optcount%1000) == 0){

-            printf("%s: rx_optcount=%d! \n",__func__,rx_optcount);

-

-		}

-		else if(rx_optcount == 1000000){

-            printf("%s: rx_optcount=%d! \n",__func__,rx_optcount);

-			rx_optcount = 0;

-			

-		}

-

-        //read form ps

-		r_size = voice_buffer_read(vbuf_rec.fd, buf, size);

-        if(r_size <= 0) 

-        {

-            first_rderr_flag++;			

-			VB_INT_OVERFLOW(first_rderr_flag);			

-            continue ;

-        }

-		else{

-			first_rderr_flag = 0;

-

-		}

-		

-        if(vbuf_rec.rx_file != NULL) 

-        {

-			r_size = fwrite(buf, 1,size, vbuf_rec.rx_file);

-

-		    if (r_size != size) {

-		        //printf("Error fwrite size not eq,r_size=%d,size=%d\n",r_size,size);

-		    }

-			else{

-			

-		        bytes_read += size;

-				if(bytes_read >= vbuf_rec.rx_filesize){

-					fseek(vbuf_rec.rx_file, 0, SEEK_SET);

-					bytes_read = 0;

-					printf("fwrite over write maxsize(%d)!!!\n",vbuf_rec.rx_filesize);

-				

-				}

-			}

-        }

-		

-		

-    }

-    

-    return 0;

-}

-

-static int vb_tx_test_thread_func(void *arg)

-{

-    int ret;

-    int num_read;

-

-	

-    char* buf = vbuf_rec.tx_buf;

-	

-    int size = vbuf_rec.buf_size;

-     int w_size;

-

-	 printf("%s: start size=%d! \n",__func__,size);

- 

-	

-    memset(buf, 0,size);    

-    while (!vbuf_rec.quit) 

-    {

-

-	    if(vbuf_rec.tx_file != NULL) 

-	    {

-

-	        num_read = fread(buf,1,size, vbuf_rec.tx_file);

-			

-	        if (num_read != size) {

-		        //printf("Error fread size not eq,num_read=%d,size=%d\n",num_read,size);

-			}

-	        if (num_read <= 0) {

-		        printf("Error fread size not eq,num_read=%d,size=%d\n",num_read,size); 

-				fseek(vbuf_rec.tx_file, 0, SEEK_SET);

-			}

-	    }			

-		tx_optcount ++;

-		VB_INT_OVERFLOW(tx_optcount);

-		

-		w_size = voice_buffer_write(vbuf_rec.fd, buf, size);

-        if(w_size <= 0) 

-        {

-        	first_wrerr_flag++;

-			

-			VB_INT_OVERFLOW(first_wrerr_flag);

-			

-            continue;

-        }

-		else{

-			first_wrerr_flag = 0;

-

-		}

-

-    }

-    return 0;

-}

-

-

-static int vb_thread_create( const char *name,pthread_t	*thread_t, vb_thread_proc *proc, 

-								int stack_size, unsigned priority,void *arg )

-{

-    pthread_attr_t thread_attr;

-    int ret;

-	int default_size;

-    

-    struct sched_param    param;

-    int  policy = SCHED_FIFO;

-    

-    printf("%s: start! \n",__func__);

-    

-    /* Init thread attributes */

-    pthread_attr_init(&thread_attr);    

-    /* Create the thread. */

-

-    ret = pthread_create( thread_t, &thread_attr,proc, arg);

-    if (ret != 0) 

-    {

-    	printf("%s: pthread_create fail,ret=%d! \n",__func__,ret);

-    

-    	pthread_attr_destroy(&thread_attr);

-        return ret;

-    }

-	

-    pthread_attr_getstacksize(&thread_attr, &default_size);

-    printf("%s: pthread_attr_getstacksize(%d)! \n",__func__,default_size);

-    

-    pthread_attr_destroy(&thread_attr);

-	

-    printf("%s: end \n",__func__);

-    return 0;

-}

-

-

-int voice_buffer_stream_test_stop(void);

-

-int voice_buffer_stream_test_start(int fs)

-{

-    int ret = 0;

-    int buf_size = 320;

-	tx_optcount = 0;

-	rx_optcount = 0;	

-    int* buf_int;

-

-	int i;

-

-	if(vbuffer_start_flag == 1){ 

-		printf(" VB already start,return \n");

-

-		return 0;

-	}

-

-	vbuffer_start_flag = 1;

-

-

-

-	if((vbuf_rec.fd != -1)&&(vbuf_rec.fd != 0)){

-		printf(" VB fd already get, vbuf_rec.fd=%d return \n",vbuf_rec.fd);

-	}

-

-	if(fs == 8000){

-

-		buf_size = 320;

-	}

-	else if(fs == 16000){

-

-		buf_size = 640;

-	}	

-	else

-	{

-		buf_size = 320;

-	}

- 	printf("Starting vb stream fs=%d buf_size=%d \n",fs,buf_size);

-

- 	printf("%s:open tx and rx file \n",__func__);

-	if(fs == 8000){

-

-   		vbuf_rec.tx_filename = VBUFFER_TX_FILE_NAME;//"/cache/tx.pcm";

-    	vbuf_rec.rx_filename = VBUFFER_RX_FILE_NAME;//"/cache/rx.pcm";

-

-	}

-	else if(fs == 16000){

-

-    	vbuf_rec.tx_filename = VBUFFER_TX16_FILE_NAME;//"/cache/tx16.pcm";

-    	vbuf_rec.rx_filename = VBUFFER_RX16_FILE_NAME;//"/cache/rx16.pcm";

-

-	}	

-	else

-	{

-		vbuf_rec.tx_filename = VBUFFER_TX_FILE_NAME;//"/cache/tx.pcm";

-		vbuf_rec.rx_filename = VBUFFER_RX_FILE_NAME;//"/cache/rx.pcm";

-

-	}

-

-

-

-	

-    vbuf_rec.tx_file = fopen(vbuf_rec.tx_filename , "rb");

-    if (!vbuf_rec.tx_file) {

-        printf("Unable to open file '%s'\n", vbuf_rec.tx_filename);

-        //return -1;

-    }

-

-

-    vbuf_rec.rx_file = fopen(vbuf_rec.rx_filename, "wb");

-    if (!vbuf_rec.rx_file) {

-        printf(stderr, "Unable to create file '%s'\n", vbuf_rec.rx_filename);

-		//fclose(vbuf_rec.tx_file);

- 

-        //return -1;

-    }

-	vbuf_rec.rx_filesize = RX_FILE_LEN_MAX;	

-	printf("%s : vbuf_rec.rx_filesize(%d) \n",__func__,vbuf_rec.rx_filesize);

-

-    vbuf_rec.rx_buf = (char*) malloc(buf_size);

-	if(!vbuf_rec.rx_buf) {

-		printf("%s : malloc buf fail,return \n",__func__);

-		goto err;

-	}	

-    vbuf_rec.tx_buf = (char*) malloc(buf_size);  

-	if(!vbuf_rec.tx_buf) {

-		free(vbuf_rec.rx_buf);

-		printf("%s : malloc buf fail,return \n",__func__);

-	    vbuf_rec.rx_buf = NULL;

-		goto err;

-	}	

-	vbuf_rec.buf_size = buf_size;

-	

-    vbuf_rec.quit = 0;

-	

-	printf("%s : vb open start \n",__func__);

-

-	

-    vbuf_rec.fd = voice_buffer_open();

-	if(vbuf_rec.fd <= 0){

-		printf("%s : vb open fail fd=%d,return \n",__func__,vbuf_rec.fd);

-		ret = -1;

-		goto err;

-		

-	}

-	printf("%s :voice_buffer_open end \n",__func__);

-	

-	printf("%s :rx tx vb_thread_create start \n",__func__);

-    ret = vb_thread_create ("vb_playback_test",&vbuf_rec.rx_test_thread, vb_rx_test_thread_func, 

-    							4*1024,35,NULL);

-    if (ret != 0)

-    {

-		printf("%s :rx vb_thread_create fail ret=%d,return \n",__func__,ret);  

-        vbuf_rec.rx_test_thread = NULL;

-		goto err;

-    }

-

-	printf("%s :rx vb_thread_create end \n",__func__);

-

-    ret = vb_thread_create ( "vbuf_record_test", &vbuf_rec.tx_test_thread, vb_tx_test_thread_func,

-    							4*1024,35,NULL);

-    if (ret != 0) 

-    {

-    

-		printf("%s :tx vb_thread_create fail ret=%d,return \n",__func__,ret);       

-        vbuf_rec.tx_test_thread = NULL;

-		goto err;

-    }

-	printf("%s :tx vb_thread_create end \n",__func__);

-

-    return 0;

-

-err:

-    voice_buffer_stream_test_stop();

-	

-    return ret;

-}

-

-

-//Stop stream

-int voice_buffer_stream_test_stop(void)

-{

-    int ret = 0;

-	printf("%s:rx tx thread exit start \n",__func__);

-	if(vbuf_rec.quit == 1) {

-		printf("%s,already stop ,return\n",__func__);

-

-	}

-    

-    vbuf_rec.quit = 1;

-	voice_buffer_stop(vbuf_rec.fd);

-    if (vbuf_rec.tx_test_thread) 

-    {

-        pthread_join (vbuf_rec.tx_test_thread,NULL);

-        vbuf_rec.tx_test_thread = NULL;

-		

-    }

-    

-    if (vbuf_rec.rx_test_thread) 

-    {	

-        pthread_join (vbuf_rec.rx_test_thread,NULL);

-        vbuf_rec.rx_test_thread = NULL;

-    }    

-	

-	if(vbuf_rec.tx_file != NULL) 

-	{

-		fclose(vbuf_rec.tx_file);

-		printf("%s : vb close ,close tx file \n",__func__);

-		vbuf_rec.tx_file = NULL;

-	}

-		

-	if(vbuf_rec.rx_file != NULL) 

-	{

-

-		fclose(vbuf_rec.rx_file);

-		printf("%s : vb close ,close rx file \n",__func__);

-		vbuf_rec.rx_file = NULL;

-		

-	}

-

-    vb_close_fd_release_buf();

-    return 0;

-}

-

-

-static int vb_loop_test_thread_func(void *arg)

-{

-    int ret;

-

-    char* buf = vbuf_rec.rx_buf;

-    int size = vbuf_rec.buf_size;

-

-	//char* buf = vbuf_rec.tx_buf;

-	

-    //int size = vbuf_rec.buf_size;

-    int w_size;

-    int r_size;

-

- 

-    printf( "%s: start size=%d! \n",__func__,size);

-    memset (buf,0, size);

-    

-    while (!vbuf_rec.quit) 

-    {

-		rx_optcount ++;	

-		VB_INT_OVERFLOW(rx_optcount);

-		if((rx_optcount%1000) == 0){

-            printf("%s: rx_optcount=%d! \n",__func__,rx_optcount);

-

-		}

-		else if(rx_optcount == 1000000){

-            printf("%s: rx_optcount=%d! \n",__func__,rx_optcount);

-			rx_optcount = 0;

-			

-		}

-

-        //read form ps

-		r_size = voice_buffer_read(vbuf_rec.fd, vbuf_rec.rx_buf, size);

-        if(r_size <= 0) 

-        {

-            first_rderr_flag++;			

-			VB_INT_OVERFLOW(first_rderr_flag);			

-            continue ;

-        }

-		else{

-			first_rderr_flag = 0;

-		}

-        memcpy(vbuf_rec.tx_buf,vbuf_rec.rx_buf,size);

-		w_size = voice_buffer_write(vbuf_rec.fd, vbuf_rec.tx_buf, size);

-        if(w_size <= 0) 

-        {

-        	first_wrerr_flag++;

-			

-			VB_INT_OVERFLOW(first_wrerr_flag);

-			

-            continue;

-        }

-		else{

-			first_wrerr_flag = 0;

-		}

-		

-    }

-    

-    return 0;

-}

-

-

-int voice_buffer_stream_loop_test_stop(void);

-

-int voice_buffer_stream_loop_test_start(int fs)

-{

-    int ret = -1;

-    int buf_size = 320;

-	tx_optcount = 0;

-	rx_optcount = 0;	

-    int* buf_int;

-

-	int i;

-

-	if(vbuffer_start_flag == 1){ 

-		printf(" VB already start,return \n");

-

-		return 0;

-	}

-

-	if((vbuf_rec.fd != -1)&&(vbuf_rec.fd != 0)){

-		printf(" VB fd already get, vbuf_rec.fd=%d return \n",vbuf_rec.fd);

-	}

-

-	vbuffer_start_flag = 1;

-

-	if(fs == 8000){

-

-		buf_size = 320;

-	}

-	else if(fs == 16000){

-

-		buf_size = 640;

-	}	

-	else

-	{

-		buf_size = 320;

-	}

- 	printf("Starting vb stream fs=%d buf_size=%d \n",fs,buf_size);

-

-    vbuf_rec.rx_buf = (char*) malloc(buf_size);

-	if(!vbuf_rec.rx_buf) {

-		printf("%s : malloc buf fail,return \n",__func__);

-		goto err;

-	}	

-    vbuf_rec.tx_buf = (char*) malloc(buf_size);  

-	if(!vbuf_rec.tx_buf) {		

-	   printf("%s : malloc buf fail,return \n",__func__);

-	   goto err;

-	}	

-	vbuf_rec.buf_size = buf_size;

-	

-    vbuf_rec.quit = 0;

-	

-	printf("%s : vb open start \n",__func__);

-

-	

-    vbuf_rec.fd = voice_buffer_open();

-	if(vbuf_rec.fd <= 0){

-		printf("%s : vb open fail fd=%d,return \n",__func__,vbuf_rec.fd);		

-		goto err;

-		

-	}	

-	printf("%s :loop vb_thread_create start \n",__func__);

-    ret = vb_thread_create ("vb_playback_test",&vbuf_rec.loop_test_thread, vb_loop_test_thread_func, 

-    							4*1024,35,NULL);

-    if (ret != 0)

-    {

-		printf("%s :rx vb_thread_create fail ret=%d,return \n",__func__,ret);    

-		goto err;

-    }

-

-	printf("%s :rx vb_thread_create end \n",__func__);

-

-    return 0;

-

-err:

-	voice_buffer_stream_loop_test_stop();

-	

-    return ret;

-}

-

-int voice_buffer_stream_loop_test_stop(void)

-{

-    int ret = 0;

-	printf("%s:loop thread exit start \n",__func__);

-	if(vbuf_rec.quit == 1) {

-		printf("%s,already stop ,return\n",__func__);

-

-	}

-    

-    vbuf_rec.quit = 1;

-	voice_buffer_stop(vbuf_rec.fd);

-    if (vbuf_rec.loop_test_thread) 

-    {

-        pthread_join (vbuf_rec.loop_test_thread,NULL);

-        vbuf_rec.tx_test_thread = NULL;

-		

-    }

-    	

-    vb_close_fd_release_buf();

-    return 0;

-}

-

-int voice_buffer_rtp_test_start(int fs)

-{   

-      // refer to  voice_buffer_stream_test_start(fs);

-      return 0;

-}

-

-

-

-int voice_buffer_rtp_test_stop(void)

-{   

-//    refer to voice_buffer_stream_loop_test_stop();

-      return 0;

-

-}

-

-void voice_buffer_cmd_proc(char *cmdstr)

-{

-    int ret = 0;

-	char data[VOICE_CMD_MAX_LEN];

-	int cmdstr_len = strlen(cmdstr); //-strlen("\r")

-    int value = 0;

-    int *p_value = &value;

-    

-    cmdstr[cmdstr_len] = '\0'; //+strlen("\0")

-

-	ret = sscanf(cmdstr, "%s", data);

-    if(1 != ret){

-        printf("data sscanf failed!(%d)\n", ret);

-        return;

-    }

-	if(0 == strncmp(data, REQ_VOICE_BUFFER_TEST_START, strlen(REQ_VOICE_BUFFER_TEST_START))){

-

-		ret = sscanf(cmdstr, "%*s %d", &value);

-        if(1 != ret){

-            printf("%s,value sscanf failed!(%d)\n",data, ret);

-            return;

-        }

-		

-        printf("%s set value %d\n", data, value);

-		ret = voice_buffer_stream_test_start(value);

-

-		printf("%s return ret=%d\n", data, ret);

-		

-	}

-	else if(0 == strncmp(data, REQ_VOICE_BUFFER_TEST_STOP, strlen(REQ_VOICE_BUFFER_TEST_STOP))){

-		ret = voice_buffer_stream_test_stop();

-		printf("%s return %d\n", data, ret);

-	}

-	else if(0 == strncmp(data, REQ_VOICE_BUFFER_LOOP_TEST_START, strlen(REQ_VOICE_BUFFER_LOOP_TEST_START))){

-

-		ret = sscanf(cmdstr, "%*s %d", &value);

-        if(1 != ret){

-            printf("%s,value sscanf failed!(%d)\n",data, ret);

-            return;

-        }

-		

-        printf("%s set value %d\n", data, value);

-		ret = voice_buffer_stream_loop_test_start(value);

-

-		printf("%s return ret=%d\n", data, ret);

-		

-	}

-	else if(0 == strncmp(data, REQ_VOICE_BUFFER_LOOP_TEST_STOP, strlen(REQ_VOICE_BUFFER_LOOP_TEST_STOP))){

-		printf("voice_buffer_stream_loop_test_stop \n");

-		ret = voice_buffer_stream_loop_test_stop();

-		printf("%s return %d\n", data, ret);

-	}

-    else if(0 == strncmp(data, REQ_VOICE_BUFFER_RTP_TEST_START, strlen(REQ_VOICE_BUFFER_RTP_TEST_START))){

-

-		ret = sscanf(cmdstr, "%*s %d", &value);

-        if(1 != ret){

-            printf("%s,value sscanf failed!(%d)\n",data, ret);

-            return;

-        }

-		

-        printf("%s set value %d\n", data, value);

-		ret = voice_buffer_rtp_test_start(value);

-

-		printf("%s return ret=%d\n", data, ret);

-		

-	}

-	else if(0 == strncmp(data, REQ_VOICE_BUFFER_RTP_TEST_STOP, strlen(REQ_VOICE_BUFFER_RTP_TEST_STOP))){

-		ret = voice_buffer_rtp_test_stop();

-		printf("%s return %d\n", data, ret);

-	}	

-    else{

-		printf("Request unknow.\n");

-        printUsage(cmdstr);

-	}

-}

-

-void vb_buffer_stop_all()

-{

-	voice_buffer_stream_loop_test_stop();

-    voice_buffer_stream_test_stop();

-    voice_buffer_rtp_test_stop();

-}

-

-void signal_handle_func(int sig)

-{

-	printf("sig(%d) signal_handle_func exit ",sig);

-    

-    vb_buffer_stop_all();

-	exit(0);

-}

-

-int main(int argc, char **argv)

-{

-    char cmdstr[VOICE_CMD_MAX_LEN];

-	

-	signal(SIGINT, signal_handle_func);

-	signal(SIGQUIT, signal_handle_func);

-	signal(SIGTERM, signal_handle_func);

-	signal(SIGPIPE, signal_handle_func);

-

-    memset(&vbuf_rec,0,sizeof(vbuf_rec));

-#if 0

-    /*add by hq for faster start @20240906,begin*/

-    if(argc>1)

-    {

-        voice_buffer_cmd_proc(argv[1]);

-    }

-    /*add by hq for faster start @20240906,end*/

-    else

-    {

-#endif

-        while(1){

-            printf("Please input an voice_demo command:\n");

-            if(NULL != fgets(cmdstr, VOICE_CMD_MAX_LEN - 1, stdin)){

-                if(0 == strcmp(EXIT_CMD_STOP, cmdstr) || 

-                    0 == strcmp(EXIT_CMD_Q, cmdstr) || 

-                    0 == strcmp(EXIT_CMD_EXIT, cmdstr)){

-					vb_buffer_stop_all();

-    				break;

-    			}

-                

-                printf("len:%d, cmdstr:%s\n", strlen(cmdstr), cmdstr);

-                

-                if(1 >= strlen(cmdstr)){

-    				continue;

-    			}

-                voice_buffer_cmd_proc(cmdstr);

-            }         

-        }

-//    }    

-

-    printf("voice_demo end\n");

-    

-    return 0;

-}

-

diff --git a/esdk/layers/meta-zxic-custom/recipes-lynq/lynq-vb-demo/files/makefile b/esdk/layers/meta-zxic-custom/recipes-lynq/lynq-vb-demo/files/makefile
deleted file mode 100755
index 6a6f960..0000000
--- a/esdk/layers/meta-zxic-custom/recipes-lynq/lynq-vb-demo/files/makefile
+++ /dev/null
@@ -1,47 +0,0 @@
-SHELL = /bin/sh
-RM = rm -f
-
-LOCAL_CFLAGS := -Wall \
-                -g -Os \
-                -flto \
-                -fpermissive \
-                -fPIC \
-
-ifeq ($(strip $(TARGET_PLATFORM)), T106)
-LOCAL_CFLAGS += -DBINDER_IPC_32BIT=1 -DHAVE_ENDIAN_H -DHAVE_PTHREADS -DHAVE_SYS_UIO_H -DHAVE_POSIX_FILEMAP -DHAVE_STRLCPY -DHAVE_PRCTL -DHAVE_MEMSET16 -DHAVE_MEMSET32 -DANDROID_SMP=0
-endif
-
-LOCAL_CFLAGS += -Werror=implicit-function-declaration
-
-$(warning ################# rock ROOT: $(ROOT),includedir:$(includedir),)
-
-LOCAL_PATH   = .
-
-LOCAL_C_INCLUDES = \
-  -I. \
-  -I$(ROOT)$(includedir)/ \
-
-
-
-LOCAL_LIBS := \
-    -L. \
-    -ldl \
-    -lpthread \
-    -lvoice \
-
-SOURCES = $(wildcard *.c)
-
-EXECUTABLE = lynq_vb_demo
-
-OBJECTS=$(SOURCES:.c=.o)
-all: $(EXECUTABLE)
-
-$(EXECUTABLE): $(OBJECTS)
-	$(CC) $(OBJECTS) $(LOCAL_LIBS) $(LOCAL_CFLAGS) $(LOCAL_C_INCLUDES) -o $@
-
-%.o : %.c
-	$(CC) $(LOCAL_C_INCLUDES) $(LOCAL_CFLAGS) $(LOCAL_LIBS) -o $@ -c $<
-
-.PHONY: clean
-clean:
-	$(RM) $(OBJECTS) $(EXECUTABLE)
diff --git a/esdk/layers/meta-zxic-custom/recipes-lynq/lynq-vb-demo/lynq-vb-demo.bb b/esdk/layers/meta-zxic-custom/recipes-lynq/lynq-vb-demo/lynq-vb-demo.bb
deleted file mode 100755
index b01d3b0..0000000
--- a/esdk/layers/meta-zxic-custom/recipes-lynq/lynq-vb-demo/lynq-vb-demo.bb
+++ /dev/null
@@ -1,29 +0,0 @@
-#inherit externalsrc package
-
-DESCRIPTION = "lynq-vb-demo"
-LICENSE = "CLOSED"
-LIC_FILES_CHKSUM = "file://LICENSE;md5=b1e07e8d88e26263e71d3a9e2aa9a2ff"
-DEPENDS += "libvoice"
-SRC_URI = "file://lynq_vb_demo.c \
-           file://makefile \
-"
-
-SRC-DIR = "${S}/../lynq-vb-demo"
-FILES_${PN} += "${bindir}/"
-TARGET_CC_ARCH += "${LDFLAGS}"
-
-S = "${WORKDIR}"
-
-#INHIBIT_PACKAGE_STRIP = "1"
-do_compile () {
-	if test "${PACKAGE_ARCH}" = "cortexa7hf-vfp-vfpv4-neon" || test "${PACKAGE_ARCH}" = "cortexa7hf-neon-vfpv4"; then
-		oe_runmake all ROOT=${STAGING_DIR_HOST} OFLAGS="--sysroot=${STAGING_DIR_HOST} -mhard-float"
-	else
-		oe_runmake all ROOT=${STAGING_DIR_HOST} OFLAGS="--sysroot=${STAGING_DIR_HOST}"
-	fi
-}
-
-do_install() {
-	install -d ${D}${bindir}/
-	install -m 0755 ${S}/lynq_vb_demo ${D}${bindir}/
-}
diff --git a/esdk/layers/meta-zxic-custom/recipes-lynq/lynq-wifi-demo/files/lynq-wifi-demo.cpp b/esdk/layers/meta-zxic-custom/recipes-lynq/lynq-wifi-demo/files/lynq-wifi-demo.cpp
index 2264f5b..445f51f 100755
--- a/esdk/layers/meta-zxic-custom/recipes-lynq/lynq-wifi-demo/files/lynq-wifi-demo.cpp
+++ b/esdk/layers/meta-zxic-custom/recipes-lynq/lynq-wifi-demo/files/lynq-wifi-demo.cpp
@@ -211,10 +211,6 @@
                 printf("wakelock create fail\n");
                 printf("wifi_lock_num=%d\n", wifi_lock_num);
             }
-            if (type == LYNQ_WIFI_AP_INDEX_AP0)
-                qser_wifi_work_mode_set(LYNQ_WIFI_WORK_MODE_AP0); // Set 2.4G, and this function must be called after the qser_wifi_enable function
-            else
-                qser_wifi_work_mode_set(LYNQ_WIFI_WORK_MODE_AP1); // Set 5G, and this function must be called after the qser_wifi_enable function
             qser_wifi_ap_start(type); // Set the ap mode of 2.4G/5G
             qser_wifi_register_handle(lynq_wifi_event_handle_demo, NULL, (void *)&args);
             ret = qser_wakelock_lock(wifi_lock_num);
@@ -224,8 +220,6 @@
                 printf("ret=%d\n", ret);
             }
             signal(SIGINT, signalHandler);
-            signal(SIGHUP, signalHandler);
-            signal(SIGTERM, signalHandler);
             while (1)
             {
                 char cmdstr[128] = {0};
@@ -283,8 +277,6 @@
                 printf("ret=%d\n", ret);
             }
             signal(SIGINT, signalHandler);
-            signal(SIGHUP, signalHandler);
-            signal(SIGTERM, signalHandler);
             while (1)
             {
                 printf("[lynq-wifi-demo]Enter the ssid and password as shown in the following example:ssid auth paris pw ||sta_pkt_get ||sta_param_get || sta_scan ||sta_stop\n");