diff --git a/app/src/main/cpp/netcamera/HangYuCtrl.cpp b/app/src/main/cpp/netcamera/HangYuCtrl.cpp index c852346f..5b096496 100644 --- a/app/src/main/cpp/netcamera/HangYuCtrl.cpp +++ b/app/src/main/cpp/netcamera/HangYuCtrl.cpp @@ -12,6 +12,16 @@ #include #include +HangYuCtrl::HangYuCtrl(const std::string& ip, const std::string& userName, const std::string& password, uint8_t channel, net_handle_t netHandle, bool syncTime) + : VendorCtrl(ip, userName, password, channel, netHandle, syncTime) +{ + if (syncTime) + { + time_t ts = time(NULL); + UpdateTime(ts); + } +} + HangYuCtrl::~HangYuCtrl() { diff --git a/app/src/main/cpp/netcamera/HangYuCtrl.h b/app/src/main/cpp/netcamera/HangYuCtrl.h index be5b2a84..40196744 100644 --- a/app/src/main/cpp/netcamera/HangYuCtrl.h +++ b/app/src/main/cpp/netcamera/HangYuCtrl.h @@ -10,7 +10,7 @@ class HangYuCtrl : public VendorCtrl { public: - using VendorCtrl::VendorCtrl; + HangYuCtrl(const std::string& ip, const std::string& userName, const std::string& password, uint8_t channel, net_handle_t netHandle, bool syncTime = true); virtual ~HangYuCtrl(); virtual bool SetOsd(uint8_t channel, std::string osd, uint8_t pos); diff --git a/app/src/main/cpp/netcamera/HikonCtrl.cpp b/app/src/main/cpp/netcamera/HikonCtrl.cpp index eaa194d5..5fb221c8 100644 --- a/app/src/main/cpp/netcamera/HikonCtrl.cpp +++ b/app/src/main/cpp/netcamera/HikonCtrl.cpp @@ -12,6 +12,16 @@ #include #include +HikonCtrl::HikonCtrl(const std::string& ip, const std::string& userName, const std::string& password, uint8_t channel, net_handle_t netHandle, bool syncTime) + : VendorCtrl(ip, userName, password, channel, netHandle, syncTime) +{ + if (syncTime) + { + time_t ts = time(NULL); + UpdateTime(ts); + } +} + HikonCtrl::~HikonCtrl() { diff --git a/app/src/main/cpp/netcamera/HikonCtrl.h b/app/src/main/cpp/netcamera/HikonCtrl.h index 0acb9d15..1f004221 100644 --- a/app/src/main/cpp/netcamera/HikonCtrl.h +++ b/app/src/main/cpp/netcamera/HikonCtrl.h @@ -10,7 +10,7 @@ class HikonCtrl : public VendorCtrl { public: - using VendorCtrl::VendorCtrl; + HikonCtrl(const std::string& ip, const std::string& userName, const std::string& password, uint8_t channel, net_handle_t netHandle, bool syncTime = true); virtual ~HikonCtrl(); virtual bool SetOsd(uint8_t channel, std::string osd, uint8_t pos); diff --git a/app/src/main/cpp/netcamera/VendorCtrl.cpp b/app/src/main/cpp/netcamera/VendorCtrl.cpp index 4552eb5b..b54195ea 100644 --- a/app/src/main/cpp/netcamera/VendorCtrl.cpp +++ b/app/src/main/cpp/netcamera/VendorCtrl.cpp @@ -7,11 +7,7 @@ VendorCtrl::VendorCtrl(const std::string& ip, const std::string& userName, const std::string& password, uint8_t channel, net_handle_t netHandle, bool syncTime/* = true*/) : m_ip(ip), m_userName(userName), m_password(password), m_channel(channel), m_netHandle(netHandle) { - if (syncTime) - { - time_t ts = time(NULL); -// UpdateTime(ts); - } + } std::string VendorCtrl::CvtJSONToString(const Json::Value& data) { diff --git a/app/src/main/cpp/netcamera/YuShiCtrl.cpp b/app/src/main/cpp/netcamera/YuShiCtrl.cpp index 7b7f0df4..bcba3621 100644 --- a/app/src/main/cpp/netcamera/YuShiCtrl.cpp +++ b/app/src/main/cpp/netcamera/YuShiCtrl.cpp @@ -8,6 +8,16 @@ #include +YuShiCtrl::YuShiCtrl(const std::string& ip, const std::string& userName, const std::string& password, uint8_t channel, net_handle_t netHandle, bool syncTime) + : VendorCtrl(ip, userName, password, channel, netHandle, syncTime) +{ + if (syncTime) + { + time_t ts = time(NULL); + UpdateTime(ts); + } +} + YuShiCtrl::~YuShiCtrl() { diff --git a/app/src/main/cpp/netcamera/YuShiCtrl.h b/app/src/main/cpp/netcamera/YuShiCtrl.h index dbc4c07a..c334bf7b 100644 --- a/app/src/main/cpp/netcamera/YuShiCtrl.h +++ b/app/src/main/cpp/netcamera/YuShiCtrl.h @@ -10,7 +10,8 @@ class YuShiCtrl : public VendorCtrl { public: - using VendorCtrl::VendorCtrl; +// using VendorCtrl::VendorCtrl; + YuShiCtrl(const std::string& ip, const std::string& userName, const std::string& password, uint8_t channel, net_handle_t netHandle, bool syncTime = true); virtual ~YuShiCtrl(); virtual bool SetOsd(uint8_t channel, std::string osd, uint8_t pos);