PLCnext API Documentation 24.0.0.71
PnStationStatePayload.hpp
1
2//
3// Copyright PHOENIX CONTACT Electronics GmbH
4//
6
7#pragma once
8
9
10#include "Arp/System/Core/Arp.h"
11#include "Arp/System/Nm/SpecializedPayload.hpp"
12#include "Arp/System/NmPayload/Io/ProfinetStack/PnStationType.hpp"
13#include <tuple>
14
15
16namespace Arp { namespace System { namespace NmPayload { namespace Io { namespace ProfinetStack
17{
18
19
21class ARP_CXX_SYMBOL_EXPORT PnStationStatePayload : public Arp::System::Nm::SpecializedPayload<PnStationStatePayload>
22{
23public:
25 using ArgumentsType = std::tuple<const char*, PnStationType, bool, bool>;
26
27 using SpecializedPayload::SpecializedPayload;
28
30 explicit PnStationStatePayload(const ArgumentsType& args);
31
37 const String& componentName, PnStationType stationType, bool bfLed, bool sfLed);
38
41
43 PnStationType GetStationType() const;
44
46 bool GetBfLed() const;
47
49 bool GetSfLed() const;
50
51private:
52 String GetFormatstring(bool bfLed, bool sfLed) const;
53 String LedStateToString(bool state) const;
54
55private:
56 // Do not change the order of the field initialization!
57 const size_t indexComponentName = this->AddField<String>();
58 const size_t indexStationType = this->AddField<PnStationType>();
59 const size_t indexBfLed = this->AddField<bool>();
60 const size_t indexSfLed = this->AddField<bool>();
61};
62
63
64}}}}} // namespace Arp::System::NmPayload::Io::ProfinetStack
Payload class for state changes of PROFINET LEDs
Definition: PnStationStatePayload.hpp:22
bool GetSfLed() const
Returns the state of the SF LED
String GetComponentName() const
Return the name of the sending component
PnStationStatePayload(const ArgumentsType &args)
Constructs the payload object
bool GetBfLed() const
Returns the state of the BF LED
PnStationStatePayload(const String &componentName, PnStationType stationType, bool bfLed, bool sfLed)
Constructs the payload object
PnStationType GetStationType() const
Returns the station type
std::tuple< const char *, PnStationType, bool, bool > ArgumentsType
ArgumentsType to be used with NonBlockingNotificationRegistration3
Definition: PnStationStatePayload.hpp:25
Base class for custom Payload classes
Definition: SpecializedPayload.hpp:44
@ System
System components used by the System, Device, Plc or Io domains.
Root namespace for the PLCnext API