map/das-dn/third_party/AdsLib/AmsPort.h

32 lines
697 B
C
Raw Normal View History

2024-12-03 10:36:06 +08:00
// SPDX-License-Identifier: MIT
/**
Copyright (c) 2015 - 2022 Beckhoff Automation GmbH & Co. KG
*/
#pragma once
#include "NotificationDispatcher.h"
2024-12-09 09:41:04 +08:00
namespace Beckhoff
{
namespace Ads
{
2024-12-03 10:36:06 +08:00
struct AmsPort {
AmsPort();
void Close();
bool IsOpen() const;
uint16_t Open(uint16_t __port);
uint32_t tmms;
uint16_t port;
void AddNotification(AmsAddr ams, uint32_t hNotify, SharedDispatcher dispatcher);
long DelNotification(AmsAddr ams, uint32_t hNotify);
private:
using NotifyUUID = std::pair<const AmsAddr, const uint32_t>;
static const uint32_t DEFAULT_TIMEOUT = 5000;
std::map<NotifyUUID, SharedDispatcher> dispatcherList;
std::mutex mutex;
};
2024-12-09 09:41:04 +08:00
}
}