PLCnext API Documentation  22.9.0.33
EthernetLinkStatePayload.hpp
1 //
3 // Copyright PHOENIX CONTACT Electronics GmbH
4 //
6 #pragma once
7 #include "Arp/System/Nm/SpecializedPayload.hpp"
8 #include "Arp/System/NmPayload/Device/EthernetLinkState.hpp"
9 #include <tuple>
10 
11 namespace Arp { namespace System { namespace NmPayload { namespace Device
12 {
13 
17  : public Arp::System::Nm::SpecializedPayload<EthernetLinkStatePayload>
18 {
19 public:
21  using ArgumentsType = std::tuple<uint32, uint32, EthernetLinkState>;
22 
23  using SpecializedPayload::SpecializedPayload;
24 
26  explicit EthernetLinkStatePayload(const ArgumentsType& args);
27 
32  EthernetLinkStatePayload(uint32 interface, uint32 port, EthernetLinkState state);
33 
36 
38  uint32 GetPort() const;
39 
41  EthernetLinkState GetState() const;
42 
43 private:
44  // Do not change the order of the field initialization!
45  const size_t indexInterface = this->AddField<uint32>();
46  const size_t indexPort = this->AddField<uint32>();
47  const size_t indexState = this->AddField<EthernetLinkState>();
48 };
49 
50 
51 }}}} // namespace Arp::System::NmPayload::Device
Payload class for changes of the link state of an Ethernet port
Definition: EthernetLinkStatePayload.hpp:18
uint32 GetInterface() const
Returns the id of interface
EthernetLinkStatePayload(const ArgumentsType &args)
Creates a payload object
uint32 GetPort() const
Returns the id of the port
EthernetLinkStatePayload(uint32 interface, uint32 port, EthernetLinkState state)
Creates a payload object
std::tuple< uint32, uint32, EthernetLinkState > ArgumentsType
ArgumentsType to be used with NonBlockingNotificationRegistration3
Definition: EthernetLinkStatePayload.hpp:21
EthernetLinkState GetState() const
Returns the state of the interface
Base class for custom Payload classes
Definition: SpecializedPayload.hpp:43
std::uint32_t uint32
The Arp unsigned integer type of 4 byte size.
Definition: PrimitiveTypes.hpp:35
@ System
System components used by the System, Device, Plc or Io domains.
Root namespace for the PLCnext API