dnp3 (C++ API) 1.1.0
dnp3::Request Class Reference

Custom request. More...

#include <dnp3.hpp>

Public Member Functions

 Request (Request &&other) noexcept
 Transfer ownership of the underlying C-type to this instance and invalidate the other instance. More...
 
 Request ()
 Create a new request. More...
 
 ~Request ()
 Destroy a request created with Request::Request() or Request::class_request(). More...
 
void add_one_byte_range_header (Variation variation, uint8_t start, uint8_t stop)
 Add a one-byte start/stop variation interrogation. More...
 
void add_two_byte_range_header (Variation variation, uint16_t start, uint16_t stop)
 Add a two-byte start/stop variation interrogation. More...
 
void add_all_objects_header (Variation variation)
 Add an all objects variation interrogation. More...
 
void add_one_byte_limited_count_header (Variation variation, uint8_t count)
 Add a one-byte limited count variation interrogation. More...
 
void add_two_byte_limited_count_header (Variation variation, uint16_t count)
 Add a two-byte limited count variation interrogation. More...
 

Static Public Member Functions

static Request class_request (bool class0, bool class1, bool class2, bool class3)
 Create a new request asking for classes. More...
 
static Request all_objects (Variation variation)
 Create a new request asking for all objects of a particular variation. More...
 
static Request one_byte_range (Variation variation, uint8_t start, uint8_t stop)
 Create a new request asking for range of objects (using 8-bit start/stop). More...
 
static Request two_byte_range (Variation variation, uint16_t start, uint16_t stop)
 Create a new request asking for range of objects (using 16-bit start/stop). More...
 
static Request one_byte_limited_count (Variation variation, uint8_t count)
 Create a new request asking for a limited count of objects (using 8-bit start/stop). More...
 
static Request two_byte_limited_count (Variation variation, uint16_t count)
 Create a new request asking for a limited count of objects (using 16-bit start/stop). More...
 

Friends

class CppRequestFriend
 

Detailed Description

Custom request.

Whenever a method takes a request as a parameter, the request is internally copied. Therefore, it is possible to reuse the same requests over and over.

Constructor & Destructor Documentation

◆ Request() [1/2]

dnp3::Request::Request ( Request &&  other)
inlinenoexcept

Transfer ownership of the underlying C-type to this instance and invalidate the other instance.

Note
the moved class will now throw an exception if any method is called
Parameters
otherClass from which ownership will be transfer to this instance

◆ Request() [2/2]

dnp3::Request::Request ( )

Create a new request.

◆ ~Request()

dnp3::Request::~Request ( )

Destroy a request created with Request::Request() or Request::class_request().

Member Function Documentation

◆ add_all_objects_header()

void dnp3::Request::add_all_objects_header ( Variation  variation)

Add an all objects variation interrogation.

Parameters
variationVariation to ask for

◆ add_one_byte_limited_count_header()

void dnp3::Request::add_one_byte_limited_count_header ( Variation  variation,
uint8_t  count 
)

Add a one-byte limited count variation interrogation.

Parameters
variationVariation to ask for
countMaximum number of events

◆ add_one_byte_range_header()

void dnp3::Request::add_one_byte_range_header ( Variation  variation,
uint8_t  start,
uint8_t  stop 
)

Add a one-byte start/stop variation interrogation.

Parameters
variationVariation to ask for
startStart index to ask
stopStop index to ask (inclusive)

◆ add_two_byte_limited_count_header()

void dnp3::Request::add_two_byte_limited_count_header ( Variation  variation,
uint16_t  count 
)

Add a two-byte limited count variation interrogation.

Parameters
variationVariation to ask for
countMaximum number of events

◆ add_two_byte_range_header()

void dnp3::Request::add_two_byte_range_header ( Variation  variation,
uint16_t  start,
uint16_t  stop 
)

Add a two-byte start/stop variation interrogation.

Parameters
variationVariation to ask for
startStart index to ask
stopStop index to ask (inclusive)

◆ all_objects()

static Request dnp3::Request::all_objects ( Variation  variation)
static

Create a new request asking for all objects of a particular variation.

An identical request can be created manually with Request::Request() and Request::add_all_objects_header().

Parameters
variationVariation to ask for
Returns
Handle to the created request

◆ class_request()

static Request dnp3::Request::class_request ( bool  class0,
bool  class1,
bool  class2,
bool  class3 
)
static

Create a new request asking for classes.

An identical request can be created manually with Request::add_all_objects_header() and variations Variation::group60_var1, Variation::group60_var2, Variation::group60_var3 and Variation::group60_var4.

Parameters
class0Ask for class 0 (static data)
class1Ask for class 1 events
class2Ask for class 2 events
class3Ask for class 3 events
Returns
Handle to the created request

◆ one_byte_limited_count()

static Request dnp3::Request::one_byte_limited_count ( Variation  variation,
uint8_t  count 
)
static

Create a new request asking for a limited count of objects (using 8-bit start/stop).

An identical request can be created manually with Request::Request() and Request::add_one_byte_limited_count_header().

Parameters
variationVariation to ask for
countMaximum number of events
Returns
Handle to the created request

◆ one_byte_range()

static Request dnp3::Request::one_byte_range ( Variation  variation,
uint8_t  start,
uint8_t  stop 
)
static

Create a new request asking for range of objects (using 8-bit start/stop).

An identical request can be created manually with Request::Request() and Request::add_one_byte_range_header().

Parameters
variationVariation to ask for
startStart index to ask
stopStop index to ask (inclusive)
Returns
Handle to the created request

◆ two_byte_limited_count()

static Request dnp3::Request::two_byte_limited_count ( Variation  variation,
uint16_t  count 
)
static

Create a new request asking for a limited count of objects (using 16-bit start/stop).

An identical request can be created manually with Request::Request() and Request::add_two_byte_limited_count_header().

Parameters
variationVariation to ask for
countMaximum number of events
Returns
Handle to the created request

◆ two_byte_range()

static Request dnp3::Request::two_byte_range ( Variation  variation,
uint16_t  start,
uint16_t  stop 
)
static

Create a new request asking for range of objects (using 16-bit start/stop).

An identical request can be created manually with Request::Request() and Request::add_two_byte_range_header().

Parameters
variationVariation to ask for
startStart index to ask
stopStop index to ask (inclusive)
Returns
Handle to the created request

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