dnp3 (C API) 1.6.0
Loading...
Searching...
No Matches
dnp3_outstation_application_t Struct Reference

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

#include <dnp3.h>

Data Fields

uint16_t(* get_processing_delay_ms )(void *)
 Returns the DELAY_MEASUREMENT delay. More...
 
dnp3_write_time_result_t(* write_absolute_time )(uint64_t, void *)
 Handle a write of the absolute time during time synchronization procedures. More...
 
dnp3_application_iin_t(* get_application_iin )(void *)
 Returns the application-controlled IIN bits. More...
 
dnp3_restart_delay_t(* cold_restart )(void *)
 Request that the outstation perform a cold restart (IEEE-1815 2012, p. 58) More...
 
dnp3_restart_delay_t(* warm_restart )(void *)
 Request that the outstation perform a warm restart (IEEE-1815 2012, p. 58) More...
 
dnp3_freeze_result_t(* freeze_counters_all )(dnp3_freeze_type_t, dnp3_database_handle_t *, void *)
 Freeze all the counters. More...
 
dnp3_freeze_result_t(* freeze_counters_all_at_time )(dnp3_database_handle_t *, uint64_t, uint32_t, void *)
 Freeze all the counters at a requested time and interval. More...
 
dnp3_freeze_result_t(* freeze_counters_range )(uint16_t, uint16_t, dnp3_freeze_type_t, dnp3_database_handle_t *, void *)
 Freeze a range of counters. More...
 
dnp3_freeze_result_t(* freeze_counters_range_at_time )(uint16_t, uint16_t, dnp3_database_handle_t *, uint64_t, uint32_t, void *)
 Freeze a range of counters at a requested time and interval. More...
 
bool(* support_write_analog_dead_bands )(void *)
 Controls outstation support for writing group 34, analog input dead-bands. More...
 
void(* begin_write_analog_dead_bands )(void *)
 Called when the outstation begins processing a header to write analog dead-bands. More...
 
void(* write_analog_dead_band )(uint16_t, double, void *)
 Called when the outstation begins processing a header to write analog dead-bands. More...
 
void(* end_write_analog_dead_bands )(void *)
 Called when the outstation completes processing a header to write analog dead-bands. More...
 
bool(* write_string_attr )(uint8_t, uint8_t, dnp3_string_attr_t, const char *, void *)
 Write a string attribute. This method is only called if the corresponding attribute has been configured as writable. More...
 
bool(* write_float_attr )(uint8_t, uint8_t, dnp3_float_attr_t, float, void *)
 Write a 32-bit floating point attribute. This method is only called if the corresponding attribute has been configured as writable. More...
 
bool(* write_double_attr )(uint8_t, uint8_t, dnp3_float_attr_t, double, void *)
 Write a 64-bit floating point attribute. This method is only called if the corresponding attribute has been configured as writable. More...
 
bool(* write_uint_attr )(uint8_t, uint8_t, dnp3_uint_attr_t, uint32_t, void *)
 Write an unsigned integer attribute. This method is only called if the corresponding attribute has been configured as writable. More...
 
bool(* write_int_attr )(uint8_t, uint8_t, dnp3_int_attr_t, int32_t, void *)
 Write a signed integer attribute. This method is only called if the corresponding attribute has been configured as writable. More...
 
bool(* write_octet_string_attr )(uint8_t, uint8_t, dnp3_octet_string_attr_t, dnp3_byte_iterator_t *, void *)
 Write an octet-string attribute. This method is only called if the corresponding attribute has been configured as writable. More...
 
bool(* write_bit_string_attr )(uint8_t, uint8_t, dnp3_bit_string_attr_t, dnp3_byte_iterator_t *, void *)
 Write a bit-string attribute. This method is only called if the corresponding attribute has been configured as writable. More...
 
bool(* write_time_attr )(uint8_t, uint8_t, dnp3_time_attr_t, uint64_t, void *)
 Write a DNP3 time attribute. This method is only called if the corresponding attribute has been configured as writable. More...
 
void(* begin_confirm )(void *)
 Called when a CONFIRM is received to a response or unsolicited response, but before any previously transmitted events are cleared from the buffer. More...
 
void(* event_cleared )(uint64_t, void *)
 Called when an event is cleared from the buffer due to master acknowledgement. More...
 
void(* end_confirm )(dnp3_buffer_state_t, void *)
 Called when all relevant events have been cleared. More...
 
void(* on_destroy )(void *arg)
 Callback when the underlying owner doesn't need the interface anymore. More...
 
void * ctx
 Context data. More...
 

Detailed Description

Dynamic information required by the outstation from the user application.

Field Documentation

◆ begin_confirm

void(* dnp3_outstation_application_t::begin_confirm) (void *)

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

Parameters
ctxContext data

◆ begin_write_analog_dead_bands

void(* dnp3_outstation_application_t::begin_write_analog_dead_bands) (void *)

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

Parameters
ctxContext data

◆ cold_restart

dnp3_restart_delay_t(* dnp3_outstation_application_t::cold_restart) (void *)

Request that the outstation perform a cold restart (IEEE-1815 2012, p. 58)

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

Parameters
ctxContext data
Returns
The restart delay

◆ ctx

void* dnp3_outstation_application_t::ctx

Context data.

◆ end_confirm

void(* dnp3_outstation_application_t::end_confirm) (dnp3_buffer_state_t, void *)

Called when all relevant events have been cleared.

Parameters
stateinformation about the post-CONFIRM state of the buffer
ctxContext data

◆ end_write_analog_dead_bands

void(* dnp3_outstation_application_t::end_write_analog_dead_bands) (void *)

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

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

Parameters
ctxContext data

◆ event_cleared

void(* dnp3_outstation_application_t::event_cleared) (uint64_t, void *)

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
ctxContext data

◆ freeze_counters_all

dnp3_freeze_result_t(* dnp3_outstation_application_t::freeze_counters_all) (dnp3_freeze_type_t, dnp3_database_handle_t *, void *)

Freeze all the counters.

Parameters
freeze_typeType of freeze operation
database_handleDatabase handle
ctxContext data
Returns
Result of the freeze operation

◆ freeze_counters_all_at_time

dnp3_freeze_result_t(* dnp3_outstation_application_t::freeze_counters_all_at_time) (dnp3_database_handle_t *, uint64_t, uint32_t, void *)

Freeze all the counters at a requested time and interval.

Refer to the table on page 57 of IEEE 1815-2012 to interpret the time and interval parameters correctly

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
ctxContext data
Returns
Result of the freeze operation

◆ freeze_counters_range

dnp3_freeze_result_t(* dnp3_outstation_application_t::freeze_counters_range) (uint16_t, uint16_t, dnp3_freeze_type_t, dnp3_database_handle_t *, void *)

Freeze a range of counters.

Parameters
startStart index to freeze (inclusive)
stopStop index to freeze (inclusive)
freeze_typeType of freeze operation
database_handleDatabase handle
ctxContext data
Returns
Result of the freeze operation

◆ freeze_counters_range_at_time

dnp3_freeze_result_t(* dnp3_outstation_application_t::freeze_counters_range_at_time) (uint16_t, uint16_t, dnp3_database_handle_t *, uint64_t, uint32_t, void *)

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

Refer to the table on page 57 of IEEE 1815-2012 to interpret the time and interval parameters correctly

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
ctxContext data
Returns
Result of the freeze operation

◆ get_application_iin

dnp3_application_iin_t(* dnp3_outstation_application_t::get_application_iin) (void *)

Returns the application-controlled IIN bits.

Parameters
ctxContext data
Returns
Application IIN bits

◆ get_processing_delay_ms

uint16_t(* dnp3_outstation_application_t::get_processing_delay_ms) (void *)

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.

For more information, see IEEE-1815 2012, p. 64.

Parameters
ctxContext data
Returns
Processing delay, in milliseconds

◆ on_destroy

void(* dnp3_outstation_application_t::on_destroy) (void *arg)

Callback when the underlying owner doesn't need the interface anymore.

Parameters
argContext data

◆ support_write_analog_dead_bands

bool(* dnp3_outstation_application_t::support_write_analog_dead_bands) (void *)

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.NO_FUNC_CODE_SUPPORT

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

1) A single call to dnp3_outstation_application_t::begin_write_analog_dead_bands

2) Zero or more calls to dnp3_outstation_application_t::write_analog_dead_band

3) A single call to dnp3_outstation_application_t::end_write_analog_dead_bands

Parameters
ctxContext data
Returns
True if the outstation should process the request

◆ warm_restart

dnp3_restart_delay_t(* dnp3_outstation_application_t::warm_restart) (void *)

Request that the outstation perform a warm restart (IEEE-1815 2012, p. 58)

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

Parameters
ctxContext data
Returns
The restart delay

◆ write_absolute_time

dnp3_write_time_result_t(* dnp3_outstation_application_t::write_absolute_time) (uint64_t, void *)

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

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

◆ write_analog_dead_band

void(* dnp3_outstation_application_t::write_analog_dead_band) (uint16_t, double, void *)

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

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

Parameters
indexIndex of the analog input
dead_bandNew dead-band value
ctxContext data

◆ write_bit_string_attr

bool(* dnp3_outstation_application_t::write_bit_string_attr) (uint8_t, uint8_t, dnp3_bit_string_attr_t, dnp3_byte_iterator_t *, void *)

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
ctxContext data
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

◆ write_double_attr

bool(* dnp3_outstation_application_t::write_double_attr) (uint8_t, uint8_t, dnp3_float_attr_t, double, void *)

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
ctxContext data
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

◆ write_float_attr

bool(* dnp3_outstation_application_t::write_float_attr) (uint8_t, uint8_t, dnp3_float_attr_t, float, void *)

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
ctxContext data
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

◆ write_int_attr

bool(* dnp3_outstation_application_t::write_int_attr) (uint8_t, uint8_t, dnp3_int_attr_t, int32_t, void *)

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
ctxContext data
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

◆ write_octet_string_attr

bool(* dnp3_outstation_application_t::write_octet_string_attr) (uint8_t, uint8_t, dnp3_octet_string_attr_t, dnp3_byte_iterator_t *, void *)

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
ctxContext data
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

◆ write_string_attr

bool(* dnp3_outstation_application_t::write_string_attr) (uint8_t, uint8_t, dnp3_string_attr_t, const char *, void *)

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
ctxContext data
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

◆ write_time_attr

bool(* dnp3_outstation_application_t::write_time_attr) (uint8_t, uint8_t, dnp3_time_attr_t, uint64_t, void *)

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
ctxContext data
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

◆ write_uint_attr

bool(* dnp3_outstation_application_t::write_uint_attr) (uint8_t, uint8_t, dnp3_uint_attr_t, uint32_t, void *)

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
ctxContext data
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

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