IO::Modbus::STM8Relay::Request Class Reference

#include <Request.h>

Inheritance diagram for IO::Modbus::STM8Relay::Request:
Collaboration diagram for IO::Modbus::STM8Relay::Request:

Public Member Functions

 Request (Device &device)
 
ErrorCode parseJson (JsonObjectConst json) override
 Fill this request from a JSON description. More...
 
void getJson (JsonObject json) const override
 Get result of a completed request in JSON format. More...
 
const DevicegetDevice () const
 
bool setNode (DevNode node) override
 If nodes are supported, implement this method. More...
 
bool nodeLatch (DevNode node)
 
bool nodeMomentary (DevNode node)
 
bool nodeDelay (DevNode node, uint8_t secs)
 
DevNode::States getNodeStates (DevNode node) override
 Query node status from response. More...
 
bool setNodeState (DevNode node, DevNode::State state) override
 
StateMaskgetResponse ()
 
const StateMaskgetResponse () const
 
Function fillRequestData (PDU::Data &data) override
 
ErrorCode callback (PDU &pdu) override
 Process a received PDU. More...
 
- Public Member Functions inherited from IO::Modbus::Request
 Request (Device &device)
 
DevicegetDevice () const
 
virtual uint16_t getAddress () const
 Allows per-request address override (e.g. for broadcast) More...
 
- Public Member Functions inherited from IO::RS485::Request
 Request (Device &device)
 
DevicegetDevice () const
 
- Public Member Functions inherited from IO::Request
 Request (Device &device)
 
 Request (const Request &)=delete
 
virtual ~Request ()
 
ErrorCode error () const
 Request error code defaults to 'pending' and is set on completion. More...
 
bool isPending () const
 
String caption () const
 Get a descriptive caption for this request. More...
 
virtual void submit ()
 Submit a request. More...
 
void complete (ErrorCode err)
 
void setID (const String &value)
 Request identifiers are optional, useful for tracking remote requests. More...
 
void setCommand (Command cmd)
 Set the command code. More...
 
void onComplete (Callback callback)
 Set the request completion callback. More...
 
bool nodeQuery (DevNode node)
 
bool nodeOff (DevNode node)
 
bool nodeOn (DevNode node)
 
bool nodeToggle (DevNode node)
 
virtual bool setValue (int value)
 If nodes support values, implement this method. More...
 
const CStringid () const
 Get the request ID, if there is one. More...
 
Command getCommand () const
 
virtual void handleEvent (Event event)
 Implementations may override this method as required. More...
 
bool nodeSet (DevNode node, int value)
 For nodes supporting analogue state (e.g. brightness) More...
 
bool nodeAdjust (DevNode node, int value)
 
- Public Member Functions inherited from LinkedObjectTemplate< Request >
Request * getNext () const
 
bool insertAfter (Request *object)
 
Iterator begin () const
 
Iterator end () const
 
Iterator cbegin () const
 
Iterator cend () const
 
- Public Member Functions inherited from LinkedObject
virtual ~LinkedObject ()
 
virtual LinkedObjectnext () const
 
bool insertAfter (LinkedObject *object)
 
bool operator== (const LinkedObject &other) const
 
bool operator!= (const LinkedObject &other) const
 

Additional Inherited Members

- Public Types inherited from IO::Request
using OwnedList = OwnedLinkedObjectListTemplate< Request >
 
using Callback = Delegate< void(const Request &request)>
 Per-request callback A request goes through the following states: More...
 
- Public Types inherited from LinkedObjectTemplate< Request >
using Iterator = IteratorTemplate< Request, Request *, Request & >
 
using ConstIterator = IteratorTemplate< const Request, const Request *, const Request & >
 
- Public Attributes inherited from IO::Request
Devicedevice
 

Constructor & Destructor Documentation

◆ Request()

IO::Modbus::STM8Relay::Request::Request ( Device device)
inline

Member Function Documentation

◆ callback()

ErrorCode IO::Modbus::STM8Relay::Request::callback ( PDU pdu)
overridevirtual

Process a received PDU.

Parameters
pdu
Return values
ErrorCodeIf request is re-submitted, return Error::pending, otherwise request will be completed with given error.

Implements IO::Modbus::Request.

◆ fillRequestData()

Function IO::Modbus::STM8Relay::Request::fillRequestData ( PDU::Data data)
overridevirtual

Implements IO::Modbus::Request.

◆ getDevice()

const Device& IO::Modbus::STM8Relay::Request::getDevice ( ) const
inline

◆ getJson()

void IO::Modbus::STM8Relay::Request::getJson ( JsonObject  json) const
overridevirtual

Get result of a completed request in JSON format.

Reimplemented from IO::Request.

◆ getNodeStates()

DevNode::States IO::Modbus::STM8Relay::Request::getNodeStates ( DevNode  node)
overridevirtual

Query node status from response.

Reimplemented from IO::Request.

◆ getResponse() [1/2]

StateMask& IO::Modbus::STM8Relay::Request::getResponse ( )
inline

◆ getResponse() [2/2]

const StateMask& IO::Modbus::STM8Relay::Request::getResponse ( ) const
inline

◆ nodeDelay()

bool IO::Modbus::STM8Relay::Request::nodeDelay ( DevNode  node,
uint8_t  secs 
)
inline

◆ nodeLatch()

bool IO::Modbus::STM8Relay::Request::nodeLatch ( DevNode  node)
inline

◆ nodeMomentary()

bool IO::Modbus::STM8Relay::Request::nodeMomentary ( DevNode  node)
inline

◆ parseJson()

ErrorCode IO::Modbus::STM8Relay::Request::parseJson ( JsonObjectConst  json)
overridevirtual

Fill this request from a JSON description.

Reimplemented from IO::Request.

◆ setNode()

bool IO::Modbus::STM8Relay::Request::setNode ( DevNode  node)
overridevirtual

If nodes are supported, implement this method.

/

/**

Reimplemented from IO::Modbus::Request.

◆ setNodeState()

bool IO::Modbus::STM8Relay::Request::setNodeState ( DevNode  node,
DevNode::State  state 
)
inlineoverridevirtual

Reimplemented from IO::Request.


The documentation for this class was generated from the following file: