This commit is contained in:
zhouhuang 2024-12-10 21:45:35 +08:00
parent 0d3f7d2a26
commit 3566343b62
3 changed files with 13 additions and 3 deletions

View File

@ -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

View File

@ -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) {

View File

@ -58,6 +58,7 @@ using AdsHandle = AdsResource<uint32_t>;
struct AdsDevice {
AdsDevice(const std::string& ipV4, AmsNetId netId, uint16_t port);
~AdsDevice();
AdsDeviceInfo GetDeviceInfo() const;