优化脚本和日志

lowmem
Matthew 3 weeks ago
parent 6e1655813d
commit aa4ca70d07

@ -16,6 +16,8 @@ MAX_ROUTE_WAIT=5 # Maximum seconds to wait for routing rules
# For debugging only - comment out in production
# set -x
ANDROID_VERSION=$(getprop ro.build.version.release 2>/dev/null | cut -d '.' -f1)
# Record script start time
SCRIPT_START=$(date +%s)
@ -105,7 +107,12 @@ echo "IP configuration before UP: $PRE_UP_IP (1=configured, 0=missing)"
# Enable interface and wait for UP
echo "Bringing up interface..."
/system/bin/ip link set eth0 up
sleep 1
if [ "$ANDROID_VERSION" = "9" ]; then
sleep 3
else
# Use standard configuration for other devices
sleep 1
fi
# Check if IP was lost after interface UP (common issue on MTK devices)
POST_UP_IP=$(/system/bin/ip addr show eth0 | grep -c "inet $ETH_IP")

@ -1610,7 +1610,7 @@ bool CPhoneDevice::TakePhotoWithNetCamera(IDevice::PHOTO_INFO& localPhotoInfo, c
}
#endif
XYLOG(XYLOG_SEVERITY_DEBUG, "Ethernet Power ON");
std::shared_ptr<PowerControl> ethernetPowerCtrl = std::make_shared<EthernetPowerCtrl>(localPhotoInfo.closeDelayTime);
uint64_t startTime = GetMicroTimeStamp();
@ -1620,8 +1620,10 @@ bool CPhoneDevice::TakePhotoWithNetCamera(IDevice::PHOTO_INFO& localPhotoInfo, c
{
std::this_thread::sleep_for(std::chrono::milliseconds(5000 - ethDuration));
}
net_handle_t netHandle = GetEthnetHandle();
XYLOG(XYLOG_SEVERITY_DEBUG, "Ethernet Power ON Init Time=%u NetHandle=%lld", (uint32_t)ethDuration, netHandle);
std::string ip = GetIpStr(localPhotoInfo.ip);
std::unique_ptr<VendorCtrl> vendorCtrl(MakeVendorCtrl(localPhotoInfo.vendor, localPhotoInfo.channel, ip, localPhotoInfo.userName, localPhotoInfo.password, netHandle, false));

Loading…
Cancel
Save