diff --git a/app/src/main/cpp/GPIOControl.h b/app/src/main/cpp/GPIOControl.h index 442b1544..c46a174d 100644 --- a/app/src/main/cpp/GPIOControl.h +++ b/app/src/main/cpp/GPIOControl.h @@ -539,13 +539,13 @@ class NetCameraPowerCtrl : public PowerControl public: NetCameraPowerCtrl(uint32_t closeDelayTime) : #ifdef USING_N938 - PowerControl(CMD_SET_OTG_STATE, CMD_SET_NETWORK_POWER_EN, CMD_SET_PIC1_POWER, CMD_SET_485_EN_STATE, closeDelayTime) + PowerControl(CMD_SET_NETWORK_POWER_EN, CMD_SET_PIC1_POWER, CMD_SET_485_EN_STATE, closeDelayTime) #else // USING_N938 #ifdef USING_PLZ - PowerControl(CMD_SET_OTG_STATE, CMD_SET_100M_ENABLE, CMD_SET_100M_SWITCH_PWR_ENABLE, CMD_SET_12V_EN_STATE, closeDelayTime) + PowerControl(CMD_SET_12V_EN_STATE, closeDelayTime) #else // USING_PLZ // MicroPhoto - PowerControl(CMD_SET_OTG_STATE, CMD_SET_12V_EN_STATE, CMD_SET_485_EN_STATE, closeDelayTime) + PowerControl(CMD_SET_12V_EN_STATE, closeDelayTime) #endif // USING_PLZ #endif // USING_N938 { diff --git a/app/src/main/cpp/PhoneDevice.cpp b/app/src/main/cpp/PhoneDevice.cpp index 6c310754..8ebaf19d 100644 --- a/app/src/main/cpp/PhoneDevice.cpp +++ b/app/src/main/cpp/PhoneDevice.cpp @@ -1534,12 +1534,8 @@ bool CPhoneDevice::TakePhotoWithNetCamera(IDevice::PHOTO_INFO& localPhotoInfo, c XYLOG(XYLOG_SEVERITY_DEBUG, "Ethernet Power ON"); std::shared_ptr ethernetPowerCtrl = std::make_shared(1); - std::this_thread::sleep_for(std::chrono::milliseconds(1000)); - SetStaticIp(); - std::this_thread::sleep_for(std::chrono::milliseconds(256)); net_handle_t netHandle = GetEthnetHandle(); - if (netHandle == 0) { // Wait about 10s @@ -1566,6 +1562,10 @@ bool CPhoneDevice::TakePhotoWithNetCamera(IDevice::PHOTO_INFO& localPhotoInfo, c { XYLOG(XYLOG_SEVERITY_INFO, "Ethernet is Available CH=%u PR=%X PHOTOID=%u", (uint32_t)localPhotoInfo.channel, (uint32_t)localPhotoInfo.preset, localPhotoInfo.photoId); } + + SetStaticIp(); + std::this_thread::sleep_for(std::chrono::milliseconds(256)); + NET_PHOTO_INFO netPhotoInfo = { netHandle, 0 }; if (localPhotoInfo.vendor == 1) {