Merge "Revert " [Bugfix][T106BUG-18][T106BUG-11]fix reset sim bug""
diff --git a/allbins/tools/resign_tool/resign.bat b/allbins/tools/resign_tool/resign.bat
index ed00f9e..27d352c 100755
--- a/allbins/tools/resign_tool/resign.bat
+++ b/allbins/tools/resign_tool/resign.bat
@@ -43,6 +43,7 @@
) else (
SignImage -z -i "%WORK_DIR%\zloader.bin" -k %PRIVATE_KEY% -t %HASH_STR% || EXIT /B 1
)
+ SignImage -z -i "%WORK_DIR%\tloader.bin" -k %PRIVATE_KEY% -t %HASH_STR% || EXIT /B 1
)
echo "HASH_STR:" %HASH_STR%
SignImage -r -i "%WORK_DIR%\uboot.bin" -k %PRIVATE_KEY% -t %HASH_STR% || EXIT /B 1
diff --git a/allbins/tools/resign_tool/resign.sh b/allbins/tools/resign_tool/resign.sh
index 7423a21..37144f2 100755
--- a/allbins/tools/resign_tool/resign.sh
+++ b/allbins/tools/resign_tool/resign.sh
@@ -42,6 +42,7 @@
#old v3t device for mdl/mifi etc.
SignImage -z -i $WORK_DIR/zloader.bin -k $PRIVATE_KEY -t $HASH_STR
fi
+ SignImage -z -i $WORK_DIR/tloader.bin -k $PRIVATE_KEY -t $HASH_STR
fi
echo "HASH_STR:" $HASH_STR
SignImage -r -i $WORK_DIR/uboot.bin -k $PRIVATE_KEY -t $HASH_STR
diff --git a/allbins/zx297520v3/prj_vehicle/config_dc_4Gb/partition.bin b/allbins/zx297520v3/prj_vehicle/config_dc_4Gb/partition.bin
index 371de96..d44975d 100755
--- a/allbins/zx297520v3/prj_vehicle/config_dc_4Gb/partition.bin
+++ b/allbins/zx297520v3/prj_vehicle/config_dc_4Gb/partition.bin
Binary files differ
diff --git a/allbins/zx297520v3/prj_vehicle/config_dc_4Gb/partition.ini b/allbins/zx297520v3/prj_vehicle/config_dc_4Gb/partition.ini
index fa377c3..15e56a0 100755
--- a/allbins/zx297520v3/prj_vehicle/config_dc_4Gb/partition.ini
+++ b/allbins/zx297520v3/prj_vehicle/config_dc_4Gb/partition.ini
@@ -99,7 +99,7 @@
partition_name=oemdata
partition_type=nand
partition_addr=0x19900000
-partition_size=0x07C00000
+partition_size=0x06400000
[Partition16]
partition_name=ddr
diff --git a/cap/zx297520v3/sources/meta-zxic-custom/conf/distro/vehicle_dc.conf b/cap/zx297520v3/sources/meta-zxic-custom/conf/distro/vehicle_dc.conf
index 56c0ee4..15ba171 100755
--- a/cap/zx297520v3/sources/meta-zxic-custom/conf/distro/vehicle_dc.conf
+++ b/cap/zx297520v3/sources/meta-zxic-custom/conf/distro/vehicle_dc.conf
@@ -164,6 +164,7 @@
liblynq-qser-gnss \
liblynq-qser-fota \
liblynq-systime \
+ liblynq-led \
"
zxic_lib += "${@bb.utils.contains('CONFIG_TEL_API_SUPPORT', 'RIL', 'libril libreference-ril', 'libtelsvr', d)}"
@@ -227,8 +228,10 @@
msm-svr \
player-demo \
lynq-ril-service \
+ lynq-led-demo \
lynq-qser-sim-demo \
lynq-qser-sms-demo \
+ lynq-led-sev \
uci \
gdb \
mobiletek-tester-rdit \
@@ -297,7 +300,7 @@
RAT_CONFIG_C2K_SUPPORT = "no"
MTK_MULTI_SIM_SUPPORT = "dsds"
TARGET_PLATFORM = "T106"
-MTK_LED_SUPPORT = "no"
+MTK_LED_SUPPORT = "yes"
#support lynq_atsvc [hong.liu add for lynq atsvc on 2022.12.1]
LYNQ_ATSVC_SUPPORT = "yes"
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 44be59c..85278a4 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
@@ -196,6 +196,8 @@
liblynq-gpio \
liblynq-irq \
liblynq-at-common \
+ liblynq-led \
+ liblynq-adc \
"
zxic_lib += "${@bb.utils.contains('CONFIG_TEL_API_SUPPORT', 'RIL', 'libril', 'libtelsvr', d)}"
@@ -257,6 +259,8 @@
msm-svr \
player-demo \
lynq-ril-service \
+ lynq-led-demo \
+ lynq-led-sev \
uci \
gdb \
mobiletek-tester-rdit \
@@ -277,6 +281,7 @@
lynq-irq-demo \
lynq-gnss-update \
lynq-audio-demo \
+ lynq-adc-demo \
"
zxic_app_open += "${@bb.utils.contains('CONFIG_TEL_API_SUPPORT', 'RIL', 'rild', '', d)}"
@@ -339,7 +344,7 @@
RAT_CONFIG_C2K_SUPPORT = "no"
MTK_MULTI_SIM_SUPPORT = "dsds"
TARGET_PLATFORM = "T106"
-MTK_LED_SUPPORT = "no"
+MTK_LED_SUPPORT = "yes"
#support lynq_atsvc [hong.liu add for lynq atsvc on 2022.12.1]
LYNQ_ATSVC_SUPPORT = "yes"
diff --git a/cap/zx297520v3/sources/meta-zxic-custom/conf/lynq_base.conf b/cap/zx297520v3/sources/meta-zxic-custom/conf/lynq_base.conf
index 9cc2d8b..0e4d57d 100755
--- a/cap/zx297520v3/sources/meta-zxic-custom/conf/lynq_base.conf
+++ b/cap/zx297520v3/sources/meta-zxic-custom/conf/lynq_base.conf
@@ -3,7 +3,7 @@
RAT_CONFIG_C2K_SUPPORT = "no"
MTK_MULTI_SIM_SUPPORT = "dsds"
TARGET_PLATFORM = "T106"
-MTK_LED_SUPPORT = "no"
+MTK_LED_SUPPORT = "yes"
#support lynq_atsvc [hong.liu add for lynq atsvc on 2022.12.1]
LYNQ_ATSVC_SUPPORT = "yes"
diff --git a/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/liblynq-adc/liblynq-adc.bb b/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/liblynq-adc/liblynq-adc.bb
new file mode 100755
index 0000000..bd5e36d
--- /dev/null
+++ b/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/liblynq-adc/liblynq-adc.bb
@@ -0,0 +1,51 @@
+#inherit externalsrc package
+
+DESCRIPTION = "liblynq-adc"
+LICENSE = "CLOSED"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=4f60c98fa94e02f659ef5939f67fa8ae"
+
+DEPENDS += "liblynq-log libbsp"
+#inherit workonsrc
+WORKONSRC = "${TOPDIR}/../src/lynq/lib/liblynq-adc/"
+FILESEXTRAPATHS_prepend :="${TOPDIR}/../src/lynq/lib/:"
+SRC_URI = " \
+ file://liblynq-adc\
+ "
+
+SRC-DIR = "${S}/../liblynq-adc"
+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-led/liblynq-led.bb b/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/liblynq-led/liblynq-led.bb
new file mode 100755
index 0000000..fcbf6a6
--- /dev/null
+++ b/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/liblynq-led/liblynq-led.bb
@@ -0,0 +1,54 @@
+#inherit externalsrc package
+
+DESCRIPTION = "lynq led"
+LICENSE = "CLOSED"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=b1e07e8d88e26263e71d3a9e2aa9a2ff"
+DEPENDS += "libpal gstreamer1.0 glib-2.0 libapn liblynq-log libvendor-ril liblynq-shm libbinder liblynq-uci"
+#inherit workonsrc
+WORKONSRC = "${TOPDIR}/../src/lynq/lib/liblynq-led"
+FILESEXTRAPATHS_prepend :="${TOPDIR}/../src/lynq/lib/:"
+SRC_URI = " \
+ file://liblynq-led \
+ "
+
+SRC-DIR = "${S}/../liblynq-led"
+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()
+EXTRA_OEMAKE = "'RAT_CONFIG_C2K_SUPPORT = ${RAT_CONFIG_C2K_SUPPORT}'\
+ 'MTK_MULTI_SIM_SUPPORT = ${MTK_MULTI_SIM_SUPPORT}'\
+ 'TARGET_PLATFORM = ${TARGET_PLATFORM}'"
+
+FILES_${PN} = "${base_libdir}/*.so \
+ ${base_bindir}\
+ ${base_sbindir} \
+ /etc/dbus-1/system.d/"
+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 () {
+ if [ "${PACKAGE_ARCH}" = "cortexa7hf-vfp-vfpv4-neon" ]; then
+ oe_runmake all -C ${SRC-DIR} ROOT=${STAGING_DIR_HOST} OFLAGS="--sysroot=${STAGING_DIR_HOST} -Os -mfpu=neon-vfpv4 -mhard-float -Wl,--hash-style=gnu -DTELEPHONYWARE"
+ elif [ "${PACKAGE_ARCH}" = "cortexa7hf-neon-vfpv4" ]; then
+ oe_runmake all -C ${SRC-DIR} ROOT=${STAGING_DIR_HOST} OFLAGS="--sysroot=${STAGING_DIR_HOST} -Os -mfpu=neon-vfpv4 -mhard-float -Wl,--hash-style=gnu -DTELEPHONYWARE"
+ elif [ "${PACKAGE_ARCH}" = "cortexa53hf-neon-fp-armv8" ]; then
+ oe_runmake all -C ${SRC-DIR} ROOT=${STAGING_DIR_HOST} OFLAGS="--sysroot=${STAGING_DIR_HOST} -Os -mfpu=neon-vfpv4 -mhard-float -Wl,--hash-style=gnu -DTELEPHONYWARE -mhard-float -mfpu=neon-fp-armv8 -mfloat-abi=hard -mcpu=cortex-a53 -mtune=cortex-a53"
+ else
+ oe_runmake all -C ${SRC-DIR} ROOT=${STAGING_DIR_HOST} OFLAGS="--sysroot=${STAGING_DIR_HOST} -Os -Wl,--hash-style=gnu -DTELEPHONYWARE"
+ fi
+}
+
+do_install() {
+ oe_runmake install -C ${SRC-DIR} ROOT=${D}
+ if [ -d "${WORKONSRC}" ] ; then
+ install -d ${D}${includedir}
+ cp -af ${SRC-DIR}/include/libled/ ${D}${includedir}/libled
+ fi
+}
diff --git a/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/liblynq-qser-gnss/liblynq-qser-gnss.bb b/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/liblynq-qser-gnss/liblynq-qser-gnss.bb
index 686d86f..8dcdfb7 100755
--- a/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/liblynq-qser-gnss/liblynq-qser-gnss.bb
+++ b/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/liblynq-qser-gnss/liblynq-qser-gnss.bb
@@ -3,7 +3,7 @@
DESCRIPTION = "liblynq-qser-gnss"
LICENSE = "CLOSED"
LIC_FILES_CHKSUM = "file://LICENSE;md5=3f86c7f456a6d0bbeca155e65084eee1"
-DEPENDS += "liblynq-log libxml2 liblynq-uci libsctel"
+DEPENDS += "liblynq-log libxml2 liblynq-uci libsctel libbsp"
#inherit workonsrc
WORKONSRC = "${TOPDIR}/../src/lynq/lib/liblynq-qser-gnss/"
FILESEXTRAPATHS_prepend :="${TOPDIR}/../src/lynq/lib/:"
diff --git a/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-adc-demo/files/LICENSE b/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-adc-demo/files/LICENSE
new file mode 100755
index 0000000..cb88533
--- /dev/null
+++ b/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-adc-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-adc-demo/files/lynq-adc-demo.cpp b/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-adc-demo/files/lynq-adc-demo.cpp
new file mode 100755
index 0000000..7fca094
--- /dev/null
+++ b/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-adc-demo/files/lynq-adc-demo.cpp
@@ -0,0 +1,49 @@
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <include/lynq-adc.h>
+
+void handle_adc(const char* adc_name, int adc_type)
+{
+ if (adc_name == NULL)
+ {
+ printf("Error: adc_name is a null pointer\n");
+ return;
+ }
+ int adc_value = qser_adc_show(adc_type);
+ if (adc_value < 0)
+ {
+ printf("Error: Failed to get the value of %s\n", adc_name);
+ return;
+ }
+ printf("%s value: %d mV\n", adc_name, adc_value);
+}
+
+int main(int argc, char *argv[])
+{
+ if (argc != 2)
+ {
+ printf("Usage: %s <ADC0|ADC1|ADC2>\n", argv[0]);
+ return -1;
+ }
+
+ if (strcmp(argv[1], "ADC0") == 0)
+ {
+ handle_adc("ADC0", ADC0);
+ }
+ else if (strcmp(argv[1], "ADC1") == 0)
+ {
+ handle_adc("ADC1", ADC1);
+ }
+ else if (strcmp(argv[1], "ADC2") == 0)
+ {
+ handle_adc("ADC2", ADC2);
+ }
+ else
+ {
+ printf("Please enter valid parameters: ADC0|ADC1|ADC2\n");
+ return -1;
+ }
+
+ return 0;
+}
diff --git a/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-adc-demo/files/makefile b/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-adc-demo/files/makefile
new file mode 100755
index 0000000..8e2ac82
--- /dev/null
+++ b/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-adc-demo/files/makefile
@@ -0,0 +1,49 @@
+SHELL = /bin/sh
+RM = rm -rf
+
+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++ \
+ -llynq-adc \
+
+SOURCES = lynq-adc-demo.cpp
+
+EXECUTABLE = lynq-adc-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-adc-demo/lynq-adc-demo.bb b/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-adc-demo/lynq-adc-demo.bb
new file mode 100644
index 0000000..edcbbe4
--- /dev/null
+++ b/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-adc-demo/lynq-adc-demo.bb
@@ -0,0 +1,29 @@
+#inherit externalsrc package
+#inherit externalsrc package systemd
+DESCRIPTION = "lynq-adc-demo"
+LICENSE = "CLOSED"
+LICENSE = "CLOSED"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=b1e07e8d88e26263e71d3a9e2aa9a2ff"
+SRC_URI = "file://lynq-adc-demo.cpp \
+ file://makefile \
+"
+DEPENDS += "liblynq-adc"
+
+SRC-DIR = "${S}/../lynq-adc-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-adc-demo ${D}${bindir}/
+}
diff --git a/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-autosuspend/files/autosuspend_wakeup_count.c b/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-autosuspend/files/autosuspend_wakeup_count.c
index b1d03ff..0f46da9 100755
--- a/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-autosuspend/files/autosuspend_wakeup_count.c
+++ b/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-autosuspend/files/autosuspend_wakeup_count.c
@@ -239,14 +239,12 @@
int t106_early_suspend(void)
{
RLOGD("t106_early_suspend start\n");
- system("/etc/init.d/syslog stop");
return 0;
}
void t106_early_resume(void)
{
RLOGD("t106_early_resume start\n");
- system("/etc/init.d/syslog start");
return NULL;
}
#endif
diff --git a/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-led-demo/lynq-led-demo.bb b/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-led-demo/lynq-led-demo.bb
new file mode 100755
index 0000000..a598b6a
--- /dev/null
+++ b/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-led-demo/lynq-led-demo.bb
@@ -0,0 +1,41 @@
+#inherit externalsrc package
+
+DESCRIPTION = "lynq led demo"
+LICENSE = "CLOSED"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=b1e07e8d88e26263e71d3a9e2aa9a2ff"
+DEPENDS += "liblynq-uci liblynq-led"
+#inherit workonsrc
+WORKONSRC = "${TOPDIR}/../src/lynq/packages/apps/lynq-led-demo"
+FILESEXTRAPATHS_prepend :="${TOPDIR}/../src/lynq/packages/apps:"
+SRC_URI = " \
+ file://lynq-led-demo \
+ "
+
+SRC-DIR = "${S}/../lynq-led-demo"
+TARGET_CC_ARCH += "${LDFLAGS}"
+
+#Parameters passed to do_compile()
+EXTRA_OEMAKE = "'RAT_CONFIG_C2K_SUPPORT = ${RAT_CONFIG_C2K_SUPPORT}'\
+ 'MTK_MULTI_SIM_SUPPORT = ${MTK_MULTI_SIM_SUPPORT}'\
+ 'TARGET_PLATFORM = ${TARGET_PLATFORM}'"
+
+EXTRA_OEMAKE += "'LYNQ_CONFIG_VERSION = ${LYNQ_CONFIG_VERSION}' \
+ 'LYNQ_CONFIG_SW_VERSION = ${LYNQ_CONFIG_SW_VERSION}'"
+
+#INHIBIT_PACKAGE_STRIP = "1"
+do_compile () {
+ if [ "${PACKAGE_ARCH}" = "cortexa7hf-vfp-vfpv4-neon" ]; then
+ oe_runmake all -C ${SRC-DIR} ROOT=${STAGING_DIR_HOST} OFLAGS="--sysroot=${STAGING_DIR_HOST} -Os -mfpu=neon-vfpv4 -mhard-float -Wl,--hash-style=gnu -DTELEPHONYWARE"
+ elif [ "${PACKAGE_ARCH}" = "cortexa7hf-neon-vfpv4" ]; then
+ oe_runmake all -C ${SRC-DIR} ROOT=${STAGING_DIR_HOST} OFLAGS="--sysroot=${STAGING_DIR_HOST} -Os -mfpu=neon-vfpv4 -mhard-float -Wl,--hash-style=gnu -DTELEPHONYWARE"
+ elif [ "${PACKAGE_ARCH}" = "cortexa53hf-neon-fp-armv8" ]; then
+ oe_runmake all -C ${SRC-DIR} ROOT=${STAGING_DIR_HOST} OFLAGS="--sysroot=${STAGING_DIR_HOST} -Os -mfpu=neon-vfpv4 -mhard-float -Wl,--hash-style=gnu -DTELEPHONYWARE -mhard-float -mfpu=neon-fp-armv8 -mfloat-abi=hard -mcpu=cortex-a53 -mtune=cortex-a53"
+ else
+ oe_runmake all -C ${SRC-DIR} ROOT=${STAGING_DIR_HOST} OFLAGS="--sysroot=${STAGING_DIR_HOST} -Os -Wl,--hash-style=gnu -DTELEPHONYWARE"
+ fi
+}
+
+do_install() {
+ install -d ${D}${bindir}/
+ install -m 0755 ${SRC-DIR}/lynq-led-demo ${D}${bindir}/
+}
diff --git a/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-led-sev/lynq-led-sev.bb b/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-led-sev/lynq-led-sev.bb
new file mode 100755
index 0000000..1c8d0a8
--- /dev/null
+++ b/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-led-sev/lynq-led-sev.bb
@@ -0,0 +1,51 @@
+#inherit externalsrc package
+
+DESCRIPTION = "lynq led sev"
+LICENSE = "CLOSED"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=b1e07e8d88e26263e71d3a9e2aa9a2ff"
+DEPENDS += "liblynq-uci"
+#inherit workonsrc
+WORKONSRC = "${TOPDIR}/../src/lynq/framework/lynq-led-sev"
+FILESEXTRAPATHS_prepend :="${TOPDIR}/../src/lynq/framework/:"
+SRC_URI = " \
+ file://lynq-led-sev \
+ "
+
+SRC-DIR = "${S}/../lynq-led-sev"
+TARGET_CC_ARCH += "${LDFLAGS}"
+SYSTEMD_PACKAGES = "${PN}"
+SYSTEMD_SERVICE_${PN} = "lynq_led_sev.service"
+FILES_${PN} += "${systemd_unitdir}/system/lynq_led_sev.service"
+FILES_${PN} += "/system/etc/tele/ring ${bindir}"
+#Parameters passed to do_compile()
+EXTRA_OEMAKE = "'RAT_CONFIG_C2K_SUPPORT = ${RAT_CONFIG_C2K_SUPPORT}'\
+ 'MTK_MULTI_SIM_SUPPORT = ${MTK_MULTI_SIM_SUPPORT}'\
+ 'TARGET_PLATFORM = ${TARGET_PLATFORM}'\
+ 'MTK_LED_SUPPORT = ${MTK_LED_SUPPORT}'\
+ 'TARGET_PLATFORM = ${TARGET_PLATFORM}'"
+EXTRA_OEMAKE += "'MOBILETEK_RIL_CFG = ${MOBILETEK_RIL_CFG}'"
+
+EXTRA_OEMAKE += "'MOBILETEK_FOTA_CFG = ${MOBILETEK_FOTA_CFG}'"
+
+#INHIBIT_PACKAGE_STRIP = "1"
+do_compile () {
+ if test "${PACKAGE_ARCH}" = "cortexa7hf-vfp-vfpv4-neon" || test "${PACKAGE_ARCH}" = "cortexa7hf-neon-vfpv4"; then
+ oe_runmake all -C ${SRC-DIR} ROOT=${STAGING_DIR_HOST} OFLAGS="--sysroot=${STAGING_DIR_HOST} -mhard-float"
+ else
+ oe_runmake all -C ${SRC-DIR} ROOT=${STAGING_DIR_HOST} OFLAGS="--sysroot=${STAGING_DIR_HOST}"
+ fi
+}
+
+do_install() {
+ install -d ${D}${bindir}/
+ install -m 0755 ${SRC-DIR}/lynq-led-sev ${D}${bindir}/
+ if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
+ install -d ${D}${systemd_unitdir}/system/
+ install -m 0644 ${B}/lynq_led_sev.service ${D}${systemd_unitdir}/system
+ else
+ install -d ${D}${sysconfdir}/init.d
+ install -m 0755 ${SRC-DIR}/lynq-led-sev.sh ${D}${sysconfdir}/init.d/lynq-led-sev.sh
+ install -d ${D}${sysconfdir}/rcS.d
+ ln -s ../init.d/lynq-led-sev.sh ${D}${sysconfdir}/rcS.d/S23lynq-led-sev
+ fi
+}
diff --git a/cap/zx297520v3/src/lynq/framework/lynq-led-sev/lynq-led-sev.sh b/cap/zx297520v3/src/lynq/framework/lynq-led-sev/lynq-led-sev.sh
new file mode 100755
index 0000000..a5f0230
--- /dev/null
+++ b/cap/zx297520v3/src/lynq/framework/lynq-led-sev/lynq-led-sev.sh
@@ -0,0 +1,39 @@
+#!/bin/sh
+#
+# Run the daemon
+#
+
+DAEMON="lynq-led-sev"
+PIDFILE="/var/run/$DAEMON.pid"
+EXEC="/usr/bin/lynq-led-sev"
+EXEC_ARGS=""
+
+
+start() {
+ echo -n "Starting $DAEMON... "
+ start-stop-daemon --no-close -S -b -m -p $PIDFILE -x $EXEC -- $EXEC_ARGS
+ [ $? -eq 0 ] && echo "OK" || echo "ERROR"
+}
+
+stop() {
+ echo -n "Stopping $DAEMON... "
+ start-stop-daemon -K -p $PIDFILE
+ [ $? -eq 0 ] && echo "OK" || echo "ERROR"
+}
+
+restart() {
+ stop
+ start
+}
+
+case "$1" in
+ start|stop|restart)
+ "$1"
+ ;;
+ *)
+ echo "Usage: $0 {start|stop|restart}"
+ exit 1
+esac
+
+exit $?
+
diff --git a/cap/zx297520v3/src/lynq/framework/lynq-led-sev/lynq_led_sev.c b/cap/zx297520v3/src/lynq/framework/lynq-led-sev/lynq_led_sev.c
new file mode 100755
index 0000000..6f6f916
--- /dev/null
+++ b/cap/zx297520v3/src/lynq/framework/lynq-led-sev/lynq_led_sev.c
@@ -0,0 +1,32 @@
+#include <stdio.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+#include <strings.h>
+#include<stdlib.h>
+#include <include/lynq_uci.h>
+
+
+#define BUF_LEN 8
+#define GPIO_LED 100
+#define LYNQ_UCI_SECTION "lynq_led"
+#define LYNQ_UCI_KEY "lynq_statusled_on"
+
+
+int main(int argc, const char *argv[])
+{
+ char led_enable[BUF_LEN] = "";
+ char com_val[GPIO_LED] = "";
+
+ system("/usr/bin/lynq-default");
+ lynq_get_value(LYNQ_UCI_FILE, LYNQ_UCI_SECTION, LYNQ_UCI_KEY, led_enable);
+ if(atoi(led_enable))
+ {
+ sprintf(com_val, "echo %d > /sys/class/gpio/gpio127/value",led_enable);
+ system("echo 127 > /sys/class/gpio/export");
+ system("echo out > /sys/class/gpio/gpio127/direction");//92 net_Status,127 status
+ system(com_val);
+ }
+
+ return 0;
+}
diff --git a/cap/zx297520v3/src/lynq/framework/lynq-led-sev/lynq_led_sev.service b/cap/zx297520v3/src/lynq/framework/lynq-led-sev/lynq_led_sev.service
new file mode 100755
index 0000000..bea06a6
--- /dev/null
+++ b/cap/zx297520v3/src/lynq/framework/lynq-led-sev/lynq_led_sev.service
@@ -0,0 +1,17 @@
+[Unit]
+Description=lynq ril service
+After=mtkfusionrild.service
+Requires=mtkfusionrild.service
+
+[Service]
+StandardOutput=kmsg+console
+Type=simple
+RemainAfterExit=no
+ExecStart=/usr/bin/lynq-led-sev
+Restart=always
+User=root
+Group=root
+
+[Install]
+Alias=rilsvc
+WantedBy=multi-user.target
\ No newline at end of file
diff --git a/cap/zx297520v3/src/lynq/framework/lynq-led-sev/makefile b/cap/zx297520v3/src/lynq/framework/lynq-led-sev/makefile
new file mode 100755
index 0000000..4e83c2b
--- /dev/null
+++ b/cap/zx297520v3/src/lynq/framework/lynq-led-sev/makefile
@@ -0,0 +1,46 @@
+SHELL = /bin/sh
+RM = rm -f
+
+LOCAL_CFLAGS := -Wall \
+ -g -Os \
+ -flto \
+ -fpermissive \
+ -fPIC \
+
+ifeq ($(strip $(TARGET_PLATFORM)), T106)
+LOCAL_CFLAGS += -DBINDER_IPC_32BIT=1 -DHAVE_ENDIAN_H -DHAVE_PTHREADS -DHAVE_SYS_UIO_H -DHAVE_POSIX_FILEMAP -DHAVE_STRLCPY -DHAVE_PRCTL -DHAVE_MEMSET16 -DHAVE_MEMSET32 -DANDROID_SMP=0
+endif
+
+LOCAL_CFLAGS += -DLYNQ_SW_INSIDE_VERSION=\"$(LYNQ_CONFIG_VERSION)\"
+LOCAL_CFLAGS += -DLYNQ_SW_VERSION=\"$(LYNQ_CONFIG_SW_VERSION)\"
+
+LOCAL_PATH = .
+
+LOCAL_C_INCLUDES = \
+ -I. \
+
+
+
+
+
+LOCAL_LIBS := \
+ -L. \
+ -ldl \
+ -llynq-uci \
+
+SOURCES = $(wildcard *.c)
+
+EXECUTABLE = lynq-led-sev
+
+OBJECTS=$(SOURCES:.c=.o)
+all: $(EXECUTABLE)
+
+$(EXECUTABLE): $(OBJECTS)
+ $(CXX) $(OBJECTS) $(LOCAL_LIBS) $(LOCAL_CFLAGS) $(LOCAL_C_INCLUDES) -o $@
+
+%.o : %.c
+ $(CC) $(LOCAL_C_INCLUDES) $(LOCAL_CFLAGS) $(LOCAL_LIBS) -o $@ -c $<
+
+.PHONY: clean
+clean:
+ $(RM) $(OBJECTS) $(EXECUTABLE)
diff --git a/cap/zx297520v3/src/lynq/framework/lynq-ril-service/src/common.cpp b/cap/zx297520v3/src/lynq/framework/lynq-ril-service/src/common.cpp
index e63b046..36d9e01 100755
--- a/cap/zx297520v3/src/lynq/framework/lynq-ril-service/src/common.cpp
+++ b/cap/zx297520v3/src/lynq/framework/lynq-ril-service/src/common.cpp
@@ -101,6 +101,10 @@
/*Warren add for SZZT 2021/11/14 end*/
+#define LED_ON 4
+#define LYNQ_UCI_SECTION "lynq_led"
+#define LYNQ_UCI_KEY "lynq_netled_on"
+
/*hq add for key information output start 2022/03/01*/
// extern int lynq_output_LINFO_enable =0;
@@ -576,6 +580,10 @@
RLOGD("[slot%d]updateCardStatusV6: sim card message is null", slot);
}
#ifdef LED_SUPPORT
+ char netled_on[LED_ON] = "";
+ lynq_get_value(LYNQ_UCI_FILE, LYNQ_UCI_SECTION, LYNQ_UCI_KEY, netled_on);
+ if(!atoi(netled_on))
+ return ;
mbtk_netled_state_update(GPIO_NETLED_REFLASH_NORMAL);
#endif
}
@@ -605,6 +613,10 @@
regCodeToServiceState(request, atoi(code), slot);
}
#ifdef LED_SUPPORT
+ char netled_on[LED_ON] = "";
+ lynq_get_value(LYNQ_UCI_FILE, LYNQ_UCI_SECTION, LYNQ_UCI_KEY, netled_on);
+ if(!atoi(netled_on))
+ return ;
mbtk_netled_state_update(GPIO_NETLED_REFLASH_NORMAL);
#endif
}
@@ -627,6 +639,10 @@
/*Warren change for SZZT 2021//11/14 end*/
}
#ifdef LED_SUPPORT
+ char netled_on[LED_ON] = "";
+ lynq_get_value(LYNQ_UCI_FILE, LYNQ_UCI_SECTION, LYNQ_UCI_KEY, netled_on);
+ if(!atoi(netled_on))
+ return ;
mbtk_netled_state_update(GPIO_NETLED_REFLASH_NORMAL);
#endif
}
diff --git a/cap/zx297520v3/src/lynq/framework/lynq-ril-service/src/led/led.cpp b/cap/zx297520v3/src/lynq/framework/lynq-ril-service/src/led/led.cpp
index a252764..0a10645 100755
--- a/cap/zx297520v3/src/lynq/framework/lynq-ril-service/src/led/led.cpp
+++ b/cap/zx297520v3/src/lynq/framework/lynq-ril-service/src/led/led.cpp
@@ -24,7 +24,13 @@
*************************************************************/
#define GPIO_NETLED_CONNECT_REFLASH_TIMER 200
#define GPIO_NETLED_CREG_REFLASH_TIMER 800
+#ifndef MOBILETEK_TARGET_PLATFORM_T106
#define MBTK_GPIO_NETLED_N 77
+#else
+#define MBTK_GPIO_LED 100
+#define MBTK_GPIO_NETLED_N 92
+#define MBTK_GPIO_STATUSLED_N 127
+#endif
/*************************************************************
Extern Function Declaration
@@ -495,6 +501,18 @@
void mbtk_gpio_write_output(int gpio_port, int value)
{
+#ifdef MOBILETEK_TARGET_PLATFORM_T106
+ char com_exp[MBTK_GPIO_LED] = "";
+ char com_dir[MBTK_GPIO_LED] = "";
+ char com_val[MBTK_GPIO_LED] = "";
+ sprintf(com_exp, "echo %d > /sys/class/gpio/export", gpio_port);
+ sprintf(com_dir, "echo out > /sys/class/gpio/gpio%d/direction", gpio_port);
+ sprintf(com_val, "echo %d > /sys/class/gpio/gpio%d/value", value, gpio_port);
+
+ system(com_exp);//92 net_Status,127 status
+ system(com_dir);
+ system(com_val);
+#else
if(value==1)
{
system("echo 255 > /sys/class/leds/led9515:green:cellular-radio/brightness");
@@ -503,6 +521,7 @@
{
system("echo 0 > /sys/class/leds/led9515:green:cellular-radio/brightness");
}
+#endif
}
/*=============================================
diff --git a/cap/zx297520v3/src/lynq/framework/lynq-ril-service/src/ril.cpp b/cap/zx297520v3/src/lynq/framework/lynq-ril-service/src/ril.cpp
index c23afae..76f99b3 100755
--- a/cap/zx297520v3/src/lynq/framework/lynq-ril-service/src/ril.cpp
+++ b/cap/zx297520v3/src/lynq/framework/lynq-ril-service/src/ril.cpp
@@ -3801,6 +3801,7 @@
s_registerCalled = 1;
sendRequestToMd(RIL_REQUEST_RADIO_POWER, get_default_sim_all_except_data());
+ initCoditions();
pthread_mutex_lock(&s_InitMutex);
if(utils::is_support_dsds()) {
@@ -3813,7 +3814,7 @@
}
}
pthread_mutex_unlock(&s_InitMutex);
- initCoditions();
+ //initCoditions();
// New rild impl calls RIL_startEventLoop() first
// old standalone impl wants it here.
diff --git a/cap/zx297520v3/src/lynq/framework/lynq-ril-service/src/stateManager/stateManager.cpp b/cap/zx297520v3/src/lynq/framework/lynq-ril-service/src/stateManager/stateManager.cpp
index d4f3ce3..291fea2 100755
--- a/cap/zx297520v3/src/lynq/framework/lynq-ril-service/src/stateManager/stateManager.cpp
+++ b/cap/zx297520v3/src/lynq/framework/lynq-ril-service/src/stateManager/stateManager.cpp
@@ -49,10 +49,13 @@
#include <liblog/lynq_deflog.h>
#ifdef LED_SUPPORT
#include "led.h"
+#include <include/lynq_uci.h>
#endif
#undef LOG_TAG
#define LOG_TAG "DEMO_MANAGER"
-
+ #define LED_ON 4
+ #define LYNQ_UCI_SECTION "lynq_led"
+ #define LYNQ_UCI_KEY "lynq_netled_on"
//RIL_REQUEST_DEVICE_IDENTITY
int getDeviceIdentity(int argc, char **argv, RIL_SOCKET_ID socket_id, RequestInfo *pRI)
{
@@ -103,6 +106,10 @@
int screen_state= atoi(argv[1]);
p.writeInt32(screen_state);
#ifdef LED_SUPPORT
+ char netled_on[LED_ON] = "";
+ lynq_get_value(LYNQ_UCI_FILE, LYNQ_UCI_SECTION, LYNQ_UCI_KEY, netled_on);
+ if(!atoi(netled_on))
+ return -1;
mbtk_netled_state_update(screen_state==0 ? GPIO_NETLED_AP_GOINGSLEEP : GPIO_NETLED_AP_WAKEUP);
usleep(wait_led_update_effective_timer_ms*1000);
#endif
diff --git a/cap/zx297520v3/src/lynq/lib/liblynq-adc/LICENSE b/cap/zx297520v3/src/lynq/lib/liblynq-adc/LICENSE
new file mode 100644
index 0000000..cb88533
--- /dev/null
+++ b/cap/zx297520v3/src/lynq/lib/liblynq-adc/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-adc/include/lynq-adc.h b/cap/zx297520v3/src/lynq/lib/liblynq-adc/include/lynq-adc.h
new file mode 100644
index 0000000..95f55be
--- /dev/null
+++ b/cap/zx297520v3/src/lynq/lib/liblynq-adc/include/lynq-adc.h
@@ -0,0 +1,23 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sc_bsp.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef enum ADC_CHANNEL_ENUM
+{
+ QADC_NONE = 0,
+ ADC0 =1,
+ ADC1 =2,
+ ADC2 =3,
+ QADC_END
+}ADC_CHANNEL_E;
+
+int qser_adc_show(ADC_CHANNEL_E qadc);
+
+#ifdef __cplusplus
+}
+#endif
diff --git a/cap/zx297520v3/src/lynq/lib/liblynq-adc/lynq-adc.cpp b/cap/zx297520v3/src/lynq/lib/liblynq-adc/lynq-adc.cpp
new file mode 100755
index 0000000..b392fca
--- /dev/null
+++ b/cap/zx297520v3/src/lynq/lib/liblynq-adc/lynq-adc.cpp
@@ -0,0 +1,88 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sc_bsp.h>
+#include <errno.h>
+#include "lynq-adc.h"
+#include "liblog/lynq_deflog.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define ADC0_NODES "/sys/kernel/debug/pmu_zx29/adc0"
+#define ADC1_NODES "/sys/kernel/debug/pmu_zx29/adc1"
+#define ADC2_NODES "/sys/kernel/debug/pmu_zx29/adc2"
+
+/********************************************************************
+* @brief: qser_adc_show, function to read ADC value from specific channel
+* @param qadc [IN]: ADC_CHANNEL_E, the ADC channel to read from
+* @return : int, the read ADC value, or error code if failed
+* @todo: NA
+* @see: NA
+* @warning: NA
+*********************************************************************/
+int qser_adc_show(ADC_CHANNEL_E qadc)
+{
+ int adc_value;
+ char cmd[1024];
+ char cmd_ret[1024];
+ FILE *fp;
+ switch(qadc)
+ {
+ case QADC_NONE:
+ {
+ LYERRLOG("function %s line %d\n", __FUNCTION__, __LINE__);
+ return 0;
+ }
+ case ADC0:
+ {
+ LYDBGLOG("function %s line %d\n", __FUNCTION__, __LINE__);
+ sprintf(cmd, "cat %s", ADC0_NODES);
+ break;
+ }
+ case ADC1:
+ {
+ LYDBGLOG("function %s line %d\n", __FUNCTION__, __LINE__);
+ sprintf(cmd, "cat %s", ADC1_NODES);
+ break;
+ }
+ case ADC2:
+ {
+ LYDBGLOG("function %s line %d\n", __FUNCTION__, __LINE__);
+ sprintf(cmd, "cat %s", ADC2_NODES);
+ break;
+ }
+ default:
+ {
+ LYERRLOG("input error\n");
+ return -1;
+ }
+ }
+ if((fp = popen(cmd,"r")) == NULL)
+ {
+ LYERRLOG("popen error: %s", strerror(errno));
+ return -1;
+ }
+ if((fread(cmd_ret,sizeof(cmd_ret),1,fp))<0)
+ {
+ LYERRLOG("fread fail: %s", strerror(errno));
+ fclose(fp);
+ return -1;
+ }
+ fclose(fp);
+ adc_value = atoi(cmd_ret);
+ if (adc_value < 0 || adc_value > 12000)
+ {
+ LYERRLOG("bad adc value %s!", cmd_ret);
+ return -1;
+ }
+ return adc_value;
+}
+
+DEFINE_LYNQ_LIB_LOG(LYNQ_ADC)
+
+#ifdef __cplusplus
+}
+#endif
+
diff --git a/cap/zx297520v3/src/lynq/lib/liblynq-adc/makefile b/cap/zx297520v3/src/lynq/lib/liblynq-adc/makefile
new file mode 100644
index 0000000..d8447e6
--- /dev/null
+++ b/cap/zx297520v3/src/lynq/lib/liblynq-adc/makefile
@@ -0,0 +1,61 @@
+SHELL = /bin/sh
+RM = rm -rf
+
+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 \
+ -llynq-log \
+ -lbsp \
+
+
+SOURCES = $(wildcard *.cpp)
+
+EXECUTABLE = liblynq-adc.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-autosuspend/lynq-autosuspend.cpp b/cap/zx297520v3/src/lynq/lib/liblynq-autosuspend/lynq-autosuspend.cpp
old mode 100644
new mode 100755
index ced8635..09160b7
--- a/cap/zx297520v3/src/lynq/lib/liblynq-autosuspend/lynq-autosuspend.cpp
+++ b/cap/zx297520v3/src/lynq/lib/liblynq-autosuspend/lynq-autosuspend.cpp
@@ -10,6 +10,8 @@
#include <pthread.h>
#include <stdbool.h>
#include <time.h>
+#include <liblog/lynq_deflog.h>
+
#include "include/libauto/lynq_autosuspend.h"
#ifdef MOBILETEK_TARGET_PLATFORM_T106
#include <sc_bsp.h>
@@ -19,10 +21,11 @@
extern "C" {
#endif
+#define USER_LOG_TAG "LIBLYNQ_AUTOSUSPEND"
-#define LOG_TAG "libautosuspend"
-// #include <liblog/lynq_deflog.h>
-#include <log/log.h>
+
+
+
#define SERVER_CMD_PATH "/tmp/autosuspend.cmd.server"
#define SERVER_DATA_PATH "/tmp/autosuspend.data.server"
// #define CLIENT_PATH "/tmp/autosuspend.client"
@@ -45,25 +48,25 @@
while((n = read(fd, ptr, nbytes)) == -1)
{
- //printf("READ,%d\n",fd);
+ //LYINFLOG("READ,%d\n",fd);
if (errno == EINTR)
{
- printf("read error eintr\n");
+ LYINFLOG("read error eintr\n");
continue;
}
else if(errno == EAGAIN || errno == EWOULDBLOCK)
{
- printf("read time out\n");
+ LYINFLOG("read time out\n");
return -2;
}
else
{
- printf("read error\n");
+ LYINFLOG("read error\n");
return -1;
}
}
//sleep(2);
- //printf("READ1,%d\n", fd);
+ //LYINFLOG("READ1,%d\n", fd);
return n;
}
static ssize_t Write(int fd, const void *ptr, size_t nbytes)
@@ -75,7 +78,7 @@
continue;
else if(errno == EPIPE)
{
- printf("write error epipe\n");
+ LYINFLOG("write error epipe\n");
return -1;
}
else
@@ -87,7 +90,7 @@
{
if (Close(fd) == -1)
{
- printf("Close error\n");
+ LYINFLOG("Close error\n");
return -1;
}
return 0;
@@ -97,13 +100,13 @@
int rc;
struct sockaddr_un server_sockaddr;
struct sockaddr_un client_sockaddr;
- printf("Start bind and connect to the service.\n");
+ LYINFLOG("Start bind and connect to the service.\n");
/**************************************/
/* Create a UNIX domain stream socket */
/**************************************/
*cfd = socket(AF_UNIX, SOCK_STREAM, 0);
if (*cfd == -1) {
- printf("SOCKET ERROR ");
+ LYINFLOG("SOCKET ERROR ");
return -1;
}
/***************************************/
@@ -120,7 +123,7 @@
unlink(client_sockaddr.sun_path);
rc = bind(*cfd, (struct sockaddr *) &client_sockaddr, sizeof(client_sockaddr));
if (rc == -1){
- printf("BIND ERROR ");
+ LYINFLOG("BIND ERROR ");
Close(*cfd);
return -1;
}
@@ -135,7 +138,7 @@
strcpy(server_sockaddr.sun_path, server_path);
rc = connect(*cfd, (struct sockaddr *) &server_sockaddr, sizeof(client_sockaddr));
if(rc == -1){
- printf("CONNECT ERROR ");
+ LYINFLOG("CONNECT ERROR ");
Close(*cfd);
return -3;
}
@@ -150,27 +153,27 @@
while (1)
{
- // printf("deal_get_feedback thread wait.\n");
+ // LYINFLOG("deal_get_feedback thread wait.\n");
// pthread_cond_wait(&get_feedback_cond,&get_feedback_mutex);
- printf("start get feedback from the service.\n");
+ LYINFLOG("start get feedback from the service.\n");
pthread_mutex_lock(&feedback_got_mutex);
memset(&time_info_client,0,sizeof(struct time_info_t));
rc = Read(client_sock,&time_info_client,sizeof(struct time_info_t));
if(rc == -1)
{
- printf("client read wakeup_feedback struct fail.\n");
+ LYINFLOG("client read wakeup_feedback struct fail.\n");
Close(client_sock);
pthread_mutex_unlock(&feedback_got_mutex);
break ;
}
else if(rc == -2)
{
- printf("client read wakeup_feedback struct timeout.\n");
+ LYINFLOG("client read wakeup_feedback struct timeout.\n");
pthread_mutex_unlock(&feedback_got_mutex);
continue;
}
- printf("system sleep_start timestamps : %ld ms\n",time_info_client.sleep_start_time);
- printf("system wakeup timestamps : %ld ms\n",time_info_client.wakeup_time);
+ LYINFLOG("system sleep_start timestamps : %ld ms\n",time_info_client.sleep_start_time);
+ LYINFLOG("system wakeup timestamps : %ld ms\n",time_info_client.wakeup_time);
// pthread_cond_broadcast(&feedback_got_cond);
pthread_mutex_unlock(&feedback_got_mutex);
usleep(10000); //给libautosuspend_get_feedback函数时间进入wait,不可删除,但可以减少
@@ -186,7 +189,7 @@
{
return 0;
}
- printf("Start libautosuspend_init.\n");
+ LYINFLOG("Start libautosuspend_init.\n");
char client_cmd_path[40];
char client_data_path[40];
sprintf(client_cmd_path,"/tmp/autosuspend.%d.cmd.client",(int)getpid());
@@ -194,13 +197,13 @@
pthread_mutex_lock(&client_fd_mutex);
if(connect_to_server(&client_sock_fd,client_cmd_path,SERVER_CMD_PATH) < 0)
{
- printf("cmd channel connect error.\n");
+ LYINFLOG("cmd channel connect error.\n");
pthread_mutex_unlock(&client_fd_mutex);
return -1;
}
if(connect_to_server(&client_data_sock_fd,client_data_path,SERVER_DATA_PATH) < 0)
{
- printf("data channel connect error.\n");
+ LYINFLOG("data channel connect error.\n");
pthread_mutex_unlock(&client_fd_mutex);
return -1;
}
@@ -226,15 +229,15 @@
/* send it to the server socket. */
/************************************/
// strcpy(buf, DATA);
- printf("Sending data...\n");
+ LYINFLOG("Sending data...\n");
rc = send(client_sock_fd, value, len, 0);
if (rc == -1) {
- printf("SEND ERROR ");
+ LYINFLOG("SEND ERROR ");
Close(client_sock_fd);
return -2;
}
else {
- printf("Data sent: %s\n",value);
+ LYINFLOG("Data sent: %s\n",value);
}
// Close(client_sock);
return rc;
@@ -243,6 +246,9 @@
{
char value[15]="enable";
char res[15];
+ LYLOGSET(LOG_INFO);
+ LYLOGEINIT(USER_LOG_TAG);
+
if(libautosuspend_init() != 0)
{
return -1;
@@ -255,17 +261,17 @@
int rc = send_cmd(value,strlen(value));
if(rc < 0)
{
- printf("libautosuspend send enable cmd fail.\n");
+ LYINFLOG("libautosuspend send enable cmd fail.\n");
pthread_mutex_unlock(&client_fd_mutex);
return -1;
}
// if(Read(client_sock_fd,res,sizeof(res)) <= 0)
// {
- // printf("libautosuspend get respond fail.\n");
+ // LYINFLOG("libautosuspend get respond fail.\n");
// pthread_mutex_unlock(&client_fd_mutex);
// return -1;
// }
- // printf("libautosuspend get respond : %s.\n",res);
+ // LYINFLOG("libautosuspend get respond : %s.\n",res);
// if(strcmp(res,"enabled") != 0)
// {
// pthread_mutex_unlock(&client_fd_mutex);
@@ -292,17 +298,17 @@
int rc = send_cmd(value,strlen(value));
if(rc < 0)
{
- printf("libautosuspend send disable cmd fail.\n");
+ LYINFLOG("libautosuspend send disable cmd fail.\n");
pthread_mutex_unlock(&client_fd_mutex);
return -1;
}
// if(Read(client_sock_fd,res,sizeof(res)) <= 0)
// {
- // printf("libautosuspend get respond fail.\n");
+ // LYINFLOG("libautosuspend get respond fail.\n");
// pthread_mutex_unlock(&client_fd_mutex);
// return -1;
// }
- // printf("libautosuspend get respond : %s.\n",res);
+ // LYINFLOG("libautosuspend get respond : %s.\n",res);
// if(strcmp(res,"disabled") != 0)
// {
// pthread_mutex_unlock(&client_fd_mutex);
@@ -318,14 +324,14 @@
// char res[15];
// if(!libautosuspend_enabled)
// {
- // printf("system autosuspend disabled, can not get wakeup feedback.\n");
+ // LYINFLOG("system autosuspend disabled, can not get wakeup feedback.\n");
// return -1;
// }
- printf("start get feedback from the service.\n");
+ LYINFLOG("start get feedback from the service.\n");
memset(time_info,0,sizeof(struct time_info_t));
// if(timeout == NULL)
// {
- // printf("client set timeout for receiving wakeup_feedback: NULL.\n");
+ // LYINFLOG("client set timeout for receiving wakeup_feedback: NULL.\n");
// }
// else
// {
@@ -333,36 +339,36 @@
// pthread_mutex_lock(&client_data_fd_mutex);
// if(setsockopt(client_data_sock_fd,SOL_SOCKET,SO_RCVTIMEO,(char*)&recv_timeout,sizeof(struct timeval)) == -1)
// {
- // printf("client set timeout for receiving wakeup_feedback: error.\n");
+ // LYINFLOG("client set timeout for receiving wakeup_feedback: error.\n");
// pthread_mutex_unlock(&client_data_fd_mutex);
// return -1;
// }
- // printf("client set timeout for receiving wakeup_feedback: %d s.\n",(*timeout));
+ // LYINFLOG("client set timeout for receiving wakeup_feedback: %d s.\n",(*timeout));
// pthread_mutex_unlock(&client_data_fd_mutex);
// }
// int rc = send_cmd(value,strlen(value));
// if(rc < 0)
// {
- // printf("libautosuspend send feedback cmd fail.\n");
+ // LYINFLOG("libautosuspend send feedback cmd fail.\n");
// pthread_mutex_unlock(&client_fd_mutex);
// return -1;
// }
// if(Read(client_data_sock_fd,time_info,sizeof(struct time_info_t)) <= 0)
// {
- // printf("libautosuspend_get_feedback fail.\n");
+ // LYINFLOG("libautosuspend_get_feedback fail.\n");
// pthread_mutex_unlock(&client_fd_mutex);
// return -1;
// }
- printf("libautosuspend_get_feedback wait.\n");
+ LYINFLOG("libautosuspend_get_feedback wait.\n");
pthread_mutex_lock(&feedback_got_mutex);
pthread_cond_wait(&feedback_got_cond,&feedback_got_mutex);
memcpy(time_info,&time_info_client,sizeof(struct time_info_t));
- printf("libautosuspend_get_feedback success.\n");
+ LYINFLOG("libautosuspend_get_feedback success.\n");
pthread_mutex_unlock(&feedback_got_mutex);
- // printf("[client] system sleep_start timestamps : %ld ms\n",time_info.sleep_start_time);
- // printf("[client] system wakeup timestamps : %ld ms\n",time_info.wakeup_time);
+ // LYINFLOG("[client] system sleep_start timestamps : %ld ms\n",time_info.sleep_start_time);
+ // LYINFLOG("[client] system wakeup timestamps : %ld ms\n",time_info.wakeup_time);
return 0;
}
int lynq_wait_wakeup_event(long *sleep_start_time, long * wakeup_time)
@@ -383,7 +389,7 @@
memset(&time_info,0,sizeof(struct time_info_t));
if(sleep_start_time == NULL || wakeup_time == NULL )
{
- printf("lynq_wait_wakeup_event input errors.\n");
+ LYINFLOG("lynq_wait_wakeup_event input errors.\n");
return -1;
}
ret=libautosuspend_get_feedback(&time_info);
@@ -403,44 +409,64 @@
int acquire_wake_lock(int lock, char *name)
{
int ret;
- printf("Get param:%s \n", name);
+ LYLOGSET(LOG_INFO);
+ LYLOGEINIT(USER_LOG_TAG);
+
+ if(strlen(name) == 0)
+ {
+ return -1;
+ }
+ LYINFLOG("Get param:%s \n", name);
ret = sc_pm_wakelock_lock(name);
if (ret != 0)
{
- printf("do_wakelock failed, err:%d", ret);
+ LYINFLOG("do_wakelock failed, err:%d", ret);
return -1;
}
- printf("do_wakelock succeed\n");
+ LYINFLOG("do_wakelock succeed\n");
return 1;
}
int release_wake_lock(char *name)
{
int ret;
- printf("Get param:%s \n", name);
+
+ if(strlen(name) == 0)
+ {
+ return -1;
+ }
+ LYLOGSET(LOG_INFO);
+ LYLOGEINIT(USER_LOG_TAG);
+
+ LYINFLOG("Get param:%s \n", name);
ret = sc_pm_wakelock_unlock(name);
if (ret != 0)
{
- printf("do_wakeunlock failed, err:%d", ret);
+ LYINFLOG("do_wakeunlock failed, err:%d", ret);
return -1;
}
- printf("do_wakeunlock succeed\n");
+ LYINFLOG("do_wakeunlock succeed\n");
return 1;
}
int lynq_set_lpmode(int lp_mode)
{
int ret;
- printf("Get param:%d \n", lp_mode);
+ LYLOGSET(LOG_INFO);
+ LYLOGEINIT(USER_LOG_TAG);
+
+ LYINFLOG("Get param:%d \n", lp_mode);
ret = sc_pm_set_lp_mode(lp_mode);
if (ret) {
- printf("do_set_lpmode failed, err:%d", ret);
+ LYINFLOG("do_set_lpmode failed, err:%d", ret);
exit(1);
}
- printf("do_set_lpmode succeed\n");
+ LYINFLOG("do_set_lpmode succeed\n");
return ret;
}
#endif
+DEFINE_LYNQ_LIB_LOG(LIBLYNQ_AUTOSUSPEND)
+
#ifdef __cplusplus
}
#endif
diff --git a/cap/zx297520v3/src/lynq/lib/liblynq-led/LICENSE b/cap/zx297520v3/src/lynq/lib/liblynq-led/LICENSE
new file mode 100755
index 0000000..605b7ea
--- /dev/null
+++ b/cap/zx297520v3/src/lynq/lib/liblynq-led/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-led/include/libled/lynq_led.h b/cap/zx297520v3/src/lynq/lib/liblynq-led/include/libled/lynq_led.h
new file mode 100755
index 0000000..c95282b
--- /dev/null
+++ b/cap/zx297520v3/src/lynq/lib/liblynq-led/include/libled/lynq_led.h
@@ -0,0 +1,12 @@
+#ifndef LYNQ_LED_H
+#define LYNQ_LED_H 1
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+int lynq_set_netled_on(const int test_mode);
+int lynq_set_statusled_on(const int test_mode);
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/cap/zx297520v3/src/lynq/lib/liblynq-led/lynq_led.cpp b/cap/zx297520v3/src/lynq/lib/liblynq-led/lynq_led.cpp
new file mode 100755
index 0000000..66ff18d
--- /dev/null
+++ b/cap/zx297520v3/src/lynq/lib/liblynq-led/lynq_led.cpp
@@ -0,0 +1,32 @@
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <log/log.h>
+#include "liblog/lynq_deflog.h"
+#include <include/lynq_uci.h>
+#include "lynq_led.h"
+
+#define BUF_LEN 258
+#define LYNQ_UCI_SECTION "lynq_led"
+#define LYNQ_UCI_KEY "lynq_statusled_on"
+#define LYNQ_UCI_STATUSLED_KEY "lynq_netled_on"
+
+int lynq_set_netled_on(int led_mode)
+{
+ char buf_netled[BUF_LEN] = "";
+
+ sprintf(buf_netled,"%s.%s.%s=%d", LYNQ_UCI_FILE, LYNQ_UCI_SECTION, LYNQ_UCI_STATUSLED_KEY, led_mode);
+ lynq_uci_set(buf_netled);
+
+ return 0;
+}
+
+int lynq_set_statusled_on(int led_mode)
+{
+ char buf_statusled[BUF_LEN] = "";
+
+ sprintf(buf_statusled,"%s.%s.%s=%d", LYNQ_UCI_FILE, LYNQ_UCI_SECTION, LYNQ_UCI_KEY, led_mode);
+ lynq_uci_set(buf_statusled);
+
+ return 0;
+}
\ No newline at end of file
diff --git a/cap/zx297520v3/src/lynq/lib/liblynq-led/makefile b/cap/zx297520v3/src/lynq/lib/liblynq-led/makefile
new file mode 100755
index 0000000..d670bd5
--- /dev/null
+++ b/cap/zx297520v3/src/lynq/lib/liblynq-led/makefile
@@ -0,0 +1,76 @@
+SHELL = /bin/sh
+RM = rm -f
+
+LOCAL_CFLAGS := -Wall \
+ -std=c++11 \
+ -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
+
+$(warning ################# lynq data demo ROOT: $(ROOT),includedir:$(includedir))
+LOCAL_PATH = .
+
+LOCAL_C_INCLUDES = \
+ -I. \
+ -I$(LOCAL_PATH)/include/libled \
+ -I$(ROOT)$(includedir)/logger \
+ -I$(ROOT)$(includedir)/liblog \
+ -I$(ROOT)$(includedir)/vendor-ril \
+ -I$(ROOT)$(includedir)/lynq_shm \
+
+
+LOCAL_LIBS := \
+ -L. \
+ -ldl \
+ -lstdc++ \
+ -llog \
+ -lcutils \
+ -lutils \
+ -lbinder \
+ -lpthread \
+ -llynq-log \
+ -llynq-shm \
+ -llynq-uci \
+
+SOURCES = $(wildcard *.cpp)
+
+EXECUTABLE = liblynq-led.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-log/include/liblog/liblog.h b/cap/zx297520v3/src/lynq/lib/liblynq-log/include/liblog/liblog.h
index 57c9c98..d1ca261 100755
--- a/cap/zx297520v3/src/lynq/lib/liblynq-log/include/liblog/liblog.h
+++ b/cap/zx297520v3/src/lynq/lib/liblynq-log/include/liblog/liblog.h
@@ -1,13 +1,16 @@
#ifndef __LIBLOG_H__
#define __LIBLOG_H__
+#include <unistd.h>
+
#ifdef __cplusplus
extern "C" {
#endif
typedef enum
{
- LOG_VERBOSE = 0,
+ LOG_UNSET = -1,
+ LOG_VERBOSE = 0,
LOG_ERROR,
LOG_WARNING,
LOG_INFO,
@@ -18,6 +21,14 @@
void lynq_log_global_output(log_level_enum Level,const char *format,...);
void lynq_log_configuration_init(const char *log_name);
const char* lynq_read_log_version();
+
+//log level api
+int lynq_set_log_level(const char * module_name, log_level_enum level);
+int lynq_get_log_level(const char * module_name, log_level_enum *level);
+int lynq_set_special_log_level(const char * exe_name, const char * module_name, log_level_enum level);
+int lynq_get_special_log_level(const char * exe_name, const char * module_name, log_level_enum *level);
+int lynq_notify_recalc_log_level(pid_t pid);
+
#ifdef __cplusplus
}
#endif
diff --git a/cap/zx297520v3/src/lynq/lib/liblynq-log/log-riltel/log.cpp b/cap/zx297520v3/src/lynq/lib/liblynq-log/log-riltel/log.cpp
index 3b35553..581fee8 100755
--- a/cap/zx297520v3/src/lynq/lib/liblynq-log/log-riltel/log.cpp
+++ b/cap/zx297520v3/src/lynq/lib/liblynq-log/log-riltel/log.cpp
@@ -30,28 +30,28 @@
log_module_entry() // constuctor of struct
{
level = LOG_INFO; // default log level when no uci value
- special_level = LOG_LEVEL_MAX;
- lib_level = LOG_LEVEL_MAX;
- exe_level = LOG_LEVEL_MAX;
- global_level = LOG_LEVEL_MAX;
+ special_level = LOG_UNSET;
+ lib_level = LOG_UNSET;
+ exe_level = LOG_UNSET;
+ global_level = LOG_UNSET;
}
void calc_level() // to calc the current log level
{
level = LOG_INFO;
- if (special_level != LOG_LEVEL_MAX) // [exe]_[lib] level as the first consideration
+ if (special_level != LOG_UNSET) // [exe]_[lib] level as the first consideration
{
level = special_level;
}
- else if (exe_level != LOG_LEVEL_MAX) // when [exe] level is set
+ else if (exe_level != LOG_UNSET) // when [exe] level is set
{
level = exe_level;
}
- else if (lib_level != LOG_LEVEL_MAX) // when [lib] level is set
+ else if (lib_level != LOG_UNSET) // when [lib] level is set
{
level = lib_level;
}
- else if (global_level != LOG_LEVEL_MAX) // global log level is set
+ else if (global_level != LOG_UNSET) // global log level is set
{
level = global_level;
}
@@ -138,7 +138,7 @@
return (log_level_enum)level;
}
}
- return LOG_LEVEL_MAX;
+ return LOG_UNSET;
}
static log_level_enum get_uci_log_value(const char *key)
@@ -146,7 +146,7 @@
char level_buf[64] = {0};
if (key == NULL || key[0] == '\0')
{
- return LOG_LEVEL_MAX;
+ return LOG_UNSET;
}
if (0 == lynq_get_value((char*)LOG_UCI_FILE, (char*)LOG_UCI_MODULE, (char*)key, level_buf))
@@ -154,7 +154,7 @@
return convert_log_level_from_string(level_buf);
}
- return LOG_LEVEL_MAX;
+ return LOG_UNSET;
}
static void get_module_log_level(struct log_module_entry *entry) // calc module log level from uci
@@ -177,8 +177,8 @@
entry->exe_level = get_uci_log_value(uci_key);
if (main_module_flag == 1) // if this entry is main module no need to get the special level
{
- entry->lib_level = LOG_LEVEL_MAX;
- entry->special_level = LOG_LEVEL_MAX;
+ entry->lib_level = LOG_UNSET;
+ entry->special_level = LOG_UNSET;
}
else
{
@@ -467,6 +467,80 @@
}
#endif
+//log level api
+
+int lynq_set_log_level(const char * module_name, log_level_enum level)
+{
+ char level_buf[64] = {0};
+ if (module_name == NULL || module_name[0] == '\0')
+ {
+ __android_log_print(ANDROID_LOG_ERROR, "LYNQ_LOG", "lynq_set_log_level: bad module name");
+ return -1;
+ }
+
+ if (level > LOG_UNSET && level < LOG_LEVEL_MAX)
+ {
+ sprintf(level_buf, "%s", LogLevelNameInfoTable[level]);
+ }
+ else if (level != LOG_UNSET)
+ {
+ __android_log_print(ANDROID_LOG_ERROR, "LYNQ_LOG", "unkown level %d", level);
+ return -1;
+ }
+
+ return lynq_set_value((char*)LOG_UCI_MODULE, (char*)module_name, level_buf);
+}
+
+int lynq_get_log_level(const char * module_name, log_level_enum *level)
+{
+ char level_buf[64] = {0};
+ if (level == NULL || module_name == NULL || module_name[0] == '\0')
+ {
+ __android_log_print(ANDROID_LOG_ERROR, "LYNQ_LOG", "lynq_get_log_level: bad param");
+ return -1;
+ }
+
+ if (0 == lynq_get_value((char*)LOG_UCI_FILE, (char*)LOG_UCI_MODULE, (char*)module_name, level_buf))
+ {
+ *level = convert_log_level_from_string(level_buf);
+ return 0;
+ }
+
+ return -1;
+}
+
+int lynq_set_special_log_level(const char * exe_name, const char * module_name, log_level_enum level)
+{
+ char special_name[128] = {0};
+ if (exe_name == NULL || module_name == NULL || exe_name[0] == '\0' || module_name[0] == '\0')
+ {
+ __android_log_print(ANDROID_LOG_ERROR, "LYNQ_LOG", "lynq_set_special_log_level: bad param");
+ return -1;
+ }
+
+ sprintf(special_name, "%s__%s", exe_name, module_name);
+ return lynq_set_log_level(special_name, level);
+}
+
+int lynq_get_special_log_level(const char * exe_name, const char * module_name, log_level_enum *level)
+{
+ char special_name[128] = {0};
+ if (exe_name == NULL || module_name == NULL || exe_name[0] == '\0' || module_name[0] == '\0')
+ {
+ __android_log_print(ANDROID_LOG_ERROR, "LYNQ_LOG", "lynq_get_special_log_level: bad param");
+ return -1;
+ }
+
+ sprintf(special_name, "%s__%s", exe_name, module_name);
+ return lynq_get_log_level(special_name, level);
+}
+
+int lynq_notify_recalc_log_level(pid_t pid)
+{
+ char cmd_buf[64];
+ sprintf(cmd_buf, " [ -d /tmp/log_level/%d ] && kill -%d %d", pid, SIGUSR1, pid);
+ return system(cmd_buf);
+}
static void log_signal_handler(int signum) {
if (SIGUSR1 != signum)
diff --git a/cap/zx297520v3/src/lynq/lib/liblynq-qser-gnss/include/mbtk_gnss_internal.h b/cap/zx297520v3/src/lynq/lib/liblynq-qser-gnss/include/mbtk_gnss_internal.h
index d512dc1..ce124b2 100755
--- a/cap/zx297520v3/src/lynq/lib/liblynq-qser-gnss/include/mbtk_gnss_internal.h
+++ b/cap/zx297520v3/src/lynq/lib/liblynq-qser-gnss/include/mbtk_gnss_internal.h
@@ -2,6 +2,7 @@
#include <stdint.h>
#ifndef __MBTK_GNSS_H__
#define __MBTK_GNSS_H__
+#include <sc_bsp.h>
#include "ringbuffer.h"
#ifdef __cplusplus
extern "C" {
@@ -270,8 +271,8 @@
};
-
-
+#define MAX_GPIO_NUM 144
+static void *test_gpio_handle[MAX_GPIO_NUM]={NULL};
static struct mopen_gnss_device_info_t mopen_gnss_device_info;
static struct mbtk_gnss_handle_t *mbtk_gnss_handle = NULL;
static int firmware_extren_state = 0;
diff --git a/cap/zx297520v3/src/lynq/lib/liblynq-qser-gnss/makefile b/cap/zx297520v3/src/lynq/lib/liblynq-qser-gnss/makefile
index b08e590..0f99e4f 100755
--- a/cap/zx297520v3/src/lynq/lib/liblynq-qser-gnss/makefile
+++ b/cap/zx297520v3/src/lynq/lib/liblynq-qser-gnss/makefile
@@ -34,6 +34,7 @@
-lxml2 \
-llynq-uci \
-lsctel \
+ -lbsp \
SOURCES = $(wildcard *.c wildcard *.h src/*.cpp)
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 a238919..1c4f1bc 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
@@ -466,10 +466,22 @@
return -1;
}
lynq_open_gps(1);
- ret = set_baudrate(tty_fd, B9600);
- if(-1 == ret)
+
+ if(gpio21_value == 1)
{
- return -1;
+ ret = set_baudrate(tty_fd, B115200);
+ if(-1 == ret)
+ {
+ return -2;
+ }
+ }
+ else if(gpio21_value == 0)
+ {
+ ret = set_baudrate(tty_fd, B9600);
+ if(-1 == ret)
+ {
+ return -2;
+ }
}
}
else
diff --git a/cap/zx297520v3/src/lynq/lib/liblynq-qser-gnss/src/mbtk_gnss.cpp b/cap/zx297520v3/src/lynq/lib/liblynq-qser-gnss/src/mbtk_gnss.cpp
index 7a7aefe..a9a0b67 100755
--- a/cap/zx297520v3/src/lynq/lib/liblynq-qser-gnss/src/mbtk_gnss.cpp
+++ b/cap/zx297520v3/src/lynq/lib/liblynq-qser-gnss/src/mbtk_gnss.cpp
@@ -731,7 +731,7 @@
{
return -1;
}
- printf("send cmd: %s\n", &buf[size]);
+ ALOGD("send cmd: %s\n", &buf[size]);
size += size_written;
if(size_written != size_to_wr)
{
@@ -913,37 +913,20 @@
return -1;
}
+
int gpio21_value = -1;
int lynq_open_gps(int state)
{
int ret;
- int cn_enable = 86;
- int eur_enable = 84;
- int eur_boot = 15;
- char compare_buf[256] = {0};
- const char* compare_cmd = "echo '21' > /sys/class/gpio/export && cat /sys/class/gpio/gpio21/value";
- exec_cmd(compare_cmd,compare_buf);
- gpio21_value = (compare_buf[0] - '0');
- const char*compare_cmd2 = "echo '21' > /sys/class/gpio/unexport";
- exec_cmd(compare_cmd2,NULL);
+ /*when in Eur,GPIO21 value is 1; in CN,GPIO21 value is 0. so use it to determined CN or Eur*/
+ test_gpio_handle[21] = sc_gpio_init(21,0,0,0);
+ ret = sc_gpio_value_get(test_gpio_handle[21],&gpio21_value);
+ if(ret)
+ {
+ ALOGE("gpio21 value get error\n");
+ }
- /*this is CN GPIO*/
- char CN_Enable[128];
- sprintf(CN_Enable,"echo '%d' > /sys/class/gpio/export && cd /sys/class/gpio/gpio%d", cn_enable,cn_enable);
-
- /*this is Europe GPIO*/
- char Eur_Boot[128];
- sprintf(Eur_Boot,"echo '%d' > /sys/class/gpio/export && cd /sys/class/gpio/gpio%d", eur_boot,eur_boot);
- char Eur_Enable[128];
- sprintf(Eur_Enable,"echo '%d' > /sys/class/gpio/export && cd /sys/class/gpio/gpio%d", eur_enable,eur_enable);
-
- char CN_Enable_unexport[128];
- sprintf(CN_Enable_unexport,"echo '%d' > /sys/class/gpio/unexport", cn_enable);
- char Eur_Boot_unexport[128];
- sprintf(Eur_Boot_unexport,"echo '%d' > /sys/class/gpio/unexport", eur_boot);
- char Eur_Enable_unexport[128];
- sprintf(Eur_Enable_unexport,"echo '%d' > /sys/class/gpio/unexport", eur_enable);
-
+ /*in Eur,need set GPIO15 and 84 value; in CN,need set GPIO86 value*/
if(0 == state)
{
nmea_state = 0;
@@ -958,53 +941,31 @@
if(gpio21_value == 1)
{
- ret = exec_cmd(Eur_Boot,NULL);
- if(ret < 0)
+ test_gpio_handle[15] = sc_gpio_init(15,1,0,0);
+ test_gpio_handle[84] = sc_gpio_init(84,1,0,0);
+ ret = sc_gpio_value_set(test_gpio_handle[15],0);
+ if(ret)
{
- return -1;
+ ALOGE("gpio15 set value 0 error\n");
}
- ret = exec_cmd(Eur_Enable,NULL);
- if(ret < 0)
+ usleep(10000);
+ ret = sc_gpio_value_set(test_gpio_handle[84],0);
+ if(ret)
{
- return -1;
- }
-
- }
- else if(gpio21_value == 0)
- {
- ret = exec_cmd(CN_Enable,NULL);
- if(ret < 0)
- {
- return -1;
+ ALOGE("gpio84 set value 0 error\n");
}
}
- const char* CN_Enable2 = "echo '0' > /sys/class/gpio/gpio86/value";
- char Eur_Boot2[128];
- sprintf(Eur_Boot2,"echo 'out' > /sys/class/gpio/gpio%d/direction && echo '0' > /sys/class/gpio/gpio%d/value",eur_boot,eur_boot);
- char Eur_Enable2[128];
- sprintf(Eur_Enable2,"echo 'out' > /sys/class/gpio/gpio%d/direction && echo '0' > /sys/class/gpio/gpio%d/value",eur_enable,eur_enable);
- if(gpio21_value == 1)
- {
- exec_cmd(Eur_Boot2,NULL);
- exec_cmd(Eur_Enable2,NULL);
- exec_cmd(Eur_Boot_unexport,NULL);
- exec_cmd(Eur_Enable_unexport,NULL);
-
- }
else if(gpio21_value == 0)
{
- ret = exec_cmd(CN_Enable2,NULL);
- if(ret < 0)
+ test_gpio_handle[86] = sc_gpio_init(86,1,0,0);
+ ret = sc_gpio_value_set(test_gpio_handle[86],0);
+ if(ret)
{
- return -1;
- }
- ret = exec_cmd(CN_Enable_unexport,NULL);
- if(ret < 0)
- {
- return -1;
+ ALOGE("gpio86 set value 0 error\n");
}
}
+
}
else if(1 == state)
@@ -1012,51 +973,44 @@
nmea_state = 1;
if(gpio21_value == 1)
{
- ret = exec_cmd(Eur_Boot,NULL);
- if(ret < 0)
+ test_gpio_handle[15] = sc_gpio_init(15,1,0,0);
+ test_gpio_handle[84] = sc_gpio_init(84,1,0,0);
+ ret = sc_gpio_value_set(test_gpio_handle[15],1);
+ if(ret)
{
- return -1;
+ ALOGE("gpio15 set value 1 error\n");
}
- ret = exec_cmd(Eur_Enable,NULL);
- if(ret < 0)
+ usleep(10000);
+ ret = sc_gpio_value_set(test_gpio_handle[84],1);
+ if(ret)
{
- return -1;
+ ALOGE("gpio84 set value 1 error\n");
}
}
else if(gpio21_value == 0)
{
- ret = exec_cmd(CN_Enable,NULL);
- if(ret < 0)
+ test_gpio_handle[86] = sc_gpio_init(86,1,0,0);
+ ret = sc_gpio_value_set(test_gpio_handle[86],1);
+ if(ret)
{
- return -1;
+ ALOGE("gpio86 set value 1 error\n");
}
}
- char CN_Enable3[128] = "echo '1' > /sys/class/gpio/gpio86/value";
- char Eur_Boot3[128];
- sprintf(Eur_Boot3,"echo 'out' > /sys/class/gpio/gpio%d/direction && echo '1' > /sys/class/gpio/gpio%d/value",eur_boot,eur_boot);
- char Eur_Enable3[128];
- sprintf(Eur_Enable3,"echo 'out' > /sys/class/gpio/gpio%d/direction && echo '1' > /sys/class/gpio/gpio%d/value",eur_enable,eur_enable);
- if(gpio21_value == 1)
- {
- exec_cmd(Eur_Boot3,NULL);
- exec_cmd(Eur_Enable3,NULL);
- exec_cmd(Eur_Boot_unexport,NULL);
- exec_cmd(Eur_Enable_unexport,NULL);
-
- }
- else if(gpio21_value == 0)
- {
- ret = exec_cmd(CN_Enable3,NULL);
- if(ret < 0)
- {
- return -1;
- }
- ret = exec_cmd(CN_Enable_unexport,NULL);
- if(ret < 0)
- {
- return -1;
- }
- }
+ }
+
+ sc_gpio_uninit(test_gpio_handle[21]);
+ test_gpio_handle[21] = NULL;
+ if(gpio21_value == 1)
+ {
+ sc_gpio_uninit(test_gpio_handle[15]);
+ sc_gpio_uninit(test_gpio_handle[84]);
+ test_gpio_handle[15] = NULL;
+ test_gpio_handle[84] = NULL;
+ }
+ else if(gpio21_value == 0)
+ {
+ sc_gpio_uninit(test_gpio_handle[86]);
+ test_gpio_handle[86] = NULL;
}
return 0;
}
@@ -1082,26 +1036,9 @@
}
memset(mbtk_gnss_handle, 0, sizeof(struct mbtk_gnss_handle_t));
memset(&mopen_gnss_device_info, 0, sizeof(mopen_gnss_device_info));
- sleep(1);
lynq_open_gps(0);
mbtk_gnss_handle->dev_fd = mopen_gnss_open(MBTK_GNSS_DEV, 0);
- ret = auto_set_uart_baudrate(mbtk_gnss_handle->dev_fd);
- if(-1 == ret) {
- ret = -2;
- goto err;
- } else if (B9600 == ret) {
- ret = mopen_uart_change(mbtk_gnss_handle->dev_fd, 1);
- if(ret)
- {
- printf("GNSS Uart set B115200 error\n");
- mopen_gnss_close(mbtk_gnss_handle->dev_fd);
- return -1;
- }
- }
-
- printf("Gnss Config Uart Baudrate Successful.\n");
-
mbtk_gnss_handle->rb = (char*)malloc(MBTK_UART_RECV_BUFFER_SIZE);
if(NULL == mbtk_gnss_handle->rb)
{
@@ -1159,7 +1096,6 @@
{
int ret;
struct mbtk_gnss_handle_t *gnss_handle = (struct mbtk_gnss_handle_t *)h_gnss;
-
if(h_gnss == NULL)
{
gnss_log("ARG error or not inited.");
@@ -1187,10 +1123,13 @@
printf("GNSS close init error\n");
return -1;
}
-
firmware_extren_state = 0;
- if (gnss_handle->rb) free(gnss_handle->rb);
- free((void *)h_gnss);
+ if (gnss_handle->rb)
+ {
+ free(gnss_handle->rb);
+ }
+ free(mbtk_gnss_handle);
+ mbtk_gnss_handle = NULL;
return 0;
}
diff --git a/cap/zx297520v3/src/lynq/lib/liblynq-uci/lynq_uci.config b/cap/zx297520v3/src/lynq/lib/liblynq-uci/lynq_uci.config
index c53e44a..b3eb4bc 100755
--- a/cap/zx297520v3/src/lynq/lib/liblynq-uci/lynq_uci.config
+++ b/cap/zx297520v3/src/lynq/lib/liblynq-uci/lynq_uci.config
@@ -27,3 +27,6 @@
config rndis_status 'rndis'
option status '0'
+
+config lynq_led_rw 'lynq_led'
+ option lynq_statusled_on '0'
\ No newline at end of file
diff --git a/cap/zx297520v3/src/lynq/lib/liblynq-uci/src/lynq_uci.c b/cap/zx297520v3/src/lynq/lib/liblynq-uci/src/lynq_uci.c
index b557c08..a50eed1 100755
--- a/cap/zx297520v3/src/lynq/lib/liblynq-uci/src/lynq_uci.c
+++ b/cap/zx297520v3/src/lynq/lib/liblynq-uci/src/lynq_uci.c
@@ -5,7 +5,6 @@
#define UCI_SUPPORT 1
int lynq_del(char *option)
{
- printf("this is lynq uci module,fun:%s,line:%d\n",__FUNCTION__,__LINE__);
#if UCI_SUPPORT
int ret;
char buf[LYNQ_UCI_MAX_LEN];
@@ -30,7 +29,6 @@
#if UCI_SUPPORT
static int uci_get_value(struct uci_option *o, char *out_buf)
{
- printf("this is lynq uci module,fun:%s,line:%d\n",__FUNCTION__,__LINE__);
#if UCI_SUPPORT
struct uci_element *e;
const char *delimiter = " ";
@@ -61,7 +59,6 @@
#endif //#if UCI_SUPPORT
int lynq_uci_get(const char *arg, char *out_buf)
{
- printf("this is lynq uci module,fun:%s,line:%d\n",__FUNCTION__,__LINE__);
#if UCI_SUPPORT
struct uci_context *ctx;
struct uci_element *e;
@@ -115,7 +112,6 @@
int lynq_uci_set(const char *arg)
{
- printf("this is lynq uci module,fun:%s,line:%d\n",__FUNCTION__,__LINE__);
#if UCI_SUPPORT
struct uci_context *ctx;
struct uci_element *e;
@@ -173,7 +169,6 @@
int lynq_add_section(char *section_type, char *section)//rita add @2021.7.30 for adding section
{
- printf("this is lynq uci module,fun:%s,line:%d\n",__FUNCTION__,__LINE__);
#if UCI_SUPPORT
char buf[128] = "";
sprintf(buf,"lynq_uci.%s=%s", section, section_type);
@@ -187,7 +182,6 @@
int lynq_set_value(char *section, char *key, char *value)//rita add @2021.7.30 for setting value
{
- printf("this is lynq uci module,fun:%s,line:%d\n",__FUNCTION__,__LINE__);
#if UCI_SUPPORT
char buf[LYNQ_UCI_MAX_LEN] = "";
@@ -202,7 +196,6 @@
int lynq_get_value(char *file, char *section, char *key, char *tmp)//rita add @2021.7.30 for getting value
{
- printf("this is lynq uci module,fun:%s,line:%d\n",__FUNCTION__,__LINE__);
#if UCI_SUPPORT
char buf[LYNQ_UCI_MAX_LEN] = "";
int ret = 0;
diff --git a/cap/zx297520v3/src/lynq/packages/apps/lynq-led-demo/lynq_led-demo.c b/cap/zx297520v3/src/lynq/packages/apps/lynq-led-demo/lynq_led-demo.c
new file mode 100755
index 0000000..706aa6f
--- /dev/null
+++ b/cap/zx297520v3/src/lynq/packages/apps/lynq-led-demo/lynq_led-demo.c
@@ -0,0 +1,24 @@
+#include <stdio.h>
+#include <strings.h>
+#include<stdlib.h>
+#include <include/lynq_uci.h>
+
+
+
+
+int main(int argc, const char *argv[])
+{
+ int ret = 0;
+ ret = lynq_set_netled_on(1);
+ if(ret){
+ printf("[%s-%d] lynq_set_netled_on error\n", __FUNCTION__, __LINE__);
+ return -1;
+ }
+ ret = lynq_set_statusled_on(1);
+ if(ret){
+ printf("[%s-%d] lynq_set_statusled_on error\n", __FUNCTION__, __LINE__);
+ return -1;
+ }
+
+ return 0;
+}
diff --git a/cap/zx297520v3/src/lynq/packages/apps/lynq-led-demo/makefile b/cap/zx297520v3/src/lynq/packages/apps/lynq-led-demo/makefile
new file mode 100755
index 0000000..bfab13c
--- /dev/null
+++ b/cap/zx297520v3/src/lynq/packages/apps/lynq-led-demo/makefile
@@ -0,0 +1,48 @@
+SHELL = /bin/sh
+RM = rm -f
+
+LOCAL_CFLAGS := -Wall \
+ -g -Os \
+ -flto \
+ -fpermissive \
+ -fPIC \
+
+ifeq ($(strip $(TARGET_PLATFORM)), T106)
+LOCAL_CFLAGS += -DBINDER_IPC_32BIT=1 -DHAVE_ENDIAN_H -DHAVE_PTHREADS -DHAVE_SYS_UIO_H -DHAVE_POSIX_FILEMAP -DHAVE_STRLCPY -DHAVE_PRCTL -DHAVE_MEMSET16 -DHAVE_MEMSET32 -DANDROID_SMP=0
+endif
+
+LOCAL_CFLAGS += -DLYNQ_SW_INSIDE_VERSION=\"$(LYNQ_CONFIG_VERSION)\"
+LOCAL_CFLAGS += -DLYNQ_SW_VERSION=\"$(LYNQ_CONFIG_SW_VERSION)\"
+
+LOCAL_PATH = .
+
+LOCAL_C_INCLUDES = \
+ -I. \
+
+
+
+
+
+LOCAL_LIBS := \
+ -L. \
+ -ldl \
+ -lpthread \
+ -llynq-uci \
+ -llynq-led \
+
+SOURCES = $(wildcard *.c)
+
+EXECUTABLE = lynq-led-demo
+
+OBJECTS=$(SOURCES:.c=.o)
+all: $(EXECUTABLE)
+
+$(EXECUTABLE): $(OBJECTS)
+ $(CXX) $(OBJECTS) $(LOCAL_LIBS) $(LOCAL_CFLAGS) $(LOCAL_C_INCLUDES) -o $@
+
+%.o : %.c
+ $(CC) $(LOCAL_C_INCLUDES) $(LOCAL_CFLAGS) $(LOCAL_LIBS) -o $@ -c $<
+
+.PHONY: clean
+clean:
+ $(RM) $(OBJECTS) $(EXECUTABLE)
diff --git a/cap/zx297520v3/zxic_code/zxic_source/linux-5.10/arch/arm/boot/dts/zx297520v3.dtsi b/cap/zx297520v3/zxic_code/zxic_source/linux-5.10/arch/arm/boot/dts/zx297520v3.dtsi
index f8adc55..b5d4bc6 100755
--- a/cap/zx297520v3/zxic_code/zxic_source/linux-5.10/arch/arm/boot/dts/zx297520v3.dtsi
+++ b/cap/zx297520v3/zxic_code/zxic_source/linux-5.10/arch/arm/boot/dts/zx297520v3.dtsi
@@ -596,13 +596,13 @@
/* interrupts: */
interrupts = <GIC_SPI SD1_INT IRQ_TYPE_LEVEL_HIGH>,
- <GIC_SPI SD1_DATA1_INT IRQ_TYPE_LEVEL_HIGH>/*,
- <GIC_SPI EX4_INT IRQ_TYPE_LEVEL_HIGH>*/; //jb.qi change for irq 4 fail
+ <GIC_SPI SD1_DATA1_INT IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI EX4_INT IRQ_TYPE_LEVEL_HIGH>;
clocks = <&clkc SD1_WCLK>, <&clkc SD1_HCLK>, <&clkc SD1_CDET>;
clock-names = "ciu", "biu","mmc_cdet";
//cd-gpios = <&bgpio 51 GPIO_ACTIVE_LOW>;
- gpios = /*<&bgpio 51 GPIO_ACTIVE_LOW>,*/<&bgpio 85 GPIO_ACTIVE_LOW>;//jb.qi add for irq 4 fail
+ gpios = <&bgpio 51 GPIO_ACTIVE_LOW>,<&bgpio 85 GPIO_ACTIVE_LOW>;//cd ,emmc en
pinctrl-names = "mmc_pins" ,"mmc_cd_int","mmc_cd_gpio","mmc_vcc_en";
pinctrl-0 = <&sd1_sd1>;
pinctrl-1 = <&sd1_cd_int>;
diff --git a/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/platform/zlog_agent/cap_logagt_main.c b/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/platform/zlog_agent/cap_logagt_main.c
index 92de043..370862b 100755
--- a/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/platform/zlog_agent/cap_logagt_main.c
+++ b/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/platform/zlog_agent/cap_logagt_main.c
@@ -191,7 +191,7 @@
gLogSaveParam.max_total_size = msgdata->max_total_size;
gLogSaveParam.max_file_size = (msgdata->max_total_size) / (msgdata->max_file_num);
snprintf(nvstr_num, char_len, "%d", msgdata->max_file_num);
- snprintf(nvstr_size, char_len, "%llu", msgdata->max_total_size);
+ snprintf(nvstr_size, char_len, "%llu", msgdata->max_total_size /ZCAT_ONE_MB_SIZE); //jb.qi change for cant sleep on 20231016
sc_cfg_set("zlog_num", nvstr_num);
sc_cfg_set("zlog_size",nvstr_size);
sc_cfg_save();
@@ -328,21 +328,22 @@
zLogAgt_initCapNetMode();
}
else
+ { /*jb.qi change for cant sleep on 20231016 start*/
+ printf("[zlog-agent] g_log_dir is %d\n", g_log_dir);
+ }
+ if((g_log_dir ==ZCAT_MODE_CAP_FS) || (g_log_dir == ZCAT_MODE_CAP_NET))
{
- /*µÈ´ýzlog_nvctrlÉèÖÃzcatģʽ*/
- sleep(10);
- }
+ zLogAgt_initCapTools();
- zLogAgt_initCapTools();
-
- ret = pthread_create(&read_aplog_thread, NULL, cap_read_aplog, NULL);
- if(ret != 0) {
- goto __exit;
- }
- ret = pthread_create(&icp_wakeup_thread, NULL, cap_open_wakeup, NULL);
- if(ret != 0) {
- goto __exit;
- }
+ ret = pthread_create(&read_aplog_thread, NULL, cap_read_aplog, NULL);
+ if(ret != 0) {
+ goto __exit;
+ }
+ ret = pthread_create(&icp_wakeup_thread, NULL, cap_open_wakeup, NULL);
+ if(ret != 0) {
+ goto __exit;
+ }
+ }/*jb.qi change for cant sleep on 20231016 end*/
g_log_state = ZCAT_STATE_RUNNING;
__exit:
diff --git a/update_version.sh b/update_version.sh
index e7bbf67..6f5cc49 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.07"
-LYNQ_CAP_INSIDE_VERSION="CAP.08.07"
-LYNQ_CAP_VERSION="CAP.08.07"
+LYNQ_AP_VERSION="T106CN-ZS03.V2.01.01.02P50U04.AP.08.09"
+LYNQ_CAP_INSIDE_VERSION="CAP.08.09"
+LYNQ_CAP_VERSION="CAP.08.09"
COMMIT_ID="$(git rev-parse HEAD)"
LYNQ_SW_INSIDE_VERSION="LYNQ_CONFIG_VERSION = \"${LYNQ_AP_VERSION}_${LYNQ_CAP_INSIDE_VERSION}\""