dnp3 (C++ API) 1.8.0-RC1
Loading...
Searching...
No Matches
dnp3::OutstationApplication Class Referenceabstract

Dynamic information required by the outstation from the user application. More...

#include <dnp3.hpp>

Public Member Functions

virtual uint16_t get_processing_delay_ms ()=0
 Returns the DELAY_MEASUREMENT delay. More...
 
virtual WriteTimeResult write_absolute_time (uint64_t time)=0
 Handle a write of the absolute time during time synchronization procedures. More...
 
virtual ApplicationIin get_application_iin ()=0
 Returns the application-controlled IIN bits. More...
 
virtual RestartDelay cold_restart ()=0
 Request that the outstation perform a cold restart. More...
 
virtual RestartDelay warm_restart ()=0
 Request that the outstation perform a warm restart. More...
 
virtual FreezeResult freeze_counters_all (FreezeType freeze_type, DatabaseHandle &database_handle)
 Freeze all the counters. More...
 
virtual FreezeResult freeze_counters_all_at_time (DatabaseHandle &database_handle, uint64_t time, uint32_t interval)
 Freeze all the counters at a requested time and interval. More...
 
virtual FreezeResult freeze_counters_range (uint16_t start, uint16_t stop, FreezeType freeze_type, DatabaseHandle &database_handle)
 Freeze a range of counters. More...
 
virtual FreezeResult freeze_counters_range_at_time (uint16_t start, uint16_t stop, DatabaseHandle &database_handle, uint64_t time, uint32_t interval)
 Freeze a range of counters at a requested time and interval. More...
 
virtual bool support_write_analog_dead_bands ()
 Controls outstation support for writing group 34, analog input dead-bands. More...
 
virtual void begin_write_analog_dead_bands ()
 Called when the outstation begins processing a header to write analog dead-bands. More...
 
virtual void write_analog_dead_band (uint16_t index, double dead_band)
 Called when the outstation writes the dead-band of an analog input. More...
 
virtual void end_write_analog_dead_bands ()
 Called when the outstation completes processing a header to write analog dead-bands. More...
 
virtual bool support_assign_class ()
 Controls outstation support for ASSIGN_CLASS requests, which change the class of the events that points generate. More...
 
virtual void begin_assign_class ()
 Called before the point headers of an accepted ASSIGN_CLASS request are reported. More...
 
virtual void assign_class_all (PointType point_type, EventClass point_class)
 Called for a point header of an accepted ASSIGN_CLASS request that names every point of a type. More...
 
virtual void assign_class_range (PointType point_type, uint16_t start, uint16_t stop, EventClass point_class)
 Called for a point header of an accepted ASSIGN_CLASS request that names a range of points of a type. More...
 
virtual void end_assign_class ()
 Called after the point headers of an accepted ASSIGN_CLASS request are reported. More...
 
virtual bool write_string_attr (uint8_t set, uint8_t variation, StringAttr attr_type, const char *value)
 Write a string attribute. This method is only called if the corresponding attribute has been configured as writable. More...
 
virtual bool write_float_attr (uint8_t set, uint8_t variation, FloatAttr attr_type, float value)
 Write a 32-bit floating point attribute. This method is only called if the corresponding attribute has been configured as writable. More...
 
virtual bool write_double_attr (uint8_t set, uint8_t variation, FloatAttr attr_type, double value)
 Write a 64-bit floating point attribute. This method is only called if the corresponding attribute has been configured as writable. More...
 
virtual bool write_uint_attr (uint8_t set, uint8_t variation, UintAttr attr_type, uint32_t value)
 Write an unsigned integer attribute. This method is only called if the corresponding attribute has been configured as writable. More...
 
virtual bool write_int_attr (uint8_t set, uint8_t variation, IntAttr attr_type, int32_t value)
 Write a signed integer attribute. This method is only called if the corresponding attribute has been configured as writable. More...
 
virtual bool write_octet_string_attr (uint8_t set, uint8_t variation, OctetStringAttr attr_type, ByteIterator &value)
 Write an octet-string attribute. This method is only called if the corresponding attribute has been configured as writable. More...
 
virtual bool write_bit_string_attr (uint8_t set, uint8_t variation, BitStringAttr attr_type, ByteIterator &value)
 Write a bit-string attribute. This method is only called if the corresponding attribute has been configured as writable. More...
 
virtual bool write_time_attr (uint8_t set, uint8_t variation, TimeAttr attr_type, uint64_t value)
 Write a DNP3 time attribute. This method is only called if the corresponding attribute has been configured as writable. More...
 
virtual void begin_confirm ()
 Called when a CONFIRM is received to a response or unsolicited response, but before any previously transmitted events are cleared from the buffer. More...
 
virtual void event_cleared (uint64_t id)
 Called when an event is cleared from the buffer due to master acknowledgement. More...
 
virtual void end_confirm (const BufferState &state)
 Called when all relevant events have been cleared. More...
 

Detailed Description

Dynamic information required by the outstation from the user application.

Note
this class is an "interface" and only has virtual methods, some of which may have default implementations.

Member Function Documentation

◆ assign_class_all()

virtual void dnp3::OutstationApplication::assign_class_all ( PointType  point_type,
EventClass  point_class 
)
inlinevirtual

Called for a point header of an accepted ASSIGN_CLASS request that names every point of a type.

Every point header is reported, even when headers name the same points, which are then in more than one call; the last header that names a point sets its class. The calls come after the whole request has been applied to the database, outside its lock, and report it: they can't reject it. This callback allows application code to persist the assignment; an outstation that doesn't reverts to its configured classes when it restarts. Replaying the calls in order reproduces the assignment.

Parameters
point_typeType of the points
point_classClass the header assigns the points' events to, or none
Note
This method has a default implementation that does nothing

◆ assign_class_range()

virtual void dnp3::OutstationApplication::assign_class_range ( PointType  point_type,
uint16_t  start,
uint16_t  stop,
EventClass  point_class 
)
inlinevirtual

Called for a point header of an accepted ASSIGN_CLASS request that names a range of points of a type.

See OutstationApplication::assign_class_all().

Parameters
point_typeType of the points
startFirst index of the range
stopLast index of the range, inclusive
point_classClass the header assigns the points' events to, or none
Note
This method has a default implementation that does nothing

◆ begin_assign_class()

virtual void dnp3::OutstationApplication::begin_assign_class ( )
inlinevirtual

Called before the point headers of an accepted ASSIGN_CLASS request are reported.

Note
This method has a default implementation that does nothing

◆ begin_confirm()

virtual void dnp3::OutstationApplication::begin_confirm ( )
inlinevirtual

Called when a CONFIRM is received to a response or unsolicited response, but before any previously transmitted events are cleared from the buffer.

Note
This method has a default implementation that does nothing

◆ begin_write_analog_dead_bands()

virtual void dnp3::OutstationApplication::begin_write_analog_dead_bands ( )
inlinevirtual

Called when the outstation begins processing a header to write analog dead-bands.

Note
This method has a default implementation that does nothing

◆ cold_restart()

virtual RestartDelay dnp3::OutstationApplication::cold_restart ( )
pure virtual

Request that the outstation perform a cold restart.

The outstation will not automatically restart. It is the responsibility of the user application to handle this request and take the appropriate action.

Returns
The restart delay

◆ end_assign_class()

virtual void dnp3::OutstationApplication::end_assign_class ( )
inlinevirtual

Called after the point headers of an accepted ASSIGN_CLASS request are reported.

Assignments accumulated in the calls before it can be persisted as a batch in this method.

Note
This method has a default implementation that does nothing

◆ end_confirm()

virtual void dnp3::OutstationApplication::end_confirm ( const BufferState &  state)
inlinevirtual

Called when all relevant events have been cleared.

Parameters
stateinformation about the post-CONFIRM state of the buffer
Note
This method has a default implementation that does nothing

◆ end_write_analog_dead_bands()

virtual void dnp3::OutstationApplication::end_write_analog_dead_bands ( )
inlinevirtual

Called when the outstation completes processing a header to write analog dead-bands.

Multiple dead-bands changes can be accumulated in calls to OutstationApplication::write_analog_dead_band() and then be processed as a batch in this method.

Note
This method has a default implementation that does nothing

◆ event_cleared()

virtual void dnp3::OutstationApplication::event_cleared ( uint64_t  id)
inlinevirtual

Called when an event is cleared from the buffer due to master acknowledgement.

Parameters
idUnique identifier previously assigned to the event by the database in an update method
Note
This method has a default implementation that does nothing

◆ freeze_counters_all()

virtual FreezeResult dnp3::OutstationApplication::freeze_counters_all ( FreezeType  freeze_type,
DatabaseHandle &  database_handle 
)
inlinevirtual

Freeze all the counters.

Parameters
freeze_typeType of freeze operation
database_handleDatabase handle
Returns
Result of the freeze operation
Note
This method has a default implementation that returns 'FreezeResult::not_supported'

◆ freeze_counters_all_at_time()

virtual FreezeResult dnp3::OutstationApplication::freeze_counters_all_at_time ( DatabaseHandle &  database_handle,
uint64_t  time,
uint32_t  interval 
)
inlinevirtual

Freeze all the counters at a requested time and interval.

A time and interval of 0 freeze once immediately; a time with an interval of 0 freezes once at that time; an interval with a time of 0 freezes periodically, relative to the beginning of the current hour; and both freeze periodically, relative to the time.

Parameters
database_handleDatabase handle
time48-bit DNP3 timestamp in milliseconds since epoch UTC
intervalCount of milliseconds representing the interval between freezes relative to the timestamp
Returns
Result of the freeze operation
Note
This method has a default implementation that returns 'FreezeResult::not_supported'

◆ freeze_counters_range()

virtual FreezeResult dnp3::OutstationApplication::freeze_counters_range ( uint16_t  start,
uint16_t  stop,
FreezeType  freeze_type,
DatabaseHandle &  database_handle 
)
inlinevirtual

Freeze a range of counters.

Parameters
startStart index to freeze (inclusive)
stopStop index to freeze (inclusive)
freeze_typeType of freeze operation
database_handleDatabase handle
Returns
Result of the freeze operation
Note
This method has a default implementation that returns 'FreezeResult::not_supported'

◆ freeze_counters_range_at_time()

virtual FreezeResult dnp3::OutstationApplication::freeze_counters_range_at_time ( uint16_t  start,
uint16_t  stop,
DatabaseHandle &  database_handle,
uint64_t  time,
uint32_t  interval 
)
inlinevirtual

Freeze a range of counters at a requested time and interval.

A time and interval of 0 freeze once immediately; a time with an interval of 0 freezes once at that time; an interval with a time of 0 freezes periodically, relative to the beginning of the current hour; and both freeze periodically, relative to the time.

Parameters
startStart index to freeze (inclusive)
stopStop index to freeze (inclusive)
database_handleDatabase handle
time48-bit DNP3 timestamp in milliseconds since epoch UTC
intervalCount of milliseconds representing the interval between freezes relative to the timestamp
Returns
Result of the freeze operation
Note
This method has a default implementation that returns 'FreezeResult::not_supported'

◆ get_application_iin()

virtual ApplicationIin dnp3::OutstationApplication::get_application_iin ( )
pure virtual

Returns the application-controlled IIN bits.

Returns
Application IIN bits

◆ get_processing_delay_ms()

virtual uint16_t dnp3::OutstationApplication::get_processing_delay_ms ( )
pure virtual

Returns the DELAY_MEASUREMENT delay.

The value returned by this method is used in conjunction with the DELAY_MEASUREMENT function code and returned in a g52v2 time delay object as part of a non-LAN time synchronization procedure.

It represents the processing delay from receiving the request to sending the response. This parameter should almost always use the default value of zero as only an RTOS or bare metal system would have access to this level of timing. Modern hardware can almost always respond in less than 1 millisecond anyway.

Returns
Processing delay, in milliseconds

◆ support_assign_class()

virtual bool dnp3::OutstationApplication::support_assign_class ( )
inlinevirtual

Controls outstation support for ASSIGN_CLASS requests, which change the class of the events that points generate.

Returning false answers them with IIN2.0 NO_FUNC_CODE_SUPPORT.

The outstation applies an accepted request to its database itself, and only to events generated afterwards: buffered events keep their class. It then reports the request with a single call to OutstationApplication::begin_assign_class(), a call to OutstationApplication::assign_class_all() or OutstationApplication::assign_class_range() for each point header in request order, and a single call to OutstationApplication::end_assign_class(). A request with any error changes nothing and makes none of these calls.

Returns
True if the outstation should process ASSIGN_CLASS requests
Note
This method has a default implementation that returns 'true'

◆ support_write_analog_dead_bands()

virtual bool dnp3::OutstationApplication::support_write_analog_dead_bands ( )
inlinevirtual

Controls outstation support for writing group 34, analog input dead-bands.

Returning false, indicates that the writes to group34 should not be processed and requests to do so should be rejected with IIN2.1 OBJECT_UNKNOWN

Returning true will allow the request to process the actual values with a sequence of calls:

1) A single call to OutstationApplication::begin_write_analog_dead_bands()

2) Zero or more calls to OutstationApplication::write_analog_dead_band()

3) A single call to OutstationApplication::end_write_analog_dead_bands()

Returns
True if the outstation should process the request
Note
This method has a default implementation that returns 'false'

◆ warm_restart()

virtual RestartDelay dnp3::OutstationApplication::warm_restart ( )
pure virtual

Request that the outstation perform a warm restart.

The outstation will not automatically restart. It is the responsibility of the user application to handle this request and take the appropriate action.

Returns
The restart delay

◆ write_absolute_time()

virtual WriteTimeResult dnp3::OutstationApplication::write_absolute_time ( uint64_t  time)
pure virtual

Handle a write of the absolute time during time synchronization procedures.

Parameters
timeReceived time in milliseconds since EPOCH (only 48 bits are used)
Returns
Result of the write time operation

◆ write_analog_dead_band()

virtual void dnp3::OutstationApplication::write_analog_dead_band ( uint16_t  index,
double  dead_band 
)
inlinevirtual

Called when the outstation writes the dead-band of an analog input.

Called for each analog dead-band in the write request where an analog input is defined at the specified index.

The dead-band is automatically updated in the database. This callback allows application code to persist the modified value to non-volatile memory if desired

A negative dead-band written by the master is stored, and reported here, as 0

Parameters
indexIndex of the analog input
dead_bandNew dead-band value
Note
This method has a default implementation that does nothing

◆ write_bit_string_attr()

virtual bool dnp3::OutstationApplication::write_bit_string_attr ( uint8_t  set,
uint8_t  variation,
BitStringAttr  attr_type,
ByteIterator &  value 
)
inlinevirtual

Write a bit-string attribute. This method is only called if the corresponding attribute has been configured as writable.

Parameters
setSet to which the attribute belongs
variationVariation of the attribute
attr_typeEnumeration describing which attribute it is, possibly unknown
valueIterator over bytes of the value
Returns
If true, the value will be modified in the in memory database and the outstation will return a successful response. If false, no change will be made and the outstation will return PARAM_ERROR
Note
This method has a default implementation that returns 'false'

◆ write_double_attr()

virtual bool dnp3::OutstationApplication::write_double_attr ( uint8_t  set,
uint8_t  variation,
FloatAttr  attr_type,
double  value 
)
inlinevirtual

Write a 64-bit floating point attribute. This method is only called if the corresponding attribute has been configured as writable.

Parameters
setSet to which the attribute belongs
variationVariation of the attribute
attr_typeEnumeration describing which attribute it is, possibly unknown
valueValue of the attribute
Returns
If true, the value will be modified in the in memory database and the outstation will return a successful response. If false, no change will be made and the outstation will return PARAM_ERROR
Note
This method has a default implementation that returns 'false'

◆ write_float_attr()

virtual bool dnp3::OutstationApplication::write_float_attr ( uint8_t  set,
uint8_t  variation,
FloatAttr  attr_type,
float  value 
)
inlinevirtual

Write a 32-bit floating point attribute. This method is only called if the corresponding attribute has been configured as writable.

Parameters
setSet to which the attribute belongs
variationVariation of the attribute
attr_typeEnumeration describing which attribute it is, possibly unknown
valueValue of the attribute
Returns
If true, the value will be modified in the in memory database and the outstation will return a successful response. If false, no change will be made and the outstation will return PARAM_ERROR
Note
This method has a default implementation that returns 'false'

◆ write_int_attr()

virtual bool dnp3::OutstationApplication::write_int_attr ( uint8_t  set,
uint8_t  variation,
IntAttr  attr_type,
int32_t  value 
)
inlinevirtual

Write a signed integer attribute. This method is only called if the corresponding attribute has been configured as writable.

Parameters
setSet to which the attribute belongs
variationVariation of the attribute
attr_typeEnumeration describing which attribute it is, possibly unknown
valueValue of the attribute
Returns
If true, the value will be modified in the in memory database and the outstation will return a successful response. If false, no change will be made and the outstation will return PARAM_ERROR
Note
This method has a default implementation that returns 'false'

◆ write_octet_string_attr()

virtual bool dnp3::OutstationApplication::write_octet_string_attr ( uint8_t  set,
uint8_t  variation,
OctetStringAttr  attr_type,
ByteIterator &  value 
)
inlinevirtual

Write an octet-string attribute. This method is only called if the corresponding attribute has been configured as writable.

Parameters
setSet to which the attribute belongs
variationVariation of the attribute
attr_typeEnumeration describing which attribute it is, possibly unknown
valueIterator over bytes of the value
Returns
If true, the value will be modified in the in memory database and the outstation will return a successful response. If false, no change will be made and the outstation will return PARAM_ERROR
Note
This method has a default implementation that returns 'false'

◆ write_string_attr()

virtual bool dnp3::OutstationApplication::write_string_attr ( uint8_t  set,
uint8_t  variation,
StringAttr  attr_type,
const char *  value 
)
inlinevirtual

Write a string attribute. This method is only called if the corresponding attribute has been configured as writable.

Parameters
setSet to which the attribute belongs
variationVariation of the attribute
attr_typeEnumeration describing which attribute it is, possibly unknown
valueValue of the attribute
Returns
If true, the value will be modified in the in memory database and the outstation will return a successful response. If false, no change will be made and the outstation will return PARAM_ERROR
Note
This method has a default implementation that returns 'false'

◆ write_time_attr()

virtual bool dnp3::OutstationApplication::write_time_attr ( uint8_t  set,
uint8_t  variation,
TimeAttr  attr_type,
uint64_t  value 
)
inlinevirtual

Write a DNP3 time attribute. This method is only called if the corresponding attribute has been configured as writable.

Parameters
setSet to which the attribute belongs
variationVariation of the attribute
attr_typeEnumeration describing which attribute it is, possibly unknown
value48-bit DNP3 timestamp value
Returns
If true, the value will be modified in the in memory database and the outstation will return a successful response. If false, no change will be made and the outstation will return PARAM_ERROR
Note
This method has a default implementation that returns 'false'

◆ write_uint_attr()

virtual bool dnp3::OutstationApplication::write_uint_attr ( uint8_t  set,
uint8_t  variation,
UintAttr  attr_type,
uint32_t  value 
)
inlinevirtual

Write an unsigned integer attribute. This method is only called if the corresponding attribute has been configured as writable.

Parameters
setSet to which the attribute belongs
variationVariation of the attribute
attr_typeEnumeration describing which attribute it is, possibly unknown
valueValue of the attribute
Returns
If true, the value will be modified in the in memory database and the outstation will return a successful response. If false, no change will be made and the outstation will return PARAM_ERROR
Note
This method has a default implementation that returns 'false'

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