From 70075a0eccf1feb48344ed58554f7d5d0c0f9b88 Mon Sep 17 00:00:00 2001 From: Matthew Date: Fri, 22 Nov 2024 11:49:07 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BD=91=E7=BB=9C=E6=91=84=E5=83=8F=E6=9C=BAip?= =?UTF-8?q?=E5=9C=B0=E5=9D=80=E7=9A=84=E5=B1=9E=E6=80=A7=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/cpp/PhoneDevice.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/src/main/cpp/PhoneDevice.cpp b/app/src/main/cpp/PhoneDevice.cpp index fe856631..91de8126 100644 --- a/app/src/main/cpp/PhoneDevice.cpp +++ b/app/src/main/cpp/PhoneDevice.cpp @@ -1522,7 +1522,10 @@ bool CPhoneDevice::TakePhoto(const IDevice::PHOTO_INFO& photoInfo, const vector< std::this_thread::sleep_for(std::chrono::milliseconds(128)); NET_PHOTO_INFO netPhotoInfo = { 0 }; - strcpy(netPhotoInfo.ip, "192.168.19.107"); + + struct in_addr addr; + addr.s_addr = localPhotoInfo.ip; + strcpy(netPhotoInfo.ip, inet_ntoa(addr)); strcpy(netPhotoInfo.url, "/cgi-bin/snapshot.cgi"); strcpy(netPhotoInfo.outputPath, path.c_str());