From 0fc6bc67a2c01b747b937d6f9198349a8e07551e Mon Sep 17 00:00:00 2001 From: ling <1042585959@qq.com> Date: Thu, 21 Mar 2024 08:42:01 +0800 Subject: [PATCH] fix --- quectel_cm_5G/src/device.c | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/quectel_cm_5G/src/device.c b/quectel_cm_5G/src/device.c index db2c7e0..f67cfc0 100644 --- a/quectel_cm_5G/src/device.c +++ b/quectel_cm_5G/src/device.c @@ -444,28 +444,15 @@ int mhidevice_detect(char *qmichannel, char *usbnet_adapter, PROFILE_T *profile) continue; } - // 解决硬编码导致不兼容hv问题 - snprintf(path, sizeof(path), "%s/%s_IPCR", rootdir, ent->d_name); + snprintf(path, sizeof(path), "%s/%.13s_IPCR", rootdir, ent->d_name); if (access(path, F_OK)) { - snprintf(path, sizeof(path), "%s/%s_QMI0", rootdir, ent->d_name); + snprintf(path, sizeof(path), "%s/%.13s_QMI0", rootdir, ent->d_name); if (access(path, F_OK)) { - snprintf(path, sizeof(path), "%s/%s_MBIM", rootdir, ent->d_name); + snprintf(path, sizeof(path), "%s/%.13s_MBIM", rootdir, ent->d_name); if (!access(path, F_OK)) software_interface = SOFTWARE_MBIM; } } - - // 原代码 - // snprintf(path, sizeof(path), "%s/%.13s_IPCR", rootdir, ent->d_name); - // if (access(path, F_OK)) { - // snprintf(path, sizeof(path), "%s/%.13s_QMI0", rootdir, ent->d_name); - // if (access(path, F_OK)) { - // snprintf(path, sizeof(path), "%s/%.13s_MBIM", rootdir, ent->d_name); - // if (!access(path, F_OK)) - // software_interface = SOFTWARE_MBIM; - // } - // } - if (access(path, F_OK)) continue;