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