Merge "[Feature][ZXW-147][GPIO]add GPIO API"
diff --git a/allbins/zx297520v3/prj_vehicle/nv_dc_ref/at_nvrw_0x00001000.bin b/allbins/zx297520v3/prj_vehicle/nv_dc_ref/at_nvrw_0x00001000.bin
new file mode 100755
index 0000000..9187a44
--- /dev/null
+++ b/allbins/zx297520v3/prj_vehicle/nv_dc_ref/at_nvrw_0x00001000.bin
Binary files differ
diff --git a/allbins/zx297520v3/prj_vehicle/nv_dc_ref/phyGgeAmtUser_nvrwo_0x0002CC00.bin b/allbins/zx297520v3/prj_vehicle/nv_dc_ref/phyGgeAmtUser_nvrwo_0x0002CC00.bin
new file mode 100755
index 0000000..3bbfaa5
--- /dev/null
+++ b/allbins/zx297520v3/prj_vehicle/nv_dc_ref/phyGgeAmtUser_nvrwo_0x0002CC00.bin
Binary files differ
diff --git a/allbins/zx297520v3/prj_vehicle/nv_dc_ref/phyGgeAmtUser_nvrwo_0x00038400.bin b/allbins/zx297520v3/prj_vehicle/nv_dc_ref/phyGgeAmtUser_nvrwo_0x00038400.bin
new file mode 100755
index 0000000..22d545d
--- /dev/null
+++ b/allbins/zx297520v3/prj_vehicle/nv_dc_ref/phyGgeAmtUser_nvrwo_0x00038400.bin
Binary files differ
diff --git a/allbins/zx297520v3/prj_vehicle/nv_dc_ref/phyLteaAmtUser_nvrwo_0x00031000.bin b/allbins/zx297520v3/prj_vehicle/nv_dc_ref/phyLteaAmtUser_nvrwo_0x00031000.bin
new file mode 100755
index 0000000..8634ae0
--- /dev/null
+++ b/allbins/zx297520v3/prj_vehicle/nv_dc_ref/phyLteaAmtUser_nvrwo_0x00031000.bin
Binary files differ
diff --git a/allbins/zx297520v3/prj_vehicle/nv_dc_ref/phyLteaAmtUser_nvrwo_0x0003C800.bin b/allbins/zx297520v3/prj_vehicle/nv_dc_ref/phyLteaAmtUser_nvrwo_0x0003C800.bin
new file mode 100755
index 0000000..7c010ff
--- /dev/null
+++ b/allbins/zx297520v3/prj_vehicle/nv_dc_ref/phyLteaAmtUser_nvrwo_0x0003C800.bin
Binary files differ
diff --git a/allbins/zx297520v3/prj_vehicle/nv_dc_ref/phyWcdmaAmtUser_nvrwo_0x0002E800.bin b/allbins/zx297520v3/prj_vehicle/nv_dc_ref/phyWcdmaAmtUser_nvrwo_0x0002E800.bin
new file mode 100755
index 0000000..156b26c
--- /dev/null
+++ b/allbins/zx297520v3/prj_vehicle/nv_dc_ref/phyWcdmaAmtUser_nvrwo_0x0002E800.bin
Binary files differ
diff --git a/allbins/zx297520v3/prj_vehicle/nv_dc_ref/phyWcdmaAmtUser_nvrwo_0x0003A000.bin b/allbins/zx297520v3/prj_vehicle/nv_dc_ref/phyWcdmaAmtUser_nvrwo_0x0003A000.bin
new file mode 100755
index 0000000..8ce0321
--- /dev/null
+++ b/allbins/zx297520v3/prj_vehicle/nv_dc_ref/phyWcdmaAmtUser_nvrwo_0x0003A000.bin
Binary files differ
diff --git a/allbins/zx297520v3/prj_vehicle/nv_dc_ref/phycom_nvrwo_0x0002C400.bin b/allbins/zx297520v3/prj_vehicle/nv_dc_ref/phycom_nvrwo_0x0002C400.bin
new file mode 100755
index 0000000..8797dfb
--- /dev/null
+++ b/allbins/zx297520v3/prj_vehicle/nv_dc_ref/phycom_nvrwo_0x0002C400.bin
Binary files differ
diff --git a/allbins/zx297520v3/prj_vehicle/nv_dc_ref/phycom_nvrwo_0x00037C00.bin b/allbins/zx297520v3/prj_vehicle/nv_dc_ref/phycom_nvrwo_0x00037C00.bin
new file mode 100755
index 0000000..01ac07b
--- /dev/null
+++ b/allbins/zx297520v3/prj_vehicle/nv_dc_ref/phycom_nvrwo_0x00037C00.bin
Binary files differ
diff --git a/allbins/zx297520v3/prj_vehicle/nv_dc_ref/psPriData_nvrw_0x00002000.bin b/allbins/zx297520v3/prj_vehicle/nv_dc_ref/psPriData_nvrw_0x00002000.bin
new file mode 100755
index 0000000..a7e322c
--- /dev/null
+++ b/allbins/zx297520v3/prj_vehicle/nv_dc_ref/psPriData_nvrw_0x00002000.bin
Binary files differ
diff --git a/allbins/zx297520v3/prj_vehicle/scripts_linux/NVRWOInOneImage_dc_ref.ini b/allbins/zx297520v3/prj_vehicle/scripts_linux/NVRWOInOneImage_dc_ref.ini
index 8c66cbe..f4fe2da 100755
--- a/allbins/zx297520v3/prj_vehicle/scripts_linux/NVRWOInOneImage_dc_ref.ini
+++ b/allbins/zx297520v3/prj_vehicle/scripts_linux/NVRWOInOneImage_dc_ref.ini
@@ -10,14 +10,30 @@
 [NVRWO]

 ;举例../../../zx297520/nv/CA_3M_BX/at_nvrw_0x00022000.bin

 ../allbins_dc_ref/phycom_nvrwo_0x0002BC00.bin

+;xf.li@20230927 add for DRDI start

+../allbins_dc_ref/phycom_nvrwo_0x0002C400.bin

+../allbins_dc_ref/phycom_nvrwo_0x00037C00.bin

+;xf.li@20230927 add for DRDI end

 ../allbins_dc_ref/phyGgeAmtUser_nvrwo_0x00003400.bin

+;xf.li@20230927 add for DRDI start

+../allbins_dc_ref/phyGgeAmtUser_nvrwo_0x0002CC00.bin

+../allbins_dc_ref/phyGgeAmtUser_nvrwo_0x00038400.bin

+;xf.li@20230927 add for DRDI end

 ../allbins_dc_ref/phyGgeCom_nvrwo_0x0000EC00.bin

 ../allbins_dc_ref/phyLteaAmtUser_nvrwo_0x00007800.bin

+;xf.li@20230927 add for DRDI start

+../allbins_dc_ref/phyLteaAmtUser_nvrwo_0x0003C800.bin

+../allbins_dc_ref/phyLteaAmtUser_nvrwo_0x00031000.bin

+;xf.li@20230927 add for DRDI end

 ../allbins_dc_ref/phyLteaCom_nvrwo_0x00012C00.bin

 ../allbins_dc_ref/phyLtetxtable_nvrwo_0x0001BC00.bin

 ../allbins_dc_ref/phyTdsAmtUser_nvrwo_0x00002800.bin

 ../allbins_dc_ref/phyTdsCom_nvrwo_0x0000E400.bin

 ../allbins_dc_ref/phyWcdmaAmtUser_nvrwo_0x00005000.bin

+;xf.li@20230927 add for DRDI start

+../allbins_dc_ref/phyWcdmaAmtUser_nvrwo_0x0002E800.bin

+../allbins_dc_ref/phyWcdmaAmtUser_nvrwo_0x0003A000.bin

+;xf.li@20230927 add for DRDI end

 ../allbins_dc_ref/phyWcdmaCom_nvrwo_0x00012400.bin

 ../allbins_dc_ref/zxRfM0_nvrwo_0x00016C00.bin

 

diff --git a/ap/app/zte_comm/at_ctl/src/atctrl/at_rcvmsg.c b/ap/app/zte_comm/at_ctl/src/atctrl/at_rcvmsg.c
index d0afa68..0ca983b 100755
--- a/ap/app/zte_comm/at_ctl/src/atctrl/at_rcvmsg.c
+++ b/ap/app/zte_comm/at_ctl/src/atctrl/at_rcvmsg.c
@@ -1337,12 +1337,21 @@
 		}

 		if(ret < 0)

 		{/*дʧ°Ü·ÀֹͨµÀ¶ÂÈû*/

+//xf.li@20230930 modify for DRDI start

+#ifdef USE_CAP_SUPPORT

+		struct at_context * context = NULL;

+		if((context = at_context_find_ctx_by_fd_type(fd, AT_FWD_DOWN)) != 0){

+			char* err_str = at_err_build(ATERR_PROC_FAILED);

+			at_context_write_data(context->fwd_context->at_channel->at_fd, err_str,strlen(err_str));

+			free(err_str);

+		}

+#endif

 			rcv_at_rsp_handle(fd,"ERROR","",0,"",0);

-			at_print(AT_ERR,"fwd_all_at_str write fail\n");

+			at_print(AT_ERR,"fwd_all_at_str write fail \n");

 		}

 	}

 }

-

+//xf.li@20230930 modify for DRDI end

 /*¶Ô½ÓÊÕµ½µÄATÃüÁî×Ö·û´®½øÐе¥¸ö×Ö·û´®´¦Àí ´¦Àí´Ó"at_recv_thread"Ï̴߳«À´µÄATͨµÀÏûÏ¢¡£¸ù¾Ý½ÓÊÕµ½µÄatÃüÁî×Ö·û´®£¬

 ×é×°ºÍÖØ×é³ÉÍêÕûµÄatÃüÁ²¢´¦Àí¡£*/

 int rcv_at_str_proc(int at_fd, char *at_str, int at_len)

diff --git a/cap/zx297520v3/sources/meta-zxic-custom/conf/distro/vehicle_dc_ref.conf b/cap/zx297520v3/sources/meta-zxic-custom/conf/distro/vehicle_dc_ref.conf
index e1740f3..4c19b3e 100755
--- a/cap/zx297520v3/sources/meta-zxic-custom/conf/distro/vehicle_dc_ref.conf
+++ b/cap/zx297520v3/sources/meta-zxic-custom/conf/distro/vehicle_dc_ref.conf
@@ -191,6 +191,7 @@
         liblynq-systime \
         liblynq-autosuspend \
         liblynq-qser-autosuspend \
+        liblynq-at-factory \
 	"
 
 zxic_lib += "${@bb.utils.contains('CONFIG_TEL_API_SUPPORT', 'RIL', 'libril', 'libtelsvr', d)}"
diff --git a/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/liblynq-at-factory/liblynq-at-factory.bb b/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/liblynq-at-factory/liblynq-at-factory.bb
new file mode 100755
index 0000000..40e8beb
--- /dev/null
+++ b/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/liblynq-at-factory/liblynq-at-factory.bb
@@ -0,0 +1,58 @@
+#inherit externalsrc package

+

+DESCRIPTION = "liblynq-at-factory"

+LICENSE = "CLOSED"

+LIC_FILES_CHKSUM = "file://LICENSE;md5=3f86c7f456a6d0bbeca155e65084eee1"

+DEPENDS += "liblynq-log libbsp"

+#inherit workonsrc

+WORKONSRC = "${TOPDIR}/../src/lynq/lib/liblynq-at-factory/"

+FILESEXTRAPATHS_prepend :="${TOPDIR}/../src/lynq/lib/:"

+SRC_URI = " \

+          file://liblynq-at-factory\

+          "

+

+SRC-DIR = "${S}/../liblynq-at-factory"

+

+TARGET_CC_ARCH += "${LDFLAGS}"

+SYSTEMD_PACKAGES = "${PN}"

+BB_INCLUDE_ADD = "--sysroot=${STAGING_DIR_HOST}"

+BB_LDFLAGS_ADD = "--sysroot=${STAGING_DIR_HOST} -Wl,--hash-style=gnu"

+FILES_${PN} += "${bindir} /data/factory"

+

+EXTRA_OEMAKE = "'TARGET_PLATFORM = ${TARGET_PLATFORM}'"

+

+FILES_${PN} += "${base_libdir}/*.so "

+

+FILES_${PN}-dev = "/test \

+                   ${includedir}"

+

+FILES_${PN}-doc = "/doc"

+

+FILES_${PN}-dbg ="${base_bindir}/.debug \

+                  ${base_libdir}/.debug \

+                  ${base_sbindir}/.debug"

+

+INSANE_SKIP_${PN} += "already-stripped"

+INSANE_SKIP_${PN} += "installed-vs-shipped"

+

+

+#INHIBIT_PACKAGE_STRIP = "1"

+do_compile () {

+		oe_runmake all -C ${SRC-DIR} ROOT=${STAGING_DIR_HOST} OFLAGS="--sysroot=${STAGING_DIR_HOST} -Os -Wl,--hash-style=gnu -DTELEPHONYWARE"

+}

+

+do_install () {

+    oe_runmake install -C ${SRC-DIR} ROOT=${D}

+

+    if [ -d "${WORKONSRC}" ] ; then

+        install -d ${D}${includedir}/

+        cp -raf ${SRC-DIR}/include/ ${D}${includedir}/

+        install -d ${D}/data/factory

+        install -m 644 ${WORKONSRC}gpio_T106.conf ${D}/data/factory/

+    fi

+}

+

+addtask bachclean

+do_bachclean () {

+    oe_runmake clean

+}

diff --git a/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-gpio-demo/files/LICENSE b/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-gpio-demo/files/LICENSE
new file mode 100755
index 0000000..cb88533
--- /dev/null
+++ b/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-gpio-demo/files/LICENSE
@@ -0,0 +1,31 @@
+Copyright 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/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-gpio-demo/files/lynq-gpio-demo.cpp b/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-gpio-demo/files/lynq-gpio-demo.cpp
new file mode 100755
index 0000000..51c0020
--- /dev/null
+++ b/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-gpio-demo/files/lynq-gpio-demo.cpp
@@ -0,0 +1,147 @@
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <errno.h>
+#include <include/lynq-gpio.h>
+
+
+int main(int argc,char** argv)
+{
+    int ret;
+    int gpio;
+    int direction;
+    int value;
+    int pullsel;
+    if(argc < 2)
+    {
+        printf("wrong input format, please -h \n");
+        return -1;
+    }
+
+    if(strcmp(argv[1],"-h") == 0)
+    {
+        printf("        -h                                        --help\n");;
+        printf("        -ds  [gpio][direction]                    --lynq_gpio_direction_set\n");
+        printf("        -vs  [gpio][value]                        --lynq_gpio_value_set\n");
+        printf("        -ps  [gpio][pullsel]                      --lynq_gpio_pullsel_set\n");
+        printf("        -vg  [gpio]                               --lynq_gpio_value_get\n");
+        printf("        -pg  [gpio]                               --lynq_gpio_pullsel_get\n");
+        return 0;
+    }
+
+    gpio = atoi(argv[2]);
+    ret = lynq_gpio_init(gpio, 0, 0, 0);
+    if(ret != 0)
+    {
+        printf("lynq_gpio_init fail\n");
+    }
+    else
+    {
+        printf("lynq_gpio_init success\n");
+    }
+
+    if(strcmp(argv[1],"-ds") == 0)
+    {
+        if(argc < 3)
+        {
+            printf("wrong input format, please -h \n");
+            return -1;
+        }
+        direction = atoi(argv[3]);
+        ret = lynq_gpio_direction_set(gpio, direction);
+        if(ret != 0)
+        {
+            printf("lynq_gpio_direction_set fail\n");
+        }
+        else
+        {
+            printf("lynq_gpio_direction_set success\n");
+        }
+
+    }
+    else if(strcmp(argv[1],"-vs") == 0)
+    {
+        if(argc < 3)
+        {
+            printf("wrong input format, please -h \n");
+            return -1;
+        }
+        value = atoi(argv[3]);
+        ret = lynq_gpio_value_set(gpio, value);
+        if(ret < 0)
+        {
+            printf("lynq_gpio_value_set fail\n");
+        }
+        else
+        {
+            printf("lynq_gpio_value_set success\n");
+        }
+    }
+    else if (strcmp(argv[1],"-ps") == 0)
+    {
+        if(argc < 3)
+        {
+            printf("wrong input format, please -h \n");
+            return -1;
+        }
+        pullsel = atoi(argv[3]);
+        ret = lynq_gpio_pullsel_set(gpio, pullsel);
+        if(ret != 0)
+        {
+            printf("lynq_gpio_pullsel_set fail\n");
+            printf("ret=%d\n", ret);
+        }
+        else
+        {
+            printf("lynq_gpio_pullsel_set success\n");
+        }
+    }
+
+    else if (strcmp(argv[1],"-vg") == 0)
+    {
+        ret = lynq_gpio_value_get(gpio);
+        if(ret < 0)
+        {
+            printf("lynq_gpio_value_get fail\n");
+            printf("ret=%d\n", ret);
+        }
+        else
+        {
+            printf("lynq_gpio_value_get success\n");
+            printf("ret=%d\n", ret);
+        }
+    }
+    else if(strcmp(argv[1],"-pg") == 0)
+    {
+        ret = lynq_gpio_pullsel_get(gpio);
+        if(ret < 0)
+        {
+            printf("lynq_gpio_pullsel_get fail\n");
+            printf("ret=%d\n", ret);
+        }
+        else
+        {
+            printf("lynq_gpio_pullsel_get success\n");
+            printf("ret=%d\n", ret);
+        }
+    }
+    else
+    {
+        printf("wrong input format, please -h \n");
+        return -1;
+    }
+
+    ret = lynq_gpio_deinit(gpio);
+    if(ret != 0)
+    {
+        printf("lynq_gpio_deinit fail\n");
+        printf("ret=%d\n", ret);
+    }
+    else
+    {
+        printf("lynq_gpio_deinit success\n");
+    }
+
+    return 0;
+
+}
diff --git a/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-gpio-demo/files/makefile b/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-gpio-demo/files/makefile
new file mode 100755
index 0000000..d135ce2
--- /dev/null
+++ b/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-gpio-demo/files/makefile
@@ -0,0 +1,53 @@
+SHELL = /bin/sh
+RM = rm -f
+
+LOCAL_CFLAGS := -Wall \
+                -std=gnu++14 \
+                -g -Os \
+                -flto \
+                -fpermissive \
+
+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)/ \
+
+
+LOCAL_LIBS := \
+    -L. \
+    -ldl \
+    -lstdc++ \
+    -lpthread \
+    -llynq-gpio \
+
+
+
+SOURCES = lynq-gpio-demo.cpp
+
+EXECUTABLE = lynq-gpio-demo
+
+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/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-gpio-demo/lynq-gpio-demo.bb b/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-gpio-demo/lynq-gpio-demo.bb
new file mode 100644
index 0000000..0d8d91d
--- /dev/null
+++ b/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-gpio-demo/lynq-gpio-demo.bb
@@ -0,0 +1,31 @@
+#inherit externalsrc package
+#inherit externalsrc package systemd
+DESCRIPTION = "lynq-gpio-demo"
+LICENSE = "CLOSED"
+LICENSE = "CLOSED"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=b1e07e8d88e26263e71d3a9e2aa9a2ff"
+SRC_URI = "file://lynq-gpio-demo.cpp \
+           file://makefile \
+"
+DEPENDS += "liblynq-gpio"
+
+SRC-DIR = "${S}/../lynq-gpio-demo"
+FILES_${PN} += "${bindir}/"
+TARGET_CC_ARCH += "${LDFLAGS}"
+SYSTEMD_PACKAGES = "${PN}"
+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-gpio-demo ${D}${bindir}/
+}
diff --git a/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-irq-demo/files/LICENSE b/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-irq-demo/files/LICENSE
new file mode 100755
index 0000000..88a1e9c
--- /dev/null
+++ b/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-irq-demo/files/LICENSE
@@ -0,0 +1,31 @@
+Copyright 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 ("MOBILIETEK SOFTWARE")
+RECEIVED FROM MOBILIETEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER
+ON AN "AS-IS" BASIS ONLY. MOBILIETEK 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 MOBILIETEK PROVIDE ANY WARRANTY WHATSOEVER WITH
+RESPECT TO THE SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY,
+INCORPORATED IN, OR SUPPLIED WITH THE MOBILIETEK 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 MOBILIETEK
+SOFTWARE. MOBILIETEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MOBILIETEK SOFTWARE
+RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR
+STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MOBILIETEK'S
+ENTIRE AND CUMULATIVE LIABILITY WITH RESPECT TO THE MOBILIETEK SOFTWARE
+RELEASED HEREUNDER WILL BE, AT MOBILIETEK'S OPTION, TO REVISE OR REPLACE THE
+MOBILIETEK SOFTWARE AT ISSUE, OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE
+CHARGE PAID BY RECEIVER TO MOBILIETEK FOR SUCH MOBILIETEK SOFTWARE AT ISSUE.
diff --git a/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-irq-demo/files/lynq-irq-demo.cpp b/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-irq-demo/files/lynq-irq-demo.cpp
new file mode 100755
index 0000000..537273e
--- /dev/null
+++ b/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-irq-demo/files/lynq-irq-demo.cpp
@@ -0,0 +1,113 @@
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <pthread.h>
+#include <include/lynq-irq.h>
+
+
+
+static void irq_test_handler(void)
+{
+    printf("this is irq_test_handler\n");
+}
+
+
+int main(int argc, char** argv)
+{
+    int ret;
+    int irq;
+    int trig_type;
+    int en;
+
+    if(argc < 2)
+    {
+        printf("wrong input format, please -h \n");
+        return -1;
+    }
+
+    if(strcmp(argv[1],"-h") == 0)
+    {
+        printf("        -h                                        --help\n");
+        printf("        -t   [irq][trig_type]                    --lynq_irq_set_type\n");
+        printf("        -sw  [irq][en]                           --lynq_irq_set_wake\n");
+        printf("        -gw  [irq]                               --lynq_irq_get_wake\n");
+        return 0;
+    }
+
+    if(argv[2] == NULL)
+    {
+        printf("wrong input format, please -h \n");
+        return -1;
+    }
+
+    irq = atoi(argv[2]);
+    ret = lynq_irq_install(irq, irq_test_handler, 1);
+    if(ret != 0)
+    {
+        printf("lynq_irq_install fail\n");
+    }
+    else
+    {
+        printf("lynq_irq_install success\n");
+    }
+
+    if(strcmp(argv[1],"-t") == 0)
+    {
+        if(argv[3] != NULL)
+        {
+            trig_type = atoi(argv[3]);
+            ret = lynq_irq_set_type(irq, trig_type);
+            if(ret < 0)
+            {
+                printf("lynq_irq_set_type fail\n");
+            }
+            else
+            {
+                printf("lynq_irq_set_type success\n");
+            }
+        }
+    }
+    else if (strcmp(argv[1],"-sw") == 0)
+    {
+        if(argv[3] != NULL)
+        {
+            en = atoi(argv[3]);
+            ret = lynq_irq_set_wake(irq, en);
+            if(ret < 0)
+            {
+                printf("lynq_irq_set_wake fail\n");
+                printf("ret=%d\n", ret);
+            }
+            else
+            {
+                printf("lynq_irq_set_wake success\n");
+                printf("ret=%d\n", ret);
+            }
+        }
+    }
+    else if (strcmp(argv[1],"-gw") == 0)
+    {
+        ret = lynq_irq_get_wake(irq);
+        printf("lynq_irq_get_wake ret %d\n", ret);
+    }
+    else
+    {
+        printf("wrong input format, please -h \n");
+        return -1;
+    }
+
+    ret = lynq_irq_uninstall(irq);
+    if(ret != 0)
+    {
+        printf("lynq_irq_uninstall fail\n");
+    }
+    else
+    {
+        printf("lynq_irq_uninstall success\n");
+    }
+        
+    return 0;
+
+}
+
+
diff --git a/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-irq-demo/files/makefile b/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-irq-demo/files/makefile
new file mode 100755
index 0000000..02f0f0c
--- /dev/null
+++ b/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-irq-demo/files/makefile
@@ -0,0 +1,53 @@
+SHELL = /bin/sh
+RM = rm -f
+
+LOCAL_CFLAGS := -Wall \
+                -std=gnu++14 \
+                -g -Os \
+                -flto \
+                -fpermissive \
+
+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)/ \
+
+
+LOCAL_LIBS := \
+    -L. \
+    -ldl \
+    -lstdc++ \
+    -lpthread \
+    -llynq-irq \
+
+
+
+SOURCES = lynq-irq-demo.cpp
+
+EXECUTABLE = lynq-irq-demo
+
+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/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-irq-demo/lynq-irq-demo.bb b/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-irq-demo/lynq-irq-demo.bb
new file mode 100644
index 0000000..7d180f6
--- /dev/null
+++ b/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-irq-demo/lynq-irq-demo.bb
@@ -0,0 +1,31 @@
+#inherit externalsrc package
+#inherit externalsrc package systemd
+DESCRIPTION = "lynq-girq-demo"
+LICENSE = "CLOSED"
+LICENSE = "CLOSED"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=b1e07e8d88e26263e71d3a9e2aa9a2ff"
+SRC_URI = "file://lynq-irq-demo.cpp \
+           file://makefile \
+"
+DEPENDS += "liblynq-irq"
+
+SRC-DIR = "${S}/../lynq-irq-demo"
+FILES_${PN} += "${bindir}/"
+TARGET_CC_ARCH += "${LDFLAGS}"
+SYSTEMD_PACKAGES = "${PN}"
+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-irq-demo ${D}${bindir}/
+}
diff --git a/cap/zx297520v3/src/lynq/lib/liblynq-at-factory/LICENSE b/cap/zx297520v3/src/lynq/lib/liblynq-at-factory/LICENSE
new file mode 100755
index 0000000..382fc78
--- /dev/null
+++ b/cap/zx297520v3/src/lynq/lib/liblynq-at-factory/LICENSE
@@ -0,0 +1,31 @@
+Copyright 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.
\ No newline at end of file
diff --git a/cap/zx297520v3/src/lynq/lib/liblynq-at-factory/gpio_T106.conf b/cap/zx297520v3/src/lynq/lib/liblynq-at-factory/gpio_T106.conf
new file mode 100755
index 0000000..0983051
--- /dev/null
+++ b/cap/zx297520v3/src/lynq/lib/liblynq-at-factory/gpio_T106.conf
@@ -0,0 +1,4 @@
+platform:T106
+total:49
+gpio:9,16,17,18,19,20,25,26,27,28,29,30,31,32,35,36,37,38,45,46,48,52,53,54,63,64,72,73,74,75,76,77,84,87,88,89,90,91,92,119,120,121,122,127,128,129,130,131,132,
+
diff --git a/cap/zx297520v3/src/lynq/lib/liblynq-at-factory/include/libat/lynq_at_factory.h b/cap/zx297520v3/src/lynq/lib/liblynq-at-factory/include/libat/lynq_at_factory.h
new file mode 100755
index 0000000..1f0aa4f
--- /dev/null
+++ b/cap/zx297520v3/src/lynq/lib/liblynq-at-factory/include/libat/lynq_at_factory.h
@@ -0,0 +1,25 @@
+/*============================================================================= 

+#     FileName: lynq_at_factory.h

+#     Desc: about at of factory

+#     Author: cz.li

+#     Version: V1.0

+#     LastChange: 2023-08-30 

+#     History: 

+      copyright:Mobiletek

+=============================================================================*/

+#ifndef LYNQ_AT_FACTORY_H

+#define LYNQ_AT_FACTORY_H 1

+#include <sc_bsp.h>

+#ifdef __cplusplus

+extern "C" {

+#endif

+#define MAX_GPIO_NUM 144

+typedef void ( *lynq_atsvc_incb )( const char *input,const int length);

+typedef void ( *lynq_atsvc_outcb )(char *output, int out_max_size, int mode);

+lynq_atsvc_incb lynq_register_at_factory(lynq_atsvc_outcb out_cb);

+

+static void *test_gpio_handle[MAX_GPIO_NUM]={NULL};

+#ifdef __cplusplus

+}

+#endif

+#endif
\ No newline at end of file
diff --git a/cap/zx297520v3/src/lynq/lib/liblynq-at-factory/liblynq-at-factory.cpp b/cap/zx297520v3/src/lynq/lib/liblynq-at-factory/liblynq-at-factory.cpp
new file mode 100755
index 0000000..b6d7e4d
--- /dev/null
+++ b/cap/zx297520v3/src/lynq/lib/liblynq-at-factory/liblynq-at-factory.cpp
@@ -0,0 +1,814 @@
+#include <string.h>

+#include <stdio.h>

+#include <stdlib.h>

+#include <sys/socket.h>

+#include <sys/time.h>

+#include <error.h>

+#include <string.h>

+#include <netinet/in.h>

+#include <netinet/ether.h>

+#include <netinet/ip.h>

+#include <netinet/udp.h>

+#include <netinet/if_ether.h>

+#include <netpacket/packet.h>

+#include <arpa/inet.h>

+#include <net/if.h>

+#include <errno.h>

+#include <log/log.h>

+#include <liblog/lynq_deflog.h>

+#include "include/libat/lynq_at_factory.h"

+

+#define FACTORY_STRING "AT+LYNQFACTORY="

+#define USER_LOG_TAG "AT_FACTORY"

+DEFINE_LYNQ_LIB_LOG(LYNQ_POWERALARM)

+

+

+#undef LOG_TAG

+#define LOG_TAG "AT_FACTORY"

+#define MTK 0

+#define ZXIC 1

+

+lynq_atsvc_outcb handle_output;

+

+typedef struct

+{

+    char *cmd;

+    void (*func)(char *input);

+}Command;

+

+enum

+{

+    Response = 0,

+    Urc

+};

+

+void lynq_response_ok()

+{

+    char *str = "OK";

+    handle_output(str, strlen(str), Response);

+}

+

+void lynq_response_error(int error_code)

+{

+    char str[32] = {0};

+    sprintf(str, "+CME ERROR: %d", error_code);

+    handle_output(str, strlen(str), Response);

+}

+

+void lynq_handle_adc(char *input)

+{

+    FILE *fp;

+    char lynq_adc_dev[126] = {0};

+    char lynq_adc_buf[32] = {0};

+    int lynq_adc_num = atoi(input+4);

+    char flag[64] = {0};

+

+    #ifdef MOBILETEK_TARGET_PLATFORM_T106

+    if(lynq_adc_num == 1)

+    {

+        sprintf(lynq_adc_dev,"cat /sys/kernel/debug/pmu_zx29/adc1");

+    }

+    else if(lynq_adc_num == 2)

+    {

+        sprintf(lynq_adc_dev,"cat /sys/kernel/debug/pmu_zx29/adc2");

+    }

+    

+    #else

+    if(lynq_adc_num == 0)

+    {

+        sprintf(lynq_adc_dev,"cat /sys/bus/iio/devices/iio:device1/in_voltage0_input  2>&1");

+    }

+    else if(lynq_adc_num == 1)

+    {

+        sprintf(lynq_adc_dev,"cat /sys/bus/iio/devices/iio:device1/in_voltage1_input  2>&1");

+    }

+    else if(lynq_adc_num == 2)

+    {

+        sprintf(lynq_adc_dev,"cat /sys/bus/iio/devices/iio:device1/in_voltage2_input  2>&1");

+    }

+    else if(lynq_adc_num == 3)

+    {

+        sprintf(lynq_adc_dev,"cat /sys/bus/iio/devices/iio:device1/in_voltage3_input  2>&1");

+    }

+    #endif

+

+    fp=popen(lynq_adc_dev, "r");

+    fgets(lynq_adc_buf,sizeof(lynq_adc_buf),fp);

+    sprintf(flag,"%s %s", "ADC:", lynq_adc_buf);

+    if(handle_output != NULL)

+    {

+        handle_output(flag, strlen(flag), Response);

+    }

+    lynq_response_ok();

+    pclose(fp);

+}

+

+void lynq_handle_emmc(char *input)

+{

+    FILE *fp;

+    char emmc_buf[100] = {0};

+    char buf[100] = {0};

+

+    #ifdef MOBILETEK_TARGET_PLATFORM_T106

+    sprintf(emmc_buf, "ls /dev | grep mmcblk1  2>&1");

+    #else

+    sprintf(emmc_buf, "ls /dev | grep mmcblk0  2>&1");

+    #endif

+

+    fp=popen(emmc_buf, "r");

+    if(!fp){

+        lynq_response_error(100);

+        return;

+    }

+    while(fgets(buf, sizeof(buf), fp) != NULL){

+        lynq_response_ok();

+        pclose(fp);

+        return;

+    }

+    lynq_response_error(100);

+    pclose(fp);

+}

+

+

+/******gpio API******/

+/*sc_gpio_init(gpio, direction, value, pullsel);

+  sc_gpio_direction_set(test_gpio_handle[gpio], direction, 0);

+  sc_gpio_value_set(test_gpio_handle[gpio], value);

+  sc_gpio_value_get(test_gpio_handle[gpio], &value);

+    gpio : gpio (0--143)

+    direction : 0 - input 1 - output 

+    value : when gpio output, set the default output value,if no use, set it to 0

+    pull_sel : 0 - bias disable 1 - pull down 2 - pull up

+    test_gpio_handle[gpio]:gpio handle get by init

+*/

+int lynq_gpio_analysis(char *input,int *lynq_gpio_arr,int lynq_gpio_total_arr[],int total_length)

+{

+    int j = 0;

+    int k = 0;

+    int size = 0;

+    char res[64] = {0};

+    int greep = input[0] - '0';

+    sprintf(res,"the greep:%d\n",greep);//The first digit represents grouping

+    handle_output(res, strlen(res), Response);

+

+    for (int i = 1; input[i] != '\0'; i++)

+    {

+        int num = 0;

+        for (; input[i] != ',' && input[i] != '\0'; i++)

+        {

+            if (input[i] >= '0' && input[i] <= '9')

+            {

+                num = num * 10 + (input[i] - '0');

+            }

+            else

+            {

+                handle_output("input error\r\n", strlen("input error\r\n"), Response);

+                return -1;

+            }

+        }

+        for (k = 0; k < total_length && num != 0;k++)

+        {

+            if(num == lynq_gpio_total_arr[k])

+            {

+                lynq_gpio_arr[size] = num;

+                size++;

+                break;

+            }

+        }

+        if(k >= total_length)

+        {

+            bzero(res,64);

+            sprintf(res,"GPIO%d input error\r\n",num);

+            handle_output(res, strlen(res), Response);

+        }

+    }

+    if (lynq_gpio_arr == NULL)

+    {

+        handle_output("input all gpio not exist\r\n", strlen("input all gpio not exist\r\n"), Response);

+        return -1;

+    }

+    return size;

+}

+

+#ifdef MOBILETEK_TARGET_PLATFORM_T106

+#define GPIO_FILE "/data/factory/gpio_T106.conf"

+int load_gpio(int *lynq_gpio_total_arr)

+{

+    FILE *fp;

+    char StrLine[512];

+    char StrGpio[512];

+    char platform[10] = {0};

+    char total[10] = {0};

+    int count = 0;

+    if((fp = fopen(GPIO_FILE, "r")) == NULL)

+    {

+        RLOGD("open %s error!\n", GPIO_FILE);

+        return -1;

+    }

+    while (!feof(fp))

+    {

+        memset(StrLine, 0, 512);

+        fgets(StrLine, 512, fp);

+        if(strstr(StrLine, "platform:") != NULL)

+        {

+            strcpy(platform, strstr(StrLine, "platform:") + sizeof("platform:") - 1);

+            if(!strcmp(platform,"T106"))

+            {

+                RLOGD("platform:error\n");

+                return -1;

+            }

+            RLOGD("platform:%s\n",platform);

+        }

+        

+        else if(strstr(StrLine, "total:") != NULL)

+        {

+            strcpy(total, strstr(StrLine, "total:") + sizeof("total:") - 1);

+            RLOGD("total:%s\n",total);

+        }

+        

+        else if((strstr(StrLine, "gpio:") != NULL))

+        {

+            strcpy(StrGpio, strstr(StrLine, "gpio:") + sizeof("gpio:") - 1);

+            for(int i=0; StrGpio[i] != '\0'; i++)

+            {

+                int num = 0;

+                for (; StrGpio[i] != ',' && StrGpio[i] != '\0' && StrGpio[i] != '\n'; i++)

+                {

+                    num = num * 10 + (StrGpio[i] - '0');

+                }

+                lynq_gpio_total_arr[count] = num;

+                count++;

+            }

+            break;

+

+        }

+    }

+    fclose(fp);

+    return count;

+}

+

+/*GPIO 50 is Used for comparison*/

+static int set_all_gpio_status_and_check(int lynq_gpio_arr[], int status, int total_length)

+{

+    int ret;

+    int value;

+    if(test_gpio_handle[50] != NULL)

+    {

+        ret = sc_gpio_uninit(test_gpio_handle[50]);

+        if(ret)

+        {

+            RLOGD("uninit 50 fail\n");

+            return -1;

+        }

+    }

+    test_gpio_handle[50] = sc_gpio_init(50, 0, 0, 0);

+    if(test_gpio_handle[50] == NULL)

+    {

+        RLOGD("init 50 fail\n");

+        return -1;

+    }

+    for(int m = 0; m < total_length; m++)

+    {

+        if(test_gpio_handle[lynq_gpio_arr[m]] != NULL)

+        {

+            ret = sc_gpio_uninit(test_gpio_handle[lynq_gpio_arr[m]]);

+            if(ret)

+            {

+                RLOGD("uninit%d fail\n",lynq_gpio_arr[m]);

+                return -1;

+            }

+        }

+        test_gpio_handle[lynq_gpio_arr[m]] = sc_gpio_init(lynq_gpio_arr[m], 1, status, 0);

+        if(test_gpio_handle[lynq_gpio_arr[m]] == NULL)

+        {

+            RLOGD("init%d fail\n",lynq_gpio_arr[m]);

+            return -1;

+        }

+    }

+    ret = sc_gpio_value_get(test_gpio_handle[50], &value);

+    if(ret)

+    {

+        return -1;

+    }

+    if(value != status)

+    {

+        return 1;

+    }

+    return 0;

+}

+

+int all_gpio_uninit(int total_length, int lynq_gpio_total_arr[256])

+{

+    int ret;

+    ret = sc_gpio_uninit(test_gpio_handle[50]);

+    if(ret)

+    {

+        return -1;

+        RLOGD("uninit 50 fail\n");

+    }

+    for(int m = 0; m < total_length; m++)

+    {

+        ret = sc_gpio_uninit(test_gpio_handle[lynq_gpio_total_arr[m]]);

+        if(ret)

+        {

+            return -1;

+            RLOGD("uninit%d fail\n",lynq_gpio_total_arr[m]);

+        }

+    }

+    return 0;

+}

+

+void lynq_handle_gpio(char *input)

+{

+    int lynq_gpio_total_arr[256];

+    int lynq_gpio_arr[256];

+    char lynq_show_gpio_state[64] = {0};

+    int lynq_gpio_low = 0;

+    int lynq_gpio_high = 0;

+    int total_length = 0;

+    int valid_length = 0;

+    int value;

+    int ret;

+    int lynq_gpio_test_env_error = 1;

+    int i = 0,m = 0,j = 0;

+    int need_int = 1;

+    int lynq_gpio_beta_state = 1;

+

+    if((total_length = load_gpio(lynq_gpio_total_arr)) < 0)

+    {

+        RLOGD("Don't have this platform gpio configure\n");

+        return;

+    }

+    RLOGD("start function %s line %d input %s\n", __FUNCTION__, __LINE__, input);

+    handle_output(input, strlen(input), Response);

+    input = input + strlen("gpio");

+    if((valid_length = lynq_gpio_analysis(input, lynq_gpio_arr, lynq_gpio_total_arr, total_length)) < 0)

+    {

+        lynq_response_error(100);

+        return;

+    }

+    RLOGD("The Valid count:%d\n",valid_length);

+    for(i=0; i < sizeof(lynq_gpio_arr)/sizeof(int); i++)

+    {

+        for(j=0;j<3;j++)

+        {

+            if  (j > 0) // reset gpio when retry

+            {

+                need_int = 1;

+            }

+

+            if (need_int == 1)

+            {

+                ret = set_all_gpio_status_and_check(lynq_gpio_total_arr, 0, total_length);

+                if (ret == 1)

+                {

+                    RLOGD("can't pull up or pull down gpio-50\n");

+                    continue;

+                }

+                else if(ret == 0)

+                {

+                    RLOGD("all gpio can pull up or pull dpwn\n");

+                    need_int = 0;

+                }

+                else if(ret == -1)

+                {

+                    RLOGD("gpio init or uninit fail\n");

+                    lynq_response_error(100);

+                    return;

+                }

+                RLOGD("finsh configure function %s line %d input %s\n", __FUNCTION__, __LINE__, input);  

+            }

+

+            lynq_gpio_low = 0;

+            lynq_gpio_high = 0;

+

+            for(int n=0;n<3;n++)

+            {

+                ret = sc_gpio_value_set(test_gpio_handle[lynq_gpio_arr[1]], 1);

+                ret = sc_gpio_value_get(test_gpio_handle[50], &value);

+                if(ret)

+                {

+                    RLOGD("sc_gpio_value_get");

+                }

+                if(value == 1)

+                {

+                    RLOGD("high function %s line %d input %s\n", __FUNCTION__, __LINE__, input);

+                    lynq_gpio_high = 1;

+                    lynq_gpio_test_env_error = 0;

+                    break;

+                }

+                else

+                {

+                    RLOGD("high function %s line %d input %s num %d\n", __FUNCTION__, __LINE__, input,lynq_gpio_arr[i]);

+                    if(i == 0 && j == 0)

+                    {

+                        lynq_gpio_test_env_error = set_all_gpio_status_and_check(lynq_gpio_total_arr, 1, total_length) == 0 ? 0 : 1;

+                    }

+                }

+            }

+            if (lynq_gpio_test_env_error == 1)

+                break;

+            ret = sc_gpio_value_set(test_gpio_handle[lynq_gpio_arr[i]], 0);

+            if(ret)

+                {

+                    RLOGD("sc_gpio_value_set gpio%d fail\n",lynq_gpio_arr[i]);

+                }

+            ret = sc_gpio_value_get(test_gpio_handle[50], &value);

+            if(ret)

+                {

+                    RLOGD("sc_gpio_value_get fail\n");

+                }

+            if(value == 0)

+            {

+                RLOGD("*low function %s line %d input %s\n", __FUNCTION__, __LINE__, input);

+                lynq_gpio_low = 1;

+            }

+            else

+            {

+                RLOGD("low function fail %s line %d input %s num %d\n", __FUNCTION__, __LINE__, input,lynq_gpio_arr[i]);

+            }

+            bzero(lynq_show_gpio_state, 64);

+            if((lynq_gpio_low != 1) || (lynq_gpio_high != 1))

+            {

+                RLOGD("fail function %s line %d input %s\n", __FUNCTION__, __LINE__, input);

+            }

+            else

+            {

+                RLOGD("success function %s line %d input %s\n", __FUNCTION__, __LINE__, input);

+                sprintf(lynq_show_gpio_state,"gpio%d\n",lynq_gpio_arr[i]);

+                handle_output(lynq_show_gpio_state, strlen(lynq_show_gpio_state), Response);

+                break; // do not retry when pass

+            }

+        } // for(j=0;j<3;j++)

+        if (lynq_gpio_test_env_error == 1)

+        {

+            lynq_gpio_beta_state = 0;

+            break;

+        }

+        if (j >= 3 )

+        {

+            lynq_gpio_beta_state = 0;

+            sprintf(lynq_show_gpio_state,"[gpio%d][result]:FAIL \n",lynq_gpio_arr[i]);

+            handle_output(lynq_show_gpio_state, strlen(lynq_show_gpio_state), Response);

+        }

+    } // for(i=0; i < sizeof(lynq_gpio_arr)/sizeof(lynq_gpio_arr[0]); i++)

+

+    if(lynq_gpio_test_env_error == 1)

+    {

+        RLOGD("tool error\n");

+        handle_output("tool error\n", strlen("tool error\n"), Response);

+    }

+

+    if(lynq_gpio_beta_state == 1)

+    {

+        RLOGD("total success function %s line %d input %s\n", __FUNCTION__, __LINE__, input);

+        lynq_response_ok();

+    }

+    else

+    {

+        RLOGD("total fail function %s line %d input %s\n", __FUNCTION__, __LINE__, input);

+        lynq_response_error(100);

+    }

+    ret = all_gpio_uninit(total_length, lynq_gpio_total_arr);

+    if(ret)

+    {

+        RLOGD("all_gpio_uninit fail\n");

+        lynq_response_error(100);

+        return;

+    }

+}

+

+int receive_data(int fd,char *buf_send,char *buf_recv, int send_len, int count)

+{

+    time_t time_start;

+    time_t time_end;

+    ssize_t ret;

+    char *buf_cmp = NULL;

+    int corrent_cont = 0;

+    time_start=time(NULL);

+    char reason_buf[32] = {0};

+

+    /*To prevent packet loss,Setting 50 opportunities*/

+    for(int cont = 0; cont < 50; cont++)

+    {

+        bzero(reason_buf,sizeof(reason_buf));

+        bzero(buf_recv, sizeof(buf_recv));

+        ret = recv(fd,buf_recv,1472,0);

+        time_end=time(NULL);

+        if(difftime(time_end,time_start)>2)

+        {

+            sprintf(reason_buf,"%d:time_out\n",count);

+            RLOGD(reason_buf, strlen(reason_buf), Response);

+            return -1;

+        }

+        if(ret<0)

+        {

+            sprintf(reason_buf,"%d:recv_fail\n",count);

+            RLOGD(reason_buf, strlen(reason_buf), Response);

+            return -1;

+        }

+

+        else if (ret < sizeof(buf_recv))

+        {

+            continue;

+        }

+        // Analyzing Ethernet frame headers

+        struct ethhdr *eth_header = (struct ethhdr *)buf_recv;

+        RLOGD("Source MAC: %02X:%02X:%02X:%02X:%02X:%02X\n", eth_header->h_source[0], eth_header->h_source[1], eth_header->h_source[2], eth_header->h_source[3], eth_header->h_source[4], eth_header->h_source[5]);

+        RLOGD("Destination MAC: %02X:%02X:%02X:%02X:%02X:%02X\n", eth_header->h_dest[0], eth_header->h_dest[1], eth_header->h_dest[2], eth_header->h_dest[3], eth_header->h_dest[4], eth_header->h_dest[5]);

+        RLOGD("Ethernet Type: %04X\n", ntohs(eth_header->h_proto));

+        // Analyzing IP headers

+        struct iphdr *ip_header = (struct iphdr *)(buf_recv + sizeof(struct ethhdr));

+        RLOGD("Source IP: %s\n", inet_ntoa(*(struct in_addr *)&ip_header->saddr));

+        RLOGD("Destination IP: %s\n", inet_ntoa(*(struct in_addr *)&ip_header->daddr));

+        RLOGD("Protocol: %d\n", ip_header->protocol);

+        // Analyzing UDP headers

+        struct udphdr *udp_header = (struct udphdr *)(buf_recv + sizeof(struct iphdr) + sizeof(struct ethhdr));

+        RLOGD("Source Port: %d\n", ntohs(udp_header->source));

+        RLOGD("Destination Port: %d\n", ntohs(udp_header->dest));

+        RLOGD("UDP Length: %d\n", ntohs(udp_header->len));

+        // Compare data

+        buf_cmp = buf_recv + sizeof(struct ethhdr) + sizeof(struct iphdr) + sizeof(struct udphdr);

+        if(memcmp(buf_send, buf_cmp, send_len))

+        {

+            RLOGD("rec data fail and retry!!\n");

+            continue;

+        }

+        // raw_socket will received data twice

+        else

+        {

+            corrent_cont++;

+            RLOGD("rec data success and again!!\n");

+            if(corrent_cont == 2)

+            {

+                RLOGD("cammpare OK!!\n");

+                return 0;

+            }

+            continue;

+        }

+        

+    }

+    handle_output("can't receive correct data", strlen("can't receive correct data"), Response);

+    return -1;

+}

+

+int rgmii_init()

+{

+    char lynq_set_rgmii_arr[128] = {0};

+

+    bzero(lynq_set_rgmii_arr, 128);

+    sprintf(lynq_set_rgmii_arr,"echo 1,0x03,0x8800,0xc834 > /sys/devices/platform/soc/1307000.gmac/mdio_test");

+    if(system(lynq_set_rgmii_arr))

+    {

+        handle_output("Please checkout network_line", strlen("Please checkout network_line"), Response);

+        return -1;

+    }

+    bzero(lynq_set_rgmii_arr, 128);

+    sprintf(lynq_set_rgmii_arr,"echo 1,0x01,0x0,0xa000 > /sys/devices/platform/soc/1307000.gmac/mdio_test");

+    if(system(lynq_set_rgmii_arr))

+    {

+        handle_output("Please checkout network_line", strlen("Please checkout network_line"), Response);

+        return -1;

+    }

+

+    bzero(lynq_set_rgmii_arr, 128);

+    sprintf(lynq_set_rgmii_arr,"ethtool -s eth0 speed 100 duplex full autoneg off");

+    system(lynq_set_rgmii_arr);

+

+    bzero(lynq_set_rgmii_arr, 128);

+    sprintf(lynq_set_rgmii_arr,"ifconfig eth0 192.168.22.1");

+    system(lynq_set_rgmii_arr);

+

+    

+    bzero(lynq_set_rgmii_arr, 128);

+    sprintf(lynq_set_rgmii_arr,"ip n replace 192.168.22.2 lladdr ec:1d:7f:b0:2f:32 dev eth0");

+    system(lynq_set_rgmii_arr);

+

+    bzero(lynq_set_rgmii_arr, 128);

+    sprintf(lynq_set_rgmii_arr,"ifconfig eth0 promisc");

+    system(lynq_set_rgmii_arr);

+

+    bzero(lynq_set_rgmii_arr, 128);

+    sprintf(lynq_set_rgmii_arr,"brctl delif br0 eth0");

+    system(lynq_set_rgmii_arr);

+

+    return 0;

+}

+

+int rgmii_socket_init(struct sockaddr_in* server_addr, const char * ip_addr)

+{

+    int ser_socket = -1;

+    server_addr->sin_family=AF_INET;

+    server_addr->sin_port = htons(100);

+    server_addr->sin_addr.s_addr = inet_addr(ip_addr);

+

+    ser_socket = socket(AF_INET,SOCK_DGRAM,0);

+    

+    if (ser_socket<0)

+    {

+        return -1;

+    }

+    

+    struct timeval timeout={1,0};

+    int ret;

+    ret = bind(ser_socket,(struct sockaddr*)server_addr,sizeof(*server_addr));

+    if(ret< 0)

+    {

+        close(ser_socket);

+        return -1;

+    }

+    return ser_socket;

+}

+

+void lynq_handle_rgmii()

+{

+    int ret;

+    int check_count = 0;

+    int check_ok_count = 0;

+    int socketfd = -1;

+    int raw_socket = -1;

+    char buf_init[1024];

+    char buf_recv[1472];

+    char flag[256]={0};

+    struct sockaddr_in ser_addr;

+    struct sockaddr_in cli_addr;

+    struct sockaddr_ll raw_addr;

+    struct ifreq ser;

+    time_t start,end;

+    bzero(buf_init,sizeof(buf_init));

+    bzero(buf_recv,sizeof(buf_recv));

+    

+    const char *ser_ip = "192.168.22.1";

+    const char *cli_ip = "192.168.22.2";

+

+    int count = 0;

+    ret = rgmii_init();

+    if(ret<0)

+    {

+        lynq_response_error(1);

+        return;

+    }

+    cli_addr.sin_family=AF_INET;

+    cli_addr.sin_port = htons(100);

+    cli_addr.sin_addr.s_addr = inet_addr(cli_ip);

+

+    socketfd = rgmii_socket_init(&ser_addr,ser_ip);

+    if(socketfd < 0)

+    {

+        handle_output("init_failed", strlen("init_failed"), Response);

+        lynq_response_error(2);

+        return;

+    }

+    //Use raw_socket receive data at the link layer

+    raw_socket = socket(AF_PACKET, SOCK_RAW, htons(ETH_P_ALL));

+    if(raw_socket < 0)

+    {

+        handle_output("raw_socket init_failed", strlen("raw_socket init_failed"), Response);

+        lynq_response_error(2);

+        return;

+    }

+    memset(&raw_addr, 0, sizeof(raw_addr));

+    raw_addr.sll_family=AF_PACKET;

+    raw_addr.sll_protocol = htons(ETH_P_ALL);

+    raw_addr.sll_ifindex = if_nametoindex("eth0");

+

+    ret = bind(raw_socket, (struct sockaddr*)&raw_addr, sizeof(raw_addr));//bind network interface card

+    if(ret < 0)

+    {

+        handle_output("bind raw_socket init_failed", strlen("bind raw_socket init_failed"), Response);

+        lynq_response_error(3);

+        return;

+    }

+

+    for(int j =0;j<4;j++)

+    {

+        for(int i =0;i<255;i++)

+        {

+            count += sprintf(buf_init + count,"%c",i);

+            if (count >= 1024)

+            {

+                buf_init[1023] = '\0';

+                break;

+            }

+        }

+        

+        if (count >= 1024)

+        {

+            break;

+        }

+    }

+

+    start = time(NULL);

+    for(int i=0;i<128;i++)

+    {

+        check_count++;

+        end = time(NULL);

+        if(difftime(end,start)>20)

+        {

+            break;

+        }

+        ret = sendto(socketfd,buf_init,sizeof(buf_init),0,(struct sockaddr*)&cli_addr,sizeof(cli_addr));

+        if(ret < 0 )

+        {

+            continue;

+        }

+        ret = receive_data(raw_socket,buf_init,buf_recv, sizeof(buf_init),check_count);

+        if(ret < 0)

+        {

+            continue;

+        }

+

+        check_ok_count ++;

+    }

+    //  Received correctly 120 times

+    if(check_ok_count >= 120)

+    {

+        RLOGD("rgmii OK!!\n");

+        lynq_response_ok();

+    }

+    else

+    {

+        sprintf(flag,"sent %d, success %d\n", check_count, check_ok_count);

+        handle_output(flag, strlen(flag), Response);

+        lynq_response_error(100);

+    }

+

+    close(socketfd);

+    close(raw_socket);

+    return;

+}

+#endif

+

+void lynq_handle_sdio(char *input)

+{

+    lynq_response_error(100);

+}

+void lynq_handle_pcm(char *input)

+{

+    lynq_response_error(100);

+}

+static Command commands[] = 

+{

+    {"adc",lynq_handle_adc},

+    {"emmc",lynq_handle_emmc},

+    {"gpio",lynq_handle_gpio},

+    {"rgmii",lynq_handle_rgmii},

+    {"sdio",lynq_handle_sdio},

+    {"pcm",lynq_handle_pcm},

+    {NULL, NULL}

+};

+

+Command* find_command(char *input)

+{

+    RLOGD("function %s line %d input %s\n", __FUNCTION__, __LINE__, input);

+    int i;

+    int ret = -1;

+    for (i = 0; commands[i].cmd; i++)

+    {

+        ret = strncmp(input, commands[i].cmd, strlen(commands[i].cmd));

+        if(ret == 0)

+        {

+            RLOGD("function %s line %d find input %s commands[i].cmd %s  strlen %d ret %d\n", __FUNCTION__, __LINE__, input, commands[i].cmd, strlen(commands[i].cmd), ret);

+            return (&commands[i]);

+        }

+    }

+    RLOGD("function %s line %d not find ret %d \n", __FUNCTION__, __LINE__, ret);

+    return ((Command *)NULL);

+}

+

+void lynq_at_factory_cb(char *input, int input_max_size)

+{

+    if(handle_output != NULL)

+    {

+        RLOGD("function %s line %d input %s\n", __FUNCTION__, __LINE__, input);

+        if(input != NULL)

+        {

+            char *handle_string = input + strlen(FACTORY_STRING);

+            if(!strlen(handle_string))

+            {

+                RLOGD("function %s line %d strlen %d\n", __FUNCTION__, __LINE__, strlen(handle_string));

+                return;

+            }

+            RLOGD("function %s line %d  handle_string %s\n", __FUNCTION__, __LINE__, handle_string);

+            Command *cmd = find_command(handle_string);

+            if(cmd != NULL)

+            {

+                RLOGD("function %s line %d\n", __FUNCTION__, __LINE__);

+                (*(cmd->func))(handle_string);

+                return;

+            }

+        }

+    }

+}

+

+lynq_atsvc_incb lynq_register_at_factory(lynq_atsvc_outcb out_cb)

+{

+    if(out_cb != NULL)

+    {

+        handle_output = out_cb;

+        RLOGD("function %s line %d\n", __FUNCTION__, __LINE__);

+        return lynq_at_factory_cb;

+    }

+}

+

+

diff --git a/cap/zx297520v3/src/lynq/lib/liblynq-at-factory/makefile b/cap/zx297520v3/src/lynq/lib/liblynq-at-factory/makefile
new file mode 100755
index 0000000..d511161
--- /dev/null
+++ b/cap/zx297520v3/src/lynq/lib/liblynq-at-factory/makefile
@@ -0,0 +1,80 @@
+

+SHELL = /bin/sh

+RM = rm -f

+

+LOCAL_CFLAGS := -Wall \

+                -std=gnu++14 \

+                -g -Os \

+                -flto \

+                -DRIL_SHLIB \

+                -DATCI_PARSE \

+                -fPIC \

+                -DKEEP_ALIVE \

+                -DECALL_SUPPORT \

+                -fpermissive \

+

+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

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

+LOCAL_CFLAGS += -DMOBILETEK_TARGET_PLATFORM_T106

+endif

+$(warning ################# lynq at factory demo ROOT: $(ROOT),includedir:$(includedir))

+LOCAL_PATH   = .

+

+LOCAL_C_INCLUDES = \

+  -I. \

+  -I$(LOCAL_PATH)/include/libat \

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

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

+  -I$(ROOT)$(includedir)/vendor-ril \

+

+

+LOCAL_LIBS := \

+    -L. \

+    -ldl \

+    -lstdc++ \

+    -llog \

+    -lcutils \

+    -lutils \

+    -lbinder \

+    -lpthread \

+    -llynq-log \

+	-lbsp \

+

+

+SOURCES = $(wildcard *.cpp)

+

+EXECUTABLE = liblynq-at-factory.so

+

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

+

+.PHONY: build clean install pack_rootfs

+

+all: build

+$(EXECUTABLE): $(OBJECTS)

+	$(CXX) -shared -Wl,--no-undefined $(OBJECTS) $(LOCAL_LIBS) $(LOCAL_CFLAGS) $(LOCAL_C_INCLUDES) -o $@

+

+%.o : %.cpp

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

+

+build:  $(EXECUTABLE)

+	$(warning ########## build $(EXECUTABLE)  ##########)

+

+install:

+	mkdir -p $(ROOT)$(base_libdir)/

+	install $(EXECUTABLE) $(ROOT)$(base_libdir)/

+	mkdir -p $(ROOT)$(includedir)/$(NAME)/sdk

+

+pack_rootfs:

+	mkdir -p $(PACK_INITRAMFS_TO)$(base_libdir)/

+	cp -af $(EXECUTABLE) $(PACK_INITRAMFS_TO)$(base_libdir)/

+	$(CROSS)strip $(PACK_INITRAMFS_TO)$(base_libdir)/$(EXECUTABLE)

+	mkdir -p $(PACK_TO)$(base_libdir)/

+	cp -af $(EXECUTABLE) $(PACK_TO)$(base_libdir)/

+	$(CROSS)strip $(PACK_TO)$(base_libdir)/$(EXECUTABLE)

+	

+.PHONY: clean

+clean:

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

+	-find . -name "*.o" -delete

diff --git a/cap/zx297520v3/src/lynq/lib/liblynq-qser-fota/lynq-qser-fota.cpp b/cap/zx297520v3/src/lynq/lib/liblynq-qser-fota/lynq-qser-fota.cpp
index 3e3393e..53ee3c8 100755
--- a/cap/zx297520v3/src/lynq/lib/liblynq-qser-fota/lynq-qser-fota.cpp
+++ b/cap/zx297520v3/src/lynq/lib/liblynq-qser-fota/lynq-qser-fota.cpp
@@ -177,22 +177,7 @@
             LYINFLOG("set system B boot failed ");

             return -1;

         }

-

-         

-        ret = lynq_set_system_a_status((char *)UNBOOTABLE);

-        if(ret < 0)

-        {

-            LYINFLOG("Set system A status to [%s] error ", UNBOOTABLE);

-            return -1;

-        }

-

-        ret = lynq_set_system_b_status((char *)BOOTABLE);

-        if(ret < 0)

-        {

-            LYINFLOG("Set system B status to [%s] error ", BOOTABLE);

-            return -1;

-        }

-

+        

     }

     else if( current_slot == atoi(SYSTEM_B))

     {

@@ -206,21 +191,6 @@
             return -1;

         }

 

-        

-        ret = lynq_set_system_b_status((char *)UNBOOTABLE);

-        if(ret < 0)

-        {

-            LYINFLOG("Set system B status to [%s] error ", UNBOOTABLE);

-            return -1;

-        }

-

-        ret = lynq_set_system_a_status((char *)BOOTABLE);

-        if(ret < 0)

-        {

-            LYINFLOG("Set system A status to [%s] error ", BOOTABLE);

-            return -1;

-        }

-

     }

     

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

diff --git a/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/sdk/ril/reference-ril/ril_cc.c b/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/sdk/ril/reference-ril/ril_cc.c
index 2b9df65..ee8b878 100755
--- a/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/sdk/ril/reference-ril/ril_cc.c
+++ b/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/sdk/ril/reference-ril/ril_cc.c
@@ -637,6 +637,12 @@
 	/* success or failure is ignored by the upper layer here.

 	   it will call GET_CURRENT_CALLS and determine success that way */

 	RIL_onRequestComplete(t, RIL_E_SUCCESS, NULL, 0);

+

+    //l.yang modify for bug id T106BUG-268 2023/9/28 start 

+    at_response_free(p_response);

+    return;

+     //l.yang modify for bug id T106BUG-268 2023/9/28 end 

+     

     //l.yang modify for bug id T106BUG-54 2023/9/20 start 

 error:

     RIL_onRequestComplete(t, RIL_E_GENERIC_FAILURE, NULL, 0);

diff --git a/update_version.sh b/update_version.sh
index d46b682..c87df48 100644
--- a/update_version.sh
+++ b/update_version.sh
@@ -1,8 +1,8 @@
 #!/bin/bash
 #export LYNQ_VERSION="T106_lynq_version_ap_build_sh"
-LYNQ_AP_VERSION="T106CN-ZS03.V2.01.01.02P50U04.AP.08.02"
-LYNQ_CAP_INSIDE_VERSION="CAP.08.02"
-LYNQ_CAP_VERSION="CAP.08.02"
+LYNQ_AP_VERSION="T106CN-ZS03.V2.01.01.02P50U04.AP.08.05"
+LYNQ_CAP_INSIDE_VERSION="CAP.08.05"
+LYNQ_CAP_VERSION="CAP.08.05"
 COMMIT_ID="$(git rev-parse HEAD)"
 
 LYNQ_SW_INSIDE_VERSION="LYNQ_CONFIG_VERSION = \"${LYNQ_AP_VERSION}_${LYNQ_CAP_INSIDE_VERSION}\""