2024-12-03 10:36:06 +08:00
|
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
/**
|
|
|
|
Copyright (c) 2021 - 2022 Beckhoff Automation GmbH & Co. KG
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "AdsDevice.h"
|
|
|
|
|
2024-12-09 09:41:04 +08:00
|
|
|
namespace Beckhoff
|
2024-12-03 10:36:06 +08:00
|
|
|
{
|
2024-12-09 09:41:04 +08:00
|
|
|
namespace Ads
|
2024-12-03 10:36:06 +08:00
|
|
|
{
|
|
|
|
#define RTIME_CPU_SETTINGS 0xd
|
|
|
|
#define RTIME_READ_LATENCY 0x2
|
|
|
|
#define RTIME_RESET_LATENCY 0xb
|
|
|
|
|
|
|
|
struct RTimeCpuSettings {
|
|
|
|
uint32_t nWinCPUs;
|
|
|
|
uint32_t nNonWinCPUs;
|
|
|
|
uint64_t affinityMask;
|
|
|
|
uint32_t nRtCpus;
|
|
|
|
uint32_t nCpuType;
|
|
|
|
uint32_t nCpuFamily;
|
|
|
|
uint32_t nCpuFreq;
|
|
|
|
};
|
|
|
|
|
2024-12-09 09:41:04 +08:00
|
|
|
std::ostream& operator<<(std::ostream& os, const Beckhoff::Ads::RTimeCpuSettings& info);
|
|
|
|
|
2024-12-03 10:36:06 +08:00
|
|
|
struct RTimeCpuLatency {
|
|
|
|
uint32_t current;
|
|
|
|
uint32_t maximum;
|
|
|
|
uint32_t limit;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct RTimeAccess {
|
|
|
|
RTimeAccess(const std::string& gw, AmsNetId netid, uint16_t port);
|
|
|
|
RTimeCpuSettings ReadCpuSettings() const;
|
|
|
|
long SetSharedCores(uint32_t sharedCores) const;
|
|
|
|
long ShowLatency(uint32_t indexOffset) const;
|
|
|
|
long ShowLatency(uint32_t indexOffset, uint32_t cpuId) const;
|
|
|
|
private:
|
|
|
|
AdsDevice device;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|