diff --git a/das-dn/inc/public.h b/das-dn/inc/public.h index 3db29c5d..5fb18517 100644 --- a/das-dn/inc/public.h +++ b/das-dn/inc/public.h @@ -42,9 +42,9 @@ typedef int SOCKET; #include "zlog/zlog.h" //#define MEMERY_1M 65536 //设置位64K -#define MEMERY_1M (2 << 20) //设置位64K -#define DELAY_RUN 5000 -#define DELAY_TIMER 50 //ms +#define MEMERY_1M (2 << 20) +#define DELAY_RUN 20000 +#define DELAY_TIMER 50 #define TIME_BASE (1000 / DELAY_TIMER) #define TIME_TICKS (DELAY_TIMER * 1000) #define MAX_PATH 260 diff --git a/das-dn/third_party/AdsLib/AdsDevice.cpp b/das-dn/third_party/AdsLib/AdsDevice.cpp index 5a336270..40fad4a3 100644 --- a/das-dn/third_party/AdsLib/AdsDevice.cpp +++ b/das-dn/third_party/AdsLib/AdsDevice.cpp @@ -38,6 +38,15 @@ AdsDevice::AdsDevice(const std::string& ipV4, AmsNetId amsNetId, uint16_t port) } } +AdsDevice::~AdsDevice() +{ + if (m_Connected == true) + { + DisconnectTarget(*m_NetId.get()); + m_Connected = false; + } +} + long AdsDevice::DeleteNotificationHandle(uint32_t handle) const { if (handle) { diff --git a/das-dn/third_party/AdsLib/AdsDevice.h b/das-dn/third_party/AdsLib/AdsDevice.h index a4d59440..8aad1bbf 100644 --- a/das-dn/third_party/AdsLib/AdsDevice.h +++ b/das-dn/third_party/AdsLib/AdsDevice.h @@ -58,6 +58,7 @@ using AdsHandle = AdsResource; struct AdsDevice { AdsDevice(const std::string& ipV4, AmsNetId netId, uint16_t port); + ~AdsDevice(); AdsDeviceInfo GetDeviceInfo() const;