Merge "[Bugfix][T106BUG-441][call] add interface to query ims state and set ims enable"
diff --git a/allbins/zx297520v3/prj_vehicle/nv_dc_ref/phyLteaAmtUser_nvrwo_0x0003C800.bin b/allbins/zx297520v3/prj_vehicle/nv_dc_ref/phyLteaAmtUser_nvrwo_0x0003C800.bin
index ae19b25..197aad6 100755
--- a/allbins/zx297520v3/prj_vehicle/nv_dc_ref/phyLteaAmtUser_nvrwo_0x0003C800.bin
+++ b/allbins/zx297520v3/prj_vehicle/nv_dc_ref/phyLteaAmtUser_nvrwo_0x0003C800.bin
Binary files differ
diff --git a/allbins/zx297520v3/prj_vehicle/nv_dc_ref/phyWcdmaAmtUser_nvrwo_0x0003A000.bin b/allbins/zx297520v3/prj_vehicle/nv_dc_ref/phyWcdmaAmtUser_nvrwo_0x0003A000.bin
index 854310c..8ef3392 100755
--- a/allbins/zx297520v3/prj_vehicle/nv_dc_ref/phyWcdmaAmtUser_nvrwo_0x0003A000.bin
+++ b/allbins/zx297520v3/prj_vehicle/nv_dc_ref/phyWcdmaAmtUser_nvrwo_0x0003A000.bin
Binary files differ
diff --git a/ap/app/Script/scripts/wan_ipv4.sh b/ap/app/Script/scripts/wan_ipv4.sh
index 7c0ba39..95b5203 100755
--- a/ap/app/Script/scripts/wan_ipv4.sh
+++ b/ap/app/Script/scripts/wan_ipv4.sh
@@ -116,11 +116,11 @@
pswan_secdns=`nv get $wan_if"_secdns"`
pswan_nm=`nv get $wan_if"_nm"`
- #ifconfig $wan_if down 2>>$test_log
- ifconfig $wan_if $pswan_ip netmask 255.255.255.0 up 2>>$test_log
- if [ $? -ne 0 ];then
- echo "Error: ifconfig $wan_if $pswan_ip up failed." >> $test_log
- fi
+# #ifconfig $wan_if down 2>>$test_log
+# ifconfig $wan_if $pswan_ip netmask 255.255.255.0 up 2>>$test_log
+# if [ $? -ne 0 ];then
+# echo "Error: ifconfig $wan_if $pswan_ip up failed." >> $test_log
+# fi
pswan_pri=`nv get pswan_priority`
rt_num=`expr $pswan_pri \* 10 + $c_id`
@@ -296,4 +296,4 @@
tc_tbf.sh down $def_cid
fi
linkdown $2 $3
-fi
\ No newline at end of file
+fi
diff --git a/ap/app/zte_comm/at_ctl/src/atconfig/mnet_whitelist.c b/ap/app/zte_comm/at_ctl/src/atconfig/mnet_whitelist.c
index ef42c51..2438963 100755
--- a/ap/app/zte_comm/at_ctl/src/atconfig/mnet_whitelist.c
+++ b/ap/app/zte_comm/at_ctl/src/atconfig/mnet_whitelist.c
@@ -147,8 +147,8 @@
mnet_whitelist_add(single_cmd);
memset(single_cmd, 0, sizeof(single_cmd));
}
- sc_cfg_set("customIndCmdList", PsmIndAtCmdPrefix);
- sc_cfg_save();
+ //sc_cfg_set("customIndCmdList", PsmIndAtCmdPrefix);jb.qi add for nv wakeup when no network on 20231229
+ //sc_cfg_save();jb.qi add for nv wakeup when no network on 20231229
return;
}
@@ -177,8 +177,8 @@
mnet_whitelist_del(single_cmd);
memset(single_cmd, 0, sizeof(single_cmd));
}
- sc_cfg_set("customIndCmdList", PsmIndAtCmdPrefix);
- sc_cfg_save();
+ //sc_cfg_set("customIndCmdList", PsmIndAtCmdPrefix);jb.qi add for nv wakeup when no network on 20231229
+ //sc_cfg_save();jb.qi add for nv wakeup when no network on 20231229
return;
}
diff --git a/ap/app/zte_comm/at_ctl/src/atconfig/ps_pdp.c b/ap/app/zte_comm/at_ctl/src/atconfig/ps_pdp.c
index 0c20965..3e4f2e0 100755
--- a/ap/app/zte_comm/at_ctl/src/atconfig/ps_pdp.c
+++ b/ap/app/zte_comm/at_ctl/src/atconfig/ps_pdp.c
@@ -515,11 +515,11 @@
offset += sprintf(at_str+offset,"\"%s\",", info->act_info.gateway);
offset += sprintf(at_str+offset,"\"%s\",", info->act_info.pri_dns);
offset += sprintf(at_str+offset,"\"%s\",", info->act_info.sec_dns);
- offset += sprintf(at_str+offset,"%d,", pdp_type);
offset += sprintf(at_str+offset,"\"%s\",", g_pdpinfo_mng[info->c_id-1].ip6addr);
offset += sprintf(at_str+offset,"\"%s\",", info->act_info.gateway6);
offset += sprintf(at_str+offset,"\"%s\",", info->act_info.pri_dns6);
offset += sprintf(at_str+offset,"\"%s\"", info->act_info.sec_dns6);
+ offset += sprintf(at_str+offset,",%d", pdp_type);
}
break;
}
diff --git a/ap/app/zte_comm/at_ctl/src/atctrl/at_com.c b/ap/app/zte_comm/at_ctl/src/atctrl/at_com.c
index 116a4b5..7811261 100755
--- a/ap/app/zte_comm/at_ctl/src/atctrl/at_com.c
+++ b/ap/app/zte_comm/at_ctl/src/atctrl/at_com.c
@@ -630,8 +630,11 @@
written_bytes = write(fd, pstr, left_len);
if(written_bytes <= 0)
{
- //ºË¼äͨµÀдʧ°Ü£¬ÖØ·¢
- if(at_chan && at_chan->attribution & (1<<CH_COMM))
+ if(written_bytes == 0){
+ at_print(AT_ERR,"====>at_sys_write written_bytes=0, fd=%d\n", fd);
+ return 0;
+ }
+ else if(at_chan && at_chan->attribution & (1<<CH_COMM))
{
if(resendcnt > 10)
{
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 b27a915..77fb3b1 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
@@ -1820,7 +1820,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("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("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)
{
@@ -1853,6 +1920,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:
/*°Î³öʼþ´¦Àí*/
@@ -1870,6 +1938,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;
@@ -2023,6 +2092,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/app/zte_comm/zte_mainctrl/netdev_proc.c b/ap/app/zte_comm/zte_mainctrl/netdev_proc.c
index 36ec590..7e853a8 100755
--- a/ap/app/zte_comm/zte_mainctrl/netdev_proc.c
+++ b/ap/app/zte_comm/zte_mainctrl/netdev_proc.c
@@ -686,6 +686,7 @@
scriptmsg.cid = cid;
scriptmsg.iptype = iptype;
char buffer[128] = {0};
+ char nv_value[16] = {0};
slog(NET_PRINT, SLOG_NORMAL, "$$$$$net_sendmsg_2_atctl cid=%d,iptype=%d\n", cid, iptype);
ret = ipc_send_message(MODULE_ID_MAIN_CTRL, MODULE_ID_AT_CTL, cmd, sizeof(TScriptMSG), &scriptmsg, 0);
@@ -693,10 +694,18 @@
softap_assert("send msg to at_ctl error");
}
snprintf(buffer, sizeof(buffer), "pdp_act_state_%d", cid);
- if(cmd == MSG_CMD_LINKUP_END)
- sc_cfg_set(buffer, "act");
- else if(cmd == MSG_CMD_LINKDOWN_END)
- sc_cfg_set(buffer, "deact");
+ sc_cfg_get(buffer, nv_value, sizeof(nv_value)-1);
+ if(cmd == MSG_CMD_LINKUP_END){
+ if(strcmp(nv_value,"acting") == 0)
+ sc_cfg_set(buffer, "act");
+ else
+ slog(NET_PRINT, SLOG_ERR, "$$$$$net_sendmsg_2_atctl_up 5s=%s\n", buffer, nv_value);
+ }else if(cmd == MSG_CMD_LINKDOWN_END){
+ if(strcmp(nv_value,"deacting") == 0)
+ sc_cfg_set(buffer, "deact");
+ else
+ slog(NET_PRINT, SLOG_ERR, "$$$$$net_sendmsg_2_atctl_down %s=%s\n", buffer, nv_value);
+ }
}
void pdp_wan_config_quick(struct pdp_active_info *actinfo, char *prefix, int prefix_len)
diff --git a/ap/os/linux/linux-3.4.x/drivers/net/zvnet/zvnet_dev.c b/ap/os/linux/linux-3.4.x/drivers/net/zvnet/zvnet_dev.c
index b940957..79cbb75 100755
--- a/ap/os/linux/linux-3.4.x/drivers/net/zvnet/zvnet_dev.c
+++ b/ap/os/linux/linux-3.4.x/drivers/net/zvnet/zvnet_dev.c
@@ -899,9 +899,9 @@
continue;
}
if(unlikely(!(skb->dev->flags & IFF_UP))) {
- dev_kfree_skb (skb);
if(printk_ratelimit())
zv_err("drop!!!%s is down.", skb->dev->name);
+ dev_kfree_skb (skb);
continue;
}
if (fast_from_driver && fast_from_driver(skb, skb->dev))
@@ -921,8 +921,8 @@
if(0 != (skb = zvnet_direct_read_skb(&g_zvnet_chn_info))) {
//skb_debug_test(skb);
if(unlikely(!(skb->dev->flags & IFF_UP))) {
- dev_kfree_skb (skb);
zv_err("drop!!!%s is down.", skb->dev->name);
+ dev_kfree_skb (skb);
continue;
}
#if 1
diff --git a/ap/os/linux/linux-3.4.x/drivers/usb/gadget/android.c b/ap/os/linux/linux-3.4.x/drivers/usb/gadget/android.c
index c6601b5..cb4a4cc 100755
--- a/ap/os/linux/linux-3.4.x/drivers/usb/gadget/android.c
+++ b/ap/os/linux/linux-3.4.x/drivers/usb/gadget/android.c
@@ -3076,7 +3076,12 @@
{
usb_rpmsg_cmd *t_resp = (usb_rpmsg_cmd *)resp;
unsigned long flags;
- struct android_usb_function *func_t;
+ struct android_usb_function *func_t;
+ struct android_usb_function *f;
+ char *buff = t_resp->param;
+ int n = 0;
+ int max_len = 252;
+ int data_len = 0;
if(!_android_dev){
printk("android_set_rpmsg_resp, _android_dev is NULL\n");
@@ -3174,8 +3179,20 @@
}
break;
- //case :
- // break;
+ case USB_RPMSG_GET_USB_CURR_CONFIG:
+
+ t_resp->cmd = USB_RPMSG_GET_USB_CURR_CONFIG;
+ spin_lock_irqsave(&cdev->lock, flags);
+ list_for_each_entry(f, &_android_dev->enabled_functions, enabled_list)
+ {
+ n = snprintf(buff, (max_len - n), "%s,", f->name);
+ buff += n;
+ data_len += n;
+ }
+ t_resp->param[data_len] = '\0';
+ spin_unlock_irqrestore(&cdev->lock, flags);
+
+ break;
//case :
// break;
//case :
diff --git a/ap/os/linux/linux-3.4.x/include/linux/android_notify.h b/ap/os/linux/linux-3.4.x/include/linux/android_notify.h
index 8ac4fe9..c18981d 100755
--- a/ap/os/linux/linux-3.4.x/include/linux/android_notify.h
+++ b/ap/os/linux/linux-3.4.x/include/linux/android_notify.h
@@ -78,6 +78,7 @@
USB_RPMSG_GET_USB_STATE,
USB_RPMSG_GET_USB_LINK_STATE,
USB_RPMSG_GET_USB_ENUM_MODE,
+ USB_RPMSG_GET_USB_CURR_CONFIG,
//USB_RPMSG_GET_,
//USB_RPMSG_GET_,
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 5084741..5af9072 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
@@ -193,6 +193,7 @@
liblynq-qser-voice \
liblynq-qser-sim \
liblynq-qser-sms \
+ liblynq-qser-thermal \
liblynq-qser-data \
liblynq-qser-network \
liblynq-qser-gnss \
@@ -290,6 +291,7 @@
lynq-qser-sim-demo \
lynq-qser-sms-demo \
lynq-qser-data-demo \
+ lynq-qser-thermal-demo \
lynq-autosuspend \
lynq-atcid \
lynq-qser-autosuspend-demo \
diff --git a/cap/zx297520v3/sources/meta-zxic-custom/recipes-core/images/files/zx297520v3/vehicle_dc_ref/fs/normal/rootfs/etc/init.d/first.sh b/cap/zx297520v3/sources/meta-zxic-custom/recipes-core/images/files/zx297520v3/vehicle_dc_ref/fs/normal/rootfs/etc/init.d/first.sh
index 08edd81..04cd5f7 100755
--- a/cap/zx297520v3/sources/meta-zxic-custom/recipes-core/images/files/zx297520v3/vehicle_dc_ref/fs/normal/rootfs/etc/init.d/first.sh
+++ b/cap/zx297520v3/sources/meta-zxic-custom/recipes-core/images/files/zx297520v3/vehicle_dc_ref/fs/normal/rootfs/etc/init.d/first.sh
@@ -35,9 +35,13 @@
fi
mkdir -p /tmp
-mount -t tmpfs tmpfs /tmp
+#l.yang modify for T106BUG-387 start
+mount -t tmpfs tmpfs /tmp -o nodev,nosuid,noexec
+#l.yang modify for T106BUG-387 end
mkdir -p /run
-mount -t tmpfs tmpfs /run
+#l.yang modify for T106BUG-387 start
+mount -t tmpfs tmpfs /run -o nodev,nosuid,noexec
+#l.yang modify for T106BUG-387 end
mkdir -p /dev/pts
mount -t devpts devpts /dev/pts
diff --git a/cap/zx297520v3/sources/meta-zxic-custom/recipes-core/images/files/zx297520v3/vehicle_dc_ref/fs/normal/rootfs/etc/init.d/fscheck.sh b/cap/zx297520v3/sources/meta-zxic-custom/recipes-core/images/files/zx297520v3/vehicle_dc_ref/fs/normal/rootfs/etc/init.d/fscheck.sh
index 43539be..73e88e9 100755
--- a/cap/zx297520v3/sources/meta-zxic-custom/recipes-core/images/files/zx297520v3/vehicle_dc_ref/fs/normal/rootfs/etc/init.d/fscheck.sh
+++ b/cap/zx297520v3/sources/meta-zxic-custom/recipes-core/images/files/zx297520v3/vehicle_dc_ref/fs/normal/rootfs/etc/init.d/fscheck.sh
@@ -3,15 +3,11 @@
#cppdemo > /dev/null 2>&1 &
fscheck -f /etc_ro/fscheck/userdata.ini
-mkdir -p /mnt/oemdata/cache
-mkdir -p /mnt/oemdata/var/log
+
#q.huang@20230920 add for network start
mkdir -p /mnt/userdata/ril/network
#q.huang@20230920 add for network end
-if [ ! -L /var/run ]; then
- rm -fr /var/run
- ln -s /run /var/run
-fi
+
if [ -d "/etc/selinux" ];then
/sbin/restorecon -RF /etc_rw /mnt/userdata/ /mnt/oemdata/
@@ -23,6 +19,16 @@
else
/sbin/ubi_mount.sh /mnt/oem oem2 vol_oem squashfs
fi
+
+#l.yang modify for T106BUG-387 start
+if [ -e /dev/mmcblk1p1 ]; then
+ mount -t ext4 /dev/mmcblk1p1 /var/log
+else
+ mkdir -p /mnt/oemdata/log
+ mount /mnt/oemdata/log /var/log
+fi
+#l.yang modify for T106BUG-387 start
+
if [ $? -ne 0 ]; then
flags_tool_static --switch
reboot
diff --git a/cap/zx297520v3/sources/meta-zxic-custom/recipes-core/images/files/zx297520v3/vehicle_dc_ref/fs/normal/rootfs/etc_ro/default/default_parameter_sys b/cap/zx297520v3/sources/meta-zxic-custom/recipes-core/images/files/zx297520v3/vehicle_dc_ref/fs/normal/rootfs/etc_ro/default/default_parameter_sys
index 6d1c13f..0cc35f9e 100755
--- a/cap/zx297520v3/sources/meta-zxic-custom/recipes-core/images/files/zx297520v3/vehicle_dc_ref/fs/normal/rootfs/etc_ro/default/default_parameter_sys
+++ b/cap/zx297520v3/sources/meta-zxic-custom/recipes-core/images/files/zx297520v3/vehicle_dc_ref/fs/normal/rootfs/etc_ro/default/default_parameter_sys
@@ -76,7 +76,9 @@
OS=TOS
urlMobile=
DNS_proxy=
-dnsmasqfile=/var/log/dnsmasq.log
+#l.yang modify fot T106BUG-387 start
+dnsmasqfile=/mnt/userdata/log/dnsmasq.log
+#l.yang modify fot T106BUG-387 end
dnsmasqfileSize=1024
lan_domain_Enabled=1
auto_connect_when_limited=no
@@ -116,7 +118,9 @@
fota_ab_upgrade_total_size=0
fota_ab_upgrade_updated_size=0
fota_ab_aa_sync_status=2
-fota_ab_log_path=/cache/zte_fota_ab/upi_ab.log
+#l.yang modify fot T106BUG-387 start
+fota_ab_log_path=/mnt/userdata/zte_fota_ab/upi_ab.log
+#l.yang modify fot T106BUG-387 end
fota_aa_auto_sync=0
Login=admin
Password=
@@ -147,10 +151,10 @@
#syslogdÏà¹ØÅäÖÃ
syslog_file_size=1
syslog_file_num=5
-#you.chen modify for log
-print_level=3
+#jb.qi change for log on 20240110 start
+print_level=1
syslog_level=1
-#you.chen modify for log
+#jb.qi change for log on 20240110 end
skb_debug=
seclog_switch=
@@ -381,13 +385,17 @@
zcat_mode=CPUSB
zlog_num=10
zlog_size=100
-zlog_path=/mnt/userdata/zcat
-rule_file=/etc_ro/logrule/ati_std.rule
+#jb.qi change for nv_log on 20240110 start
+zlog_path=/mnt/oemdata/zcat
+rule_file=/etc_ro/logrule/all_3.rule
+#jb.qi change for nv_log on 20240110 end
-#ramdump´æ´¢Ä£Ê½
+#ramdump
ramdump_mode=USB
ramdump_device=/dev/mmcblk1p1
-ramdump_path=/cache
+#l.yang modify fot T106BUG-387 start
+ramdump_path=/mnt/userdata
+#l.yang modify fot T106BUG-387 end
#ÕÕÏà»úͼƬ·Ö±æÂÊÏÔʾ¿ØÖÆ
zcamera_interprolation=1
@@ -433,4 +441,4 @@
DEBUG_INFO_FILE_PATH=/mnt/userdata
DEBUG_INFO_FILE_NUM=2
DEBUG_INFO_FILE_TOTAL_SIZE=1
-#debug info end
\ No newline at end of file
+#debug info end
diff --git a/cap/zx297520v3/sources/meta-zxic-custom/recipes-core/images/files/zx297520v3/vehicle_dc_ref/fs/normal/rootfs/etc_ro/default/default_parameter_user b/cap/zx297520v3/sources/meta-zxic-custom/recipes-core/images/files/zx297520v3/vehicle_dc_ref/fs/normal/rootfs/etc_ro/default/default_parameter_user
index 88d46cd..0ae23b1 100755
--- a/cap/zx297520v3/sources/meta-zxic-custom/recipes-core/images/files/zx297520v3/vehicle_dc_ref/fs/normal/rootfs/etc_ro/default/default_parameter_user
+++ b/cap/zx297520v3/sources/meta-zxic-custom/recipes-core/images/files/zx297520v3/vehicle_dc_ref/fs/normal/rootfs/etc_ro/default/default_parameter_user
@@ -14,7 +14,9 @@
at_snap_flag=3
at_wifi_mac=0
auto_apn_index=0
-cid_reserved=1
+#xf.li@20240111 modify for T106BUG-480 start
+cid_reserved=0
+#xf.li@20240111 modify for T106BUG-480 end
clear_pb_when_restore=no
clear_sms_when_restore=no
default_apn=3gnet
diff --git a/cap/zx297520v3/sources/meta-zxic-custom/recipes-core/images/files/zx297520v3/vehicle_dc_ref/fs/normal/rootfs/postinstall.sh b/cap/zx297520v3/sources/meta-zxic-custom/recipes-core/images/files/zx297520v3/vehicle_dc_ref/fs/normal/rootfs/postinstall.sh
index b8a5064..df788bf 100755
--- a/cap/zx297520v3/sources/meta-zxic-custom/recipes-core/images/files/zx297520v3/vehicle_dc_ref/fs/normal/rootfs/postinstall.sh
+++ b/cap/zx297520v3/sources/meta-zxic-custom/recipes-core/images/files/zx297520v3/vehicle_dc_ref/fs/normal/rootfs/postinstall.sh
@@ -1,6 +1,12 @@
#!/bin/sh
-ln -s /mnt/oemdata/cache cache
+set -e
+
+#l.yang modify for T106BUG-387 ,create a log file in the/var directory start
+rm -fr var/* && ln -s /run var/run && mkdir -p var/log
+#l.yang modify for T106BUG-387 ,create a log file in the/var directory end
+
+#ln -s /mnt/userdata/cache cache
ln -s /etc/init.d/fscheck.sh ./etc/rcS.d/S14fscheck.sh
ln -s /etc/init.d/zcatlog_config.sh ./etc/rcS.d/S17zcatlog_config.sh
ln -s /etc/init.d/shutdown_first.sh ./etc/rcS.d/K01shutdown_first.sh
diff --git a/cap/zx297520v3/sources/meta-zxic-custom/recipes-core/images/zxic-image.bb b/cap/zx297520v3/sources/meta-zxic-custom/recipes-core/images/zxic-image.bb
index 4c9df17..b9d6b78 100755
--- a/cap/zx297520v3/sources/meta-zxic-custom/recipes-core/images/zxic-image.bb
+++ b/cap/zx297520v3/sources/meta-zxic-custom/recipes-core/images/zxic-image.bb
@@ -88,9 +88,6 @@
fakeroot distro_rootfs_files_sysvinit() {
rm -rf ${IMAGE_ROOTFS}/boot
cp -arfp ${FS-DIR}/fs/${BOOT_CTL}/rootfs/* ${IMAGE_ROOTFS}/
- if [ -f ${IMAGE_ROOTFS}/postinstall.sh ]; then
- cd ${IMAGE_ROOTFS} && sh postinstall.sh && rm -v ${IMAGE_ROOTFS}/postinstall.sh
- fi
rm -rf ${IMAGE_ROOTFS}/etc/rc[0-6].d
rm -f ${IMAGE_ROOTFS}/etc/fstab
@@ -217,17 +214,9 @@
ROOTFS_POSTPROCESS_COMMAND_remove += 'empty_var_volatile;'
-fakeroot do_ln_var(){
- if ${@bb.utils.contains('DISTRO_FEATURES','sysvinit','true','false',d)}; then
- rm -rf ${IMAGE_ROOTFS}/var
- if ${@bb.utils.contains('DISTRO_FEATURES','oemfs','true','false',d)}; then
- cd ${IMAGE_ROOTFS}/ && ln -snf mnt/oemdata/var var
- else
- cd ${IMAGE_ROOTFS}/ && ln -snf mnt/userdata/var var
- fi
- elif ${@bb.utils.contains('DISTRO_FEATURES','procd','true','false',d)}; then
- rm -rf ${IMAGE_ROOTFS}/var
- cd ${IMAGE_ROOTFS}/ && ln -snf tmp var
+fakeroot do_postinstall(){
+ if [ -f ${IMAGE_ROOTFS}/postinstall.sh ]; then
+ cd ${IMAGE_ROOTFS} && sh postinstall.sh && rm -v ${IMAGE_ROOTFS}/postinstall.sh
fi
}
@@ -256,7 +245,7 @@
}
IMAGE_POSTPROCESS_COMMAND_prepend = ' \
- do_ln_var; \
+ do_postinstall; \
${@bb.utils.contains("TCLIBC", "musl", "do_ln_musl_ld;", "", d)} \
${@bb.utils.contains("DISTRO_FEATURES", "selinux", "selinux_set_labels ;", "", d)} \
'
diff --git a/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/liblynq-at-common/liblynq-at-common.bb b/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/liblynq-at-common/liblynq-at-common.bb
index f50d299..70f1504 100755
--- a/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/liblynq-at-common/liblynq-at-common.bb
+++ b/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/liblynq-at-common/liblynq-at-common.bb
@@ -3,7 +3,7 @@
DESCRIPTION = "liblynq-at-common"
LICENSE = "CLOSED"
LIC_FILES_CHKSUM = "file://LICENSE;md5=3f86c7f456a6d0bbeca155e65084eee1"
-DEPENDS += "liblynq-log liblynq-qser-autosuspend"
+DEPENDS += "liblynq-log liblynq-qser-autosuspend liblynq-led"
#inherit workonsrc
WORKONSRC = "${TOPDIR}/../src/lynq/lib/liblynq-at-common/"
FILESEXTRAPATHS_prepend :="${TOPDIR}/../src/lynq/lib/:"
diff --git a/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/liblynq-qser-autosuspend/liblynq-qser-autosuspend.bb b/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/liblynq-qser-autosuspend/liblynq-qser-autosuspend.bb
index 2f48049..45bfa6b 100755
--- a/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/liblynq-qser-autosuspend/liblynq-qser-autosuspend.bb
+++ b/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/liblynq-qser-autosuspend/liblynq-qser-autosuspend.bb
@@ -4,7 +4,7 @@
LICENSE = "CLOSED"
LIC_FILES_CHKSUM = "file://LICENSE;md5=e1696b147d49d491bcb4da1a57173fff"
-DEPENDS += "${@bb.utils.contains('TARGET_PLATFORM', 'mt2735', 'audio-mixer-ctrl streamer1.0', '', d)} liblynq-autosuspend liblynq-log at-ctl libsctel"
+DEPENDS += "${@bb.utils.contains('TARGET_PLATFORM', 'mt2735', 'audio-mixer-ctrl streamer1.0', '', d)} liblynq-autosuspend liblynq-log liblynq-uci"
#inherit workonsrc
WORKONSRC = "${TOPDIR}/../src/lynq/lib/liblynq-qser-autosuspend/"
FILESEXTRAPATHS_prepend :="${TOPDIR}/../src/lynq/lib/:"
diff --git a/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/liblynq-qser-thermal/liblynq-qser-thermal.bb b/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/liblynq-qser-thermal/liblynq-qser-thermal.bb
new file mode 100755
index 0000000..cdc8bd1
--- /dev/null
+++ b/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/liblynq-qser-thermal/liblynq-qser-thermal.bb
@@ -0,0 +1,53 @@
+#inherit externalsrc package
+
+DESCRIPTION = "liblynq-qser-thermal"
+LICENSE = "CLOSED"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=e1696b147d49d491bcb4da1a57173fff"
+DEPENDS += "liblynq-log"
+#inherit workonsrc
+WORKONSRC = "${TOPDIR}/../src/lynq/lib/liblynq-qser-thermal/"
+FILESEXTRAPATHS_prepend :="${TOPDIR}/../src/lynq/lib/:"
+SRC_URI = " \
+ file://liblynq-qser-thermal \
+ "
+
+SRC-DIR = "${S}/../liblynq-qser-thermal"
+
+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 -DTELEPHONYWARE"
+}
+
+do_install () {
+ oe_runmake install -C ${SRC-DIR} ROOT=${D}
+
+ if [ -d "${WORKONSRC}" ] ; then
+ install -d ${D}${includedir}/
+ cp -af ${SRC-DIR}/include/ ${D}${includedir}/
+ fi
+}
+
+addtask bachclean
+do_bachclean () {
+ oe_runmake clean
+}
diff --git a/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-autosuspend/files/autosuspend_wakeup_count.c b/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-autosuspend/files/autosuspend_wakeup_count.c
index 2a113a1..3f01e93 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
@@ -34,22 +34,22 @@
//#include <cutils/properties.h>
#define USER_LOG_TAG "PMS"
#include <liblog/lynq_deflog.h>
+#include <include/lynq_uci.h>
+
#include <log/log.h>
#include <stdlib.h>
#include "autosuspend_ops.h"
-
-#ifdef MOBILETEK_SUSPEND_CFG
+#include <sc_mnet_whitelist.h>
+#include <sc_at.h>
#define SYS_POWER_STATE "/sys/power/state"
-#endif
-#ifdef MOBILETEK_TARGET_PLATFORM_T106
-#define SYS_POWER_STATE "/sys/power/autosleep"
-#endif
#define SYS_POWER_WAKEUP_COUNT "/sys/power/wakeup_count"
#define SYS_POWER_SPM_SUSPEND_CRTL "/sys/power/spm/suspend_ctrl"
#define BASE_SLEEP_TIME 100000
#define POSSIBLE_MAX_SLEEP_TIME 60000000
+#define LOG_UCI_MODULE "lynq_autosuspend"
+#define LOG_UCI_FILE "lynq_uci"
static int state_fd;
static int wakeup_count_fd;
@@ -231,22 +231,122 @@
}
dlerror(); // Clear any previous dlerror
- return;
+ return;
}
#endif
#ifdef MOBILETEK_TARGET_PLATFORM_T106
+int t106_set_blacklist(int blacklist_state)
+{
+ int ret;
+ char rsp[128];
+ char cmdstr[256];
+ if(blacklist_state == 0)
+ {
+ strcpy(cmdstr, "AT+SHELL=echo \"+CREG:+CGREG:+CEREG:^MODE:\" > /sys/module/at_io/parameters/at_psm_filter\r\n");
+ }
+ else
+ {
+ strcpy(cmdstr, "AT+SHELL=echo \"\" > /sys/module/at_io/parameters/at_psm_filter\r\n");
+ }
+ printf("cmd:%s\n",cmdstr);
+ ret = sc_at_send(1,cmdstr,rsp,sizeof(rsp));
+ printf("sc_at_send result:%d %s\n",ret,rsp);
+ return ret;
+
+}
+int t106_set_whitelist(void)
+{
+ char tmp[8];
+ int ret;
+ lynq_get_value(LOG_UCI_FILE, LOG_UCI_MODULE, "whitelist_state", tmp);
+ if(strlen(tmp) != 4)
+ {
+ RLOGD("the whitelist len is error\n");
+ return 0;
+ }
+ if(tmp[0] == '1')
+ {
+ ret = sc_mnet_whitelist_add(1);
+ if(ret)
+ {
+ RLOGD("sc_mnet_whitelist_add 1 fail\n");
+ return ret;
+ }
+ ret = sc_mnet_whitelist_add(5);
+ if(ret)
+ {
+ RLOGD("sc_mnet_whitelist_add 5 fail\n");
+ return ret;
+ }
+ }
+ if(tmp[1] == '1')
+ {
+ ret = sc_mnet_whitelist_add(2);
+ if(ret)
+ {
+ RLOGD("sc_mnet_whitelist_add 2 fail\n");
+ return ret;
+ }
+ }
+ if(tmp[2] == '1')
+ {
+ ret = sc_mnet_whitelist_add(3);
+ if(ret)
+ {
+ RLOGD("sc_mnet_whitelist_add 3 fail\n");
+ return ret;
+ }
+ }
+ if(tmp[3] == '1')
+ {
+ ret = sc_mnet_whitelist_add(4);
+ if(ret)
+ {
+ RLOGD("sc_mnet_whitelist_add 4 fail\n");
+ return ret;
+ }
+ }
+
+ return 0;
+
+}
int t106_early_suspend(void)
{
+ int ret;
RLOGD("t106_early_suspend start\n");
system("zlog_nvctrl -m 1");
+ ret = t106_set_whitelist();
+ if(ret)
+ {
+ RLOGD("t106_set_whitelist ret=%d\n", ret);
+ return ret;
+ }
+ ret = t106_set_blacklist(0);
+ if(ret)
+ {
+ RLOGD("t106_set_blacklist ret=%d\n", ret);
+ return ret;
+ }
return 0;
}
void t106_early_resume(void)
{
+ int ret;
RLOGD("t106_early_resume start\n");
+ ret = t106_set_blacklist(1);
+ if(ret)
+ {
+ RLOGD("t106_set_whitelist ret=%d\n", ret);
+ }
+ ret = sc_mnet_whitelist_clear();
+ if(ret)
+ {
+ RLOGD("sc_mnet_whitelist_clear ret=%d\n", ret);
+ }
system("zlog_nvctrl -m 0");
+
return NULL;
}
#endif
@@ -584,6 +684,15 @@
ALOGI("Error creating semaphore: %s\n", buf);
goto err_sem_init;
}
+ if(sc_at_init(1)){
+ ALOGD("sc_at_init failed.\n");
+ return NULL;
+ }
+ if(sc_mnet_whitelist_init() != 0)
+ {
+ ALOGD("sc_mnet_whitelist_init failed.\n");
+ return NULL;
+ }
ret = pthread_create(&suspend_thread, NULL, suspend_thread_func, NULL);
if (ret) {
strerror_r(ret, buf, sizeof(buf));
diff --git a/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-autosuspend/files/makefile b/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-autosuspend/files/makefile
index 0441d43..a2eba39 100755
--- a/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-autosuspend/files/makefile
+++ b/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-autosuspend/files/makefile
@@ -47,6 +47,10 @@
-llynq-uci \
-llog \
-lbsp \
+ -lsctel \
+ -latutils \
+ -latreg \
+
SOURCES = $(wildcard *.c )
diff --git a/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-autosuspend/lynq-autosuspend.bb b/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-autosuspend/lynq-autosuspend.bb
index 23076f4..96c90de 100755
--- a/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-autosuspend/lynq-autosuspend.bb
+++ b/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-autosuspend/lynq-autosuspend.bb
@@ -22,7 +22,7 @@
LOCAL_C_INCLUDES = "-I. "
DEPENDS = "liblynq-log liblynq-uci"
-DEPENDS += "${@bb.utils.contains('TARGET_PLATFORM', 'mt2735', 'audio-mixer-ctrl streamer1.0', '', d)} liblynq-log liblynq-uci libbsp"
+DEPENDS += "${@bb.utils.contains('TARGET_PLATFORM', 'mt2735', 'audio-mixer-ctrl streamer1.0', '', d)} liblynq-log liblynq-uci libbsp libsctel libatutils libatreg"
LOCAL_LIBS = "-L. -ldl -lstdc++ -lpthread -llog"
SOURCES = "$(wildcard *.c )"
diff --git a/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-fota-backup/files/lynq-fota-backup.cpp b/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-fota-backup/files/lynq-fota-backup.cpp
index 2c4f1e0..d91390c 100755
--- a/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-fota-backup/files/lynq-fota-backup.cpp
+++ b/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-fota-backup/files/lynq-fota-backup.cpp
@@ -27,6 +27,7 @@
extern "C" {
#endif
+#define FOTA_REBOOT_FLAG "/mnt/userdata/.fota_reboot_flag"
#define FOTA_FLAG_FILE "/mnt/userdata/.back_up_flag"
#define FOTA_SYNC_FLAG 1
@@ -34,6 +35,24 @@
extern int lynq_fota_get_addr_value(char *tmp_value);
extern int lynq_fota_set_addr_value(char *value,int size);
extern int lynq_fota_nrestart(void);
+#define REBOOT_DONE 1
+
+void set_upgrade_reboot_flag(void)
+{
+ FILE *fp = NULL;
+ int reboot_flag = REBOOT_DONE;
+ fp = fopen(FOTA_REBOOT_FLAG,"w+");
+ if(fp == NULL)
+ {
+ printf("Open reboot flag file failed\n");
+ return;
+ }
+
+ fwrite(&reboot_flag,sizeof(int),1,fp);
+ fclose(fp);
+ system("sync");
+ return ;
+}
int main()
{
int ret = 0 ;
@@ -48,16 +67,23 @@
return -1;
}
-
- //read fota upgrade flag, 0 :upgrade failed, 1:upgrade success
+
fread(&sync_flag,sizeof(int),1,fp);
-
+ fclose(fp);
+
+ set_upgrade_reboot_flag();
+
if(sync_flag == FOTA_SYNC_FLAG)
{
- printf("upgrade flag is success ");
- return 0;
+ ret = lynq_sync_system();
+ if(ret != 0)
+ {
+ printf("sync faild\n");
+ }
+ system("rm -rf /mnt/userdata/.back_up_flag");
+
}
- else if(sync_flag != FOTA_SYNC_FLAG)
+ else if(sync_flag != FOTA_SYNC_FLAG)
{
ret = lynq_fota_get_addr_value(tmp_addr);
if(ret != 0)
@@ -71,7 +97,6 @@
{
printf("Set addr failed\n");
return -1;
-
}
ret = lynq_fota_nrestart();
if(ret != 0)
@@ -81,8 +106,7 @@
}
}
-
-
+
return 0;
}
diff --git a/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-irq-demo/files/lynq-irq-demo.cpp b/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-irq-demo/files/lynq-irq-demo.cpp
index 0f8ddef..3b3bafc 100755
--- a/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-irq-demo/files/lynq-irq-demo.cpp
+++ b/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-irq-demo/files/lynq-irq-demo.cpp
@@ -144,8 +144,8 @@
else
{
printf("lynq_irq_uninstall success\n");
- break;
}
+ break;
}
else
{
diff --git a/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-qser-autosuspend-demo/files/lynq-qser-autosuspend-demo.cpp b/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-qser-autosuspend-demo/files/lynq-qser-autosuspend-demo.cpp
index 4437af4..fbaa297 100755
--- a/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-qser-autosuspend-demo/files/lynq-qser-autosuspend-demo.cpp
+++ b/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-qser-autosuspend-demo/files/lynq-qser-autosuspend-demo.cpp
@@ -29,12 +29,11 @@
printf("-al [wakelock num] --qser_wakelock_lock \n");
printf("-rl [wakelock num] --qser_wakelock_unlock \n");
printf("-dl [wakelock num] --qser_wakelock_destroy\n");
+ printf("-ws [whitelist num] --qser_whitelist_set\n");
+ printf("-wg --qser_whitelist_get\n");
printf("-ccl --check created locks\n");
printf("-cll --check lockup locks\n");
- printf("-wla [id] --qser_whitelist_add\n");
- printf("-wld [id] --qser_whitelist_del\n");
- printf("-wlg --qser_whitelist_get\n");
- printf("-wlc --qser_whitelist_clear\n");
+ printf("-cws --check wakeup sources\n");
printf("Please input an cmd:");
}
@@ -90,9 +89,12 @@
int num;
int ret;
int len;
- char cmd[16];
+ FILE *fp;
+ char buf[256];
+ char cmd[64];
char *cmd2;
char *cmd1;
+ char tmp[8];
qser_pm_cfg_t *qser_lpm_cfg = NULL;
qser_lpm_cfg = (qser_pm_cfg_t *)malloc(sizeof(qser_pm_cfg_t));
qser_lpm_cfg->wakeupin.wakeupin_pin = 50;
@@ -137,6 +139,7 @@
if(cmd2 == NULL)
{
printf("name is null\n");
+ continue;
}
len = strlen(cmd2);
printf("len =%d\n", len);
@@ -157,6 +160,7 @@
if(cmd2 == NULL)
{
printf("fd is null\n");
+ continue;
}
num = atoi(cmd2);
ret = qser_wakelock_lock(num);
@@ -176,6 +180,7 @@
if(cmd2 == NULL)
{
printf("fd is null\n");
+ continue;
}
num = atoi(cmd2);
ret = qser_wakelock_unlock(num);
@@ -194,6 +199,7 @@
if(cmd2 == NULL)
{
printf("fd is null\n");
+ continue;
}
num = atoi(cmd2);
ret = qser_wakelock_destroy(num);
@@ -207,6 +213,38 @@
printf("wakelock destroy success\n");
}
}
+ else if(strcmp(cmd1, "-ws") == 0)
+ {
+ if(cmd2 == NULL)
+ {
+ printf("num is null\n");
+ continue;
+ }
+ delete_enter(cmd2);
+ ret = qser_whitelist_set(cmd2);
+ if(ret != 0)
+ {
+ printf("qser_whitlist_set fail\n");
+ printf("ret=%d\n", ret);
+ }
+ else
+ {
+ printf("qser_whitlist_set success\n");
+ }
+ }
+ else if(strcmp(cmd1, "-wg") == 0)
+ {
+ ret = qser_whitelist_get(tmp);
+ if(ret != 0)
+ {
+ printf("qser_whitlist_set fail\n");
+ }
+ else
+ {
+ printf("qser_whitlist_set success\n");
+ printf("ret=%d, whilelist state is %s\n", ret, tmp);
+ }
+ }
else if(strcmp(cmd1,"-ccl") == 0)
{
int ret;
@@ -230,38 +268,16 @@
printf("check created lock fail\n");
}
}
- else if(strcmp(cmd1,"-wla") == 0)
+ else if(strcmp(cmd1,"-cws") == 0)
{
- num = atoi(cmd2);
- ret = qser_whitelist_add(num);
- if(ret != 0)
+ printf("start check active wakeup_sources !!!\n");
+ memset(buf,0,sizeof(buf));
+ fp = popen("cat /sys/kernel/debug/wakeup_sources|sed -e 's/\"^ \"/\"unnamed\"/g' | awk '{print $6 \"\t\" $1}'| grep -v \"^0\" |sort -n \n","r");
+ while(fgets(buf, 255, fp) != NULL)
{
- printf("mnet_whitelist_add ret %d.\n", ret);
+ printf("%s", buf);
}
-
- }
- else if(strcmp(cmd1,"-wld") == 0)
- {
- num = atoi(cmd2);
- ret = qser_whitelist_del(num);
- if(ret != 0)
- {
- printf("mnet_whitelist_del ret %d.\n", ret);
- }
- }
- else if(strcmp(cmd1,"-wlg") == 0)
- {
- char* whitelist;
- qser_whitelist_get(whitelist);
- printf("mnet_whitelist_get :%s\n",whitelist);
- }
- else if(strcmp(cmd1,"-wlc") == 0)
- {
- ret = qser_whitelist_clear();
- if(ret != 0)
- {
- printf("mnet_whitelist_clear ret %d.\n", ret);
- }
+ pclose(fp);
}
else if(strcmp(cmd1, "-d") == 0)
{
diff --git a/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-qser-fota-demo/files/lynq-qser-fota-demo.cpp b/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-qser-fota-demo/files/lynq-qser-fota-demo.cpp
index 63c9504..de637ec 100755
--- a/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-qser-fota-demo/files/lynq-qser-fota-demo.cpp
+++ b/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-qser-fota-demo/files/lynq-qser-fota-demo.cpp
@@ -5,14 +5,30 @@
#include <unistd.h>
#include <dlfcn.h>
#include <stdint.h>
+#include <pthread.h>
int (*lynq_get_upgrade_status)(void);
int (*lynq_fota_set_addr_value)(char *value,int size);
int (*lynq_fota_nrestart)(void);
int (*lynq_rock_main)(int first_run);
-
+int (*lynq_read_process)(void);
void *dlHandle_fota = NULL;
+void *thread_function_noreboot(void *arg)
+{
+
+ lynq_fota_nrestart();
+ return NULL;
+}
+
+void *thread_function_reboot(void *arg)
+{
+
+ lynq_rock_main(1);
+ return NULL;
+}
+
+
int main(int argc,char *argv[])
{
int ret = 0;
@@ -53,6 +69,13 @@
printf("lynq_rock_main is null\n");
return -1;
}
+
+ lynq_read_process = (int (*)(void))dlsym(dlHandle_fota,"lynq_read_process");
+ if(lynq_read_process == NULL)
+ {
+ printf("lynq_read_process is null\n");
+ return -1;
+ }
ret = lynq_fota_set_addr_value(value,(int )strlen(value));
if(ret != 0)
@@ -60,34 +83,53 @@
printf("set upgrade package addr failed\n");
return -1;
}
-
- printf("Please chose reboot or not when upgrade done 1: reboot 0: not reboot\n");
- scanf("%d",&reboot_flag);
-
- switch(reboot_flag)
+ while(1)
{
- case 0:
- printf("Not reboot when upgrade done!!!\n ");
- ret = lynq_fota_nrestart();
- printf("upgrade result is %d\n",ret);
- ret = lynq_get_upgrade_status();
- printf("get upgrade status result is %d\n",ret);
- break;
+ printf("Please chose action 0: upgrade done ,not reboot 1: upgrade done ,reboot 2:get upgrade status 3:read fota process \n");
+ scanf("%d",&reboot_flag);
- case 1:
- printf("Will reboot when upgrade done!!!\n ");
- ret = lynq_rock_main(1);
- printf("upgrade result is %d\n",ret);
- ret = lynq_get_upgrade_status();
- printf("get upgrade status result is %d\n",ret);
- break;
+ switch(reboot_flag)
+ {
+ case 0:
+ {
+ pthread_t thread_id_noreboot;
+ int result = pthread_create(&thread_id_noreboot, NULL, thread_function_noreboot, NULL);
+ if (result != 0)
+ {
+ printf("pthread_create failed \n");
+ return -1;;
+ }
+ }
+ break;
- default:
- printf("please input right flag 1 or 0\n");
- break;
+ case 1:
+ {
+ pthread_t thread_id_reboot;
+ int result = pthread_create(&thread_id_reboot, NULL, thread_function_reboot, NULL);
+ if (result != 0)
+ {
+ printf("pthread_create failed \n");
+ return -1;;
+ }
+ }
+ break;
+ case 2:
+ printf("Get fota upgrade status \n");
+ ret = lynq_get_upgrade_status();
+ printf("lynq_get_upgrade_status ret is %d\n",ret);
+ break;
+ case 3:
+ printf("get fota upgrade process\n");
+ ret = lynq_read_process();
+ printf("Now upgrade process is %d\n",ret);
+ break;
+ default:
+ printf("please input right flag 0 or 1 or 2 or 3\n");
+ break;
+ }
+
}
-
return 0;
}
diff --git a/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-qser-fota-demo/lynq-qser-fota-demo.bb b/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-qser-fota-demo/lynq-qser-fota-demo.bb
index d24b8bb..1ce3f8c 100644
--- a/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-qser-fota-demo/lynq-qser-fota-demo.bb
+++ b/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-qser-fota-demo/lynq-qser-fota-demo.bb
@@ -16,7 +16,7 @@
LOCAL_C_INCLUDES = "-I."
-LOCAL_LIBS = "-L. -ldl -lstdc++"
+LOCAL_LIBS = "-L. -ldl -lstdc++ -lpthread"
#INHIBIT_PACKAGE_STRIP = "1"
S = "${WORKDIR}"
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 0cb7976..a7d62ec 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
@@ -145,7 +145,7 @@
char msg[MSG_BUF] = {};
QSER_sms_info_t pt_sms_info;
// sprintf(telephony_num,"10086");//è¯·ç”¨æˆ·åŠ¡å¿…æ›¿æ¢æ¤å·ç ï¼Œéšæ„å‘è¿è¥å•†å‘çŸæ¶ˆæ¯æžæœ‰å¯èƒ½è¢«å°å·ã€‚
- sprintf(msg,"hello");
+ sprintf(msg,"\"Chello worrld-7bit-mr!./\"");
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_7BIT;
diff --git a/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-qser-thermal-demo/files/lynq-qser-thermal-demo.cpp b/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-qser-thermal-demo/files/lynq-qser-thermal-demo.cpp
new file mode 100755
index 0000000..03a5926
--- /dev/null
+++ b/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-qser-thermal-demo/files/lynq-qser-thermal-demo.cpp
@@ -0,0 +1,49 @@
+#include <sys/types.h>
+#include <dirent.h>
+#include <unistd.h>
+#include <stdio.h>
+#include <string.h>
+#include <fcntl.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <dlfcn.h>
+
+#include"lynq-qser-thermal-demo.h"
+
+
+int (*get_thermal_zone)(int *numbers, int size);
+
+
+int main(int argc, char *argv[]){
+ int numbers[MAX_SIZE];
+ int ret = 0;
+ const char *lynq_libpath_thermal = "/lib/liblynq-qser-thermal.so";
+
+ void *dlHandle_thermal = dlopen(lynq_libpath_thermal, RTLD_NOW);
+ if (dlHandle_thermal == NULL)
+ {
+ printf("dlopen dlHandle_thermal failed: %s\n", dlerror());
+ exit(EXIT_FAILURE);
+ }
+ get_thermal_zone = (int(*)(int *numbers, int size))dlsym(dlHandle_thermal,"get_thermal_zone");
+ if(NULL != get_thermal_zone)
+ {
+ ret = get_thermal_zone(numbers, MAX_SIZE);
+ if (ret <= 0) {
+ printf("get_thermal_zone error\n");
+ return -1;
+ }
+ }else{
+ printf("get_thermal_zone dlsym error\n");
+ }
+
+ for (int j = 0; j < ret; ++j) {
+ printf("[%s-%d] temp[%d] = %d \n", __func__, __LINE__, j, numbers[j]);
+ }
+
+ return 0;
+}
+
+
+
+
diff --git a/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-qser-thermal-demo/files/lynq-qser-thermal-demo.h b/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-qser-thermal-demo/files/lynq-qser-thermal-demo.h
new file mode 100755
index 0000000..6366538
--- /dev/null
+++ b/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-qser-thermal-demo/files/lynq-qser-thermal-demo.h
@@ -0,0 +1,5 @@
+#define MAX_SIZE 100
+#define MAX_LINES 5
+#define MAX_LINE_LENGTH 10
+
+
diff --git a/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-qser-thermal-demo/files/makefile b/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-qser-thermal-demo/files/makefile
new file mode 100755
index 0000000..4468ca5
--- /dev/null
+++ b/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-qser-thermal-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-qser-thermal \
+
+SOURCES = lynq-qser-thermal-demo.cpp
+
+EXECUTABLE = lynq-qser-thermal-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-thermal-demo/lynq-qser-thermal-demo.bb b/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-qser-thermal-demo/lynq-qser-thermal-demo.bb
new file mode 100755
index 0000000..bfd0a84
--- /dev/null
+++ b/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-qser-thermal-demo/lynq-qser-thermal-demo.bb
@@ -0,0 +1,33 @@
+# Package summary
+SUMMARY = "lynq-qser-thermal-demo"
+# License, for example MIT
+LICENSE = "MIT"
+# License checksum file is always required
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
+
+SRC_URI = "file://lynq-qser-thermal-demo.h file://lynq-qser-thermal-demo.cpp"
+
+SRC-DIR = "${S}/../lynq-qser-thermal-demo"
+TARGET_CC_ARCH += "${LDFLAGS}"
+
+#Parameters passed to do_compile()
+EXTRA_OEMAKE = "'TARGET_PLATFORM = ${TARGET_PLATFORM}'\"
+EXTRA_OEMAKE += "'MOBILETEK_RIL_CFG = ${MOBILETEK_RIL_CFG}'"
+
+LOCAL_C_INCLUDES = "-I."
+
+LOCAL_LIBS = "-L. -ldl -g -Os -lstdc++"
+
+#INHIBIT_PACKAGE_STRIP = "1"
+S = "${WORKDIR}"
+
+#INHIBIT_PACKAGE_STRIP = "1"
+do_compile () {
+
+ ${CXX} -Wall lynq-qser-thermal-demo.cpp ${LOCAL_LIBS} ${LOCAL_C_INCLUDES} -o lynq-qser-thermal-demo
+}
+
+do_install() {
+ install -d ${D}${bindir}/
+ install -m 0755 ${S}/lynq-qser-thermal-demo ${D}${bindir}/
+}
diff --git a/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-qser-voice-demo/files/lynq-qser-voice-demo.cpp b/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-qser-voice-demo/files/lynq-qser-voice-demo.cpp
index 81185d9..d6ddaf1 100755
--- a/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-qser-voice-demo/files/lynq-qser-voice-demo.cpp
+++ b/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-qser-voice-demo/files/lynq-qser-voice-demo.cpp
@@ -24,6 +24,7 @@
{3, "qser_voice_call_answer"},
{4, "qser_voice_set_speech_volume"},
{5, "qser_voice_get_speech_volume"},
+ {6, "qser_voice_set_dtmf"},
{-1, NULL}
};
@@ -31,7 +32,6 @@
typedef uint32_t voice_client_handle_type;
-static pthread_t s_lynq_voice_tid = -1;
int (*qser_voice_call_client_init)(voice_client_handle_type *ph_voice);
int (*qser_voice_call_client_deinit)(voice_client_handle_type );
@@ -48,6 +48,7 @@
int (*qser_voice_call_answer)(voice_client_handle_type ,int );
int (*qser_voice_set_speech_volume)(const int volume);
int (*qser_voice_get_speech_volume)(int *volume);
+int (*qser_voice_set_dtmf)(const char callnum);
void *dlHandle_call = NULL;
@@ -156,6 +157,13 @@
printf("qser_voice_get_speech_volume not defined or exported in %s\n", lynqLibPath_Call);
return -1;
}
+
+ qser_voice_set_dtmf = (int (*)(const char ))dlsym(dlHandle_call,"qser_voice_set_dtmf");
+ if(qser_voice_set_dtmf == NULL)
+ {
+ printf("qser_voice_set_dtmf not defined or exported in %s\n", lynqLibPath_Call);
+ return -1;
+ }
ret = qser_voice_call_client_init(&h_voice);
if(ret != 0 )
@@ -244,6 +252,25 @@
break;
}
+ case 6:
+ {
+
+ int ret;
+ char inputChar;
+
+ printf("Enter set dtmf\n");
+ scanf(" %c", &inputChar);
+ printf("inputChar is %c\n", inputChar);
+ ret = qser_voice_set_dtmf(inputChar);
+
+ if (ret != 0)
+ {
+ printf("qser set voice dtmf failed\n");
+ return -1;
+ }
+ break;
+ }
+
default:
print_help();
break;
diff --git a/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/poweralarm-demo/files/poweralarm-demo.cpp b/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/poweralarm-demo/files/poweralarm-demo.cpp
index 2e0f71f..0bca3bb 100755
--- a/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/poweralarm-demo/files/poweralarm-demo.cpp
+++ b/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/poweralarm-demo/files/poweralarm-demo.cpp
@@ -8,7 +8,7 @@
#define INIT_SUCCESS 0
-
+#define RTC_DEINIT -1
typedef struct
{
int cmdIdx;
@@ -285,6 +285,10 @@
printf("lynq rtc service deinit failed \n");
return -1;
}
+ else
+ {
+ init_flag = RTC_DEINIT;
+ }
}
break;
}
diff --git a/cap/zx297520v3/sources/meta-zxic-selinux/recipes-security/refpolicy/files/policy-mls/policy/modules/system/logging.te b/cap/zx297520v3/sources/meta-zxic-selinux/recipes-security/refpolicy/files/policy-mls/policy/modules/system/logging.te
old mode 100755
new mode 100644
index 2672b4a..fe01295
--- a/cap/zx297520v3/sources/meta-zxic-selinux/recipes-security/refpolicy/files/policy-mls/policy/modules/system/logging.te
+++ b/cap/zx297520v3/sources/meta-zxic-selinux/recipes-security/refpolicy/files/policy-mls/policy/modules/system/logging.te
@@ -526,7 +526,7 @@
# for systemd-journal
allow syslogd_t self:netlink_audit_socket connected_socket_perms;
allow syslogd_t self:capability2 audit_read;
- allow syslogd_t self:capability { chown setgid setuid sys_ptrace dac_read_search };
+ allow syslogd_t self:capability { chown setgid setuid sys_ptrace dac_read_search sys_rawio };
allow syslogd_t self:netlink_audit_socket { getattr getopt read setopt write nlmsg_write };
# remove /run/log/journal when switching to permanent storage
@@ -671,6 +671,7 @@
allow syslogd_t mnt_t:dir { search };
allow syslogd_t tmpfs_t:dir { write add_name remove_name search };
+allow syslogd_t self:capability { sys_rawio };
diff --git a/cap/zx297520v3/sources/meta-zxic/recipes-kernel/linux/files/zx297520v3/linux-5_10-vehicle_dc_ref-normal-defconfig b/cap/zx297520v3/sources/meta-zxic/recipes-kernel/linux/files/zx297520v3/linux-5_10-vehicle_dc_ref-normal-defconfig
index a8470b2..8206074 100755
--- a/cap/zx297520v3/sources/meta-zxic/recipes-kernel/linux/files/zx297520v3/linux-5_10-vehicle_dc_ref-normal-defconfig
+++ b/cap/zx297520v3/sources/meta-zxic/recipes-kernel/linux/files/zx297520v3/linux-5_10-vehicle_dc_ref-normal-defconfig
@@ -1395,6 +1395,9 @@
# CONFIG_NET_VENDOR_XILINX is not set
CONFIG_NET_VENDOR_ZTE=y
CONFIG_ZX29_GMAC=y
+# zw.wang modify for T106BUG-423 20240118 start
+CONFIG_BOOT_WITHOUT_LOCK=y
+# zw.wang modify for T106BUG-423 20240118 end
CONFIG_PHYLIB=y
CONFIG_SWPHY=y
CONFIG_FIXED_PHY=y
diff --git a/cap/zx297520v3/src/lynq/framework/lynq-atcid/lynq_atsvc_plugin.xml b/cap/zx297520v3/src/lynq/framework/lynq-atcid/lynq_atsvc_plugin.xml
index 1fa3af5..3ec11c8 100755
--- a/cap/zx297520v3/src/lynq/framework/lynq-atcid/lynq_atsvc_plugin.xml
+++ b/cap/zx297520v3/src/lynq/framework/lynq-atcid/lynq_atsvc_plugin.xml
@@ -10,7 +10,7 @@
/>
<module name="/lib/liblynq-at-common.so"
register="lynq_register_at_common"
- cmd="AT+MNETCALL;AT+GTARNDIS;AT+CGIR;AT+LGMDS;AT+LRNDISHANDLE;AT+LEELSP"
+ cmd="AT+MNETCALL;AT+GTARNDIS;AT+CGIR;AT+LGMDS;AT+LRNDISHANDLE;AT+LEELSP;AT+NETLED;AT+STATUSLED"
/>
<module name="/lib/liblynq-at-factory.so"
register="lynq_register_at_factory"
diff --git a/cap/zx297520v3/src/lynq/lib/liblynq-at-common/liblynq-at-common.cpp b/cap/zx297520v3/src/lynq/lib/liblynq-at-common/liblynq-at-common.cpp
index ea38faf..391d43c 100755
--- a/cap/zx297520v3/src/lynq/lib/liblynq-at-common/liblynq-at-common.cpp
+++ b/cap/zx297520v3/src/lynq/lib/liblynq-at-common/liblynq-at-common.cpp
@@ -7,6 +7,7 @@
#include <liblog/lynq_deflog.h>
#include "include/liblynq-at-common.h"
#include <include/lynq-qser-autosuspend.h>
+#include <libled/lynq_led.h>
DEFINE_LYNQ_LIB_LOG(LYNQ_AT_COMMON)
@@ -67,10 +68,54 @@
return;
}
+void lynq_handle_netled(char* input)
+{
+ int ret;
+ char buf[64] = {0};
+ int mode = input[strlen(input)-1]-'0';
+ ALOGE("lynq_handle_netled start\n");
+
+ ret = lynq_set_netled_on(mode);
+ if(ret != 0)
+ {
+ sprintf(buf,"+CME ERROR: 100\r\n");
+ handle_output(buf, strlen(buf), Response);
+ }
+ else
+ {
+ lynq_response_ok();
+ }
+
+ return;
+}
+
+void lynq_handle_statusled(char* input)
+{
+ int ret;
+ char buf[64] = {0};
+ int mode = input[strlen(input)-1]-'0';
+
+ ALOGE("lynq_handle_statusled start\n");
+ ret = lynq_set_statusled_on(mode);
+
+ if(ret != 0)
+ {
+ sprintf(buf,"+CME ERROR: 100\r\n");
+ handle_output(buf, strlen(buf), Response);
+ }
+ else
+ {
+ lynq_response_ok();
+ }
+
+ return;
+}
static Command commands[] =
{
{"CGIR",lynq_handle_version},
{"LEELSP",lynq_handle_autosuspend},
+ {"NETLED",lynq_handle_netled},
+ {"STATUSLED",lynq_handle_statusled},
{NULL, NULL}
};
diff --git a/cap/zx297520v3/src/lynq/lib/liblynq-at-common/makefile b/cap/zx297520v3/src/lynq/lib/liblynq-at-common/makefile
index e5a1c20..869f980 100755
--- a/cap/zx297520v3/src/lynq/lib/liblynq-at-common/makefile
+++ b/cap/zx297520v3/src/lynq/lib/liblynq-at-common/makefile
@@ -38,6 +38,8 @@
-lpthread \
-llynq-log \
-llynq-qser-autosuspend \
+ -llynq-led \
+
SOURCES = $(wildcard *.cpp)
diff --git a/cap/zx297520v3/src/lynq/lib/liblynq-data/lynq_data.cpp b/cap/zx297520v3/src/lynq/lib/liblynq-data/lynq_data.cpp
index b497527..105d347 100755
--- a/cap/zx297520v3/src/lynq/lib/liblynq-data/lynq_data.cpp
+++ b/cap/zx297520v3/src/lynq/lib/liblynq-data/lynq_data.cpp
@@ -1594,7 +1594,7 @@
return -1;
}
- if(user == NULL || strcmp(user, "NULL") == 0)
+ if(user == NULL || strcmp(user, "NULL") == 0 || strlen(user) == 0)
{
argv[1] = NULL;
}
@@ -1603,7 +1603,7 @@
argv[1] = user;
}
- if(password == NULL || strcmp(password, "NULL") == 0)
+ if(password == NULL || strcmp(password, "NULL") == 0 || strlen(password) == 0)
{
argv[2] = NULL;
}
@@ -1612,7 +1612,7 @@
argv[2] = password;
}
- if(authType == NULL || strcmp(authType, "NULL") == 0)
+ if(authType == NULL || strcmp(authType, "NULL") == 0 || strlen(authType) == 0)
{
argv[3] = NULL;
}
@@ -1620,7 +1620,7 @@
{
argv[3] = authType;
}
- if(normalProtocol==NULL)
+ if(normalProtocol==NULL|| strlen(normalProtocol) == 0)
{
argv[4] = "IPV4V6";
}
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 dc769e1..5d3966a 100755
--- 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
@@ -64,10 +64,9 @@
int qser_wakelock_unlock(int fd);
int qser_wakelock_destroy(int fd);
-int qser_whitelist_add(int id);
-int qser_whitelist_del(int id);
-int qser_whitelist_get(char* whitelist);
-int qser_whitelist_clear(void);
+int qser_whitelist_set(char *whitelist);
+int qser_whitelist_get(char *whitelist);
+
#ifdef __cplusplus
}
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 204660a..260dcb6 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
@@ -7,12 +7,12 @@
#include <errno.h>
#include <pthread.h>
#include <unistd.h>
-#include <cutils/uevent.h>
+
#include <lynq_autosuspend.h>
#include "lynq-qser-autosuspend.h"
#include "liblog/lynq_deflog.h"
-#include "sc_mnet_whitelist.h"
+#include <include/lynq_uci.h>
#ifdef __cplusplus
extern "C" {
@@ -26,18 +26,12 @@
#define USER_LOG_TAG "LYNQ_QSER_AUTOSUSPEND"
#define FILE_LOCK_TABLE "/tmp/.lock_table"
+#define LOG_UCI_MODULE "lynq_autosuspend"
+#define LOG_UCI_FILE "lynq_uci"
+
#define UEVENT_MSG_LEN 128
-int device_fd;
-
-struct dtr_uevent {
- const char *action;
- const char *path;
- const char *subsystem;
- const char *usbevent;
-};
-
-static void parse_event(const char *msg, struct dtr_uevent *dtr_uevent);
+int g_init_flag = 0;
qser_lpm_Handler_t g_lpm_handler = NULL;
@@ -235,75 +229,35 @@
return ret;
}
-static void parse_event(const char *msg, struct dtr_uevent *dtr_uevent)
-{
- dtr_uevent->action = "";
- dtr_uevent->path = "";
- dtr_uevent->subsystem = "";
- dtr_uevent->usbevent = "";
-
- while (*msg) {
- if (!strncmp(msg, "ACTION=", 7))
- {
- msg += 7;
- dtr_uevent->action = msg;
- }
- else if (!strncmp(msg, "DEVPATH=", 8))
- {
- msg += 8;
- dtr_uevent->path = msg;
- }
- else if (!strncmp(msg, "SUBSYSTEM=", 10))
- {
- msg += 10;
- dtr_uevent->subsystem = msg;
- }
- else if (!strncmp(msg, "USBEVENT=", 9)) {
- msg += 9;
- dtr_uevent->usbevent = msg;
- }
-
- while(*msg++);
- }
-
- LYINFLOG("event { '%s', '%s', '%s', '%s'}\n",
- dtr_uevent->action, dtr_uevent->path, dtr_uevent->subsystem,dtr_uevent->usbevent);
-}
-
-
void *check_dtr(void * arg)
{
qser_lpm_edge_t lpm_edge;
- char msg[UEVENT_MSG_LEN+2];
- struct dtr_uevent dtr_uevent;
- int n;
- int i;
-
- device_fd = uevent_open_socket(4*UEVENT_MSG_LEN, true);
- if(device_fd < 0)
- {
- LYERRLOG("uevent_open_socket fail\n");
- return -1;
- }
+ char msg[16];
+ int fd=0;
+ int ret=0;
+
while(1)
{
- n = uevent_kernel_multicast_recv(device_fd, msg, UEVENT_MSG_LEN);
- msg[n] = '\0';
- msg[n+1] = '\0';
- parse_event(msg, &dtr_uevent);
- if((!strcmp(dtr_uevent.subsystem, "xp2xp")))
+ fd = open("/sys/xp2xp/xp2xp_notify/xp2xp_state", O_RDONLY);
+ ret=read(fd, &msg,15);
+ LYERRLOG("xp2xp_state ret = %d\n", ret);
+ close(fd);
+
+ if(ret == 5)
{
- if(!strcmp(dtr_uevent.action, "online"))
- {
- lpm_edge =E_QL_LPM_FALLING;
- }
- else
- {
- lpm_edge =E_QL_LPM_RISING;
- }
- g_lpm_handler(lpm_edge);
+ lpm_edge =E_QL_LPM_FALLING;
}
+ else if(ret == 6)
+ {
+ lpm_edge =E_QL_LPM_RISING;
+ }
+ else
+ {
+ continue;
+ }
+ g_lpm_handler(lpm_edge);
+
}
return 0;
@@ -314,12 +268,17 @@
{
int ret;
int num;
-
+ if(g_init_flag != 0)
+ {
+ LYERRLOG("g_init_flag is error\n");
+ return -1;
+ }
+ g_init_flag = 1;
g_lpm_handler = qser_lpm_handler;
ret = pthread_create(&thid,NULL,check_dtr,NULL);
if(ret != 0)
{
- LYERRLOG("restart service fail");
+ LYERRLOG("pthread create fail, qser_lpm_init fail\n");
}
return ret;
}
@@ -328,8 +287,13 @@
int qser_lpm_deinit(void)
{
int ret;
+ if(g_init_flag != 1)
+ {
+ LYERRLOG("g_init_flag is error");
+ return -1;
+ }
+ g_init_flag = 0;
ret = pthread_cancel(thid);
- close(device_fd);
if(!ret)
{
LYERRLOG("pthread cancel success, lpm deinit success\n");
@@ -445,80 +409,35 @@
return ret;
}
-int qser_whitelist_add(int id)
+int qser_whitelist_set(char *whitelist)
{
int ret;
- if(sc_mnet_whitelist_init() != 0)
+ char cmd[64];
+ if(strlen(whitelist) != 4)
{
- LYINFLOG("sc_mnet_whitelist_init failed.\n");
+ LYINFLOG("string len is error\n");
return -1;
}
-
- ret = sc_mnet_whitelist_add(id);
- LYINFLOG("sc_mnet_whitelist_add ret %d.\n", ret);
-
- sc_mnet_whitelist_deinit();
+ sprintf(cmd, "uci set lynq_uci.lynq_autosuspend.whitelist_state='%s'", whitelist);
+ ret = system(cmd);
+ system("uci commit");
+ if(ret != 0)
+ {
+ LYINFLOG("qser_whitlist_set fail");
+ }
return ret;
}
-int qser_whitelist_del(int id)
+int qser_whitelist_get(char *whitelist)
{
int ret;
- if(sc_mnet_whitelist_init() != 0)
- {
- LYINFLOG("sc_mnet_whitelist_init failed.\n");
- return -1;
- }
-
- ret = sc_mnet_whitelist_del(id);
- LYINFLOG("qser_whitelist_del ret %d.\n", ret);
-
- sc_mnet_whitelist_deinit();
+ ret = lynq_get_value(LOG_UCI_FILE, LOG_UCI_MODULE, "whitelist_state", whitelist);
+ LYERRLOG("ret =%d, whitelist_state is %s\n", ret, whitelist);
return ret;
}
-int qser_whitelist_get(char* whitelist)
-{
- int ret;
- if(sc_mnet_whitelist_init() != 0)
- {
- LYINFLOG("sc_mnet_whitelist_init failed.\n");
- return -1;
- }
-
- whitelist = sc_mnet_whitelist_get();
- if(NULL != whitelist)
- {
- LYINFLOG("sc_mnet_whitelist_get :%s\n",whitelist);
- ret = 0;
- }
- else
- {
- LYINFLOG("sc_mnet_whitelist_get empty\n");
- ret = -1;
- }
- sc_mnet_whitelist_deinit();
- return ret;
-}
-
-int qser_whitelist_clear(void)
-{
- int ret;
- if(sc_mnet_whitelist_init() != 0)
- {
- LYINFLOG("sc_mnet_whitelist_init failed.\n");
- return -1;
- }
- ret = sc_mnet_whitelist_clear();
- LYINFLOG("sc_mnet_whitelist_clear ret %d\n", ret);
- sc_mnet_whitelist_deinit();
- return ret;
-
-}
-
-
DEFINE_LYNQ_LIB_LOG(LYNQ_QSER_AUTOSUSPEND)
#ifdef __cplusplus
diff --git a/cap/zx297520v3/src/lynq/lib/liblynq-qser-autosuspend/makefile b/cap/zx297520v3/src/lynq/lib/liblynq-qser-autosuspend/makefile
index 4027a6d..a6ded06 100755
--- a/cap/zx297520v3/src/lynq/lib/liblynq-qser-autosuspend/makefile
+++ b/cap/zx297520v3/src/lynq/lib/liblynq-qser-autosuspend/makefile
@@ -31,7 +31,7 @@
-lpthread \
-llynq-autosuspend \
-llynq-log \
- -lsctel \
+ -llynq-uci \
SOURCES = $(wildcard *.cpp)
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 395cf95..a4e452e 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
@@ -603,6 +603,61 @@
return RESULT_ERROR;
}
+int apn_xml_handle_clean()
+{
+ int node_num = 0;
+ int default_handle = LYNQ_APN_CHANNEL_MAX + 1;
+ xmlNodePtr node = NULL;
+ xmlNodePtr modify_node = NULL;
+ xmlChar *temp_char;
+ char temp_buff[12];
+
+ if(NULL == apn_table_xml_pdoc)
+ {
+ LYERRLOG("open xml file error");
+ goto FAILED;
+ }
+
+ node = xmlDocGetRootElement(apn_table_xml_pdoc);
+ if (NULL == node)
+ {
+ LYERRLOG("xmlDocGetRootElement() error");
+ goto FAILED;
+ }
+ modify_node = node->xmlChildrenNode;
+ if(modify_node != NULL)
+ {
+ modify_node = modify_node->next;
+ }
+ else
+ {
+ LYERRLOG("modify_node is null\n");
+ goto FAILED;
+ }
+ while (modify_node != NULL)
+ {
+ temp_char = xmlGetProp(modify_node, "handle");
+ if (temp_char == NULL)
+ {
+ modify_node = modify_node->next;
+ continue;
+ }
+ bzero(temp_buff,12);
+ snprintf(temp_buff,sizeof(temp_buff),"%d",default_handle);
+ xmlSetProp(modify_node,BAD_CAST"handle",(xmlChar *)temp_buff);
+ modify_node = modify_node->next;
+ }
+ xmlSaveFormatFileEnc(data_xml_path, apn_table_xml_pdoc, "UTF-8", 1);
+ return RESULT_OK;
+
+ FAILED:
+ // if (apn_table_xml_pdoc)
+ // {
+ // xmlFreeDoc(apn_table_xml_pdoc);
+ // }
+ return RESULT_ERROR;
+}
+
int apn_xml_add(qser_apn_add_s *apn,unsigned char *apn_num)
{
int node_num = 0;
@@ -795,6 +850,8 @@
}
//check apn_type
check_node = modify_node;
+ bzero(temp_buff,12);
+ snprintf(temp_buff,sizeof(temp_buff),"%d",(unsigned int)apn->profile_idx);
while (check_node != NULL)
{
if (xmlGetProp(check_node, "profile_idx") == NULL) //Null Node
@@ -804,6 +861,11 @@
}
else if(strcmp((char *)xmlGetProp(check_node, "apn_type"), apn->apn_type) == 0)
{
+ if(strcmp((char *)xmlGetProp(check_node, "profile_idx"), temp_buff) == 0)
+ {
+ check_node = check_node->next;
+ continue;
+ }
LYERRLOG("apntype already exists\n");
goto FAILED;
}
@@ -1254,6 +1316,12 @@
LYERRLOG("open xml file error");
return RESULT_ERROR;
}
+ ret = apn_xml_handle_clean();
+ if(ret != RESULT_OK)
+ {
+ LYERRLOG("clean handle error");
+ return RESULT_ERROR;
+ }
g_lynq_qser_data_init_flag = 1;
return RESULT_OK;
}
diff --git a/cap/zx297520v3/src/lynq/lib/liblynq-qser-fota/include/lynq-qser-fota.h b/cap/zx297520v3/src/lynq/lib/liblynq-qser-fota/include/lynq-qser-fota.h
index 34be9aa..2a8cfd6 100755
--- a/cap/zx297520v3/src/lynq/lib/liblynq-qser-fota/include/lynq-qser-fota.h
+++ b/cap/zx297520v3/src/lynq/lib/liblynq-qser-fota/include/lynq-qser-fota.h
@@ -18,6 +18,7 @@
int lynq_fota_set_addr_value(char *value,int size);
int lynq_fota_nrestart(void);
int lynq_rock_main(int first_run);
+int lynq_read_process(void);
#ifdef __cplusplus
}
diff --git a/cap/zx297520v3/src/lynq/lib/liblynq-qser-fota/lynq-qser-fota.cpp b/cap/zx297520v3/src/lynq/lib/liblynq-qser-fota/lynq-qser-fota.cpp
index 53ee3c8..5dab391 100755
--- a/cap/zx297520v3/src/lynq/lib/liblynq-qser-fota/lynq-qser-fota.cpp
+++ b/cap/zx297520v3/src/lynq/lib/liblynq-qser-fota/lynq-qser-fota.cpp
@@ -28,12 +28,13 @@
#include "include/lynq-qser-fota.h"
#include "liblog/lynq_deflog.h"
-#define FOTA_FLAG_FILE "/mnt/userdata/.back_up_flag"
+#define FOTA_REBOOT_FLAG "/mnt/userdata/.fota_reboot_flag"
+#define FOTA_FLAG_FILE "/mnt/userdata/.back_up_flag"
#define USER_LOG_TAG "LYNQ_FOTA"
#define FOTA_ADDR_FILE "/mnt/userdata/.addr_value"
#define FOTA_FILE_NAME "upgrade.package"
-
+#define FOTA_UPGRADE_PROCESS "/mnt/userdata/.fota_upgrade_process"
#define SYSTEM_A "34650"
#define SYSTEM_B "39019"
@@ -49,6 +50,18 @@
#define LYNQ_UPGRADE_STATUS_UPDATE_SUCCESS (4)
#define LYNQ_UPGRADE_STATUS_UPDATE_FAIL (5)
+#define LYNQ_SYNNCHRONIZING 8
+#define LYNQ_SYNC_SUCCESS 9
+#define LYNQ_SYNC_FAILED -1
+
+#define ZXIC_SYNCHRONIZING 1
+#define ZXIC_SYNC_SUCCESS 0
+
+#define NO_REBOOT 0
+
+
+int total_size = 0;
+int upgrade_size = 0;
typedef struct
{
@@ -122,6 +135,7 @@
int ret = 0;
int current_slot = 0;
int fota_sync_flag = 0;
+ int reboot_flg = NO_REBOOT;
FILE *fp = NULL;
fp = fopen(FOTA_FLAG_FILE,"w+");
if(fp == NULL)
@@ -134,6 +148,17 @@
/* T106BUG-189 fix */
system("sync");
+
+ fp =fopen(FOTA_REBOOT_FLAG,"w+");
+ if(fp == NULL)
+ {
+ LYERRLOG("Creaf get upgrade status flag failed");
+ return -1;
+ }
+
+ fwrite(&reboot_flg,sizeof(int),1,fp);
+ fclose(fp);
+ system("sync");
ret = lynq_fota_verify();
if(ret != 0)
@@ -233,7 +258,20 @@
LYINFLOG("Total size:%d ", p_status->total_size);
LYINFLOG("Updated size:%d ", p_status->upgraded_size);
- return ;
+
+ total_size = p_status->total_size;
+ upgrade_size = p_status->upgraded_size;
+
+ FILE *fp = NULL;
+ fp = fopen(FOTA_UPGRADE_PROCESS,"w");
+ if (fp == NULL)
+ {
+ LYERRLOG("Error opening file");
+ return;
+ }
+
+ fprintf(fp, "%d,%d\n", total_size, upgrade_size);
+ fclose(fp);
}
/*****************************************
@@ -528,21 +566,59 @@
{
z_upgrade_status_info_t status;
int ret = 0;
-
-
- ret = zxic_dual_get_upgrade_status(&status);
- if(ret < 0)
+ int reboot_flag = -1;
+ FILE *fp = NULL;
+ fp = fopen(FOTA_REBOOT_FLAG,"r");
+ if(fp == NULL)
{
- LYINFLOG("Get upgrade status fail! ");
+ LYERRLOG("Open reboot flag file failed");
return -1;
}
+
+ fread(&reboot_flag,sizeof(int),1,fp);
+ fclose(fp);
+
+ //get upgrade status before no reboot
+ if(reboot_flag == NO_REBOOT)
+ {
+
+ ret = zxic_dual_get_upgrade_status(&status);
+ if(ret < 0)
+ {
+ LYERRLOG("Get upgrade status fail! ");
+ return -1;
+ }
- LYINFLOG("Current upgrade info: ");
- LYINFLOG("Current upgrade status:%d ", status.upgrade_status);
- LYINFLOG("Current upgrade total size:%d ", status.total_size);
- LYINFLOG("Current upgrade updated size:%d ", status.upgraded_size);
-
- return status.upgrade_status;
+ LYINFLOG("Current upgrade info: ");
+ LYINFLOG("Current upgrade status:%d ", status.upgrade_status);
+ LYINFLOG("Current upgrade total size:%d ", status.total_size);
+ LYINFLOG("Current upgrade updated size:%d ", status.upgraded_size);
+
+ return status.upgrade_status;
+ }
+ else
+ {
+ //get sync status
+ int fota_sync_tatus = 0;
+ fota_sync_tatus = lynq_get_sync_status();
+ if(fota_sync_tatus == ZXIC_SYNCHRONIZING)
+ {
+ LYINFLOG("Now fota upgrade sync status is synchronizing");
+ return LYNQ_SYNNCHRONIZING;
+ }
+ else if(fota_sync_tatus == ZXIC_SYNC_SUCCESS)
+ {
+ LYINFLOG("Now fota upgrade sync status sync success ");
+ return LYNQ_SYNC_SUCCESS;
+ }
+ else if(fota_sync_tatus == LYNQ_SYNC_FAILED)
+ {
+ LYERRLOG("Now fota upgrade sync status sync failed ");
+ return LYNQ_SYNC_FAILED;
+ }
+
+
+ }
}
@@ -753,7 +829,7 @@
int sync_status = -2;
zxic_dual_get_sync_status(&sync_status);
LYINFLOG("Current sync status is %d", sync_status);
- return 0;
+ return sync_status;
}
/*****************************************
@@ -785,6 +861,67 @@
return 0;
}
+/*****************************************
+* @brief:lynq_read_process
+* @param count [IN]:NS
+* @param sum [OUT]:NA
+* @return :fota upgrade process 0-10
+* @todo:NA
+* @see:NA
+* @warning:NA
+*****************************************/
+int lynq_read_process(void)
+{
+ LYINFLOG("Enter lynq_read_process");
+
+ float fota_process = 0;
+ int ration = 0;
+ int read_count = 0;
+ FILE *fp = NULL;
+
+ while(1)
+ {
+
+ fp = fopen(FOTA_UPGRADE_PROCESS, "r");
+ if(fp == NULL)
+ {
+ LYERRLOG("lynq_read_process open file failed");
+ usleep(10000);
+ read_count++;
+ if(read_count > 5)
+ {
+ break;
+ }
+ }
+ else
+ {
+ break;
+ }
+ }
+
+ if(fp != NULL)
+ {
+
+ char line[256] = {0};
+ if (fgets(line, sizeof(line), fp) != NULL)
+ {
+ sscanf(line, "%d,%d", &total_size, &upgrade_size);
+ }
+ fclose(fp);
+ }
+
+
+ if(total_size != 0 && upgrade_size <= total_size)
+ {
+ LYINFLOG("Caculate fota process ration ");
+ fota_process = (float) upgrade_size / total_size;
+ }
+
+ ration = (int)(fota_process * 10);
+ LYINFLOG("Fota process ration is %d",ration);
+ return ration;
+}
+
DEFINE_LYNQ_LIB_LOG(LYNQ_FOTA)
#ifdef __cplusplus
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 d508438..90a5521 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
@@ -474,6 +474,7 @@
{
int ret = 0;
int i = 0;
+ int location = 17;
static struct mopen_location_info_t mopen_location_info;
static int64_t tmp_time = 0;
mopen_gnss_nmea_info_t nmea_info;
@@ -513,7 +514,9 @@
//set system time.
if (g_gnss_sync_enable_flag == 1 && g_gnss_sync_done == 0)
{
- if( strncmp(data+3,NMEA_RMC,strlen(NMEA_RMC)) == 0 && data[17] == 'A')
+
+ location = (gpio21_value == 0?17:18);
+ if(strncmp(data+3,NMEA_RMC,strlen(NMEA_RMC)) == 0 && data[location] == 'A')
{
if (update_system_time(nmea_info.timestamp) == 0)
{
diff --git a/cap/zx297520v3/src/lynq/lib/liblynq-qser-thermal/include/lynq_qser_thermal.h b/cap/zx297520v3/src/lynq/lib/liblynq-qser-thermal/include/lynq_qser_thermal.h
new file mode 100755
index 0000000..d776dde
--- /dev/null
+++ b/cap/zx297520v3/src/lynq/lib/liblynq-qser-thermal/include/lynq_qser_thermal.h
@@ -0,0 +1,12 @@
+#ifndef _LYNQ_QSER_THERMAL_H_
+#define _LYNQ_QSER_THERMAL_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+#define MAX_SIZE 100
+int get_thermal_zone(int *numbers, int size);
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/cap/zx297520v3/src/lynq/lib/liblynq-qser-thermal/makefile b/cap/zx297520v3/src/lynq/lib/liblynq-qser-thermal/makefile
new file mode 100755
index 0000000..d1d6061
--- /dev/null
+++ b/cap/zx297520v3/src/lynq/lib/liblynq-qser-thermal/makefile
@@ -0,0 +1,88 @@
+SHELL = /bin/sh
+RM = rm -f
+
+LOCAL_CFLAGS := -Wall \
+ -g -Os \
+ -flto \
+ -fPIC \
+
+$(warning ################# C2K support: $(RAT_CONFIG_C2K_SUPPORT))
+ifeq ($(strip $(RAT_CONFIG_C2K_SUPPORT)), yes)
+ LOCAL_CFLAGS += -DC2K_SUPPORT
+
+endif
+
+ifeq ($(strip $(MTK_MULTI_SIM_SUPPORT)), dsds)
+ LOCAL_CFLAGS += -DANDROID_SIM_COUNT_2 \
+ -DANDROID_MULTI_SIM \
+ -DMODE_DSDS
+endif
+
+
+$(warning ################# TARGET_PLATFORM: $(TARGET_PLATFORM))
+ifeq ($(strip $(TARGET_PLATFORM)), mt2731)
+#$(warning #################add for debug $(ROOT), $(includedir))
+$(warning ################# TARGET_PLATFORM_MT2731)
+ LOCAL_CFLAGS += -DTARGET_PLATFORM_MT2731 \
+ -DMD_93_SUPPORT
+else ifeq ($(strip $(TARGET_PLATFORM)), mt2635)
+$(warning ################# TARGET_PLATFORM_MT2635)
+ LOCAL_CFLAGS += -DTARGET_PLATFORM_MT2635 \
+ -DMD_90_SUPPORT
+endif
+
+$(warning ################# RITA ROOT: $(ROOT),includedir:$(includedir))
+LOCAL_PATH = .
+
+LOCAL_C_INCLUDES = \
+ -I. \
+ -I$(LOCAL_PATH)/include \
+
+
+LOCAL_LIBS := \
+ -L. \
+ -ldl \
+ -lpthread \
+ -luci \
+
+SOURCES = $(wildcard *.c wildcard *.h src/*.c)
+
+EXECUTABLE = liblynq-qser-thermal.so
+
+OBJECTS=$(SOURCES:.c=.o)
+
+DATE_FMT = +%Y-%m-%d
+ifdef SOURCE_DATE_EPOCH
+ BUILD_DATE ?= $(shell date -u -d "@$(SOURCE_DATE_EPOCH)" "$(DATE_FMT)" 2>/dev/null || date -u -r "$(SOURCE_DATE_EPOCH)" "$(DATE_FMT)" 2>/dev/null || date -u "$(DATE_FMT)")
+else
+ BUILD_DATE ?= $(shell date "$(DATE_FMT)")
+endif
+
+.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 : %.c
+ $(CC) $(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)
diff --git a/cap/zx297520v3/src/lynq/lib/liblynq-qser-thermal/src/lynq_qser_thermal.c b/cap/zx297520v3/src/lynq/lib/liblynq-qser-thermal/src/lynq_qser_thermal.c
new file mode 100755
index 0000000..30114f0
--- /dev/null
+++ b/cap/zx297520v3/src/lynq/lib/liblynq-qser-thermal/src/lynq_qser_thermal.c
@@ -0,0 +1,63 @@
+#include <stdio.h>
+#include "lynq_qser_thermal.h"
+
+
+void parseBuffer(const char *buf, int *numbers, int *count) {
+ int i = 0;
+
+ while (buf[i] != '\0') {
+ while (buf[i] == ' ' || buf[i] == '\n') {
+ ++i;
+ }
+
+ int num = 0;
+
+ while (buf[i] >= '0' && buf[i] <= '9') {
+ num = num * 10 + (buf[i] - '0');
+ ++i;
+ }
+
+ numbers[(*count)++] = num;
+ }
+}
+
+
+int get_thermal_zone(int *numbers, int size) {
+ char path[] = "/sys/zx_tsc/tsc_value";
+ int ch;
+ char buf[MAX_SIZE];
+ int i = 0;
+ int count = 0;
+
+ if(NULL == numbers ){
+ printf("Error para\n");
+ return -1;
+ }
+
+ if(size < 6){
+ printf("Error para\n");
+ return -1;
+ }
+
+ FILE *file = fopen(path, "r");
+ if (file == NULL) {
+ printf("Error opening file.\n");
+ return -2;
+ }
+
+ while ((ch = fgetc(file)) != EOF && i < MAX_SIZE - 1)
+ {
+ if (ch != '\0') {
+ buf[i++] = (char)ch;
+ }
+ }
+
+ buf[i] = '\0';
+ fclose(file);
+
+ parseBuffer(buf, numbers, &count);
+
+ return count;
+}
+
+
diff --git a/cap/zx297520v3/src/lynq/lib/liblynq-qser-voice/include/lynq-qser-voice.h b/cap/zx297520v3/src/lynq/lib/liblynq-qser-voice/include/lynq-qser-voice.h
index 8666362..1fb0e01 100755
--- a/cap/zx297520v3/src/lynq/lib/liblynq-qser-voice/include/lynq-qser-voice.h
+++ b/cap/zx297520v3/src/lynq/lib/liblynq-qser-voice/include/lynq-qser-voice.h
@@ -94,19 +94,7 @@
//Get voice speech volume
int qser_voice_get_speech_volume(int *volume);
-//Set voice call waiting
-int qser_voice_call_setwaiting
-(
- int h_voice,
- qser_voice_call_waiting_service_t e_service
-);
-
-//Get voice call waiting status
-int qser_voice_call_getwaitingstatus
-(
- int h_voice,
- qser_voice_call_waiting_service_t *pe_service
-);
+int qser_voice_set_dtmf(const char callnum);
/*
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 a35a192..d32a69e 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
@@ -229,5 +229,11 @@
return lynq_get_speech_volume(volume);
}
+int qser_voice_set_dtmf(const char callnum)
+{
+ return lynq_set_DTMF(callnum);
+
+}
+
DEFINE_LYNQ_LIB_LOG(LYNQ_QSER_CALL)
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 fb00165..d349bd5 100755
--- a/cap/zx297520v3/src/lynq/lib/liblynq-systime/lynq_systime.cpp
+++ b/cap/zx297520v3/src/lynq/lib/liblynq-systime/lynq_systime.cpp
@@ -64,6 +64,8 @@
extern int sc_rtc_time_get(int srcid, sc_rtc_time_get_cb rtc_notify);
extern int sc_cfg_get(char *name, char* buf, int bufLen);
extern int sc_cfg_set (char *name, char *value);
+extern int get_terminate_flag(void);
+
char sync_from_rtc_cb_flag = 1;
@@ -230,6 +232,7 @@
int ret = -1;
int srcid = -1;
int i = 0;
+ int count = 0;
if ((srcid = sc_rtc_timer_init()) <= 0)
{
LYERRLOG("rtc_timer_demo:rtc_timer_init fail!\n");
@@ -264,6 +267,12 @@
LYERRLOG("uninit failed \n");
return -1;
}
+ //xy.he add for T106BUG-413 2024-01-04
+ while((get_terminate_flag() == 0) && (count <100))
+ {
+ usleep(10*1000);
+ count ++;
+ }
return 0;
}
@@ -274,6 +283,7 @@
LYDBGLOG("[%s][%d] enter.\n", __FUNCTION__, __LINE__);
int ret = -1;
int srcid = -1;
+ int count = 0;
if ((srcid = sc_rtc_timer_init()) <= 0)
{
LYERRLOG("rtc_timer_demo:rtc_timer_init fail!\n");
@@ -291,7 +301,13 @@
LYERRLOG("uninit failed \n");
return -1;
}
- usleep(5000);
+ //xy.he add for T106BUG-413 2024-01-04
+ while((get_terminate_flag() == 0) && (count <100))
+ {
+ usleep(10*1000);
+ count ++;
+ }
+ printf("lynq_set_rtc_time_success\n");
return 0;
}
@@ -303,6 +319,7 @@
int ret = -1;
int srcid = -1;
int i = 0;
+ int count = 0;
if (NULL == ulsec)
{
LYERRLOG("NULL parameter!\n");
@@ -341,6 +358,12 @@
LYERRLOG("uninit failed \n");
return -1;
}
+ //xy.he add for T106BUG-413 2024-01-04
+ while((get_terminate_flag() == 0) && (count <100))
+ {
+ usleep(10*1000);
+ count ++;
+ }
return 0;
}
#endif
diff --git a/cap/zx297520v3/src/lynq/lib/liblynq-systime/makefile b/cap/zx297520v3/src/lynq/lib/liblynq-systime/makefile
index d0e37e8..20fc50a 100755
--- a/cap/zx297520v3/src/lynq/lib/liblynq-systime/makefile
+++ b/cap/zx297520v3/src/lynq/lib/liblynq-systime/makefile
@@ -38,6 +38,7 @@
-llynq-uci \
-llynq-log \
-lnvram \
+ -lscipc \
SOURCES = $(wildcard *.cpp)
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 569b224..7193768 100755
--- a/cap/zx297520v3/src/lynq/lib/liblynq-uci/lynq_uci.config
+++ b/cap/zx297520v3/src/lynq/lib/liblynq-uci/lynq_uci.config
@@ -14,7 +14,8 @@
config lynq_autosuspend 'lynq_autosuspend'
option auto_enable '0'
option debug '1'
-
+ option whitelist_state '0000'
+
config debug_mode 'debug_mode'
option sysinfo_debug_status '1'
option check_file_size '228'
diff --git a/cap/zx297520v3/src/lynq/packages/apps/Mobiletek_Tester_RDIT/main.cpp b/cap/zx297520v3/src/lynq/packages/apps/Mobiletek_Tester_RDIT/main.cpp
index 8abbd7c..3f7bbf0 100755
--- a/cap/zx297520v3/src/lynq/packages/apps/Mobiletek_Tester_RDIT/main.cpp
+++ b/cap/zx297520v3/src/lynq/packages/apps/Mobiletek_Tester_RDIT/main.cpp
@@ -29,8 +29,8 @@
int ret = 0;
char socket_name[64]={0};
- system("rm -rf /var/socket");
- system("mkdir -p /var/socket");
+ system("rm -rf /var/run/socket");
+ system("mkdir -p /var/run/socket");
if(argc < 3)
{
@@ -39,7 +39,7 @@
}
if((argv[1] != NULL) && (argv[2]!=NULL))
{
- sprintf(socket_name,"/var/socket/%s",argv[1]);
+ sprintf(socket_name,"/var/run/socket/%s",argv[1]);
if(LYNQ_E_SUCCESS != init_msg_dispatch(socket_name, atoi(argv[2])))
{
exit(1);
diff --git a/cap/zx297520v3/src/lynq/packages/apps/Mobiletek_Tester_RDIT/socket-tool.cpp b/cap/zx297520v3/src/lynq/packages/apps/Mobiletek_Tester_RDIT/socket-tool.cpp
index 24e4f22..990a910 100755
--- a/cap/zx297520v3/src/lynq/packages/apps/Mobiletek_Tester_RDIT/socket-tool.cpp
+++ b/cap/zx297520v3/src/lynq/packages/apps/Mobiletek_Tester_RDIT/socket-tool.cpp
@@ -22,7 +22,7 @@
}
if((argv[1] != NULL) && (argv[2]!=NULL))
{
- sprintf(socket_name_service,"/var/socket/%s",argv[1]);
+ sprintf(socket_name_service,"/var/run/socket/%s",argv[1]);
//sprintf(socket_name_client,"/var/socket/%s-client",argv[1]);
client_socket_fd = create_socket(AF_UNIX, SOCK_DGRAM,0, 0, NULL,socket_name_service, (void *)&g_client_local_addr, 2, 1);
if(0 > client_socket_fd)
diff --git a/cap/zx297520v3/zxic_code/zxic_source/linux-5.10/drivers/net/ethernet/zte/zx29_gmac.c b/cap/zx297520v3/zxic_code/zxic_source/linux-5.10/drivers/net/ethernet/zte/zx29_gmac.c
old mode 100755
new mode 100644
index b344482..a4d3372
--- a/cap/zx297520v3/zxic_code/zxic_source/linux-5.10/drivers/net/ethernet/zte/zx29_gmac.c
+++ b/cap/zx297520v3/zxic_code/zxic_source/linux-5.10/drivers/net/ethernet/zte/zx29_gmac.c
@@ -1391,11 +1391,174 @@
}
/*jb.qi add for gamc power down on 20231116 end */
+/*zw.wang add for switching the primary/secondary mode of gmac on 20240118 start*/
+int mode_type = -1;
+
+ssize_t gmac_master_or_slave_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
+{
+ struct platform_device *pdev = to_platform_device(dev);
+ struct net_device *ndev = platform_get_drvdata(pdev);
+ struct zx29_gmac_dev *priv = (struct zx29_gmac_dev *)netdev_priv(ndev);
+ int mmd = 0;
+ int reg = 0;
+ int val = 0;
+ int ret;
+
+ ///read mode_type
+ ret = sscanf(buf, "%d", &mode_type);
+ if (ret < 1) {
+ printk(KERN_ERR "Please enter the number 0-3 to enable the corresponding mode \n"
+ "Enter values in the non-0-3 range to get pattern description \n");
+ return count;
+ }
+
+ ///Judgment model
+ if (mode_type < 0 || mode_type > 3) {
+ printk(KERN_DEBUG "Please enter the number range 0-3\n"
+ "0: Set the slave mode \n"
+ "1: Set the main mode \n"
+ "2: indicates setting SQI value view mode \n"
+ "3: Set the VCT value view mode \n"
+ "After the mode is set, the corresponding value can be obtained\n");
+ return ret ? ret : count;
+ }
+
+ ///Set the Ethernet slave mode
+ if (mode_type == 0) {
+ mmd = 0x1;
+ reg = 0x834;
+ mdiobus_write(priv->phydev->mdio.bus, priv->phydev->mdio.addr, 0x0d, mmd);
+ mdiobus_write(priv->phydev->mdio.bus, priv->phydev->mdio.addr, 0x0e, reg);
+ mdiobus_write(priv->phydev->mdio.bus, priv->phydev->mdio.addr, 0x0d, 0x4000 | mmd);
+ val = mdiobus_read(priv->phydev->mdio.bus, priv->phydev->mdio.addr, 0x0e);
+
+ mdiobus_write(priv->phydev->mdio.bus, priv->phydev->mdio.addr, 0x0d, mmd);
+ mdiobus_write(priv->phydev->mdio.bus, priv->phydev->mdio.addr, 0x0e, reg);
+ mdiobus_write(priv->phydev->mdio.bus, priv->phydev->mdio.addr, 0x0d, 0x4000 | mmd);
+ mdiobus_write(priv->phydev->mdio.bus, priv->phydev->mdio.addr, 0x0e, val & (~BIT(14)));
+ }
+ ///Set the Ethernet master mode
+ else if (mode_type == 1) {
+ mmd = 0x1;
+ reg = 0x834;
+ mdiobus_write(priv->phydev->mdio.bus, priv->phydev->mdio.addr, 0x0d, mmd);
+ mdiobus_write(priv->phydev->mdio.bus, priv->phydev->mdio.addr, 0x0e, reg);
+ mdiobus_write(priv->phydev->mdio.bus, priv->phydev->mdio.addr, 0x0d, 0x4000 | mmd);
+ val = mdiobus_read(priv->phydev->mdio.bus, priv->phydev->mdio.addr, 0x0e);
+
+ mdiobus_write(priv->phydev->mdio.bus, priv->phydev->mdio.addr, 0x0d, mmd);
+ mdiobus_write(priv->phydev->mdio.bus, priv->phydev->mdio.addr, 0x0e, reg);
+ mdiobus_write(priv->phydev->mdio.bus, priv->phydev->mdio.addr, 0x0d, 0x4000 | mmd);
+ mdiobus_write(priv->phydev->mdio.bus, priv->phydev->mdio.addr, 0x0e, val | BIT(14));
+ }
+ return count;
+}
+
+ssize_t gmac_master_or_slave_show(struct device *dev, struct device_attribute *attr, char *buf)
+{
+ struct platform_device *pdev = to_platform_device(dev);
+ struct net_device *ndev = platform_get_drvdata(pdev);
+ struct zx29_gmac_dev *priv = (struct zx29_gmac_dev *)netdev_priv(ndev);
+ int mmd = 0;
+ int reg = 0;
+ int val = 0;
+ int len = 0;
+ int ret;
+
+ ///Read the network master/slave
+ if (mode_type == 0 || mode_type == 1) {
+ mmd = 0x1;
+ reg = 0x834;
+ mdiobus_write(priv->phydev->mdio.bus, priv->phydev->mdio.addr, 0x0d, mmd);
+ mdiobus_write(priv->phydev->mdio.bus, priv->phydev->mdio.addr, 0x0e, reg);
+ mdiobus_write(priv->phydev->mdio.bus, priv->phydev->mdio.addr, 0x0d, 0x4000 | mmd);
+ val = mdiobus_read(priv->phydev->mdio.bus, priv->phydev->mdio.addr, 0x0e) & BIT(14);
+ if(val)
+ memcpy(buf, "Master\n",7);
+ else
+ memcpy(buf, "Slave\n", 6);
+
+ printk(KERN_DEBUG "mode_type %d - gmac_master_or_slave is %s\n", mode_type, buf);
+
+ }
+ ///Obtain the cable quality SQI value
+ else if(mode_type == 2){
+ mmd = 0x1;
+ reg = 0x8B10;
+ mdiobus_write(priv->phydev->mdio.bus, priv->phydev->mdio.addr, 0x0d, mmd);
+ mdiobus_write(priv->phydev->mdio.bus, priv->phydev->mdio.addr, 0x0e, reg);
+ mdiobus_write(priv->phydev->mdio.bus, priv->phydev->mdio.addr, 0x0d, 0x4000 | mmd);
+ val = mdiobus_read(priv->phydev->mdio.bus, priv->phydev->mdio.addr, 0x0e);
+ sprintf(buf, "0x%x\n", val);
+ sprintf(buf, "SQI : 0x%x\n", val);
+ printk(KERN_DEBUG "mode_type %d - SQI is 0x%x", mode_type, val);
+
+ }
+ ///Obtain short circuit, open circuit and normal connection of VCT
+ else if(mode_type == 3){
+ ///--TDR Enable
+ mmd = 0x1;
+ reg = 0x8B00;
+ mdiobus_write(priv->phydev->mdio.bus, priv->phydev->mdio.addr, 0x0d, mmd);
+ mdiobus_write(priv->phydev->mdio.bus, priv->phydev->mdio.addr, 0x0e, reg);
+ mdiobus_write(priv->phydev->mdio.bus, priv->phydev->mdio.addr, 0x0d, 0x4000 | mmd);
+ mdiobus_write(priv->phydev->mdio.bus, priv->phydev->mdio.addr, 0x0e, BIT(14) | BIT(12));
+
+ ///--Read VCT
+ mmd = 0x1;
+ reg = 0x8B02;
+ mdiobus_write(priv->phydev->mdio.bus, priv->phydev->mdio.addr, 0x0d, mmd);
+ mdiobus_write(priv->phydev->mdio.bus, priv->phydev->mdio.addr, 0x0e, reg);
+ mdiobus_write(priv->phydev->mdio.bus, priv->phydev->mdio.addr, 0x0d, 0x4000 | mmd);
+ val = mdiobus_read(priv->phydev->mdio.bus, priv->phydev->mdio.addr, 0x0e);
+ printk(KERN_DEBUG "Open status: %s - Short status: %s\n",
+ (val & BIT(0)) ? "Open" : "Normal", (val & BIT(1)) ? "Short" : "Normal");
+ sprintf(buf, "Open status: %s\nShort status: %s\n",
+ (val & BIT(0)) ? "Open" : "Normal", (val & BIT(1)) ? "Short" : "Normal");
+ reg = 0x8B01;
+ mdiobus_write(priv->phydev->mdio.bus, priv->phydev->mdio.addr, 0x0d, mmd);
+ mdiobus_write(priv->phydev->mdio.bus, priv->phydev->mdio.addr, 0x0e, reg);
+ mdiobus_write(priv->phydev->mdio.bus, priv->phydev->mdio.addr, 0x0d, 0x4000 | mmd);
+ val = mdiobus_read(priv->phydev->mdio.bus, priv->phydev->mdio.addr, 0x0e);
+ sprintf(buf, "%sDistance status: 0x%x\n", buf, val);
+ printk(KERN_DEBUG "mode_type %d - Distance status is 0x%x\n", mode_type, val);
+
+ ///--TDR Disable
+ mmd = 0x1;
+ reg = 0x8B00;
+ mdiobus_write(priv->phydev->mdio.bus, priv->phydev->mdio.addr, 0x0d, mmd);
+ mdiobus_write(priv->phydev->mdio.bus, priv->phydev->mdio.addr, 0x0e, reg);
+ mdiobus_write(priv->phydev->mdio.bus, priv->phydev->mdio.addr, 0x0d, 0x4000 | mmd);
+ mdiobus_write(priv->phydev->mdio.bus, priv->phydev->mdio.addr, 0x0e, 0);
+
+ }
+ ///Get model help information
+ else{
+ sprintf(buf, "Please enter the number range 0-3\n"
+ "0: Set the slave mode \n"
+ "1: Set the main mode \n"
+ "2: indicates setting SQI value view mode \n"
+ "3: Set the VCT value view mode \n"
+ "After the mode is set, the corresponding value can be obtained\n");
+ printk(KERN_DEBUG "Please enter the number range 0-3\n"
+ "0: Set the slave mode \n"
+ "1: Set the main mode \n"
+ "2: indicates setting SQI value view mode \n"
+ "3: Set the VCT value view mode \n"
+ "After the mode is set, the corresponding value can be obtained\n");
+ }
+ return strlen(buf);
+
+}
+
+/*zw.wang add for switching the primary/secondary mode of gmac on 20240118 end */
+
static DEVICE_ATTR(gmac_test, 0664, show_fun, store_fun);
static DEVICE_ATTR(mdio_test, 0664, mdio_show, mdio_store);
static DEVICE_ATTR(free_mdio, 0664, free_mdio_show, free_mdio_store);
static DEVICE_ATTR(debug_on, 0664, debug_on_show, debug_on_store);
static DEVICE_ATTR(gmac_power, 0664, gmac_power_show, gmac_power_store);//jb.qi add for gamc power down on 20231116
+static DEVICE_ATTR(gmac_master_or_slave, 0664, gmac_master_or_slave_show, gmac_master_or_slave_store);//zw.wang add for switching the primary/secondary mode of gmac on 20240118
static int zx29_gmac_probe(struct platform_device *pdev)
{
@@ -1423,6 +1586,7 @@
device_create_file(&pdev->dev, &dev_attr_free_mdio);
device_create_file(&pdev->dev, &dev_attr_debug_on);
device_create_file(&pdev->dev, &dev_attr_gmac_power);//jb.qi add for gamc power down on 20231116
+ device_create_file(&pdev->dev, &dev_attr_gmac_master_or_slave);//zw.wang add for switching the primary/secondary mode of gmac on 20240118
prv = netdev_priv(ndev);
memset(prv, 0, sizeof(*prv));
@@ -1668,6 +1832,7 @@
device_remove_file(&pdev->dev, &dev_attr_free_mdio);
device_remove_file(&pdev->dev, &dev_attr_debug_on);
device_remove_file(&pdev->dev, &dev_attr_gmac_power);//jb.qi add for gamc power down on 20231116
+ device_remove_file(&pdev->dev, &dev_attr_gmac_master_or_slave);//zw.wang add for switching the primary/secondary mode of gmac on 20240118
}
return 0;
}
diff --git a/cap/zx297520v3/zxic_code/zxic_source/linux-5.10/drivers/net/zvnet/zvnet_dev.c b/cap/zx297520v3/zxic_code/zxic_source/linux-5.10/drivers/net/zvnet/zvnet_dev.c
old mode 100644
new mode 100755
index 94238d6..917ca39
--- a/cap/zx297520v3/zxic_code/zxic_source/linux-5.10/drivers/net/zvnet/zvnet_dev.c
+++ b/cap/zx297520v3/zxic_code/zxic_source/linux-5.10/drivers/net/zvnet/zvnet_dev.c
@@ -832,9 +832,9 @@
continue;
}
if(unlikely(!(skb->dev->flags & IFF_UP))) {
- dev_kfree_skb (skb);
if(printk_ratelimit())
zv_err("drop!!!%s is down.", skb->dev->name);
+ dev_kfree_skb (skb);
continue;
}
skb->protocol = eth_type_trans(skb, skb->dev);
@@ -855,8 +855,8 @@
if(0 != (skb = zvnet_direct_read_skb(&g_zvnet_chn_info))) {
//skb_debug_test(skb);
if(unlikely(!(skb->dev->flags & IFF_UP))) {
- dev_kfree_skb (skb);
zv_err("drop!!!%s is down.", skb->dev->name);
+ dev_kfree_skb (skb);
continue;
}
skb->protocol = eth_type_trans(skb, skb->dev);
diff --git a/cap/zx297520v3/zxic_code/zxic_source/linux-5.10/drivers/soc/sc/power_4line/hal_xp2xp.c b/cap/zx297520v3/zxic_code/zxic_source/linux-5.10/drivers/soc/sc/power_4line/hal_xp2xp.c
index 7d75efc..b9044fa 100755
--- a/cap/zx297520v3/zxic_code/zxic_source/linux-5.10/drivers/soc/sc/power_4line/hal_xp2xp.c
+++ b/cap/zx297520v3/zxic_code/zxic_source/linux-5.10/drivers/soc/sc/power_4line/hal_xp2xp.c
@@ -50,14 +50,14 @@
/****************************************************************************
* Local Macros
****************************************************************************/
-#define AP2CP_WAKE_GPIO 50 /*AP»½ÐÑCPÖжÏÏß¶ÔÓ¦µÄGPIO*/
-#define AP2CP_SLEEP_GPIO 53 /*AP¸øCPµÄ˯Ãß»½ÐÑ״̬¶ÔÓ¦µÄGPIO*/
-#define CP2AP_WAKE_GPIO 131 /*CP»½ÐÑAPÖжÏÏß¶ÔÓ¦µÄGPIO*/
-#define CP2AP_SLEEP_GPIO 130 /*CP¸øAPµÄ˯Ãß»½ÐÑ״̬¶ÔÓ¦µÄGPIO*/
+#define AP2CP_WAKE_GPIO 50
+#define AP2CP_SLEEP_GPIO 53
+#define CP2AP_WAKE_GPIO 131
+#define CP2AP_SLEEP_GPIO 130
-#define AP_SLEEP_STATUS 0 /*AP˯Ãßʱ¸ÃÒý½ÅΪ0*/
-#define AP_WAKE_STATUS 1 /*AP»½ÐÑʱ¸ÃÒý½ÅΪ1*/
+#define AP_SLEEP_STATUS 0
+#define AP_WAKE_STATUS 1
#define CP_SLEEP_STATUS 1 //jb.q add for dtr on 20231204
#define CP_WAKE_STATUS 0 //jb.q add for dtr on 20231204
@@ -141,7 +141,8 @@
/****************************************************************************
* Global Variables
****************************************************************************/
-
+static wait_queue_head_t wakeup_dtr_wqhead;
+static int wakeup_irq_occurs = 0;
struct wakeup_source *xp2xp_wake_lock;
static int xp2xp_init_flag = 0;
static int irq_num = 0;
@@ -175,17 +176,16 @@
ssize_t xp2xp_obj_show(struct kobject *kobject,struct attribute *attr,char *buf)
{
-
- if(!strcmp(attr->name, XP2XP_STATE)){
- sprintf(buf, "curr_gpio_v:%d, currState:%s, sleep_cnt:%d, wake_cnt:%d, \n",g_xp2xp.curr_gpio_value, (g_xp2xp.wake_state == 1 ? "work" : "sleep"),
- g_xp2xp.sleep_cnt, g_xp2xp.wake_cnt
- );
-
- }
+ wakeup_irq_occurs = 0;
+ wait_event_interruptible(wakeup_dtr_wqhead,wakeup_irq_occurs);
+ if(!strcmp(attr->name, XP2XP_STATE))
+ {
+ sprintf(buf, "%s\n",(g_xp2xp.wake_state == 1 ? "work" : "sleep"));
+ }
+
return strlen(buf);
}
-
ssize_t xp2xp_obj_store(struct kobject *kobject,struct attribute *attr, const char *buf,size_t size)
{
unsigned int value = 0;
@@ -402,8 +402,7 @@
unsigned int irq_type;
struct hal_xp2xp_dev *xp2xp_dev = (struct hal_xp2xp_dev *)priv;
- disable_irq_nosync(irq);
- xp2xp_dev->xp2xp_irq_state = 0;
+ disable_irq_nosync(irq);
gpio_value = 0 ;
if(xp2xp_dev->xp2xp_ws){
@@ -431,12 +430,13 @@
xp2xp_dev->wake_state = 1;
pm_stay_awake(g_xp2xp.dev);
}
-
if (pinctrl_select_state(xp2xp_dev->pctrl_wk_int, xp2xp_dev->st_int) < 0) {
printk( "setting card detect irq failed\n");
}
irq_set_irq_type(irq,irq_type);
- up(&xp2xp_dev->wk_sem);
+ wakeup_irq_occurs = 1;
+ wake_up_interruptible(&wakeup_dtr_wqhead);
+ enable_irq(xp2xp_dev->eint_irq);
return IRQ_HANDLED;
}
/*jb.qi add for dtr uevent on 20231218 end*/
@@ -628,8 +628,7 @@
int ret = 0;
printk("kset test init!\n");
-
- /* ´´½¨²¢×¢²á kset_p */
+
kset_xp2xp = kset_create_and_add("xp2xp", &xp2xp_uevent_ops, NULL);
xp2xpkobj = kzalloc(sizeof(*xp2xpkobj),GFP_KERNEL);
@@ -718,7 +717,7 @@
spin_lock_init(&g_xp2xp.wk_lock);
device_init_wakeup(&pdev->dev, true);//jb.q add for dtr on 20231204
-
+ init_waitqueue_head(&wakeup_dtr_wqhead);
g_xp2xp.xp2xp_ws = wakeup_source_register(NULL, "xp2xp");
if(g_xp2xp.xp2xp_ws == NULL){
printk("adb_setup wakeup_source_create fail\n");
@@ -796,14 +795,14 @@
panic("hal_xp2xp_probe request_irq fail, %d", ret);
}
-
+ /*
g_xp2xp.wake_int_thread = kthread_run(xp2xp_wkcp_thread, (void *)&g_xp2xp, "xp2xp_wake_thread");
if (IS_ERR(g_xp2xp.wake_int_thread)) {
printk("Can't start up our thread");
return PTR_ERR(g_xp2xp.wake_int_thread);
}
-
+ */
enable_irq_wake(g_xp2xp.eint_irq);
/*jb.q add for dtr on 20231204 start*/
/* gpio request */
diff --git a/cap/zx297520v3/zxic_code/zxic_source/linux-5.10/drivers/usb/gadget/usb_netlink.c b/cap/zx297520v3/zxic_code/zxic_source/linux-5.10/drivers/usb/gadget/usb_netlink.c
index ad17fd7..4be86bd 100755
--- a/cap/zx297520v3/zxic_code/zxic_source/linux-5.10/drivers/usb/gadget/usb_netlink.c
+++ b/cap/zx297520v3/zxic_code/zxic_source/linux-5.10/drivers/usb/gadget/usb_netlink.c
@@ -56,6 +56,7 @@
#define USB_SPEED_TYPE "usb_speed"
#define USB_SWITCH_MODE "switch_mode"
+#define USB_CURR_CONFIG "currcfg"
#define USB_DL_OPEN "dl_open"
#define NET_NAME "netname"
@@ -163,6 +164,11 @@
.name = "dl_open",
.mode = S_IRUGO|S_IWUSR,
};
+static struct attribute usb_currcfg_attr =
+{
+ .name = "currcfg",
+ .mode = S_IRUGO|S_IWUSR,
+};
static struct attribute *usb_status_attrs[] =
{
@@ -177,6 +183,7 @@
&usb_adb_switch_attr,
&usb_switch_mode_attr,
&usb_dl_open_attr,
+ &usb_currcfg_attr,
NULL,
};
@@ -259,7 +266,8 @@
int dc=0;
int ret = 0;
if(usbnetlink_ws){
- __pm_wakeup_event(usbnetlink_ws, 3000);
+ //__pm_wakeup_event(usbnetlink_ws, 3000);
+ __pm_stay_awake(usbnetlink_ws);
}
if(!strcmp(attr->name, USB_STATE)){
//printk("\n[usb_netlink:%s-%d]:plug_state\n",__func__,__LINE__);
@@ -325,6 +333,20 @@
goto done;
}
sprintf(buf, "%s\n",usb_get_resp_data());
+ }else if(!strcmp(attr->name, USB_CURR_CONFIG)){
+ usb_rpmsg_config_cmd(USB_RPMSG_GET_USB_CURR_CONFIG, NULL, 0);
+ usb_schedule_work();
+ ret = wait_event_interruptible(usb_netlink_wq, atomic_read(&resp_done));
+ if (ret < 0 ) {
+ sprintf(buf, "%s\n", "got fail \n");
+ goto done;
+ }
+ if(usb_get_resp_type() != USB_RPMSG_GET_USB_CURR_CONFIG){
+ printk("GET_USB_CURR_CONFIG invalid resp type\n");
+ sprintf(buf, "%s\n", "got fail \n");
+ goto done;
+ }
+ sprintf(buf, "%s\n",usb_get_resp_data());
}else if(!strcmp(attr->name, RAMDUMP_FLAG)){
sprintf(buf, "%d\n",ramdump_flag);
}else if(!strcmp(attr->name, HOT_PLUG)){
@@ -345,6 +367,11 @@
done:
atomic_set(&resp_done,0);
usb_clean_mem();
+
+ if(usbnetlink_ws){
+ //__pm_wakeup_event(usbnetlink_ws, 3000);
+ __pm_relax(usbnetlink_ws);
+ }
return strlen(buf);
}
diff --git a/cap/zx297520v3/zxic_code/zxic_source/linux-5.10/include/linux/android_notify.h b/cap/zx297520v3/zxic_code/zxic_source/linux-5.10/include/linux/android_notify.h
index a95eb06..4e2a0ed 100755
--- a/cap/zx297520v3/zxic_code/zxic_source/linux-5.10/include/linux/android_notify.h
+++ b/cap/zx297520v3/zxic_code/zxic_source/linux-5.10/include/linux/android_notify.h
@@ -67,6 +67,7 @@
USB_RPMSG_GET_USB_STATE,
USB_RPMSG_GET_USB_LINK_STATE,
USB_RPMSG_GET_USB_ENUM_MODE,
+ USB_RPMSG_GET_USB_CURR_CONFIG,
USB_RPMSG_CMD_MAX,
USB_RPMSG_NOTIFY_ADB_TO_AP,
USB_RPMSG_NOTIFY_ADB_TO_CAP,
diff --git a/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/platform/Script/etc/options.auth b/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/platform/Script/etc/options.auth
index db0cc5a..1e34ddf 100755
--- a/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/platform/Script/etc/options.auth
+++ b/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/platform/Script/etc/options.auth
@@ -1,5 +1,5 @@
#dev_name#
-logfile /var/log/pppd.log
+logfile /mnt/userdata/log/pppd.log
debug
local 192.168.2.1:192.168.2.100
ms-dns 114.114.114.114
diff --git a/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/platform/Script/etc/options.noauth b/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/platform/Script/etc/options.noauth
index e00b17f..c7e6438 100755
--- a/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/platform/Script/etc/options.noauth
+++ b/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/platform/Script/etc/options.noauth
@@ -1,5 +1,5 @@
#dev_name#
-logfile /var/log/pppd.log
+logfile /mnt/userdata/log/pppd.log
debug
local 192.168.2.1:192.168.2.100
ms-dns 114.114.114.114
diff --git a/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/platform/Script/scripts/fota_release_space.sh b/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/platform/Script/scripts/fota_release_space.sh
index dfe8908..9cc1bb0 100755
--- a/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/platform/Script/scripts/fota_release_space.sh
+++ b/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/platform/Script/scripts/fota_release_space.sh
@@ -29,7 +29,7 @@
killall sd_hotplug
killall syslogd
-rm -rf /var/log
+rm -rf /mnt/userdata/log
#EC 616000558980
killall zte_mifi
diff --git a/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/platform/adb/services.c b/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/platform/adb/services.c
index ba96def..f870096 100755
--- a/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/platform/adb/services.c
+++ b/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/platform/adb/services.c
@@ -162,38 +162,20 @@
adb_close(fd);
}
-int my_adb_reboot(int a,int b,void * p)
-{
- return 0;
-}
-
void reboot_service(int fd, void *arg)
{
char buf[100];
- int pid, ret;
+ int ret;
sync();
-
- /* Attempt to unmount the SD card first.
- * No need to bother checking for errors.
- */
- pid = fork();
- if (pid == 0) {
- /* ask vdc to unmount it */
- execl("/system/bin/vdc", "/system/bin/vdc", "volume", "unmount",
- getenv("EXTERNAL_STORAGE"), "force", NULL);
- } else if (pid > 0) {
- /* wait until vdc succeeds or fails */
- waitpid(pid, &ret, 0);
- }
-
- ret = my_adb_reboot(ANDROID_RB_RESTART2, 0, (char *) arg);
+ ret = system("reboot");
if (ret < 0) {
snprintf(buf, sizeof(buf), "reboot failed: %s\n", strerror(errno));
writex(fd, buf, strlen(buf));
}
free(arg);
adb_close(fd);
+ sleep(3);
}
#endif
diff --git a/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/platform/at_ctl/inc/fota_update.h b/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/platform/at_ctl/inc/fota_update.h
index 0d2b9b2..5ebcdb4 100755
--- a/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/platform/at_ctl/inc/fota_update.h
+++ b/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/platform/at_ctl/inc/fota_update.h
@@ -8,7 +8,7 @@
#define ZFOTA_AT_PARA_LEN 16
#define NV_FOTA_UPGRADE_FLAG "fota_update_flag"
-#define FOTA_MAIN_PATH "/cache/zte_fota/"
+#define FOTA_MAIN_PATH "/mnt/userdata/zte_fota/"
#define FOTA_DUA_MAIN_PATH FOTA_MAIN_PATH"dua/"
#define FOTA_DUA_UPDATE_STATUS_FILE FOTA_MAIN_PATH"update_status"
#define NV_FOTA_UPGRADE_RESULT "fota_upgrade_result"
diff --git a/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/platform/at_ctl/src/atconfig/ps_pdp.c b/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/platform/at_ctl/src/atconfig/ps_pdp.c
index cca6719..ff164db 100755
--- a/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/platform/at_ctl/src/atconfig/ps_pdp.c
+++ b/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/platform/at_ctl/src/atconfig/ps_pdp.c
@@ -732,14 +732,14 @@
act_info->gateway,
act_info->pri_dns,
act_info->sec_dns,
- &pdpinfo->pdp_type,
act_info->ip6,
act_info->gateway6,
act_info->pri_dns6,
- act_info->sec_dns6
+ act_info->sec_dns6,
+ &pdpinfo->pdp_type
};
act_info->ip46flag = V46_VALID;
- parse_param("%d,%s,%s,%s,%s,%s,%d,%s,%s,%s,%s",at_paras,(void **)p3);
+ parse_param("%d,%s,%s,%s,%s,%s,%s,%s,%s,%s,%d",at_paras,(void **)p3);
//save_unicast_ip6addr(cid, act_info->ip6);
if(pdpinfo->pdp_type == PDP_EXT){
proc_netdev(cid, 1, act_info->ip);
diff --git a/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/platform/dhcp6/dhcp6c.c b/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/platform/dhcp6/dhcp6c.c
index bc6e8eb..a4b1594 100755
--- a/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/platform/dhcp6/dhcp6c.c
+++ b/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/platform/dhcp6/dhcp6c.c
@@ -149,7 +149,7 @@
#define DHCP6C_CONF "/etc_ro/dhcp6c.conf"
#define DHCP6C_PIDFILE "/var/run/dhcp6c.pid"
-#define DUID_FILE "/var/dhcp6c_duid"
+#define DUID_FILE "/var/run/dhcp6c_duid"
int g_i_if_chinamobile_pd_diff = 0;
static int pid;
diff --git a/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/platform/dhcp6/dhcp6s.c b/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/platform/dhcp6/dhcp6s.c
index 9dcb413..db6a967 100755
--- a/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/platform/dhcp6/dhcp6s.c
+++ b/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/platform/dhcp6/dhcp6s.c
@@ -112,7 +112,7 @@
struct host_decl *host = NULL;
struct rootgroup *globalgroup = NULL;
-#define DUID_FILE "/var/dhcp6s_duid"
+#define DUID_FILE "/var/run/dhcp6s_duid"
#define DHCP6S_CONF "/etc_ro/dhcp6s.conf"
#define DH6_VALID_MESSAGE(a) \
@@ -355,11 +355,11 @@
exit(1);
}
if (num_device != 0) {
- {
+ /*{
char tmp_buf[128] = {0};
snprintf(tmp_buf, sizeof(tmp_buf),"nv set %s_dhcp6s_pid=%d", device[0], getpid());
system(tmp_buf);
- }
+ }*/
for (i = 0; i < num_device; i++) {
ifidx[i] = if_nametoindex(device[i]);
if (ifidx[i] == 0) {
diff --git a/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/platform/dhcp6/lease.h b/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/platform/dhcp6/lease.h
index 2ccafa6..96bbb42 100755
--- a/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/platform/dhcp6/lease.h
+++ b/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/platform/dhcp6/lease.h
@@ -39,8 +39,8 @@
#define ADDR_VALIDATE 2
#define ADDR_ABANDON 3
-#define PATH_SERVER6_LEASE "/var/server6.leases"
-#define PATH_CLIENT6_LEASE "/var/client6.leases"
+#define PATH_SERVER6_LEASE "/var/run/server6.leases"
+#define PATH_CLIENT6_LEASE "/var/run/client6.leases"
#define HASH_TABLE_COUNT 4
diff --git a/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/platform/fota_auto_sync/main.c b/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/platform/fota_auto_sync/main.c
index dcf4b12..ab58af6 100755
--- a/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/platform/fota_auto_sync/main.c
+++ b/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/platform/fota_auto_sync/main.c
@@ -42,7 +42,7 @@
#define FILE_PATH_PROC_CMDLINE "/proc/cmdline"
-#define FOTA_SYNC_LOG_PATH "/cache/zte_fota_ab/upi_ab.log"
+#define FOTA_SYNC_LOG_PATH "/mnt/userdata/zte_fota_ab/upi_ab.log"
/*******************************************************************************
diff --git a/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/platform/include/fota_common.h b/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/platform/include/fota_common.h
index 9429d72..a74e436 100755
--- a/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/platform/include/fota_common.h
+++ b/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/platform/include/fota_common.h
@@ -214,7 +214,7 @@
/***********************************************/
-#define ZTE_FOTA_MAIN_PATH "/cache/zte_fota/"
+#define ZTE_FOTA_MAIN_PATH "/mnt/userdata/zte_fota/"
#define FOTAUPI ZTE_FOTA_MAIN_PATH"upi.log"
#define FOTARB ZTE_FOTA_MAIN_PATH"lib.log"
#define FOTADM ZTE_FOTA_MAIN_PATH"dm.log"
diff --git a/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/platform/libsqlite/sqlite3.c b/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/platform/libsqlite/sqlite3.c
index 29e1321..0b60e4d 100755
--- a/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/platform/libsqlite/sqlite3.c
+++ b/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/platform/libsqlite/sqlite3.c
@@ -29545,7 +29545,7 @@
static const char *azDirs[] = {
0,
0,
- "/var/tmp",
+ 0,/*"/tmp",*/
"/usr/tmp",
"/tmp",
0 /* List terminator */
diff --git a/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/platform/libvoice/voice_buffer.c b/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/platform/libvoice/voice_buffer.c
index 56598f4..e236432 100755
--- a/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/platform/libvoice/voice_buffer.c
+++ b/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/platform/libvoice/voice_buffer.c
@@ -60,19 +60,19 @@
#define VBUFFER_DEV_FLAGS O_RDWR
-#define VBUFFER_TX_FILE_NAME "/cache/tx.pcm"
-#define VBUFFER_RX_FILE_NAME "/cache/rx.pcm"
-#define VBUFFER_TX16_FILE_NAME "/cache/tx16.pcm"
-#define VBUFFER_RX16_FILE_NAME "/cache/rx16.pcm"
+#define VBUFFER_TX_FILE_NAME "/mnt/userdata/tx.pcm"
+#define VBUFFER_RX_FILE_NAME "/mnt/userdata/rx.pcm"
+#define VBUFFER_TX16_FILE_NAME "/mnt/userdata/tx16.pcm"
+#define VBUFFER_RX16_FILE_NAME "/mnt/userdata/rx16.pcm"
-#define VBUFFER_RTP_TX_FILE_NAME "/cache/rtp_tx.rtp"
-#define VBUFFER_RTP_RX_FILE_NAME "/cache/rtp_rx.rtp"
-#define VBUFFER_RTP_TX16_FILE_NAME "/cache/rtp_tx16.rtp"
-#define VBUFFER_RTP_RX16_FILE_NAME "/cache/rtp_rx16.rtp"
-#define VBUFFER_RTP_TX_PCM_FILE_NAME "/cache/rtp_tx_dec.pcm"
+#define VBUFFER_RTP_TX_FILE_NAME "/mnt/userdata/rtp_tx.rtp"
+#define VBUFFER_RTP_RX_FILE_NAME "/mnt/userdata/rtp_rx.rtp"
+#define VBUFFER_RTP_TX16_FILE_NAME "/mnt/userdata/rtp_tx16.rtp"
+#define VBUFFER_RTP_RX16_FILE_NAME "/mnt/userdata/rtp_rx16.rtp"
+#define VBUFFER_RTP_TX_PCM_FILE_NAME "/mnt/userdata/rtp_tx_dec.pcm"
-#define VBUFFER_RTP_FROM_NET_FILE_NAME "/cache/rtp_from_net.rtp"
+#define VBUFFER_RTP_FROM_NET_FILE_NAME "/mnt/userdata/rtp_from_net.rtp"
#define ENABLE_RTP_TX_TEST
#define RTP_TEST_WITH_NET_SOCKET
diff --git a/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/sdk/binder/include/cutils/sockets.h b/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/sdk/binder/include/cutils/sockets.h
index ed7ed05..fd01af8 100755
--- a/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/sdk/binder/include/cutils/sockets.h
+++ b/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/sdk/binder/include/cutils/sockets.h
@@ -34,7 +34,7 @@
#ifdef ZXIC_RIL_SUPPORT
#define ANDROID_SOCKET_DIR "/dev/socket"
#else
-#define ANDROID_SOCKET_DIR "/var/socket"
+#define ANDROID_SOCKET_DIR "/var/run/socket"
#endif
#ifdef __cplusplus
diff --git a/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/sdk/binder/libcutils/socket_local.h b/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/sdk/binder/libcutils/socket_local.h
index ac97679..9bdb166 100755
--- a/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/sdk/binder/libcutils/socket_local.h
+++ b/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/sdk/binder/libcutils/socket_local.h
@@ -21,7 +21,7 @@
#ifdef ZXIC_RIL_SUPPORT
//#define ANDROID_RESERVED_SOCKET_PREFIX "/dev/socket/"
#else
-#define ANDROID_RESERVED_SOCKET_PREFIX "/var/socket/"
+#define ANDROID_RESERVED_SOCKET_PREFIX "/var/run/socket/"
#endif
/*
diff --git a/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/sdk/binder/liblog/log_read.c b/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/sdk/binder/liblog/log_read.c
index 08dbaa8..6f94e5a 100755
--- a/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/sdk/binder/liblog/log_read.c
+++ b/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/sdk/binder/liblog/log_read.c
@@ -65,7 +65,7 @@
#ifdef ZXIC_RIL_SUPPORT
#define ANDROID_RESERVED_SOCKET_PREFIX "/dev/socket/"
#else
-#define ANDROID_RESERVED_SOCKET_PREFIX "/var/socket/"
+#define ANDROID_RESERVED_SOCKET_PREFIX "/var/run/socket/"
#endif
/* End of ../libcutils/socket_local.h */
diff --git a/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/sdk/libbsp/sc_usb.c b/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/sdk/libbsp/sc_usb.c
index 6a1bd73..8970498 100644
--- a/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/sdk/libbsp/sc_usb.c
+++ b/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/sdk/libbsp/sc_usb.c
@@ -19,6 +19,7 @@
#include "sc_usb.h"
//#include "nv_api.h"
+#define BUFF_LEN 256
/*¶ÁдÎļþÏà¹Ø²Ù×÷begin*/
static int filelength(FILE *fp)
@@ -178,5 +179,43 @@
sc_usb_set_netcardtype(USB_NET_ECM);
}
+int sc_usb_usermode_net_state(void)
+{
+ char curr_cfg[BUFF_LEN] = {0};
+ int ret = 0;
+ memset(curr_cfg, 0, BUFF_LEN);
+ ret = readfile(USB_ATTR_CURRCFG, curr_cfg, BUFF_LEN);
+ if(ret < 0){
+ printf("sc_usb_usermode_adb_state fail\n");
+ goto END;
+ }
+ ret = 0;
+
+ if(strstr(curr_cfg, "rndis") || strstr(curr_cfg, "ecm"))
+ return 1;
+
+END:
+ return ret;
+}
+int sc_usb_usermode_adb_state(void)
+{
+
+ char curr_cfg[BUFF_LEN] = {0};
+ int ret = 0;
+ memset(curr_cfg, 0, BUFF_LEN);
+ ret = readfile(USB_ATTR_CURRCFG, curr_cfg, BUFF_LEN);
+ if(ret < 0){
+ printf("sc_usb_usermode_adb_state fail\n");
+ goto END;
+ }
+ ret = 0;
+
+ if(strstr(curr_cfg, "adb"))
+ return 1;
+
+END:
+ return ret;
+}
+
diff --git a/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/sdk/libbsp/sc_usb.c.orig b/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/sdk/libbsp/sc_usb.c.orig
new file mode 100644
index 0000000..6a1bd73
--- /dev/null
+++ b/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/sdk/libbsp/sc_usb.c.orig
@@ -0,0 +1,182 @@
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <assert.h>
+#include <errno.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <string.h>
+#include <unistd.h>
+
+//add for cmux
+#include <sys/socket.h>
+#include <linux/if.h>
+#include <linux/gsmmux.h>
+#include <linux/netlink.h>
+#include <poll.h>
+#include <linux/serial.h>
+#include <termios.h>
+#include "sc_usb.h"
+//#include "nv_api.h"
+
+
+/*¶ÁдÎļþÏà¹Ø²Ù×÷begin*/
+static int filelength(FILE *fp)
+{
+ int num;
+ fseek(fp,0,SEEK_END);
+ num=ftell(fp);
+ fseek(fp,0,SEEK_SET);
+ return num;
+}
+
+int readfile(char *path, char* buf, unsigned len)
+{
+ FILE *fp;
+ unsigned int length;
+ if((fp=fopen(path,"r"))==NULL)
+ {
+ //slog(USBCFGMNG_PRINT,SLOG_ERR, "[usbCfgMng] open file %s error.\n",path);
+ return -1;
+ }
+ length=filelength(fp);
+ length = length > len? len: length;
+ //ch=(char *)malloc(length+1);
+ int read_len = fread(buf,length,1,fp);
+ if(read_len < 1) // cov M CHECKED_RETURN
+ {
+ //slog(SDCARD_PRINT, SLOG_ERR, "fread %s error.\n",path);
+ }
+
+ fclose(fp);
+ *(buf+length) = '\0';
+ return (int)length;
+}
+
+
+
+int writefile(char*path, char*buf, unsigned len)
+{
+ FILE *fp;
+ int rtv = 0;
+ if((fp=fopen(path,"w"))==NULL)
+ {
+ return -1;
+ }
+ rtv = fwrite(buf,len,1, fp);
+ fclose(fp);
+ return rtv;
+}
+
+
+void sc_usb_dl_open(void)
+{
+ writefile(USB_ATTR_DL_OPEN, "1", 1);
+}
+
+void sc_usb_dl_close(void)
+{
+ writefile(USB_ATTR_DL_OPEN, "0", 1);
+}
+
+int sc_usb_get_mode(char* buf, int len)
+{
+ int ret = 0;
+ ret = readfile(USB_ATTR_SWITCH_MODE, buf, len);
+ return ret;
+}
+
+int sc_usb_switch_mode(char *type)
+{
+ int ret = 0;
+
+ ret = writefile(USB_ATTR_SWITCH_MODE, type, strlen(type));
+ return ret;
+}
+
+void sc_usb_set_usermode(void)
+{
+ sc_usb_switch_mode("1");
+}
+
+void sc_usb_user_closedl(void)
+{
+ sc_usb_dl_close();
+ sc_usb_switch_mode("1");
+}
+
+void sc_usb_set_debugmode(void)
+{
+ sc_usb_switch_mode("0");
+
+}
+
+void sc_usb_debug_opendl(void)
+{
+ sc_usb_dl_open();
+ sc_usb_switch_mode("0");
+
+}
+void sc_usb_set_amtmode(void)
+{
+ sc_usb_switch_mode("3");
+}
+
+void sc_usb_set_factorymode(void)
+{
+ sc_usb_switch_mode("2");
+}
+
+void sc_usb_set_eyemode(void)
+{
+ sc_usb_switch_mode("4");
+}
+
+
+int sc_usb_get_usbstate(char* buf, int len)
+{
+ int ret = 0;
+ ret = readfile(USB_ATTR_USB_STATE, buf, len);
+ return ret;
+}
+
+int sc_usb_get_usb_speed(char* buf, int len)
+{
+ int ret = 0;
+ ret = readfile(USB_ATTR_SPEED, buf, len);
+ return ret;
+}
+
+
+int sc_usb_get_netname(char* buf, int len)
+{
+ int ret = 0;
+ ret = readfile(USB_ATTR_NETNAME, buf, len);
+ return ret;
+}
+
+
+int sc_usb_set_netcardtype(e_usb_net_type type)
+{
+ int ret = 0;
+ if(type == USB_NET_RNDIS)
+ ret = writefile(USB_ATTR_FORCENET, "0", 1);
+ else
+ ret = writefile(USB_ATTR_FORCENET, "1", 1);
+ return ret;
+}
+
+void sc_usb_set_net_rndis(void)
+{
+ //nv_set_item(NV_RO, STR_FORCE_NETCARD_TYPE, "force_rndis", 1);
+ sc_usb_set_netcardtype(USB_NET_RNDIS);
+}
+
+void sc_usb_set_net_ecm(void)
+{
+ //nv_set_item(NV_RO, STR_FORCE_NETCARD_TYPE, "force_ecm", 1);
+ sc_usb_set_netcardtype(USB_NET_ECM);
+}
+
+
+
diff --git a/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/sdk/libbsp/sc_usb.h b/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/sdk/libbsp/sc_usb.h
index 32820a3..d24f750 100644
--- a/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/sdk/libbsp/sc_usb.h
+++ b/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/sdk/libbsp/sc_usb.h
@@ -28,7 +28,8 @@
#define USB_ATTR_NETNAME "/sys/gen_usb/usb_state/netname"
#define USB_ATTR_FORCENET "/sys/gen_usb/usb_state/forcenet"
#define USB_ATTR_SIMULATE_PLUG "/sys/gen_usb/usb_state/usb_simulate_plug"
-#define USB_ATTR_BOOT_MODE "/sys/gen_usb/usb_state/boot_mode"
+#define USB_ATTR_BOOT_MODE "/sys/gen_usb/usb_state/boot_mode"
+#define USB_ATTR_CURRCFG "/sys/gen_usb/usb_state/currcfg"
#define STR_FORCE_NETCARD_TYPE "forcenetcard_type"
#define USB_ATTR_FAST_POWEROFF "/sys/gen_usb/usb_state/fast_poweroff"
@@ -128,6 +129,8 @@
void sc_usb_set_net_ecm(void);
+int sc_usb_usermode_net_state(void);
+int sc_usb_usermode_adb_state(void);
diff --git a/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/sdk/libscipc/sc_ipc.c b/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/sdk/libscipc/sc_ipc.c
index 7b32b99..04dc0c4 100755
--- a/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/sdk/libscipc/sc_ipc.c
+++ b/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/sdk/libscipc/sc_ipc.c
@@ -52,6 +52,8 @@
static int s_local_fd = -1;
static int s_local_key = -1;
static int s_remote_fd = -1;
+//xy.he add for T106BUG-413 2024-01-04
+int terminate_loop_flag = 0;
static pthread_t s_tid_dispatch;
//static pthread_t s_tid_reader;
@@ -284,6 +286,8 @@
pthread_mutex_lock(&s_startupMutex);
s_started = 1;
+ //xy.he add for T106BUG-413 2024-01-04
+ terminate_loop_flag = 0;
pthread_cond_broadcast(&s_startupCond);
pthread_mutex_unlock(&s_startupMutex);
@@ -311,7 +315,9 @@
if(-1 != s_local_fd)
sc_ipc_destroy_msg_fd(s_local_fd);
-
+ //xy.he add for T106BUG-413 2024-01-04
+ terminate_loop_flag = 1;
+
return (void*)0;
}
@@ -641,7 +647,7 @@
int ret = 0;
sc_ipc_msg msg = {0};
- if(s_started)
+ if(!s_started)
goto Done;
msg.type = 0;
@@ -680,3 +686,10 @@
return;
}
+//xy.he add for T106BUG-413 2024-01-04
+int get_terminate_flag()
+{
+ return terminate_loop_flag;
+}
+
+
diff --git a/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/sdk/libsctel/data/sc_data.c b/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/sdk/libsctel/data/sc_data.c
index fa3d1f3..389799f 100755
--- a/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/sdk/libsctel/data/sc_data.c
+++ b/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/sdk/libsctel/data/sc_data.c
@@ -72,27 +72,47 @@
char pri_dns6[IPV6ADDLEN_MAX];
char sec_dns6[IPV6ADDLEN_MAX];
char at_cmd[128] = {0};
+ char str[512] = {0};
+ void *p[] = {str};
char *at_str = at_cmd;
- void *p[] = { &rsp->c_id,
+ void *p0[] = { &rsp->c_id,
ip_type,
ip,
gateway,
pri_dns,
sec_dns,
- &rsp->pdp_type,
ip6,
gateway6,
pri_dns6,
- sec_dns6
+ sec_dns6,
+ &rsp->pdp_type
+ };
+ void *p1[] = { &rsp->c_id,
+ ip_type,
+ ip,
+ gateway,
+ pri_dns,
+ sec_dns,
+ &rsp->pdp_type
+ };
+ void *p2[] = { &rsp->c_id,
+ ip_type,
+ ip6,
+ gateway6,
+ pri_dns6,
+ sec_dns6,
+ &rsp->pdp_type
};
offset += sprintf(at_str+offset,"AT+ZPDPACT=%d,\"%s\",\"%s\",,,", req->c_id, req->ip_type, req->apn);
offset += sprintf(at_str+offset,",%d,\"%s\",\"%s\"", req->auth_type, req->username, req->password);
offset += sprintf(at_str+offset,",\"%s\",,1,%d\r\n", req->challenge, req->act_type);
- ret = get_modem_info(at_cmd, "%d,%s,%s,%s,%s,%s,%d,%s,%s,%s,%s", (void **)p);
+ ret = get_modem_info(at_cmd, "%s", (void **)p);
if(ret == 0){
+ ret = parse_param("%d,%s,%s,%s,%s,%s,%d", str, (void **)p2);
if(0 == strcmp("IP", ip_type))
{
+ parse_param("%d,%s,%s,%s,%s,%s,%d", str, (void **)p1);
strncpy(rsp->act_info.ip, ip, IPV4ADDLEN_MAX-1);
strncpy(rsp->act_info.gateway, gateway, IPV4ADDLEN_MAX-1);
strncpy(rsp->act_info.pri_dns, pri_dns, IPV4ADDLEN_MAX-1);
@@ -109,6 +129,11 @@
}
else if(0 == strcmp("IPV4V6", ip_type))
{
+ memset(ip6, 0, sizeof(ip6));
+ memset(gateway6, 0, sizeof(gateway6));
+ memset(pri_dns6, 0, sizeof(pri_dns6));
+ memset(sec_dns6, 0, sizeof(sec_dns6));
+ parse_param("%d,%s,%s,%s,%s,%s,%s,%s,%s,%s,%d", str, (void **)p0);
strncpy(rsp->act_info.ip, ip, IPV4ADDLEN_MAX-1);
strncpy(rsp->act_info.gateway, gateway, IPV4ADDLEN_MAX-1);
strncpy(rsp->act_info.pri_dns, pri_dns, IPV4ADDLEN_MAX-1);
diff --git a/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/sdk/ril/include/telephony/ril.h b/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/sdk/ril/include/telephony/ril.h
index 8aaf524..75ad0a0 100755
--- a/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/sdk/ril/include/telephony/ril.h
+++ b/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/sdk/ril/include/telephony/ril.h
@@ -145,6 +145,17 @@
RIL_E_POWER_ON_UIM_NOT_READY = 7000,
// Power on end
//MTK end
+ RIL_E_SIM_PIN = 9200,
+
+ RIL_E_SIM_PUK,
+
+ RIL_E_SIM_LOCKED,
+
+ RIL_E_SIM_INIT_FAILED,
+
+ RIL_E_SIM_GLOBAL_PIN,
+
+ RIL_E_SIM_GLOBAL_PUK,
} RIL_Errno;
typedef enum {
diff --git a/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/sdk/ril/reference-ril/ril.h b/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/sdk/ril/reference-ril/ril.h
index 8aaf524..75ad0a0 100755
--- a/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/sdk/ril/reference-ril/ril.h
+++ b/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/sdk/ril/reference-ril/ril.h
@@ -145,6 +145,17 @@
RIL_E_POWER_ON_UIM_NOT_READY = 7000,
// Power on end
//MTK end
+ RIL_E_SIM_PIN = 9200,
+
+ RIL_E_SIM_PUK,
+
+ RIL_E_SIM_LOCKED,
+
+ RIL_E_SIM_INIT_FAILED,
+
+ RIL_E_SIM_GLOBAL_PIN,
+
+ RIL_E_SIM_GLOBAL_PUK,
} RIL_Errno;
typedef enum {
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 0d3cf4b..f84e878 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
@@ -465,6 +465,10 @@
goto exit;
}
+ //l.yang modify for bug id T106BUG-57 2023/9/13 start
+ usleep(600000);
+ //l.yang modify for bug id T106BUG-57 2023/9/13 end
+
err = at_send_command_multiline("AT+CLCC", "+CLCC:", &response);
if (err < 0) {
RLOGD("ril_request_get_current_calls err= %d", err);
@@ -625,15 +629,35 @@
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 */
+
/* success or failure is ignored by the upper layer here.
it will call GET_CURRENT_CALLS and determine success that way */
+
RIL_onRequestComplete(t, RIL_E_SUCCESS, NULL, 0);
+
+ //l.yang modify for bug id T106BUG-268 2023/9/28 start
+ at_response_free(p_response);
+ return;
+ //l.yang modify for bug id T106BUG-268 2023/9/28 end
+
+ //l.yang modify for bug id T106BUG-54 2023/9/20 start
+error:
+ RIL_onRequestComplete(t, RIL_E_GENERIC_FAILURE, NULL, 0);
+ 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/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/sdk/ril/reference-ril/ril_ps.c b/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/sdk/ril/reference-ril/ril_ps.c
index 03b128d..aba2754 100755
--- a/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/sdk/ril/reference-ril/ril_ps.c
+++ b/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/sdk/ril/reference-ril/ril_ps.c
@@ -804,10 +804,10 @@
const char *username = NULL;
const char *password = NULL;
const char *challenge = NULL;
- /*act_typeΪ¼¤»î×éÍøÀàÐÍ£¬
- *0ΪAPºË±¾µØ²¦ºÅ,ÎÞЧ
- *1ΪCAPºË±¾µØ²¦ºÅ,
- *2ΪĬÈϲ¦ºÅ£¨normal£©,Æô¶¯Ä¬ÈÏ·ÓÉ,É豸ËùÓÐÓ¦Óö¼¿ÉÒÔÖ±½ÓÉÏÍø,Ö»Äܲ¥Ò»Â·;
+ /*act_typeΪ\BC\A4\BB\EE\D7\E9\CD\F8\C0\E0\D0ͣ\AC
+ *0ΪAP\BA˱\BE\B5ز\A6\BA\C5,\CE\DEЧ
+ *1ΪCAP\BA˱\BE\B5ز\A6\BA\C5,
+ *2ΪĬ\C8ϲ\A6\BAţ\A8normal\A3\A9,\C6\F4\B6\AFĬ\C8\CF·\D3\C9,\C9豸\CB\F9\D3\D0Ӧ\D3ö\BC\BF\C9\D2\D4ֱ\BD\D3\C9\CF\CD\F8,ֻ\C4ܲ\A5һ·;
*/
const char *active_type = NULL;
@@ -913,9 +913,10 @@
}
cmd = atstr + strlen(atstr);
- /*act_typeΪ¼¤»î×éÍøÀàÐÍ£¬0ΪAPºË±¾µØ²¦ºÅ,1ΪCAPºË±¾µØ²¦ºÅ,2ΪĬÈϲ¦ºÅ,Æô¶¯Ä¬ÈÏ·ÓÉ,É豸ËùÓÐÓ¦Óö¼¿ÉÒÔÖ±½ÓÉÏÍø,Ö»Äܲ¥Ò»Â·;*/
- snprintf(cmd, sizeof(atstr) - strlen(atstr) - 1, ",,,%d", act_type);
-
+ /*act_typeΪ\BC\A4\BB\EE\D7\E9\CD\F8\C0\E0\D0ͣ\AC0ΪAP\BA˱\BE\B5ز\A6\BA\C5,1ΪCAP\BA˱\BE\B5ز\A6\BA\C5,2ΪĬ\C8ϲ\A6\BA\C5,\C6\F4\B6\AFĬ\C8\CF·\D3\C9,\C9豸\CB\F9\D3\D0Ӧ\D3ö\BC\BF\C9\D2\D4ֱ\BD\D3\C9\CF\CD\F8,ֻ\C4ܲ\A5һ·;*/
+ //xf.li@20240111 modify for T106BUG-480 start
+ snprintf(cmd, sizeof(atstr) - strlen(atstr) - 1, ",,1,%d", act_type);
+ //xf.li@20240111 modify for T106BUG-480 end
err = at_send_command_singleline_timeout(atstr, "+ZPDPACT:", &p_response, TIMEOUT_ZPDPACT);
if (err < 0 || (p_response->success == 0)) {
RLOGE("requestSetupDataCall err:%d", err);
diff --git a/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/sdk/ril/reference-ril/ril_sim.c b/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/sdk/ril/reference-ril/ril_sim.c
index 3c67eff..bcc55ea 100755
--- a/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/sdk/ril/reference-ril/ril_sim.c
+++ b/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/sdk/ril/reference-ril/ril_sim.c
@@ -1140,9 +1140,16 @@
goto exit;
case 11: //need pin
+ RIL_onRequestComplete(token, RIL_E_SIM_PIN, NULL, 0);
+ goto error;
case 12: //need puk
+ RIL_onRequestComplete(token, RIL_E_SIM_PIN, NULL, 0);
+ goto error;
case 13: //sim locked
+ RIL_onRequestComplete(token, RIL_E_SIM_LOCKED, NULL, 0);
+ goto error;
case 15: //init fail
+ RIL_onRequestComplete(token, RIL_E_SIM_INIT_FAILED, NULL, 0);
goto error;
case 30: //init sucess
@@ -1151,7 +1158,11 @@
goto exit;
case 260: //need global pin
+ RIL_onRequestComplete(token, RIL_E_SIM_GLOBAL_PIN, NULL, 0);
+ goto error;
case 261: //need global puk
+ RIL_onRequestComplete(token, RIL_E_SIM_GLOBAL_PUK, NULL, 0);
+ goto error;
default:
goto error;
}
@@ -1159,8 +1170,8 @@
}
error:
- RLOGD("ril_request_radio_reset: failed!");
- RIL_onRequestComplete(token, RIL_E_GENERIC_FAILURE, NULL, 0);
+ RLOGD("ril_request_simcard_reset: failed!");
+ //RIL_onRequestComplete(token, RIL_E_GENERIC_FAILURE, NULL, 0);
updateRadioState();//if at error, we must update radio state
exit:
at_response_free(response);
diff --git a/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/sdk/rild/rild.c b/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/sdk/rild/rild.c
index 0602575..0a45733 100755
--- a/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/sdk/rild/rild.c
+++ b/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/sdk/rild/rild.c
@@ -159,7 +159,7 @@
}
sprintf(val,"%d",sock);
- snprintf(key, sizeof(key), "/var/socket/%s", sname);
+ snprintf(key, sizeof(key), "/var/run/socket/%s", sname);
setenv(key, val, 1);
RLOGD("getRildSocket val:%s", getenv(key));
@@ -332,8 +332,8 @@
#endif
- system("rm -rf /var/socket");
- system("mkdir -p /var/socket");
+ system("rm -rf /var/run/socket");
+ system("mkdir -p /var/run/socket");
if(0 > getRildSocket("rild") || 0 > getRildSocket("rild-debug")) {
RLOGD("getLogSocket fail.");
goto done;
diff --git a/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/test/player_demo/capture_demo.c b/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/test/player_demo/capture_demo.c
index 2a2da17..78d5556 100755
--- a/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/test/player_demo/capture_demo.c
+++ b/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/test/player_demo/capture_demo.c
@@ -137,7 +137,7 @@
int audio_is_init = 0;
sc_audio_handle_t capture_handle = SC_AUDIO_INVALID_HANDLE;
sc_audio_pcm_config_t pcm_config;
- char *fpath = "/var/capture.wav";
+ char *fpath = "/mnt/userdata/capture.wav";
audiodemo_log("capture_demo:Demo go.\n");
if(parseOpts(argc,argv) == -1) {
diff --git a/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/test/socket_demo/socket_main.c b/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/test/socket_demo/socket_main.c
index 2c732cb..e96da51 100755
--- a/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/test/socket_demo/socket_main.c
+++ b/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/test/socket_demo/socket_main.c
@@ -56,14 +56,14 @@
{
printf("Usage: %s\n", Opt);
printf("sock_create:type create a new socket(eg. sock_create:1)\n");
- printf("sock_createclient:type,addr,data create a new client socket(eg. sock_createclient:1,/var/sockclient,data)\n");
- printf("sock_createserver:type,addr,backlog create a new server socket(eg. sock_createserver:1,/var/sockserver,30)\n");
- printf("sock_bind:fd,addr socket bind(eg. sock_bind:fd,/var/sockclient)\n");
+ printf("sock_createclient:type,addr,data create a new client socket(eg. sock_createclient:1,/var/run/sockclient,data)\n");
+ printf("sock_createserver:type,addr,backlog create a new server socket(eg. sock_createserver:1,/var/run/sockserver,30)\n");
+ printf("sock_bind:fd,addr socket bind(eg. sock_bind:fd,/var/run/sockclient)\n");
printf("sock_listen:fd,backlog socket listen(eg. sock_listen:fd,30)\n");
printf("sock_accept:fd socket accept(eg. sock_accept:fd)\n");
- printf("sock_conn:fd,srvaddr conn server socket(eg. sock_conn:fd, /var/sockserver)\n");
+ printf("sock_conn:fd,srvaddr conn server socket(eg. sock_conn:fd, /var/run/sockserver)\n");
printf("sock_send:fd,message send socket message(eg. sock_send:fd,ipc test)\n");
- printf("sock_sendto:fd,srvaddr,message sendto socket message(eg. sock_sendto:fd,/var/sockserver,ipc test)\n");
+ printf("sock_sendto:fd,srvaddr,message sendto socket message(eg. sock_sendto:fd,/var/run/sockserver,ipc test)\n");
printf("sock_write:fd,message write socket message(eg. sock_write:fd,ipc test)\n");
printf("sock_recv:fd recv socket message(eg. sock_recv: fd)\n");
printf("sock_recvfrom:fd recvfrom socket message(eg. sock_recvfrom: fd)\n");
@@ -152,7 +152,7 @@
memset(&my_addr, 0, sizeof(struct sockaddr_un));
my_addr.sun_family = AF_UNIX;
- strncpy(my_addr.sun_path, "/var/socktest", sizeof(my_addr.sun_path)-1);
+ strncpy(my_addr.sun_path, "/var/run/socktest", sizeof(my_addr.sun_path)-1);
//·þÎñ¶Ë°ó¶¨µØÖ·
if(bind(serverfd, (struct sockaddr*)&my_addr, sizeof(my_addr)) == 0){
@@ -250,7 +250,7 @@
//¸ø¿Í»§¶Ë°ó¶¨µØÖ·
memset(&my_addr, 0, sizeof(struct sockaddr_un));
my_addr.sun_family = AF_UNIX;
- strncpy(my_addr.sun_path, "/var/sockclient", sizeof(my_addr.sun_path)-1);
+ strncpy(my_addr.sun_path, "/var/run/sockclient", sizeof(my_addr.sun_path)-1);
//¿Í»§¶Ë°ó¶¨µØÖ·
if(bind(clientfd, (struct sockaddr*)&my_addr, sizeof(my_addr)) == 0){
@@ -1298,7 +1298,7 @@
}
}
#else
- snprintf(cmdstr, SOCKET_CMD_MAX_LEN, "sock_createclient:%d,%s,%s", 2, "/var/socketap", "send data to ap test");
+ snprintf(cmdstr, SOCKET_CMD_MAX_LEN, "sock_createclient:%d,%s,%s", 2, "/var/run/socketap", "send data to ap test");
socket_create_client(cmdstr, strlen(cmdstr));
#endif
diff --git a/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/test/usbtest/usbtest.c b/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/test/usbtest/usbtest.c
index 998ee5d..6955ce8 100755
--- a/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/test/usbtest/usbtest.c
+++ b/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/test/usbtest/usbtest.c
@@ -408,6 +408,39 @@
printf("do_set_netcardtype test fail\n");
}
+
+
+void do_get_adb_state(int nargs, char **argv)
+{
+
+ int ret = 0;
+
+ ret = sc_usb_usermode_adb_state();
+ if(ret < 0){
+ printf("get adb state fail,ret:%d \n", ret);
+ return;
+ }
+
+ printf("adb state:%d, %s\n", ret, ((ret == 0) ? "off" : "on"));
+
+}
+
+void do_get_net_state(int nargs, char **argv)
+{
+
+ int ret = 0;
+
+ ret = sc_usb_usermode_net_state();
+ if(ret < 0){
+ printf("get net state fail,ret:%d \n", ret);
+ return;
+ }
+
+ printf("net state:%d, %s\n", ret, ((ret == 0) ? "off" : "on"));
+
+}
+
+
void do_monitor_usb_plug(int nargs, char **argv)
{
int ret;
@@ -477,6 +510,16 @@
"monitor usb plug in/plug out",
NULL, NULL, 0
},
+ { do_get_adb_state, -0,
+ "get_adb_state","\n"
+ "get adb state.",
+ NULL, NULL, 0
+ },
+ { do_get_net_state, -0,
+ "get_net_state","\n"
+ "get net state.",
+ NULL, NULL, 0
+ },
{ 0, 0, 0, 0, NULL, NULL, 0 }
};
diff --git a/mk_T106.sh b/mk_T106.sh
index 6a218cc..2a53128 100644
--- a/mk_T106.sh
+++ b/mk_T106.sh
@@ -1,7 +1,11 @@
#!/bin/bash
TOP=$(pwd)
source update_version.sh
-
+mkdir esdk_patch/Uboot
+cp -R boot/ build/ cp/ pub/ rpm/ tools/ esdk_patch/Uboot/
+cd esdk_patch
+tar -czvf Uboot.tar.gz Uboot
+cd ${TOP}
cd ap/project/zx297520v3/prj_vehicle_dc_ref/build/
make allclean all
cd ../../../../..
@@ -29,6 +33,7 @@
tar -czvf upstream.tar.gz upstream
mkdir do_package_tool
cd ${TOP}
+cp esdk_patch/Uboot.tar.gz allbins cap/zx297520v3/build-vehicle_dc_ref/tmp/deploy/sdk/
cp -R allbins cap/zx297520v3/build-vehicle_dc_ref/tmp/deploy/sdk/do_package_tool/
cd cap/zx297520v3/build-vehicle_dc_ref/tmp/deploy/sdk/
tar -czvf do_package_tool.tar.gz do_package_tool
diff --git a/update_version.sh b/update_version.sh
index 57852e6..8daa8be 100755
--- 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.02P52U02.AP.09.11"
-LYNQ_CAP_INSIDE_VERSION="CAP.09.11"
-LYNQ_CAP_VERSION="CAP.09.11"
+LYNQ_AP_VERSION="T106CN-ZS03.V2.01.01.02P54U02.AP.10.04"
+LYNQ_CAP_INSIDE_VERSION="CAP.10.04"
+LYNQ_CAP_VERSION="CAP.10.04"
COMMIT_ID="$(git rev-parse HEAD)"
LYNQ_SW_INSIDE_VERSION="LYNQ_CONFIG_VERSION = \"${LYNQ_AP_VERSION}_${LYNQ_CAP_INSIDE_VERSION}\""