优化网络摄像头电源控制

streaming
Matthew 4 months ago
parent 2898295236
commit 54e35bce2c

@ -539,13 +539,13 @@ class NetCameraPowerCtrl : public PowerControl
public: public:
NetCameraPowerCtrl(uint32_t closeDelayTime) : NetCameraPowerCtrl(uint32_t closeDelayTime) :
#ifdef USING_N938 #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 #else // USING_N938
#ifdef USING_PLZ #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 #else // USING_PLZ
// MicroPhoto // 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_PLZ
#endif // USING_N938 #endif // USING_N938
{ {

@ -1534,12 +1534,8 @@ bool CPhoneDevice::TakePhotoWithNetCamera(IDevice::PHOTO_INFO& localPhotoInfo, c
XYLOG(XYLOG_SEVERITY_DEBUG, "Ethernet Power ON"); XYLOG(XYLOG_SEVERITY_DEBUG, "Ethernet Power ON");
std::shared_ptr<PowerControl> ethernetPowerCtrl = std::make_shared<EthernetPowerCtrl>(1); std::shared_ptr<PowerControl> ethernetPowerCtrl = std::make_shared<EthernetPowerCtrl>(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(); net_handle_t netHandle = GetEthnetHandle();
if (netHandle == 0) if (netHandle == 0)
{ {
// Wait about 10s // 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); 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 }; NET_PHOTO_INFO netPhotoInfo = { netHandle, 0 };
if (localPhotoInfo.vendor == 1) if (localPhotoInfo.vendor == 1)
{ {

Loading…
Cancel
Save