IO::RFSwitch::Request Class Reference

#include <Request.h>

Inheritance diagram for IO::RFSwitch::Request:
Collaboration diagram for IO::RFSwitch::Request:

Public Member Functions

 Request (IO::Device &device)
 
const DevicegetDevice () const
 
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...
 
bool setNode (DevNode node) override
 If nodes are supported, implement this method. More...
 
void send (uint32_t code, uint8_t repeats=0)
 
uint32_t getCode () const
 
uint8_t getRepeats () 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...
 
virtual DevNode::States getNodeStates (DevNode node)
 Query node status from response. More...
 
virtual bool setNodeState (DevNode node, DevNode::State state)
 
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
 

Protected Member Functions

void callback ()
 

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::RFSwitch::Request::Request ( IO::Device device)
inline

Member Function Documentation

◆ callback()

void IO::RFSwitch::Request::callback ( )
inlineprotected

◆ getCode()

uint32_t IO::RFSwitch::Request::getCode ( ) const
inline

◆ getDevice()

const Device& IO::RFSwitch::Request::getDevice ( ) const
inline

◆ getJson()

void IO::RFSwitch::Request::getJson ( JsonObject  json) const
overridevirtual

Get result of a completed request in JSON format.

Reimplemented from IO::Request.

◆ getRepeats()

uint8_t IO::RFSwitch::Request::getRepeats ( ) const
inline

◆ parseJson()

ErrorCode IO::RFSwitch::Request::parseJson ( JsonObjectConst  json)
overridevirtual

Fill this request from a JSON description.

Reimplemented from IO::Request.

◆ send()

void IO::RFSwitch::Request::send ( uint32_t  code,
uint8_t  repeats = 0 
)

◆ setNode()

bool IO::RFSwitch::Request::setNode ( DevNode  node)
inlineoverridevirtual

If nodes are supported, implement this method.

/

/**

Reimplemented from IO::Request.


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