From 812688ae68eef2b3a0ab693e63059d598ab1fff4 Mon Sep 17 00:00:00 2001 From: "XI.CHEN" <2311041011@qq.com> Date: Mon, 19 May 2025 17:46:55 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BA=91=E5=8F=B0ip=E5=9C=B0=E5=9D=80=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/cpp/PhoneDevice.cpp | 2 +- .../main/java/com/xypower/mpapp/MicroPhotoService.java | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/src/main/cpp/PhoneDevice.cpp b/app/src/main/cpp/PhoneDevice.cpp index 55a7fa8b..069f3bc7 100644 --- a/app/src/main/cpp/PhoneDevice.cpp +++ b/app/src/main/cpp/PhoneDevice.cpp @@ -1612,7 +1612,7 @@ bool CPhoneDevice::TakePhotoWithNetCamera(IDevice::PHOTO_INFO& localPhotoInfo, c std::this_thread::sleep_for(std::chrono::milliseconds(5000)); net_handle_t netHandle = 0; -#ifndef USING_N938 +#if (!(defined USING_N938 && defined USING_PTZ)) // Wait about 10s for (int idx = 0; idx < 84; idx++) { diff --git a/app/src/main/java/com/xypower/mpapp/MicroPhotoService.java b/app/src/main/java/com/xypower/mpapp/MicroPhotoService.java index 0b8bea4b..2d1fc637 100644 --- a/app/src/main/java/com/xypower/mpapp/MicroPhotoService.java +++ b/app/src/main/java/com/xypower/mpapp/MicroPhotoService.java @@ -1174,8 +1174,8 @@ public class MicroPhotoService extends Service { new Thread(new Runnable() { @Override public void run() { - if (getCustomAppId() == 2) { - // setStaticNetwork(iface, "192.168.68.91", "192.168.68.91", "192.168.68.0", 24); + if (getCustomAppId() == 2 || getCustomAppId() == 1) { + setStaticNetwork(iface, "192.168.68.91", "192.168.68.91", "192.168.68.0", 24); } else { setEthernetRoute(iface, "192.168.68.0", 24); } @@ -1798,7 +1798,7 @@ public class MicroPhotoService extends Service { public void setStaticNetwork(final String iface, final String ip, final String netmask, final String gateway) { - if (getCustomAppId() == 2) { + if (getCustomAppId() == 2 || getCustomAppId() == 1) { // N938 new Thread(new Runnable() { @Override @@ -1922,9 +1922,9 @@ public class MicroPhotoService extends Service { Process process = Runtime.getRuntime().exec("/system/xbin/su root"); DataOutputStream os = new DataOutputStream(process.getOutputStream()); - // os.writeBytes("/system/bin/ip link set eth0 down\n"); +// os.writeBytes("/system/bin/ip link set eth0 down\n"); os.writeBytes("/system/bin/ip addr add 192.168.68.91/24 broadcast 192.168.68.255 dev eth0\n"); - // os.writeBytes("/system/bin/ip link set eth0 up\n"); +// os.writeBytes("/system/bin/ip link set eth0 up\n"); // os.writeBytes("/system/bin/ip route delete 192.168.68.0/24 table 20 2>/dev/null || true\n"); os.writeBytes("/system/bin/ip route replace 192.168.68.0/24 dev eth0 proto static scope link table 20\n"); os.writeBytes("/system/bin/ip route flush cache\n");