OS  v1.7.5
Documentation
Loading...
Searching...
No Matches
qOS::response Class Reference

A Response Handler object. More...

#include <response.hpp>

Public Member Functions

 response ()=default
 
bool setup (char *xLocBuff, const size_t nMax) noexcept
 Initialize the instance of the response handler object.
 
void reset (void) noexcept
 Reset the Response Handler.
 
responseStatus received (const char *pattern, const size_t n, const qOS::duration_t t=clock::IMMEDIATE) noexcept
 Non-Blocking response check.
 
bool isrHandler (const char rxChar) noexcept
 ISR receiver for the response handler.
 
bool isInitialized (void) const noexcept
 Check if the response object is already initialized by using response::setup()
 

Detailed Description

A Response Handler object.

Constructor & Destructor Documentation

◆ response()

qOS::response::response ( )
default

Member Function Documentation

◆ isInitialized()

bool qOS::response::isInitialized ( void ) const
noexcept

Check if the response object is already initialized by using response::setup()

Returns
true if the response object is initialized, false if not.

◆ isrHandler()

bool qOS::response::isrHandler ( const char rxChar)
noexcept

ISR receiver for the response handler.

Parameters
[in]rxCharThe byte-data from the receiver
Returns
True when the Response handler match the request from response::received()

◆ received()

responseStatus qOS::response::received ( const char * pattern,
const size_t n,
const qOS::duration_t t = clock::IMMEDIATE )
noexcept

Non-Blocking response check.

Parameters
[in]patternThe data checked in the receiver ISR
[in]nThe length of the data pointer by pattern (if pattern is string, set n to 0 to auto-compute the length)
[in]tThe timeout value given in milliseconds.
Returns
responseStatus::SUCCESS if there is a response acknowledge, responseStatus::TIMEOUT if timeout expires otherwise returns responseStatus::MISSING

◆ reset()

void qOS::response::reset ( void )
noexcept

Reset the Response Handler.

◆ setup()

bool qOS::response::setup ( char * xLocBuff,
const size_t nMax )
noexcept

Initialize the instance of the response handler object.

Parameters
[in]xLocBuffA pointer to the memory block where the desired response will remain.
[in]nMaxThe size of xLocBuff
Returns
On success returns true, otherwise returns false.