[Bugfix][SZZT-83][Factory-test]The low-power test is unstable. The time of sleep success needs to be optimized, and the flag bit of sleep success needs to be added or other ways to mark sleep success.
Change-Id: Id83c317b5ab113ab20c36226fdd3d1e639355c7a
diff --git a/meta/meta-mediatek-mt2731/recipes-lynq/lynq-low-power/lynq-low-power.bb b/meta/meta-mediatek-mt2731/recipes-lynq/lynq-low-power/lynq-low-power.bb
index 53af55c..835cdd6 100755
--- a/meta/meta-mediatek-mt2731/recipes-lynq/lynq-low-power/lynq-low-power.bb
+++ b/meta/meta-mediatek-mt2731/recipes-lynq/lynq-low-power/lynq-low-power.bb
@@ -3,12 +3,12 @@
DESCRIPTION = "function test"
LICENSE = "CLOSED"
LIC_FILES_CHKSUM = "file://LICENSE;md5=e1696b147d49d491bcb4da1a57173fff"
-DEPENDS += "platform-libs liblynq-sim"
+DEPENDS += "platform-libs"
inherit workonsrc
WORKONSRC = "${TOPDIR}/../src/lynq/packages/apps/lynq-low-power/src"
TARGET_CC_ARCH += "${LDFLAGS}"
-
+FILES_${PN} = "/data/ ${bindir}"
#Parameters passed to do_compile()
EXTRA_OEMAKE = "'RAT_CONFIG_C2K_SUPPORT = ${RAT_CONFIG_C2K_SUPPORT}'\
'MTK_MULTI_SIM_SUPPORT = ${MTK_MULTI_SIM_SUPPORT}'\
@@ -26,5 +26,6 @@
do_install() {
install -d ${D}${bindir}/
install -m 0755 ${S}/lynq-low-power ${D}${bindir}/
- install -d ${D}${includedir}
+ install -d ${D}/data/
+ cp -R ${S}/lynq-low-power.sh ${D}/data/
}
diff --git a/src/lynq/packages/apps/lynq-low-power/src/lynq-low-power.sh b/src/lynq/packages/apps/lynq-low-power/src/lynq-low-power.sh
new file mode 100755
index 0000000..0c85199
--- /dev/null
+++ b/src/lynq/packages/apps/lynq-low-power/src/lynq-low-power.sh
@@ -0,0 +1,15 @@
+
+#bin/sh
+telephony &
+sleep 3
+echo 11 | emdlogger_ctrl
+mdlogctl stop
+echo 0 > /dev/wmtWifi
+echo 7 9 0 > /proc/driver/wmt_dbg
+sh /usr/bin/demoscript/DSDS/set_default_sim_all_except_data.sh 1
+sleep 1
+sh /usr/bin/demoscript/Network_API/RadioOn.sh 0
+sh /usr/bin/demoscript/DSDS/set_default_sim_all_except_data.sh 0
+sleep 1
+sh /usr/bin/demoscript/Network_API/RadioOn.sh 0
+echo mem > /sys/power/autosleep
diff --git a/src/lynq/packages/apps/lynq-low-power/src/main.cpp b/src/lynq/packages/apps/lynq-low-power/src/main.cpp
index 4b057b6..bcf340c 100755
--- a/src/lynq/packages/apps/lynq-low-power/src/main.cpp
+++ b/src/lynq/packages/apps/lynq-low-power/src/main.cpp
@@ -1,36 +1,22 @@
+
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
-#include <include/lynq_sim.h>
#ifdef __cplusplus
extern "C" {
#endif
-
/**
* @brief only for factory test:flight mode
*
* @return int
*/
-
int main(void){
- lynq_sim_init(2022);
- system("echo 11 | emdlogger_ctrl");
+ system("ps -ef | grep \'lynq-atsvc\' | grep -v grep | awk \'{print $2}\' | xargs kill -s SIGINT");
sleep(1);
- system("mdlogctl stop");
- system("echo 0 > /dev/wmtWifi");
- system("echo 7 9 0 > /proc/driver/wmt_dbg");
- sleep(1);
- lynq_switch_card(1);
- sleep(1);
- lynq_factory_radio(0);
- sleep(3);
- lynq_switch_card(0);
- sleep(1);
- lynq_factory_radio(0);
- sleep(3);
- system("echo mem > /sys/power/autosleep");
+ system("echo \"Sys flight mode\" >/dev/console");
+ system("source /data/lynq-low-power.sh");
return 0;
}
#ifdef __cplusplus
}
-#endif
\ No newline at end of file
+#endif
diff --git a/src/lynq/packages/apps/lynq-low-power/src/makefile b/src/lynq/packages/apps/lynq-low-power/src/makefile
index 44a4021..e7ac063 100755
--- a/src/lynq/packages/apps/lynq-low-power/src/makefile
+++ b/src/lynq/packages/apps/lynq-low-power/src/makefile
@@ -47,7 +47,6 @@
-I. \
-I$(LOCAL_PATH) \
-I$(ROOT)$(includedir)/ \
- -I$(ROOT)$(includedir)/include \
-DLIB_GNSS_HAL_DIR='"$(libdir)"'
LOCAL_C_INCLUDES+=$(DNS_FLAGS)
@@ -60,9 +59,7 @@
-lcutils \
-lutils \
-lbinder \
- -llynq-log \
-lpthread \
- -llynq-sim \
LOCAL_SRC_FILES_CPP = $(wildcard *.cpp gpio/*.cpp ril/*.cpp)
LOCAL_SRC_FILES_C = $(wildcard *.c gps/*.c)