IO::Modbus::Request Class Referenceabstract
#include <Request.h>
Inheritance diagram for IO::Modbus::Request:
Collaboration diagram for IO::Modbus::Request:
Public Member Functions | |
Request (Device &device) | |
Device & | getDevice () const |
virtual Function | fillRequestData (PDU::Data &data)=0 |
bool | setNode (DevNode node) override |
If nodes are supported, implement this method. More... | |
virtual uint16_t | getAddress () const |
Allows per-request address override (e.g. for broadcast) More... | |
virtual ErrorCode | callback (PDU &pdu)=0 |
Process a received PDU. More... | |
![]() | |
Request (Device &device) | |
Device & | getDevice () const |
![]() | |
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 ErrorCode | parseJson (JsonObjectConst json) |
Fill this request from a JSON description. More... | |
virtual void | submit () |
Submit a request. More... | |
void | complete (ErrorCode err) |
virtual void | getJson (JsonObject json) const |
Get result of a completed request in JSON format. More... | |
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... | |
virtual DevNode::States | getNodeStates (DevNode node) |
Query node status from response. More... | |
virtual bool | setNodeState (DevNode node, DevNode::State state) |
const CString & | id () 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) |
![]() | |
Request * | getNext () const |
bool | insertAfter (Request *object) |
Iterator | begin () const |
Iterator | end () const |
Iterator | cbegin () const |
Iterator | cend () const |
![]() | |
virtual | ~LinkedObject () |
virtual LinkedObject * | next () const |
bool | insertAfter (LinkedObject *object) |
bool | operator== (const LinkedObject &other) const |
bool | operator!= (const LinkedObject &other) const |
Additional Inherited Members | |
![]() | |
using | OwnedList = OwnedLinkedObjectListTemplate< Request > |
using | Callback = Delegate< void(const Request &request)> |
Per-request callback A request goes through the following states: More... | |
![]() | |
using | Iterator = IteratorTemplate< Request, Request *, Request & > |
using | ConstIterator = IteratorTemplate< const Request, const Request *, const Request & > |
![]() | |
Device & | device |
Constructor & Destructor Documentation
◆ Request()
|
inline |
Member Function Documentation
◆ callback()
Process a received PDU.
- Parameters
-
pdu
- Return values
-
ErrorCode If request is re-submitted, return Error::pending, otherwise request will be completed with given error.
Implemented in IO::Modbus::STS::Fan::Request, IO::Modbus::STM8Relay::Request, IO::Modbus::RID35::Request, IO::Modbus::R421A::Request, IO::Modbus::NT18B07::Request, and IO::Modbus::GenericRequest.
◆ fillRequestData()
◆ getAddress()
|
inlinevirtual |
Allows per-request address override (e.g. for broadcast)
◆ getDevice()
|
inline |
◆ setNode()
|
inlineoverridevirtual |
If nodes are supported, implement this method.
/
/**
Reimplemented from IO::Request.
Reimplemented in IO::Modbus::STS::Fan::Request, and IO::Modbus::STM8Relay::Request.
The documentation for this class was generated from the following file: