Merge "[Feature][ZXW-136]merge P50U04 version"
diff --git a/ap/app/zte_comm/zte_drv_ctrl/usb/zte_drv_usb_ctrl.c b/ap/app/zte_comm/zte_drv_ctrl/usb/zte_drv_usb_ctrl.c
index d266663..35154d0 100755
--- a/ap/app/zte_comm/zte_drv_ctrl/usb/zte_drv_usb_ctrl.c
+++ b/ap/app/zte_comm/zte_drv_ctrl/usb/zte_drv_usb_ctrl.c
@@ -1819,6 +1819,74 @@
return 0;
}
+/*jb.qi add for usb wakelock on 20230918 start*/
+#define RPMSG_IOC_MAGIC 'R'
+
+/*ioctl cmd usd by device*/
+#define RPMSG_CREATE_CHANNEL _IOW(RPMSG_IOC_MAGIC, 1, char *)
+#define RPMSG_GET_DATASIZE _IOWR(RPMSG_IOC_MAGIC, 2, char *)
+#define RPMSG_SET_INT _IOW(RPMSG_IOC_MAGIC, 3, char *)
+#define RPMSG_SET_INT_FLAG _IOW(RPMSG_IOC_MAGIC, 4, char *)
+#define RPMSG_CLEAR_INT_FLAG _IOW(RPMSG_IOC_MAGIC, 5, char *)
+#define RPMSG_SET_POLL_FLAG _IOW(RPMSG_IOC_MAGIC, 6, char *)
+#define RPMSG_CLEAR_POLL_FLAG _IOW(RPMSG_IOC_MAGIC, 7, char *)
+
+#define USB_PLUG_WAKE_CAP_DEV "/dev/rpmsg50"
+
+int usbplug_fd = -1;
+
+int usbplug_icp_init(void)
+{
+ usbplug_fd = open(USB_PLUG_WAKE_CAP_DEV, O_RDWR);
+
+ if(0 > usbplug_fd){
+ printf("%s: open the channel(%s) error!\n", __func__, USB_PLUG_WAKE_CAP_DEV);
+ return -1;
+ }
+
+ if(0 > ioctl(usbplug_fd, RPMSG_CREATE_CHANNEL, 64)){
+ printf("%s: ioctl RPMSG_CREATE_CHANNEL fail!\n", __func__);
+ close(usbplug_fd);
+ usbplug_fd = -1;
+ return -1;
+ }
+
+ if(0 > ioctl(usbplug_fd, RPMSG_SET_INT_FLAG, NULL)){ //¿¿¿
+ printf("%s: ioctl RPMSG_SET_INT_FLAG fail!\n", __func__);
+ close(usbplug_fd);
+ usbplug_fd = -1;
+ return -1;
+ }
+
+ printf("yanming %s create success!\n",__func__);
+
+ return 0;
+}
+
+int usbplug_rpmsg_send(int value)
+{
+ int write_len = 0;
+ char usbplug_in[20]="usbplug_in";
+ char usbplug_out[20]="usbplug_out";
+
+ printf("yanming usbplug_rpmsg_send value:%d\n",value);
+
+ if(value == 1){
+ write_len = write(usbplug_fd, usbplug_in, sizeof(usbplug_in));
+ }
+
+ if(value == 0){
+ write_len = write(usbplug_fd, usbplug_out, sizeof(usbplug_out));
+ }
+
+ if(write_len <0){
+ printf("yanming usbplug rpmsg write FAIL\n");
+ close(usbplug_fd);
+ }
+
+ return write_len;
+}
+/*jb.qi add for usb wakelock on 20230918 end*/
/*usbÈȰβåʼþ´¦Àí*/
int usb_event_proc(unsigned short usb_msg, int usb_event)
@@ -1850,6 +1918,7 @@
{
slog(USBCFGMNG_PRINT,SLOG_NORMAL, "[usbCfgMng] usb charger plugin \n");
}
+ usbplug_rpmsg_send(1);//jb.qi add for usb wakelock on 20230918
break;
case MSG_CMD_DRV_USB_REMOVE:
/*°Î³öʼþ´¦Àí*/
@@ -1867,6 +1936,7 @@
{
slog(USBCFGMNG_PRINT,SLOG_NORMAL, "[usbCfgMng] usb charger plugOut \n");
}
+ usbplug_rpmsg_send(0);//jb.qi add for usb wakelock on 20230918
break;
default:
break;
@@ -2020,6 +2090,15 @@
slog(USBCFGMNG_PRINT,SLOG_ERR, "[usbCfgMng] warning: readfile %s fail \n", USB_PLUG_FILE_NAME);
return -1;
}
+ /*jb.qi add for usb wakelock on 20230918 start*/
+ printf("usbPlugtype:%d\n",usbPlugtype);
+ if(usbPlugtype == 1)
+ sc_cfg_set("usbplug_nv","1");
+
+ if(usbPlugtype == 0)
+ sc_cfg_set("usbplug_nv","0");
+ usbplug_icp_init();
+ /*jb.qi add for usb wakelock on 20230918 end*/
usb_usbCfgMngInit(usbPlugtype);
if (usbPlugtype == 1 && cp_need_udisk == 1)
usb_sendUsbOperateRlt(2);
diff --git a/ap/os/linux/linux-3.4.x/drivers/usb/dwc_otg/dwc_otg_chg_identify.c b/ap/os/linux/linux-3.4.x/drivers/usb/dwc_otg/dwc_otg_chg_identify.c
index 82f129a..a0057aa 100755
--- a/ap/os/linux/linux-3.4.x/drivers/usb/dwc_otg/dwc_otg_chg_identify.c
+++ b/ap/os/linux/linux-3.4.x/drivers/usb/dwc_otg/dwc_otg_chg_identify.c
@@ -184,7 +184,7 @@
//for mdl,enum usb when poweron,maybe no gpio detect
#ifndef _USE_VEHICLE_DC_REF
- return 1;
+ //return 1; jb.qi add for usb wakelock on 20230918
#else
//others ,depends gpio detect
return usb_plugin;
@@ -396,7 +396,7 @@
DWC_WRITE_REG32(core_if->pcgcctl, 0);
/* Device configuration register */
- init_chg_devspd(core_if,0);//ĬÈÏÅäÖóɸßËÙ
+ init_chg_devspd(core_if,0);//Ĭ\C8\CF\C5\E4\D6óɸ\DF\CB\D9
dcfg.d32 = DWC_READ_REG32(&dev_if->dev_global_regs->dcfg);
dcfg.b.descdma = 0;
dcfg.b.perfrint = DWC_DCFG_FRAME_INTERVAL_80;
@@ -633,7 +633,7 @@
case DWC_SLAVE_ONLY_ARCH:
//ahbcfg.b.nptxfemplvl_txfemplvl = DWC_GAHBCFG_TXFEMPTYLVL_HALFEMPTY;
- // ÅäÖÃÈ«¿ÕFIFO²úÉúÖжÏ
+ // \C5\E4\D6\C3ȫ\BF\D5FIFO\B2\FA\C9\FA\D6ж\CF
ahbcfg.b.nptxfemplvl_txfemplvl = DWC_GAHBCFG_TXFEMPTYLVL_EMPTY ;
ahbcfg.b.ptxfemplvl = DWC_GAHBCFG_TXFEMPTYLVL_HALFEMPTY;
core_if->dma_enable = 0;
@@ -688,7 +688,7 @@
ahbcfg.b.dmaenable = 0;
-// ÅäÖÃÈ«¿ÕFIFO²úÉúÖжÏ
+// \C5\E4\D6\C3ȫ\BF\D5FIFO\B2\FA\C9\FA\D6ж\CF
ahbcfg.b.nptxfemplvl_txfemplvl = DWC_GAHBCFG_TXFEMPTYLVL_EMPTY ;
#endif
@@ -1047,8 +1047,8 @@
extern unsigned int get_usb_gpio_detect_flag(void);
//wangzhen
extern int dwc_otg_disconnect(void);
-/*GPIOºÍÍⲿÖжϺŸù¾ÝÏîĿʵ¼ÊÇé¿öÐÞ¸Ä
- *´Ë´¦Îª²Î¿¼´úÂë
+/*GPIO\BA\CD\CDⲿ\D6жϺŸ\F9\BE\DD\CF\EEĿʵ\BC\CA\C7\E9\BF\F6\D0\C4
+ *\B4˴\A6Ϊ\B2ο\BC\B4\FA\C2\EB
*/
//xf.li@20230909 modify for usb hot-plug start
#ifdef _USE_VEHICLE_DC_REF
@@ -1254,4 +1254,4 @@
module_init(usb_detect_init);
-#endif
\ No newline at end of file
+#endif
diff --git a/cap/zx297520v3/src/lynq/packages/apps/lynq-qser-autosuspend-demo/LICENSE b/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-qser-autosuspend-demo/files/LICENSE
similarity index 100%
rename from cap/zx297520v3/src/lynq/packages/apps/lynq-qser-autosuspend-demo/LICENSE
rename to cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-qser-autosuspend-demo/files/LICENSE
diff --git a/cap/zx297520v3/src/lynq/packages/apps/lynq-qser-autosuspend-demo/lynq-qser-autosuspend-demo.c b/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-qser-autosuspend-demo/files/lynq-qser-autosuspend-demo.cpp
similarity index 66%
rename from cap/zx297520v3/src/lynq/packages/apps/lynq-qser-autosuspend-demo/lynq-qser-autosuspend-demo.c
rename to cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-qser-autosuspend-demo/files/lynq-qser-autosuspend-demo.cpp
index 6c1b489..4c661e0 100755
--- a/cap/zx297520v3/src/lynq/packages/apps/lynq-qser-autosuspend-demo/lynq-qser-autosuspend-demo.c
+++ b/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-qser-autosuspend-demo/files/lynq-qser-autosuspend-demo.cpp
@@ -7,86 +7,12 @@
#include <dlfcn.h>
#include <errno.h>
#include <fcntl.h>
-
+#include <include/lynq-qser-autosuspend.h>
#define FILE_LOCK_TABLE "/tmp/.lock_table"
-void *dlHandle_wakelock;
-
-int (*qser_lpm_deinit)(void);
-int (*qser_autosuspend_enable)(char enable);
-int (*qser_wakelock_create)(const char *value, size_t len);
-int (*qser_wakelock_lock)(int fd);
-int (*qser_wakelock_unlock)(int fd);
-int (*qser_wakelock_destroy)(int fd);
-
#define MAX_LOCK_NUM 128
-typedef struct
-{
- char lock_name[MAX_LOCK_NUM][64];
-} LOCK_TABLE;
-
-void init_autosuspend_func(void)
-{
-
- const char *lynqLibPath_WakeLock = "/lib/liblynq-qser-autosuspend.so";
-
-
- dlHandle_wakelock = dlopen(lynqLibPath_WakeLock, RTLD_NOW);
- if (dlHandle_wakelock == NULL)
- {
- printf("dlopen lynqLibPath_WakeLock failed: %s", dlerror());
- exit(EXIT_FAILURE);
- }
-
- qser_lpm_deinit = (int(*)(void))dlsym(dlHandle_wakelock, "qser_lpm_deinit");
- if (qser_lpm_deinit == NULL)
- {
- printf("qser_lpm_deinit not defined or exported in %s", lynqLibPath_WakeLock);
- exit(EXIT_FAILURE);
- }
-
- qser_autosuspend_enable = (int(*)(char))dlsym(dlHandle_wakelock, "qser_autosuspend_enable");
- if (qser_autosuspend_enable == NULL)
- {
- printf("qser_autosuspend_enable not defined or exported in %s", lynqLibPath_WakeLock);
- exit(EXIT_FAILURE);
- }
-
- qser_wakelock_create = (int(*)(const char *value, size_t len))dlsym(dlHandle_wakelock, "qser_wakelock_create");
- if (qser_wakelock_create == NULL)
- {
- printf("qser_wakelock_create not defined or exported in %s", lynqLibPath_WakeLock);
- exit(EXIT_FAILURE);
- }
-
- qser_wakelock_lock = (int(*)(int))dlsym(dlHandle_wakelock, "qser_wakelock_lock");
- if (qser_wakelock_lock == NULL)
- {
- printf("qser_wakelock_lock not defined or exported in %s", lynqLibPath_WakeLock);
- exit(EXIT_FAILURE);
- }
-
- qser_wakelock_unlock = (int(*)(int))dlsym(dlHandle_wakelock, "qser_wakelock_unlock");
- if (qser_wakelock_unlock == NULL)
- {
- printf("qser_wakelock_unlock not defined or exported in %s", lynqLibPath_WakeLock);
- exit(EXIT_FAILURE);
- }
-
- qser_wakelock_destroy = (int(*)(int))dlsym(dlHandle_wakelock, "qser_wakelock_destroy");
- if (qser_wakelock_destroy == NULL)
- {
- printf("qser_wakelock_unlock not defined or exported in %s", lynqLibPath_WakeLock);
- exit(EXIT_FAILURE);
- }
-
- dlerror(); // Clear any previous dlerror
-
- return;
-}
-
int check_lock(void)
{
@@ -106,17 +32,19 @@
memset(&lock_status, 0, sizeof(lock_status));
lseek(file_fd,0,SEEK_SET);
ret = read(file_fd,(unsigned char *)&lock_status,sizeof(lock_status));
- for(i=0;i<128;i++)
+ if(ret <= 0)
+ {
+ close(file_fd);
+ return -2;
+ }
+ for(i=0;i<MAX_LOCK_NUM;i++)
{
if(strlen(lock_status.lock_name[i]) != 0)
{
printf("fd: %d lock_name:%s strlen:%d\n", i, lock_status.lock_name[i], strlen(lock_status.lock_name[i]));
}
}
- if(ret <= 0)
- {
- return -2;
- }
+
close(file_fd);
return 0;
@@ -128,7 +56,7 @@
int num;
int ret;
int len;
- init_autosuspend_func();
+
if(argc < 2)
{
printf("wrong input format, please -h \n");
diff --git a/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-qser-autosuspend-demo/files/makefile b/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-qser-autosuspend-demo/files/makefile
new file mode 100755
index 0000000..c51d5a0
--- /dev/null
+++ b/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-qser-autosuspend-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-qser-autosuspend \
+
+
+
+SOURCES = lynq-qser-autosuspend-demo.cpp
+
+EXECUTABLE = lynq-qser-autosuspend-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-qser-autosuspend-demo/lynq-qser-autosuspend-demo.bb b/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-qser-autosuspend-demo/lynq-qser-autosuspend-demo.bb
index ab8d052..d1ec3ae 100644
--- a/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-qser-autosuspend-demo/lynq-qser-autosuspend-demo.bb
+++ b/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-qser-autosuspend-demo/lynq-qser-autosuspend-demo.bb
@@ -1,40 +1,31 @@
-inherit externalsrc package
-DESCRIPTION = "autosuspend-client demo"
-
-LICENSE = "MobileTekProprietary"
-LIC_FILES_CHKSUM = "file://LICENSE;md5=4f60c98fa94e02f659ef5939f67fa8ae"
-#DEPENDS = "platform-libs"
-
-
-inherit workonsrc
-WORKONSRC = "${TOPDIR}/../src/lynq/packages/apps/lynq-qser-autosuspend-demo"
-FILESEXTRAPATHS_prepend :="${TOPDIR}/../src/lynq/packages/apps:"
-SRC_URI = " \
- file://lynq-qser-autosuspend-demo \
- "
+#inherit externalsrc package
+#inherit externalsrc package systemd
+DESCRIPTION = "lynq-qser-autosuspend-demo"
+LICENSE = "CLOSED"
+LICENSE = "CLOSED"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=b1e07e8d88e26263e71d3a9e2aa9a2ff"
+SRC_URI = "file://lynq-qser-autosuspend-demo.cpp \
+ file://makefile \
+"
+DEPENDS += "liblynq-qser-autosuspend"
SRC-DIR = "${S}/../lynq-qser-autosuspend-demo"
+FILES_${PN} += "${bindir}/"
TARGET_CC_ARCH += "${LDFLAGS}"
-
SYSTEMD_PACKAGES = "${PN}"
-#Parameters passed to do_compile()
-EXTRA_OEMAKE = "'TARGET_PLATFORM = ${TARGET_PLATFORM}'\"
-EXTRA_OEMAKE += "'MOBILETEK_RIL_CFG = ${MOBILETEK_RIL_CFG}'"
-
-EXTRA_OEMAKE += "'MOBILETEK_FOTA_CFG = ${MOBILETEK_FOTA_CFG}'"
-
+S = "${WORKDIR}"
#INHIBIT_PACKAGE_STRIP = "1"
do_compile () {
if test "${PACKAGE_ARCH}" = "cortexa7hf-vfp-vfpv4-neon" || test "${PACKAGE_ARCH}" = "cortexa7hf-neon-vfpv4"; then
- oe_runmake all -C ${SRC-DIR} ROOT=${STAGING_DIR_HOST} OFLAGS="--sysroot=${STAGING_DIR_HOST} -mhard-float"
+ oe_runmake all ROOT=${STAGING_DIR_HOST} OFLAGS="--sysroot=${STAGING_DIR_HOST} -mhard-float"
else
- oe_runmake all -C ${SRC-DIR} ROOT=${STAGING_DIR_HOST} OFLAGS="--sysroot=${STAGING_DIR_HOST}"
+ oe_runmake all ROOT=${STAGING_DIR_HOST} OFLAGS="--sysroot=${STAGING_DIR_HOST}"
fi
}
do_install() {
+
install -d ${D}${bindir}/
- install -m 0755 ${SRC-DIR}/lynq-qser-autosuspend-demo ${D}${bindir}/
- install -d ${D}${includedir}
+ install -m 0755 ${S}/lynq-qser-autosuspend-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 16be058..7e4c03c 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
@@ -6,6 +6,7 @@
#include <unistd.h>
#include <dlfcn.h>
#include <stdint.h>
+#include <ctype.h>
#include"lynq-qser-sms-demo.h"
@@ -28,260 +29,156 @@
int (*qser_sms_getsmscenteraddress)(sms_client_handle_type h_sms, QSER_sms_service_center_cfg_t *set_sca_cfg);
int (*qser_sms_setsmscenteraddress)(sms_client_handle_type h_sms, QSER_sms_service_center_cfg_t *get_sca_cfg);
-
-typedef struct
-{
- int cmdIdx;
- const char *funcName;
-} st_api_test_case;
-
-//for server test
-st_api_test_case at_api_testcases[] =
-{
- {0, "qser_sms_client_init"},
- {1, "qser_sms_client_deinit"},
- {2, "qser_sms_send_sms"},
- {3, "qser_sms_addrxmsghandler"},
- {4, "qser_sms_deletefromstorage"},
- {5, "qser_sms_getsmscenteraddress"},
- {6, "qser_sms_setsmscenteraddress"},
- {-1, NULL}
-};
-
-void print_help(void)
-{
- int i;
- printf("Supported test cases:\n");
- for(i = 0; ; i++)
- {
- if(at_api_testcases[i].cmdIdx == -1)
- {
- break;
- }
- printf("%d:\t%s\n", at_api_testcases[i].cmdIdx, at_api_testcases[i].funcName);
- }
-}
-
void qser_sms_handler(QSER_SMS_MsgRef msgRef, void* contextPtr) {
printf("[%s-%d] sms handler, msgRef->sms_data = %s\n", __FUNCTION__, __LINE__, msgRef->sms_data);
}
+bool isNumeric(char *phnum) {
+ int length = strlen(phnum);
+
+ if (length == 0) {
+ return false;
+ }
+
+ if (phnum[0] != '+' && (phnum[0] < '0' || phnum[0] > '9')) {
+ return false;
+ }
+
+ if (phnum[0] == '+' && length < 3) {
+ return false;
+ }
+
+ for (int i = 1; i < length; i++) {
+ if (phnum[i] < '0' || phnum[i] > '9') {
+ return false;
+ }
+ }
+
+ return true;
+}
+
+//以下示例默认为所有API 执行都æˆåŠŸçš„æƒ…å†µä¸‹ï¼Œä¾æ¬¡æ‰§è¡ŒåŽç»API
int main(int argc, char *argv[])
{
- int cmdIdx = 0;
int ret = 0;
-
+ //char phnum[SMS_BUF]={0};
+
const char *lynq_libpath_sms = "/lib/liblynq-qser-sms.so";
void *dlHandle_sms = dlopen(lynq_libpath_sms, RTLD_NOW);
+
if (dlHandle_sms == NULL)
{
printf("dlopen dlHandle_sms failed: %s\n", dlerror());
exit(EXIT_FAILURE);
}
- print_help();
- while(1)
+ if(argc != 2 || !isNumeric(argv[1]))
{
- printf("\nplease input cmd index(-1 exit): ");
- scanf("%d", &cmdIdx);
- if(cmdIdx == -1)
- {
- break;
- }
-
- switch(cmdIdx)
- {
- //"qser_sms_client_init"
- case 0:
- {
- if(flag_init == 1)
- {
- printf("init is already\n");
- break;
- }
- else{
- //int token;
- printf("input token\n");
- //scanf("%d", &token);
-
- qser_sms_client_init = (int(*)(sms_client_handle_type *ph_sms))dlsym(dlHandle_sms,"qser_sms_client_init");
- if(NULL != qser_sms_client_init)
- {
- ret = qser_sms_client_init(&ph_sms);
- if(ret == 0)
- {
- printf("Run qser_sms_client_init\n");
- flag_init = 1;
- }else{
- printf("qser_sim_client_init error\n");
- }
- }else{
- printf("qser_sim_client_init dlsym error\n");
- }
- break;
- }
- }
- //"qser_sms_client_deinit"
- case 1:
- {
- if(flag_init == 0){
- printf("must init first\n");
- }
- else{
- qser_sms_client_deinit = (int (*)(sms_client_handle_type h_sms))dlsym(dlHandle_sms,"qser_sms_client_deinit");
- if(NULL != qser_sms_client_deinit)
- {
- ret = qser_sms_client_deinit(h_sms);
- if(ret == 0)
- {
- printf("sms deinit success");
- }else{
- printf("sms deinit error, ret = %d\n", ret);
- }
- }else{
- printf("qser_sms_client_deinit dlsym error\n");
- }
- }
- break;
- }
- //"qser_sms_send_sms"
- case 2:
- {
- if(flag_init == 0){
- printf("must init first\n");
- }
- else{
- char telephony_num[SMS_BUF] = {};
- char msg[MSG_BUF] = {};
- QSER_sms_info_t pt_sms_info;
- sprintf(telephony_num,"10086");
- sprintf(msg,"hello");
- strncpy(pt_sms_info.src_addr, telephony_num, SMS_BUF);
- strncpy(pt_sms_info.sms_data, msg, MSG_BUF);
- pt_sms_info.format = QSER_SMS_8BIT;
- 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);
-
- qser_sms_send_sms = (int (*)(sms_client_handle_type h_sms, QSER_sms_info_t *pt_sms_info))dlsym(dlHandle_sms,"qser_sms_send_sms");
- if(NULL != qser_sms_send_sms)
- {
- ret = qser_sms_send_sms(h_sms, &pt_sms_info);
- if(ret == 0)
- {
- printf("send sms success");
- }else{
- printf("send sms error, ret = %d\n", ret);
- }
- }else{
- printf("qser_sms_send_sms dlsym error\n");
- }
- }
- break;
- }
- //"qser_sms_addrxmsghandler"
- case 3:
- {
- if(flag_init == 0){
- printf("must init first\n");
- }
- else{
-
- qser_sms_addrxmsghandler = (int(*)(QSER_SMS_RxMsgHandlerFunc_t handlerPtr, void* contextPtr))dlsym(dlHandle_sms,"qser_sms_addrxmsghandler");
-
- if(NULL != qser_sms_addrxmsghandler)
- {
- ret = qser_sms_addrxmsghandler(qser_sms_handler, NULL);
- if(ret == 0)
- {
- printf("qser_sms_addrxmsghandler success");
- }else{
- printf("qser_sms_addrxmsghandler error, ret = %d\n", ret);
- }
- }else{
- printf("qser_sms_addrxmsghandler dlsym error\n");
- }
- }
- break;
- }
- //"qser_sms_deletefromstorage"
- case 4:
- {
- if(flag_init == 0){
- printf("must init first\n");
- }
- else{
- QSER_sms_storage_info_t pt_sms_storage;
- pt_sms_storage.storage_idx = 1;
- qser_sms_deletefromstorage = (int (*)(sms_client_handle_type h_sms, QSER_sms_storage_info_t *pt_sms_storage))dlsym(dlHandle_sms,"qser_sms_deletefromstorage");
- if(NULL != qser_sms_deletefromstorage)
- {
- ret = qser_sms_deletefromstorage(h_sms, &pt_sms_storage);
- if(ret == 0)
- {
- printf("ret= %d\n",ret);
- }else{
- printf("del sms error, ret = %d\n", ret);
- }
- }else{
- printf("qser_sms_deletefromstorage dlsym error\n");
- }
- }
- break;
- }
- //"qser_sms_getsmscenteraddress"
- case 5:
- {
- if(flag_init == 0){
- printf("must init first\n");
- }
- else{
- QSER_sms_service_center_cfg_t get_sca_cfg;
- qser_sms_getsmscenteraddress = (int (*)(sms_client_handle_type h_sms, QSER_sms_service_center_cfg_t *get_sca_cfg))dlsym(dlHandle_sms,"qser_sms_getsmscenteraddress");
- if(NULL != qser_sms_getsmscenteraddress)
- {
- ret = qser_sms_getsmscenteraddress(h_sms, &get_sca_cfg);
- if(ret == 0)
- {
- printf("get smsc success,service_center_addr = %s\n",get_sca_cfg.service_center_addr);
- }else{
- printf("get smsc error, ret = %d\n", ret);
- }
- }else{
- printf("qser_sms_getsmscenteraddress dlsym error\n");
- }
- }
- break;
- }
- //"qser_sms_setsmscenteraddress"
- case 6:
- {
- if(flag_init == 0){
- printf("must init first\n");
- }
- else{
- QSER_sms_service_center_cfg_t set_sca_cfg;
- strncpy(set_sca_cfg.service_center_addr, "+8613800230500", 14);
- qser_sms_setsmscenteraddress = (int (*)(sms_client_handle_type h_sms, QSER_sms_service_center_cfg_t *set_sca_cfg))dlsym(dlHandle_sms,"qser_sms_setsmscenteraddress");
- if(NULL != qser_sms_setsmscenteraddress)
- {
- ret = qser_sms_setsmscenteraddress(h_sms, &set_sca_cfg);
- if(ret == 0)
- {
- printf("set smsc success");
- }else{
- printf("set smsc error, ret = %d\n", ret);
- }
- }else{
- printf("qser_sms_setsmscenteraddress dlsym error\n");
- }
- }
- break;
- }
- default:
- print_help();
- break;
- }
+ printf("[%s][%d] please input correct phnum\n",__FUNCTION__,__LINE__);
+ exit(1);
}
- return 0;
+ qser_sms_client_init = (int(*)(sms_client_handle_type *ph_sms))dlsym(dlHandle_sms,"qser_sms_client_init");
+ if(NULL != qser_sms_client_init)
+ {
+ ret = qser_sms_client_init(&ph_sms);
+ if(ret == 0)
+ {
+ printf("Run qser_sms_client_init\n");
+ }else{
+ printf("qser_sim_client_init error\n");
+ }
+ }else{
+ printf("qser_sim_client_init dlsym error\n");
+ }
+
+ sleep(2);
+
+ qser_sms_addrxmsghandler = (int(*)(QSER_SMS_RxMsgHandlerFunc_t handlerPtr, void* contextPtr))dlsym(dlHandle_sms,"qser_sms_addrxmsghandler");
+
+ if(NULL != qser_sms_addrxmsghandler)
+ {
+ ret = qser_sms_addrxmsghandler(qser_sms_handler, NULL);
+ if(ret == 0)
+ {
+ printf("qser_sms_addrxmsghandler success");
+ }else{
+ printf("qser_sms_addrxmsghandler error, ret = %d\n", ret);
+ }
+ }else{
+ printf("qser_sms_addrxmsghandler dlsym error\n");
+ }
+
+ QSER_sms_service_center_cfg_t get_sca_cfg;
+ qser_sms_getsmscenteraddress = (int (*)(sms_client_handle_type h_sms, QSER_sms_service_center_cfg_t *get_sca_cfg))dlsym(dlHandle_sms,"qser_sms_getsmscenteraddress");
+ if(NULL != qser_sms_getsmscenteraddress)
+ {
+ ret = qser_sms_getsmscenteraddress(h_sms, &get_sca_cfg);
+ if(ret == 0)
+ {
+ printf("get smsc success,service_center_addr = %s\n",get_sca_cfg.service_center_addr);
+ }else{
+ printf("get smsc error, ret = %d\n", ret);
+ }
+ }else{
+ printf("qser_sms_getsmscenteraddress dlsym error\n");
+ }
+ sleep(1);
+ QSER_sms_service_center_cfg_t set_sca_cfg;
+ strncpy(set_sca_cfg.service_center_addr, "+8613800230500", 14);//smsc ÊǸù¾Ý²»Í¬ÔËÓªÉÌ£¬²»Í¬¿¨À´ÅäÖõÄ
+ qser_sms_setsmscenteraddress = (int (*)(sms_client_handle_type h_sms, QSER_sms_service_center_cfg_t *set_sca_cfg))dlsym(dlHandle_sms,"qser_sms_setsmscenteraddress");
+ if(NULL != qser_sms_setsmscenteraddress)
+ {
+ ret = qser_sms_setsmscenteraddress(h_sms, &set_sca_cfg);
+ if(ret == 0)
+ {
+ printf("set smsc success");
+ }else{
+ printf("set smsc error, ret = %d\n", ret);
+ }
+ }else{
+ printf("qser_sms_setsmscenteraddress dlsym error\n");
+ }
+
+ // char telephony_num[SMS_BUF] = {};
+ char msg[MSG_BUF] = {};
+ QSER_sms_info_t pt_sms_info;
+ // sprintf(telephony_num,"10086");//è¯·ç”¨æˆ·åŠ¡å¿…æ›¿æ¢æ¤å·ç ï¼Œéšæ„å‘è¿è¥å•†å‘çŸæ¶ˆæ¯æžæœ‰å¯èƒ½è¢«å°å·ã€‚
+ 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;
+ // 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);
+
+ qser_sms_send_sms = (int (*)(sms_client_handle_type h_sms, QSER_sms_info_t *pt_sms_info))dlsym(dlHandle_sms,"qser_sms_send_sms");
+ if(NULL != qser_sms_send_sms)
+ {
+ ret = qser_sms_send_sms(h_sms, &pt_sms_info);
+ if(ret == 0)
+ {
+ printf("send sms success");
+ }else{
+ printf("send sms error, ret = %d\n", ret);
+ }
+ }else{
+ printf("qser_sms_send_sms dlsym error\n");
+ }
+
+ sleep(120);//åœ¨æ¤æœŸé—´å‘模组å‘é€çŸæ¶ˆæ¯ï¼Œå³å¯è§¦å‘â€œæŽ¥å—æ–°çŸæ¶ˆæ¯äº‹ä»¶â€ã€‚
+ qser_sms_client_deinit = (int (*)(sms_client_handle_type h_sms))dlsym(dlHandle_sms,"qser_sms_client_deinit");
+ if(NULL != qser_sms_client_deinit)
+ {
+ ret = qser_sms_client_deinit(h_sms);
+ if(ret == 0)
+ {
+ printf("sms deinit success");
+ }else{
+ printf("sms deinit error, ret = %d\n", ret);
+ }
+ }else{
+ printf("qser_sms_client_deinit dlsym error\n");
+ }
+
}
+
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 e53281d..818c508 100755
--- a/cap/zx297520v3/sources/meta-zxic/recipes-app/libmedia/libmedia.bb
+++ b/cap/zx297520v3/sources/meta-zxic/recipes-app/libmedia/libmedia.bb
@@ -29,9 +29,10 @@
install -d ${D}/usr/include
install -m 0755 ${S}/libmedia/libmedia.so ${D}${libdir}/
install -m 0755 ${S}/libmedia/libmedia.a ${D}${libdir}/
- 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/
+#xf.li@20230920 modify for esdk start -tmp
#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 ce9d32c..2767d5b 100755
--- a/cap/zx297520v3/sources/meta-zxic/recipes-app/libtelsvr/libtelsvr.bb
+++ b/cap/zx297520v3/sources/meta-zxic/recipes-app/libtelsvr/libtelsvr.bb
@@ -29,9 +29,11 @@
#install -m 0755 ${S}/libtelsvr/libtelsvr.so ${D}${libdir}/
install -m 0755 ${S}/libtelsvr/lib/libtelsvr.a ${D}${libdir}/
- 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 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 elfs
install -d ${ELFS-PATH}/
diff --git a/cap/zx297520v3/src/lynq/lib/liblynq-autosuspend/lynq-autosuspend.cpp b/cap/zx297520v3/src/lynq/lib/liblynq-autosuspend/lynq-autosuspend.cpp
index 54c88fd..ced8635 100644
--- a/cap/zx297520v3/src/lynq/lib/liblynq-autosuspend/lynq-autosuspend.cpp
+++ b/cap/zx297520v3/src/lynq/lib/liblynq-autosuspend/lynq-autosuspend.cpp
@@ -405,26 +405,27 @@
int ret;
printf("Get param:%s \n", name);
ret = sc_pm_wakelock_lock(name);
- if (ret)
+ if (ret != 0)
{
printf("do_wakelock failed, err:%d", ret);
- return ret;
+ return -1;
}
+
printf("do_wakelock succeed\n");
- return ret;
+ return 1;
}
int release_wake_lock(char *name)
{
int ret;
printf("Get param:%s \n", name);
ret = sc_pm_wakelock_unlock(name);
- if (ret)
+ if (ret != 0)
{
printf("do_wakeunlock failed, err:%d", ret);
- return ret;
+ return -1;
}
printf("do_wakeunlock succeed\n");
- return ret;
+ return 1;
}
int lynq_set_lpmode(int lp_mode)
{
diff --git a/cap/zx297520v3/src/lynq/lib/liblynq-call/include/libcall/lynq_call.h b/cap/zx297520v3/src/lynq/lib/liblynq-call/include/libcall/lynq_call.h
index ec50ef7..3bb398f 100755
--- a/cap/zx297520v3/src/lynq/lib/liblynq-call/include/libcall/lynq_call.h
+++ b/cap/zx297520v3/src/lynq/lib/liblynq-call/include/libcall/lynq_call.h
@@ -64,6 +64,9 @@
int lynq_hangup_waiting_or_background(void);
int lynq_hangup_foreground_resume_background(void);
+/* add for T106bug-213 2023/9/18 */
+void lynq_release_wait_call();
+
/*lei add for API-163/API-164 2023/1/3*/
/**
* @brief wait_call_state_change
diff --git a/cap/zx297520v3/src/lynq/lib/liblynq-call/lynq_call.cpp b/cap/zx297520v3/src/lynq/lib/liblynq-call/lynq_call.cpp
index b40f6c1..58849e7 100755
--- a/cap/zx297520v3/src/lynq/lib/liblynq-call/lynq_call.cpp
+++ b/cap/zx297520v3/src/lynq/lib/liblynq-call/lynq_call.cpp
@@ -765,7 +765,6 @@
return LYNQ_E_PARAMETER_ANONALY;
}
g_module_init_flag = MODULE_SWITCHING;
- s_call_state_change_mutex = PTHREAD_MUTEX_INITIALIZER;
LYLOGSET(LOG_INFO);
LYLOGEINIT(USER_LOG_TAG);
@@ -819,7 +818,6 @@
lynq_close_all_rc_socket_thread();
lynq_stop_call_list_loop();
g_module_init_flag = MODULE_CLOSED;
- pthread_mutex_destroy(&s_call_state_change_mutex);
return 0;
}
@@ -1457,7 +1455,10 @@
}
/*audio end*/
-
+void lynq_release_wait_call()
+{
+ pthread_cond_signal(&s_call_state_change_cond);
+}
bool is_support_urc(int urc_id)
{
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 5feff58..3b35553 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
@@ -83,7 +83,11 @@
switch(level)
{
case LOG_VERBOSE:
+#ifdef MOBILETEK_TARGET_PLATFORM_T106
+ __android_log_vprint(ANDROID_LOG_ERROR,log_entry->module_name, format, args);
+#else
__android_log_vprint(ANDROID_LOG_VERBOSE,log_entry->module_name, format, args);
+#endif
break;
case LOG_ERROR:
__android_log_vprint(ANDROID_LOG_ERROR,log_entry->module_name, format, args);
diff --git a/cap/zx297520v3/src/lynq/lib/liblynq-qser-autosuspend/include/lynq-qser-autosuspend.h b/cap/zx297520v3/src/lynq/lib/liblynq-qser-autosuspend/include/lynq-qser-autosuspend.h
index 54b663f..8ea9c01 100644
--- a/cap/zx297520v3/src/lynq/lib/liblynq-qser-autosuspend/include/lynq-qser-autosuspend.h
+++ b/cap/zx297520v3/src/lynq/lib/liblynq-qser-autosuspend/include/lynq-qser-autosuspend.h
@@ -13,7 +13,9 @@
#define E_READ -2
#define E_WRITE -3
-#define E_INIT -4
+#define E_TABLE_FULL -4
+#define E_LOCK_EXIST -5
+#define E_INPUT_ERROR -6
typedef enum
{
diff --git a/cap/zx297520v3/src/lynq/lib/liblynq-qser-autosuspend/lynq-qser-autosuspend.cpp b/cap/zx297520v3/src/lynq/lib/liblynq-qser-autosuspend/lynq-qser-autosuspend.cpp
index c037505..2a5ff52 100755
--- a/cap/zx297520v3/src/lynq/lib/liblynq-qser-autosuspend/lynq-qser-autosuspend.cpp
+++ b/cap/zx297520v3/src/lynq/lib/liblynq-qser-autosuspend/lynq-qser-autosuspend.cpp
@@ -6,11 +6,8 @@
#include <fcntl.h>
#include <errno.h>
#include <pthread.h>
-
#include<unistd.h>
-
-
#include <lynq_autosuspend.h>
#include "lynq-qser-autosuspend.h"
#include "liblog/lynq_deflog.h"
@@ -54,7 +51,7 @@
{
LYINFLOG("write fail\n");
close(file_fd);
- return -1;
+ return E_WRITE;
}
sync();
close(file_fd);
@@ -75,7 +72,7 @@
ret = lock_table_init();
if(ret < 0)
{
- return -2;
+ return E_READ;
}
}
@@ -84,7 +81,7 @@
{
err = errno;
LYINFLOG("Error open lock_table file:%s\n", strerror(errno));
- return -2;
+ return E_READ;
}
memset(&lock_status, 0, sizeof(lock_status));
@@ -94,7 +91,7 @@
if(ret <= 0)
{
close(file_fd);
- return -2;
+ return E_READ;
}
for(i=0;i<MAX_LOCK_NUM;i++)
@@ -119,7 +116,7 @@
{
err = errno;
LYINFLOG("Error open lock_table file:%s\n", strerror(errno));
- return -3;
+ return E_WRITE;
}
LYINFLOG("write lock_name[0]: %s\n", lock_status.lock_name[0]);
ret = write(file_fd, (unsigned char *)&lock_status, sizeof(lock_status));
@@ -128,7 +125,7 @@
{
LYINFLOG("write fail\n");
close(file_fd);
- return -3;
+ return E_WRITE;
}
sync();
close(file_fd);
@@ -189,7 +186,7 @@
}
if(i == MAX_LOCK_NUM)
{
- return -1;
+ return E_TABLE_FULL;
}
else
{
@@ -198,7 +195,7 @@
}
else
{
- num = check_flag;
+ return E_LOCK_EXIST;
}
LYINFLOG("num = %d\n", num);
@@ -255,6 +252,7 @@
return 0;
}
+
int qser_autosuspend_enable(char enable)
{
int ret;
@@ -269,19 +267,24 @@
}
else
{
- ret = -1;
+ return E_INPUT_ERROR;
}
+ if(ret >= 0)
+ {
+ ret = 0;
+ }
return ret;
}
+
int qser_wakelock_create(const char *name, size_t len)
{
int ret;
if(name == NULL)
{
- return -1;
+ return E_INPUT_ERROR;
}
LYINFLOG("%s\n", name);
ret = add_lock(name);
@@ -294,10 +297,18 @@
int ret;
if(fd < 0 || fd >= MAX_LOCK_NUM)
{
- return -4;
+ return E_INPUT_ERROR;
}
ret = read_lock_table();
ret = acquire_wake_lock( 0, lock_status.lock_name[fd]);
+ if(ret > 0)
+ {
+ ret = 0;
+ }
+ else
+ {
+ ret = -1;
+ }
return ret;
}
@@ -306,7 +317,7 @@
int ret;
if(fd < 0 || fd >= MAX_LOCK_NUM)
{
- return -4;
+ return E_INPUT_ERROR;
}
ret = read_lock_table();
if(strlen(lock_status.lock_name[fd]) == 0)
@@ -315,6 +326,14 @@
return -1;
}
ret = release_wake_lock(lock_status.lock_name[fd]);
+ if(ret > 0)
+ {
+ ret = 0;
+ }
+ else
+ {
+ ret = -1;
+ }
return ret;
}
@@ -323,7 +342,7 @@
int ret;
if(fd < 0 || fd >= MAX_LOCK_NUM)
{
- return -4;
+ return E_INPUT_ERROR;
}
ret = delete_lock(fd);
return ret;
diff --git a/cap/zx297520v3/src/lynq/lib/liblynq-qser-data/lynq-qser-data.cpp b/cap/zx297520v3/src/lynq/lib/liblynq-qser-data/lynq-qser-data.cpp
index 6a79c6c..d1114fc 100755
--- a/cap/zx297520v3/src/lynq/lib/liblynq-qser-data/lynq-qser-data.cpp
+++ b/cap/zx297520v3/src/lynq/lib/liblynq-qser-data/lynq-qser-data.cpp
@@ -614,6 +614,11 @@
continue;
}
modify_node = modify_node->next;
+ if(modify_node == NULL)
+ {
+ LYERRLOG("modify_node is null\n");
+ goto FAILED;
+ }
}
apn->profile_idx = (unsigned char)atoi(xmlGetProp(modify_node, "profile_idx"));
apn->pdp_type = (qser_apn_pdp_type_e)atoi(xmlGetProp(modify_node, "pdp_type"));
@@ -743,6 +748,7 @@
int table_num = 0;
lynq_apn_info **apn_table = NULL;
qser_apn_info_s apn;
+ int ret = 0;
apn_table = (lynq_apn_info **)malloc(sizeof(lynq_apn_info *)*LYNQ_APN_CHANNEL_MAX);
if (NULL == apn_table)
{
@@ -764,7 +770,12 @@
}
lynq_get_apn_table(&table_num,apn_table);
memset(&apn,0,sizeof(qser_apn_info_s));
- apn_xml_query(profile_idx,&apn);
+ ret = apn_xml_query(profile_idx,&apn);
+ if (ret < 0)
+ {
+ LYERRLOG("apn_xml_query error");
+ return ret;
+ }
for (int j = 0;j < table_num;j++)
{
if (strcmp(apn.apn_type,apn_table[j]->apnType) == 0)
@@ -966,7 +977,12 @@
{
char pdptype[16];
qser_apn_info_s apn_info;
- qser_apn_get(data_call->profile_idx,&apn_info);
+ ret = qser_apn_get(data_call->profile_idx,&apn_info);
+ if (ret != 0)
+ {
+ LYERRLOG("qser_apn_get error");
+ return ret;
+ }
judge_pdp_type(apn_info.pdp_type,pdptype);
ret = lynq_setup_data_call_sp(&handle,apn_info.apn_name,apn_info.apn_type,apn_info.username,apn_info.password,NULL,pdptype,pdptype);
}
diff --git a/cap/zx297520v3/src/lynq/lib/liblynq-qser-voice/lynq-qser-voice.cpp b/cap/zx297520v3/src/lynq/lib/liblynq-qser-voice/lynq-qser-voice.cpp
index fa210e6..a35a192 100755
--- a/cap/zx297520v3/src/lynq/lib/liblynq-qser-voice/lynq-qser-voice.cpp
+++ b/cap/zx297520v3/src/lynq/lib/liblynq-qser-voice/lynq-qser-voice.cpp
@@ -48,6 +48,10 @@
while (s_voice_thread_status)
{
lynq_wait_call_state_change(&handle);
+ if(s_voice_thread_status == 0)
+ {
+ return NULL;
+ }
lynq_get_current_call_state(&handle,&call_state,&toa,&direction,addr);
if (call_state == LYNQ_CALL_ACTIVE)
{
@@ -141,19 +145,14 @@
int qser_voice_call_removestatehandle(voice_client_handle_type h_voice)
{
- int ret;
- if (s_lynq_voice_tid != -1)
- {
- ret = pthread_cancel(s_lynq_voice_tid);
- LYDBGLOG("pthread cancel ret = %d",ret);
- }
- if (s_lynq_voice_tid != -1)
- {
- ret = pthread_join(s_lynq_voice_tid,NULL);
- LYDBGLOG("pthread cancel ret = %d",ret);
- s_lynq_voice_tid = -1;
- }
+
+ LYINFLOG("Enter removestatehandle !!!");
s_voice_thread_status = 0;
+ if(s_lynq_voice_tid != -1)
+ {
+ lynq_release_wait_call();
+ }
+
s_voice_cb = NULL;
return RESULT_OK;
}
diff --git a/cap/zx297520v3/src/lynq/lib/liblynq-systime/lynq_systime.cpp b/cap/zx297520v3/src/lynq/lib/liblynq-systime/lynq_systime.cpp
index 4109b21..690c0d0 100755
--- a/cap/zx297520v3/src/lynq/lib/liblynq-systime/lynq_systime.cpp
+++ b/cap/zx297520v3/src/lynq/lib/liblynq-systime/lynq_systime.cpp
@@ -36,14 +36,14 @@
#define NTP_ALREADY_ENABLE 1
#define NTP_ALREADY_DISABLE 2
-#define OPEN_ERROR 7
+#define SYSTEM_FUNC_FAILED 7
#define ERROR_PARA 8
#ifdef MOBILETEK_TARGET_PLATFORM_T106
#define NTP_RESTART_BUF "/etc/init.d/sntp restart"
#define NTP_STOP_BUF "/etc/init.d/sntp stop"
#define NTP_START_BUF "/etc/init.d/sntp start"
-#define PGREP_NTP_DARMON "pgrep -x /usr/bin/sntp"
+#define PGREP_NTP_DARMON "pgrep sntp"
#else
#define NTP_RESTART_BUF "systemctl restart ntpd"
@@ -54,7 +54,7 @@
#endif
#ifdef MOBILETEK_TARGET_PLATFORM_T106
- typedef int (*sc_rtc_time_get_cb)(unsigned int src_id, unsigned long ulsec);
+typedef int (*sc_rtc_time_get_cb)(unsigned int src_id, unsigned long ulsec);
extern int sc_rtc_timer_init(void);
extern int sc_rtc_timer_uninit(void);
extern int sc_rtc_time_set(int srcid);
@@ -79,7 +79,13 @@
LYINFLOG("RTC time now is: %d-%d-%d,%d:%d:%d\n",
rtc_time.tm_year + 1900, rtc_time.tm_mon + 1, rtc_time.tm_mday, rtc_time.tm_hour, rtc_time.tm_min, rtc_time.tm_sec);
snprintf(command, sizeof(command), "date --set=\'@%lu\' ", ulsec);
- system(command);
+ int ret = system(command);
+ if (ret != 0)
+ {
+ printf("Function system(\"%s\") failed.", command);
+ sync_from_rtc_cb_flag = 0;
+ return SYSTEM_FUNC_FAILED;
+ }
sync_from_rtc_cb_flag = 0;
return 0;
}
@@ -279,7 +285,12 @@
// set systime
snprintf(cmd_buf, sizeof(cmd_buf), "date -s %s+%s", date, time);
- system(cmd_buf);
+ int ret = system(cmd_buf);
+ if (ret != 0)
+ {
+ printf("Function system(\"%s\") failed.", cmd_buf);
+ return SYSTEM_FUNC_FAILED;
+ }
return 0;
}
@@ -287,7 +298,7 @@
{
LYLOGSET(LOG_LEVEL);
LYLOGEINIT(USER_LOG_TAG);
- LYDBGLOG("[%s][%d] enter.\n", __FUNCTION__, __LINE__);
+ LYDBGLOG("[%s][%d] enter.\n", __func__, __LINE__);
if (enable != 0 && enable != 1)
{
LYERRLOG("Parameter error! Only 0/1 allowed.\n");
@@ -298,13 +309,21 @@
{
if (enable)
{
- system(NTP_RESTART_BUF);
- return NTP_ALREADY_ENABLE;
+ ret = system(NTP_RESTART_BUF);
+ if (ret != 0)
+ {
+ printf("Function system(\"%s\") failed.", NTP_RESTART_BUF);
+ return SYSTEM_FUNC_FAILED;
+ }
}
else
{
- system(NTP_STOP_BUF);
- return SYNC_TIME_SUCCESS;
+ ret = system(NTP_STOP_BUF);
+ if (ret != 0)
+ {
+ printf("Function system(\"%s\") failed.", NTP_STOP_BUF);
+ return SYSTEM_FUNC_FAILED;
+ }
}
}
else
@@ -314,14 +333,15 @@
// Only one time source is allowed to run simultaneously.
modem_time_enable(0);
gnss_time_enable(0);
- system(NTP_START_BUF);
- return SYNC_TIME_SUCCESS;
- }
- else
- {
- return NTP_ALREADY_DISABLE;
+ ret = system(NTP_START_BUF);
+ if (ret != 0)
+ {
+ printf("Function system(\"%s\") failed.", NTP_START_BUF);
+ return SYSTEM_FUNC_FAILED;
+ }
}
}
+ return SYNC_TIME_SUCCESS;
}
int modem_time_enable(int enable)
diff --git a/cap/zx297520v3/src/lynq/lib/libpoweralarm/libpoweralarm.cpp b/cap/zx297520v3/src/lynq/lib/libpoweralarm/libpoweralarm.cpp
index 3d17411..b3b7827 100755
--- a/cap/zx297520v3/src/lynq/lib/libpoweralarm/libpoweralarm.cpp
+++ b/cap/zx297520v3/src/lynq/lib/libpoweralarm/libpoweralarm.cpp
@@ -31,7 +31,6 @@
static int wk_rtc_id = 1;
-static int pw_rtc_id = 2;
static int wk_srcid = 0;
typedef int (*sc_rtc_timer_exp_cb)(unsigned int src_id, int rtc_id);
@@ -42,6 +41,10 @@
extern int sc_rtc_timer_add_utc(int srcid, int rtc_id, struct tm *utc_sec, int wakeup, sc_rtc_timer_exp_cb rtc_notify);
+extern int sc_rtc_get_poweroff_alarm_modid(int src_id,char *name);
+
+extern int sc_rtc_add_poweroff_alarm(int srcid, int alarm_modid, int rtc_id, struct tm *utc_sec, sc_rtc_timer_exp_cb rtc_notify);
+
/*****************************************
* @brief:sc_rtc_timer_add_cb
* @param count [IN]:src_id, rtc_id,
@@ -72,10 +75,10 @@
int ret = 0;
char *buf_bak = buffer;
time_t tmp_time = 0;
- struct tm *ptime = NULL;
+
struct tm *wake_arlarm = NULL;
tmp_time = time(NULL);
- ptime = localtime(&tmp_time);
+ localtime(&tmp_time);
LYLOGSET(LOG_INFO);
LYLOGEINIT(USER_LOG_TAG);
@@ -155,7 +158,15 @@
unsigned long time_sec = 0;
int ret = 0;
char *buf_bak = buffer;
-
+
+ int alarmid = 0;
+ char username[8] = "user";
+ time_t tmp_time = 0;
+ struct tm *power_arlarm = NULL;
+ tmp_time = time(NULL);
+ localtime(&tmp_time);
+
+
LYLOGSET(LOG_INFO);
LYLOGEINIT(USER_LOG_TAG);
@@ -181,6 +192,10 @@
buffer = buf_bak;
time_sec = strtoul(buffer,NULL,10);
+
+ tmp_time += time_sec;
+ power_arlarm = localtime(&tmp_time);
+
if(time_sec < MIN_TIME || time_sec > MAX_TIME || errno == ERANGE)
{
LYERRLOG("Illeagle input: too large or too small !!!");
@@ -194,23 +209,30 @@
LYERRLOG("rtc_timer_init fail!");
return -1;
}
- ret = sc_rtc_timer_add(srcid, pw_rtc_id, time_sec, sc_rtc_timer_add_cb);
- if(ret < 0)
+
+ alarmid = sc_rtc_get_poweroff_alarm_modid(srcid, username);
+ if(alarmid < 0)
{
- LYERRLOG("Add rtc timer failed!!!!");
+ LYERRLOG("Get poweroff alarm id failed !!!");
return -1;
}
-
- LYINFLOG("Set poweralarm success !!!");
+
+ ret = sc_rtc_add_poweroff_alarm(srcid, alarmid, 0, power_arlarm, sc_rtc_timer_add_cb);
+ if(ret < 0)
+ {
+ LYERRLOG("Set power alarm failed !!!");
+ return -1;
+ }
+ LYINFLOG("Set power alarm success !!!!");
ret = sc_rtc_timer_uninit();
if(ret != 0)
{
- LYINFLOG("Deinit failed");
+ LYINFLOG("Deinit failed!!!");
}
return 0;
-
+
}
/**********************************************
@@ -254,6 +276,18 @@
int ret = 0;
int srcid = 0;
+ int alarmid = 0;
+ char username[8] = "user";
+
+ time_t tmp_time = 0;
+ struct tm *power_arlarm = NULL;
+ tmp_time = time(NULL);
+ localtime(&tmp_time);
+
+
+ tmp_time += time_sec;
+ power_arlarm = localtime(&tmp_time);
+
LYLOGSET(LOG_INFO);
LYLOGEINIT(USER_LOG_TAG);
@@ -262,30 +296,39 @@
LYERRLOG("Illeagle input: too large or too small !!!");
return -1;
}
-
- LYINFLOG("lynq_set_poweralarm %lu seconds",time_sec);
+
+ LYINFLOG("lynq_set_poweralarm %lu seconds",time_sec);
srcid = sc_rtc_timer_init();
if (srcid <= 0)
{
LYERRLOG("rtc_timer_init fail!");
return -1;
}
- ret = sc_rtc_timer_add(srcid, pw_rtc_id, time_sec, sc_rtc_timer_add_cb);
+
+ alarmid = sc_rtc_get_poweroff_alarm_modid(srcid, username);
+ if(alarmid < 0)
+ {
+ LYERRLOG("Get poweroff alarm id failed !!!");
+ return -1;
+ }
+
+ ret = sc_rtc_add_poweroff_alarm(srcid, alarmid, 0, power_arlarm, sc_rtc_timer_add_cb);
if(ret < 0)
{
- LYINFLOG("Add rtc timer failed!!!!");
+ LYERRLOG("Set power alarm failed !!!");
return -1;
}
- LYINFLOG("Set poweralarm success !!!");
-
+ LYINFLOG("Set power alarm success !!!!");
+
ret = sc_rtc_timer_uninit();
if(ret != 0)
{
- LYINFLOG("Deinit failed");
+ LYINFLOG("Deinit rtc_timer failed!!!");
}
return 0;
+
}
@@ -304,10 +347,9 @@
int ret = 0;
time_t tmp_time = 0;
- struct tm *ptime = NULL;
struct tm *wake_arlarm = NULL;
tmp_time = time(NULL);
- ptime = localtime(&tmp_time);
+ localtime(&tmp_time);
LYLOGSET(LOG_INFO);
LYLOGEINIT(USER_LOG_TAG);
diff --git a/cap/zx297520v3/src/lynq/packages/apps/lynq-qser-autosuspend-demo/makefile b/cap/zx297520v3/src/lynq/packages/apps/lynq-qser-autosuspend-demo/makefile
deleted file mode 100755
index b3638ea..0000000
--- a/cap/zx297520v3/src/lynq/packages/apps/lynq-qser-autosuspend-demo/makefile
+++ /dev/null
@@ -1,42 +0,0 @@
-SHELL = /bin/sh
-RM = rm -f
-
-LOCAL_CFLAGS := -Wall \
- -g -Os \
- -flto \
- -fpermissive \
- -fPIC \
-
-ifeq ($(strip $(TARGET_PLATFORM)), T106)
-LOCAL_CFLAGS += -DBINDER_IPC_32BIT=1 -DHAVE_ENDIAN_H -DHAVE_PTHREADS -DHAVE_SYS_UIO_H -DHAVE_POSIX_FILEMAP -DHAVE_STRLCPY -DHAVE_PRCTL -DHAVE_MEMSET16 -DHAVE_MEMSET32 -DANDROID_SMP=0
-endif
-
-LOCAL_CFLAGS += -DZXW
-
-LOCAL_PATH = .
-
-LOCAL_C_INCLUDES = \
- -I. \
-
-
-LOCAL_LIBS := \
- -L. \
- -ldl \
- -lpthread \
-
-SOURCES = $(wildcard *.c)
-
-EXECUTABLE = lynq-qser-autosuspend-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-vehicle_dc_ref.dts b/cap/zx297520v3/zxic_code/zxic_source/linux-5.10/arch/arm/boot/dts/zx297520v3-vehicle_dc_ref.dts
index ff55fb9..1067603 100755
--- a/cap/zx297520v3/zxic_code/zxic_source/linux-5.10/arch/arm/boot/dts/zx297520v3-vehicle_dc_ref.dts
+++ b/cap/zx297520v3/zxic_code/zxic_source/linux-5.10/arch/arm/boot/dts/zx297520v3-vehicle_dc_ref.dts
@@ -202,7 +202,7 @@
label = "GPIO Key USER2";//flight mode
linux,code = <KEY_WAKEUP>;
- status = "okay";
+ status = "disabled";
};
diff --git a/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/platform/zxic_mainctrl/zxic_mainctrl.c b/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/platform/zxic_mainctrl/zxic_mainctrl.c
index 816e85f..e8cdc65 100755
--- a/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/platform/zxic_mainctrl/zxic_mainctrl.c
+++ b/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/platform/zxic_mainctrl/zxic_mainctrl.c
@@ -1584,6 +1584,134 @@
}
}
+/*jb.qi add for usb wake lock on 20230918 start*/
+static void write_lockfile(char *filepath, char *setbuf)
+{
+ int f = -1;
+
+ int len = 0;
+ f = open(filepath, O_RDWR);
+
+ if (f < 0)
+ {
+ printf("usbplug wakelock open error");
+ return;
+ }
+ len = strlen(setbuf);
+
+ if (write(f, setbuf, len) != len)
+ {
+ printf("usbplug wakelock write fail\n");
+ }
+ close(f);
+}
+
+
+
+static void wake_usbplug_lock()
+{
+ write_lockfile("/sys/power/wake_lock", "usb_wakelock");
+}
+
+static void wake_usbplug_unlock()
+{
+ write_lockfile("/sys/power/wake_unlock", "usb_wakelock");
+}
+
+#define RPMSG_IOC_MAGIC 'R'
+
+/*ioctl cmd usd by device*/
+#define RPMSG_CREATE_CHANNEL _IOW(RPMSG_IOC_MAGIC, 1, char *)
+#define RPMSG_GET_DATASIZE _IOWR(RPMSG_IOC_MAGIC, 2, char *)
+#define RPMSG_SET_INT _IOW(RPMSG_IOC_MAGIC, 3, char *)
+#define RPMSG_SET_INT_FLAG _IOW(RPMSG_IOC_MAGIC, 4, char *)
+#define RPMSG_CLEAR_INT_FLAG _IOW(RPMSG_IOC_MAGIC, 5, char *)
+#define RPMSG_SET_POLL_FLAG _IOW(RPMSG_IOC_MAGIC, 6, char *)
+#define RPMSG_CLEAR_POLL_FLAG _IOW(RPMSG_IOC_MAGIC, 7, char *)
+
+void *recv_usbplug_entry(void *arg)
+{
+ int charging_netlink = -1;
+ int fd_counts = -1;
+ char buf[20] = {0};
+
+ char *buf_temp;
+ int len = 0;
+ int ret = 0;
+ fd_set readfds;
+ CHAR usbplug_nv[8] = {0};
+
+ printf("recv_usbplug_entry \n");
+
+ prctl(PR_SET_NAME, "usbplug", 0, 0, 0);
+ int fd = open("/dev/armps_rpmsgch50", O_RDWR);
+ if (fd < 0) {
+ printf("usbplug open armps_rpmsgch50 wrong \n");
+ return NULL;
+ }
+ ret = ioctl(fd, RPMSG_CREATE_CHANNEL, 64); // cov M CHECKED_RETURN
+ if(ret<0){
+ printf("usbplug cap add ioctl create ch FAIL\n");
+ close(fd);
+ return ret;
+
+ }
+ ret=ioctl(fd, RPMSG_SET_INT_FLAG, NULL);
+
+ if(ret<0){
+ printf("usbplug cap add ioctl set int FAIL\n");
+ close(fd);
+
+ return ret;
+ }
+ sc_cfg_get("usbplug_nv",usbplug_nv,sizeof(usbplug_nv));
+
+ if(!strcmp(usbplug_nv,"1")){
+ printf("yanming usbplug in state\n");
+ wake_usbplug_lock();
+ }
+
+ while (1) {
+ FD_ZERO(&readfds);
+ FD_SET(fd, &readfds);
+
+ fd_counts = select(fd + 1, &readfds, NULL, NULL, NULL);
+ if (fd_counts < 0)
+ continue;
+
+ if (FD_ISSET(fd, &readfds)) {
+ memset(buf, 0, sizeof(buf));
+ len = read(fd, &buf, sizeof(buf));
+ if (len <= 0) {
+ printf("usbplug recv msg fail!\n");
+ continue;
+ }
+
+ buf_temp = malloc(len+1);
+
+ if(NULL == buf_temp)
+ {
+ assert(0);
+ }
+
+ memset(buf_temp, 0x00, len+1);
+ memcpy(buf_temp, buf, len);
+
+ printf("yanming usbplug recv buf:%s\n",buf_temp);
+ if(!strcmp(buf_temp,"usbplug_in")){
+ wake_usbplug_lock();
+ printf("yanming usbplug lock\n");
+ }
+
+ if(!strcmp(buf_temp,"usbplug_out")){
+ wake_usbplug_unlock();
+ printf("yanming usbplug unlock\n");
+ }
+ }
+ }
+}
+/*jb.qi add for usb wake lock on 20230918 end*/
+
int main(int argc, char * argv[])
{
int iMsgHandle = 0;
@@ -1601,9 +1729,16 @@
slog(NET_PRINT, SLOG_ERR, "zxic_mainctrl begin ======= build date: %s %s \n", __DATE__, __TIME__);
pthread_t zte_security_log_tid;
+ pthread_t zte_usbplug_log_tid;//jb.qi add for usb wake lock on 20230918 end
+
if (pthread_create(&zte_security_log_tid, NULL, (void *)zte_security_log_entry, NULL) != 0) //cov m
slog(NET_PRINT, SLOG_ERR, "security_log_entry create fail\n");
+ /*jb.qi add for usb wake lock on 20230918 start*/
+ if (pthread_create(&zte_usbplug_log_tid, NULL, (void *)recv_usbplug_entry, NULL) != 0)
+ printf("recv_usbplug_entry create fail\n");
+ /*jb.qi add for usb wake lock on 20230918 end*/
+
iMsgHandle = create_msg_queue();
if (-1 == iMsgHandle) {
slog(NET_PRINT, SLOG_ERR, "can not create msg queue for router!\n");
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 1e3352e..2b9df65 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
@@ -621,8 +621,15 @@
void requestAnswer(void *data __unused, size_t datalen __unused, RIL_Token t)
{
- at_send_command("ATA", NULL);
-
+ //l.yang modify for bug id T106BUG-54 2023/9/20 start
+ ATResponse *p_response = NULL;
+ at_send_command("ATA", &p_response);
+ if( p_response->success == 0)
+ {
+ goto error;
+ }
+ //l.yang modify for bug id T106BUG-54 2023/9/20 end
+
#ifdef WORKAROUND_ERRONEOUS_ANSWER
s_expectAnswer = 1;
#endif /* WORKAROUND_ERRONEOUS_ANSWER */
@@ -630,6 +637,11 @@
/* 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-54 2023/9/20 start
+error:
+ RIL_onRequestComplete(t, RIL_E_GENERIC_FAILURE, NULL, 0);
+ at_response_free(p_response);
+ //l.yang modify for bug id T106BUG-54 2023/9/20 end
}
void requestConference(void *data __unused, size_t datalen __unused, RIL_Token t)
diff --git a/esdk_patch/mk_esdk.sh b/esdk_patch/mk_esdk.sh
index 75a112e..e1ff843 100755
--- a/esdk_patch/mk_esdk.sh
+++ b/esdk_patch/mk_esdk.sh
@@ -19,3 +19,4 @@
cd ${dest_dir}/esdk/layers/meta-zxic/recipes-kernel/linux
git apply linux_bb.diff
cd ${dest_dir}/esdk
+mkdir -p ${dest_dir}/allbins/zx297520v3/vehicle_dc_ref/elf/normal