PLCnext API Documentation  21.0.0.35466
PnStationStatePayload.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/Io/ProfinetStack/PnStationType.hpp"
12 
13 
14 namespace Arp { namespace System { namespace NmPayload { namespace Io { namespace ProfinetStack
15 {
16 
17 
19 class PnStationStatePayload : public Arp::System::Nm::SpecializedPayload<PnStationStatePayload>
20 {
21 public:
22  using SpecializedPayload::SpecializedPayload;
23 
29  const String& componentName, PnStationType stationType, bool bfLed, bool sfLed);
30 
32  String GetComponentName() const;
33 
35  PnStationType GetStationType() const;
36 
38  bool GetBfLed() const;
39 
41  bool GetSfLed() const;
42 
43 private:
44  String GetFormatstring(bool bfLed, bool sfLed) const;
45  String LedStateToString(bool state) const;
46 
47 private:
48  // Do not change the order of the field initialization!
49  const size_t indexComponentName = this->AddField<String>();
50  const size_t indexStationType = this->AddField<PnStationType>();
51  const size_t indexBfLed = this->AddField<bool>();
52  const size_t indexSfLed = this->AddField<bool>();
53 };
54 
55 
56 }}}}} // namespace Arp::System::NmPayload::Io::ProfinetStack
PnStationType GetStationType() const
Returns the station type
bool GetSfLed() const
Returns the state of the SF LED
Base class for custom Payload classes
Definition: SpecializedPayload.hpp:42
PnStationStatePayload(const String &componentName, PnStationType stationType, bool bfLed, bool sfLed)
Constructs the payload object
String GetComponentName() const
Return the name of the sending component
Payload class for state changes of PROFINET LEDs
Definition: PnStationStatePayload.hpp:19
Root namespace for the PLCnext API
System components used by the System, Device, Plc or Io domains.
bool GetBfLed() const
Returns the state of the BF LED