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

Outstation handle. More...

#include <dnp3.hpp>

Public Member Functions

 Outstation (Outstation &&other) noexcept
 Transfer ownership of the underlying C-type to this instance and invalidate the other instance. More...
 
 ~Outstation ()
 Free resources of the outstation. More...
 
void transaction (DatabaseTransaction &callback)
 Acquire a mutex on the underlying database and apply a set of changes as a transaction. More...
 
void set_decode_level (const DecodeLevel &level)
 Set decoding log level. More...
 

Static Public Member Functions

static Outstation create_serial_session (Runtime &runtime, const std::string &serial_path, const SerialSettings &settings, const OutstationConfig &config, std::unique_ptr< OutstationApplication > application, std::unique_ptr< OutstationInformation > information, std::unique_ptr< ControlHandler > control_handler)
 Create an outstation instance running on a serial port. More...
 
static Outstation create_serial_session_fault_tolerant (Runtime &runtime, const std::string &serial_path, const SerialSettings &settings, std::chrono::steady_clock::duration open_retry_delay, const OutstationConfig &config, std::unique_ptr< OutstationApplication > application, std::unique_ptr< OutstationInformation > information, std::unique_ptr< ControlHandler > control_handler)
 Create an outstation instance running on a serial port which is tolerant to the serial port being added and removed. More...
 

Friends

class CppOutstationFriend
 

Detailed Description

Outstation handle.

Use this handle to modify the internal database.

Constructor & Destructor Documentation

◆ Outstation()

dnp3::Outstation::Outstation ( Outstation &&  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

◆ ~Outstation()

dnp3::Outstation::~Outstation ( )

Free resources of the outstation.

Warning
This does not shutdown the outstation. Only OutstationServer::~OutstationServer() will properly shutdown the outstation.

Member Function Documentation

◆ create_serial_session()

static Outstation dnp3::Outstation::create_serial_session ( Runtime runtime,
const std::string &  serial_path,
const SerialSettings settings,
const OutstationConfig config,
std::unique_ptr< OutstationApplication application,
std::unique_ptr< OutstationInformation information,
std::unique_ptr< ControlHandler control_handler 
)
static

Create an outstation instance running on a serial port.

The port is opened immediately on the calling thread and fails if not successful

Warning
Most users should prefer the fault tolerant version of the this method Outstation::create_serial_session_fault_tolerant()
Parameters
runtimeruntime on which to spawn the outstation
serial_pathPath of the serial device
settingssettings for the serial port
configoutstation configuration
applicationapplication interface
informationinformational events interface
control_handlercontrol handler interface
Returns
Outstation instance or NULL if the port cannot be opened
Exceptions
ParamException

◆ create_serial_session_fault_tolerant()

static Outstation dnp3::Outstation::create_serial_session_fault_tolerant ( Runtime runtime,
const std::string &  serial_path,
const SerialSettings settings,
std::chrono::steady_clock::duration  open_retry_delay,
const OutstationConfig config,
std::unique_ptr< OutstationApplication application,
std::unique_ptr< OutstationInformation information,
std::unique_ptr< ControlHandler control_handler 
)
static

Create an outstation instance running on a serial port which is tolerant to the serial port being added and removed.

Parameters
runtimeruntime on which to spawn the outstation
serial_pathPath of the serial device
settingssettings for the serial port
open_retry_delaydelay between attempts to open the serial port
configoutstation configuration
applicationapplication interface
informationinformational events interface
control_handlercontrol handler interface
Returns
Outstation instance or NULL if the port cannot be opened
Exceptions
ParamException

◆ set_decode_level()

void dnp3::Outstation::set_decode_level ( const DecodeLevel level)

Set decoding log level.

Parameters
levelDecode log
Exceptions
ParamException

◆ transaction()

void dnp3::Outstation::transaction ( DatabaseTransaction callback)

Acquire a mutex on the underlying database and apply a set of changes as a transaction.

Parameters
callbackInterface on which to execute the transaction

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