diff --git a/app/src/main/cpp/PhoneDevice.cpp b/app/src/main/cpp/PhoneDevice.cpp index d312fb8d..ed89fa3d 100644 --- a/app/src/main/cpp/PhoneDevice.cpp +++ b/app/src/main/cpp/PhoneDevice.cpp @@ -1567,7 +1567,18 @@ bool CPhoneDevice::TakePhotoWithNetCamera(IDevice::PHOTO_INFO& localPhotoInfo, c } else { - XYLOG(XYLOG_SEVERITY_INFO, "Ethernet is Available CH=%u PR=%X PHOTOID=%u", (uint32_t)localPhotoInfo.channel, (uint32_t)localPhotoInfo.preset, localPhotoInfo.photoId); + unsigned int ip = 0; + unsigned int netMask = 0; + unsigned int gateway = 0; + char buf[32] = { 0 }; + if (GetNetInfo("eth0", ip, netMask, gateway)) + { + // const + sockaddr_in addrIn = { AF_INET, 0, ip}; + inet_ntop(AF_INET, &addrIn.sin_addr, buf, sizeof(buf)); //其中recvAddr为SOCKADDR_IN类型 + } + + XYLOG(XYLOG_SEVERITY_INFO, "Ethernet is Available Handle=%ld IP=%s CH=%u PR=%X PHOTOID=%u", (uint64_t)netHandle, buf, (uint32_t)localPhotoInfo.channel, (uint32_t)localPhotoInfo.preset, localPhotoInfo.photoId); } // SetStaticIp();