dnp3 (C++ API) 1.6.0
Loading...
Searching...
No Matches
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 header for use with a READ request. More...
 
void add_two_byte_range_header (Variation variation, uint16_t start, uint16_t stop)
 Add a two-byte start/stop header for use with a READ request. More...
 
void add_all_objects_header (Variation variation)
 Add an all objects variation request. More...
 
void add_one_byte_limited_count_header (Variation variation, uint8_t count)
 Add a one-byte limited count variation header for use with a READ request. More...
 
void add_two_byte_limited_count_header (Variation variation, uint16_t count)
 Add a two-byte limited count variation header for use with a READ request. More...
 
void add_time_and_interval (uint64_t time, uint32_t interval_ms)
 Add a single g51v1 time-and-interval. More...
 
void add_specific_attribute (uint8_t variation, uint8_t set)
 Add a one-byte start/stop header for use with a READ request. More...
 
void add_string_attribute (uint8_t variation, uint8_t set, const std::string &value)
 Add a one-byte start/stop header containing for use with a WRITE request. More...
 
void add_uint_attribute (uint8_t variation, uint8_t set, uint32_t value)
 Add a one-byte start/stop header containing for use with a WRITE request. 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 request.

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 header for use with a READ request.

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 header for use with a READ request.

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

◆ add_specific_attribute()

void dnp3::Request::add_specific_attribute ( uint8_t  variation,
uint8_t  set 
)

Add a one-byte start/stop header for use with a READ request.

Parameters
variationVariation of the device attribute
setThe set (point) to which the attribute belongs

◆ add_string_attribute()

void dnp3::Request::add_string_attribute ( uint8_t  variation,
uint8_t  set,
const std::string &  value 
)

Add a one-byte start/stop header containing for use with a WRITE request.

Parameters
variationVariation of the attribute
setThe set (point) to which the attribute belongs
valueValue of the attribute

◆ add_time_and_interval()

void dnp3::Request::add_time_and_interval ( uint64_t  time,
uint32_t  interval_ms 
)

Add a single g51v1 time-and-interval.

This is useful when constructing freeze-at-time requests

Parameters
timeDNP3 48-bit timestamp representing count of milliseconds since epoch UTC
interval_msInterval expressed in milliseconds

◆ 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 header for use with a READ request.

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 header for use with a READ request.

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

◆ add_uint_attribute()

void dnp3::Request::add_uint_attribute ( uint8_t  variation,
uint8_t  set,
uint32_t  value 
)

Add a one-byte start/stop header containing for use with a WRITE request.

Parameters
variationVariation of the attribute
setThe set (point) to which the attribute belongs
valueValue of the attribute

◆ 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: