|
SMACC2
|
Client behavior to read relay channel status. More...
#include <cb_relay_status.hpp>


Public Member Functions | |
| CbRelayStatus () | |
| Construct behavior to read all channel statuses. | |
| CbRelayStatus (int channel) | |
| Construct behavior to read a specific channel status. | |
| virtual | ~CbRelayStatus () |
| template<typename TOrthogonal , typename TSourceObject > | |
| void | onStateOrthogonalAllocation () |
| virtual void | onEntry () override |
| uint8_t | getChannelStates () const |
| Get the last read channel states (bitmask) | |
| virtual void | onStatusRead (uint8_t channelStates) |
| Virtual callback for status read completion Override in derived classes for custom handling. | |
Public Member Functions inherited from smacc2::SmaccAsyncClientBehavior | |
| template<typename TOrthogonal , typename TSourceObject > | |
| void | onStateOrthogonalAllocation () |
| virtual | ~SmaccAsyncClientBehavior () |
| template<typename TCallback , typename T > | |
| smacc2::SmaccSignalConnection | onSuccess (TCallback callback, T *object) |
| template<typename TCallback , typename T > | |
| smacc2::SmaccSignalConnection | onFinished (TCallback callback, T *object) |
| template<typename TCallback , typename T > | |
| smacc2::SmaccSignalConnection | onFailure (TCallback callback, T *object) |
| void | requestForceFinish () |
| void | executeOnEntry () override |
| void | executeOnExit () override |
| void | waitOnEntryThread (bool requestFinish) |
| template<typename TCallbackMethod , typename T > | |
| smacc2::SmaccSignalConnection | onSuccess (TCallbackMethod callback, T *object) |
| template<typename TCallbackMethod , typename T > | |
| smacc2::SmaccSignalConnection | onFinished (TCallbackMethod callback, T *object) |
| template<typename TCallbackMethod , typename T > | |
| smacc2::SmaccSignalConnection | onFailure (TCallbackMethod callback, T *object) |
Public Member Functions inherited from smacc2::ISmaccClientBehavior | |
| ISmaccClientBehavior () | |
| virtual | ~ISmaccClientBehavior () |
| ISmaccStateMachine * | getStateMachine () |
| std::string | getName () const |
| template<typename SmaccClientType > | |
| void | requiresClient (SmaccClientType *&storage) |
| template<typename SmaccComponentType > | |
| void | requiresComponent (SmaccComponentType *&storage, ComponentRequirement requirementType=ComponentRequirement::SOFT) |
| virtual void | onExit () |
Private Member Functions | |
| void | readSingleChannel (int channel) |
| void | readAllChannels () |
Private Attributes | |
| std::optional< int > | channel_ |
| ClModbusTcpRelay * | client_ |
| CpModbusRelay * | relayComponent_ |
| uint8_t | channelStates_ = 0 |
Additional Inherited Members | |
Protected Member Functions inherited from smacc2::SmaccAsyncClientBehavior | |
| void | postSuccessEvent () |
| void | postFailureEvent () |
| virtual void | dispose () override |
| bool | isShutdownRequested () |
| onEntry is executed in a new thread. However the current state cannot be left until the onEntry thread finishes. This flag can be checked from the onEntry thread to force finishing the thread. | |
Protected Member Functions inherited from smacc2::ISmaccClientBehavior | |
| virtual void | runtimeConfigure () |
| template<typename EventType > | |
| void | postEvent (const EventType &ev) |
| template<typename EventType > | |
| void | postEvent () |
| ISmaccState * | getCurrentState () |
| virtual rclcpp::Node::SharedPtr | getNode () const |
| virtual rclcpp::Logger | getLogger () const |
Client behavior to read relay channel status.
Can read single channel or all channels. Posts EvCbSuccess on successful read, EvCbFailure on error.
Definition at line 37 of file cb_relay_status.hpp.
|
inline |
Construct behavior to read all channel statuses.
Definition at line 43 of file cb_relay_status.hpp.
|
inlineexplicit |
Construct behavior to read a specific channel status.
| channel | Relay channel number (1-8) |
Definition at line 49 of file cb_relay_status.hpp.
|
inlinevirtual |
Definition at line 51 of file cb_relay_status.hpp.
|
inline |
Get the last read channel states (bitmask)
Definition at line 78 of file cb_relay_status.hpp.
References channelStates_.
|
inlineoverridevirtual |
Reimplemented from smacc2::ISmaccClientBehavior.
Definition at line 62 of file cb_relay_status.hpp.
References channel_, readAllChannels(), and readSingleChannel().

|
inline |
Definition at line 54 of file cb_relay_status.hpp.
References client_, smacc2::SmaccAsyncClientBehavior::onStateOrthogonalAllocation(), relayComponent_, smacc2::ISmaccClientBehavior::requiresClient(), and smacc2::ISmaccClientBehavior::requiresComponent().

|
inlinevirtual |
Virtual callback for status read completion Override in derived classes for custom handling.
| channelStates | Bitmask of channel states |
Definition at line 85 of file cb_relay_status.hpp.
References smacc2::ISmaccClientBehavior::getLogger().
Referenced by readAllChannels(), and readSingleChannel().


|
inlineprivate |
Definition at line 124 of file cb_relay_status.hpp.
References channelStates_, smacc2::ISmaccClientBehavior::getLogger(), onStatusRead(), smacc2::SmaccAsyncClientBehavior::postFailureEvent(), smacc2::SmaccAsyncClientBehavior::postSuccessEvent(), cl_modbus_tcp_relay::CpModbusRelay::readAllCoils(), and relayComponent_.
Referenced by onEntry().


|
inlineprivate |
Definition at line 96 of file cb_relay_status.hpp.
References channelStates_, smacc2::ISmaccClientBehavior::getLogger(), onStatusRead(), smacc2::SmaccAsyncClientBehavior::postFailureEvent(), smacc2::SmaccAsyncClientBehavior::postSuccessEvent(), cl_modbus_tcp_relay::CpModbusRelay::readCoil(), and relayComponent_.
Referenced by onEntry().


|
private |
Definition at line 91 of file cb_relay_status.hpp.
Referenced by onEntry().
|
private |
Definition at line 94 of file cb_relay_status.hpp.
Referenced by getChannelStates(), readAllChannels(), and readSingleChannel().
|
private |
Definition at line 92 of file cb_relay_status.hpp.
Referenced by onStateOrthogonalAllocation().
|
private |
Definition at line 93 of file cb_relay_status.hpp.
Referenced by onStateOrthogonalAllocation(), readAllChannels(), and readSingleChannel().