Merge "[Bugfix][106BUG-116][Network] T106 support get current cell's tac earfcn"
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/allbins/zx297520v3/prj_vehicle/scripts_linux/copybin_vehicle_dc_ref.sh b/allbins/zx297520v3/prj_vehicle/scripts_linux/copybin_vehicle_dc_ref.sh
index cb9574a..364ab03 100755
--- a/allbins/zx297520v3/prj_vehicle/scripts_linux/copybin_vehicle_dc_ref.sh
+++ b/allbins/zx297520v3/prj_vehicle/scripts_linux/copybin_vehicle_dc_ref.sh
@@ -50,7 +50,7 @@
#ap
cp -rvf $TOP_DIR/ap/project/zx297520v3/prj_vehicle_dc_ref/bin/220A1/allbins/* $TOP_DIR/allbins/zx297520v3/prj_vehicle/allbins_dc_ref/
-cp -rvf $TOP_DIR/ap/project/zx297520v3/prj_vehicle_dc_ref/bin/220A1/elf_dc_ref/* $TOP_DIR/allbins/zx297520v3/prj_vehicle/elf_dc_ref/
+cp -rvf $TOP_DIR/ap/project/zx297520v3/prj_vehicle_dc_ref/bin/220A1/elfs/* $TOP_DIR/allbins/zx297520v3/prj_vehicle/elf_dc_ref/
#cap
mkdir -p $TOP_DIR/allbins/zx297520v3/prj_vehicle/elf_dc_ref/cap
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..6ef9412 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,9 @@
liblynq-systime \
liblynq-autosuspend \
liblynq-qser-autosuspend \
+ liblynq-at-factory \
+ liblynq-gpio \
+ liblynq-irq \
"
zxic_lib += "${@bb.utils.contains('CONFIG_TEL_API_SUPPORT', 'RIL', 'libril', 'libtelsvr', d)}"
@@ -268,6 +271,8 @@
lynq-autosuspend \
lynq-atcid \
lynq-qser-autosuspend-demo \
+ lynq-gpio-demo \
+ lynq-irq-demo \
"
zxic_app_open += "${@bb.utils.contains('CONFIG_TEL_API_SUPPORT', 'RIL', 'rild', '', d)}"
diff --git a/cap/zx297520v3/sources/meta-zxic-custom/recipes-core/images/files/squashfs_dm-verity.sh b/cap/zx297520v3/sources/meta-zxic-custom/recipes-core/images/files/squashfs_dm-verity.sh
index 9e504f7..f7ff653 100755
--- a/cap/zx297520v3/sources/meta-zxic-custom/recipes-core/images/files/squashfs_dm-verity.sh
+++ b/cap/zx297520v3/sources/meta-zxic-custom/recipes-core/images/files/squashfs_dm-verity.sh
@@ -4,17 +4,18 @@
WORK_DIR=$2
OUT_FILE=$3
PRIV_KEY=$4
+SignImage=$5
VERITY_DIR=$WORK_DIR/verity
-rm -rf $VERITY_DIR/raw_table $VERITY_DIR/hash_tree $VERITY_DIR/sign
+rm -rf $VERITY_DIR $OUT_FILE $OUT_FILE.pad
mkdir -p $VERITY_DIR
# 1.pad
let size="$(stat -c%s $IN_FILE)" pad="128*1024" offset="0" pad="(pad - ((size + offset) % pad)) % pad" newsize='size + pad'
echo $size $newsize
dd if=$IN_FILE of=$OUT_FILE bs=$newsize count=1 conv=sync
-cp -v $OUT_FILE $OUT_FILE.pad
+#cp -v $OUT_FILE $OUT_FILE.pad
# 2. gen raw_table and hash_tree
veritysetup format $OUT_FILE $VERITY_DIR/hash_tree > $VERITY_DIR/raw_table
@@ -24,14 +25,16 @@
fi
# 3. gen signature of raw_table
-openssl dgst -sha256 -binary -sign $PRIV_KEY $VERITY_DIR/raw_table > $VERITY_DIR/sign
+#openssl dgst -sha256 -binary -sign $PRIV_KEY $VERITY_DIR/raw_table > $VERITY_DIR/sign
+$SignImage -i $VERITY_DIR/raw_table -o $VERITY_DIR/raw_table.signed -k $PRIV_KEY
if [ $? -ne 0 ]; then
echo "generate squashfs dm-verity sign error!"
exit 1
fi
+dd if=$VERITY_DIR/raw_table.signed of=$VERITY_DIR/sign bs=640 count=1 status=none
# 4. padding sign, raw_table and hash_tree to input file
-$WORK_DIR/generate_squashfs_verity $OUT_FILE $VERITY_DIR/sign $VERITY_DIR/raw_table $VERITY_DIR/hash_tree
+$WORK_DIR/zxic_generate_squashfs_verity $OUT_FILE $VERITY_DIR/sign $VERITY_DIR/raw_table $VERITY_DIR/hash_tree
if [ $? -ne 0 ]; then
echo "generate squashfs dm-verity error!"
exit 1
diff --git a/cap/zx297520v3/sources/meta-zxic-custom/recipes-core/images/files/zx297520v3/vehicle_dc_ref/fs/normal/rootfs/etc_ro/default/default_parameter_user b/cap/zx297520v3/sources/meta-zxic-custom/recipes-core/images/files/zx297520v3/vehicle_dc_ref/fs/normal/rootfs/etc_ro/default/default_parameter_user
index 6278707..690246e 100755
--- a/cap/zx297520v3/sources/meta-zxic-custom/recipes-core/images/files/zx297520v3/vehicle_dc_ref/fs/normal/rootfs/etc_ro/default/default_parameter_user
+++ b/cap/zx297520v3/sources/meta-zxic-custom/recipes-core/images/files/zx297520v3/vehicle_dc_ref/fs/normal/rootfs/etc_ro/default/default_parameter_user
@@ -484,7 +484,7 @@
zlog_size=100
zlog_path=/mnt/userdata/zcat
rule_file=/mnt/userdata/simple_1.rule
-cap_port_name=/dev/ttyGS0
+cap_port_name=/dev/ttyGS0 + /dev/ttyGS1
customIndCmdList=
defrt_cid=1
MaxRtrAdvInterval=1800
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/liblynq-gpio/liblynq-gpio.bb b/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/liblynq-gpio/liblynq-gpio.bb
new file mode 100755
index 0000000..b380fbd
--- /dev/null
+++ b/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/liblynq-gpio/liblynq-gpio.bb
@@ -0,0 +1,52 @@
+#inherit externalsrc package
+
+DESCRIPTION = "liblynq-gpio"
+LICENSE = "CLOSED"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=4f60c98fa94e02f659ef5939f67fa8ae"
+
+DEPENDS += "liblynq-log libbsp"
+#inherit workonsrc
+WORKONSRC = "${TOPDIR}/../src/lynq/lib/liblynq-gpio/"
+FILESEXTRAPATHS_prepend :="${TOPDIR}/../src/lynq/lib/:"
+SRC_URI = " \
+ file://liblynq-gpio\
+ "
+
+SRC-DIR = "${S}/../liblynq-gpio"
+TARGET_CC_ARCH += "${LDFLAGS}"
+BB_INCLUDE_ADD = "--sysroot=${STAGING_DIR_HOST}"
+BB_LDFLAGS_ADD = "--sysroot=${STAGING_DIR_HOST} -Wl,--hash-style=gnu"
+#Parameters passed to do_compile()
+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"
+}
+
+do_install () {
+ oe_runmake install -C ${SRC-DIR} ROOT=${D}
+
+ if [ -d "${WORKONSRC}" ] ; then
+ install -d ${D}${includedir}/
+ cp -af ${SRC-DIR}/include/ ${D}${includedir}/
+ fi
+}
+
+addtask bachclean
+do_bachclean () {
+ oe_runmake clean
+}
diff --git a/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/liblynq-irq/liblynq-irq.bb b/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/liblynq-irq/liblynq-irq.bb
new file mode 100755
index 0000000..acbcf36
--- /dev/null
+++ b/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/liblynq-irq/liblynq-irq.bb
@@ -0,0 +1,52 @@
+#inherit externalsrc package
+
+DESCRIPTION = "liblynq-irq"
+LICENSE = "CLOSED"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=a602258eb4e1a7f2625939bd2e61155e"
+
+DEPENDS += "liblynq-log libbsp"
+#inherit workonsrc
+WORKONSRC = "${TOPDIR}/../src/lynq/lib/liblynq-irq/"
+FILESEXTRAPATHS_prepend :="${TOPDIR}/../src/lynq/lib/:"
+SRC_URI = " \
+ file://liblynq-irq\
+ "
+
+SRC-DIR = "${S}/../liblynq-irq"
+TARGET_CC_ARCH += "${LDFLAGS}"
+BB_INCLUDE_ADD = "--sysroot=${STAGING_DIR_HOST}"
+BB_LDFLAGS_ADD = "--sysroot=${STAGING_DIR_HOST} -Wl,--hash-style=gnu"
+#Parameters passed to do_compile()
+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"
+}
+
+do_install () {
+ oe_runmake install -C ${SRC-DIR} ROOT=${D}
+
+ if [ -d "${WORKONSRC}" ] ; then
+ install -d ${D}${includedir}/
+ cp -af ${SRC-DIR}/include/ ${D}${includedir}/
+ 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/sources/meta-zxic-custom/recipes-lynq/lynq-qser-sms-demo/files/lynq-qser-sms-demo.cpp b/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-qser-sms-demo/files/lynq-qser-sms-demo.cpp
index 7e4c03c..6707bc2 100755
--- a/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-qser-sms-demo/files/lynq-qser-sms-demo.cpp
+++ b/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-qser-sms-demo/files/lynq-qser-sms-demo.cpp
@@ -147,7 +147,7 @@
sprintf(msg,"hello");
strncpy(pt_sms_info.src_addr, argv[1], SMS_BUF);
strncpy(pt_sms_info.sms_data, msg, MSG_BUF);
- pt_sms_info.format = QSER_SMS_8BIT;
+ pt_sms_info.format = QSER_SMS_7BIT;
// printf("[%s,%d] src_addr=%s, telephony_num = %s\n",__FUNCTION__,__LINE__, pt_sms_info.src_addr, telephony_num);
printf("[%s,%d] sms_data=%s, msg = %s\n",__FUNCTION__,__LINE__, pt_sms_info.sms_data, msg);
diff --git a/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/poweralarm-demo/files/poweralarm-demo.cpp b/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/poweralarm-demo/files/poweralarm-demo.cpp
index 199106b..a83d3d7 100755
--- a/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/poweralarm-demo/files/poweralarm-demo.cpp
+++ b/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/poweralarm-demo/files/poweralarm-demo.cpp
@@ -132,7 +132,7 @@
ret = wakealarm(tmp_time);
if(ret != 0)
{
- printf("set poweralarm failed\n");
+ printf("set wakealarm failed\n");
return -1;
}
break;
@@ -155,18 +155,19 @@
printf("Input time_sec you want poweralarm,e.g:60 (seconds)\n");
scanf("%lu",&time_sec);
ret =lynq_set_poweralarm(time_sec);
+ printf("ret is %d\n",ret);
if(ret != 0)
{
printf("lynq_set_poweralarm failed\n");
return -1;
}
-
+ break;
}
case 5:
{
int ret = 0;
unsigned long time_sec = 0;
- printf("Input time_sec you want poweralarm,e.g:60 (seconds)\n");
+ printf("Input time_sec you want wakealarm,e.g:60 (seconds)\n");
scanf("%lu",&time_sec);
ret =lynq_set_wakealarm(time_sec);
if(ret != 0)
@@ -174,6 +175,7 @@
printf("lynq_set_wakealarm failed\n");
return -1;
}
+ break;
}
default:
diff --git a/cap/zx297520v3/sources/meta-zxic/recipes-app/libmedia/libmedia.bb b/cap/zx297520v3/sources/meta-zxic/recipes-app/libmedia/libmedia.bb
index 818c508..e53281d 100755
--- a/cap/zx297520v3/sources/meta-zxic/recipes-app/libmedia/libmedia.bb
+++ b/cap/zx297520v3/sources/meta-zxic/recipes-app/libmedia/libmedia.bb
@@ -29,10 +29,9 @@
install -d ${D}/usr/include
install -m 0755 ${S}/libmedia/libmedia.so ${D}${libdir}/
install -m 0755 ${S}/libmedia/libmedia.a ${D}${libdir}/
-#xf.li@20230920 modify for esdk start -tmp
- #install -m 0644 ${S}/libmedia/*.h ${D}/usr/include/
- #install -m 0644 ${S}/libmedia/player/*.h ${D}/usr/include/
-#xf.li@20230920 modify for esdk start -tmp
+ install -m 0644 ${S}/libmedia/*.h ${D}/usr/include/
+ install -m 0644 ${S}/libmedia/player/*.h ${D}/usr/include/
+
#install elfs
install -d ${ELFS-PATH}/
install -m 0755 ${S}/libmedia/libmedia.so ${ELFS-PATH}/
diff --git a/cap/zx297520v3/sources/meta-zxic/recipes-app/libtelsvr/libtelsvr.bb b/cap/zx297520v3/sources/meta-zxic/recipes-app/libtelsvr/libtelsvr.bb
index 2767d5b..ce9d32c 100755
--- a/cap/zx297520v3/sources/meta-zxic/recipes-app/libtelsvr/libtelsvr.bb
+++ b/cap/zx297520v3/sources/meta-zxic/recipes-app/libtelsvr/libtelsvr.bb
@@ -29,11 +29,9 @@
#install -m 0755 ${S}/libtelsvr/libtelsvr.so ${D}${libdir}/
install -m 0755 ${S}/libtelsvr/lib/libtelsvr.a ${D}${libdir}/
-#xf.li@20230920 modify for esdk start -tmp
- #install -m 0644 ${S}/libtelsvr/include/*.h ${D}/usr/include/
- #install -m 0644 ${S}/libtelsvr/include/pal/os/*.h ${D}/usr/include/
- #install -m 0644 ${S}/libtelsvr/include/pal/dm/*.h ${D}/usr/include/
-#xf.li@20230920 modify for esdk end -tmp
+ install -m 0644 ${S}/libtelsvr/include/*.h ${D}/usr/include/
+ install -m 0644 ${S}/libtelsvr/include/pal/os/*.h ${D}/usr/include/
+ install -m 0644 ${S}/libtelsvr/include/pal/dm/*.h ${D}/usr/include/
#install elfs
install -d ${ELFS-PATH}/
diff --git a/cap/zx297520v3/src/lynq/framework/lynq-atcid/lynq_atsvc_plugin.xml b/cap/zx297520v3/src/lynq/framework/lynq-atcid/lynq_atsvc_plugin.xml
index 3cdb250..b6fb1a4 100755
--- a/cap/zx297520v3/src/lynq/framework/lynq-atcid/lynq_atsvc_plugin.xml
+++ b/cap/zx297520v3/src/lynq/framework/lynq-atcid/lynq_atsvc_plugin.xml
@@ -1,18 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<lynq_atsvc_plugin >
- <module name="/lib64/liblynq-test-data.so"
+ <module name="/lib/liblynq-test-data.so"
register="lynq_register_test_data"
cmd="AT+LETEST;AT+LEABC;AT+LEDEF"
/>
- <module name="/lib64/liblynq-gnss.so"
+ <module name="/lib/liblynq-qser-gnss.so"
register="lynq_register_gnss"
cmd="AT+CGPS;AT+CGPSNMEA"
/>
- <module name="/lib64/liblynq-at-common.so"
+ <module name="/lib/liblynq-at-common.so"
register="lynq_register_at_common"
cmd="AT+MNETCALL;AT+GTARNDIS;AT+CGIR;AT+LGMDS;AT+LRNDISHANDLE"
/>
- <module name="/lib64/liblynq-at-factory.so"
+ <module name="/lib/liblynq-at-factory.so"
register="lynq_register_at_factory"
cmd="AT+LYNQFACTORY"
/>
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..5133ad0
--- /dev/null
+++ b/cap/zx297520v3/src/lynq/lib/liblynq-at-factory/gpio_T106.conf
@@ -0,0 +1,4 @@
+platform:T106
+total:49
+gpio:16,17,18,20,25,26,27,28,29,30,31,32,35,36,37,38,39,40,41,42,45,46,48,52,53,54,64,72,73,74,75,76,77,84,87,88,89,90,91,92,119,120,121,122,123,124,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..ac73582
--- /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},
+ {"rmii",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-gpio/LICENSE b/cap/zx297520v3/src/lynq/lib/liblynq-gpio/LICENSE
new file mode 100644
index 0000000..cb88533
--- /dev/null
+++ b/cap/zx297520v3/src/lynq/lib/liblynq-gpio/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/src/lynq/lib/liblynq-gpio/include/lynq-gpio.h b/cap/zx297520v3/src/lynq/lib/liblynq-gpio/include/lynq-gpio.h
new file mode 100644
index 0000000..156d9a8
--- /dev/null
+++ b/cap/zx297520v3/src/lynq/lib/liblynq-gpio/include/lynq-gpio.h
@@ -0,0 +1,30 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sc_bsp.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define MAX_GPIO_NUM (200)
+static void *test_gpio_handle[MAX_GPIO_NUM]={NULL};
+
+int lynq_gpio_init(int gpio, int direction, int value, int pullsel);
+
+int lynq_gpio_deinit(int gpio);
+
+int lynq_gpio_direction_set(int gpio, int direction);
+
+int lynq_gpio_value_set(int gpio, int value);
+
+int lynq_gpio_value_get(int gpio);
+
+int lynq_gpio_pullsel_set(int gpio, int pullsel);
+
+int lynq_gpio_pullsel_get(int gpio);
+
+
+#ifdef __cplusplus
+}
+#endif
diff --git a/cap/zx297520v3/src/lynq/lib/liblynq-gpio/lynq-gpio.cpp b/cap/zx297520v3/src/lynq/lib/liblynq-gpio/lynq-gpio.cpp
new file mode 100755
index 0000000..cf6958f
--- /dev/null
+++ b/cap/zx297520v3/src/lynq/lib/liblynq-gpio/lynq-gpio.cpp
@@ -0,0 +1,230 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sc_bsp.h>
+#include <errno.h>
+#include "lynq-gpio.h"
+#include "liblog/lynq_deflog.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define USER_LOG_TAG "LYNQ_GPIO"
+
+/*****************************************
+* @brief:lynq_gpio_init
+* @param count [IN]:4
+* @param sum [OUT]:NA
+* @return :success 0, failed -1
+* @todo:NA
+* @see:NA
+* @warning:NA
+******************************************/
+
+int lynq_gpio_init(int gpio, int direction, int value, int pullsel)
+{
+ LYLOGSET(LOG_INFO);
+ LYLOGEINIT(USER_LOG_TAG);
+
+ test_gpio_handle[gpio] = sc_gpio_init(gpio, direction, value, pullsel);
+ if (!test_gpio_handle[gpio])
+ {
+ LYINFLOG("do_gpio_init failed, err:%d", errno);
+ return -1;
+ }
+ return 0;
+}
+
+/*****************************************
+* @brief:lynq_gpio_deinit
+* @param count [IN]:1
+* @param sum [OUT]:NA
+* @return :success 0, failed -1
+* @todo:NA
+* @see:NA
+* @warning:NA
+******************************************/
+
+
+int lynq_gpio_deinit(int gpio)
+{
+ int ret;
+ LYLOGSET(LOG_INFO);
+ LYLOGEINIT(USER_LOG_TAG);
+
+ ret = sc_gpio_uninit(test_gpio_handle[gpio]);
+ if (ret)
+ {
+ LYINFLOG("do_gpio_uninit failed, err:%d", ret);
+ return -1;
+ }
+ return 0;
+}
+
+/*****************************************
+* @brief:lynq_gpio_direction_set
+* @param count [IN]:2
+* @param sum [OUT]:NA
+* @return :success 0, failed -1
+* @todo:NA
+* @see:NA
+* @warning:NA
+******************************************/
+
+int lynq_gpio_direction_set(int gpio, int direction)
+{
+ int ret;
+ LYLOGSET(LOG_INFO);
+ LYLOGEINIT(USER_LOG_TAG);
+ if(direction != 0 && direction != 1)
+ {
+ LYINFLOG("input direction is error\n");
+ return -1;
+ }
+ ret = sc_gpio_direction_set(test_gpio_handle[gpio], direction, 0);
+ if (ret)
+ {
+ LYINFLOG("do_gpio_input set direction failed, err:%d\n", ret);
+ return -1;;
+ }
+ return 0;
+}
+
+/*****************************************
+* @brief:lynq_gpio_value_set
+* @param count [IN]:2
+* @param sum [OUT]:NA
+* @return :success 0, failed -1
+* @todo:NA
+* @see:NA
+* @warning:NA
+******************************************/
+
+int lynq_gpio_value_set(int gpio, int value)
+{
+ int ret;
+ LYLOGSET(LOG_INFO);
+ LYLOGEINIT(USER_LOG_TAG);
+ if(value != 0 && value != 1)
+ {
+ LYINFLOG("input value is error\n");
+ return -1;
+ }
+ ret = sc_gpio_direction_set(test_gpio_handle[gpio], 1, 0);
+ if (ret)
+ {
+ LYINFLOG("do_gpio_input set direction failed, err:%d\n", ret);
+ return -1;;
+ }
+ ret = sc_gpio_value_set(test_gpio_handle[gpio], value);
+ if (ret)
+ {
+ LYINFLOG("do_gpio_output set value failed, err:%d\n", ret);
+ return -1;
+ }
+ else
+ {
+ LYINFLOG("gpio%d set value:%d\n", gpio, value);
+ }
+ return 0;
+}
+
+/*****************************************
+* @brief:lynq_gpio_value_set
+* @param count [IN]:1
+* @param sum [OUT]:NA
+* @return :success 0, failed -1
+* @todo:NA
+* @see:NA
+* @warning:NA
+******************************************/
+
+
+int lynq_gpio_value_get(int gpio)
+{
+ int ret;
+ int value;
+ LYLOGSET(LOG_INFO);
+ LYLOGEINIT(USER_LOG_TAG);
+ ret = sc_gpio_value_get(test_gpio_handle[gpio], &value);
+ if (ret)
+ {
+ LYINFLOG("do_gpio_input get value failed, err:%d\n", ret);
+ return -1;
+ }
+ else
+ {
+ LYINFLOG("gpio%d value:%d\n", gpio, value);
+ }
+ return value;
+}
+
+/*****************************************
+* @brief:lynq_gpio_pullsel_set
+* @param count [IN]:2
+* @param sum [OUT]:NA
+* @return :success 0, failed -1
+* @todo:NA
+* @see:NA
+* @warning:NA
+******************************************/
+
+
+int lynq_gpio_pullsel_set(int gpio, int pullsel)
+{
+ int ret;
+ LYLOGSET(LOG_INFO);
+ LYLOGEINIT(USER_LOG_TAG);
+ ret = sc_gpio_pullsel_set(test_gpio_handle[gpio], pullsel);
+ if (ret)
+ {
+ LYINFLOG("do_gpio_input get pull failed, err:%d\n", ret);
+ return -1;
+ }
+ else
+ {
+ LYINFLOG("gpio%d pull:%d\n", gpio, pullsel);
+ }
+ return 0;
+}
+
+/*****************************************
+* @brief:lynq_gpio_pullsel_get
+* @param count [IN]:1
+* @param sum [OUT]:NA
+* @return :success >=0, failed -1
+* @todo:NA
+* @see:NA
+* @warning:NA
+******************************************/
+
+
+int lynq_gpio_pullsel_get(int gpio)
+{
+ int ret;
+ int pullsel;
+ LYLOGSET(LOG_INFO);
+ LYLOGEINIT(USER_LOG_TAG);
+ ret = sc_gpio_pullsel_get(test_gpio_handle[gpio], &pullsel);
+ if (ret)
+ {
+ LYINFLOG("do_gpio_input get pull failed, err:%d\n", ret);
+ return -1;
+ }
+ else
+ {
+ LYINFLOG("gpio%d pull:%d\n", gpio, pullsel);
+ }
+ return pullsel;
+}
+
+
+DEFINE_LYNQ_LIB_LOG(LYNQ_GPIO)
+
+#ifdef __cplusplus
+}
+#endif
+
+
+
diff --git a/cap/zx297520v3/src/lynq/lib/liblynq-gpio/makefile b/cap/zx297520v3/src/lynq/lib/liblynq-gpio/makefile
new file mode 100644
index 0000000..3211402
--- /dev/null
+++ b/cap/zx297520v3/src/lynq/lib/liblynq-gpio/makefile
@@ -0,0 +1,67 @@
+SHELL = /bin/sh
+RM = rm -f
+
+LOCAL_CFLAGS := -Wall \
+ -std=gnu++14 \
+ -g -Os \
+ -flto \
+ -fPIC \
+ -fpermissive \
+
+
+
+$(warning ################# lynq qser autosuspend API ROOT: $(ROOT),includedir:$(includedir))
+LOCAL_PATH = .
+
+LOCAL_C_INCLUDES = \
+ -I. \
+ -I$(LOCAL_PATH)/include/ \
+ -I$(LOCAL_PATH)/ \
+ -I$(ROOT)$(includedir)/logger \
+ -I$(ROOT)$(includedir)/liblog \
+
+
+
+
+LOCAL_LIBS := \
+ -L. \
+ -lstdc++ \
+ -lcutils \
+ -lutils \
+ -lpthread \
+ -llynq-log \
+ -lbsp \
+
+
+SOURCES = $(wildcard *.cpp)
+
+EXECUTABLE = liblynq-gpio.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-irq/LICENSE b/cap/zx297520v3/src/lynq/lib/liblynq-irq/LICENSE
new file mode 100755
index 0000000..88a1e9c
--- /dev/null
+++ b/cap/zx297520v3/src/lynq/lib/liblynq-irq/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/src/lynq/lib/liblynq-irq/include/lynq-irq.h b/cap/zx297520v3/src/lynq/lib/liblynq-irq/include/lynq-irq.h
new file mode 100755
index 0000000..298e75a
--- /dev/null
+++ b/cap/zx297520v3/src/lynq/lib/liblynq-irq/include/lynq-irq.h
@@ -0,0 +1,24 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef void (*irq_handler)(void);
+
+int lynq_irq_install(int line, irq_handler irq_handler, int trig_type);
+
+int lynq_irq_uninstall(int line);
+
+int lynq_irq_set_type(int line, int trig_type);
+
+int lynq_irq_set_wake(int line, int en);
+
+int lynq_irq_get_wake(int line);
+
+
+#ifdef __cplusplus
+}
+#endif
diff --git a/cap/zx297520v3/src/lynq/lib/liblynq-irq/lynq-irq.cpp b/cap/zx297520v3/src/lynq/lib/liblynq-irq/lynq-irq.cpp
new file mode 100755
index 0000000..566961e
--- /dev/null
+++ b/cap/zx297520v3/src/lynq/lib/liblynq-irq/lynq-irq.cpp
@@ -0,0 +1,149 @@
+#include <ctype.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <pthread.h>
+#include <sc_irq.h>
+
+#include "lynq-irq.h"
+#include "liblog/lynq_deflog.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define USER_LOG_TAG "LYNQ_IRQ"
+
+/*****************************************
+* @brief:lynq_irq_install
+* @param count [IN]:2
+* @param sum [OUT]:NA
+* @return :success 0, failed other
+* @todo:NA
+* @see:NA
+* @warning:NA
+******************************************/
+
+int lynq_irq_install(int line, irq_handler irq_test_handler, int trig_type)
+{
+ int ret;
+ LYLOGSET(LOG_INFO);
+ LYLOGEINIT(USER_LOG_TAG);
+ ret = sc_irq_install(line, irq_test_handler, trig_type);
+ if (ret != 0)
+ {
+ LYINFLOG("do_install_irq failed, ret:%d\n", ret);
+ return ret;
+ }
+ return 0;
+}
+
+
+/*****************************************
+* @brief:lynq_irq_uninstall
+* @param count [IN]:2
+* @param sum [OUT]:NA
+* @return :success 0, failed other
+* @todo:NA
+* @see:NA
+* @warning:NA
+******************************************/
+
+int lynq_irq_uninstall(int line)
+{
+ int ret;
+ LYLOGSET(LOG_INFO);
+ LYLOGEINIT(USER_LOG_TAG);
+ ret = sc_irq_uninstall(line);
+ if (ret != 0)
+ {
+ LYINFLOG("unistall failed, ret:%d\n", ret);
+ return ret;
+ }
+ LYINFLOG("uninstall irq(%d) ok\n", line);
+ return 0;
+}
+
+
+/*****************************************
+* @brief:lynq_irq_set_type
+* @param count [IN]:2
+* @param sum [OUT]:NA
+* @return :success 0, failed other
+* @todo:NA
+* @see:NA
+* @warning:NA
+******************************************/
+int lynq_irq_set_type(int line, int trig_type)
+{
+ int ret;
+ LYLOGSET(LOG_INFO);
+ LYLOGEINIT(USER_LOG_TAG);
+ ret = sc_irq_set_type(line, trig_type);
+ if (ret < 0)
+ {
+ LYINFLOG("set_type failed, ret:%d\n", ret);
+ return ret;
+ }
+ return 0;
+
+}
+
+
+/*****************************************
+* @brief:lynq_irq_set_wake
+* @param count [IN]:2
+* @param sum [OUT]:NA
+* @return :success >0, failed <0
+* @todo:NA
+* @see:NA
+* @warning:NA
+******************************************/
+int lynq_irq_set_wake(int line, int en)
+{
+ int ret;
+ LYLOGSET(LOG_INFO);
+ LYLOGEINIT(USER_LOG_TAG);
+ ret = sc_irq_set_wake(line, en);
+ if (ret < 0)
+ {
+ LYINFLOG("set_wake failed, ret:%d\n", ret);
+ return ret;
+ }
+ return 0;
+}
+
+/*****************************************
+* @brief:lynq_irq_get_wake
+* @param count [IN]:1
+* @param sum [OUT]:NA
+* @return :success >= 0, failed other
+* @todo:NA
+* @see:NA
+* @warning:NA
+******************************************/
+int lynq_irq_get_wake(int line)
+{
+ int ret;
+ int en;
+ LYLOGSET(LOG_INFO);
+ LYLOGEINIT(USER_LOG_TAG);
+ ret = sc_irq_get_wake(line, &en);
+ if (ret != 0)
+ {
+ LYINFLOG("get_wake failed, ret:%d\n", ret);
+ return ret;
+ }
+ LYINFLOG("get_wake readback(%d)\n", en);
+ return en;
+}
+
+
+DEFINE_LYNQ_LIB_LOG(LYNQ_IRQ)
+
+#ifdef __cplusplus
+}
+#endif
+
+
+
diff --git a/cap/zx297520v3/src/lynq/lib/liblynq-irq/makefile b/cap/zx297520v3/src/lynq/lib/liblynq-irq/makefile
new file mode 100755
index 0000000..eec849b
--- /dev/null
+++ b/cap/zx297520v3/src/lynq/lib/liblynq-irq/makefile
@@ -0,0 +1,67 @@
+SHELL = /bin/sh
+RM = rm -f
+
+LOCAL_CFLAGS := -Wall \
+ -std=gnu++14 \
+ -g -Os \
+ -flto \
+ -fPIC \
+ -fpermissive \
+
+
+
+$(warning ################# lynq qser autosuspend API ROOT: $(ROOT),includedir:$(includedir))
+LOCAL_PATH = .
+
+LOCAL_C_INCLUDES = \
+ -I. \
+ -I$(LOCAL_PATH)/include/ \
+ -I$(LOCAL_PATH)/ \
+ -I$(ROOT)$(includedir)/logger \
+ -I$(ROOT)$(includedir)/liblog \
+
+
+
+
+LOCAL_LIBS := \
+ -L. \
+ -lstdc++ \
+ -lcutils \
+ -lutils \
+ -pthread \
+ -llynq-log \
+ -lbsp \
+
+
+SOURCES = $(wildcard *.cpp)
+
+EXECUTABLE = liblynq-irq.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/src/lynq/lib/liblynq-qser-gnss/include/lynq_qser_gnss.h b/cap/zx297520v3/src/lynq/lib/liblynq-qser-gnss/include/lynq_qser_gnss.h
index d761104..6c6c051 100755
--- a/cap/zx297520v3/src/lynq/lib/liblynq-qser-gnss/include/lynq_qser_gnss.h
+++ b/cap/zx297520v3/src/lynq/lib/liblynq-qser-gnss/include/lynq_qser_gnss.h
@@ -102,6 +102,10 @@
DELETE_ALL = 5, /**< Delete all location data. */
}DELETE_AIDING_DATA_TYPE_T;
+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_gnss(lynq_atsvc_outcb out_cb);
+
int qser_Gnss_Init(uint32_t *h_gnss);
int qser_Gnss_Deinit(uint32_t h_gnss);
int qser_AddRxIndMsgHandler(gnss_handler_func_t handler_ptr,uint32_t h_gnss);
diff --git a/cap/zx297520v3/src/lynq/lib/liblynq-qser-gnss/makefile b/cap/zx297520v3/src/lynq/lib/liblynq-qser-gnss/makefile
index bdd8518..b18390b 100755
--- a/cap/zx297520v3/src/lynq/lib/liblynq-qser-gnss/makefile
+++ b/cap/zx297520v3/src/lynq/lib/liblynq-qser-gnss/makefile
@@ -26,6 +26,7 @@
LOCAL_LIBS := \
-L. \
-lstdc++ \
+ -llog \
-lcutils \
-lutils \
-lpthread \
diff --git a/cap/zx297520v3/src/lynq/lib/liblynq-qser-gnss/src/lynq_qser_gnss.cpp b/cap/zx297520v3/src/lynq/lib/liblynq-qser-gnss/src/lynq_qser_gnss.cpp
index 66046b7..65414ed 100755
--- a/cap/zx297520v3/src/lynq/lib/liblynq-qser-gnss/src/lynq_qser_gnss.cpp
+++ b/cap/zx297520v3/src/lynq/lib/liblynq-qser-gnss/src/lynq_qser_gnss.cpp
@@ -29,9 +29,12 @@
#include <sys/ioctl.h>
#include <dlfcn.h>
#include <stdint.h>
+#include <linux/rpmsg/rpmsg_zx29.h>
+#include <liblog/lynq_deflog.h>
#include "mbtk_gnss_internal.h"
#include "ringbuffer.h"
#include "lynq_qser_gnss.h"
+DEFINE_LYNQ_LIB_LOG(LYNQ_QSER_GNSS)
#ifdef __cplusplus
extern "C" {
#endif
@@ -104,9 +107,7 @@
struct timeb tmNOW;
struct tm *ptm = {0};
ptm = gmtime(&tNOW);
- printf("gmtime\n");
ftime(&tmNOW);
- printf("fuzhi start\n");
time_info->year = (ptm->tm_year+1900);
time_info->month = (ptm->tm_mon+1);
time_info->day = ptm->tm_mday;
@@ -114,7 +115,6 @@
time_info->minute = ptm->tm_min;
time_info->second = ptm->tm_sec;
time_info->millisecond = tmNOW.millitm;
- printf("fuzhi complate\n");
char send_buf[128] = {0};
printf("%d\n,%d\n,%d\n,%d\n,%d\n,%d\n,%d\r\n",time_info->year,time_info->month,time_info->day,\
time_info->hour,time_info->minute,time_info->second,time_info->millisecond);
@@ -126,7 +126,7 @@
printf("send fail\n");
return -1;
}
-
+ lynq_gnss_get_aidinfo(h_gnss);
return 0;
}
@@ -222,6 +222,335 @@
return 0;
}
+void atsvc_incb_entity(char *input,int length);
+int lynq_at_cgps(int at_type,int gnss_state_type);
+int lynq_at_cgpsnmea(int at_type,int gnss_state_type);
+lynq_atsvc_outcb atsvc_gnss_outcb;
+int at_gps_status = 0;
+int at_gpsnmea_status = 0;
+int pthread_state = 1;
+int tty_fd = -1;
+int device_fd = -1;
+
+int strUpper(char * str)
+{
+ int i=0;
+ while(1)
+ {
+ if(str[i]=='\0')
+ {
+ break;
+ }
+ if(str[i]>='a'&&str[i]<='z')
+ {
+ str[i]=str[i]-32;
+ }
+ i++;
+ }
+ return 0;
+}
+
+static int channel_config(int device_fd)
+{
+ if(ioctl(device_fd, RPMSG_CREATE_CHANNEL, 512) < 0)
+ {
+ ALOGE("CREATE_CHANNEL Failed\n");
+ }
+ // 发送消息时,触发中断
+ if(ioctl(device_fd, RPMSG_SET_INT_FLAG, NULL) < 0)
+ {
+ ALOGE("SET_INT_FLAG Failed\n");
+ return -1;
+ }
+ // 阻塞的方式读;
+ if(ioctl(device_fd, RPMSG_CLEAR_POLL_FLAG, NULL) < 0)
+ {
+ ALOGE("CLEAR_POLL_FLAG Failed\n");
+ return -1;
+ }
+ return 0;
+}
+
+int gps_channel_init()
+{
+ int ret = 0;
+ tty_fd = open("/dev/ttyS2", O_RDWR);
+ ALOGD("tty_fd:%d\n",tty_fd);
+ if (tty_fd == -1)
+ {
+ ALOGE("Failed to open serial port\n");
+ return -1;
+ }
+ device_fd = open("/dev/armps_rpmsgch30", O_RDWR);//30 is AT-channel;31 is modem-channel
+ ALOGD("device_fd:%d\n",device_fd);
+ if (device_fd == -1)
+ {
+ ALOGE("Failed to open device file\n");
+ close(tty_fd);
+ return -1;
+ }
+ ret = channel_config(device_fd);
+ if(ret < 0)
+ {
+ close(tty_fd);
+ close(device_fd);
+ return -1;
+ }
+ return 0;
+}
+
+void read_gps_data()
+{
+ char gnss_buf[256];
+ while (at_gpsnmea_status)
+ {
+ bzero(gnss_buf,256);
+ ssize_t gnss_lenth = read(tty_fd, gnss_buf, sizeof(gnss_buf));
+ if (gnss_lenth > 0)
+ {
+ write(device_fd, gnss_buf, gnss_lenth);
+ }
+ }
+ pthread_state = 0;
+ return;
+}
+
+int gnss_at_cmd_parse(char *cmd,char *parse_cmd,int* gnss_state_type,int* at_type)
+{
+ if (NULL == cmd || NULL == parse_cmd || NULL == at_type)
+ {
+ return -1;
+ }
+ int ret = 0;
+ int at_type_jug = 0;
+ int cmd_size;
+ char cmd_buf[32] = {0};
+ char buffer1[32] = {0};
+ char buffer2[32] = {0};
+ bzero(cmd_buf,32);
+ bzero(buffer1,32);
+ bzero(buffer2,32);
+ cmd_size = strlen(cmd);
+ strncpy(cmd_buf,cmd,cmd_size);
+ strUpper(cmd_buf);
+ ret = sscanf(cmd_buf, "%[^=]=%[^=]", buffer1,buffer2);
+ if (ret == 1)
+ {
+ *at_type = 1;
+ sscanf(buffer1, "%[^?]", buffer2);
+ strcpy(parse_cmd,buffer2);
+ return 0;
+ }
+ else if (ret == 2)
+ {
+ at_type_jug = strcmp(buffer2,"?");
+ ALOGD("at_type_jug :%d\n",at_type_jug);
+ if (at_type_jug == 0)
+ {
+ *at_type = 0;
+ strcpy(parse_cmd,buffer1);
+ return 0;
+ }
+ else
+ {
+ *at_type = 2;
+ ALOGD("Buffertest1:buffer1 :%s buffer2 :%s\n",buffer1,buffer2);
+ strcpy(parse_cmd,buffer1);
+ *gnss_state_type = atoi(buffer2);
+ ALOGD("buffer1 :%s buffer2 :%d\n",parse_cmd,*gnss_state_type);
+ return 0;
+ }
+ }
+ else
+ {
+ ALOGE("unknown paramters");
+ return -1;
+ }
+}
+
+int lynq_at_cgps(int at_type,int gnss_state_type)
+{
+ int ret = 0;
+ char cgps_at_res[64]={};
+ if (at_type == 0)
+ {
+ strncpy(cgps_at_res,"+CGPS:(0,1)\r\n",64);
+ atsvc_gnss_outcb(cgps_at_res,strlen(cgps_at_res),0);
+ return 0;
+ }
+
+ else if(at_type == 1)
+ {
+ bzero(cgps_at_res,64);
+ sprintf(cgps_at_res,"+CGPS:<%d>",at_gps_status);
+ atsvc_gnss_outcb(cgps_at_res,strlen(cgps_at_res),0);
+ return 0;
+ }
+
+ else if(at_type == 2)
+ {
+ if (at_gps_status != gnss_state_type)
+ {
+ at_gps_status = gnss_state_type;
+ }
+ else
+ {
+ strncpy(cgps_at_res,"+CGPS: same status\r\n",64);
+ atsvc_gnss_outcb(cgps_at_res,strlen(cgps_at_res),0);
+ return -1;
+ }
+ if (at_gps_status == 0)
+ {
+ lynq_open_gps(0);
+ close(device_fd);
+ close(tty_fd);
+ }
+ else if(at_gps_status == 1)
+ {
+ ret = gps_channel_init();
+ if(ret < 0)
+ {
+ return -1;
+ }
+ lynq_open_gps(1);
+ ret = set_baudrate(tty_fd, B9600);
+ if(-1 == ret)
+ {
+ return -1;
+ }
+ }
+ else
+ {
+ ALOGE("unknown at paramters");
+ return -1;
+ }
+ return 0;
+ }
+}
+
+int lynq_at_cgpsnmea(int at_type,int gnss_state_type)
+{
+ int ret = 0;
+ char cgpsnmea_at_res[64]={};
+ if (at_type == 0)
+ {
+ strncpy(cgpsnmea_at_res,"+CGPSNMEA:(0,1)\r\n",64);
+ atsvc_gnss_outcb(cgpsnmea_at_res,strlen(cgpsnmea_at_res),0);
+ return 0;
+ }
+ else if(at_type == 1)
+ {
+ bzero(cgpsnmea_at_res,64);
+ sprintf(cgpsnmea_at_res,"+CGPSNMEA:<%d>",at_gpsnmea_status);
+ atsvc_gnss_outcb(cgpsnmea_at_res,strlen(cgpsnmea_at_res),0);
+ return 0;
+ }
+ else if(at_type == 2)
+ {
+ pthread_t thread;
+ if (at_gpsnmea_status != gnss_state_type)
+ {
+ at_gpsnmea_status = gnss_state_type;
+ }
+ else
+ {
+ strncpy(cgpsnmea_at_res,"+CGPSNMEA: same status\r\n",64);
+ atsvc_gnss_outcb(cgpsnmea_at_res,strlen(cgpsnmea_at_res),0);
+ return -1;
+ }
+
+ if (at_gpsnmea_status == 0)
+ {
+ ALOGD("gpsnmea_status = %d\n",at_gpsnmea_status);
+ for(int i = 0;i < 20;i++)
+ {
+ if(pthread_state == 0)
+ {
+ ALOGD("pthread down\n");
+ sleep(1);
+ break;
+ }
+ }
+ }
+ else if(at_gpsnmea_status == 1)
+ {
+ ALOGD("gpsnmea_status = %d\n",at_gpsnmea_status);
+ pthread_create(&thread, NULL, read_gps_data, NULL);
+ }
+
+ else
+ {
+ ALOGE("unknown at paramters");
+ return -1;
+ }
+ return 0;
+ }
+
+}
+
+void atsvc_incb_entity(char *input,int length)
+{
+ int res = 0;
+ int income_at_type = 0;
+ int gnss_state_type = -1;
+ char at_cmd[128]={0};
+ char gnss_at_cmd[64] = {0};
+ char parse_atcmd[128] = {0};
+ if(NULL == input)
+ {
+ strncpy(gnss_at_cmd,"+CME ERROR: 100\r\n",64);
+ atsvc_gnss_outcb(gnss_at_cmd,strlen(gnss_at_cmd),0);
+ return;
+ }
+ bzero(at_cmd,128);
+ strncpy(at_cmd,input,strlen(input));
+ res = gnss_at_cmd_parse(at_cmd,parse_atcmd,&gnss_state_type,&income_at_type);
+ if (res != 0)
+ {
+ ALOGE("parse at cmd error");
+ strncpy(gnss_at_cmd,"+CME ERROR: 100\r\n",64);
+ atsvc_gnss_outcb(gnss_at_cmd,strlen(gnss_at_cmd),0);
+ return;
+ }
+
+ if (!strcmp(parse_atcmd, "AT+CGPS"))
+ {
+ res = lynq_at_cgps(income_at_type,gnss_state_type);
+ if (res != 0)
+ {
+ strncpy(gnss_at_cmd,"+CME ERROR: 100\r\n",64);
+ atsvc_gnss_outcb(gnss_at_cmd,strlen(gnss_at_cmd),0);
+ return;
+ }
+ }
+ else if (!strcmp(parse_atcmd, "AT+CGPSNMEA"))
+ {
+ res = lynq_at_cgpsnmea(income_at_type,gnss_state_type);
+ if (res != 0)
+ {
+ strncpy(gnss_at_cmd,"+CME ERROR: 100\r\n",64);
+ atsvc_gnss_outcb(gnss_at_cmd,strlen(gnss_at_cmd),0);
+ return;
+ }
+ }
+ strncpy(gnss_at_cmd,"ok\r\n",64);
+ atsvc_gnss_outcb(gnss_at_cmd,strlen(gnss_at_cmd),0);
+ return;
+}
+
+lynq_atsvc_incb lynq_register_gnss(lynq_atsvc_outcb out_cb)
+{
+ char reg_return[50] = {0};
+ if(NULL == out_cb)
+ {
+ ALOGE("out cb is null");
+ return NULL;
+ }
+ atsvc_gnss_outcb = out_cb;
+ ALOGE("gnss register success\r\n");
+ return atsvc_incb_entity;
+}
+
#ifdef __cplusplus
}
#endif
diff --git a/cap/zx297520v3/src/lynq/lib/liblynq-qser-sms/lynq_qser_sms.cpp b/cap/zx297520v3/src/lynq/lib/liblynq-qser-sms/lynq_qser_sms.cpp
index 7160e8c..9f78e04 100755
--- a/cap/zx297520v3/src/lynq/lib/liblynq-qser-sms/lynq_qser_sms.cpp
+++ b/cap/zx297520v3/src/lynq/lib/liblynq-qser-sms/lynq_qser_sms.cpp
@@ -104,7 +104,7 @@
LYERRLOG("not init\n");
return SMS_PARAM_ERR;
}
- return lynq_send_sms(pt_sms_info->src_addr, pt_sms_info->type, pt_sms_info->sms_data, pt_sms_info->sms_data_len);
+ return lynq_send_sms(pt_sms_info->src_addr, pt_sms_info->format, pt_sms_info->sms_data, pt_sms_info->sms_data_len);
}
int qser_sms_addrxmsghandler(QSER_SMS_RxMsgHandlerFunc_t handlerPtr, void* contextPtr)
@@ -113,10 +113,10 @@
{
return SMS_PARAM_ERR;
}
- if(NULL == contextPtr)
- {
- return SMS_PARAM_ERR;
- }
+ // if(NULL == contextPtr)
+ // {
+ // return SMS_PARAM_ERR;
+ // }
tmp = handlerPtr;
pthread_t lynq_new_sms_tid = -1;
int rt = pthread_create(&lynq_new_sms_tid, NULL, new_sms_thread_recv, NULL);
diff --git a/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/platform/at_ctl/src/atctrl/at_context.c b/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/platform/at_ctl/src/atctrl/at_context.c
index b03a455..43b3d40 100755
--- a/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/platform/at_ctl/src/atctrl/at_context.c
+++ b/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/platform/at_ctl/src/atctrl/at_context.c
@@ -299,7 +299,7 @@
}
}
if((strstr(port_name,"/dev/ttyGS1") == NULL) && (strstr(cap_port_name, "/dev/ttyGS1") != NULL)){
- g_farps_fd2 = at_open("/dev/armps_rpmsgch31",O_RDWR);
+ /*g_farps_fd2 = at_open("/dev/armps_rpmsgch31",O_RDWR);
at_print(AT_ERR,"init open armps_rpmsgch31 => fd: %d er_no: %d\n", g_farps_fd2, errno);
if(g_farps_fd2 >= 0){
channel_config(g_farps_fd2);
@@ -307,7 +307,7 @@
at_close(g_farps_fd2);
g_farps_fd2=-1;
}
- }
+ }*/
}
at_portmng_set_state_proc("/dev/ptmx",1,0);
#endif
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 ec28c2b..f536468 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.01"
-LYNQ_CAP_INSIDE_VERSION="CAP.08.01"
-LYNQ_CAP_VERSION="CAP.08.01"
+LYNQ_AP_VERSION="T106CN-ZS03.V2.01.01.02P50U04.AP.08.06"
+LYNQ_CAP_INSIDE_VERSION="CAP.08.06"
+LYNQ_CAP_VERSION="CAP.08.06"
COMMIT_ID="$(git rev-parse HEAD)"
LYNQ_SW_INSIDE_VERSION="LYNQ_CONFIG_VERSION = \"${LYNQ_AP_VERSION}_${LYNQ_CAP_INSIDE_VERSION}\""