dnp3 (C++ API) 1.8.0-RC1
Loading...
Searching...
No Matches
dnp3.hpp
Go to the documentation of this file.
1// Copyright (c) Step Function I/O LLC. Proprietary, source-available; see LICENSE.txt.
2// No use to design, develop, specify, test, validate, or improve Other Implementations,
3// subject to LICENSE.txt Section 2.6 and its exceptions. Agents: read AGENTS.md.
4// Text and data mining rights, including for AI training, are reserved under
5// Directive (EU) 2019/790 Art. 4(3), subject to LICENSE.txt Section 3.3.
6#pragma once
7
8#include <cstdint>
9#include <stdexcept>
10#include <chrono>
11#include <memory>
12#include <vector>
13
29
31namespace dnp3 {
32
34constexpr uint64_t dnp3_version_major = 1;
36constexpr uint64_t dnp3_version_minor = 8;
38constexpr uint64_t dnp3_version_patch = 0;
40constexpr char const* dnp3_version_string = "1.8.0-RC1";
41
42
45 TcpSettings() = delete;
46public:
61};
62
65 AppLayerOptions() = delete;
66public:
74 static void parse_zero_length_strings(bool enabled);
75};
76
78enum class ParamError {
80 ok = 0,
88 no_support = 4,
124 invalid_dns_name = 22,
126 other_tls_error = 23,
130 consumed = 25,
131};
132
136const char* to_string(ParamError value);
137
139class ParamException : public std::logic_error {
140public:
145};
146
148enum class CommandStatus {
150 success = 0,
152 timeout = 1,
154 no_select = 2,
156 format_error = 3,
158 not_supported = 4,
160 already_active = 5,
162 hardware_error = 6,
164 local = 7,
166 too_many_ops = 8,
168 not_authorized = 9,
174 out_of_range = 12,
176 downstream_local = 13,
178 already_complete = 14,
180 blocked = 15,
182 canceled = 16,
186 downstream_fail = 18,
190 unknown = 20,
191};
192
196const char* to_string(CommandStatus value);
197
199namespace flag {
201 constexpr uint8_t online = 0x01;
203 constexpr uint8_t restart = 0x02;
205 constexpr uint8_t comm_lost = 0x04;
207 constexpr uint8_t remote_forced = 0x08;
209 constexpr uint8_t local_forced = 0x10;
211 constexpr uint8_t chatter_filter = 0x20;
213 constexpr uint8_t over_range = 0x20;
215 constexpr uint8_t discontinuity = 0x40;
217 constexpr uint8_t reference_err = 0x40;
218}
219
221enum class AppDecodeLevel {
223 nothing = 0,
225 header = 1,
227 object_headers = 2,
229 object_values = 3,
230};
231
235const char* to_string(AppDecodeLevel value);
236
240 nothing = 0,
242 header = 1,
244 payload = 2,
245};
246
251
253enum class LinkDecodeLevel {
255 nothing = 0,
257 header = 1,
259 payload = 2,
260};
261
265const char* to_string(LinkDecodeLevel value);
266
268enum class PhysDecodeLevel {
270 nothing = 0,
272 length = 1,
274 data = 2,
275};
276
280const char* to_string(PhysDecodeLevel value);
281
282struct DecodeLevel;
283
286 friend class CppDecodeLevelFriend;
287
288private:
296
297public:
298
309
310
321
322
331};
332
333class Runtime;
334
335struct RuntimeConfig;
336
339 friend class CppRuntimeConfigFriend;
340
341private:
346
347public:
348
356
357
362};
363
365class Runtime {
366 friend class CppRuntimeFriend;
367 // pointer to the underlying C type
368 void* self;
369 // constructor only accessible internally
370 Runtime(void* self): self(self) {}
371 // non-copyable
372 Runtime(const Runtime&) = delete;
373 Runtime& operator=(const Runtime&) = delete;
374 // no move assignment
375 Runtime& operator=(Runtime&& other) = delete;
376
377public:
381 Runtime(Runtime&& other) noexcept : self(other.self) { other.self = nullptr; }
382
389 Runtime(const RuntimeConfig& config);
390
395
403 void set_shutdown_timeout(std::chrono::steady_clock::duration timeout);
404};
405
406struct ControlField;
407
410 friend class CppControlFieldFriend;
411
412private:
420 ControlField(bool fir, bool fin, bool con, bool uns, uint8_t seq);
421
422public:
423 ControlField() = delete;
424
426 bool fir;
428 bool fin;
430 bool con;
432 bool uns;
434 uint8_t seq;
435};
436
438enum class TripCloseCode {
440 nul = 0,
442 close = 1,
444 trip = 2,
446 reserved = 3,
447};
448
452const char* to_string(TripCloseCode value);
453
455enum class OpType {
457 nul = 0,
459 pulse_on = 1,
461 pulse_off = 2,
463 latch_on = 3,
465 latch_off = 4,
466};
467
471const char* to_string(OpType value);
472
473struct ControlCode;
474
477 friend class CppControlCodeFriend;
478
479private:
487
488public:
489 ControlCode() = delete;
490
501
502
515
516
529
530
534 bool clear;
536 bool queue;
539};
540
541struct Group12Var1;
542
545 friend class CppGroup12Var1Friend;
546
547 Group12Var1() = delete;
548
555 Group12Var1(const ControlCode& code, uint8_t count, uint32_t on_time, uint32_t off_time);
556
557
570
571
575 uint8_t count;
577 uint32_t on_time;
579 uint32_t off_time;
580};
581
582struct Flags;
583
585struct Flags {
586 friend class CppFlagsFriend;
587
588 Flags() = delete;
589
593 Flags(uint8_t value);
594
595
597 uint8_t value;
598};
599
601enum class TimeQuality {
613 invalid_time = 2,
614};
615
619const char* to_string(TimeQuality value);
620
621struct Timestamp;
622
624struct Timestamp {
625 friend class CppTimestampFriend;
626
627private:
633
634public:
635 Timestamp() = delete;
636
645
646
655
656
665
666
670 uint64_t value;
673};
674
676enum class DoubleBit {
678 intermediate = 0,
680 determined_off = 1,
682 determined_on = 2,
684 indeterminate = 3,
685};
686
690const char* to_string(DoubleBit value);
691
692struct BinaryInput;
693
696 friend class CppBinaryInputFriend;
697
698 BinaryInput() = delete;
699
706 BinaryInput(uint16_t index, bool value, const Flags& flags, const Timestamp& time);
707
708
710 uint16_t index;
712 bool value;
717};
718
720
733
734 friend class CppBinaryInputIteratorFriend;
735
736 // underlying opaque c type
737 void* iter;
738 // pointer to the last retrieved c value
739 void* current;
740
741 // internal constructor
742 BinaryInputIterator(void* iter) : iter(iter), current(nullptr) {}
743
744 BinaryInputIterator() = delete; // no default construction
745 BinaryInputIterator(const BinaryInputIterator&) = delete; // no copies
746 BinaryInputIterator& operator=(const BinaryInputIterator&) = delete; // no self-assignment
747 BinaryInputIterator& operator=(BinaryInputIterator&&) = delete; // no move self-assignment
748
749public:
750
753
756 bool next();
757
762};
763
765
768 friend class CppDoubleBitBinaryInputFriend;
769
770 DoubleBitBinaryInput() = delete;
771
779
780
782 uint16_t index;
789};
790
792
805
806 friend class CppDoubleBitBinaryInputIteratorFriend;
807
808 // underlying opaque c type
809 void* iter;
810 // pointer to the last retrieved c value
811 void* current;
812
813 // internal constructor
814 DoubleBitBinaryInputIterator(void* iter) : iter(iter), current(nullptr) {}
815
816 DoubleBitBinaryInputIterator() = delete; // no default construction
818 DoubleBitBinaryInputIterator& operator=(const DoubleBitBinaryInputIterator&) = delete; // no self-assignment
819 DoubleBitBinaryInputIterator& operator=(DoubleBitBinaryInputIterator&&) = delete; // no move self-assignment
820
821public:
822
825
828 bool next();
829
834};
835
836struct BinaryOutputStatus;
837
840 friend class CppBinaryOutputStatusFriend;
841
842 BinaryOutputStatus() = delete;
843
850 BinaryOutputStatus(uint16_t index, bool value, const Flags& flags, const Timestamp& time);
851
852
854 uint16_t index;
856 bool value;
861};
862
864
877
878 friend class CppBinaryOutputStatusIteratorFriend;
879
880 // underlying opaque c type
881 void* iter;
882 // pointer to the last retrieved c value
883 void* current;
884
885 // internal constructor
886 BinaryOutputStatusIterator(void* iter) : iter(iter), current(nullptr) {}
887
888 BinaryOutputStatusIterator() = delete; // no default construction
889 BinaryOutputStatusIterator(const BinaryOutputStatusIterator&) = delete; // no copies
890 BinaryOutputStatusIterator& operator=(const BinaryOutputStatusIterator&) = delete; // no self-assignment
891 BinaryOutputStatusIterator& operator=(BinaryOutputStatusIterator&&) = delete; // no move self-assignment
892
893public:
894
897
900 bool next();
901
906};
907
908struct Counter;
909
911struct Counter {
912 friend class CppCounterFriend;
913
914 Counter() = delete;
915
922 Counter(uint16_t index, uint32_t value, const Flags& flags, const Timestamp& time);
923
924
926 uint16_t index;
928 uint32_t value;
933};
934
935class CounterIterator;
936
948class CounterIterator final {
949
950 friend class CppCounterIteratorFriend;
951
952 // underlying opaque c type
953 void* iter;
954 // pointer to the last retrieved c value
955 void* current;
956
957 // internal constructor
958 CounterIterator(void* iter) : iter(iter), current(nullptr) {}
959
960 CounterIterator() = delete; // no default construction
961 CounterIterator(const CounterIterator&) = delete; // no copies
962 CounterIterator& operator=(const CounterIterator&) = delete; // no self-assignment
963 CounterIterator& operator=(CounterIterator&&) = delete; // no move self-assignment
964
965public:
966
969
972 bool next();
973
978};
979
980struct FrozenCounter;
981
984 friend class CppFrozenCounterFriend;
985
986 FrozenCounter() = delete;
987
994 FrozenCounter(uint16_t index, uint32_t value, const Flags& flags, const Timestamp& time);
995
996
998 uint16_t index;
1000 uint32_t value;
1005};
1006
1008
1021
1022 friend class CppFrozenCounterIteratorFriend;
1023
1024 // underlying opaque c type
1025 void* iter;
1026 // pointer to the last retrieved c value
1027 void* current;
1028
1029 // internal constructor
1030 FrozenCounterIterator(void* iter) : iter(iter), current(nullptr) {}
1031
1032 FrozenCounterIterator() = delete; // no default construction
1033 FrozenCounterIterator(const FrozenCounterIterator&) = delete; // no copies
1034 FrozenCounterIterator& operator=(const FrozenCounterIterator&) = delete; // no self-assignment
1035 FrozenCounterIterator& operator=(FrozenCounterIterator&&) = delete; // no move self-assignment
1036
1037public:
1038
1041
1044 bool next();
1045
1050};
1051
1052struct AnalogInput;
1053
1056 friend class CppAnalogInputFriend;
1057
1058 AnalogInput() = delete;
1059
1066 AnalogInput(uint16_t index, double value, const Flags& flags, const Timestamp& time);
1067
1068
1070 uint16_t index;
1072 double value;
1077};
1078
1080
1093
1094 friend class CppAnalogInputIteratorFriend;
1095
1096 // underlying opaque c type
1097 void* iter;
1098 // pointer to the last retrieved c value
1099 void* current;
1100
1101 // internal constructor
1102 AnalogInputIterator(void* iter) : iter(iter), current(nullptr) {}
1103
1104 AnalogInputIterator() = delete; // no default construction
1105 AnalogInputIterator(const AnalogInputIterator&) = delete; // no copies
1106 AnalogInputIterator& operator=(const AnalogInputIterator&) = delete; // no self-assignment
1107 AnalogInputIterator& operator=(AnalogInputIterator&&) = delete; // no move self-assignment
1108
1109public:
1110
1113
1116 bool next();
1117
1122};
1123
1124struct FrozenAnalogInput;
1125
1128 friend class CppFrozenAnalogInputFriend;
1129
1130 FrozenAnalogInput() = delete;
1131
1138 FrozenAnalogInput(uint16_t index, double value, const Flags& flags, const Timestamp& time);
1139
1140
1142 uint16_t index;
1144 double value;
1149};
1150
1152
1165
1166 friend class CppFrozenAnalogInputIteratorFriend;
1167
1168 // underlying opaque c type
1169 void* iter;
1170 // pointer to the last retrieved c value
1171 void* current;
1172
1173 // internal constructor
1174 FrozenAnalogInputIterator(void* iter) : iter(iter), current(nullptr) {}
1175
1176 FrozenAnalogInputIterator() = delete; // no default construction
1177 FrozenAnalogInputIterator(const FrozenAnalogInputIterator&) = delete; // no copies
1178 FrozenAnalogInputIterator& operator=(const FrozenAnalogInputIterator&) = delete; // no self-assignment
1179 FrozenAnalogInputIterator& operator=(FrozenAnalogInputIterator&&) = delete; // no move self-assignment
1180
1181public:
1182
1185
1188 bool next();
1189
1194};
1195
1196struct AnalogOutputStatus;
1197
1200 friend class CppAnalogOutputStatusFriend;
1201
1202 AnalogOutputStatus() = delete;
1203
1210 AnalogOutputStatus(uint16_t index, double value, const Flags& flags, const Timestamp& time);
1211
1212
1214 uint16_t index;
1216 double value;
1221};
1222
1224
1237
1238 friend class CppAnalogOutputStatusIteratorFriend;
1239
1240 // underlying opaque c type
1241 void* iter;
1242 // pointer to the last retrieved c value
1243 void* current;
1244
1245 // internal constructor
1246 AnalogOutputStatusIterator(void* iter) : iter(iter), current(nullptr) {}
1247
1248 AnalogOutputStatusIterator() = delete; // no default construction
1249 AnalogOutputStatusIterator(const AnalogOutputStatusIterator&) = delete; // no copies
1250 AnalogOutputStatusIterator& operator=(const AnalogOutputStatusIterator&) = delete; // no self-assignment
1251 AnalogOutputStatusIterator& operator=(AnalogOutputStatusIterator&&) = delete; // no move self-assignment
1252
1253public:
1254
1257
1260 bool next();
1261
1266};
1267
1269
1276 friend class CppBinaryOutputCommandEventFriend;
1277
1278 BinaryOutputCommandEvent() = delete;
1279
1287
1288
1290 uint16_t index;
1299};
1300
1302
1315
1316 friend class CppBinaryOutputCommandEventIteratorFriend;
1317
1318 // underlying opaque c type
1319 void* iter;
1320 // pointer to the last retrieved c value
1321 void* current;
1322
1323 // internal constructor
1324 BinaryOutputCommandEventIterator(void* iter) : iter(iter), current(nullptr) {}
1325
1326 BinaryOutputCommandEventIterator() = delete; // no default construction
1328 BinaryOutputCommandEventIterator& operator=(const BinaryOutputCommandEventIterator&) = delete; // no self-assignment
1329 BinaryOutputCommandEventIterator& operator=(BinaryOutputCommandEventIterator&&) = delete; // no move self-assignment
1330
1331public:
1332
1335
1338 bool next();
1339
1344};
1345
1349 i16 = 0,
1351 i32 = 1,
1353 f32 = 2,
1355 f64 = 3,
1356};
1357
1361const char* to_string(AnalogCommandType value);
1362
1364
1371 friend class CppAnalogOutputCommandEventFriend;
1372
1373 AnalogOutputCommandEvent() = delete;
1374
1383
1384
1386 uint16_t index;
1397};
1398
1400
1413
1414 friend class CppAnalogOutputCommandEventIteratorFriend;
1415
1416 // underlying opaque c type
1417 void* iter;
1418 // pointer to the last retrieved c value
1419 void* current;
1420
1421 // internal constructor
1422 AnalogOutputCommandEventIterator(void* iter) : iter(iter), current(nullptr) {}
1423
1424 AnalogOutputCommandEventIterator() = delete; // no default construction
1426 AnalogOutputCommandEventIterator& operator=(const AnalogOutputCommandEventIterator&) = delete; // no self-assignment
1427 AnalogOutputCommandEventIterator& operator=(AnalogOutputCommandEventIterator&&) = delete; // no move self-assignment
1428
1429public:
1430
1433
1436 bool next();
1437
1442};
1443
1444struct UnsignedInteger;
1445
1450 friend class CppUnsignedIntegerFriend;
1451
1452 UnsignedInteger() = delete;
1453
1458 UnsignedInteger(uint16_t index, uint8_t value);
1459
1460
1462 uint16_t index;
1464 uint8_t value;
1465};
1466
1468
1481
1482 friend class CppUnsignedIntegerIteratorFriend;
1483
1484 // underlying opaque c type
1485 void* iter;
1486 // pointer to the last retrieved c value
1487 void* current;
1488
1489 // internal constructor
1490 UnsignedIntegerIterator(void* iter) : iter(iter), current(nullptr) {}
1491
1492 UnsignedIntegerIterator() = delete; // no default construction
1493 UnsignedIntegerIterator(const UnsignedIntegerIterator&) = delete; // no copies
1494 UnsignedIntegerIterator& operator=(const UnsignedIntegerIterator&) = delete; // no self-assignment
1495 UnsignedIntegerIterator& operator=(UnsignedIntegerIterator&&) = delete; // no move self-assignment
1496
1497public:
1498
1501
1504 bool next();
1505
1510};
1511
1512struct AnalogInputDeadBand;
1513
1516 friend class CppAnalogInputDeadBandFriend;
1517
1518 AnalogInputDeadBand() = delete;
1519
1525
1526
1528 uint16_t index;
1532 double value;
1533};
1534
1536
1549
1550 friend class CppAnalogInputDeadBandIteratorFriend;
1551
1552 // underlying opaque c type
1553 void* iter;
1554 // pointer to the last retrieved c value
1555 void* current;
1556
1557 // internal constructor
1558 AnalogInputDeadBandIterator(void* iter) : iter(iter), current(nullptr) {}
1559
1560 AnalogInputDeadBandIterator() = delete; // no default construction
1561 AnalogInputDeadBandIterator(const AnalogInputDeadBandIterator&) = delete; // no copies
1562 AnalogInputDeadBandIterator& operator=(const AnalogInputDeadBandIterator&) = delete; // no self-assignment
1563 AnalogInputDeadBandIterator& operator=(AnalogInputDeadBandIterator&&) = delete; // no move self-assignment
1564
1565public:
1566
1569
1572 bool next();
1573
1578};
1579
1580class ByteIterator;
1581
1593class ByteIterator final {
1594
1595 friend class CppByteIteratorFriend;
1596
1597 // underlying opaque c type
1598 void* iter;
1599 // pointer to the last retrieved c value
1600 void* current;
1601
1602 // internal constructor
1603 ByteIterator(void* iter) : iter(iter), current(nullptr) {}
1604
1605 ByteIterator() = delete; // no default construction
1606 ByteIterator(const ByteIterator&) = delete; // no copies
1607 ByteIterator& operator=(const ByteIterator&) = delete; // no self-assignment
1608 ByteIterator& operator=(ByteIterator&&) = delete; // no move self-assignment
1609
1610public:
1611
1614
1617 bool next();
1618
1622 uint8_t get();
1623};
1624
1625struct OctetString;
1626
1629 friend class CppOctetStringFriend;
1630
1631 OctetString() = delete;
1632
1638
1639
1641 uint16_t index;
1644};
1645
1647
1660
1661 friend class CppOctetStringIteratorFriend;
1662
1663 // underlying opaque c type
1664 void* iter;
1665 // pointer to the last retrieved c value
1666 void* current;
1667
1668 // internal constructor
1669 OctetStringIterator(void* iter) : iter(iter), current(nullptr) {}
1670
1671 OctetStringIterator() = delete; // no default construction
1672 OctetStringIterator(const OctetStringIterator&) = delete; // no copies
1673 OctetStringIterator& operator=(const OctetStringIterator&) = delete; // no self-assignment
1674 OctetStringIterator& operator=(OctetStringIterator&&) = delete; // no move self-assignment
1675
1676public:
1677
1680
1683 bool next();
1684
1689};
1690
1691class ConnectOptions;
1692
1695 friend class CppConnectOptionsFriend;
1696 // pointer to the underlying C type
1697 void* self;
1698 // constructor only accessible internally
1699 ConnectOptions(void* self): self(self) {}
1700 // non-copyable
1701 ConnectOptions(const ConnectOptions&) = delete;
1702 ConnectOptions& operator=(const ConnectOptions&) = delete;
1703 // no move assignment
1704 ConnectOptions& operator=(ConnectOptions&& other) = delete;
1705
1706public:
1710 ConnectOptions(ConnectOptions&& other) noexcept : self(other.self) { other.self = nullptr; }
1711
1715
1718
1722 void set_timeout(std::chrono::steady_clock::duration timeout);
1723
1730 void set_local_endpoint(const std::string& endpoint);
1731};
1732
1733class EndpointList;
1734
1739 friend class CppEndpointListFriend;
1740 // pointer to the underlying C type
1741 void* self;
1742 // constructor only accessible internally
1743 EndpointList(void* self): self(self) {}
1744 // non-copyable
1745 EndpointList(const EndpointList&) = delete;
1746 EndpointList& operator=(const EndpointList&) = delete;
1747 // no move assignment
1748 EndpointList& operator=(EndpointList&& other) = delete;
1749
1750public:
1754 EndpointList(EndpointList&& other) noexcept : self(other.self) { other.self = nullptr; }
1755
1761 EndpointList(const std::string& main_endpoint);
1762
1765
1771 void add(const std::string& endpoint);
1772};
1773
1774struct ConnectStrategy;
1775
1778 friend class CppConnectStrategyFriend;
1779
1780private:
1786 ConnectStrategy(std::chrono::steady_clock::duration min_connect_delay, std::chrono::steady_clock::duration max_connect_delay, std::chrono::steady_clock::duration reconnect_delay);
1787
1788public:
1789
1799
1800
1802 std::chrono::steady_clock::duration min_connect_delay;
1804 std::chrono::steady_clock::duration max_connect_delay;
1806 std::chrono::steady_clock::duration reconnect_delay;
1807};
1808
1810enum class MinTlsVersion {
1812 v12 = 0,
1814 v13 = 1,
1815};
1816
1820const char* to_string(MinTlsVersion value);
1821
1831 authority_based = 0,
1835 self_signed = 1,
1836};
1837
1841const char* to_string(CertificateMode value);
1842
1843struct TlsClientConfig;
1844
1847 friend class CppTlsClientConfigFriend;
1848
1849private:
1860 TlsClientConfig(const std::string& dns_name, const std::string& peer_cert_path, const std::string& local_cert_path, const std::string& private_key_path, const std::string& password, MinTlsVersion min_tls_version, CertificateMode certificate_mode, bool allow_server_name_wildcard);
1861
1862public:
1863 TlsClientConfig() = delete;
1864
1878 TlsClientConfig(const std::string& dns_name, const std::string& peer_cert_path, const std::string& local_cert_path, const std::string& private_key_path, const std::string& password);
1879
1880
1884 std::string dns_name;
1886 std::string peer_cert_path;
1888 std::string local_cert_path;
1890 std::string private_key_path;
1896 std::string password;
1903};
1904
1906namespace attribute_variations {
1908 constexpr uint8_t config_id = 0xC4;
1910 constexpr uint8_t config_version = 0xC5;
1912 constexpr uint8_t config_build_date = 0xC6;
1914 constexpr uint8_t config_last_change_date = 0xC7;
1916 constexpr uint8_t config_digest = 0xC8;
1918 constexpr uint8_t config_digest_algorithm = 0xC9;
1920 constexpr uint8_t master_resource_id = 0xCA;
1922 constexpr uint8_t device_location_altitude = 0xCB;
1924 constexpr uint8_t device_location_longitude = 0xCC;
1926 constexpr uint8_t device_location_latitude = 0xCD;
1930 constexpr uint8_t user_assigned_primary_operator_name = 0xCF;
1932 constexpr uint8_t user_assigned_system_name = 0xD0;
1934 constexpr uint8_t secure_auth_version = 0xD1;
1936 constexpr uint8_t num_security_stats_per_assoc = 0xD2;
1938 constexpr uint8_t user_specific_attributes = 0xD3;
1940 constexpr uint8_t num_master_defined_data_set_proto = 0xD4;
1944 constexpr uint8_t num_master_defined_data_sets = 0xD6;
1946 constexpr uint8_t num_outstation_defined_data_sets = 0xD7;
1948 constexpr uint8_t max_binary_output_per_request = 0xD8;
1950 constexpr uint8_t local_timing_accuracy = 0xD9;
1952 constexpr uint8_t duration_of_time_accuracy = 0xDA;
1954 constexpr uint8_t supports_analog_output_events = 0xDB;
1956 constexpr uint8_t max_analog_output_index = 0xDC;
1958 constexpr uint8_t num_analog_outputs = 0xDD;
1960 constexpr uint8_t supports_binary_output_events = 0xDE;
1962 constexpr uint8_t max_binary_output_index = 0xDF;
1964 constexpr uint8_t num_binary_outputs = 0xE0;
1966 constexpr uint8_t supports_frozen_counter_events = 0xE1;
1968 constexpr uint8_t supports_frozen_counters = 0xE2;
1970 constexpr uint8_t supports_counter_events = 0xE3;
1972 constexpr uint8_t max_counter_index = 0xE4;
1974 constexpr uint8_t num_counter = 0xE5;
1976 constexpr uint8_t supports_frozen_analog_inputs = 0xE6;
1978 constexpr uint8_t supports_analog_input_events = 0xE7;
1980 constexpr uint8_t max_analog_input_index = 0xE8;
1982 constexpr uint8_t num_analog_input = 0xE9;
1986 constexpr uint8_t max_double_bit_binary_input_index = 0xEB;
1988 constexpr uint8_t num_double_bit_binary_input = 0xEC;
1990 constexpr uint8_t supports_binary_input_events = 0xED;
1992 constexpr uint8_t max_binary_input_index = 0xEE;
1994 constexpr uint8_t num_binary_input = 0xEF;
1996 constexpr uint8_t max_tx_fragment_size = 0xF0;
1998 constexpr uint8_t max_rx_fragment_size = 0xF1;
2004 constexpr uint8_t user_assigned_owner_name = 0xF4;
2006 constexpr uint8_t user_assigned_location = 0xF5;
2008 constexpr uint8_t user_assigned_id = 0xF6;
2010 constexpr uint8_t user_assigned_device_name = 0xF7;
2012 constexpr uint8_t device_serial_number = 0xF8;
2014 constexpr uint8_t device_subset_and_conformance = 0xF9;
2016 constexpr uint8_t product_name_and_model = 0xFA;
2018 constexpr uint8_t device_manufacturers_name = 0xFC;
2020 constexpr uint8_t all_attributes_request = 0xFE;
2022 constexpr uint8_t list_of_variations = 0xFF;
2023}
2024
2028 unknown = 0,
2031};
2032
2036const char* to_string(VariationListAttr value);
2037
2039enum class StringAttr {
2041 unknown = 0,
2043 config_id = 1,
2045 config_version = 2,
2067 user_assigned_id = 13,
2078};
2079
2083const char* to_string(StringAttr value);
2084
2086enum class UintAttr {
2088 unknown = 0,
2110 num_analog_outputs = 11,
2114 num_binary_outputs = 13,
2116 max_counter_index = 14,
2118 num_counter = 15,
2122 num_analog_input = 17,
2130 num_binary_input = 21,
2135};
2136
2140const char* to_string(UintAttr value);
2141
2145enum class IntAttr {
2147 unknown = 0,
2148};
2149
2153const char* to_string(IntAttr value);
2154
2158enum class BoolAttr {
2160 unknown = 0,
2179};
2180
2184const char* to_string(BoolAttr value);
2185
2187enum class TimeAttr {
2189 unknown = 0,
2194};
2195
2199const char* to_string(TimeAttr value);
2200
2204 unknown = 0,
2206 config_digest = 1,
2207};
2208
2212const char* to_string(OctetStringAttr value);
2213
2215enum class BitStringAttr {
2217 unknown = 0,
2218};
2219
2223const char* to_string(BitStringAttr value);
2224
2226enum class FloatAttr {
2228 unknown = 0,
2235};
2236
2240const char* to_string(FloatAttr value);
2241
2242struct AttrProp;
2243
2247struct AttrProp {
2248 friend class CppAttrPropFriend;
2249
2250private:
2254 AttrProp(bool is_writable);
2255
2256public:
2257 AttrProp() = delete;
2258
2261};
2262
2263struct AttrItem;
2264
2266struct AttrItem {
2267 friend class CppAttrItemFriend;
2268
2269private:
2274 AttrItem(uint8_t variation, const AttrProp& properties);
2275
2276public:
2277 AttrItem() = delete;
2278
2280 uint8_t variation;
2283};
2284
2285class AttrItemIter;
2286
2298class AttrItemIter final {
2299
2300 friend class CppAttrItemIterFriend;
2301
2302 // underlying opaque c type
2303 void* iter;
2304 // pointer to the last retrieved c value
2305 void* current;
2306
2307 // internal constructor
2308 AttrItemIter(void* iter) : iter(iter), current(nullptr) {}
2309
2310 AttrItemIter() = delete; // no default construction
2311 AttrItemIter(const AttrItemIter&) = delete; // no copies
2312 AttrItemIter& operator=(const AttrItemIter&) = delete; // no self-assignment
2313 AttrItemIter& operator=(AttrItemIter&&) = delete; // no move self-assignment
2314
2315public:
2316
2319
2322 bool next();
2323
2328};
2329
2331enum class Nothing {
2333 nothing = 0,
2334};
2335
2339const char* to_string(Nothing value);
2340
2342enum class PortState {
2344 disabled = 0,
2346 wait = 1,
2348 open = 2,
2350 shutdown = 3,
2351};
2352
2356const char* to_string(PortState value);
2357
2362public:
2363 virtual ~PortStateListener() = default;
2364
2368 virtual void on_change(PortState state) = 0;
2369
2370};
2371
2373namespace functional {
2374
2377template <class T>
2379{
2380 static_assert(std::is_copy_constructible<T>::value, "Lambda expression must be copy constructible. Does it contain something that is move-only?");
2381
2382 T lambda;
2383
2384public:
2387 PortStateListenerLambda(const T& lambda) : lambda(lambda) {}
2388
2390 void on_change(PortState state) override
2391 {
2392 lambda(state);
2393 }
2394};
2395
2400template <class T>
2401std::unique_ptr<PortStateListener> port_state_listener(const T& lambda)
2402{
2403 return std::make_unique<PortStateListenerLambda<T>>(lambda); ;
2404}
2405
2406} // end namespace functional
2407
2411enum class ClientState {
2413 disabled = 0,
2415 connecting = 1,
2417 connected = 2,
2423 shutdown = 5,
2424};
2425
2429const char* to_string(ClientState value);
2430
2435public:
2436 virtual ~ClientStateListener() = default;
2437
2441 virtual void on_change(ClientState state) = 0;
2442
2443};
2444
2445namespace functional {
2446
2449template <class T>
2451{
2452 static_assert(std::is_copy_constructible<T>::value, "Lambda expression must be copy constructible. Does it contain something that is move-only?");
2453
2454 T lambda;
2455
2456public:
2459 ClientStateListenerLambda(const T& lambda) : lambda(lambda) {}
2460
2462 void on_change(ClientState state) override
2463 {
2464 lambda(state);
2465 }
2466};
2467
2472template <class T>
2473std::unique_ptr<ClientStateListener> client_state_listener(const T& lambda)
2474{
2475 return std::make_unique<ClientStateListenerLambda<T>>(lambda); ;
2476}
2477
2478} // end namespace functional
2479
2481enum class Variation {
2483 group0 = 0,
2485 group0_var254 = 1,
2487 group1_var0 = 2,
2489 group1_var1 = 3,
2491 group1_var2 = 4,
2493 group2_var0 = 5,
2495 group2_var1 = 6,
2497 group2_var2 = 7,
2499 group2_var3 = 8,
2501 group3_var0 = 9,
2503 group3_var1 = 10,
2505 group3_var2 = 11,
2507 group4_var0 = 12,
2509 group4_var1 = 13,
2511 group4_var2 = 14,
2513 group4_var3 = 15,
2515 group10_var0 = 16,
2517 group10_var1 = 17,
2519 group10_var2 = 18,
2521 group11_var0 = 19,
2523 group11_var1 = 20,
2525 group11_var2 = 21,
2527 group12_var1 = 22,
2529 group13_var1 = 23,
2531 group13_var2 = 24,
2533 group20_var0 = 25,
2535 group20_var1 = 26,
2537 group20_var2 = 27,
2539 group20_var5 = 28,
2541 group20_var6 = 29,
2543 group21_var0 = 30,
2545 group21_var1 = 31,
2547 group21_var2 = 32,
2549 group21_var5 = 33,
2551 group21_var6 = 34,
2553 group21_var9 = 35,
2555 group21_var10 = 36,
2557 group22_var0 = 37,
2559 group22_var1 = 38,
2561 group22_var2 = 39,
2563 group22_var5 = 40,
2565 group22_var6 = 41,
2567 group23_var0 = 42,
2569 group23_var1 = 43,
2571 group23_var2 = 44,
2573 group23_var5 = 45,
2575 group23_var6 = 46,
2577 group30_var0 = 47,
2579 group30_var1 = 48,
2581 group30_var2 = 49,
2583 group30_var3 = 50,
2585 group30_var4 = 51,
2587 group30_var5 = 52,
2589 group30_var6 = 53,
2591 group31_var0 = 54,
2593 group31_var1 = 55,
2595 group31_var2 = 56,
2597 group31_var3 = 57,
2599 group31_var4 = 58,
2601 group31_var5 = 59,
2603 group31_var6 = 60,
2605 group31_var7 = 61,
2607 group31_var8 = 62,
2609 group32_var0 = 63,
2611 group32_var1 = 64,
2613 group32_var2 = 65,
2615 group32_var3 = 66,
2617 group32_var4 = 67,
2619 group32_var5 = 68,
2621 group32_var6 = 69,
2623 group32_var7 = 70,
2625 group32_var8 = 71,
2627 group33_var0 = 72,
2629 group33_var1 = 73,
2631 group33_var2 = 74,
2633 group33_var3 = 75,
2635 group33_var4 = 76,
2637 group33_var5 = 77,
2639 group33_var6 = 78,
2641 group33_var7 = 79,
2643 group33_var8 = 80,
2645 group34_var0 = 81,
2647 group34_var1 = 82,
2649 group34_var2 = 83,
2651 group34_var3 = 84,
2653 group40_var0 = 85,
2655 group40_var1 = 86,
2657 group40_var2 = 87,
2659 group40_var3 = 88,
2661 group40_var4 = 89,
2663 group41_var1 = 90,
2665 group41_var2 = 91,
2667 group41_var3 = 92,
2669 group41_var4 = 93,
2671 group42_var0 = 94,
2673 group42_var1 = 95,
2675 group42_var2 = 96,
2677 group42_var3 = 97,
2679 group42_var4 = 98,
2681 group42_var5 = 99,
2683 group42_var6 = 100,
2685 group42_var7 = 101,
2687 group42_var8 = 102,
2689 group43_var1 = 103,
2691 group43_var2 = 104,
2693 group43_var3 = 105,
2695 group43_var4 = 106,
2697 group43_var5 = 107,
2699 group43_var6 = 108,
2701 group43_var7 = 109,
2703 group43_var8 = 110,
2705 group50_var1 = 111,
2707 group50_var2 = 112,
2709 group50_var3 = 113,
2711 group50_var4 = 114,
2713 group51_var1 = 115,
2715 group51_var2 = 116,
2717 group52_var1 = 117,
2719 group52_var2 = 118,
2721 group60_var1 = 119,
2723 group60_var2 = 120,
2725 group60_var3 = 121,
2727 group60_var4 = 122,
2729 group70_var2 = 123,
2731 group70_var3 = 124,
2733 group70_var4 = 125,
2735 group70_var5 = 126,
2737 group70_var6 = 127,
2739 group70_var7 = 128,
2741 group70_var8 = 129,
2743 group80_var1 = 130,
2745 group102_var0 = 131,
2747 group102_var1 = 132,
2749 group110 = 133,
2751 group111 = 134,
2752};
2753
2757const char* to_string(Variation value);
2758
2759struct EventClasses;
2760
2763 friend class CppEventClassesFriend;
2764
2765 EventClasses() = delete;
2766
2773
2774
2784
2785
2795
2796
2803};
2804
2806enum class EventClass {
2808 none = 0,
2810 class1 = 1,
2812 class2 = 2,
2814 class3 = 3,
2815};
2816
2820const char* to_string(EventClass value);
2821
2822struct ClassCount;
2823
2826 friend class CppClassCountFriend;
2827
2828private:
2834 ClassCount(uint32_t num_class_1, uint32_t num_class_2, uint32_t num_class_3);
2835
2836public:
2837 ClassCount() = delete;
2838
2840 uint32_t num_class_1;
2842 uint32_t num_class_2;
2844 uint32_t num_class_3;
2845};
2846
2847struct RetryStrategy;
2848
2855 friend class CppRetryStrategyFriend;
2856
2857private:
2862 RetryStrategy(std::chrono::steady_clock::duration min_delay, std::chrono::steady_clock::duration max_delay);
2863
2864public:
2865
2874
2875
2877 std::chrono::steady_clock::duration min_delay;
2879 std::chrono::steady_clock::duration max_delay;
2880};
2881
2883enum class DataBits {
2885 five = 0,
2887 six = 1,
2889 seven = 2,
2891 eight = 3,
2892};
2893
2897const char* to_string(DataBits value);
2898
2900enum class FlowControl {
2902 none = 0,
2904 software = 1,
2906 hardware = 2,
2907};
2908
2912const char* to_string(FlowControl value);
2913
2915enum class Parity {
2917 none = 0,
2919 odd = 1,
2921 even = 2,
2922};
2923
2927const char* to_string(Parity value);
2928
2930enum class StopBits {
2932 one = 0,
2934 two = 1,
2935};
2936
2940const char* to_string(StopBits value);
2941
2942struct SerialSettings;
2943
2946 friend class CppSerialSettingsFriend;
2947
2948private:
2957
2958public:
2959
2971
2972
2974 uint32_t baud_rate;
2983};
2984
2986enum class LinkErrorMode {
2988 discard = 0,
2990 close = 1,
2991};
2992
2996const char* to_string(LinkErrorMode value);
2997
2999enum class FunctionCode {
3001 confirm = 0,
3003 read = 1,
3005 write = 2,
3007 select = 3,
3009 operate = 4,
3011 direct_operate = 5,
3015 immediate_freeze = 7,
3019 freeze_clear = 9,
3023 freeze_at_time = 11,
3027 cold_restart = 13,
3029 warm_restart = 14,
3031 initialize_data = 15,
3035 start_application = 17,
3037 stop_application = 18,
3039 save_configuration = 19,
3041 enable_unsolicited = 20,
3045 assign_class = 22,
3047 delay_measure = 23,
3051 open_file = 25,
3053 close_file = 26,
3055 delete_file = 27,
3057 get_file_info = 28,
3059 authenticate_file = 29,
3061 abort_file = 30,
3063 response = 31,
3066};
3067
3071const char* to_string(FunctionCode value);
3072
3074enum class FileType {
3076 directory = 0,
3078 simple = 1,
3080 other = 2,
3081};
3082
3086const char* to_string(FileType value);
3087
3088struct PermissionSet;
3089
3092 friend class CppPermissionSetFriend;
3093
3094
3100 PermissionSet(bool execute, bool write, bool read);
3101
3102
3112
3113
3117 bool write;
3119 bool read;
3120};
3121
3122struct Permissions;
3123
3126 friend class CppPermissionsFriend;
3127
3128 Permissions() = delete;
3129
3136
3137
3147
3148
3155};
3156
3157struct OpenFile;
3158
3160struct OpenFile {
3161 friend class CppOpenFileFriend;
3162
3163private:
3169 OpenFile(uint32_t file_handle, uint32_t file_size, uint16_t max_block_size);
3170
3171public:
3172 OpenFile() = delete;
3173
3177 uint32_t file_handle;
3179 uint32_t file_size;
3184};
3185
3187enum class FileError {
3189 ok = 0,
3191 bad_status = 1,
3193 no_permission = 2,
3195 bad_block_num = 3,
3197 abort_by_user = 4,
3201 wrong_handle = 6,
3205 iin_error = 8,
3207 bad_response = 9,
3209 response_timeout = 10,
3211 write_error = 11,
3213 no_connection = 12,
3215 shutdown = 13,
3219 bad_encoding = 15,
3224};
3225
3229const char* to_string(FileError value);
3230
3232class FileException : public std::logic_error {
3233public:
3238};
3239
3240struct FileInfo;
3241
3245struct FileInfo {
3246 friend class CppFileInfoFriend;
3247
3248private:
3256 FileInfo(const std::string& file_name, FileType file_type, uint32_t size, uint64_t time_created, const Permissions& permissions);
3257
3258public:
3259 FileInfo() = delete;
3260
3262 std::string file_name;
3268 uint32_t size;
3275};
3276
3281public:
3282 virtual ~FileOpenCallback() = default;
3283
3287 virtual void on_complete(const OpenFile& result) = 0;
3288
3292 virtual void on_failure(FileError error) = 0;
3293
3294};
3295
3300public:
3301 virtual ~FileOperationCallback() = default;
3302
3306 virtual void on_complete(Nothing result) = 0;
3307
3311 virtual void on_failure(FileError error) = 0;
3312
3313};
3314
3319public:
3320 virtual ~FileAuthCallback() = default;
3321
3325 virtual void on_complete(uint32_t result) = 0;
3326
3330 virtual void on_failure(FileError error) = 0;
3331
3332};
3333
3335enum class FileMode {
3337 read = 0,
3339 write = 1,
3341 append = 2,
3342};
3343
3347const char* to_string(FileMode value);
3348
3350enum class UdpSocketMode {
3352 one_to_one = 0,
3356 one_to_many = 1,
3357};
3358
3362const char* to_string(UdpSocketMode value);
3363
3367enum class LinkReadMode {
3369 stream = 0,
3371 datagram = 1,
3372};
3373
3377const char* to_string(LinkReadMode value);
3378
3382enum class LogLevel {
3384 error = 0,
3386 warn = 1,
3388 info = 2,
3390 debug = 3,
3392 trace = 4,
3393};
3394
3398const char* to_string(LogLevel value);
3399
3400struct LoggingConfig;
3401
3405 text = 0,
3407 json = 1,
3408};
3409
3413const char* to_string(LogOutputFormat value);
3414
3416enum class TimeFormat {
3418 none = 0,
3420 rfc_3339 = 1,
3422 system = 2,
3423};
3424
3428const char* to_string(TimeFormat value);
3429
3432 friend class CppLoggingConfigFriend;
3433
3434private:
3443
3444public:
3445
3457
3458
3469};
3470
3474class Logger {
3475public:
3476 virtual ~Logger() = default;
3477
3482 virtual void on_message(LogLevel level, const char* message) = 0;
3483
3484};
3485
3486namespace functional {
3487
3490template <class T>
3491class LoggerLambda final : public Logger
3492{
3493 static_assert(std::is_copy_constructible<T>::value, "Lambda expression must be copy constructible. Does it contain something that is move-only?");
3494
3495 T lambda;
3496
3497public:
3500 LoggerLambda(const T& lambda) : lambda(lambda) {}
3501
3503 void on_message(LogLevel level, const char* message) override
3504 {
3505 lambda(level, message);
3506 }
3507};
3508
3513template <class T>
3514std::unique_ptr<Logger> logger(const T& lambda)
3515{
3516 return std::make_unique<LoggerLambda<T>>(lambda); ;
3517}
3518
3519} // end namespace functional
3520
3522class Logging {
3523 Logging() = delete;
3524public:
3534 static void configure(const LoggingConfig& config, std::unique_ptr<Logger> logger);
3535};
3536
3540 response = 0,
3543};
3544
3548const char* to_string(ResponseFunction value);
3549
3550struct Iin1;
3551
3553struct Iin1 {
3554 friend class CppIin1Friend;
3555
3556private:
3568
3569public:
3570 Iin1() = delete;
3571
3588};
3589
3590struct Iin2;
3591
3593struct Iin2 {
3594 friend class CppIin2Friend;
3595
3596private:
3608
3609public:
3610 Iin2() = delete;
3611
3628};
3629
3630struct Iin;
3631
3633struct Iin {
3634 friend class CppIinFriend;
3635
3636private:
3641 Iin(const Iin1& iin1, const Iin2& iin2);
3642
3643public:
3644 Iin() = delete;
3645
3650};
3651
3652struct ResponseHeader;
3653
3656 friend class CppResponseHeaderFriend;
3657
3658private:
3665
3666public:
3667 ResponseHeader() = delete;
3668
3675};
3676
3678enum class QualifierCode {
3680 range8 = 0,
3682 range16 = 1,
3684 all_objects = 2,
3686 count8 = 3,
3688 count16 = 4,
3694 free_format_16 = 7,
3695};
3696
3700const char* to_string(QualifierCode value);
3701
3702struct HeaderInfo;
3703
3706 friend class CppHeaderInfoFriend;
3707
3708 HeaderInfo() = delete;
3709
3717
3718
3727};
3728
3730enum class ReadType {
3734 unsolicited = 1,
3736 single_poll = 2,
3738 periodic_poll = 3,
3739};
3740
3744const char* to_string(ReadType value);
3745
3752public:
3753 virtual ~ReadHandler() = default;
3754
3761 virtual void begin_fragment(ReadType read_type, const ResponseHeader& header) {};
3762
3769 virtual void end_fragment(ReadType read_type, const ResponseHeader& header) {};
3770
3777 virtual void handle_binary_input(const HeaderInfo& info, BinaryInputIterator& values) {};
3778
3786
3794
3801 virtual void handle_counter(const HeaderInfo& info, CounterIterator& values) {};
3802
3810
3817 virtual void handle_analog_input(const HeaderInfo& info, AnalogInputIterator& values) {};
3818
3826
3834
3842
3850
3858
3866
3873 virtual void handle_octet_string(const HeaderInfo& info, OctetStringIterator& values) {};
3874
3881 virtual void handle_abs_time(const HeaderInfo& info, const Timestamp& time) {};
3882
3892 virtual void handle_string_attr(const HeaderInfo& info, StringAttr attr, uint8_t set, uint8_t variation, const char* value) {};
3893
3903 virtual void handle_variation_list_attr(const HeaderInfo& info, VariationListAttr attr, uint8_t set, uint8_t variation, AttrItemIter& value) {};
3904
3914 virtual void handle_uint_attr(const HeaderInfo& info, UintAttr attr, uint8_t set, uint8_t variation, uint32_t value) {};
3915
3927 virtual void handle_bool_attr(const HeaderInfo& info, BoolAttr attr, uint8_t set, uint8_t variation, bool value) {};
3928
3940 virtual void handle_int_attr(const HeaderInfo& info, IntAttr attr, uint8_t set, uint8_t variation, int32_t value) {};
3941
3951 virtual void handle_time_attr(const HeaderInfo& info, TimeAttr attr, uint8_t set, uint8_t variation, uint64_t value) {};
3952
3962 virtual void handle_float_attr(const HeaderInfo& info, FloatAttr attr, uint8_t set, uint8_t variation, double value) {};
3963
3973 virtual void handle_octet_string_attr(const HeaderInfo& info, OctetStringAttr attr, uint8_t set, uint8_t variation, ByteIterator& value) {};
3974
3984 virtual void handle_bit_string_attr(const HeaderInfo& info, BitStringAttr attr, uint8_t set, uint8_t variation, ByteIterator& value) {};
3985
3986};
3987
3988struct MasterChannelConfig;
3989
3992 friend class CppMasterChannelConfigFriend;
3993
3994private:
4002
4003public:
4004 MasterChannelConfig() = delete;
4005
4016
4017
4019 uint16_t address;
4030};
4031
4032class MasterChannel;
4033
4035
4038 friend class CppWriteDeadBandRequestFriend;
4039 // pointer to the underlying C type
4040 void* self;
4041 // constructor only accessible internally
4042 WriteDeadBandRequest(void* self): self(self) {}
4043 // non-copyable
4045 WriteDeadBandRequest& operator=(const WriteDeadBandRequest&) = delete;
4046 // no move assignment
4047 WriteDeadBandRequest& operator=(WriteDeadBandRequest&& other) = delete;
4048
4049public:
4053 WriteDeadBandRequest(WriteDeadBandRequest&& other) noexcept : self(other.self) { other.self = nullptr; }
4054
4058
4061
4068 void add_g34v1_u8(uint8_t index, uint16_t dead_band);
4069
4076 void add_g34v2_u8(uint8_t index, uint32_t dead_band);
4077
4084 void add_g34v3_u8(uint8_t index, float dead_band);
4085
4092 void add_g34v1_u16(uint16_t index, uint16_t dead_band);
4093
4100 void add_g34v2_u16(uint16_t index, uint32_t dead_band);
4101
4108 void add_g34v3_u16(uint16_t index, float dead_band);
4109
4115};
4116
4120 ok = 0,
4122 rejected_by_iin2 = 1,
4126 iin_error = 3,
4128 bad_response = 4,
4130 response_timeout = 5,
4132 write_error = 6,
4134 no_connection = 7,
4136 shutdown = 8,
4140 bad_encoding = 10,
4145};
4146
4151
4153class EmptyResponseException : public std::logic_error {
4154public:
4159};
4160
4165public:
4166 virtual ~EmptyResponseCallback() = default;
4167
4171 virtual void on_complete(Nothing result) = 0;
4172
4177
4178};
4179
4180struct AssociationId;
4181
4184 friend class CppAssociationIdFriend;
4185
4186private:
4187
4191 AssociationId(uint16_t address);
4192
4193 AssociationId() = delete;
4194
4196 uint16_t address;
4197};
4198
4199struct PollId;
4200
4202struct PollId {
4203 friend class CppPollIdFriend;
4204
4205private:
4206
4211 PollId(uint16_t association_id, uint64_t id);
4212
4213 PollId() = delete;
4214
4216 uint16_t association_id;
4218 uint64_t id;
4219};
4220
4221struct Classes;
4222
4224struct Classes {
4225 friend class CppClassesFriend;
4226
4227 Classes() = delete;
4228
4235 Classes(bool class0, bool class1, bool class2, bool class3);
4236
4237
4247 static Classes all();
4248
4249
4259 static Classes none();
4260
4261
4270};
4271
4273enum class AutoTimeSync {
4275 none = 0,
4277 lan = 1,
4279 non_lan = 2,
4282};
4283
4287const char* to_string(AutoTimeSync value);
4288
4289struct AssociationConfig;
4290
4293 friend class CppAssociationConfigFriend;
4294
4295private:
4309
4310public:
4311 AssociationConfig() = delete;
4312
4329
4330
4332 std::chrono::steady_clock::duration response_timeout;
4348 std::chrono::steady_clock::duration keep_alive_timeout;
4355};
4356
4357struct UtcTimestamp;
4358
4363 friend class CppUtcTimestampFriend;
4364
4365private:
4370 UtcTimestamp(uint64_t value, bool is_valid);
4371
4372public:
4373 UtcTimestamp() = delete;
4374
4382 static UtcTimestamp valid(uint64_t value);
4383
4384
4393
4394
4398 uint64_t value;
4401};
4402
4407public:
4408 virtual ~AssociationHandler() = default;
4409
4418
4419};
4420
4421namespace functional {
4422
4425template <class T>
4427{
4428 static_assert(std::is_copy_constructible<T>::value, "Lambda expression must be copy constructible. Does it contain something that is move-only?");
4429
4430 T lambda;
4431
4432public:
4435 AssociationHandlerLambda(const T& lambda) : lambda(lambda) {}
4436
4439 {
4440 return lambda();
4441 }
4442};
4443
4448template <class T>
4449std::unique_ptr<AssociationHandler> association_handler(const T& lambda)
4450{
4451 return std::make_unique<AssociationHandlerLambda<T>>(lambda); ;
4452}
4453
4454} // end namespace functional
4455
4457enum class TaskType {
4459 user_read = 0,
4461 periodic_poll = 1,
4465 auto_event_scan = 3,
4467 command = 4,
4475 time_sync = 8,
4477 restart = 9,
4479 write_dead_bands = 10,
4487 file_read = 12,
4489 get_file_info = 13,
4491 file_auth = 14,
4493 file_open = 15,
4495 file_write_block = 16,
4497 file_close = 17,
4498};
4499
4503const char* to_string(TaskType value);
4504
4506enum class TaskError {
4510 iin_error = 1,
4512 bad_response = 2,
4514 response_timeout = 3,
4516 write_error = 4,
4518 no_connection = 5,
4520 shutdown = 6,
4524 bad_encoding = 8,
4531};
4532
4536const char* to_string(TaskError value);
4537
4542public:
4543 virtual ~AssociationInformation() = default;
4544
4550 virtual void task_start(TaskType task_type, FunctionCode function_code, uint8_t seq) = 0;
4551
4559 virtual void task_success(TaskType task_type, FunctionCode function_code, uint8_t seq) = 0;
4560
4565 virtual void task_fail(TaskType task_type, TaskError error) = 0;
4566
4571 virtual void unsolicited_response(bool is_duplicate, uint8_t seq) = 0;
4572
4573};
4574
4575class Request;
4576
4580class Request {
4581 friend class CppRequestFriend;
4582 // pointer to the underlying C type
4583 void* self;
4584 // constructor only accessible internally
4585 Request(void* self): self(self) {}
4586 // non-copyable
4587 Request(const Request&) = delete;
4588 Request& operator=(const Request&) = delete;
4589 // no move assignment
4590 Request& operator=(Request&& other) = delete;
4591
4592public:
4596 Request(Request&& other) noexcept : self(other.self) { other.self = nullptr; }
4597
4601
4604
4610 void add_one_byte_range_header(Variation variation, uint8_t start, uint8_t stop);
4611
4617 void add_two_byte_range_header(Variation variation, uint16_t start, uint16_t stop);
4618
4623
4628 void add_one_byte_limited_count_header(Variation variation, uint8_t count);
4629
4634 void add_two_byte_limited_count_header(Variation variation, uint16_t count);
4635
4642 void add_time_and_interval(uint64_t time, uint32_t interval_ms);
4643
4648 void add_specific_attribute(uint8_t variation, uint8_t set);
4649
4655 void add_string_attribute(uint8_t variation, uint8_t set, const std::string& value);
4656
4662 void add_uint_attribute(uint8_t variation, uint8_t set, uint32_t value);
4663
4673 static Request class_request(bool class0, bool class1, bool class2, bool class3);
4674
4681 static Request all_objects(Variation variation);
4682
4691 static Request one_byte_range(Variation variation, uint8_t start, uint8_t stop);
4692
4701 static Request two_byte_range(Variation variation, uint16_t start, uint16_t stop);
4702
4710 static Request one_byte_limited_count(Variation variation, uint8_t count);
4711
4719 static Request two_byte_limited_count(Variation variation, uint16_t count);
4720};
4721
4723enum class ReadError {
4725 ok = 0,
4729 iin_error = 2,
4731 bad_response = 3,
4733 response_timeout = 4,
4735 write_error = 5,
4737 no_connection = 6,
4739 shutdown = 7,
4743 bad_encoding = 9,
4748};
4749
4753const char* to_string(ReadError value);
4754
4756class ReadException : public std::logic_error {
4757public:
4762};
4763
4768public:
4769 virtual ~ReadTaskCallback() = default;
4770
4774 virtual void on_complete(Nothing result) = 0;
4775
4779 virtual void on_failure(ReadError error) = 0;
4780
4781};
4782
4783class CommandSet;
4784
4787 friend class CppCommandSetFriend;
4788 // pointer to the underlying C type
4789 void* self;
4790 // constructor only accessible internally
4791 CommandSet(void* self): self(self) {}
4792 // non-copyable
4793 CommandSet(const CommandSet&) = delete;
4794 CommandSet& operator=(const CommandSet&) = delete;
4795 // no move assignment
4796 CommandSet& operator=(CommandSet&& other) = delete;
4797
4798public:
4802 CommandSet(CommandSet&& other) noexcept : self(other.self) { other.self = nullptr; }
4803
4807
4810
4815 void add_g12_v1_u8(uint8_t idx, const Group12Var1& header);
4816
4821 void add_g12_v1_u16(uint16_t idx, const Group12Var1& header);
4822
4827 void add_g41_v1_u8(uint8_t idx, int32_t value);
4828
4833 void add_g41_v1_u16(uint16_t idx, int32_t value);
4834
4839 void add_g41_v2_u8(uint8_t idx, int16_t value);
4840
4845 void add_g41_v2_u16(uint16_t idx, int16_t value);
4846
4851 void add_g41_v3_u8(uint8_t idx, float value);
4852
4857 void add_g41_v3_u16(uint16_t idx, float value);
4858
4863 void add_g41_v4_u8(uint8_t idx, double value);
4864
4869 void add_g41_v4_u16(uint16_t idx, double value);
4870
4874};
4875
4877enum class CommandMode {
4879 direct_operate = 0,
4882};
4883
4887const char* to_string(CommandMode value);
4888
4890enum class CommandError {
4892 ok = 0,
4894 bad_status = 1,
4896 header_mismatch = 2,
4900 iin_error = 4,
4902 bad_response = 5,
4904 response_timeout = 6,
4906 write_error = 7,
4908 no_connection = 8,
4910 shutdown = 9,
4914 bad_encoding = 11,
4919};
4920
4924const char* to_string(CommandError value);
4925
4927class CommandException : public std::logic_error {
4928public:
4933};
4934
4939public:
4940 virtual ~CommandTaskCallback() = default;
4941
4945 virtual void on_complete(Nothing result) = 0;
4946
4950 virtual void on_failure(CommandError error) = 0;
4951
4952};
4953
4955enum class TimeSyncMode {
4957 lan = 0,
4959 non_lan = 1,
4962};
4963
4967const char* to_string(TimeSyncMode value);
4968
4970enum class TimeSyncError {
4972 ok = 0,
4974 clock_rollback = 1,
4980 overflow = 4,
4982 still_needs_time = 5,
4988 iin_error = 8,
4990 bad_response = 9,
4992 response_timeout = 10,
4994 write_error = 11,
4996 no_connection = 12,
4998 shutdown = 13,
5002 bad_encoding = 15,
5007};
5008
5012const char* to_string(TimeSyncError value);
5013
5015class TimeSyncException : public std::logic_error {
5016public:
5021};
5022
5027public:
5028 virtual ~TimeSyncTaskCallback() = default;
5029
5033 virtual void on_complete(Nothing result) = 0;
5034
5038 virtual void on_failure(TimeSyncError error) = 0;
5039
5040};
5041
5043enum class RestartError {
5045 ok = 0,
5049 iin_error = 2,
5051 bad_response = 3,
5053 response_timeout = 4,
5055 write_error = 5,
5057 no_connection = 6,
5059 shutdown = 7,
5063 bad_encoding = 9,
5068};
5069
5073const char* to_string(RestartError value);
5074
5076class RestartException : public std::logic_error {
5077public:
5082};
5083
5088public:
5089 virtual ~RestartTaskCallback() = default;
5090
5094 virtual void on_complete(std::chrono::steady_clock::duration result) = 0;
5095
5099 virtual void on_failure(RestartError error) = 0;
5100
5101};
5102
5107public:
5108 virtual ~FileInfoCallback() = default;
5109
5113 virtual void on_complete(const FileInfo& result) = 0;
5114
5118 virtual void on_failure(FileError error) = 0;
5119
5120};
5121
5128public:
5129 virtual ~FileReader() = default;
5130
5137 virtual bool opened(uint32_t size) = 0;
5138
5146 virtual bool block_received(uint32_t block_num, ByteIterator& data) = 0;
5147
5151 virtual void aborted(FileError error) = 0;
5152
5155 virtual void completed() = 0;
5156
5157};
5158
5159struct FileReadConfig;
5160
5163 friend class CppFileReadConfigFriend;
5164
5165private:
5170 FileReadConfig(uint16_t max_block_size, uint32_t max_file_size);
5171
5172public:
5173 FileReadConfig() = delete;
5174
5183
5184
5189};
5190
5191struct DirReadConfig;
5192
5195 friend class CppDirReadConfigFriend;
5196
5197private:
5202 DirReadConfig(uint16_t max_block_size, uint32_t max_file_size);
5203
5204public:
5205 DirReadConfig() = delete;
5206
5215
5216
5221};
5222
5223class FileInfoIterator;
5224
5236class FileInfoIterator final {
5237
5238 friend class CppFileInfoIteratorFriend;
5239
5240 // underlying opaque c type
5241 void* iter;
5242 // pointer to the last retrieved c value
5243 void* current;
5244
5245 // internal constructor
5246 FileInfoIterator(void* iter) : iter(iter), current(nullptr) {}
5247
5248 FileInfoIterator() = delete; // no default construction
5249 FileInfoIterator(const FileInfoIterator&) = delete; // no copies
5250 FileInfoIterator& operator=(const FileInfoIterator&) = delete; // no self-assignment
5251 FileInfoIterator& operator=(FileInfoIterator&&) = delete; // no move self-assignment
5252
5253public:
5254
5257
5260 bool next();
5261
5266};
5267
5272public:
5273 virtual ~ReadDirectoryCallback() = default;
5274
5278 virtual void on_complete(FileInfoIterator& result) = 0;
5279
5283 virtual void on_failure(FileError error) = 0;
5284
5285};
5286
5290 ok = 0,
5296 iin_error = 3,
5298 bad_response = 4,
5300 response_timeout = 5,
5302 write_error = 6,
5304 no_connection = 7,
5306 shutdown = 8,
5310 bad_encoding = 10,
5315};
5316
5320const char* to_string(LinkStatusError value);
5321
5323class LinkStatusException : public std::logic_error {
5324public:
5329};
5330
5335public:
5336 virtual ~LinkStatusCallback() = default;
5337
5341 virtual void on_complete(Nothing result) = 0;
5342
5347
5348};
5349
5356 friend class CppMasterChannelFriend;
5357 // pointer to the underlying C type
5358 void* self;
5359 // constructor only accessible internally
5360 MasterChannel(void* self): self(self) {}
5361 // non-copyable
5362 MasterChannel(const MasterChannel&) = delete;
5363 MasterChannel& operator=(const MasterChannel&) = delete;
5364 // no move assignment
5365 MasterChannel& operator=(MasterChannel&& other) = delete;
5366
5367public:
5371 MasterChannel(MasterChannel&& other) noexcept : self(other.self) { other.self = nullptr; }
5372
5375
5379 void enable();
5380
5384 void disable();
5385
5395 AssociationId add_association(uint16_t address, const AssociationConfig& config, std::unique_ptr<ReadHandler> read_handler, std::unique_ptr<AssociationHandler> association_handler, std::unique_ptr<AssociationInformation> association_information);
5396
5407 AssociationId add_udp_association(uint16_t address, const std::string& destination, const AssociationConfig& config, std::unique_ptr<ReadHandler> read_handler, std::unique_ptr<AssociationHandler> association_handler, std::unique_ptr<AssociationInformation> association_information);
5408
5414
5419 void set_decode_level(const DecodeLevel& decode_level);
5420
5426
5436 PollId add_poll(const AssociationId& id, Request& request, std::chrono::steady_clock::duration period);
5437
5444 void remove_poll(const PollId& poll_id);
5445
5456 void demand_poll(const PollId& poll_id);
5457
5465 void read_file(const AssociationId& association, const std::string& remote_file_path, const FileReadConfig& config, std::unique_ptr<FileReader> reader);
5466
5478 void read_file_with_auth(const AssociationId& association, const std::string& remote_file_path, const FileReadConfig& config, std::unique_ptr<FileReader> reader, const std::string& user_name, const std::string& password);
5479
5490 static MasterChannel create_tcp_channel(Runtime& runtime, LinkErrorMode link_error_mode, const MasterChannelConfig& config, EndpointList& endpoints, const ConnectStrategy& connect_strategy, std::unique_ptr<ClientStateListener> listener);
5491
5505 static MasterChannel create_tcp_channel_2(Runtime& runtime, LinkErrorMode link_error_mode, const MasterChannelConfig& config, EndpointList& endpoints, const ConnectStrategy& connect_strategy, ConnectOptions& connect_options, std::unique_ptr<ClientStateListener> listener);
5506
5518 static MasterChannel create_tls_channel(Runtime& runtime, LinkErrorMode link_error_mode, const MasterChannelConfig& config, EndpointList& endpoints, const ConnectStrategy& connect_strategy, std::unique_ptr<ClientStateListener> listener, const TlsClientConfig& tls_config);
5519
5534 static MasterChannel create_tls_channel_2(Runtime& runtime, LinkErrorMode link_error_mode, const MasterChannelConfig& config, EndpointList& endpoints, const ConnectStrategy& connect_strategy, ConnectOptions& connect_options, std::unique_ptr<ClientStateListener> listener, const TlsClientConfig& tls_config);
5535
5548 static MasterChannel create_serial_channel(Runtime& runtime, const MasterChannelConfig& config, const std::string& path, const SerialSettings& serial_params, std::chrono::steady_clock::duration open_retry_delay, std::unique_ptr<PortStateListener> listener);
5549
5561 static MasterChannel create_udp_channel(Runtime& runtime, const MasterChannelConfig& config, const std::string& local_endpoint, LinkReadMode link_read_mode, std::chrono::steady_clock::duration retry_delay);
5562
5571 void read(const AssociationId& association, Request& request, std::unique_ptr<ReadTaskCallback> callback);
5572
5573
5583 void read_with_handler(const AssociationId& association, Request& request, std::unique_ptr<ReadHandler> handler, std::unique_ptr<ReadTaskCallback> callback);
5584
5585
5593 void operate(const AssociationId& association, CommandMode mode, CommandSet& command, std::unique_ptr<CommandTaskCallback> callback);
5594
5595
5604 void operate_no_ack(const AssociationId& association, CommandSet& command, std::unique_ptr<CommandTaskCallback> callback);
5605
5606
5613 void synchronize_time(const AssociationId& association, TimeSyncMode mode, std::unique_ptr<TimeSyncTaskCallback> callback);
5614
5615
5621 void cold_restart(const AssociationId& association, std::unique_ptr<RestartTaskCallback> callback);
5622
5623
5629 void warm_restart(const AssociationId& association, std::unique_ptr<RestartTaskCallback> callback);
5630
5631
5638 void write_dead_bands(const AssociationId& association, WriteDeadBandRequest& request, std::unique_ptr<EmptyResponseCallback> callback);
5639
5640
5652 void send_and_expect_empty_response(const AssociationId& association, FunctionCode function, Request& headers, std::unique_ptr<EmptyResponseCallback> callback);
5653
5654
5663 void get_file_info(const AssociationId& association, const std::string& file_name, std::unique_ptr<FileInfoCallback> callback);
5664
5665
5673 void get_file_auth_key(const AssociationId& association, const std::string& username, const std::string& password, std::unique_ptr<FileAuthCallback> callback);
5674
5675
5687 void open_file(const AssociationId& association, const std::string& file_name, uint32_t auth_key, const Permissions& permissions, uint32_t file_size, FileMode file_mode, uint16_t max_block_size, std::unique_ptr<FileOpenCallback> callback);
5688
5689
5699 void write_file_block(const AssociationId& association, uint32_t handle, uint32_t block_number, bool final_block, const std::vector<uint8_t>& block_data, std::unique_ptr<FileOperationCallback> callback);
5700
5701
5708 void close_file(const AssociationId& association, uint32_t handle, std::unique_ptr<FileOperationCallback> callback);
5709
5710
5720 void read_directory(const AssociationId& association, const std::string& dir_path, const DirReadConfig& config, std::unique_ptr<ReadDirectoryCallback> callback);
5721
5722
5734 void read_directory_with_auth(const AssociationId& association, const std::string& dir_path, const DirReadConfig& config, const std::string& user_name, const std::string& password, std::unique_ptr<ReadDirectoryCallback> callback);
5735
5736
5742 void check_link_status(const AssociationId& association, std::unique_ptr<LinkStatusCallback> callback);
5743
5744};
5745
5746class AcceptHandler;
5747
5750 friend class CppAcceptHandlerFriend;
5751 // pointer to the underlying C type
5752 void* self;
5753 // constructor only accessible internally
5754 AcceptHandler(void* self): self(self) {}
5755 // non-copyable
5756 AcceptHandler(const AcceptHandler&) = delete;
5757 AcceptHandler& operator=(const AcceptHandler&) = delete;
5758 // no move assignment
5759 AcceptHandler& operator=(AcceptHandler&& other) = delete;
5760
5761public:
5765 AcceptHandler(AcceptHandler&& other) noexcept : self(other.self) { other.self = nullptr; }
5766
5773
5780};
5781
5783
5786 friend class CppIdentifiedLinkHandlerFriend;
5787 // pointer to the underlying C type
5788 void* self;
5789 // constructor only accessible internally
5790 IdentifiedLinkHandler(void* self): self(self) {}
5791 // non-copyable
5793 IdentifiedLinkHandler& operator=(const IdentifiedLinkHandler&) = delete;
5794 // no move assignment
5795 IdentifiedLinkHandler& operator=(IdentifiedLinkHandler&& other) = delete;
5796
5797public:
5801 IdentifiedLinkHandler(IdentifiedLinkHandler&& other) noexcept : self(other.self) { other.self = nullptr; }
5802
5809};
5810
5815public:
5816 virtual ~ConnectionHandler() = default;
5817
5822 virtual void accept(const char* remote_addr, AcceptHandler& acceptor) = 0;
5823
5830 virtual void start(const char* remote_addr, MasterChannel& channel) = 0;
5831
5838 virtual void accept_with_link_id(const char* remote_addr, uint16_t source, uint16_t destination, IdentifiedLinkHandler& acceptor) = 0;
5839
5848 virtual void start_with_link_id(const char* remote_addr, uint16_t source, uint16_t destination, MasterChannel& channel) = 0;
5849
5850};
5851
5852class MasterServer;
5853
5854struct LinkIdConfig;
5855
5858 friend class CppLinkIdConfigFriend;
5859
5860private:
5866 LinkIdConfig(uint16_t max_tasks, std::chrono::steady_clock::duration timeout, PhysDecodeLevel decode_level);
5867
5868public:
5869
5879
5880
5882 uint16_t max_tasks;
5884 std::chrono::steady_clock::duration timeout;
5887};
5888
5891 friend class CppMasterServerFriend;
5892 // pointer to the underlying C type
5893 void* self;
5894 // constructor only accessible internally
5895 MasterServer(void* self): self(self) {}
5896 // non-copyable
5897 MasterServer(const MasterServer&) = delete;
5898 MasterServer& operator=(const MasterServer&) = delete;
5899 // no move assignment
5900 MasterServer& operator=(MasterServer&& other) = delete;
5901
5902public:
5906 MasterServer(MasterServer&& other) noexcept : self(other.self) { other.self = nullptr; }
5907
5910
5921 static MasterServer create_tcp_server(Runtime& runtime, const std::string& local_addr, const LinkIdConfig& link_id_config, std::unique_ptr<ConnectionHandler> connection_handler);
5922};
5923
5924class Database;
5925
5927enum class UpdateResult {
5929 no_point = 0,
5931 no_event = 1,
5933 created = 2,
5935 overflow = 3,
5936};
5937
5941const char* to_string(UpdateResult value);
5942
5943struct UpdateInfo;
5944
5947 friend class CppUpdateInfoFriend;
5948
5949private:
5955 UpdateInfo(UpdateResult result, uint64_t created, uint64_t discarded);
5956
5957public:
5958 UpdateInfo() = delete;
5959
5963 uint64_t created;
5965 uint64_t discarded;
5966};
5967
5969enum class EventMode {
5973 detect = 0,
5975 force = 1,
5977 suppress = 2,
5978};
5979
5983const char* to_string(EventMode value);
5984
5985struct UpdateOptions;
5986
5991 friend class CppUpdateOptionsFriend;
5992
5993private:
5999
6000public:
6001 UpdateOptions() = delete;
6002
6011
6012
6021
6022
6027};
6028
6032 binary_input = 0,
6038 counter = 3,
6040 frozen_counter = 4,
6042 analog_input = 5,
6045};
6046
6050const char* to_string(UpdateFlagsType value);
6051
6055 group1_var1 = 0,
6057 group1_var2 = 1,
6058};
6059
6064
6068 group2_var1 = 0,
6072 group2_var2 = 1,
6076 group2_var3 = 2,
6077};
6078
6083
6084struct BinaryInputConfig;
6085
6088 friend class CppBinaryInputConfigFriend;
6089
6090
6096
6097
6106
6107
6112};
6113
6117 group3_var1 = 0,
6119 group3_var2 = 1,
6120};
6121
6126
6130 group4_var1 = 0,
6134 group4_var2 = 1,
6138 group4_var3 = 2,
6139};
6140
6145
6147
6150 friend class CppDoubleBitBinaryInputConfigFriend;
6151
6152
6158
6159
6168
6169
6174};
6175
6179 group10_var1 = 0,
6181 group10_var2 = 1,
6182};
6183
6188
6192 group11_var1 = 0,
6196 group11_var2 = 1,
6197};
6198
6203
6205
6208 friend class CppBinaryOutputStatusConfigFriend;
6209
6210
6216
6217
6226
6227
6232};
6233
6237 group20_var1 = 0,
6239 group20_var2 = 1,
6241 group20_var5 = 2,
6243 group20_var6 = 3,
6244};
6245
6250
6254 group22_var1 = 0,
6256 group22_var2 = 1,
6260 group22_var5 = 2,
6264 group22_var6 = 3,
6265};
6266
6271
6272struct CounterConfig;
6273
6276 friend class CppCounterConfigFriend;
6277
6278
6285
6286
6296
6297
6303 uint32_t deadband;
6304};
6305
6309 group21_var1 = 0,
6311 group21_var2 = 1,
6313 group21_var5 = 2,
6315 group21_var6 = 3,
6317 group21_var9 = 4,
6319 group21_var10 = 5,
6320};
6321
6326
6330 group23_var1 = 0,
6332 group23_var2 = 1,
6336 group23_var5 = 2,
6340 group23_var6 = 3,
6341};
6342
6347
6348struct FrozenCounterConfig;
6349
6352 friend class CppFrozenCounterConfigFriend;
6353
6354
6361
6362
6372
6373
6379 uint32_t deadband;
6380};
6381
6385 group30_var1 = 0,
6387 group30_var2 = 1,
6389 group30_var3 = 2,
6391 group30_var4 = 3,
6393 group30_var5 = 4,
6395 group30_var6 = 5,
6396};
6397
6402
6406 group32_var1 = 0,
6408 group32_var2 = 1,
6412 group32_var3 = 2,
6416 group32_var4 = 3,
6418 group32_var5 = 4,
6420 group32_var6 = 5,
6424 group32_var7 = 6,
6428 group32_var8 = 7,
6429};
6430
6435
6436struct AnalogInputConfig;
6437
6440 friend class CppAnalogInputConfigFriend;
6441
6442
6449
6450
6460
6461
6469 double deadband;
6470};
6471
6475 group40_var1 = 0,
6477 group40_var2 = 1,
6479 group40_var3 = 2,
6481 group40_var4 = 3,
6482};
6483
6488
6492 group42_var1 = 0,
6494 group42_var2 = 1,
6498 group42_var3 = 2,
6502 group42_var4 = 3,
6504 group42_var5 = 4,
6506 group42_var6 = 5,
6510 group42_var7 = 6,
6514 group42_var8 = 7,
6515};
6516
6521
6523
6526 friend class CppAnalogOutputStatusConfigFriend;
6527
6528
6535
6536
6546
6547
6555 double deadband;
6556};
6557
6559enum class AttrDefError {
6561 ok = 0,
6563 already_defined = 1,
6567 bad_type = 3,
6569 not_writable = 4,
6571 bad_value = 5,
6572};
6573
6577const char* to_string(AttrDefError value);
6578
6583 friend class CppDatabaseFriend;
6584 // pointer to the underlying C type
6585 void* self;
6586 // constructor only accessible internally
6587 Database(void* self): self(self) {}
6588 // non-copyable
6589 Database(const Database&) = delete;
6590 Database& operator=(const Database&) = delete;
6591 // no move assignment
6592 Database& operator=(Database&& other) = delete;
6593
6594public:
6598 Database(Database&& other) noexcept : self(other.self) { other.self = nullptr; }
6599
6610 UpdateInfo update_flags(uint16_t index, UpdateFlagsType flags_type, const Flags& flags, const Timestamp& time, const UpdateOptions& options);
6611
6623
6630 bool add_binary_input(uint16_t index, EventClass point_class, const BinaryInputConfig& config);
6631
6636 bool remove_binary_input(uint16_t index);
6637
6643 bool update_binary_input(const BinaryInput& value, const UpdateOptions& options);
6644
6651
6658
6665 bool add_double_bit_binary_input(uint16_t index, EventClass point_class, const DoubleBitBinaryInputConfig& config);
6666
6672
6679
6686
6693
6700 bool add_binary_output_status(uint16_t index, EventClass point_class, const BinaryOutputStatusConfig& config);
6701
6706 bool remove_binary_output_status(uint16_t index);
6707
6714
6721
6728
6735 bool add_counter(uint16_t index, EventClass point_class, const CounterConfig& config);
6736
6741 bool remove_counter(uint16_t index);
6742
6748 bool update_counter(const Counter& value, const UpdateOptions& options);
6749
6755 UpdateInfo update_counter_2(const Counter& value, const UpdateOptions& options);
6756
6762 Counter get_counter(uint16_t index);
6763
6770 bool add_frozen_counter(uint16_t index, EventClass point_class, const FrozenCounterConfig& config);
6771
6776 bool remove_frozen_counter(uint16_t index);
6777
6783 bool update_frozen_counter(const FrozenCounter& value, const UpdateOptions& options);
6784
6791
6798
6807 bool add_analog_input(uint16_t index, EventClass point_class, const AnalogInputConfig& config);
6808
6813 bool remove_analog_input(uint16_t index);
6814
6820 bool update_analog_input(const AnalogInput& value, const UpdateOptions& options);
6821
6828
6835
6844 bool add_analog_output_status(uint16_t index, EventClass point_class, const AnalogOutputStatusConfig& config);
6845
6850 bool remove_analog_output_status(uint16_t index);
6851
6858
6865
6872
6878 bool add_octet_string(uint16_t index, EventClass point_class);
6879
6884 bool remove_octet_string(uint16_t index);
6885
6892 bool update_octet_string(uint16_t index, const std::vector<uint8_t>& value, const UpdateOptions& options);
6893
6900 UpdateInfo update_octet_string_2(uint16_t index, const std::vector<uint8_t>& value, const UpdateOptions& options);
6901
6909 AttrDefError define_string_attr(uint8_t set, bool writable, uint8_t variation, const std::string& value);
6910
6918 AttrDefError define_int_attr(uint8_t set, bool writable, uint8_t variation, int32_t value);
6919
6927 AttrDefError define_uint_attr(uint8_t set, bool writable, uint8_t variation, uint32_t value);
6928
6936 AttrDefError define_time_attr(uint8_t set, bool writable, uint8_t variation, uint64_t value);
6937
6945 AttrDefError define_bool_attr(uint8_t set, bool writable, uint8_t variation, bool value);
6946
6954 AttrDefError define_float_attr(uint8_t set, bool writable, uint8_t variation, float value);
6955
6963 AttrDefError define_double_attr(uint8_t set, bool writable, uint8_t variation, double value);
6964};
6965
6970public:
6971 virtual ~DatabaseTransaction() = default;
6972
6976 virtual void execute(Database& database) = 0;
6977
6978};
6979
6980namespace functional {
6981
6984template <class T>
6986{
6987 static_assert(std::is_copy_constructible<T>::value, "Lambda expression must be copy constructible. Does it contain something that is move-only?");
6988
6989 T lambda;
6990
6991public:
6994 DatabaseTransactionLambda(const T& lambda) : lambda(lambda) {}
6995
6997 void execute(Database& database) override
6998 {
6999 lambda(database);
7000 }
7001};
7002
7007template <class T>
7009{
7010 return DatabaseTransactionLambda<T>(lambda);
7011}
7012
7013} // end namespace functional
7014
7015class DatabaseHandle;
7016
7021 friend class CppDatabaseHandleFriend;
7022 // pointer to the underlying C type
7023 void* self;
7024 // constructor only accessible internally
7025 DatabaseHandle(void* self): self(self) {}
7026 // non-copyable
7027 DatabaseHandle(const DatabaseHandle&) = delete;
7028 DatabaseHandle& operator=(const DatabaseHandle&) = delete;
7029 // no move assignment
7030 DatabaseHandle& operator=(DatabaseHandle&& other) = delete;
7031
7032public:
7036 DatabaseHandle(DatabaseHandle&& other) noexcept : self(other.self) { other.self = nullptr; }
7037
7042};
7043
7044struct EventBufferConfig;
7045
7050 friend class CppEventBufferConfigFriend;
7051
7052 EventBufferConfig() = delete;
7053
7065
7066
7081
7082
7084 uint16_t max_binary;
7090 uint16_t max_counter;
7094 uint16_t max_analog;
7099};
7100
7101struct ClassZeroConfig;
7102
7105 friend class CppClassZeroConfigFriend;
7106
7107private:
7119
7120public:
7121
7136
7137
7156};
7157
7158struct OutstationFeatures;
7159
7162 friend class CppOutstationFeaturesFriend;
7163
7164private:
7172
7173public:
7174
7185
7186
7197};
7198
7199struct OutstationConfig;
7200
7203 friend class CppOutstationConfigFriend;
7204
7205private:
7224 OutstationConfig(uint16_t outstation_address, uint16_t master_address, const EventBufferConfig& event_buffer_config, uint16_t solicited_buffer_size, uint16_t unsolicited_buffer_size, uint16_t rx_buffer_size, const DecodeLevel& decode_level, std::chrono::steady_clock::duration confirm_timeout, std::chrono::steady_clock::duration select_timeout, const OutstationFeatures& features, uint32_t max_unsolicited_retries, std::chrono::steady_clock::duration unsolicited_retry_delay, std::chrono::steady_clock::duration keep_alive_timeout, uint16_t max_read_request_headers, uint16_t max_controls_per_request, const ClassZeroConfig& class_zero);
7225
7226public:
7227 OutstationConfig() = delete;
7228
7251
7252
7274 std::chrono::steady_clock::duration confirm_timeout;
7276 std::chrono::steady_clock::duration select_timeout;
7282 std::chrono::steady_clock::duration unsolicited_retry_delay;
7286 std::chrono::steady_clock::duration keep_alive_timeout;
7301};
7302
7306 not_supported = 0,
7308 seconds = 1,
7310 milli_seconds = 2,
7311};
7312
7316const char* to_string(RestartDelayType value);
7317
7318struct RestartDelay;
7319
7324 friend class CppRestartDelayFriend;
7325
7326private:
7332
7333public:
7334 RestartDelay() = delete;
7335
7344
7345
7353 static RestartDelay seconds(uint16_t value);
7354
7355
7364
7365
7369 uint16_t value;
7370};
7371
7373enum class PointType {
7375 binary_input = 0,
7381 counter = 3,
7383 frozen_counter = 4,
7385 analog_input = 5,
7389 octet_string = 7,
7390};
7391
7395const char* to_string(PointType value);
7396
7400 ok = 0,
7402 parameter_error = 1,
7404 not_supported = 2,
7405};
7406
7410const char* to_string(WriteTimeResult value);
7411
7413enum class FreezeType {
7415 immediate_freeze = 0,
7417 freeze_and_clear = 1,
7418};
7419
7423const char* to_string(FreezeType value);
7424
7426enum class FreezeResult {
7428 ok = 0,
7430 parameter_error = 1,
7432 not_supported = 2,
7433};
7434
7438const char* to_string(FreezeResult value);
7439
7440struct ApplicationIin;
7441
7444 friend class CppApplicationIinFriend;
7445
7446private:
7454
7455public:
7456
7467
7468
7477};
7478
7479struct TypeCount;
7480
7483 friend class CppTypeCountFriend;
7484
7485private:
7497
7498public:
7499 TypeCount() = delete;
7500
7508 uint32_t num_counter;
7512 uint32_t num_analog;
7517};
7518
7519struct BufferState;
7520
7523 friend class CppBufferStateFriend;
7524
7525private:
7531
7532public:
7533 BufferState() = delete;
7534
7539};
7540
7545public:
7546 virtual ~OutstationApplication() = default;
7547
7555 virtual uint16_t get_processing_delay_ms() = 0;
7556
7561 virtual WriteTimeResult write_absolute_time(uint64_t time) = 0;
7562
7567
7574
7581
7589 virtual FreezeResult freeze_counters_all(FreezeType freeze_type, DatabaseHandle& database_handle) {
7591 }
7592
7603 virtual FreezeResult freeze_counters_all_at_time(DatabaseHandle& database_handle, uint64_t time, uint32_t interval) {
7605 }
7606
7616 virtual FreezeResult freeze_counters_range(uint16_t start, uint16_t stop, FreezeType freeze_type, DatabaseHandle& database_handle) {
7618 }
7619
7632 virtual FreezeResult freeze_counters_range_at_time(uint16_t start, uint16_t stop, DatabaseHandle& database_handle, uint64_t time, uint32_t interval) {
7634 }
7635
7652 return false;
7653 }
7654
7660
7673 virtual void write_analog_dead_band(uint16_t index, double dead_band) {};
7674
7682
7692 virtual bool support_assign_class() {
7693 return true;
7694 }
7695
7700 virtual void begin_assign_class() {};
7701
7710 virtual void assign_class_all(PointType point_type, EventClass point_class) {};
7711
7722 virtual void assign_class_range(PointType point_type, uint16_t start, uint16_t stop, EventClass point_class) {};
7723
7730 virtual void end_assign_class() {};
7731
7741 virtual bool write_string_attr(uint8_t set, uint8_t variation, StringAttr attr_type, const char* value) {
7742 return false;
7743 }
7744
7754 virtual bool write_float_attr(uint8_t set, uint8_t variation, FloatAttr attr_type, float value) {
7755 return false;
7756 }
7757
7767 virtual bool write_double_attr(uint8_t set, uint8_t variation, FloatAttr attr_type, double value) {
7768 return false;
7769 }
7770
7780 virtual bool write_uint_attr(uint8_t set, uint8_t variation, UintAttr attr_type, uint32_t value) {
7781 return false;
7782 }
7783
7793 virtual bool write_int_attr(uint8_t set, uint8_t variation, IntAttr attr_type, int32_t value) {
7794 return false;
7795 }
7796
7806 virtual bool write_octet_string_attr(uint8_t set, uint8_t variation, OctetStringAttr attr_type, ByteIterator& value) {
7807 return false;
7808 }
7809
7819 virtual bool write_bit_string_attr(uint8_t set, uint8_t variation, BitStringAttr attr_type, ByteIterator& value) {
7820 return false;
7821 }
7822
7832 virtual bool write_time_attr(uint8_t set, uint8_t variation, TimeAttr attr_type, uint64_t value) {
7833 return false;
7834 }
7835
7840 virtual void begin_confirm() {};
7841
7847 virtual void event_cleared(uint64_t id) {};
7848
7854 virtual void end_confirm(const BufferState& state) {};
7855
7856};
7857
7858struct RequestHeader;
7859
7862 friend class CppRequestHeaderFriend;
7863
7864private:
7870
7871public:
7872 RequestHeader() = delete;
7873
7878};
7879
7883 processed = 0,
7890};
7891
7895const char* to_string(BroadcastAction value);
7896
7903public:
7904 virtual ~OutstationInformation() = default;
7905
7910
7915 virtual void broadcast_received(FunctionCode function_code, BroadcastAction action) = 0;
7916
7920 virtual void enter_solicited_confirm_wait(uint8_t ecsn) = 0;
7921
7925 virtual void solicited_confirm_timeout(uint8_t ecsn) = 0;
7926
7930 virtual void solicited_confirm_received(uint8_t ecsn) = 0;
7931
7935
7940 virtual void wrong_solicited_confirm_seq(uint8_t ecsn, uint8_t seq) = 0;
7941
7946 virtual void unexpected_confirm(bool unsolicited, uint8_t seq) = 0;
7947
7951 virtual void enter_unsolicited_confirm_wait(uint8_t ecsn) = 0;
7952
7957 virtual void unsolicited_confirm_timeout(uint8_t ecsn, bool retry) = 0;
7958
7962 virtual void unsolicited_confirmed(uint8_t ecsn) = 0;
7963
7966 virtual void clear_restart_iin() = 0;
7967
7968};
7969
7971enum class OperateType {
7975 direct_operate = 1,
7978};
7979
7983const char* to_string(OperateType value);
7984
7993public:
7994 virtual ~ControlHandler() = default;
7995
7998 virtual void begin_fragment() = 0;
7999
8003 virtual void end_fragment(DatabaseHandle& database) = 0;
8004
8015 virtual CommandStatus select_g12v1(const Group12Var1& value, uint16_t index, DatabaseHandle& database_handle) = 0;
8016
8024 virtual CommandStatus operate_g12v1(const Group12Var1& value, uint16_t index, OperateType op_type, DatabaseHandle& database_handle) = 0;
8025
8036 virtual CommandStatus select_g41v1(int32_t value, uint16_t index, DatabaseHandle& database_handle) = 0;
8037
8045 virtual CommandStatus operate_g41v1(int32_t value, uint16_t index, OperateType op_type, DatabaseHandle& database_handle) = 0;
8046
8057 virtual CommandStatus select_g41v2(int16_t value, uint16_t index, DatabaseHandle& database_handle) = 0;
8058
8066 virtual CommandStatus operate_g41v2(int16_t value, uint16_t index, OperateType op_type, DatabaseHandle& database_handle) = 0;
8067
8078 virtual CommandStatus select_g41v3(float value, uint16_t index, DatabaseHandle& database_handle) = 0;
8079
8087 virtual CommandStatus operate_g41v3(float value, uint16_t index, OperateType op_type, DatabaseHandle& database_handle) = 0;
8088
8099 virtual CommandStatus select_g41v4(double value, uint16_t index, DatabaseHandle& database_handle) = 0;
8100
8108 virtual CommandStatus operate_g41v4(double value, uint16_t index, OperateType op_type, DatabaseHandle& database_handle) = 0;
8109
8110};
8111
8115 connected = 0,
8117 disconnected = 1,
8118};
8119
8123const char* to_string(ConnectionState value);
8124
8129public:
8130 virtual ~ConnectionStateListener() = default;
8131
8135 virtual void on_change(ConnectionState state) = 0;
8136
8137};
8138
8139namespace functional {
8140
8143template <class T>
8145{
8146 static_assert(std::is_copy_constructible<T>::value, "Lambda expression must be copy constructible. Does it contain something that is move-only?");
8147
8148 T lambda;
8149
8150public:
8153 ConnectionStateListenerLambda(const T& lambda) : lambda(lambda) {}
8154
8156 void on_change(ConnectionState state) override
8157 {
8158 lambda(state);
8159 }
8160};
8161
8166template <class T>
8167std::unique_ptr<ConnectionStateListener> connection_state_listener(const T& lambda)
8168{
8169 return std::make_unique<ConnectionStateListenerLambda<T>>(lambda); ;
8170}
8171
8172} // end namespace functional
8173
8174class ConnectionInfo;
8175
8184 friend class CppConnectionInfoFriend;
8185 // pointer to the underlying C type
8186 void* self;
8187 // constructor only accessible internally
8188 ConnectionInfo(void* self): self(self) {}
8189 // non-copyable
8190 ConnectionInfo(const ConnectionInfo&) = delete;
8191 ConnectionInfo& operator=(const ConnectionInfo&) = delete;
8192 // no move assignment
8193 ConnectionInfo& operator=(ConnectionInfo&& other) = delete;
8194
8195public:
8199 ConnectionInfo(ConnectionInfo&& other) noexcept : self(other.self) { other.self = nullptr; }
8200
8204
8207
8214 ParamError set_endpoint(const std::string& endpoint);
8215
8221 void set_timeout(std::chrono::steady_clock::duration timeout_ms);
8222
8226
8237 ParamError set_local_endpoint(const std::string& local_endpoint);
8238
8242
8254};
8255
8256class NextEndpointAction;
8257
8260 friend class CppNextEndpointActionFriend;
8261 // pointer to the underlying C type
8262 void* self;
8263 // constructor only accessible internally
8264 NextEndpointAction(void* self): self(self) {}
8265 // non-copyable
8266 NextEndpointAction(const NextEndpointAction&) = delete;
8267 NextEndpointAction& operator=(const NextEndpointAction&) = delete;
8268 // no move assignment
8269 NextEndpointAction& operator=(NextEndpointAction&& other) = delete;
8270
8271public:
8275 NextEndpointAction(NextEndpointAction&& other) noexcept : self(other.self) { other.self = nullptr; }
8276
8282
8287 ParamError sleep_for(std::chrono::steady_clock::duration duration);
8288};
8289
8294public:
8295 virtual ~ClientConnectionHandler() = default;
8296
8302 virtual std::chrono::steady_clock::duration disconnected(const char* addr, const char* hostname) = 0;
8303
8308 virtual void connecting(const char* addr, const char* hostname) = 0;
8309
8314 virtual void connect_failed(const char* addr, const char* hostname) = 0;
8315
8320 virtual void connected(const char* addr, const char* hostname) = 0;
8321
8325 virtual void resolution_failed(const char* hostname) = 0;
8326
8330 virtual void next(NextEndpointAction& action) = 0;
8331
8332};
8333
8334class Outstation;
8335
8336struct OutstationUdpConfig;
8337
8340 friend class CppOutstationUdpConfigFriend;
8341
8342private:
8350 OutstationUdpConfig(const std::string& local_endpoint, const std::string& remote_endpoint, UdpSocketMode socket_mode, LinkReadMode link_read_mode, std::chrono::steady_clock::duration retry_delay);
8351
8352public:
8353 OutstationUdpConfig() = delete;
8354
8365 OutstationUdpConfig(const std::string& local_endpoint, const std::string& remote_endpoint);
8366
8367
8369 std::string local_endpoint;
8371 std::string remote_endpoint;
8377 std::chrono::steady_clock::duration retry_delay;
8378};
8379
8384 friend class CppOutstationFriend;
8385 // pointer to the underlying C type
8386 void* self;
8387 // constructor only accessible internally
8388 Outstation(void* self): self(self) {}
8389 // non-copyable
8390 Outstation(const Outstation&) = delete;
8391 Outstation& operator=(const Outstation&) = delete;
8392 // no move assignment
8393 Outstation& operator=(Outstation&& other) = delete;
8394
8395public:
8399 Outstation(Outstation&& other) noexcept : self(other.self) { other.self = nullptr; }
8400
8405
8409 void enable();
8410
8414 void disable();
8415
8420
8425 void set_decode_level(const DecodeLevel& level);
8426
8442 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);
8443
8456 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);
8457
8471 static Outstation create_serial_session_2(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, std::unique_ptr<PortStateListener> port_listener);
8472
8487 static Outstation create_tcp_client(Runtime& runtime, LinkErrorMode link_error_mode, EndpointList& endpoints, const ConnectStrategy& connect_strategy, ConnectOptions& connect_options, const OutstationConfig& config, std::unique_ptr<OutstationApplication> application, std::unique_ptr<OutstationInformation> information, std::unique_ptr<ControlHandler> control_handler, std::unique_ptr<ClientStateListener> listener);
8488
8504 static Outstation create_tcp_client_with_handler(Runtime& runtime, LinkErrorMode link_error_mode, const std::string& span_name, const OutstationConfig& config, std::unique_ptr<OutstationApplication> application, std::unique_ptr<OutstationInformation> information, std::unique_ptr<ControlHandler> control_handler, std::unique_ptr<ClientStateListener> listener, std::unique_ptr<ClientConnectionHandler> connection_handler);
8505
8521 static Outstation create_tls_client(Runtime& runtime, LinkErrorMode link_error_mode, EndpointList& endpoints, const ConnectStrategy& connect_strategy, ConnectOptions& connect_options, const OutstationConfig& config, std::unique_ptr<OutstationApplication> application, std::unique_ptr<OutstationInformation> information, std::unique_ptr<ControlHandler> control_handler, std::unique_ptr<ClientStateListener> listener, const TlsClientConfig& tls_config);
8522
8539 static Outstation create_tls_client_with_handler(Runtime& runtime, LinkErrorMode link_error_mode, const std::string& span_name, const OutstationConfig& config, std::unique_ptr<OutstationApplication> application, std::unique_ptr<OutstationInformation> information, std::unique_ptr<ControlHandler> control_handler, std::unique_ptr<ClientStateListener> listener, std::unique_ptr<ClientConnectionHandler> connection_handler, const TlsClientConfig& tls_config);
8540
8553 static Outstation create_udp(Runtime& runtime, const OutstationUdpConfig& udp_config, const OutstationConfig& config, std::unique_ptr<OutstationApplication> application, std::unique_ptr<OutstationInformation> information, std::unique_ptr<ControlHandler> control_handler);
8554};
8555
8556class AddressFilter;
8557
8562 friend class CppAddressFilterFriend;
8563 // pointer to the underlying C type
8564 void* self;
8565 // constructor only accessible internally
8566 AddressFilter(void* self): self(self) {}
8567 // non-copyable
8568 AddressFilter(const AddressFilter&) = delete;
8569 AddressFilter& operator=(const AddressFilter&) = delete;
8570 // no move assignment
8571 AddressFilter& operator=(AddressFilter&& other) = delete;
8572
8573public:
8577 AddressFilter(AddressFilter&& other) noexcept : self(other.self) { other.self = nullptr; }
8578
8587 AddressFilter(const std::string& address);
8588
8591
8596 void add(const std::string& address);
8597
8602};
8603
8604struct TlsServerConfig;
8605
8608 friend class CppTlsServerConfigFriend;
8609
8610private:
8621 TlsServerConfig(const std::string& dns_name, const std::string& peer_cert_path, const std::string& local_cert_path, const std::string& private_key_path, const std::string& password, MinTlsVersion min_tls_version, CertificateMode certificate_mode, bool allow_client_name_wildcard);
8622
8623public:
8624 TlsServerConfig() = delete;
8625
8639 TlsServerConfig(const std::string& dns_name, const std::string& peer_cert_path, const std::string& local_cert_path, const std::string& private_key_path, const std::string& password);
8640
8641
8645 std::string dns_name;
8647 std::string peer_cert_path;
8649 std::string local_cert_path;
8651 std::string private_key_path;
8657 std::string password;
8664};
8665
8666class OutstationServer;
8667
8674 friend class CppOutstationServerFriend;
8675 // pointer to the underlying C type
8676 void* self;
8677 // constructor only accessible internally
8678 OutstationServer(void* self): self(self) {}
8679 // non-copyable
8680 OutstationServer(const OutstationServer&) = delete;
8681 OutstationServer& operator=(const OutstationServer&) = delete;
8682 // no move assignment
8683 OutstationServer& operator=(OutstationServer&& other) = delete;
8684
8685public:
8689 OutstationServer(OutstationServer&& other) noexcept : self(other.self) { other.self = nullptr; }
8690
8693
8708 Outstation add_outstation(const OutstationConfig& config, std::unique_ptr<OutstationApplication> application, std::unique_ptr<OutstationInformation> information, std::unique_ptr<ControlHandler> control_handler, std::unique_ptr<ConnectionStateListener> listener, AddressFilter& filter);
8709
8715 void bind();
8716
8726 static OutstationServer create_tcp_server(Runtime& runtime, LinkErrorMode link_error_mode, const std::string& address);
8727
8738 static OutstationServer create_tls_server(Runtime& runtime, LinkErrorMode link_error_mode, const std::string& address, const TlsServerConfig& tls_config);
8739};
8740
8741} // end namespace dnp3
Class used to accept a connection, reject it, or defer it to link identification.
Definition: dnp3.hpp:5749
AcceptHandler(AcceptHandler &&other) noexcept
Transfer ownership of the underlying C-type to this instance and invalidate the other instance.
Definition: dnp3.hpp:5765
ParamError accept(LinkErrorMode error_mode, const MasterChannelConfig &config)
Accept the connection and create a master channel.
ParamError get_link_identity()
Request that server attempt to identify the outstation by reading a link-layer header from the physic...
Filters connecting client by their IP address to associate a connecting master with an outstation on ...
Definition: dnp3.hpp:8561
static AddressFilter any()
Create an address filter that accepts any IP address.
AddressFilter(const std::string &address)
Create an address filter that matches a specific address or wildcards.
AddressFilter(AddressFilter &&other) noexcept
Transfer ownership of the underlying C-type to this instance and invalidate the other instance.
Definition: dnp3.hpp:8577
~AddressFilter()
Destroy an address filter.
void add(const std::string &address)
Add an accepted IP address to the filter.
Iterator over AnalogInputDeadBand instances.
Definition: dnp3.hpp:1548
AnalogInputDeadBand get()
retrieve the current value
AnalogInputDeadBandIterator(AnalogInputDeadBandIterator &&)=default
move constructor for the iterator
bool next()
move the iterator to the next value
Iterator over AnalogInput instances.
Definition: dnp3.hpp:1092
AnalogInputIterator(AnalogInputIterator &&)=default
move constructor for the iterator
AnalogInput get()
retrieve the current value
bool next()
move the iterator to the next value
Iterator over AnalogOutputCommandEvent instances.
Definition: dnp3.hpp:1412
AnalogOutputCommandEventIterator(AnalogOutputCommandEventIterator &&)=default
move constructor for the iterator
AnalogOutputCommandEvent get()
retrieve the current value
bool next()
move the iterator to the next value
Iterator over AnalogOutputStatus instances.
Definition: dnp3.hpp:1236
AnalogOutputStatus get()
retrieve the current value
bool next()
move the iterator to the next value
AnalogOutputStatusIterator(AnalogOutputStatusIterator &&)=default
move constructor for the iterator
Global application layer configuration settings.
Definition: dnp3.hpp:64
static void parse_zero_length_strings(bool enabled)
Enable or disable the parsing of zero-length strings, e.g., Group 110/111 Variation 0.
Callbacks for a particular outstation association.
Definition: dnp3.hpp:4406
virtual UtcTimestamp get_current_time()=0
Returns the current time or an invalid time if none is available.
Informational callbacks about the current state of an outstation association.
Definition: dnp3.hpp:4541
virtual void task_success(TaskType task_type, FunctionCode function_code, uint8_t seq)=0
Called when a task successfully completes.
virtual void task_start(TaskType task_type, FunctionCode function_code, uint8_t seq)=0
Called when a new task is started.
virtual void unsolicited_response(bool is_duplicate, uint8_t seq)=0
Called when an unsolicited response is received.
virtual void task_fail(TaskType task_type, TaskError error)=0
Called when a task fails.
Iterator over AttrItem instances.
Definition: dnp3.hpp:2298
AttrItem get()
retrieve the current value
AttrItemIter(AttrItemIter &&)=default
move constructor for the iterator
bool next()
move the iterator to the next value
Iterator over BinaryInput instances.
Definition: dnp3.hpp:732
bool next()
move the iterator to the next value
BinaryInput get()
retrieve the current value
BinaryInputIterator(BinaryInputIterator &&)=default
move constructor for the iterator
Iterator over BinaryOutputCommandEvent instances.
Definition: dnp3.hpp:1314
bool next()
move the iterator to the next value
BinaryOutputCommandEvent get()
retrieve the current value
BinaryOutputCommandEventIterator(BinaryOutputCommandEventIterator &&)=default
move constructor for the iterator
Iterator over BinaryOutputStatus instances.
Definition: dnp3.hpp:876
bool next()
move the iterator to the next value
BinaryOutputStatus get()
retrieve the current value
BinaryOutputStatusIterator(BinaryOutputStatusIterator &&)=default
move constructor for the iterator
Iterator over uint8_t instances.
Definition: dnp3.hpp:1593
ByteIterator(ByteIterator &&)=default
move constructor for the iterator
uint8_t get()
retrieve the current value
bool next()
move the iterator to the next value
Provides fine-grained control over how TCP and TLS clients connect to endpoints.
Definition: dnp3.hpp:8293
virtual void connecting(const char *addr, const char *hostname)=0
Notification that a connection attempt is being made.
virtual void resolution_failed(const char *hostname)=0
Notification that DNS resolution failed.
virtual void next(NextEndpointAction &action)=0
Called to get the next endpoint to connect to or to sleep for a duration. Use the provided action obj...
virtual void connected(const char *addr, const char *hostname)=0
Notification that a connection attempt succeeded.
virtual std::chrono::steady_clock::duration disconnected(const char *addr, const char *hostname)=0
Notification that a previously successful connection failed. The task will sleep for the specified du...
virtual void connect_failed(const char *addr, const char *hostname)=0
Notification that connection operation failed.
Callback for monitoring the client TCP connection state.
Definition: dnp3.hpp:2434
virtual void on_change(ClientState state)=0
Called when the client state changed.
Exception type corresponding to the underlying error enum CommandError.
Definition: dnp3.hpp:4927
CommandException(CommandError error)
construct the exception with an instance of the enum
Definition: dnp3.hpp:4932
CommandError error
underlying error enum
Definition: dnp3.hpp:4930
Builder type used to construct command requests.
Definition: dnp3.hpp:4786
~CommandSet()
Destroy a set of commands.
void add_g41_v1_u16(uint16_t idx, int32_t value)
Add a Analog Output command (signed 32-bit integer) with 2-byte prefix index.
void add_g12_v1_u16(uint16_t idx, const Group12Var1 &header)
Add a CROB with 2-byte prefix index.
void add_g41_v3_u8(uint8_t idx, float value)
Add a Analog Output command (single-precision float) with 1-byte prefix index.
CommandSet(CommandSet &&other) noexcept
Transfer ownership of the underlying C-type to this instance and invalidate the other instance.
Definition: dnp3.hpp:4802
void add_g41_v4_u16(uint16_t idx, double value)
Add a Analog Output command (double-precision float) with 2-byte prefix index.
void add_g12_v1_u8(uint8_t idx, const Group12Var1 &header)
Add a CROB with 1-byte prefix index.
CommandSet()
Create a new set of commands.
void add_g41_v1_u8(uint8_t idx, int32_t value)
Add a Analog Output command (signed 32-bit integer) with 1-byte prefix index.
void add_g41_v3_u16(uint16_t idx, float value)
Add a Analog Output command (single-precision float) with 2-byte prefix index.
void add_g41_v2_u8(uint8_t idx, int16_t value)
Add a Analog Output command (signed 16-bit integer) with 1-byte prefix index.
void finish_header()
Finish any partially completed header. This allows for the construction of two headers with the same ...
void add_g41_v4_u8(uint8_t idx, double value)
Add a Analog Output command (double-precision float) with 1-byte prefix index.
void add_g41_v2_u16(uint16_t idx, int16_t value)
Add a Analog Output command (signed 16-bit integer) with 2-byte prefix index.
Handler for command tasks.
Definition: dnp3.hpp:4938
virtual void on_failure(CommandError error)=0
Invoked when the asynchronous operation fails.
virtual void on_complete(Nothing result)=0
Invoked when the asynchronous operation completes successfully.
Options that control how TCP connections are established.
Definition: dnp3.hpp:1694
void set_timeout(std::chrono::steady_clock::duration timeout)
Set a timeout for the TCP connection that might be less than the default for the OS.
void set_local_endpoint(const std::string &endpoint)
Set the local address to which the socket is bound.
ConnectOptions(ConnectOptions &&other) noexcept
Transfer ownership of the underlying C-type to this instance and invalidate the other instance.
Definition: dnp3.hpp:1710
~ConnectOptions()
Destroy an instance.
ConnectOptions()
Initialize to the defaults.
Callbacks to user code that determine how the server processes connections.
Definition: dnp3.hpp:5814
virtual void start(const char *remote_addr, MasterChannel &channel)=0
Start a communication session that was previously accepted using only the socket address.
virtual void accept(const char *remote_addr, AcceptHandler &acceptor)=0
Filter the connection solely based on the remote address.
virtual void accept_with_link_id(const char *remote_addr, uint16_t source, uint16_t destination, IdentifiedLinkHandler &acceptor)=0
Filter the connection based on the source and destination of the first link-layer frame.
virtual void start_with_link_id(const char *remote_addr, uint16_t source, uint16_t destination, MasterChannel &channel)=0
Start a communication session that was previously accepted using link identity information.
Builder for configuring connection parameters.
Definition: dnp3.hpp:8183
~ConnectionInfo()
Destroy a ConnectionInfo instance.
ParamError set_endpoint(const std::string &endpoint)
Set the endpoint to connect to.
ParamError set_local_endpoint(const std::string &local_endpoint)
Set the local endpoint to bind to.
ConnectionInfo()
Create a new ConnectionInfo. You must call set_endpoint() before using it.
void set_timeout(std::chrono::steady_clock::duration timeout_ms)
Set the connection timeout.
void clear_timeout()
Clear any previously configured timeout so the OS default is used.
ConnectionInfo(ConnectionInfo &&other) noexcept
Transfer ownership of the underlying C-type to this instance and invalidate the other instance.
Definition: dnp3.hpp:8199
ParamError set_master_address(uint16_t address)
Change the master address for this and all subsequent connections.
void clear_local_endpoint()
Clear any previously configured local endpoint so the OS chooses the interface and port.
Callback interface for connection state events.
Definition: dnp3.hpp:8128
virtual void on_change(ConnectionState state)=0
Called when the connection state changes.
Callbacks for handling controls.
Definition: dnp3.hpp:7992
virtual CommandStatus select_g41v4(double value, uint16_t index, DatabaseHandle &database_handle)=0
Select an analog output, but do not operate.
virtual void end_fragment(DatabaseHandle &database)=0
Notifies the end of a command fragment.
virtual CommandStatus operate_g41v1(int32_t value, uint16_t index, OperateType op_type, DatabaseHandle &database_handle)=0
Operate a control point.
virtual CommandStatus operate_g12v1(const Group12Var1 &value, uint16_t index, OperateType op_type, DatabaseHandle &database_handle)=0
Operate a control point.
virtual CommandStatus operate_g41v2(int16_t value, uint16_t index, OperateType op_type, DatabaseHandle &database_handle)=0
Operate a control point.
virtual CommandStatus select_g41v2(int16_t value, uint16_t index, DatabaseHandle &database_handle)=0
Select an analog output, but do not operate.
virtual CommandStatus select_g41v3(float value, uint16_t index, DatabaseHandle &database_handle)=0
Select an analog output, but do not operate.
virtual CommandStatus operate_g41v3(float value, uint16_t index, OperateType op_type, DatabaseHandle &database_handle)=0
Operate a control point.
virtual CommandStatus operate_g41v4(double value, uint16_t index, OperateType op_type, DatabaseHandle &database_handle)=0
Operate a control point.
virtual CommandStatus select_g12v1(const Group12Var1 &value, uint16_t index, DatabaseHandle &database_handle)=0
Select a CROB, but do not operate.
virtual void begin_fragment()=0
Notifies the start of a command fragment.
virtual CommandStatus select_g41v1(int32_t value, uint16_t index, DatabaseHandle &database_handle)=0
Select an analog output, but do not operate.
Iterator over Counter instances.
Definition: dnp3.hpp:948
CounterIterator(CounterIterator &&)=default
move constructor for the iterator
Counter get()
retrieve the current value
bool next()
move the iterator to the next value
Handle typed used to perform transactions on the database inside of control and freeze callbacks.
Definition: dnp3.hpp:7020
void transaction(DatabaseTransaction &callback)
Acquire a mutex on the underlying database and apply a set of changes as a transaction.
DatabaseHandle(DatabaseHandle &&other) noexcept
Transfer ownership of the underlying C-type to this instance and invalidate the other instance.
Definition: dnp3.hpp:7036
Database transaction interface.
Definition: dnp3.hpp:6969
virtual void execute(Database &database)=0
Execute a transaction on the provided database.
Internal database access.
Definition: dnp3.hpp:6582
bool remove_frozen_counter(uint16_t index)
Remove a Frozen Counter point.
bool add_analog_output_status(uint16_t index, EventClass point_class, const AnalogOutputStatusConfig &config)
Add a new Analog Output Status point.
Counter get_counter(uint16_t index)
Get a Counter point.
UpdateInfo update_binary_input_2(const BinaryInput &value, const UpdateOptions &options)
Update a BinaryInput point.
bool remove_binary_output_status(uint16_t index)
Remove a Binary Output Status point.
AttrDefError define_time_attr(uint8_t set, bool writable, uint8_t variation, uint64_t value)
Define a DNP3 time attribute.
UpdateInfo update_frozen_counter_2(const FrozenCounter &value, const UpdateOptions &options)
Update an Frozen Counter point.
BinaryOutputStatus get_binary_output_status(uint16_t index)
Get a Binary Output Status point.
DoubleBitBinaryInput get_double_bit_binary_input(uint16_t index)
Get a Double-Bit Binary Input point.
UpdateInfo update_analog_output_status_2(const AnalogOutputStatus &value, const UpdateOptions &options)
Update a Analog Output Status point.
bool update_binary_output_status(const BinaryOutputStatus &value, const UpdateOptions &options)
Update a Binary Output Status point.
AttrDefError define_bool_attr(uint8_t set, bool writable, uint8_t variation, bool value)
Define a boolean attribute which is mapped to an unsigned integer internally.
bool remove_octet_string(uint16_t index)
Remove an Octet String point.
bool update_double_bit_binary_input(const DoubleBitBinaryInput &value, const UpdateOptions &options)
Update a Double-Bit Binary Input point.
bool update_frozen_counter(const FrozenCounter &value, const UpdateOptions &options)
Update an Frozen Counter point.
bool add_double_bit_binary_input(uint16_t index, EventClass point_class, const DoubleBitBinaryInputConfig &config)
Add a new Double-Bit Binary Input point.
UpdateInfo update_counter_2(const Counter &value, const UpdateOptions &options)
Update a Counter point.
AttrDefError define_int_attr(uint8_t set, bool writable, uint8_t variation, int32_t value)
Define a signed integer attribute.
AttrDefError define_string_attr(uint8_t set, bool writable, uint8_t variation, const std::string &value)
Define a string attribute.
bool update_analog_input(const AnalogInput &value, const UpdateOptions &options)
Update a AnalogInput point.
bool add_analog_input(uint16_t index, EventClass point_class, const AnalogInputConfig &config)
Add a new AnalogInput point.
bool add_binary_input(uint16_t index, EventClass point_class, const BinaryInputConfig &config)
Add a new BinaryInput point.
bool add_counter(uint16_t index, EventClass point_class, const CounterConfig &config)
Add a new Counter point.
UpdateInfo update_analog_input_2(const AnalogInput &value, const UpdateOptions &options)
Update a AnalogInput point.
bool add_binary_output_status(uint16_t index, EventClass point_class, const BinaryOutputStatusConfig &config)
Add a new Binary Output Status point.
bool update_binary_input(const BinaryInput &value, const UpdateOptions &options)
Update a BinaryInput point.
bool remove_analog_input(uint16_t index)
Remove an AnalogInput point.
AttrDefError define_double_attr(uint8_t set, bool writable, uint8_t variation, double value)
Define a 64-bit floating point attribute.
AttrDefError define_float_attr(uint8_t set, bool writable, uint8_t variation, float value)
Define a 32-bit floating point attribute.
UpdateInfo update_flags(uint16_t index, UpdateFlagsType flags_type, const Flags &flags, const Timestamp &time, const UpdateOptions &options)
Update the flags for the specified point without changing the value.
UpdateInfo update_binary_output_status_2(const BinaryOutputStatus &value, const UpdateOptions &options)
Update a Binary Output Status point.
bool add_octet_string(uint16_t index, EventClass point_class)
Add a new Octet String point.
UpdateInfo update_octet_string_2(uint16_t index, const std::vector< uint8_t > &value, const UpdateOptions &options)
Update an Octet String point.
AnalogOutputStatus get_analog_output_status(uint16_t index)
Get a Analog Output Status point.
FrozenCounter get_frozen_counter(uint16_t index)
Get a Frozen Counter point.
bool update_counter(const Counter &value, const UpdateOptions &options)
Update a Counter point.
bool remove_counter(uint16_t index)
Remove a Counter point.
Database(Database &&other) noexcept
Transfer ownership of the underlying C-type to this instance and invalidate the other instance.
Definition: dnp3.hpp:6598
bool update_octet_string(uint16_t index, const std::vector< uint8_t > &value, const UpdateOptions &options)
Update an Octet String point.
bool remove_double_bit_binary_input(uint16_t index)
Remove a Double-Bit Binary Input point.
UpdateInfo update_double_bit_binary_input_2(const DoubleBitBinaryInput &value, const UpdateOptions &options)
Update a Double-Bit Binary Input point.
ClassCount discard_unselected_events(const EventClasses &classes)
Discard undelivered events of the given classes from the event buffer.
AttrDefError define_uint_attr(uint8_t set, bool writable, uint8_t variation, uint32_t value)
Define an unsigned integer attribute.
BinaryInput get_binary_input(uint16_t index)
Get a BinaryInput point.
AnalogInput get_analog_input(uint16_t index)
Get a AnalogInput point.
bool update_analog_output_status(const AnalogOutputStatus &value, const UpdateOptions &options)
Update a Analog Output Status point.
bool remove_analog_output_status(uint16_t index)
Remove an Analog Output Status point.
bool remove_binary_input(uint16_t index)
Remove a BinaryInput point.
bool add_frozen_counter(uint16_t index, EventClass point_class, const FrozenCounterConfig &config)
Add a new Frozen Counter point.
Iterator over DoubleBitBinaryInput instances.
Definition: dnp3.hpp:804
DoubleBitBinaryInput get()
retrieve the current value
bool next()
move the iterator to the next value
DoubleBitBinaryInputIterator(DoubleBitBinaryInputIterator &&)=default
move constructor for the iterator
Callback interface for any task that expects an empty response.
Definition: dnp3.hpp:4164
virtual void on_failure(EmptyResponseError error)=0
Invoked when the asynchronous operation fails.
virtual void on_complete(Nothing result)=0
Invoked when the asynchronous operation completes successfully.
Exception type corresponding to the underlying error enum EmptyResponseError.
Definition: dnp3.hpp:4153
EmptyResponseException(EmptyResponseError error)
construct the exception with an instance of the enum
Definition: dnp3.hpp:4158
EmptyResponseError error
underlying error enum
Definition: dnp3.hpp:4156
List of IP endpoints.
Definition: dnp3.hpp:1738
EndpointList(EndpointList &&other) noexcept
Transfer ownership of the underlying C-type to this instance and invalidate the other instance.
Definition: dnp3.hpp:1754
~EndpointList()
Destroy a previously allocated endpoint list.
void add(const std::string &endpoint)
Add an IP endpoint to the list.
EndpointList(const std::string &main_endpoint)
Create a new list of IP endpoints.
Callback interface used when obtaining an authentication key.
Definition: dnp3.hpp:3318
virtual void on_complete(uint32_t result)=0
Invoked when the asynchronous operation completes successfully.
virtual void on_failure(FileError error)=0
Invoked when the asynchronous operation fails.
Exception type corresponding to the underlying error enum FileError.
Definition: dnp3.hpp:3232
FileException(FileError error)
construct the exception with an instance of the enum
Definition: dnp3.hpp:3237
FileError error
underlying error enum
Definition: dnp3.hpp:3235
Callback interface for retrieving file info asynchronously.
Definition: dnp3.hpp:5106
virtual void on_failure(FileError error)=0
Invoked when the asynchronous operation fails.
virtual void on_complete(const FileInfo &result)=0
Invoked when the asynchronous operation completes successfully.
Iterator over FileInfo instances.
Definition: dnp3.hpp:5236
FileInfo get()
retrieve the current value
FileInfoIterator(FileInfoIterator &&)=default
move constructor for the iterator
bool next()
move the iterator to the next value
Callback interface used when opening a file.
Definition: dnp3.hpp:3280
virtual void on_complete(const OpenFile &result)=0
Invoked when the asynchronous operation completes successfully.
virtual void on_failure(FileError error)=0
Invoked when the asynchronous operation fails.
Callback interface used when closing a file or writing a block of file data.
Definition: dnp3.hpp:3299
virtual void on_complete(Nothing result)=0
Invoked when the asynchronous operation completes successfully.
virtual void on_failure(FileError error)=0
Invoked when the asynchronous operation fails.
Callbacks for reading a file from the outstation asynchronously.
Definition: dnp3.hpp:5127
virtual bool opened(uint32_t size)=0
Called when the file is successfully opened.
virtual bool block_received(uint32_t block_num, ByteIterator &data)=0
Called when the next block is received.
virtual void completed()=0
Called when the transfer completes successfully.
virtual void aborted(FileError error)=0
Called when the transfer is aborted before completion due to an error or user request.
Iterator over FrozenAnalogInput instances.
Definition: dnp3.hpp:1164
FrozenAnalogInput get()
retrieve the current value
FrozenAnalogInputIterator(FrozenAnalogInputIterator &&)=default
move constructor for the iterator
bool next()
move the iterator to the next value
Iterator over FrozenCounter instances.
Definition: dnp3.hpp:1020
FrozenCounter get()
retrieve the current value
bool next()
move the iterator to the next value
FrozenCounterIterator(FrozenCounterIterator &&)=default
move constructor for the iterator
Class used to accept a connection, reject it, or defer it to link identification.
Definition: dnp3.hpp:5785
ParamError accept(LinkErrorMode error_mode, const MasterChannelConfig &config)
Accept the connection and create a master channel.
IdentifiedLinkHandler(IdentifiedLinkHandler &&other) noexcept
Transfer ownership of the underlying C-type to this instance and invalidate the other instance.
Definition: dnp3.hpp:5801
Handler for link status check.
Definition: dnp3.hpp:5334
virtual void on_complete(Nothing result)=0
Invoked when the asynchronous operation completes successfully.
virtual void on_failure(LinkStatusError error)=0
Invoked when the asynchronous operation fails.
Exception type corresponding to the underlying error enum LinkStatusError.
Definition: dnp3.hpp:5323
LinkStatusError error
underlying error enum
Definition: dnp3.hpp:5326
LinkStatusException(LinkStatusError error)
construct the exception with an instance of the enum
Definition: dnp3.hpp:5328
Logging interface that receives the log messages and writes them somewhere.
Definition: dnp3.hpp:3474
virtual void on_message(LogLevel level, const char *message)=0
Called when a log message was received and should be logged.
Provides a static method for configuring logging.
Definition: dnp3.hpp:3522
static void configure(const LoggingConfig &config, std::unique_ptr< Logger > logger)
Set the callback that will receive all the log messages.
Represents a communication channel for a master station.
Definition: dnp3.hpp:5355
void get_file_info(const AssociationId &association, const std::string &file_name, std::unique_ptr< FileInfoCallback > callback)
Asynchronously retrieve information on a particular file.
void read_file_with_auth(const AssociationId &association, const std::string &remote_file_path, const FileReadConfig &config, std::unique_ptr< FileReader > reader, const std::string &user_name, const std::string &password)
Start an operation to READ a file from the outstation using a FileReader to receive data.
void read_file(const AssociationId &association, const std::string &remote_file_path, const FileReadConfig &config, std::unique_ptr< FileReader > reader)
Start an operation to READ a file from the outstation using a FileReader to receive data.
void read(const AssociationId &association, Request &request, std::unique_ptr< ReadTaskCallback > callback)
Perform a read on the association.
void warm_restart(const AssociationId &association, std::unique_ptr< RestartTaskCallback > callback)
Asynchronously perform a warm restart operation to the association.
void cold_restart(const AssociationId &association, std::unique_ptr< RestartTaskCallback > callback)
Asynchronously perform a cold restart operation to the association.
void send_and_expect_empty_response(const AssociationId &association, FunctionCode function, Request &headers, std::unique_ptr< EmptyResponseCallback > callback)
Send the specified request to the association using the supplied function and collection of request h...
void get_file_auth_key(const AssociationId &association, const std::string &username, const std::string &password, std::unique_ptr< FileAuthCallback > callback)
Obtain a file authentication key.
void remove_poll(const PollId &poll_id)
Add a periodic poll to an association.
void enable()
start communications
void demand_poll(const PollId &poll_id)
Demand the immediate execution of a poll previously created with MasterChannel::add_poll().
void synchronize_time(const AssociationId &association, TimeSyncMode mode, std::unique_ptr< TimeSyncTaskCallback > callback)
Asynchronously perform a time sync operation to the association.
void open_file(const AssociationId &association, const std::string &file_name, uint32_t auth_key, const Permissions &permissions, uint32_t file_size, FileMode file_mode, uint16_t max_block_size, std::unique_ptr< FileOpenCallback > callback)
Asynchronously open a file.
void disable()
stop communications
PollId add_poll(const AssociationId &id, Request &request, std::chrono::steady_clock::duration period)
Add a periodic poll to an association.
void write_dead_bands(const AssociationId &association, WriteDeadBandRequest &request, std::unique_ptr< EmptyResponseCallback > callback)
Perform a WRITE on the association using the supplied collection of dead-band headers.
DecodeLevel get_decode_level()
Get the decoding level for the channel.
static MasterChannel create_tls_channel(Runtime &runtime, LinkErrorMode link_error_mode, const MasterChannelConfig &config, EndpointList &endpoints, const ConnectStrategy &connect_strategy, std::unique_ptr< ClientStateListener > listener, const TlsClientConfig &tls_config)
Create a master channel that connects to the specified TCP endpoint(s) and establish a TLS session wi...
void write_file_block(const AssociationId &association, uint32_t handle, uint32_t block_number, bool final_block, const std::vector< uint8_t > &block_data, std::unique_ptr< FileOperationCallback > callback)
Asynchronously write a block of file data to the outstation.
void read_with_handler(const AssociationId &association, Request &request, std::unique_ptr< ReadHandler > handler, std::unique_ptr< ReadTaskCallback > callback)
Perform a read on the association.
static MasterChannel create_tcp_channel_2(Runtime &runtime, LinkErrorMode link_error_mode, const MasterChannelConfig &config, EndpointList &endpoints, const ConnectStrategy &connect_strategy, ConnectOptions &connect_options, std::unique_ptr< ClientStateListener > listener)
Create a master channel that connects to the specified TCP endpoint(s)
AssociationId add_association(uint16_t address, const AssociationConfig &config, std::unique_ptr< ReadHandler > read_handler, std::unique_ptr< AssociationHandler > association_handler, std::unique_ptr< AssociationInformation > association_information)
Add an association to the channel.
void read_directory_with_auth(const AssociationId &association, const std::string &dir_path, const DirReadConfig &config, const std::string &user_name, const std::string &password, std::unique_ptr< ReadDirectoryCallback > callback)
Asynchronously retrieve a directory listing by first obtaining an authentication key.
void close_file(const AssociationId &association, uint32_t handle, std::unique_ptr< FileOperationCallback > callback)
Asynchronously close a file.
void operate_no_ack(const AssociationId &association, CommandSet &command, std::unique_ptr< CommandTaskCallback > callback)
Asynchronously perform a DIRECT_OPERATE_NO_ACK (0x06) command operation on the association.
void operate(const AssociationId &association, CommandMode mode, CommandSet &command, std::unique_ptr< CommandTaskCallback > callback)
Asynchronously perform a command operation on the association.
~MasterChannel()
Shutdown a MasterChannel and release all resources.
static MasterChannel create_tcp_channel(Runtime &runtime, LinkErrorMode link_error_mode, const MasterChannelConfig &config, EndpointList &endpoints, const ConnectStrategy &connect_strategy, std::unique_ptr< ClientStateListener > listener)
Create a master channel that connects to the specified TCP endpoint(s)
void remove_association(const AssociationId &id)
Remove an association from the channel.
MasterChannel(MasterChannel &&other) noexcept
Transfer ownership of the underlying C-type to this instance and invalidate the other instance.
Definition: dnp3.hpp:5371
static MasterChannel create_udp_channel(Runtime &runtime, const MasterChannelConfig &config, const std::string &local_endpoint, LinkReadMode link_read_mode, std::chrono::steady_clock::duration retry_delay)
Create a UDP master channel on the local endpoint.
static MasterChannel create_tls_channel_2(Runtime &runtime, LinkErrorMode link_error_mode, const MasterChannelConfig &config, EndpointList &endpoints, const ConnectStrategy &connect_strategy, ConnectOptions &connect_options, std::unique_ptr< ClientStateListener > listener, const TlsClientConfig &tls_config)
Create a master channel that connects to the specified TCP endpoint(s) and establish a TLS session wi...
void check_link_status(const AssociationId &association, std::unique_ptr< LinkStatusCallback > callback)
Asynchronously perform a link status check.
void set_decode_level(const DecodeLevel &decode_level)
Set the decoding level for the channel.
AssociationId add_udp_association(uint16_t address, const std::string &destination, const AssociationConfig &config, std::unique_ptr< ReadHandler > read_handler, std::unique_ptr< AssociationHandler > association_handler, std::unique_ptr< AssociationInformation > association_information)
Add a UDP association to the channel.
void read_directory(const AssociationId &association, const std::string &dir_path, const DirReadConfig &config, std::unique_ptr< ReadDirectoryCallback > callback)
Asynchronously retrieve a directory listing.
static MasterChannel create_serial_channel(Runtime &runtime, const MasterChannelConfig &config, const std::string &path, const SerialSettings &serial_params, std::chrono::steady_clock::duration open_retry_delay, std::unique_ptr< PortStateListener > listener)
Create a master channel on the specified serial port.
Class with methods used to spawn servers.
Definition: dnp3.hpp:5890
MasterServer(MasterServer &&other) noexcept
Transfer ownership of the underlying C-type to this instance and invalidate the other instance.
Definition: dnp3.hpp:5906
static MasterServer create_tcp_server(Runtime &runtime, const std::string &local_addr, const LinkIdConfig &link_id_config, std::unique_ptr< ConnectionHandler > connection_handler)
Spawn a TCP server that accepts connections from outstations.
~MasterServer()
Shutdown down the server.
Action object used by ClientConnectionHandler.next() to specify the next connection attempt or sleep ...
Definition: dnp3.hpp:8259
NextEndpointAction(NextEndpointAction &&other) noexcept
Transfer ownership of the underlying C-type to this instance and invalidate the other instance.
Definition: dnp3.hpp:8275
ParamError sleep_for(std::chrono::steady_clock::duration duration)
Indicate that the connection task should sleep for the specified duration.
ParamError connect_to(ConnectionInfo &info)
Specify the next endpoint to attempt connection to.
Iterator over OctetString instances.
Definition: dnp3.hpp:1659
OctetString get()
retrieve the current value
OctetStringIterator(OctetStringIterator &&)=default
move constructor for the iterator
bool next()
move the iterator to the next value
Dynamic information required by the outstation from the user application.
Definition: dnp3.hpp:7544
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.
Definition: dnp3.hpp:7710
virtual FreezeResult freeze_counters_range(uint16_t start, uint16_t stop, FreezeType freeze_type, DatabaseHandle &database_handle)
Freeze a range of counters.
Definition: dnp3.hpp:7616
virtual void begin_assign_class()
Called before the point headers of an accepted ASSIGN_CLASS request are reported.
Definition: dnp3.hpp:7700
virtual RestartDelay warm_restart()=0
Request that the outstation perform a warm restart.
virtual void event_cleared(uint64_t id)
Called when an event is cleared from the buffer due to master acknowledgement.
Definition: dnp3.hpp:7847
virtual void end_confirm(const BufferState &state)
Called when all relevant events have been cleared.
Definition: dnp3.hpp:7854
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 c...
Definition: dnp3.hpp:7806
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 be...
Definition: dnp3.hpp:7780
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 configur...
Definition: dnp3.hpp:7741
virtual FreezeResult freeze_counters_all(FreezeType freeze_type, DatabaseHandle &database_handle)
Freeze all the counters.
Definition: dnp3.hpp:7589
virtual void write_analog_dead_band(uint16_t index, double dead_band)
Called when the outstation writes the dead-band of an analog input.
Definition: dnp3.hpp:7673
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.
Definition: dnp3.hpp:7603
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 ha...
Definition: dnp3.hpp:7754
virtual RestartDelay cold_restart()=0
Request that the outstation perform a cold restart.
virtual ApplicationIin get_application_iin()=0
Returns the application-controlled IIN bits.
virtual bool support_assign_class()
Controls outstation support for ASSIGN_CLASS requests, which change the class of the events that poin...
Definition: dnp3.hpp:7692
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.
Definition: dnp3.hpp:7722
virtual uint16_t get_processing_delay_ms()=0
Returns the DELAY_MEASUREMENT delay.
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 ...
Definition: dnp3.hpp:7793
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.
Definition: dnp3.hpp:7632
virtual void end_write_analog_dead_bands()
Called when the outstation completes processing a header to write analog dead-bands.
Definition: dnp3.hpp:7681
virtual bool support_write_analog_dead_bands()
Controls outstation support for writing group 34, analog input dead-bands.
Definition: dnp3.hpp:7651
virtual void begin_confirm()
Called when a CONFIRM is received to a response or unsolicited response, but before any previously tr...
Definition: dnp3.hpp:7840
virtual void begin_write_analog_dead_bands()
Called when the outstation begins processing a header to write analog dead-bands.
Definition: dnp3.hpp:7659
virtual WriteTimeResult write_absolute_time(uint64_t time)=0
Handle a write of the absolute time during time synchronization procedures.
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 ha...
Definition: dnp3.hpp:7767
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 confi...
Definition: dnp3.hpp:7832
virtual void end_assign_class()
Called after the point headers of an accepted ASSIGN_CLASS request are reported.
Definition: dnp3.hpp:7730
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 conf...
Definition: dnp3.hpp:7819
Informational callbacks that the outstation doesn't rely on to function.
Definition: dnp3.hpp:7902
virtual void solicited_confirm_received(uint8_t ecsn)=0
Received the expected confirm.
virtual void enter_unsolicited_confirm_wait(uint8_t ecsn)=0
Outstation has begun waiting for an unsolicited confirm.
virtual void unsolicited_confirm_timeout(uint8_t ecsn, bool retry)=0
Failed to receive an unsolicited confirm before the timeout occurred.
virtual void broadcast_received(FunctionCode function_code, BroadcastAction action)=0
Called when a broadcast request is received by the outstation.
virtual void enter_solicited_confirm_wait(uint8_t ecsn)=0
Outstation has begun waiting for a solicited confirm.
virtual void unsolicited_confirmed(uint8_t ecsn)=0
Master confirmed an unsolicited message.
virtual void wrong_solicited_confirm_seq(uint8_t ecsn, uint8_t seq)=0
Received a solicited confirm with the wrong sequence number.
virtual void unexpected_confirm(bool unsolicited, uint8_t seq)=0
Received a confirm when not expecting one.
virtual void process_request_from_idle(const RequestHeader &header)=0
Called when a request is processed from the IDLE state.
virtual void solicited_confirm_wait_new_request()=0
Received a new request while waiting for a solicited confirm, aborting the response series.
virtual void clear_restart_iin()=0
Master cleared the restart IIN bit.
virtual void solicited_confirm_timeout(uint8_t ecsn)=0
Failed to receive a solicited confirm before the timeout occurred.
TCP server that listens for connections and routes the messages to outstations.
Definition: dnp3.hpp:8673
Outstation add_outstation(const OutstationConfig &config, std::unique_ptr< OutstationApplication > application, std::unique_ptr< OutstationInformation > information, std::unique_ptr< ControlHandler > control_handler, std::unique_ptr< ConnectionStateListener > listener, AddressFilter &filter)
Add an outstation to the server.
~OutstationServer()
Gracefully shutdown all the outstations associated to this server, stops the server and release resou...
void bind()
Bind the server to the port and starts listening. Also starts all the outstations associated to it.
OutstationServer(OutstationServer &&other) noexcept
Transfer ownership of the underlying C-type to this instance and invalidate the other instance.
Definition: dnp3.hpp:8689
static OutstationServer create_tls_server(Runtime &runtime, LinkErrorMode link_error_mode, const std::string &address, const TlsServerConfig &tls_config)
Create a new TLS server.
static OutstationServer create_tcp_server(Runtime &runtime, LinkErrorMode link_error_mode, const std::string &address)
Create a new TCP server.
Outstation handle.
Definition: dnp3.hpp:8383
void set_decode_level(const DecodeLevel &level)
Set decoding log level.
static Outstation create_tcp_client(Runtime &runtime, LinkErrorMode link_error_mode, EndpointList &endpoints, const ConnectStrategy &connect_strategy, ConnectOptions &connect_options, const OutstationConfig &config, std::unique_ptr< OutstationApplication > application, std::unique_ptr< OutstationInformation > information, std::unique_ptr< ControlHandler > control_handler, std::unique_ptr< ClientStateListener > listener)
Create an outstation instance running as a TCP client.
static Outstation create_serial_session_2(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, std::unique_ptr< PortStateListener > port_listener)
Create an outstation instance running on a serial port which is tolerant to the serial port being add...
~Outstation()
Free resources of the outstation.
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.
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)
This method is implemented in terms of Outstation::create_serial_session_2() but without a port liste...
void disable()
disable communications
static Outstation create_udp(Runtime &runtime, const OutstationUdpConfig &udp_config, const OutstationConfig &config, std::unique_ptr< OutstationApplication > application, std::unique_ptr< OutstationInformation > information, std::unique_ptr< ControlHandler > control_handler)
Create an outstation instance that communicates over UDP.
void enable()
enable communications
void transaction(DatabaseTransaction &callback)
Acquire a mutex on the underlying database and apply a set of changes as a transaction.
Outstation(Outstation &&other) noexcept
Transfer ownership of the underlying C-type to this instance and invalidate the other instance.
Definition: dnp3.hpp:8399
static Outstation create_tls_client_with_handler(Runtime &runtime, LinkErrorMode link_error_mode, const std::string &span_name, const OutstationConfig &config, std::unique_ptr< OutstationApplication > application, std::unique_ptr< OutstationInformation > information, std::unique_ptr< ControlHandler > control_handler, std::unique_ptr< ClientStateListener > listener, std::unique_ptr< ClientConnectionHandler > connection_handler, const TlsClientConfig &tls_config)
Create an outstation instance running as a TLS client with fine-grained connection management.
static Outstation create_tls_client(Runtime &runtime, LinkErrorMode link_error_mode, EndpointList &endpoints, const ConnectStrategy &connect_strategy, ConnectOptions &connect_options, const OutstationConfig &config, std::unique_ptr< OutstationApplication > application, std::unique_ptr< OutstationInformation > information, std::unique_ptr< ControlHandler > control_handler, std::unique_ptr< ClientStateListener > listener, const TlsClientConfig &tls_config)
Create an outstation instance running as a TLS client.
static Outstation create_tcp_client_with_handler(Runtime &runtime, LinkErrorMode link_error_mode, const std::string &span_name, const OutstationConfig &config, std::unique_ptr< OutstationApplication > application, std::unique_ptr< OutstationInformation > information, std::unique_ptr< ControlHandler > control_handler, std::unique_ptr< ClientStateListener > listener, std::unique_ptr< ClientConnectionHandler > connection_handler)
Create an outstation instance running as a TCP client with fine-grained connection management.
Exception type corresponding to the underlying error enum ParamError.
Definition: dnp3.hpp:139
ParamError error
underlying error enum
Definition: dnp3.hpp:142
ParamException(ParamError error)
construct the exception with an instance of the enum
Definition: dnp3.hpp:144
Callback interface for receiving updates about the state of a serial port.
Definition: dnp3.hpp:2361
virtual void on_change(PortState state)=0
Invoked when the serial port changes state.
Callback interface for retrieving a directory list.
Definition: dnp3.hpp:5271
virtual void on_failure(FileError error)=0
Invoked when the asynchronous operation fails.
virtual void on_complete(FileInfoIterator &result)=0
Invoked when the asynchronous operation completes successfully.
Exception type corresponding to the underlying error enum ReadError.
Definition: dnp3.hpp:4756
ReadException(ReadError error)
construct the exception with an instance of the enum
Definition: dnp3.hpp:4761
ReadError error
underlying error enum
Definition: dnp3.hpp:4759
Callback interface used to received measurement values received from the outstation.
Definition: dnp3.hpp:3751
virtual void handle_abs_time(const HeaderInfo &info, const Timestamp &time)
Handle an absolute time value (g50v1)
Definition: dnp3.hpp:3881
virtual void handle_binary_input(const HeaderInfo &info, BinaryInputIterator &values)
Handle binary input data.
Definition: dnp3.hpp:3777
virtual void handle_bool_attr(const HeaderInfo &info, BoolAttr attr, uint8_t set, uint8_t variation, bool value)
Handle a boolean device attribute.
Definition: dnp3.hpp:3927
virtual void handle_analog_output_status(const HeaderInfo &info, AnalogOutputStatusIterator &values)
Handle analog output status data.
Definition: dnp3.hpp:3833
virtual void handle_octet_string_attr(const HeaderInfo &info, OctetStringAttr attr, uint8_t set, uint8_t variation, ByteIterator &value)
Handle an octet string device attribute.
Definition: dnp3.hpp:3973
virtual void handle_binary_output_command_event(const HeaderInfo &info, BinaryOutputCommandEventIterator &values)
Handle binary output command events.
Definition: dnp3.hpp:3841
virtual void handle_double_bit_binary_input(const HeaderInfo &info, DoubleBitBinaryInputIterator &values)
Handle double-bit binary input data.
Definition: dnp3.hpp:3785
virtual void handle_frozen_counter(const HeaderInfo &info, FrozenCounterIterator &values)
Handle frozen counter input data.
Definition: dnp3.hpp:3809
virtual void handle_int_attr(const HeaderInfo &info, IntAttr attr, uint8_t set, uint8_t variation, int32_t value)
Handle a signed integer device attribute.
Definition: dnp3.hpp:3940
virtual void end_fragment(ReadType read_type, const ResponseHeader &header)
Called when all the data from a response fragment has been processed.
Definition: dnp3.hpp:3769
virtual void handle_analog_output_command_event(const HeaderInfo &info, AnalogOutputCommandEventIterator &values)
Handle analog output command events.
Definition: dnp3.hpp:3849
virtual void handle_octet_string(const HeaderInfo &info, OctetStringIterator &values)
Handle octet string data.
Definition: dnp3.hpp:3873
virtual void handle_float_attr(const HeaderInfo &info, FloatAttr attr, uint8_t set, uint8_t variation, double value)
Handle a floating point device attribute.
Definition: dnp3.hpp:3962
virtual void begin_fragment(ReadType read_type, const ResponseHeader &header)
Called when a valid response fragment is received, but before any measurements are processed.
Definition: dnp3.hpp:3761
virtual void handle_binary_output_status(const HeaderInfo &info, BinaryOutputStatusIterator &values)
Handle binary output status data.
Definition: dnp3.hpp:3793
virtual void handle_analog_input_dead_band(const HeaderInfo &info, AnalogInputDeadBandIterator &values)
Handle analog input deadbands (g34)
Definition: dnp3.hpp:3865
virtual void handle_uint_attr(const HeaderInfo &info, UintAttr attr, uint8_t set, uint8_t variation, uint32_t value)
Handle an unsigned integer device attribute.
Definition: dnp3.hpp:3914
virtual void handle_variation_list_attr(const HeaderInfo &info, VariationListAttr attr, uint8_t set, uint8_t variation, AttrItemIter &value)
Handle a known or unknown list of attribute variations.
Definition: dnp3.hpp:3903
virtual void handle_string_attr(const HeaderInfo &info, StringAttr attr, uint8_t set, uint8_t variation, const char *value)
Handle a known or unknown visible string device attribute.
Definition: dnp3.hpp:3892
virtual void handle_counter(const HeaderInfo &info, CounterIterator &values)
Handle counter data.
Definition: dnp3.hpp:3801
virtual void handle_analog_input(const HeaderInfo &info, AnalogInputIterator &values)
Handle analog input data.
Definition: dnp3.hpp:3817
virtual void handle_time_attr(const HeaderInfo &info, TimeAttr attr, uint8_t set, uint8_t variation, uint64_t value)
Handle a DNP3 time device attribute.
Definition: dnp3.hpp:3951
virtual void handle_frozen_analog_input(const HeaderInfo &info, FrozenAnalogInputIterator &values)
Handle frozen analog input data.
Definition: dnp3.hpp:3825
virtual void handle_bit_string_attr(const HeaderInfo &info, BitStringAttr attr, uint8_t set, uint8_t variation, ByteIterator &value)
Handle a bit string device attribute.
Definition: dnp3.hpp:3984
virtual void handle_unsigned_integer(const HeaderInfo &info, UnsignedIntegerIterator &values)
Handle unsigned integer values (g102)
Definition: dnp3.hpp:3857
Handler for read tasks.
Definition: dnp3.hpp:4767
virtual void on_complete(Nothing result)=0
Invoked when the asynchronous operation completes successfully.
virtual void on_failure(ReadError error)=0
Invoked when the asynchronous operation fails.
Custom request.
Definition: dnp3.hpp:4580
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.
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).
~Request()
Destroy a request created with Request::Request() or Request::class_request().
Request(Request &&other) noexcept
Transfer ownership of the underlying C-type to this instance and invalidate the other instance.
Definition: dnp3.hpp:4596
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).
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).
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.
void add_time_and_interval(uint64_t time, uint32_t interval_ms)
Add a single g51v1 time-and-interval.
static Request class_request(bool class0, bool class1, bool class2, bool class3)
Create a new request asking for classes.
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).
void add_specific_attribute(uint8_t variation, uint8_t set)
Add a header that reads a specific device attribute (group 0) for use with a READ request.
Request()
Create a new request.
void add_uint_attribute(uint8_t variation, uint8_t set, uint32_t value)
Add a header that writes an unsigned integer device attribute (group 0) for use with a WRITE request.
void add_all_objects_header(Variation variation)
Add an all objects variation request.
static Request all_objects(Variation variation)
Create a new request asking for all objects of a particular variation.
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.
void add_string_attribute(uint8_t variation, uint8_t set, const std::string &value)
Add a header that writes a visible string device attribute (group 0) for use with a WRITE request.
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.
Exception type corresponding to the underlying error enum RestartError.
Definition: dnp3.hpp:5076
RestartException(RestartError error)
construct the exception with an instance of the enum
Definition: dnp3.hpp:5081
RestartError error
underlying error enum
Definition: dnp3.hpp:5079
Handler for restart tasks.
Definition: dnp3.hpp:5087
virtual void on_complete(std::chrono::steady_clock::duration result)=0
Invoked when the asynchronous operation completes successfully.
virtual void on_failure(RestartError error)=0
Invoked when the asynchronous operation fails.
Handle to the underlying runtime.
Definition: dnp3.hpp:365
void set_shutdown_timeout(std::chrono::steady_clock::duration timeout)
By default, when the runtime shuts down, it does so without a timeout and waits indefinitely for all ...
Runtime(const RuntimeConfig &config)
Creates a new runtime for running the protocol stack.
~Runtime()
Destroy a runtime.
Runtime(Runtime &&other) noexcept
Transfer ownership of the underlying C-type to this instance and invalidate the other instance.
Definition: dnp3.hpp:381
Global TCP/TLS configuration settings.
Definition: dnp3.hpp:44
static void disable_server_tcp_no_delay()
By default, TCP_NODELAY is set to true for all server TCP/TLS connections. This disables Nagle's algo...
static void disable_client_tcp_no_delay()
By default, TCP_NODELAY is set to true for all client TCP/TLS connections. This disables Nagle's algo...
Exception type corresponding to the underlying error enum TimeSyncError.
Definition: dnp3.hpp:5015
TimeSyncError error
underlying error enum
Definition: dnp3.hpp:5018
TimeSyncException(TimeSyncError error)
construct the exception with an instance of the enum
Definition: dnp3.hpp:5020
Handler for time synchronization tasks.
Definition: dnp3.hpp:5026
virtual void on_failure(TimeSyncError error)=0
Invoked when the asynchronous operation fails.
virtual void on_complete(Nothing result)=0
Invoked when the asynchronous operation completes successfully.
Iterator over UnsignedInteger instances.
Definition: dnp3.hpp:1480
UnsignedIntegerIterator(UnsignedIntegerIterator &&)=default
move constructor for the iterator
bool next()
move the iterator to the next value
UnsignedInteger get()
retrieve the current value
Define a custom request to WRITE analog input dead-bands.
Definition: dnp3.hpp:4037
void add_g34v2_u16(uint16_t index, uint32_t dead_band)
Add a g34v2 (unsigned 32-bit) dead-band with 16-bit indexing to the request.
void add_g34v2_u8(uint8_t index, uint32_t dead_band)
Add a g34v2 (unsigned 32-bit) dead-band with 8-bit indexing to the request.
~WriteDeadBandRequest()
Destroy a request created with WriteDeadBandRequest::WriteDeadBandRequest()
void finish_header()
If a header is currently being written, then this will complete the header so that no new objects may...
WriteDeadBandRequest()
A builder class to create one or more headers of analog input dead-bands.
void add_g34v1_u16(uint16_t index, uint16_t dead_band)
Add a g34v1 (unsigned 16-bit) dead-band with 16-bit indexing to the request.
WriteDeadBandRequest(WriteDeadBandRequest &&other) noexcept
Transfer ownership of the underlying C-type to this instance and invalidate the other instance.
Definition: dnp3.hpp:4053
void add_g34v1_u8(uint8_t index, uint16_t dead_band)
Add a g34v1 (unsigned 16-bit) dead-band with 8-bit indexing to the request.
void add_g34v3_u8(uint8_t index, float dead_band)
Add a g34v3 (single-precision floating point) dead-band with 8-bit indexing to the request.
void add_g34v3_u16(uint16_t index, float dead_band)
Add a g34v3 (single-precision floating point) dead-band with 16-bit indexing to the request.
class that implements AssociationHandler in terms of a lambda expression
Definition: dnp3.hpp:4427
AssociationHandlerLambda(const T &lambda)
constructor
Definition: dnp3.hpp:4435
UtcTimestamp get_current_time() override
implement virtual method from base class
Definition: dnp3.hpp:4438
class that implements ClientStateListener in terms of a lambda expression
Definition: dnp3.hpp:2451
ClientStateListenerLambda(const T &lambda)
constructor
Definition: dnp3.hpp:2459
void on_change(ClientState state) override
implement virtual method from base class
Definition: dnp3.hpp:2462
class that implements ConnectionStateListener in terms of a lambda expression
Definition: dnp3.hpp:8145
ConnectionStateListenerLambda(const T &lambda)
constructor
Definition: dnp3.hpp:8153
void on_change(ConnectionState state) override
implement virtual method from base class
Definition: dnp3.hpp:8156
class that implements DatabaseTransaction in terms of a lambda expression
Definition: dnp3.hpp:6986
DatabaseTransactionLambda(const T &lambda)
constructor
Definition: dnp3.hpp:6994
void execute(Database &database) override
implement virtual method from base class
Definition: dnp3.hpp:6997
class that implements Logger in terms of a lambda expression
Definition: dnp3.hpp:3492
LoggerLambda(const T &lambda)
constructor
Definition: dnp3.hpp:3500
void on_message(LogLevel level, const char *message) override
implement virtual method from base class
Definition: dnp3.hpp:3503
class that implements PortStateListener in terms of a lambda expression
Definition: dnp3.hpp:2379
void on_change(PortState state) override
implement virtual method from base class
Definition: dnp3.hpp:2390
PortStateListenerLambda(const T &lambda)
constructor
Definition: dnp3.hpp:2387
constexpr uint8_t max_binary_input_index
Maximum binary input point index.
Definition: dnp3.hpp:1992
constexpr uint8_t user_assigned_id
User assigned ID code/number.
Definition: dnp3.hpp:2008
constexpr uint8_t supports_frozen_analog_inputs
Supports frozen analog input events.
Definition: dnp3.hpp:1976
constexpr uint8_t device_manufacturers_name
Device manufacturer's name.
Definition: dnp3.hpp:2018
constexpr uint8_t user_specific_attributes
Identification of user-specific attributes.
Definition: dnp3.hpp:1938
constexpr uint8_t device_location_longitude
Longitude of the device from reference meridian (-180.0 to 180.0 deg)
Definition: dnp3.hpp:1924
constexpr uint8_t num_counter
Number of counter points.
Definition: dnp3.hpp:1974
constexpr uint8_t num_master_defined_data_sets
Number of master defined data-sets.
Definition: dnp3.hpp:1944
constexpr uint8_t duration_of_time_accuracy
Duration of time accuracy (seconds)
Definition: dnp3.hpp:1952
constexpr uint8_t num_analog_input
Number of analog input points.
Definition: dnp3.hpp:1982
constexpr uint8_t device_subset_and_conformance
DNP3 subset and conformance.
Definition: dnp3.hpp:2014
constexpr uint8_t num_binary_input
Number of binary input points.
Definition: dnp3.hpp:1994
constexpr uint8_t max_analog_input_index
Maximum analog input point index.
Definition: dnp3.hpp:1980
constexpr uint8_t config_build_date
Time and date that the outstation's current configuration was built defined.
Definition: dnp3.hpp:1912
constexpr uint8_t supports_binary_input_events
Support binary input events.
Definition: dnp3.hpp:1990
constexpr uint8_t num_outstation_defined_data_sets
Number of outstation defined data-sets.
Definition: dnp3.hpp:1946
constexpr uint8_t user_assigned_primary_operator_name
User-assigned primary operator name.
Definition: dnp3.hpp:1930
constexpr uint8_t supports_counter_events
Supports counter events.
Definition: dnp3.hpp:1970
constexpr uint8_t device_manufacturer_software_version
Device manufacturer software version.
Definition: dnp3.hpp:2000
constexpr uint8_t num_binary_outputs
Number of binary outputs.
Definition: dnp3.hpp:1964
constexpr uint8_t supports_frozen_counter_events
Supports frozen counter events.
Definition: dnp3.hpp:1966
constexpr uint8_t config_version
Configuration version.
Definition: dnp3.hpp:1910
constexpr uint8_t device_serial_number
Device serial number.
Definition: dnp3.hpp:2012
constexpr uint8_t supports_double_bit_binary_input_events
Supports double-bit binary input events.
Definition: dnp3.hpp:1984
constexpr uint8_t user_assigned_owner_name
User-assigned owner name.
Definition: dnp3.hpp:2004
constexpr uint8_t num_analog_outputs
Number of analog outputs.
Definition: dnp3.hpp:1958
constexpr uint8_t max_double_bit_binary_input_index
Maximum double-bit binary input point index.
Definition: dnp3.hpp:1986
constexpr uint8_t max_analog_output_index
Maximum analog output index.
Definition: dnp3.hpp:1956
constexpr uint8_t config_id
Configuration id.
Definition: dnp3.hpp:1908
constexpr uint8_t supports_analog_output_events
Supports analog output events.
Definition: dnp3.hpp:1954
constexpr uint8_t all_attributes_request
Non-specific all attributes request.
Definition: dnp3.hpp:2020
constexpr uint8_t list_of_variations
List of attribute variations.
Definition: dnp3.hpp:2022
constexpr uint8_t user_assigned_system_name
User-assigned system name.
Definition: dnp3.hpp:1932
constexpr uint8_t config_last_change_date
Time and date that the outstation's configuration was last modified.
Definition: dnp3.hpp:1914
constexpr uint8_t num_security_stats_per_assoc
Number of security statistics per association.
Definition: dnp3.hpp:1936
constexpr uint8_t num_master_defined_data_set_proto
Number of master defined data-set prototypes.
Definition: dnp3.hpp:1940
constexpr uint8_t product_name_and_model
Device manufacturer's product name and model.
Definition: dnp3.hpp:2016
constexpr uint8_t supports_frozen_counters
Supports frozen counters.
Definition: dnp3.hpp:1968
constexpr uint8_t max_binary_output_index
Maximum binary output index.
Definition: dnp3.hpp:1962
constexpr uint8_t config_digest
Digest (aka fingerprint) of the configuration using a CRC, HASH, MAC, or public key signature.
Definition: dnp3.hpp:1916
constexpr uint8_t supports_analog_input_events
Supports analog input events.
Definition: dnp3.hpp:1978
constexpr uint8_t user_assigned_device_name
User assigned device name.
Definition: dnp3.hpp:2010
constexpr uint8_t device_manufacturer_hardware_version
Device manufacturer hardware version.
Definition: dnp3.hpp:2002
constexpr uint8_t supports_binary_output_events
Supports binary output events.
Definition: dnp3.hpp:1960
constexpr uint8_t max_counter_index
Maximum counter point index.
Definition: dnp3.hpp:1972
constexpr uint8_t max_rx_fragment_size
Maximum receive fragment size.
Definition: dnp3.hpp:1998
constexpr uint8_t local_timing_accuracy
Local timing accuracy (microseconds)
Definition: dnp3.hpp:1950
constexpr uint8_t device_location_latitude
Latitude of the device from the equator (90.0 to -90.0 deg)
Definition: dnp3.hpp:1926
constexpr uint8_t config_digest_algorithm
Configuration digest algorithm.
Definition: dnp3.hpp:1918
constexpr uint8_t max_tx_fragment_size
Maximum transmit fragment size.
Definition: dnp3.hpp:1996
constexpr uint8_t num_outstation_defined_data_set_proto
Number of outstation defined data-set prototypes.
Definition: dnp3.hpp:1942
constexpr uint8_t user_assigned_secondary_operator_name
User-assigned secondary operator name.
Definition: dnp3.hpp:1928
constexpr uint8_t master_resource_id
Master resource id (mRID)
Definition: dnp3.hpp:1920
constexpr uint8_t num_double_bit_binary_input
Number of double-bit binary input points.
Definition: dnp3.hpp:1988
constexpr uint8_t max_binary_output_per_request
Maximum number of binary outputs per request.
Definition: dnp3.hpp:1948
constexpr uint8_t device_location_altitude
Altitude of the device.
Definition: dnp3.hpp:1922
constexpr uint8_t user_assigned_location
User assigned location name.
Definition: dnp3.hpp:2006
constexpr uint8_t secure_auth_version
Secure authentication version.
Definition: dnp3.hpp:1934
constexpr uint8_t restart
Object value has not been updated since device restart.
Definition: dnp3.hpp:203
constexpr uint8_t discontinuity
Reported counter value cannot be compared against a prior value to obtain the correct count differenc...
Definition: dnp3.hpp:215
constexpr uint8_t chatter_filter
Object value is changing state rapidly (device dependent meaning)
Definition: dnp3.hpp:211
constexpr uint8_t reference_err
Object's value might not have the expected level of accuracy.
Definition: dnp3.hpp:217
constexpr uint8_t over_range
Object's true exceeds the measurement range of the reported variation.
Definition: dnp3.hpp:213
constexpr uint8_t remote_forced
Object value is overridden in a downstream reporting device.
Definition: dnp3.hpp:207
constexpr uint8_t local_forced
Object value is overridden by the device reporting this flag.
Definition: dnp3.hpp:209
constexpr uint8_t online
Object value is 'good' / 'valid' / 'nominal'.
Definition: dnp3.hpp:201
constexpr uint8_t comm_lost
Object value represents the last value available before a communication failure occurred....
Definition: dnp3.hpp:205
std::unique_ptr< ConnectionStateListener > connection_state_listener(const T &lambda)
construct an implementation of ConnectionStateListener based on a lambda expression
Definition: dnp3.hpp:8167
std::unique_ptr< Logger > logger(const T &lambda)
construct an implementation of Logger based on a lambda expression
Definition: dnp3.hpp:3514
std::unique_ptr< PortStateListener > port_state_listener(const T &lambda)
construct an implementation of PortStateListener based on a lambda expression
Definition: dnp3.hpp:2401
std::unique_ptr< ClientStateListener > client_state_listener(const T &lambda)
construct an implementation of ClientStateListener based on a lambda expression
Definition: dnp3.hpp:2473
DatabaseTransactionLambda< T > database_transaction(const T &lambda)
construct an implementation of DatabaseTransaction based on a lambda expression
Definition: dnp3.hpp:7008
std::unique_ptr< AssociationHandler > association_handler(const T &lambda)
construct an implementation of AssociationHandler based on a lambda expression
Definition: dnp3.hpp:4449
main namespace for the dnp3 library
Definition: dnp3.hpp:31
AutoTimeSync
Automatic time synchronization configuration.
Definition: dnp3.hpp:4273
@ non_lan
Perform automatic time sync with Delay Measurement (0x17) function code.
@ direct_write_abs_time
Directly write absolute time (g50v1) without delay measurement. WARNING: This is a non-conformant wor...
@ lan
Perform automatic time sync with Record Current Time (0x18) function code.
EventBinaryOutputStatusVariation
Event binary output status variation.
Definition: dnp3.hpp:6190
ResponseFunction
Type of response.
Definition: dnp3.hpp:3538
FileType
File type enumeration used in Group 70 objects.
Definition: dnp3.hpp:3074
@ directory
File is a directory.
@ other
Some other unspecified value.
@ simple
File is a simple file type suitable for sequential file transfer.
TimeAttr
Enumeration of all the known DNP3 Time attributes.
Definition: dnp3.hpp:2187
@ config_last_change_date
Variation 199 - Time and date that the outstation's configuration was last modified.
@ config_build_date
Variation 198 - Time and date that the outstation's current configuration was built defined.
PointType
A type of static point whose events an ASSIGN_CLASS request assigns to a class.
Definition: dnp3.hpp:7373
@ octet_string
Octet strings (group 110), whose events are group 111.
TimeFormat
Describes if and how the time will be formatted in log messages.
Definition: dnp3.hpp:3416
@ system
Format the time in a human readable format e.g. 'Jun 25 14:27:12.955'.
@ rfc_3339
Format the time using RFC 3339.
CommandMode
Command operation mode.
Definition: dnp3.hpp:4877
@ select_before_operate
Perform a Select and Operate (0x03 then 0x04)
StringAttr
Enumeration of all the default string attributes.
Definition: dnp3.hpp:2039
@ user_assigned_system_name
Variation 208 - User-assigned system name.
@ user_assigned_location
Variation 245 - User assigned location name.
@ device_serial_number
Variation 248 - Device serial number.
@ device_manufacturer_software_version
Variation 242 - Device manufacturer software version.
@ user_assigned_device_name
Variation 247 - User assigned device name.
@ device_subset_and_conformance
Variation 249 - DNP3 subset and conformance.
@ user_assigned_secondary_operator_name
Variation 206 - User-assigned secondary operator name.
@ device_manufacturers_name
Variation 252 - Device manufacturer's name.
@ master_resource_id
Variation 202 - Master resource id (mRID)
@ device_manufacturer_hardware_version
Variation 243 - Device manufacturer hardware version.
@ config_id
Variation 196 - Configuration id.
@ config_version
Variation 197 - Configuration version.
@ config_digest_algorithm
Variation 201 - Configuration digest algorithm.
@ product_name_and_model
Variation 250 - Device manufacturer's product name and model.
@ user_assigned_owner_name
Variation 244 - User-assigned owner name.
@ user_assigned_id
Variation 246 - User assigned ID code/number.
@ user_specific_attributes
Variation 211 - Identification of user-specific attributes.
@ user_assigned_primary_operator_name
Variation 207 - User-assigned primary operator name.
DataBits
Number of bits per character.
Definition: dnp3.hpp:2883
@ eight
8 bits per character
@ five
5 bits per character
@ seven
7 bits per character
@ six
6 bits per character
ReadType
Describes the source of a read event.
Definition: dnp3.hpp:3730
@ single_poll
Single poll requested by the user.
@ startup_integrity
Startup integrity poll.
@ unsolicited
Unsolicited message.
@ periodic_poll
Periodic poll configured by the user.
EventMode
Controls how events are processed when updating values in the database.
Definition: dnp3.hpp:5969
@ detect
Detect events in a type dependent fashion.
@ suppress
Never produce an event regardless of change.
@ force
Produce an event whether the value has changed or not.
EventAnalogOutputStatusVariation
Event analog output status variation.
Definition: dnp3.hpp:6490
BoolAttr
Enumeration of all the known boolean attributes.
Definition: dnp3.hpp:2158
@ supports_analog_input_events
Variation 231 - Supports analog input events.
@ supports_frozen_counters
Variation 226 - Supports frozen counters.
@ supports_binary_input_events
Variation 237 - Support binary input events.
@ supports_analog_output_events
Variation 219 - Supports analog output events.
@ supports_double_bit_binary_input_events
Variation 234 - Supports double-bit binary input events.
@ supports_counter_events
Variation 227 - Supports counter events.
@ supports_binary_output_events
Variation 222 - Supports binary output events.
@ supports_frozen_analog_inputs
Variation 230 - Supports frozen analog input events.
@ supports_frozen_counter_events
Variation 225 - Supports frozen counter events.
LogLevel
Log level.
Definition: dnp3.hpp:3382
@ trace
Trace log level.
@ warn
Warning log level.
@ debug
Debugging log level.
@ info
Information log level.
@ error
Error log level.
AttrDefError
Errors that can occur when defining attributes.
Definition: dnp3.hpp:6559
@ reserved_variation
Variation is reserved and cannot be defined.
@ bad_value
The value cannot be encoded, e.g. a string longer than 255 bytes.
@ already_defined
Attribute has already been defined.
@ bad_type
The type does not match the required type in set 0.
@ not_writable
This attribute cannot be configured as writable.
FlowControl
Flow control modes.
Definition: dnp3.hpp:2900
@ hardware
Flow control using RTS/CTS signals.
@ software
Flow control using XON/XOFF bytes.
EventAnalogInputVariation
Event analog input variation.
Definition: dnp3.hpp:6404
WriteTimeResult
Write time result used by OutstationApplication::write_absolute_time()
Definition: dnp3.hpp:7398
@ parameter_error
The request parameters are nonsensical.
StaticBinaryOutputStatusVariation
Static binary output status variation.
Definition: dnp3.hpp:6177
TransportDecodeLevel
Controls how transmitted and received transport segments are decoded at the INFO log level.
Definition: dnp3.hpp:238
@ payload
Decode the header and the raw payload as hexadecimal.
FloatAttr
Enumeration of all known float attributes.
Definition: dnp3.hpp:2226
@ device_location_longitude
Variation 204 - Longitude of the device from reference meridian (-180.0 to 180.0 deg)
@ device_location_latitude
Variation 205 - Latitude of the device from the equator (90.0 to -90.0 deg)
@ device_location_altitude
Variation 203 - Altitude of the device.
AnalogCommandType
Describes the encoding of the commanded value.
Definition: dnp3.hpp:1347
@ i16
16-bit integer
@ f32
single-precision floating point
@ f64
double-precision floating point
@ i32
16-bit integer
TimeSyncError
Possible errors that can occur during a time synchronization procedure.
Definition: dnp3.hpp:4970
@ overflow
Overflow in calculation.
@ system_time_not_unix
The system time cannot be converted to a Unix timestamp.
@ bad_outstation_time_delay
Outstation time delay exceeded the response delay.
@ clock_rollback
Detected a clock rollback.
@ still_needs_time
Outstation did not clear the NEED_TIME IIN bit.
TaskType
Task type used in AssociationInformation.
Definition: dnp3.hpp:4457
@ file_read
Read a file or directory from the outstation.
@ command
Command request.
@ user_read
User-defined read request.
@ auto_event_scan
Automatic event scan caused by the event class IIN bits (IIN1.1 - IIN1.3) indicating that events are ...
@ time_sync
Time synchronisation task.
@ file_close
Close a file on the outstation.
@ generic_empty_response
Generic request that expects an empty response.
@ write_dead_bands
Write analog input dead-bands.
@ restart
Cold or warm restart task.
@ clear_restart_bit
Clear RESTART IIN bit.
@ file_write_block
Write a file block to the outstation.
@ file_open
Open a file on the outstation.
@ file_auth
Send username and password and get back an auth key from the outstation.
Variation
Group/Variation.
Definition: dnp3.hpp:2481
@ group41_var4
Analog Output - Double-precision floating point.
@ group42_var1
Analog Output Event - 32-bit without time.
@ group23_var2
Frozen Counter Event - 16-bit without time.
@ group31_var7
Frozen Analog Input - Single-precision floating point with flags.
@ group13_var2
Binary Output Command Event - With time.
@ group40_var3
Analog Output Status - Single-precision floating point with flags.
@ group60_var4
Class Data - Class 3.
@ group21_var9
Frozen Counter - 32-bit without flags.
@ group33_var8
Frozen Analog Input Event - Double-precision floating point with time of freeze.
@ group31_var0
Frozen Analog Input - Any variation.
@ group31_var5
Frozen Analog Input - 32-bit without flags.
@ group21_var2
Frozen Counter - 16-bit with flags.
@ group13_var1
Binary Output Command Event - Without time.
@ group40_var1
Analog Output Status - 32-bit with flags.
@ group30_var3
Analog Input - 32-bit without flags.
@ group34_var1
Analog Input Reporting Deadband - 16-bit.
@ group11_var1
Binary Output Event - Without time.
@ group70_var2
File Control - Authentication.
@ group42_var5
Analog Output Event - Single-precision floating point without time.
@ group22_var2
Counter Event - 16-bit without time.
@ group102_var1
Unsigned Integer - 8-bit.
@ group12_var1
Binary Output Command - Control relay output block.
@ group42_var3
Analog Output Event - 32-bit with time.
@ group33_var0
Frozen Analog Input Event - Any variation.
@ group34_var2
Analog Input Reporting Deadband - 32-bit.
@ group70_var7
File Control - File descriptor.
@ group11_var2
Binary Output Event - With time.
@ group22_var5
Counter Event - 32-bit with time.
@ group42_var8
Analog Output Event - Double-precision floating point with time.
@ group30_var6
Analog Input - Double-precision floating point with flags.
@ group50_var1
Time and Date - Absolute time.
@ group60_var2
Class Data - Class 1.
@ group20_var2
Counter - 16-bit with flags.
@ group70_var6
File Control - File transport status.
@ group2_var0
Binary Input Event - Any variation.
@ group21_var5
Frozen Counter - 32-bit with flags and time.
@ group70_var8
File Control - File specification string.
@ group0
Device Attributes - Specific attribute (variations 1 to 253 and 255). Only reported in HeaderInfo: it...
@ group2_var3
Binary Input Event - With relative time.
@ group42_var6
Analog Output Event - Double-precision floating point without time.
@ group32_var0
Analog Input Event - Any variation.
@ group33_var7
Frozen Analog Input Event - Single-precision floating point with time of freeze.
@ group22_var6
Counter Event - 16-bit with time.
@ group20_var1
Counter - 32-bit with flags.
@ group33_var4
Frozen Analog Input Event - 16-bit with time of freeze.
@ group43_var7
Analog Output Command Event - Single-precision floating point with time.
@ group31_var1
Frozen Analog Input - 32-bit with flags.
@ group32_var1
Analog Input Event - 32-bit without time.
@ group40_var4
Analog Output Status - Double-precision floating point with flags.
@ group1_var2
Binary Input - With flags.
@ group34_var3
Analog Input Reporting Deadband - Single-precision floating point.
@ group23_var5
Frozen Counter Event - 32-bit with time.
@ group0_var254
Device Attributes - All attributes request.
@ group60_var1
Class Data - Class 0.
@ group42_var4
Analog Output Event - 16-bit with time.
@ group32_var4
Analog Input Event - 16-bit with time.
@ group3_var1
Double-bit Binary Input - Packed format.
@ group31_var3
Frozen Analog Input - 32-bit with flags and time of freeze.
@ group42_var7
Analog Output Event - Single-precision floating point with time.
@ group110
Octet String - Sized by variation.
@ group10_var1
Binary Output - Packed format.
@ group43_var3
Analog Output Command Event - 32-bit with time.
@ group33_var6
Frozen Analog Input Event - Double-precision floating point without time.
@ group10_var2
Binary Output - With flags.
@ group4_var1
Double-bit Binary Input Event - Without time.
@ group31_var4
Frozen Analog Input - 16-bit with flags and time of freeze.
@ group30_var0
Analog Input - Any variation.
@ group21_var0
Frozen Counter - Any variation.
@ group70_var5
File Control - File transport.
@ group33_var5
Frozen Analog Input Event - Single-precision floating point without time.
@ group51_var2
Time and Date CTO - Unsynchronized absolute time.
@ group40_var0
Analog Output Status - Any variation.
@ group33_var2
Frozen Analog Input Event - 16-bit without time.
@ group43_var4
Analog Output Command Event - 16-bit with time.
@ group50_var4
Time and Date - Indexed time and long interval.
@ group52_var1
Time Delay - Coarse (seconds)
@ group51_var1
Time and Date CTO - Synchronized absolute time.
@ group52_var2
Time Delay - Fine (milliseconds)
@ group50_var2
Time and Date - Absolute time and interval.
@ group34_var0
Analog Input Reporting Deadband - Any variation.
@ group20_var0
Counter - Any variation.
@ group32_var7
Analog Input Event - Single-precision floating point with time.
@ group3_var0
Double-bit Binary Input - Any variation.
@ group31_var2
Frozen Analog Input - 16-bit with flags.
@ group30_var1
Analog Input - 32-bit with flags.
@ group32_var8
Analog Input Event - Double-precision floating point with time.
@ group32_var6
Analog Input Event - Double-precision floating point without time.
@ group22_var1
Counter Event - 32-bit without time.
@ group70_var3
File Control - File command.
@ group42_var0
Analog Output Event - Any variation.
@ group33_var3
Frozen Analog Input Event - 32-bit with time of freeze.
@ group23_var0
Frozen Counter Event - Any variation.
@ group31_var6
Frozen Analog Input - 16-bit without flags.
@ group50_var3
Time and Date - Last recorded time.
@ group22_var0
Counter Event - Any variation.
@ group30_var2
Analog Input - 16-bit with flags.
@ group20_var5
Counter - 32-bit without flags.
@ group31_var8
Frozen Analog Input - Double-precision floating point with flags.
@ group3_var2
Double-bit Binary Input - With flags.
@ group32_var3
Analog Input Event - 32-bit with time.
@ group41_var3
Analog Output - Single-precision floating point.
@ group10_var0
Binary Output - Any variation.
@ group43_var5
Analog Output Command Event - Single-precision floating point without time.
@ group42_var2
Analog Output Event - 16-bit without time.
@ group33_var1
Frozen Analog Input Event - 32-bit without time.
@ group40_var2
Analog Output Status - 16-bit with flags.
@ group1_var0
Binary Input - Any variation.
@ group60_var3
Class Data - Class 2.
@ group102_var0
Unsigned Integer - Any variation.
@ group32_var5
Analog Input Event - Single-precision floating point without time.
@ group21_var10
Frozen Counter - 16-bit without flags.
@ group2_var1
Binary Input Event - Without time.
@ group70_var4
File Control - File command status.
@ group43_var1
Analog Output Command Event - 32-bit without time.
@ group41_var2
Analog Output - 16-bit.
@ group43_var6
Analog Output Command Event - Double-precision floating point without time.
@ group30_var4
Analog Input - 16-bit without flags.
@ group41_var1
Analog Output - 32-bit.
@ group20_var6
Counter - 16-bit without flags.
@ group43_var8
Analog Output Command Event - Double-precision floating point with time.
@ group43_var2
Analog Output Command Event - 16-bit without time.
@ group32_var2
Analog Input Event - 16-bit without time.
@ group1_var1
Binary Input - Packed format.
@ group30_var5
Analog Input - Single-precision floating point with flags.
@ group21_var6
Frozen Counter - 16-bit with flags and time.
@ group80_var1
Internal Indications - Packed format.
@ group21_var1
Frozen Counter - 32-bit with flags.
@ group4_var2
Double-bit Binary Input Event - With absolute time.
@ group11_var0
Binary Output Event - Any variation.
@ group23_var1
Frozen Counter Event - 32-bit without time.
@ group111
Octet String Event - Sized by variation.
@ group2_var2
Binary Input Event - With absolute time.
@ group23_var6
Frozen Counter Event - 16-bit with time.
@ group4_var3
Double-bit Binary Input Event - With relative time.
@ group4_var0
Double-bit Binary Input Event - Any variation.
OpType
Operation Type field, used in conjunction with TripCloseCode to specify a control operation.
Definition: dnp3.hpp:455
@ pulse_on
PULSE_ON (1)
@ pulse_off
PULSE_OFF (2)
@ latch_on
LATCH_ON (3)
@ latch_off
LATCH_OFF(4)
BitStringAttr
Enumeration of all known bit-string attributes.
Definition: dnp3.hpp:2215
EventCounterVariation
Event counter variation.
Definition: dnp3.hpp:6252
OperateType
Enumeration describing how the master requested the control operation.
Definition: dnp3.hpp:7971
@ direct_operate_no_ack
operate the control via a DirectOperateNoAck request
EventDoubleBitBinaryInputVariation
Event double-bit binary input variation.
Definition: dnp3.hpp:6128
UdpSocketMode
Describes how the UDP socket reads and writes datagrams from remote endpoint(s)
Definition: dnp3.hpp:3350
@ one_to_many
The UDP endpoint will accept packets any remote endpoint.
@ one_to_one
The UDP endpoint will only communicate with the specified remote endpoint.
StaticAnalogOutputStatusVariation
Static analog output status variation.
Definition: dnp3.hpp:6473
CommandStatus
Enumeration received from an outstation in response to command request.
Definition: dnp3.hpp:148
@ format_error
bad control code or timing values (value == 3)
@ automation_inhibit
command not accepted because it was prevented or inhibited by a local automation process,...
@ success
command was accepted, initiated, or queued (value == 0)
@ too_many_ops
the command has been done too often and has been throttled (value == 8)
@ no_select
command requires being selected before operate, configuration issue (value == 2)
@ already_active
command is all ready in progress or its all ready in that mode (value == 5)
@ out_of_range
command not accepted because the value is outside the acceptable range permitted for this point (valu...
@ non_participating
(deprecated) indicates the outstation shall not issue or perform the control operation (value == 126)
@ blocked
command not accepted because the requested function is specifically blocked at the outstation (value ...
@ already_complete
command not accepted because the outstation has already completed the requested operation (value == 1...
@ not_authorized
the command was rejected because the device denied it or an RTU intercepted it (value == 9)
@ timeout
command timed out before completing (value == 1)
@ not_supported
command is not implemented (value == 4)
@ unknown
captures any value not defined in the enumeration
@ canceled
command not accepted because the operation was cancelled (value == 16)
@ hardware_error
something is stopping the command, often a local/remote interlock (value == 6)
@ blocked_other_master
command not accepted because another master is communicating with the outstation and has exclusive ri...
@ processing_limited
command not accepted because the device cannot process any more activities than are presently in prog...
@ local
the function governed by the control is in local only control (value == 7)
@ downstream_local
command not accepted because the outstation is forwarding the request to another downstream device wh...
@ downstream_fail
command not accepted because the outstation is forwarding the request to another downstream device wh...
FileMode
Different modes in which files may be opened.
Definition: dnp3.hpp:3335
@ append
Specifies that the file is to be opened for writing, appending to the end of the file.
TimeQuality
Timestamp quality.
Definition: dnp3.hpp:601
@ invalid_time
Timestamp is not valid, ignore the value and use a local timestamp.
@ synchronized_time
The timestamp is UTC synchronized at the remote device.
@ unsynchronized_time
The device indicates the timestamp may be not be synchronized.
constexpr uint64_t dnp3_version_major
major version number
Definition: dnp3.hpp:34
StaticDoubleBitBinaryInputVariation
Static double-bit binary input variation.
Definition: dnp3.hpp:6115
UpdateResult
Defines what occurred during an update operation and which fields of UpdateInfo are valid.
Definition: dnp3.hpp:5927
@ no_event
The point exists, but the update did not create an event.
@ no_point
No point exists for this type and index.
@ created
An event was created with the specified id.
StaticAnalogInputVariation
Static analog input variation.
Definition: dnp3.hpp:6383
LinkReadMode
Controls how the link-layer parser treats frames that span multiple calls to read of the physical lay...
Definition: dnp3.hpp:3367
@ datagram
Reading datagrams (UDP) where link-layer frames MAY NOT span separate calls to read.
@ stream
Reading from a stream (TCP, serial, etc.) where link-layer frames MAY span separate calls to read.
FunctionCode
Application layer function code.
Definition: dnp3.hpp:2999
@ cold_restart
Outstation shall perform a complete reset of all hardware and software in the device (value == 13)
@ operate
Outstation shall activate the output points selected (or armed) by a previous select function code co...
@ get_file_info
Outstation shall retrieve information about a file (value == 28)
@ stop_application
Outstation shall stop running the applications specified by the objects in the request (value == 18)
@ immediate_freeze
Outstation shall copy the point data values specified by the objects in the request to a separate fre...
@ initialize_data
Obsolete-Do not use for new designs (value == 15)
@ delay_measure
Outstation shall report the time it takes to process and initiate the transmission of its response (v...
@ abort_file
Outstation shall abort a file transfer operation (value == 30)
@ disable_unsolicited
Prevents outstation from initiating unsolicited responses from points specified by the objects in the...
@ immediate_freeze_no_response
Same as ImmediateFreeze but outstation shall not send a response (value == 8)
@ unsolicited_response
Master shall interpret this fragment as an unsolicited response that was not prompted by an explicit ...
@ enable_unsolicited
Enables outstation to initiate unsolicited responses from points specified by the objects in the requ...
@ close_file
Outstation shall close a file (value == 26)
@ freeze_clear_no_response
Same as FreezeClear but outstation shall not send a response (value == 10)
@ save_configuration
This code is deprecated-Do not use for new designs (value == 19)
@ record_current_time
Outstation shall save the time when the last octet of this message is received (value == 24)
@ assign_class
Outstation shall assign the events generated by the points specified by the objects in the request to...
@ select
Outstation shall select (or arm) the output points specified by the objects in the request in prepara...
@ delete_file
Outstation shall delete a file (value == 27)
@ start_application
Outstation shall start running the applications specified by the objects in the request (value == 17)
@ freeze_clear
Outstation shall copy the point data values specified by the objects in the request into a separate f...
@ freeze_at_time_no_response
Same as FreezeAtTime but outstation shall not send a response (value == 12)
@ direct_operate_no_response
Same as DirectOperate but outstation shall not send a response (value == 6)
@ confirm
Master sends this to an outstation to confirm the receipt of an Application Layer fragment (value == ...
@ response
Master shall interpret this fragment as an Application Layer response to an ApplicationLayer request ...
@ initialize_application
Outstation shall place the applications specified by the objects in the request into the ready to run...
@ direct_operate
Outstation shall immediately actuate the output points specified by the objects in the request (value...
@ authenticate_file
Outstation shall return a file authentication key (value == 29)
@ read
Outstation shall return the data specified by the objects in the request (value == 1)
@ write
Outstation shall store the data specified by the objects in the request (value == 2)
@ open_file
Outstation shall open a file (value == 25)
@ freeze_at_time
Outstation shall copy the point data values specified by the objects in the request to a separate fre...
@ warm_restart
Outstation shall reset only portions of the device (value == 14)
Nothing
A single value enum which is used as a placeholder for futures that don't return a value.
Definition: dnp3.hpp:2331
StaticBinaryInputVariation
Static binary input variation.
Definition: dnp3.hpp:6053
RestartDelayType
Type of restart delay value. Used by RestartDelay.
Definition: dnp3.hpp:7304
@ seconds
Value is in seconds (corresponds to g51v1)
@ milli_seconds
Value is in milliseconds (corresponds to g51v2)
LinkDecodeLevel
Controls how transmitted and received link frames are decoded at the INFO log level.
Definition: dnp3.hpp:253
CertificateMode
Determines how the certificate(s) presented by the peer are validated.
Definition: dnp3.hpp:1825
@ authority_based
Validates the peer certificate against one or more configured trust anchors.
@ self_signed
Validates that the peer presents a single certificate which is a byte-for-byte match against the conf...
VariationListAttr
Enumeration of all the variation list attributes.
Definition: dnp3.hpp:2026
@ list_of_variations
Variation 255 - List of attribute variations.
UintAttr
Enumeration of all the default uint attributes.
Definition: dnp3.hpp:2086
@ max_tx_fragment_size
Variation 240 - Maximum transmit fragment size.
@ num_counter
Variation 229 - Number of counter points.
@ max_double_bit_binary_input_index
Variation 235 - Maximum double-bit binary input point index.
@ num_binary_input
Variation 239 - Number of binary input points.
@ num_outstation_defined_data_set_proto
Variation 213 - Number of outstation defined data-set prototypes.
@ max_analog_output_index
Variation 220 - Maximum analog output index.
@ num_analog_outputs
Variation 221 - Number of analog outputs.
@ num_master_defined_data_sets
Variation 214 - Number of master defined data-sets.
@ duration_of_time_accuracy
Variation 218 - Duration of time accuracy (seconds)
@ local_timing_accuracy
Variation 217 - Local timing accuracy (microseconds)
@ num_analog_input
Variation 233 - Number of analog input points.
@ max_counter_index
Variation 228 - Maximum counter point index.
@ max_analog_input_index
Variation 232 - Maximum analog input point index.
@ secure_auth_version
Variation 209 - Secure authentication version.
@ num_master_defined_data_set_proto
Variation 212 - Number of master defined data-set prototypes.
@ num_double_bit_binary_input
Variation 236 - Number of double-bit binary input points.
@ max_rx_fragment_size
Variation 241 - Maximum receive fragment size.
@ num_outstation_defined_data_sets
Variation 215 - Number of outstation defined data-sets.
@ num_binary_outputs
Variation 224 - Number of binary outputs.
@ max_binary_output_index
Variation 223 - Maximum binary output index.
@ max_binary_output_per_request
Variation 216 - Maximum number of binary outputs per request.
@ num_security_stats_per_assoc
Variation 210 - Number of security statistics per association.
@ max_binary_input_index
Variation 238 - Maximum binary input point index.
CommandError
Result of a command.
Definition: dnp3.hpp:4890
@ header_mismatch
Number of headers or objects in the response didn't match the number in the request.
EventBinaryInputVariation
Event binary input variation.
Definition: dnp3.hpp:6066
const char * to_string(ParamError value)
convert an instance of enum ParamError into a C-style string
DoubleBit
Double-bit binary input value.
Definition: dnp3.hpp:676
@ determined_off
Determined to be OFF.
@ intermediate
Transition between conditions.
@ indeterminate
Abnormal or custom condition.
@ determined_on
Determined to be ON.
StaticFrozenCounterVariation
Static frozen counter variation.
Definition: dnp3.hpp:6307
StopBits
Number of stop bits.
Definition: dnp3.hpp:2930
@ two
Two stop bits.
@ one
One stop bit.
ReadError
Errors that can occur during a read operation.
Definition: dnp3.hpp:4723
FreezeType
Freeze operation type.
Definition: dnp3.hpp:7413
@ freeze_and_clear
Copy the current value of a counter to the associated point and clear the current value to 0.
constexpr uint64_t dnp3_version_patch
patch version number
Definition: dnp3.hpp:38
AppDecodeLevel
Controls how transmitted and received application-layer fragments are decoded at the INFO log level.
Definition: dnp3.hpp:221
@ header
Decode the header-only.
@ object_values
Decode the header, the object headers, and the object values.
@ nothing
Decode nothing.
@ object_headers
Decode the header and the object headers.
EventFrozenCounterVariation
Event frozen counter variation.
Definition: dnp3.hpp:6328
FreezeResult
Result of a freeze operation.
Definition: dnp3.hpp:7426
@ not_supported
The demanded freeze operation is not supported by this device (translated to IIN2....
OctetStringAttr
Enumeration of all known octet-string attributes.
Definition: dnp3.hpp:2202
@ config_digest
Variation 200 - Digest (aka fingerprint) of the configuration using a CRC, HASH, MAC,...
constexpr uint64_t dnp3_version_minor
minor version number
Definition: dnp3.hpp:36
FileError
Errors that can occur during file transfer.
Definition: dnp3.hpp:3187
@ no_connection
no connection
@ bad_encoding
request data could not be encoded
@ abort_by_user
File transfer aborted by user.
@ response_timeout
timeout occurred before receiving a response
@ unsupported_response
response contained objects that the library doesn't support, which may be valid DNP3 (e....
@ no_permission
Outstation indicated no permission to access file.
@ bad_status
Outstation returned an error status code.
@ too_many_requests
too many user requests queued
@ max_length_exceeded
Exceeded the maximum length specified by the user.
@ bad_response
response was malformed or contained unexpected object headers
@ bad_block_num
Received an unexpected block number.
@ unsupported_or_bad_response
response contained objects that are either malformed or valid but not supported by the library (e....
@ wrong_handle
File handle returned by the outstation did not match the request.
@ iin_error
outstation returned an IIN.2 error bit
@ write_error
insufficient buffer space to serialize the request
@ association_removed
association was removed mid-task
QualifierCode
Qualifier code used in the response.
Definition: dnp3.hpp:3678
@ range8
8-bit start stop (0x00)
@ all_objects
All objects (0x06)
@ free_format_16
16-bit free format (0x5B)
@ range16
16-bit start stop (0x01)
@ count_and_prefix_16
16-bit count and prefix (0x28)
@ count_and_prefix_8
8-bit count and prefix (0x17)
@ count8
8-bit count (0x07)
@ count16
16-bit count (0x08)
LinkErrorMode
Controls how errors in parsed link-layer frames are handled. This behavior is configurable for physic...
Definition: dnp3.hpp:2986
@ discard
Framing errors are discarded. The link-layer parser is reset on any error, and the parser begins scan...
EmptyResponseError
Errors that may occur when performing a request that expects a response with zero object headers.
Definition: dnp3.hpp:4118
@ rejected_by_iin2
IIN2 indicates request was not completely successful.
constexpr char const * dnp3_version_string
version number as the string major.minor.patch
Definition: dnp3.hpp:40
TaskError
Task error used in AssociationInformation.
Definition: dnp3.hpp:4506
@ system_time_not_available
the master had no system time to synchronize the outstation with, because AssociationHandler::get_cur...
RestartError
Errors that can occur during a cold/warm restart operation.
Definition: dnp3.hpp:5043
ParamError
Error type used throughout the library.
Definition: dnp3.hpp:78
@ wrong_channel_type
This operation cannot be performed on this channel type.
@ invalid_local_certificate
Invalid local certificate file.
@ invalid_timeout
The supplied timeout value is too small or too large.
@ no_support
Native library was compiled without support for this feature.
@ server_bind_error
Server failed to bind to the specified port.
@ ok
Success, i.e. no error occurred.
@ consumed
This object is consumed and cannot be used again.
@ server_already_started
Server already started.
@ invalid_dns_name
Invalid DNS name.
@ other_tls_error
Other TLS error.
@ master_already_shutdown
Master was already shutdown.
@ association_does_not_exist
The specified association does not exist.
@ null_parameter
Null parameter.
@ invalid_peer_certificate
Invalid peer certificate file.
@ string_not_utf8
Provided string argument is not UTF-8.
@ invalid_private_key
Invalid private key file.
@ runtime_cannot_block_within_async
Runtime cannot execute blocking call within asynchronous context.
@ association_duplicate_address
Duplicate association address.
@ runtime_creation_failure
Failed to create Tokio runtime.
@ point_does_not_exist
Point does not exist.
@ invalid_socket_address
Invalid socket address.
@ invalid_dnp3_address
Invalid link-layer DNP3 address.
@ runtime_destroyed
Runtime has already been disposed.
@ address_filter_conflict
Conflict in the address filter specification.
@ logging_already_configured
Logging can only be configured once.
@ invalid_buffer_size
Invalid buffer size.
UpdateFlagsType
Point type on which to update the flags.
Definition: dnp3.hpp:6030
@ binary_input
Binary input.
@ binary_output_status
Binary output status.
@ analog_input
Analog input.
@ double_bit_binary_input
Doubl-bit binary input.
@ frozen_counter
Frozen counter.
@ analog_output_status
Analog output status.
EventClass
Event class.
Definition: dnp3.hpp:2806
@ none
Does not generate events.
@ class3
Class 3 event.
@ class1
Class 1 event.
@ class2
Class 2 event.
TimeSyncMode
Time synchronization mode.
Definition: dnp3.hpp:4955
LinkStatusError
Errors that can occur during a manually initiated link status check. See MasterChannel::check_link_st...
Definition: dnp3.hpp:5288
@ unexpected_response
There was activity on the link, but it wasn't a LINK_STATUS.
StaticCounterVariation
Static counter variation.
Definition: dnp3.hpp:6235
BroadcastAction
Enumeration describing how the outstation processed a broadcast request.
Definition: dnp3.hpp:7881
@ bad_object_headers
Outstation was unable to parse the object headers and ignored the request.
@ ignored_by_configuration
Outstation ignored the broadcast message b/c it is disabled by configuration.
@ processed
Outstation processed the broadcast.
@ unsupported_function
Outstation ignore the broadcast message b/c the function is not supported via Broadcast.
ConnectionState
Outstation connection state for connection-oriented transports, e.g. TCP.
Definition: dnp3.hpp:8113
@ disconnected
Disconnected from the master.
TripCloseCode
Trip-Close Code field, used in conjunction with OpType to specify a control operation.
Definition: dnp3.hpp:438
@ reserved
RESERVED (3)
MinTlsVersion
Minimum TLS version to allow.
Definition: dnp3.hpp:1810
@ v12
Allow TLS 1.2 and 1.3.
@ v13
Only allow TLS 1.3. A peer that does not support TLS 1.3 will fail to complete the handshake.
LogOutputFormat
Describes how each log event is formatted.
Definition: dnp3.hpp:3403
@ text
A simple text-based format.
@ json
Output formatted as JSON.
Parity
Parity checking modes.
Definition: dnp3.hpp:2915
@ odd
Parity bit sets odd number of 1 bits.
@ even
Parity bit sets even number of 1 bits.
PortState
State of the serial port.
Definition: dnp3.hpp:2342
@ disabled
Disabled until enabled.
@ wait
Waiting to perform an open retry.
@ shutdown
Task has been shut down.
@ open
Port is open.
ClientState
State of the client connection.
Definition: dnp3.hpp:2411
@ connected
Client is connected to the remote device.
@ wait_after_failed_connect
Failed to establish a connection, waiting before retrying.
@ connecting
Client is trying to establish a connection to the remote device.
@ wait_after_disconnect
Client was disconnected, waiting before retrying.
IntAttr
Enumeration of all the default integer attributes.
Definition: dnp3.hpp:2145
PhysDecodeLevel
Controls how data transmitted at the physical layer (TCP, serial, etc) is logged.
Definition: dnp3.hpp:268
@ length
Log only the length of data that is sent and received.
@ data
Log the length and the actual data that is sent and received.
Analog configuration.
Definition: dnp3.hpp:6439
double deadband
Deadband value.
Definition: dnp3.hpp:6469
AnalogInputConfig()
Initialize to defaults.
AnalogInputConfig(StaticAnalogInputVariation static_variation, EventAnalogInputVariation event_variation, double deadband)
Fully construct AnalogInputConfig specifying the value of each field.
StaticAnalogInputVariation static_variation
Default static variation.
Definition: dnp3.hpp:6463
EventAnalogInputVariation event_variation
Default event variation.
Definition: dnp3.hpp:6465
Analog input deadband corresponding to group 34.
Definition: dnp3.hpp:1515
double value
Deadband of the analog input.
Definition: dnp3.hpp:1532
AnalogInputDeadBand(uint16_t index, double value)
Fully construct AnalogInputDeadBand specifying the value of each field.
uint16_t index
Index of the analog input.
Definition: dnp3.hpp:1528
analog_input point
Definition: dnp3.hpp:1055
Timestamp time
Point timestamp.
Definition: dnp3.hpp:1076
uint16_t index
Point index.
Definition: dnp3.hpp:1070
AnalogInput(uint16_t index, double value, const Flags &flags, const Timestamp &time)
Fully construct AnalogInput specifying the value of each field.
Flags flags
Point flags.
Definition: dnp3.hpp:1074
double value
Point value.
Definition: dnp3.hpp:1072
Event transferred from master to outstation when the outstation receives a corresponding command.
Definition: dnp3.hpp:1370
double commanded_value
Commanded state of the binary output.
Definition: dnp3.hpp:1392
AnalogCommandType command_type
Describes how the value was encoded in the protocol.
Definition: dnp3.hpp:1394
AnalogOutputCommandEvent(uint16_t index, CommandStatus status, double commanded_value, AnalogCommandType command_type, const Timestamp &time)
Fully construct AnalogOutputCommandEvent specifying the value of each field.
CommandStatus status
Status from processing the command that triggered this event.
Definition: dnp3.hpp:1388
uint16_t index
Index of the command event.
Definition: dnp3.hpp:1386
Timestamp time
Associated timestamp.
Definition: dnp3.hpp:1396
Analog Output Status configuration.
Definition: dnp3.hpp:6525
AnalogOutputStatusConfig(StaticAnalogOutputStatusVariation static_variation, EventAnalogOutputStatusVariation event_variation, double deadband)
Fully construct AnalogOutputStatusConfig specifying the value of each field.
double deadband
Deadband value.
Definition: dnp3.hpp:6555
StaticAnalogOutputStatusVariation static_variation
Default static variation.
Definition: dnp3.hpp:6549
EventAnalogOutputStatusVariation event_variation
Default event variation.
Definition: dnp3.hpp:6551
AnalogOutputStatusConfig()
Initialize to defaults.
analog_output_status point
Definition: dnp3.hpp:1199
Timestamp time
Point timestamp.
Definition: dnp3.hpp:1220
AnalogOutputStatus(uint16_t index, double value, const Flags &flags, const Timestamp &time)
Fully construct AnalogOutputStatus specifying the value of each field.
uint16_t index
Point index.
Definition: dnp3.hpp:1214
Flags flags
Point flags.
Definition: dnp3.hpp:1218
double value
Point value.
Definition: dnp3.hpp:1216
Application-controlled IIN bits.
Definition: dnp3.hpp:7443
bool config_corrupt
IIN2.5 - Configuration corrupt.
Definition: dnp3.hpp:7476
bool need_time
IIN1.4 - Time synchronization is required.
Definition: dnp3.hpp:7470
bool local_control
IIN1.5 - Some output points are in local mode.
Definition: dnp3.hpp:7472
bool device_trouble
IIN1.6 - Device trouble.
Definition: dnp3.hpp:7474
ApplicationIin()
Initialize all fields in ApplicationIin to false.
Association configuration.
Definition: dnp3.hpp:4292
Classes startup_integrity_classes
Startup integrity classes to ask on master startup and when an outstation restart is detected.
Definition: dnp3.hpp:4340
std::chrono::steady_clock::duration keep_alive_timeout
Delay of inactivity before sending a REQUEST_LINK_STATUS to the outstation.
Definition: dnp3.hpp:4348
AssociationConfig(const EventClasses &disable_unsol_classes, const EventClasses &enable_unsol_classes, const Classes &startup_integrity_classes, const EventClasses &event_scan_on_events_available)
Initialize the configuration with the specified values.
AutoTimeSync auto_time_sync
Automatic time synchronization configuration.
Definition: dnp3.hpp:4342
EventClasses enable_unsol_classes
Classes to enable unsolicited responses at startup.
Definition: dnp3.hpp:4336
EventClasses event_scan_on_events_available
Classes to automatically send reads when the IIN bit is asserted.
Definition: dnp3.hpp:4352
uint16_t max_queued_user_requests
maximum number of user requests (e.g. commands, adhoc reads, etc) that will be queued before back-pre...
Definition: dnp3.hpp:4354
EventClasses disable_unsol_classes
Classes to disable unsolicited responses at startup.
Definition: dnp3.hpp:4334
bool auto_integrity_scan_on_buffer_overflow
Automatic integrity scan when an EVENT_BUFFER_OVERFLOW is detected.
Definition: dnp3.hpp:4350
RetryStrategy auto_tasks_retry_strategy
Automatic tasks retry strategy.
Definition: dnp3.hpp:4344
std::chrono::steady_clock::duration response_timeout
Timeout for receiving a response on this association.
Definition: dnp3.hpp:4332
Association identifier.
Definition: dnp3.hpp:4183
An attribute variation and properties pair returned in Group0Var255.
Definition: dnp3.hpp:2266
uint8_t variation
Variation of the attribute.
Definition: dnp3.hpp:2280
AttrProp properties
Properties of the attribute.
Definition: dnp3.hpp:2282
Attribute properties returned in Group0Var255.
Definition: dnp3.hpp:2247
bool is_writable
Indicate if the property can be used in a WRITE operation.
Definition: dnp3.hpp:2260
Binary Input configuration.
Definition: dnp3.hpp:6087
BinaryInputConfig(StaticBinaryInputVariation static_variation, EventBinaryInputVariation event_variation)
Fully construct BinaryInputConfig specifying the value of each field.
StaticBinaryInputVariation static_variation
Default static variation.
Definition: dnp3.hpp:6109
EventBinaryInputVariation event_variation
Default event variation.
Definition: dnp3.hpp:6111
BinaryInputConfig()
Initialize to defaults.
binary_input point
Definition: dnp3.hpp:695
uint16_t index
Point index.
Definition: dnp3.hpp:710
Timestamp time
Point timestamp.
Definition: dnp3.hpp:716
bool value
Point value.
Definition: dnp3.hpp:712
BinaryInput(uint16_t index, bool value, const Flags &flags, const Timestamp &time)
Fully construct BinaryInput specifying the value of each field.
Flags flags
Point flags.
Definition: dnp3.hpp:714
Event transferred from master to outstation when the outstation receives a corresponding command.
Definition: dnp3.hpp:1275
BinaryOutputCommandEvent(uint16_t index, CommandStatus status, bool commanded_state, const Timestamp &time)
Fully construct BinaryOutputCommandEvent specifying the value of each field.
bool commanded_state
Commanded state of the binary output.
Definition: dnp3.hpp:1296
uint16_t index
Index of the binary command event.
Definition: dnp3.hpp:1290
Timestamp time
Associated timestamp.
Definition: dnp3.hpp:1298
CommandStatus status
Status from processing the command that triggered this event.
Definition: dnp3.hpp:1292
Binary Output Status configuration.
Definition: dnp3.hpp:6207
EventBinaryOutputStatusVariation event_variation
Default event variation.
Definition: dnp3.hpp:6231
StaticBinaryOutputStatusVariation static_variation
Default static variation.
Definition: dnp3.hpp:6229
BinaryOutputStatusConfig()
Initialize to defaults.
BinaryOutputStatusConfig(StaticBinaryOutputStatusVariation static_variation, EventBinaryOutputStatusVariation event_variation)
Fully construct BinaryOutputStatusConfig specifying the value of each field.
binary_output_status point
Definition: dnp3.hpp:839
uint16_t index
Point index.
Definition: dnp3.hpp:854
BinaryOutputStatus(uint16_t index, bool value, const Flags &flags, const Timestamp &time)
Fully construct BinaryOutputStatus specifying the value of each field.
bool value
Point value.
Definition: dnp3.hpp:856
Flags flags
Point flags.
Definition: dnp3.hpp:858
Timestamp time
Point timestamp.
Definition: dnp3.hpp:860
Information about the state of buffer after a CONFIRM has been processed.
Definition: dnp3.hpp:7522
ClassCount classes
Remaining number of events in the buffer on a per-class basis.
Definition: dnp3.hpp:7536
TypeCount types
Remaining number of events in the buffer on a per-type basis.
Definition: dnp3.hpp:7538
A count of events on a per-class basis.
Definition: dnp3.hpp:2825
uint32_t num_class_1
Number of class 1 events.
Definition: dnp3.hpp:2840
uint32_t num_class_2
Number of class 2 events.
Definition: dnp3.hpp:2842
uint32_t num_class_3
Number of class 3 events.
Definition: dnp3.hpp:2844
Controls which types are reported during a Class 0 read.
Definition: dnp3.hpp:7104
ClassZeroConfig()
Initialize to default values.
bool analog_output_status
Include Analog Output Status in Class 0 reads.
Definition: dnp3.hpp:7151
bool binary
Include Binary Inputs in Class 0 reads.
Definition: dnp3.hpp:7139
bool frozen_counter
Include Frozen Counters in Class 0 reads.
Definition: dnp3.hpp:7147
bool analog
Include Analog Inputs in Class 0 reads.
Definition: dnp3.hpp:7149
bool octet_string
Include Octet Strings in Class 0 reads.
Definition: dnp3.hpp:7155
bool binary_output_status
Include Binary Output Status in Class 0 reads.
Definition: dnp3.hpp:7143
bool double_bit_binary
Include Double-Bit Binary Inputs in Class 0 reads.
Definition: dnp3.hpp:7141
bool counter
Include Counters in Class 0 reads.
Definition: dnp3.hpp:7145
Class 0, 1, 2 and 3 config.
Definition: dnp3.hpp:4224
bool class3
Class 3 events.
Definition: dnp3.hpp:4269
bool class0
Class 0 (static data)
Definition: dnp3.hpp:4263
static Classes all()
Initialize all classes to true.
static Classes none()
Initialize all classes to false.
Classes(bool class0, bool class1, bool class2, bool class3)
Fully construct Classes specifying the value of each field.
bool class1
Class 1 events.
Definition: dnp3.hpp:4265
bool class2
Class 2 events.
Definition: dnp3.hpp:4267
Timing parameters for connection attempts.
Definition: dnp3.hpp:1777
std::chrono::steady_clock::duration reconnect_delay
Delay before attempting a connection after a disconnect.
Definition: dnp3.hpp:1806
std::chrono::steady_clock::duration min_connect_delay
Minimum delay between two connection attempts, doubles up to the maximum delay.
Definition: dnp3.hpp:1802
std::chrono::steady_clock::duration max_connect_delay
Maximum delay between two connection attempts.
Definition: dnp3.hpp:1804
ConnectStrategy()
Initialize to default values.
CROB (Group12Var1) control code.
Definition: dnp3.hpp:476
bool clear
Support for this field is optional. When the clear bit is set, the device shall remove pending contro...
Definition: dnp3.hpp:534
OpType op_type
This field is used in conjunction with the ControlCode::tcc field to specify a control operation.
Definition: dnp3.hpp:538
ControlCode(TripCloseCode tcc, bool clear, OpType op_type)
Initialize a ControlCode instance.
bool queue
This field is obsolete and should always be 0.
Definition: dnp3.hpp:536
static ControlCode from_op_type(OpType op_type)
Initialize a ControlCode instance from a OpType
TripCloseCode tcc
This field is used in conjunction with ControlCode::op_type to specify a control operation.
Definition: dnp3.hpp:532
static ControlCode from_tcc_and_op_type(TripCloseCode tcc, OpType op_type)
Initialize a ControlCode instance from a TripCloseCode and a OpType.
APDU Control field.
Definition: dnp3.hpp:409
bool fir
First fragment in the message.
Definition: dnp3.hpp:426
bool uns
Unsolicited response.
Definition: dnp3.hpp:432
bool fin
Final fragment of the message.
Definition: dnp3.hpp:428
bool con
Requires confirmation.
Definition: dnp3.hpp:430
uint8_t seq
Sequence number.
Definition: dnp3.hpp:434
Counter configuration.
Definition: dnp3.hpp:6275
StaticCounterVariation static_variation
Default static variation.
Definition: dnp3.hpp:6299
uint32_t deadband
Deadband value.
Definition: dnp3.hpp:6303
CounterConfig(StaticCounterVariation static_variation, EventCounterVariation event_variation, uint32_t deadband)
Fully construct CounterConfig specifying the value of each field.
CounterConfig()
Initialize to defaults.
EventCounterVariation event_variation
Default event variation.
Definition: dnp3.hpp:6301
counter point
Definition: dnp3.hpp:911
uint16_t index
Point index.
Definition: dnp3.hpp:926
Timestamp time
Point timestamp.
Definition: dnp3.hpp:932
Flags flags
Point flags.
Definition: dnp3.hpp:930
uint32_t value
Point value.
Definition: dnp3.hpp:928
Counter(uint16_t index, uint32_t value, const Flags &flags, const Timestamp &time)
Fully construct Counter specifying the value of each field.
Controls the decoding of transmitted and received data at the application, transport,...
Definition: dnp3.hpp:285
TransportDecodeLevel transport
Controls transport segment layer decoding.
Definition: dnp3.hpp:326
DecodeLevel()
Initialize log levels to defaults.
AppDecodeLevel application
Controls application fragment decoding.
Definition: dnp3.hpp:324
LinkDecodeLevel link
Controls link frame decoding.
Definition: dnp3.hpp:328
static DecodeLevel nothing()
Initialize log levels to nothing.
PhysDecodeLevel physical
Controls the logging of physical layer read/write.
Definition: dnp3.hpp:330
Configuration related to reading a file.
Definition: dnp3.hpp:5194
uint16_t max_block_size
Maximum block size requested by the master during the file open.
Definition: dnp3.hpp:5218
uint32_t max_file_size
Maximum number of bytes that may be accumulated while reading directory information.
Definition: dnp3.hpp:5220
static DirReadConfig defaults()
Initialize the configuration to default values.
Double-Bit Binary Input configuration.
Definition: dnp3.hpp:6149
DoubleBitBinaryInputConfig(StaticDoubleBitBinaryInputVariation static_variation, EventDoubleBitBinaryInputVariation event_variation)
Fully construct DoubleBitBinaryInputConfig specifying the value of each field.
EventDoubleBitBinaryInputVariation event_variation
Default event variation.
Definition: dnp3.hpp:6173
StaticDoubleBitBinaryInputVariation static_variation
Default static variation.
Definition: dnp3.hpp:6171
DoubleBitBinaryInputConfig()
Initialize to defaults.
double_bit_binary_input point
Definition: dnp3.hpp:767
DoubleBit value
Point value.
Definition: dnp3.hpp:784
DoubleBitBinaryInput(uint16_t index, DoubleBit value, const Flags &flags, const Timestamp &time)
Fully construct DoubleBitBinaryInput specifying the value of each field.
Flags flags
Point flags.
Definition: dnp3.hpp:786
uint16_t index
Point index.
Definition: dnp3.hpp:782
Timestamp time
Point timestamp.
Definition: dnp3.hpp:788
Maximum number of events for each type.
Definition: dnp3.hpp:7049
uint16_t max_counter
Maximum number of Counter events (g22)
Definition: dnp3.hpp:7090
uint16_t max_frozen_counter
Maximum number of Frozen Counter events (g23)
Definition: dnp3.hpp:7092
uint16_t max_binary
Maximum number of Binary Input events (g2)
Definition: dnp3.hpp:7084
uint16_t max_analog_output_status
Maximum number of Analog Output Status events (g42)
Definition: dnp3.hpp:7096
EventBufferConfig(uint16_t max_binary, uint16_t max_double_bit_binary, uint16_t max_binary_output_status, uint16_t max_counter, uint16_t max_frozen_counter, uint16_t max_analog, uint16_t max_analog_output_status, uint16_t max_octet_string)
Fully construct EventBufferConfig specifying the value of each field.
uint16_t max_octet_string
Maximum number of Octet String events (g111)
Definition: dnp3.hpp:7098
uint16_t max_analog
Maximum number of Analog Input events (g32)
Definition: dnp3.hpp:7094
static EventBufferConfig no_events()
Create a configuration where no events are buffered.
uint16_t max_binary_output_status
Maximum number of Binary Output Status events (g11)
Definition: dnp3.hpp:7088
uint16_t max_double_bit_binary
Maximum number of Double-Bit Binary Input events (g4)
Definition: dnp3.hpp:7086
Event classes.
Definition: dnp3.hpp:2762
bool class2
Class 2 events.
Definition: dnp3.hpp:2800
static EventClasses none()
Initialize all classes to false.
bool class1
Class 1 events.
Definition: dnp3.hpp:2798
EventClasses(bool class1, bool class2, bool class3)
Fully construct EventClasses specifying the value of each field.
static EventClasses all()
Initialize all classes to true.
bool class3
Class 3 events.
Definition: dnp3.hpp:2802
Information about a file or directory returned from the outstation.
Definition: dnp3.hpp:3245
uint64_t time_created
DNP3 timestamp.
Definition: dnp3.hpp:3272
Permissions permissions
Outstation permissions for the file.
Definition: dnp3.hpp:3274
uint32_t size
Size of the file in bytes.
Definition: dnp3.hpp:3268
FileType file_type
Simple file or directory.
Definition: dnp3.hpp:3264
std::string file_name
Name of the file or directory.
Definition: dnp3.hpp:3262
Configuration related to reading a file.
Definition: dnp3.hpp:5162
static FileReadConfig defaults()
Initialize the configuration to default values.
uint16_t max_block_size
Maximum block size requested by the master during the file open.
Definition: dnp3.hpp:5186
uint32_t max_file_size
Maximum file size accepted by the master.
Definition: dnp3.hpp:5188
Collection of individual flag bits represented by an underlying mask value.
Definition: dnp3.hpp:585
Flags(uint8_t value)
Fully construct Flags specifying the value of each field.
uint8_t value
bit-mask representing a set of individual flag bits
Definition: dnp3.hpp:597
frozen_analog_input point
Definition: dnp3.hpp:1127
Timestamp time
Point timestamp.
Definition: dnp3.hpp:1148
uint16_t index
Point index.
Definition: dnp3.hpp:1142
Flags flags
Point flags.
Definition: dnp3.hpp:1146
FrozenAnalogInput(uint16_t index, double value, const Flags &flags, const Timestamp &time)
Fully construct FrozenAnalogInput specifying the value of each field.
double value
Point value.
Definition: dnp3.hpp:1144
Frozen Counter configuration.
Definition: dnp3.hpp:6351
FrozenCounterConfig()
Initialize to defaults.
uint32_t deadband
Deadband value.
Definition: dnp3.hpp:6379
StaticFrozenCounterVariation static_variation
Default static variation.
Definition: dnp3.hpp:6375
FrozenCounterConfig(StaticFrozenCounterVariation static_variation, EventFrozenCounterVariation event_variation, uint32_t deadband)
Fully construct FrozenCounterConfig specifying the value of each field.
EventFrozenCounterVariation event_variation
Default event variation.
Definition: dnp3.hpp:6377
frozen_counter point
Definition: dnp3.hpp:983
Flags flags
Point flags.
Definition: dnp3.hpp:1002
Timestamp time
Point timestamp.
Definition: dnp3.hpp:1004
uint16_t index
Point index.
Definition: dnp3.hpp:998
FrozenCounter(uint16_t index, uint32_t value, const Flags &flags, const Timestamp &time)
Fully construct FrozenCounter specifying the value of each field.
uint32_t value
Point value.
Definition: dnp3.hpp:1000
Control Relay Output Block.
Definition: dnp3.hpp:544
static Group12Var1 from_code(const ControlCode &code)
Construct a Group12Var1 from a ControlCode.
uint32_t off_time
Duration the output drive remains non-active (in milliseconds)
Definition: dnp3.hpp:579
uint32_t on_time
Duration the output drive remains active (in milliseconds)
Definition: dnp3.hpp:577
uint8_t count
Count.
Definition: dnp3.hpp:575
ControlCode code
Control code.
Definition: dnp3.hpp:573
Group12Var1(const ControlCode &code, uint8_t count, uint32_t on_time, uint32_t off_time)
Fully construct Group12Var1 specifying the value of each field.
Information about the object header and specific variation.
Definition: dnp3.hpp:3705
bool has_flags
true if a flags byte is present on the underlying variation, false otherwise
Definition: dnp3.hpp:3726
QualifierCode qualifier
Qualifier code used in the response.
Definition: dnp3.hpp:3722
HeaderInfo(Variation variation, QualifierCode qualifier, bool is_event, bool has_flags)
Fully construct HeaderInfo specifying the value of each field.
Variation variation
underlying variation in the response
Definition: dnp3.hpp:3720
bool is_event
true if the received variation is an event type, false otherwise
Definition: dnp3.hpp:3724
First IIN byte.
Definition: dnp3.hpp:3553
bool need_time
Outstation requires time synchronization.
Definition: dnp3.hpp:3581
bool class_2_events
Outstation has unreported Class 2 events.
Definition: dnp3.hpp:3577
bool device_trouble
An abnormal, device-specific condition exists in the outstation.
Definition: dnp3.hpp:3585
bool local_control
One or more of the outstation’s points are in local control mode.
Definition: dnp3.hpp:3583
bool class_1_events
Outstation has unreported Class 1 events.
Definition: dnp3.hpp:3575
bool class_3_events
Outstation has unreported Class 3 events.
Definition: dnp3.hpp:3579
bool broadcast
Broadcast message was received.
Definition: dnp3.hpp:3573
bool device_restart
Outstation restarted.
Definition: dnp3.hpp:3587
Second IIN byte.
Definition: dnp3.hpp:3593
bool object_unknown
Outstation does not support requested operation for objects in the request.
Definition: dnp3.hpp:3615
bool config_corrupt
The outstation detected corrupt configuration (optional support)
Definition: dnp3.hpp:3623
bool reserved_2
Reserved for future use - should always be set to 0.
Definition: dnp3.hpp:3625
bool event_buffer_overflow
An event buffer overflow condition exists in the outstation, and at least one unconfirmed event was l...
Definition: dnp3.hpp:3619
bool no_func_code_support
Outstation does not support this function code.
Definition: dnp3.hpp:3613
bool reserved_1
Reserved for future use - should always be set to 0.
Definition: dnp3.hpp:3627
bool already_executing
The operation requested is already executing (optional support)
Definition: dnp3.hpp:3621
bool parameter_error
A parameter in the request was invalid, e.g. malformed object data or an unsupported qualifier or ran...
Definition: dnp3.hpp:3617
Pair of IIN bytes.
Definition: dnp3.hpp:3633
Iin2 iin2
Second IIN byte.
Definition: dnp3.hpp:3649
Iin1 iin1
First IIN byte.
Definition: dnp3.hpp:3647
Configuration that controls how the server performs remote link identification.
Definition: dnp3.hpp:5857
std::chrono::steady_clock::duration timeout
Maximum time period to wait before receiving a link frame from the outstation.
Definition: dnp3.hpp:5884
PhysDecodeLevel decode_level
Set the decode level to use when reading the link header used for identification.
Definition: dnp3.hpp:5886
LinkIdConfig()
Initialize to default values.
uint16_t max_tasks
Set the maximum number of simultaneous tasks used to perform link identification.
Definition: dnp3.hpp:5882
Logging configuration options.
Definition: dnp3.hpp:3431
LogOutputFormat output_format
output formatting options
Definition: dnp3.hpp:3462
bool print_level
optionally print the log level as part to the message string
Definition: dnp3.hpp:3466
LoggingConfig()
Initialize the configuration to default values.
TimeFormat time_format
optional time format
Definition: dnp3.hpp:3464
bool print_module_info
optionally print the underlying Rust module information to the message string
Definition: dnp3.hpp:3468
LogLevel level
logging level
Definition: dnp3.hpp:3460
Configuration for a MasterChannel that is independent of the physical layer.
Definition: dnp3.hpp:3991
DecodeLevel decode_level
Decoding level for this master. You can modify this later on with MasterChannel::set_decode_level().
Definition: dnp3.hpp:4021
uint16_t address
Local DNP3 data-link address.
Definition: dnp3.hpp:4019
MasterChannelConfig(uint16_t address)
Initialize MasterChannelConfig to default values.
uint16_t tx_buffer_size
TX buffer size.
Definition: dnp3.hpp:4025
uint16_t rx_buffer_size
RX buffer size.
Definition: dnp3.hpp:4029
Octet String point.
Definition: dnp3.hpp:1628
OctetString(uint16_t index, ByteIterator value)
Fully construct OctetString specifying the value of each field.
uint16_t index
Point index.
Definition: dnp3.hpp:1641
ByteIterator value
Point value.
Definition: dnp3.hpp:1643
The result of opening a file on the outstation.
Definition: dnp3.hpp:3160
uint16_t max_block_size
Maximum block size returned by the outstation.
Definition: dnp3.hpp:3183
uint32_t file_handle
The handle assigned to the file by the outstation.
Definition: dnp3.hpp:3177
uint32_t file_size
Size of the file returned by the outstation.
Definition: dnp3.hpp:3179
Outstation configuration.
Definition: dnp3.hpp:7202
uint32_t max_unsolicited_retries
Maximum number of unsolicited retries.
Definition: dnp3.hpp:7280
uint16_t max_controls_per_request
Maximum number of controls in a single request.
Definition: dnp3.hpp:7298
DecodeLevel decode_level
Decoding level.
Definition: dnp3.hpp:7272
uint16_t unsolicited_buffer_size
Unsolicited response buffer size.
Definition: dnp3.hpp:7266
OutstationFeatures features
Optional features.
Definition: dnp3.hpp:7278
OutstationConfig(uint16_t outstation_address, uint16_t master_address, const EventBufferConfig &event_buffer_config)
Initialize to defaults.
std::chrono::steady_clock::duration select_timeout
Select timeout.
Definition: dnp3.hpp:7276
std::chrono::steady_clock::duration unsolicited_retry_delay
Delay to wait before retrying an unsolicited response.
Definition: dnp3.hpp:7282
std::chrono::steady_clock::duration keep_alive_timeout
Delay of inactivity before sending a REQUEST_LINK_STATUS to the master.
Definition: dnp3.hpp:7286
std::chrono::steady_clock::duration confirm_timeout
Confirmation timeout.
Definition: dnp3.hpp:7274
ClassZeroConfig class_zero
Controls responses to Class 0 reads.
Definition: dnp3.hpp:7300
uint16_t max_read_request_headers
Limits the selections or headers processed in a READ request.
Definition: dnp3.hpp:7296
uint16_t master_address
Link-layer master address.
Definition: dnp3.hpp:7256
EventBufferConfig event_buffer_config
Event buffer sizes configuration.
Definition: dnp3.hpp:7258
uint16_t outstation_address
Link-layer outstation address.
Definition: dnp3.hpp:7254
uint16_t solicited_buffer_size
Solicited response buffer size.
Definition: dnp3.hpp:7262
uint16_t rx_buffer_size
Receive buffer size.
Definition: dnp3.hpp:7270
Optional outstation features that can be enabled or disabled.
Definition: dnp3.hpp:7161
bool broadcast
Process valid broadcast messages.
Definition: dnp3.hpp:7190
OutstationFeatures()
Initialize to default values.
bool self_address
Respond to the self address.
Definition: dnp3.hpp:7188
bool unsolicited
Respond to enable/disable unsolicited response and produce unsolicited responses.
Definition: dnp3.hpp:7192
bool respond_to_any_master
Outstation will process every request as if it came from the configured master address.
Definition: dnp3.hpp:7196
UDP outstation configuration.
Definition: dnp3.hpp:8339
std::string remote_endpoint
Remote endpoint where outbound requests are sent. Must be a socket address (ip:port)
Definition: dnp3.hpp:8371
std::chrono::steady_clock::duration retry_delay
Period to wait before retrying after a failure to bind or connect the UDP socket.
Definition: dnp3.hpp:8377
OutstationUdpConfig(const std::string &local_endpoint, const std::string &remote_endpoint)
Initialize the configuration with default settings for unspecified parameter.
UdpSocketMode socket_mode
UDP socket mode to use.
Definition: dnp3.hpp:8373
std::string local_endpoint
Local endpoint to which the UDP socket is bound. Must be a socket address (ip:port)
Definition: dnp3.hpp:8369
LinkReadMode link_read_mode
Read mode to use, this should typically be set to LinkReadMode::datagram
Definition: dnp3.hpp:8375
Defines read, write, execute permissions for particular group or user.
Definition: dnp3.hpp:3091
bool execute
Permission to execute.
Definition: dnp3.hpp:3115
bool read
Permission to read.
Definition: dnp3.hpp:3119
PermissionSet(bool execute, bool write, bool read)
Fully construct PermissionSet specifying the value of each field.
PermissionSet()
Permission set with nothing enabled.
bool write
Permission to write.
Definition: dnp3.hpp:3117
Permissions for world, group, and owner.
Definition: dnp3.hpp:3125
PermissionSet owner
Owner permissions.
Definition: dnp3.hpp:3154
PermissionSet group
Group permissions.
Definition: dnp3.hpp:3152
Permissions(const PermissionSet &world, const PermissionSet &group, const PermissionSet &owner)
Fully construct Permissions specifying the value of each field.
static Permissions none()
Permissions with nothing enabled.
PermissionSet world
World permissions.
Definition: dnp3.hpp:3150
Poll identifier.
Definition: dnp3.hpp:4202
Application-layer header for requests.
Definition: dnp3.hpp:7861
ControlField control_field
Control field.
Definition: dnp3.hpp:7875
FunctionCode function
Function code.
Definition: dnp3.hpp:7877
Response header information.
Definition: dnp3.hpp:3655
ResponseFunction func
Response type.
Definition: dnp3.hpp:3672
Iin iin
IIN bytes.
Definition: dnp3.hpp:3674
ControlField control_field
Application control field.
Definition: dnp3.hpp:3670
Restart delay used by OutstationApplication::cold_restart() and OutstationApplication::warm_restart()
Definition: dnp3.hpp:7323
static RestartDelay not_supported()
RestartDelay indicating that the request is not supported.
static RestartDelay milliseconds(uint16_t value)
RestartDelay with a count of milliseconds.
uint16_t value
Expected delay before the outstation comes back online.
Definition: dnp3.hpp:7369
static RestartDelay seconds(uint16_t value)
RestartDelay with a count of seconds.
RestartDelayType restart_type
Indicates what RestartDelay::value is.
Definition: dnp3.hpp:7367
Retry strategy configuration.
Definition: dnp3.hpp:2854
RetryStrategy()
Initialize to defaults.
std::chrono::steady_clock::duration max_delay
Maximum delay between two retries.
Definition: dnp3.hpp:2879
std::chrono::steady_clock::duration min_delay
Minimum delay between two retries.
Definition: dnp3.hpp:2877
Runtime configuration.
Definition: dnp3.hpp:338
uint16_t num_core_threads
Number of runtime threads to spawn. For a guess of the number of CPU cores, use 0.
Definition: dnp3.hpp:361
RuntimeConfig()
Initialize the configuration to default values.
Serial port settings.
Definition: dnp3.hpp:2945
StopBits stop_bits
Number of bits to use to signal the end of a character.
Definition: dnp3.hpp:2982
FlowControl flow_control
Type of signalling to use for controlling data transfer.
Definition: dnp3.hpp:2978
Parity parity
Type of parity to use for error checking.
Definition: dnp3.hpp:2980
SerialSettings()
Initialize to default values.
uint32_t baud_rate
Baud rate (in symbols-per-second)
Definition: dnp3.hpp:2974
DataBits data_bits
Number of bits used to represent a character sent on the line.
Definition: dnp3.hpp:2976
Timestamp associated with particular measurement from the outstation. The validity of the value depen...
Definition: dnp3.hpp:624
static Timestamp synchronized_timestamp(uint64_t value)
Creates a synchronized timestamp struct.
static Timestamp invalid_timestamp()
Creates an invalid timestamp struct.
TimeQuality quality
Enumeration that indicates the timestamp's validity.
Definition: dnp3.hpp:672
static Timestamp unsynchronized_timestamp(uint64_t value)
Creates an unsynchronized timestamp struct.
uint64_t value
Count of milliseconds since UNIX epoch.
Definition: dnp3.hpp:670
TLS client configuration.
Definition: dnp3.hpp:1846
MinTlsVersion min_tls_version
Minimum TLS version allowed.
Definition: dnp3.hpp:1898
CertificateMode certificate_mode
Certificate validation mode.
Definition: dnp3.hpp:1900
bool allow_server_name_wildcard
If set to true, a '*' may be used for TlsClientConfig::dns_name to bypass server name validation.
Definition: dnp3.hpp:1902
TlsClientConfig(const std::string &dns_name, const std::string &peer_cert_path, const std::string &local_cert_path, const std::string &private_key_path, const std::string &password)
construct the configuration with defaults
std::string peer_cert_path
Path to the PEM-encoded certificate of the peer.
Definition: dnp3.hpp:1886
std::string local_cert_path
Path to the PEM-encoded local certificate.
Definition: dnp3.hpp:1888
std::string private_key_path
Path to the the PEM-encoded private key.
Definition: dnp3.hpp:1890
std::string password
Optional password if the private key file is encrypted.
Definition: dnp3.hpp:1896
std::string dns_name
Subject name which is verified in the presented server certificate, from the SAN extension or in the ...
Definition: dnp3.hpp:1884
TLS server configuration.
Definition: dnp3.hpp:8607
std::string dns_name
Subject name which is verified in the presented client certificate, from the SAN extension or in the ...
Definition: dnp3.hpp:8645
CertificateMode certificate_mode
Certificate validation mode.
Definition: dnp3.hpp:8661
std::string local_cert_path
Path to the PEM-encoded local certificate.
Definition: dnp3.hpp:8649
MinTlsVersion min_tls_version
Minimum TLS version allowed.
Definition: dnp3.hpp:8659
std::string password
Optional password if the private key file is encrypted.
Definition: dnp3.hpp:8657
std::string peer_cert_path
Path to the PEM-encoded certificate of the peer.
Definition: dnp3.hpp:8647
bool allow_client_name_wildcard
If set to true, a '*' may be used for TlsServerConfig::dns_name to allow any authenticated client to ...
Definition: dnp3.hpp:8663
std::string private_key_path
Path to the PEM-encoded private key.
Definition: dnp3.hpp:8651
TlsServerConfig(const std::string &dns_name, const std::string &peer_cert_path, const std::string &local_cert_path, const std::string &private_key_path, const std::string &password)
construct the configuration with defaults
Remaining number of events in the buffer after a confirm on a per-type basis.
Definition: dnp3.hpp:7482
uint32_t num_counter
Number of counter events remaining in the buffer.
Definition: dnp3.hpp:7508
uint32_t num_frozen_counter
Number of frozen counter events remaining in the buffer.
Definition: dnp3.hpp:7510
uint32_t num_double_bit_binary_input
Number of double-bit binary input events remaining in the buffer.
Definition: dnp3.hpp:7504
uint32_t num_binary_output_status
Number of binary output status events remaining in the buffer.
Definition: dnp3.hpp:7506
uint32_t num_binary_input
Number of binary input events remaining in the buffer.
Definition: dnp3.hpp:7502
uint32_t num_analog_output_status
Number of analog output status events remaining in the buffer.
Definition: dnp3.hpp:7514
uint32_t num_analog
Number of analog events remaining in the buffer.
Definition: dnp3.hpp:7512
uint32_t num_octet_string
Number octet string events remaining in the buffer.
Definition: dnp3.hpp:7516
Unsigned byte corresponding to group 102 variation 1.
Definition: dnp3.hpp:1449
UnsignedInteger(uint16_t index, uint8_t value)
Fully construct UnsignedInteger specifying the value of each field.
uint8_t value
Value of the object.
Definition: dnp3.hpp:1464
uint16_t index
Index of the object.
Definition: dnp3.hpp:1462
Defines what occurred during an update operation. Only certain id fields are valid depending on the v...
Definition: dnp3.hpp:5946
UpdateResult result
Defines what happened and which id fields are valid.
Definition: dnp3.hpp:5961
uint64_t discarded
The id of the discarded event if the result is UpdateResult::overflow
Definition: dnp3.hpp:5965
uint64_t created
The id of the created event if the result is UpdateResult::created or UpdateResult::overflow
Definition: dnp3.hpp:5963
Options that control how the update is performed.
Definition: dnp3.hpp:5990
static UpdateOptions detect_event()
Default event detection mode. Updates the static value and automatically detects event.
EventMode event_mode
Determines how/if an event is produced.
Definition: dnp3.hpp:6026
bool update_static
Optionally bypass updating the static database (the current value)
Definition: dnp3.hpp:6024
static UpdateOptions no_event()
Only update the static value. Usefull during initialization of the database.
Timestamp value returned by AssociationHandler::get_current_time().
Definition: dnp3.hpp:4362
static UtcTimestamp invalid()
Construct an invalid UtcTimestamp.
uint64_t value
Count of milliseconds since UNIX epoch.
Definition: dnp3.hpp:4398
static UtcTimestamp valid(uint64_t value)
Construct a valid UtcTimestamp.
bool is_valid
True if the timestamp is valid, false otherwise.
Definition: dnp3.hpp:4400