dnp3 (C++ API) 1.6.0
Loading...
Searching...
No Matches
dnp3.hpp
Go to the documentation of this file.
1// This library is provided under the terms of a non-commercial license.
2//
3// Please refer to the source repository for details:
4//
5// https://github.com/stepfunc/dnp3/blob/master/LICENSE.txt
6//
7// Please contact Step Function I/O if you are interested in commercial license:
8//
9// info@stepfunc.io
10#pragma once
11
12#include <cstdint>
13#include <stdexcept>
14#include <chrono>
15#include <memory>
16#include <vector>
17
37
39namespace dnp3 {
40
42constexpr uint64_t dnp3_version_major = 1;
44constexpr uint64_t dnp3_version_minor = 6;
46constexpr uint64_t dnp3_version_patch = 0;
48constexpr char const* dnp3_version_string = "1.6.0";
49
50
53 TcpSettings() = delete;
54public:
69};
70
72enum class ParamError {
74 ok = 0,
82 no_support = 4,
118 invalid_dns_name = 22,
120 other_tls_error = 23,
124 consumed = 25,
125};
126
130const char* to_string(ParamError value);
131
133class ParamException : public std::logic_error {
134public:
139};
140
142enum class CommandStatus {
144 success = 0,
146 timeout = 1,
148 no_select = 2,
150 format_error = 3,
152 not_supported = 4,
154 already_active = 5,
156 hardware_error = 6,
158 local = 7,
160 too_many_ops = 8,
162 not_authorized = 9,
168 out_of_range = 12,
170 downstream_local = 13,
172 already_complete = 14,
174 blocked = 15,
176 canceled = 16,
180 downstream_fail = 18,
184 unknown = 20,
185};
186
190const char* to_string(CommandStatus value);
191
193namespace flag {
195 constexpr uint8_t online = 0x01;
197 constexpr uint8_t restart = 0x02;
199 constexpr uint8_t comm_lost = 0x04;
201 constexpr uint8_t remote_forced = 0x08;
203 constexpr uint8_t local_forced = 0x10;
205 constexpr uint8_t chatter_filter = 0x20;
207 constexpr uint8_t over_range = 0x20;
209 constexpr uint8_t discontinuity = 0x40;
211 constexpr uint8_t reference_err = 0x40;
212}
213
215enum class AppDecodeLevel {
217 nothing = 0,
219 header = 1,
221 object_headers = 2,
223 object_values = 3,
224};
225
229const char* to_string(AppDecodeLevel value);
230
234 nothing = 0,
236 header = 1,
238 payload = 2,
239};
240
245
247enum class LinkDecodeLevel {
249 nothing = 0,
251 header = 1,
253 payload = 2,
254};
255
259const char* to_string(LinkDecodeLevel value);
260
262enum class PhysDecodeLevel {
264 nothing = 0,
266 length = 1,
268 data = 2,
269};
270
274const char* to_string(PhysDecodeLevel value);
275
276struct DecodeLevel;
277
280 friend class CppDecodeLevelFriend;
281
282private:
290
291public:
292
303
304
315
316
325};
326
327class Runtime;
328
329struct RuntimeConfig;
330
333 friend class CppRuntimeConfigFriend;
334
335private:
340
341public:
342
350
351
356};
357
359class Runtime {
360 friend class CppRuntimeFriend;
361 // pointer to the underlying C type
362 void* self;
363 // constructor only accessible internally
364 Runtime(void* self): self(self) {}
365 // non-copyable
366 Runtime(const Runtime&) = delete;
367 Runtime& operator=(const Runtime&) = delete;
368 // no move assignment
369 Runtime& operator=(Runtime&& other) = delete;
370
371public:
375 Runtime(Runtime&& other) noexcept : self(other.self) { other.self = nullptr; }
376
383 Runtime(const RuntimeConfig& config);
384
389
397 void set_shutdown_timeout(std::chrono::steady_clock::duration timeout);
398};
399
400struct ControlField;
401
404 friend class CppControlFieldFriend;
405
406private:
414 ControlField(bool fir, bool fin, bool con, bool uns, uint8_t seq);
415
416public:
417 ControlField() = delete;
418
420 bool fir;
422 bool fin;
424 bool con;
426 bool uns;
428 uint8_t seq;
429};
430
432enum class TripCloseCode {
434 nul = 0,
436 close = 1,
438 trip = 2,
440 reserved = 3,
441};
442
446const char* to_string(TripCloseCode value);
447
449enum class OpType {
451 nul = 0,
453 pulse_on = 1,
455 pulse_off = 2,
457 latch_on = 3,
459 latch_off = 4,
460};
461
465const char* to_string(OpType value);
466
467struct ControlCode;
468
471 friend class CppControlCodeFriend;
472
473private:
481
482public:
483 ControlCode() = delete;
484
495
496
509
510
523
524
528 bool clear;
530 bool queue;
533};
534
535struct Group12Var1;
536
539 friend class CppGroup12Var1Friend;
540
541 Group12Var1() = delete;
542
549 Group12Var1(const ControlCode& code, uint8_t count, uint32_t on_time, uint32_t off_time);
550
551
564
565
569 uint8_t count;
571 uint32_t on_time;
573 uint32_t off_time;
574};
575
576struct Flags;
577
579struct Flags {
580 friend class CppFlagsFriend;
581
582 Flags() = delete;
583
587 Flags(uint8_t value);
588
589
591 uint8_t value;
592};
593
595enum class TimeQuality {
601 invalid_time = 2,
602};
603
607const char* to_string(TimeQuality value);
608
609struct Timestamp;
610
612struct Timestamp {
613 friend class CppTimestampFriend;
614
615private:
621
622public:
623 Timestamp() = delete;
624
633
634
643
644
653
654
658 uint64_t value;
661};
662
664enum class DoubleBit {
666 intermediate = 0,
668 determined_off = 1,
670 determined_on = 2,
672 indeterminate = 3,
673};
674
678const char* to_string(DoubleBit value);
679
680struct BinaryInput;
681
684 friend class CppBinaryInputFriend;
685
686 BinaryInput() = delete;
687
694 BinaryInput(uint16_t index, bool value, const Flags& flags, const Timestamp& time);
695
696
698 uint16_t index;
700 bool value;
705};
706
708
721
722 friend class CppBinaryInputIteratorFriend;
723
724 // underlying opaque c type
725 void* iter;
726 // pointer to the last retrieved c value
727 void* current;
728
729 // internal constructor
730 BinaryInputIterator(void* iter) : iter(iter), current(nullptr) {}
731
732 BinaryInputIterator() = delete; // no default construction
733 BinaryInputIterator(const BinaryInputIterator&) = delete; // no copies
734 BinaryInputIterator& operator=(const BinaryInputIterator&) = delete; // no self-assignment
735 BinaryInputIterator& operator=(BinaryInputIterator&&) = delete; // no move self-assignment
736
737public:
738
741
744 bool next();
745
750};
751
753
756 friend class CppDoubleBitBinaryInputFriend;
757
758 DoubleBitBinaryInput() = delete;
759
767
768
770 uint16_t index;
777};
778
780
793
794 friend class CppDoubleBitBinaryInputIteratorFriend;
795
796 // underlying opaque c type
797 void* iter;
798 // pointer to the last retrieved c value
799 void* current;
800
801 // internal constructor
802 DoubleBitBinaryInputIterator(void* iter) : iter(iter), current(nullptr) {}
803
804 DoubleBitBinaryInputIterator() = delete; // no default construction
806 DoubleBitBinaryInputIterator& operator=(const DoubleBitBinaryInputIterator&) = delete; // no self-assignment
807 DoubleBitBinaryInputIterator& operator=(DoubleBitBinaryInputIterator&&) = delete; // no move self-assignment
808
809public:
810
813
816 bool next();
817
822};
823
824struct BinaryOutputStatus;
825
828 friend class CppBinaryOutputStatusFriend;
829
830 BinaryOutputStatus() = delete;
831
838 BinaryOutputStatus(uint16_t index, bool value, const Flags& flags, const Timestamp& time);
839
840
842 uint16_t index;
844 bool value;
849};
850
852
865
866 friend class CppBinaryOutputStatusIteratorFriend;
867
868 // underlying opaque c type
869 void* iter;
870 // pointer to the last retrieved c value
871 void* current;
872
873 // internal constructor
874 BinaryOutputStatusIterator(void* iter) : iter(iter), current(nullptr) {}
875
876 BinaryOutputStatusIterator() = delete; // no default construction
877 BinaryOutputStatusIterator(const BinaryOutputStatusIterator&) = delete; // no copies
878 BinaryOutputStatusIterator& operator=(const BinaryOutputStatusIterator&) = delete; // no self-assignment
879 BinaryOutputStatusIterator& operator=(BinaryOutputStatusIterator&&) = delete; // no move self-assignment
880
881public:
882
885
888 bool next();
889
894};
895
896struct Counter;
897
899struct Counter {
900 friend class CppCounterFriend;
901
902 Counter() = delete;
903
910 Counter(uint16_t index, uint32_t value, const Flags& flags, const Timestamp& time);
911
912
914 uint16_t index;
916 uint32_t value;
921};
922
923class CounterIterator;
924
936class CounterIterator final {
937
938 friend class CppCounterIteratorFriend;
939
940 // underlying opaque c type
941 void* iter;
942 // pointer to the last retrieved c value
943 void* current;
944
945 // internal constructor
946 CounterIterator(void* iter) : iter(iter), current(nullptr) {}
947
948 CounterIterator() = delete; // no default construction
949 CounterIterator(const CounterIterator&) = delete; // no copies
950 CounterIterator& operator=(const CounterIterator&) = delete; // no self-assignment
951 CounterIterator& operator=(CounterIterator&&) = delete; // no move self-assignment
952
953public:
954
957
960 bool next();
961
966};
967
968struct FrozenCounter;
969
972 friend class CppFrozenCounterFriend;
973
974 FrozenCounter() = delete;
975
982 FrozenCounter(uint16_t index, uint32_t value, const Flags& flags, const Timestamp& time);
983
984
986 uint16_t index;
988 uint32_t value;
993};
994
996
1009
1010 friend class CppFrozenCounterIteratorFriend;
1011
1012 // underlying opaque c type
1013 void* iter;
1014 // pointer to the last retrieved c value
1015 void* current;
1016
1017 // internal constructor
1018 FrozenCounterIterator(void* iter) : iter(iter), current(nullptr) {}
1019
1020 FrozenCounterIterator() = delete; // no default construction
1021 FrozenCounterIterator(const FrozenCounterIterator&) = delete; // no copies
1022 FrozenCounterIterator& operator=(const FrozenCounterIterator&) = delete; // no self-assignment
1023 FrozenCounterIterator& operator=(FrozenCounterIterator&&) = delete; // no move self-assignment
1024
1025public:
1026
1029
1032 bool next();
1033
1038};
1039
1040struct AnalogInput;
1041
1044 friend class CppAnalogInputFriend;
1045
1046 AnalogInput() = delete;
1047
1054 AnalogInput(uint16_t index, double value, const Flags& flags, const Timestamp& time);
1055
1056
1058 uint16_t index;
1060 double value;
1065};
1066
1068
1081
1082 friend class CppAnalogInputIteratorFriend;
1083
1084 // underlying opaque c type
1085 void* iter;
1086 // pointer to the last retrieved c value
1087 void* current;
1088
1089 // internal constructor
1090 AnalogInputIterator(void* iter) : iter(iter), current(nullptr) {}
1091
1092 AnalogInputIterator() = delete; // no default construction
1093 AnalogInputIterator(const AnalogInputIterator&) = delete; // no copies
1094 AnalogInputIterator& operator=(const AnalogInputIterator&) = delete; // no self-assignment
1095 AnalogInputIterator& operator=(AnalogInputIterator&&) = delete; // no move self-assignment
1096
1097public:
1098
1101
1104 bool next();
1105
1110};
1111
1112struct FrozenAnalogInput;
1113
1116 friend class CppFrozenAnalogInputFriend;
1117
1118 FrozenAnalogInput() = delete;
1119
1126 FrozenAnalogInput(uint16_t index, double value, const Flags& flags, const Timestamp& time);
1127
1128
1130 uint16_t index;
1132 double value;
1137};
1138
1140
1153
1154 friend class CppFrozenAnalogInputIteratorFriend;
1155
1156 // underlying opaque c type
1157 void* iter;
1158 // pointer to the last retrieved c value
1159 void* current;
1160
1161 // internal constructor
1162 FrozenAnalogInputIterator(void* iter) : iter(iter), current(nullptr) {}
1163
1164 FrozenAnalogInputIterator() = delete; // no default construction
1165 FrozenAnalogInputIterator(const FrozenAnalogInputIterator&) = delete; // no copies
1166 FrozenAnalogInputIterator& operator=(const FrozenAnalogInputIterator&) = delete; // no self-assignment
1167 FrozenAnalogInputIterator& operator=(FrozenAnalogInputIterator&&) = delete; // no move self-assignment
1168
1169public:
1170
1173
1176 bool next();
1177
1182};
1183
1184struct AnalogOutputStatus;
1185
1188 friend class CppAnalogOutputStatusFriend;
1189
1190 AnalogOutputStatus() = delete;
1191
1198 AnalogOutputStatus(uint16_t index, double value, const Flags& flags, const Timestamp& time);
1199
1200
1202 uint16_t index;
1204 double value;
1209};
1210
1212
1225
1226 friend class CppAnalogOutputStatusIteratorFriend;
1227
1228 // underlying opaque c type
1229 void* iter;
1230 // pointer to the last retrieved c value
1231 void* current;
1232
1233 // internal constructor
1234 AnalogOutputStatusIterator(void* iter) : iter(iter), current(nullptr) {}
1235
1236 AnalogOutputStatusIterator() = delete; // no default construction
1237 AnalogOutputStatusIterator(const AnalogOutputStatusIterator&) = delete; // no copies
1238 AnalogOutputStatusIterator& operator=(const AnalogOutputStatusIterator&) = delete; // no self-assignment
1239 AnalogOutputStatusIterator& operator=(AnalogOutputStatusIterator&&) = delete; // no move self-assignment
1240
1241public:
1242
1245
1248 bool next();
1249
1254};
1255
1257
1264 friend class CppBinaryOutputCommandEventFriend;
1265
1266 BinaryOutputCommandEvent() = delete;
1267
1275
1276
1278 uint16_t index;
1287};
1288
1290
1303
1304 friend class CppBinaryOutputCommandEventIteratorFriend;
1305
1306 // underlying opaque c type
1307 void* iter;
1308 // pointer to the last retrieved c value
1309 void* current;
1310
1311 // internal constructor
1312 BinaryOutputCommandEventIterator(void* iter) : iter(iter), current(nullptr) {}
1313
1314 BinaryOutputCommandEventIterator() = delete; // no default construction
1316 BinaryOutputCommandEventIterator& operator=(const BinaryOutputCommandEventIterator&) = delete; // no self-assignment
1317 BinaryOutputCommandEventIterator& operator=(BinaryOutputCommandEventIterator&&) = delete; // no move self-assignment
1318
1319public:
1320
1323
1326 bool next();
1327
1332};
1333
1337 i16 = 0,
1339 i32 = 1,
1341 f32 = 2,
1343 f64 = 3,
1344};
1345
1349const char* to_string(AnalogCommandType value);
1350
1352
1359 friend class CppAnalogOutputCommandEventFriend;
1360
1361 AnalogOutputCommandEvent() = delete;
1362
1371
1372
1374 uint16_t index;
1385};
1386
1388
1401
1402 friend class CppAnalogOutputCommandEventIteratorFriend;
1403
1404 // underlying opaque c type
1405 void* iter;
1406 // pointer to the last retrieved c value
1407 void* current;
1408
1409 // internal constructor
1410 AnalogOutputCommandEventIterator(void* iter) : iter(iter), current(nullptr) {}
1411
1412 AnalogOutputCommandEventIterator() = delete; // no default construction
1414 AnalogOutputCommandEventIterator& operator=(const AnalogOutputCommandEventIterator&) = delete; // no self-assignment
1415 AnalogOutputCommandEventIterator& operator=(AnalogOutputCommandEventIterator&&) = delete; // no move self-assignment
1416
1417public:
1418
1421
1424 bool next();
1425
1430};
1431
1432struct UnsignedInteger;
1433
1438 friend class CppUnsignedIntegerFriend;
1439
1440 UnsignedInteger() = delete;
1441
1446 UnsignedInteger(uint16_t index, uint8_t value);
1447
1448
1450 uint16_t index;
1452 uint8_t value;
1453};
1454
1456
1469
1470 friend class CppUnsignedIntegerIteratorFriend;
1471
1472 // underlying opaque c type
1473 void* iter;
1474 // pointer to the last retrieved c value
1475 void* current;
1476
1477 // internal constructor
1478 UnsignedIntegerIterator(void* iter) : iter(iter), current(nullptr) {}
1479
1480 UnsignedIntegerIterator() = delete; // no default construction
1481 UnsignedIntegerIterator(const UnsignedIntegerIterator&) = delete; // no copies
1482 UnsignedIntegerIterator& operator=(const UnsignedIntegerIterator&) = delete; // no self-assignment
1483 UnsignedIntegerIterator& operator=(UnsignedIntegerIterator&&) = delete; // no move self-assignment
1484
1485public:
1486
1489
1492 bool next();
1493
1498};
1499
1500class ByteIterator;
1501
1513class ByteIterator final {
1514
1515 friend class CppByteIteratorFriend;
1516
1517 // underlying opaque c type
1518 void* iter;
1519 // pointer to the last retrieved c value
1520 void* current;
1521
1522 // internal constructor
1523 ByteIterator(void* iter) : iter(iter), current(nullptr) {}
1524
1525 ByteIterator() = delete; // no default construction
1526 ByteIterator(const ByteIterator&) = delete; // no copies
1527 ByteIterator& operator=(const ByteIterator&) = delete; // no self-assignment
1528 ByteIterator& operator=(ByteIterator&&) = delete; // no move self-assignment
1529
1530public:
1531
1534
1537 bool next();
1538
1542 uint8_t get();
1543};
1544
1545struct OctetString;
1546
1549 friend class CppOctetStringFriend;
1550
1551private:
1557
1558public:
1559 OctetString() = delete;
1560
1562 uint16_t index;
1565};
1566
1568
1581
1582 friend class CppOctetStringIteratorFriend;
1583
1584 // underlying opaque c type
1585 void* iter;
1586 // pointer to the last retrieved c value
1587 void* current;
1588
1589 // internal constructor
1590 OctetStringIterator(void* iter) : iter(iter), current(nullptr) {}
1591
1592 OctetStringIterator() = delete; // no default construction
1593 OctetStringIterator(const OctetStringIterator&) = delete; // no copies
1594 OctetStringIterator& operator=(const OctetStringIterator&) = delete; // no self-assignment
1595 OctetStringIterator& operator=(OctetStringIterator&&) = delete; // no move self-assignment
1596
1597public:
1598
1601
1604 bool next();
1605
1610};
1611
1612class ConnectOptions;
1613
1616 friend class CppConnectOptionsFriend;
1617 // pointer to the underlying C type
1618 void* self;
1619 // constructor only accessible internally
1620 ConnectOptions(void* self): self(self) {}
1621 // non-copyable
1622 ConnectOptions(const ConnectOptions&) = delete;
1623 ConnectOptions& operator=(const ConnectOptions&) = delete;
1624 // no move assignment
1625 ConnectOptions& operator=(ConnectOptions&& other) = delete;
1626
1627public:
1631 ConnectOptions(ConnectOptions&& other) noexcept : self(other.self) { other.self = nullptr; }
1632
1636
1639
1643 void set_timeout(std::chrono::steady_clock::duration timeout);
1644
1651 void set_local_endpoint(const std::string& endpoint);
1652};
1653
1654class EndpointList;
1655
1660 friend class CppEndpointListFriend;
1661 // pointer to the underlying C type
1662 void* self;
1663 // constructor only accessible internally
1664 EndpointList(void* self): self(self) {}
1665 // non-copyable
1666 EndpointList(const EndpointList&) = delete;
1667 EndpointList& operator=(const EndpointList&) = delete;
1668 // no move assignment
1669 EndpointList& operator=(EndpointList&& other) = delete;
1670
1671public:
1675 EndpointList(EndpointList&& other) noexcept : self(other.self) { other.self = nullptr; }
1676
1682 EndpointList(const std::string& main_endpoint);
1683
1686
1692 void add(const std::string& endpoint);
1693};
1694
1695struct ConnectStrategy;
1696
1699 friend class CppConnectStrategyFriend;
1700
1701private:
1707 ConnectStrategy(std::chrono::steady_clock::duration min_connect_delay, std::chrono::steady_clock::duration max_connect_delay, std::chrono::steady_clock::duration reconnect_delay);
1708
1709public:
1710
1720
1721
1723 std::chrono::steady_clock::duration min_connect_delay;
1725 std::chrono::steady_clock::duration max_connect_delay;
1727 std::chrono::steady_clock::duration reconnect_delay;
1728};
1729
1731enum class MinTlsVersion {
1733 v12 = 0,
1735 v13 = 1,
1736};
1737
1741const char* to_string(MinTlsVersion value);
1742
1752 authority_based = 0,
1756 self_signed = 1,
1757};
1758
1762const char* to_string(CertificateMode value);
1763
1764struct TlsClientConfig;
1765
1768 friend class CppTlsClientConfigFriend;
1769
1770private:
1781 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);
1782
1783public:
1784 TlsClientConfig() = delete;
1785
1799 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);
1800
1801
1805 std::string dns_name;
1807 std::string peer_cert_path;
1809 std::string local_cert_path;
1811 std::string private_key_path;
1817 std::string password;
1824};
1825
1827namespace attribute_variations {
1829 constexpr uint8_t config_id = 0xC4;
1831 constexpr uint8_t config_version = 0xC5;
1833 constexpr uint8_t config_build_date = 0xC6;
1835 constexpr uint8_t config_last_change_date = 0xC7;
1837 constexpr uint8_t config_digest = 0xC8;
1839 constexpr uint8_t config_digest_algorithm = 0xC9;
1841 constexpr uint8_t master_resource_id = 0xCA;
1843 constexpr uint8_t device_location_altitude = 0xCB;
1845 constexpr uint8_t device_location_longitude = 0xCC;
1847 constexpr uint8_t device_location_latitude = 0xCD;
1851 constexpr uint8_t user_assigned_primary_operator_name = 0xCF;
1853 constexpr uint8_t user_assigned_system_name = 0xD0;
1855 constexpr uint8_t secure_auth_version = 0xD1;
1857 constexpr uint8_t num_security_stats_per_assoc = 0xD2;
1859 constexpr uint8_t user_specific_attributes = 0xD3;
1861 constexpr uint8_t num_master_defined_data_set_proto = 0xD4;
1865 constexpr uint8_t num_master_defined_data_sets = 0xD6;
1867 constexpr uint8_t num_outstation_defined_data_sets = 0xD7;
1869 constexpr uint8_t max_binary_output_per_request = 0xD8;
1871 constexpr uint8_t local_timing_accuracy = 0xD9;
1873 constexpr uint8_t duration_of_time_accuracy = 0xDA;
1875 constexpr uint8_t supports_analog_output_events = 0xDB;
1877 constexpr uint8_t max_analog_output_index = 0xDC;
1879 constexpr uint8_t num_analog_outputs = 0xDD;
1881 constexpr uint8_t supports_binary_output_events = 0xDE;
1883 constexpr uint8_t max_binary_output_index = 0xDF;
1885 constexpr uint8_t num_binary_outputs = 0xE0;
1887 constexpr uint8_t supports_frozen_counter_events = 0xE1;
1889 constexpr uint8_t supports_frozen_counters = 0xE2;
1891 constexpr uint8_t supports_counter_events = 0xE3;
1893 constexpr uint8_t max_counter_index = 0xE4;
1895 constexpr uint8_t num_counter = 0xE5;
1897 constexpr uint8_t supports_frozen_analog_inputs = 0xE6;
1899 constexpr uint8_t supports_analog_input_events = 0xE7;
1901 constexpr uint8_t max_analog_input_index = 0xE8;
1903 constexpr uint8_t num_analog_input = 0xE9;
1907 constexpr uint8_t max_double_bit_binary_input_index = 0xEB;
1909 constexpr uint8_t num_double_bit_binary_input = 0xEC;
1911 constexpr uint8_t supports_binary_input_events = 0xED;
1913 constexpr uint8_t max_binary_input_index = 0xEE;
1915 constexpr uint8_t num_binary_input = 0xEF;
1917 constexpr uint8_t max_tx_fragment_size = 0xF0;
1919 constexpr uint8_t max_rx_fragment_size = 0xF1;
1925 constexpr uint8_t user_assigned_owner_name = 0xF4;
1927 constexpr uint8_t user_assigned_location = 0xF5;
1929 constexpr uint8_t user_assigned_id = 0xF6;
1931 constexpr uint8_t user_assigned_device_name = 0xF7;
1933 constexpr uint8_t device_serial_number = 0xF8;
1935 constexpr uint8_t device_subset_and_conformance = 0xF9;
1937 constexpr uint8_t product_name_and_model = 0xFA;
1939 constexpr uint8_t device_manufacturers_name = 0xFC;
1941 constexpr uint8_t all_attributes_request = 0xFE;
1943 constexpr uint8_t list_of_variations = 0xFF;
1944}
1945
1949 unknown = 0,
1952};
1953
1957const char* to_string(VariationListAttr value);
1958
1960enum class StringAttr {
1962 unknown = 0,
1964 config_id = 1,
1966 config_version = 2,
1988 user_assigned_id = 13,
1999};
2000
2004const char* to_string(StringAttr value);
2005
2007enum class UintAttr {
2009 unknown = 0,
2031 num_analog_outputs = 11,
2035 num_binary_outputs = 13,
2037 max_counter_index = 14,
2039 num_counter = 15,
2043 num_analog_input = 17,
2051 num_binary_input = 21,
2056};
2057
2061const char* to_string(UintAttr value);
2062
2066enum class IntAttr {
2068 unknown = 0,
2069};
2070
2074const char* to_string(IntAttr value);
2075
2079enum class BoolAttr {
2081 unknown = 0,
2100};
2101
2105const char* to_string(BoolAttr value);
2106
2108enum class TimeAttr {
2110 unknown = 0,
2115};
2116
2120const char* to_string(TimeAttr value);
2121
2125 unknown = 0,
2127 config_digest = 1,
2128};
2129
2133const char* to_string(OctetStringAttr value);
2134
2136enum class BitStringAttr {
2138 unknown = 0,
2139};
2140
2144const char* to_string(BitStringAttr value);
2145
2147enum class FloatAttr {
2149 unknown = 0,
2156};
2157
2161const char* to_string(FloatAttr value);
2162
2163struct AttrProp;
2164
2168struct AttrProp {
2169 friend class CppAttrPropFriend;
2170
2171private:
2175 AttrProp(bool is_writable);
2176
2177public:
2178 AttrProp() = delete;
2179
2182};
2183
2184struct AttrItem;
2185
2187struct AttrItem {
2188 friend class CppAttrItemFriend;
2189
2190private:
2195 AttrItem(uint8_t variation, const AttrProp& properties);
2196
2197public:
2198 AttrItem() = delete;
2199
2201 uint8_t variation;
2204};
2205
2206class AttrItemIter;
2207
2219class AttrItemIter final {
2220
2221 friend class CppAttrItemIterFriend;
2222
2223 // underlying opaque c type
2224 void* iter;
2225 // pointer to the last retrieved c value
2226 void* current;
2227
2228 // internal constructor
2229 AttrItemIter(void* iter) : iter(iter), current(nullptr) {}
2230
2231 AttrItemIter() = delete; // no default construction
2232 AttrItemIter(const AttrItemIter&) = delete; // no copies
2233 AttrItemIter& operator=(const AttrItemIter&) = delete; // no self-assignment
2234 AttrItemIter& operator=(AttrItemIter&&) = delete; // no move self-assignment
2235
2236public:
2237
2240
2243 bool next();
2244
2249};
2250
2252enum class Nothing {
2254 nothing = 0,
2255};
2256
2260const char* to_string(Nothing value);
2261
2263enum class PortState {
2265 disabled = 0,
2267 wait = 1,
2269 open = 2,
2271 shutdown = 3,
2272};
2273
2277const char* to_string(PortState value);
2278
2283public:
2284 virtual ~PortStateListener() = default;
2285
2289 virtual void on_change(PortState state) = 0;
2290
2291};
2292
2294namespace functional {
2295
2298template <class T>
2300{
2301 static_assert(std::is_copy_constructible<T>::value, "Lambda expression must be copy constructible. Does it contain something that is move-only?");
2302
2303 T lambda;
2304
2305public:
2308 PortStateListenerLambda(const T& lambda) : lambda(lambda) {}
2309
2311 void on_change(PortState state) override
2312 {
2313 lambda(state);
2314 }
2315};
2316
2321template <class T>
2322std::unique_ptr<PortStateListener> port_state_listener(const T& lambda)
2323{
2324 return std::make_unique<PortStateListenerLambda<T>>(lambda); ;
2325}
2326
2327} // end namespace functional
2328
2332enum class ClientState {
2334 disabled = 0,
2336 connecting = 1,
2338 connected = 2,
2344 shutdown = 5,
2345};
2346
2350const char* to_string(ClientState value);
2351
2356public:
2357 virtual ~ClientStateListener() = default;
2358
2362 virtual void on_change(ClientState state) = 0;
2363
2364};
2365
2366namespace functional {
2367
2370template <class T>
2372{
2373 static_assert(std::is_copy_constructible<T>::value, "Lambda expression must be copy constructible. Does it contain something that is move-only?");
2374
2375 T lambda;
2376
2377public:
2380 ClientStateListenerLambda(const T& lambda) : lambda(lambda) {}
2381
2383 void on_change(ClientState state) override
2384 {
2385 lambda(state);
2386 }
2387};
2388
2393template <class T>
2394std::unique_ptr<ClientStateListener> client_state_listener(const T& lambda)
2395{
2396 return std::make_unique<ClientStateListenerLambda<T>>(lambda); ;
2397}
2398
2399} // end namespace functional
2400
2402enum class Variation {
2404 group0 = 0,
2406 group0_var254 = 1,
2408 group1_var0 = 2,
2410 group1_var1 = 3,
2412 group1_var2 = 4,
2414 group2_var0 = 5,
2416 group2_var1 = 6,
2418 group2_var2 = 7,
2420 group2_var3 = 8,
2422 group3_var0 = 9,
2424 group3_var1 = 10,
2426 group3_var2 = 11,
2428 group4_var0 = 12,
2430 group4_var1 = 13,
2432 group4_var2 = 14,
2434 group4_var3 = 15,
2436 group10_var0 = 16,
2438 group10_var1 = 17,
2440 group10_var2 = 18,
2442 group11_var0 = 19,
2444 group11_var1 = 20,
2446 group11_var2 = 21,
2448 group12_var1 = 22,
2450 group13_var1 = 23,
2452 group13_var2 = 24,
2454 group20_var0 = 25,
2456 group20_var1 = 26,
2458 group20_var2 = 27,
2460 group20_var5 = 28,
2462 group20_var6 = 29,
2464 group21_var0 = 30,
2466 group21_var1 = 31,
2468 group21_var2 = 32,
2470 group21_var5 = 33,
2472 group21_var6 = 34,
2474 group21_var9 = 35,
2476 group21_var10 = 36,
2478 group22_var0 = 37,
2480 group22_var1 = 38,
2482 group22_var2 = 39,
2484 group22_var5 = 40,
2486 group22_var6 = 41,
2488 group23_var0 = 42,
2490 group23_var1 = 43,
2492 group23_var2 = 44,
2494 group23_var5 = 45,
2496 group23_var6 = 46,
2498 group30_var0 = 47,
2500 group30_var1 = 48,
2502 group30_var2 = 49,
2504 group30_var3 = 50,
2506 group30_var4 = 51,
2508 group30_var5 = 52,
2510 group30_var6 = 53,
2512 group31_var0 = 54,
2514 group31_var1 = 55,
2516 group31_var2 = 56,
2518 group31_var3 = 57,
2520 group31_var4 = 58,
2522 group31_var5 = 59,
2524 group31_var6 = 60,
2526 group31_var7 = 61,
2528 group31_var8 = 62,
2530 group32_var0 = 63,
2532 group32_var1 = 64,
2534 group32_var2 = 65,
2536 group32_var3 = 66,
2538 group32_var4 = 67,
2540 group32_var5 = 68,
2542 group32_var6 = 69,
2544 group32_var7 = 70,
2546 group32_var8 = 71,
2548 group33_var0 = 72,
2550 group33_var1 = 73,
2552 group33_var2 = 74,
2554 group33_var3 = 75,
2556 group33_var4 = 76,
2558 group33_var5 = 77,
2560 group33_var6 = 78,
2562 group33_var7 = 79,
2564 group33_var8 = 80,
2566 group34_var0 = 81,
2568 group34_var1 = 82,
2570 group34_var2 = 83,
2572 group34_var3 = 84,
2574 group40_var0 = 85,
2576 group40_var1 = 86,
2578 group40_var2 = 87,
2580 group40_var3 = 88,
2582 group40_var4 = 89,
2584 group41_var1 = 90,
2586 group41_var2 = 91,
2588 group41_var3 = 92,
2590 group41_var4 = 93,
2592 group42_var0 = 94,
2594 group42_var1 = 95,
2596 group42_var2 = 96,
2598 group42_var3 = 97,
2600 group42_var4 = 98,
2602 group42_var5 = 99,
2604 group42_var6 = 100,
2606 group42_var7 = 101,
2608 group42_var8 = 102,
2610 group43_var1 = 103,
2612 group43_var2 = 104,
2614 group43_var3 = 105,
2616 group43_var4 = 106,
2618 group43_var5 = 107,
2620 group43_var6 = 108,
2622 group43_var7 = 109,
2624 group43_var8 = 110,
2626 group50_var1 = 111,
2628 group50_var2 = 112,
2630 group50_var3 = 113,
2632 group50_var4 = 114,
2634 group51_var1 = 115,
2636 group51_var2 = 116,
2638 group52_var1 = 117,
2640 group52_var2 = 118,
2642 group60_var1 = 119,
2644 group60_var2 = 120,
2646 group60_var3 = 121,
2648 group60_var4 = 122,
2650 group70_var2 = 123,
2652 group70_var3 = 124,
2654 group70_var4 = 125,
2656 group70_var5 = 126,
2658 group70_var6 = 127,
2660 group70_var7 = 128,
2662 group70_var8 = 129,
2664 group80_var1 = 130,
2666 group102_var0 = 131,
2668 group102_var1 = 132,
2670 group110 = 133,
2672 group111 = 134,
2673};
2674
2678const char* to_string(Variation value);
2679
2680struct RetryStrategy;
2681
2686 friend class CppRetryStrategyFriend;
2687
2688private:
2693 RetryStrategy(std::chrono::steady_clock::duration min_delay, std::chrono::steady_clock::duration max_delay);
2694
2695public:
2696
2705
2706
2708 std::chrono::steady_clock::duration min_delay;
2710 std::chrono::steady_clock::duration max_delay;
2711};
2712
2714enum class DataBits {
2716 five = 0,
2718 six = 1,
2720 seven = 2,
2722 eight = 3,
2723};
2724
2728const char* to_string(DataBits value);
2729
2731enum class FlowControl {
2733 none = 0,
2735 software = 1,
2737 hardware = 2,
2738};
2739
2743const char* to_string(FlowControl value);
2744
2746enum class Parity {
2748 none = 0,
2750 odd = 1,
2752 even = 2,
2753};
2754
2758const char* to_string(Parity value);
2759
2761enum class StopBits {
2763 one = 0,
2765 two = 1,
2766};
2767
2771const char* to_string(StopBits value);
2772
2773struct SerialSettings;
2774
2777 friend class CppSerialSettingsFriend;
2778
2779private:
2788
2789public:
2790
2802
2803
2805 uint32_t baud_rate;
2814};
2815
2817enum class LinkErrorMode {
2819 discard = 0,
2821 close = 1,
2822};
2823
2827const char* to_string(LinkErrorMode value);
2828
2830enum class FunctionCode {
2832 confirm = 0,
2834 read = 1,
2836 write = 2,
2838 select = 3,
2840 operate = 4,
2842 direct_operate = 5,
2846 immediate_freeze = 7,
2850 freeze_clear = 9,
2854 freeze_at_time = 11,
2858 cold_restart = 13,
2860 warm_restart = 14,
2862 initialize_data = 15,
2866 start_application = 17,
2868 stop_application = 18,
2870 save_configuration = 19,
2872 enable_unsolicited = 20,
2876 assign_class = 22,
2878 delay_measure = 23,
2882 open_file = 25,
2884 close_file = 26,
2886 delete_file = 27,
2888 get_file_info = 28,
2890 authenticate_file = 29,
2892 abort_file = 30,
2894 response = 31,
2897};
2898
2902const char* to_string(FunctionCode value);
2903
2905enum class FileType {
2907 directory = 0,
2909 simple = 1,
2911 other = 2,
2912};
2913
2917const char* to_string(FileType value);
2918
2919struct PermissionSet;
2920
2923 friend class CppPermissionSetFriend;
2924
2925
2931 PermissionSet(bool execute, bool write, bool read);
2932
2933
2943
2944
2948 bool write;
2950 bool read;
2951};
2952
2953struct Permissions;
2954
2957 friend class CppPermissionsFriend;
2958
2959 Permissions() = delete;
2960
2967
2968
2978
2979
2986};
2987
2988struct OpenFile;
2989
2991struct OpenFile {
2992 friend class CppOpenFileFriend;
2993
2994private:
3000 OpenFile(uint32_t file_handle, uint32_t file_size, uint16_t max_block_size);
3001
3002public:
3003 OpenFile() = delete;
3004
3008 uint32_t file_handle;
3010 uint32_t file_size;
3015};
3016
3018enum class FileError {
3020 ok = 0,
3022 bad_status = 1,
3024 no_permission = 2,
3026 bad_block_num = 3,
3028 abort_by_user = 4,
3032 wrong_handle = 6,
3036 iin_error = 8,
3038 bad_response = 9,
3040 response_timeout = 10,
3042 write_error = 11,
3044 no_connection = 12,
3046 shutdown = 13,
3050 bad_encoding = 15,
3051};
3052
3056const char* to_string(FileError value);
3057
3059class FileException : public std::logic_error {
3060public:
3065};
3066
3067struct FileInfo;
3068
3072struct FileInfo {
3073 friend class CppFileInfoFriend;
3074
3075private:
3083 FileInfo(const std::string& file_name, FileType file_type, uint32_t size, uint64_t time_created, const Permissions& permissions);
3084
3085public:
3086 FileInfo() = delete;
3087
3089 std::string file_name;
3095 uint32_t size;
3102};
3103
3108public:
3109 virtual ~FileOpenCallback() = default;
3110
3114 virtual void on_complete(const OpenFile& result) = 0;
3115
3119 virtual void on_failure(FileError error) = 0;
3120
3121};
3122
3127public:
3128 virtual ~FileOperationCallback() = default;
3129
3133 virtual void on_complete(Nothing result) = 0;
3134
3138 virtual void on_failure(FileError error) = 0;
3139
3140};
3141
3146public:
3147 virtual ~FileAuthCallback() = default;
3148
3152 virtual void on_complete(uint32_t result) = 0;
3153
3157 virtual void on_failure(FileError error) = 0;
3158
3159};
3160
3162enum class FileMode {
3164 read = 0,
3166 write = 1,
3168 append = 2,
3169};
3170
3174const char* to_string(FileMode value);
3175
3177enum class UdpSocketMode {
3179 one_to_one = 0,
3183 one_to_many = 1,
3184};
3185
3189const char* to_string(UdpSocketMode value);
3190
3194enum class LinkReadMode {
3196 stream = 0,
3198 datagram = 1,
3199};
3200
3204const char* to_string(LinkReadMode value);
3205
3209enum class LogLevel {
3211 error = 0,
3213 warn = 1,
3215 info = 2,
3217 debug = 3,
3219 trace = 4,
3220};
3221
3225const char* to_string(LogLevel value);
3226
3227struct LoggingConfig;
3228
3232 text = 0,
3234 json = 1,
3235};
3236
3240const char* to_string(LogOutputFormat value);
3241
3243enum class TimeFormat {
3245 none = 0,
3247 rfc_3339 = 1,
3249 system = 2,
3250};
3251
3255const char* to_string(TimeFormat value);
3256
3259 friend class CppLoggingConfigFriend;
3260
3261private:
3270
3271public:
3272
3284
3285
3296};
3297
3301class Logger {
3302public:
3303 virtual ~Logger() = default;
3304
3309 virtual void on_message(LogLevel level, const char* message) = 0;
3310
3311};
3312
3313namespace functional {
3314
3317template <class T>
3318class LoggerLambda final : public Logger
3319{
3320 static_assert(std::is_copy_constructible<T>::value, "Lambda expression must be copy constructible. Does it contain something that is move-only?");
3321
3322 T lambda;
3323
3324public:
3327 LoggerLambda(const T& lambda) : lambda(lambda) {}
3328
3330 void on_message(LogLevel level, const char* message) override
3331 {
3332 lambda(level, message);
3333 }
3334};
3335
3340template <class T>
3341std::unique_ptr<Logger> logger(const T& lambda)
3342{
3343 return std::make_unique<LoggerLambda<T>>(lambda); ;
3344}
3345
3346} // end namespace functional
3347
3349class Logging {
3350 Logging() = delete;
3351public:
3361 static void configure(const LoggingConfig& config, std::unique_ptr<Logger> logger);
3362};
3363
3367 response = 0,
3370};
3371
3375const char* to_string(ResponseFunction value);
3376
3377struct Iin1;
3378
3380struct Iin1 {
3381 friend class CppIin1Friend;
3382
3383private:
3395
3396public:
3397 Iin1() = delete;
3398
3415};
3416
3417struct Iin2;
3418
3420struct Iin2 {
3421 friend class CppIin2Friend;
3422
3423private:
3435
3436public:
3437 Iin2() = delete;
3438
3455};
3456
3457struct Iin;
3458
3460struct Iin {
3461 friend class CppIinFriend;
3462
3463private:
3468 Iin(const Iin1& iin1, const Iin2& iin2);
3469
3470public:
3471 Iin() = delete;
3472
3477};
3478
3479struct ResponseHeader;
3480
3483 friend class CppResponseHeaderFriend;
3484
3485private:
3492
3493public:
3494 ResponseHeader() = delete;
3495
3502};
3503
3505enum class QualifierCode {
3507 range8 = 0,
3509 range16 = 1,
3511 all_objects = 2,
3513 count8 = 3,
3515 count16 = 4,
3521 free_format_16 = 7,
3522};
3523
3527const char* to_string(QualifierCode value);
3528
3529struct HeaderInfo;
3530
3533 friend class CppHeaderInfoFriend;
3534
3535private:
3543
3544public:
3545 HeaderInfo() = delete;
3546
3555};
3556
3558enum class ReadType {
3562 unsolicited = 1,
3564 single_poll = 2,
3566 periodic_poll = 3,
3567};
3568
3572const char* to_string(ReadType value);
3573
3580public:
3581 virtual ~ReadHandler() = default;
3582
3589 virtual void begin_fragment(ReadType read_type, const ResponseHeader& header) {};
3590
3597 virtual void end_fragment(ReadType read_type, const ResponseHeader& header) {};
3598
3605 virtual void handle_binary_input(const HeaderInfo& info, BinaryInputIterator& values) {};
3606
3614
3622
3629 virtual void handle_counter(const HeaderInfo& info, CounterIterator& values) {};
3630
3638
3645 virtual void handle_analog_input(const HeaderInfo& info, AnalogInputIterator& values) {};
3646
3654
3662
3670
3678
3686
3693 virtual void handle_octet_string(const HeaderInfo& info, OctetStringIterator& values) {};
3694
3704 virtual void handle_string_attr(const HeaderInfo& info, StringAttr attr, uint8_t set, uint8_t variation, const char* value) {};
3705
3715 virtual void handle_variation_list_attr(const HeaderInfo& info, VariationListAttr attr, uint8_t set, uint8_t variation, AttrItemIter& value) {};
3716
3726 virtual void handle_uint_attr(const HeaderInfo& info, UintAttr attr, uint8_t set, uint8_t variation, uint32_t value) {};
3727
3739 virtual void handle_bool_attr(const HeaderInfo& info, BoolAttr attr, uint8_t set, uint8_t variation, bool value) {};
3740
3752 virtual void handle_int_attr(const HeaderInfo& info, IntAttr attr, uint8_t set, uint8_t variation, int32_t value) {};
3753
3763 virtual void handle_time_attr(const HeaderInfo& info, TimeAttr attr, uint8_t set, uint8_t variation, uint64_t value) {};
3764
3774 virtual void handle_float_attr(const HeaderInfo& info, FloatAttr attr, uint8_t set, uint8_t variation, double value) {};
3775
3785 virtual void handle_octet_string_attr(const HeaderInfo& info, OctetStringAttr attr, uint8_t set, uint8_t variation, ByteIterator& value) {};
3786
3796 virtual void handle_bit_string_attr(const HeaderInfo& info, BitStringAttr attr, uint8_t set, uint8_t variation, ByteIterator& value) {};
3797
3798};
3799
3800struct MasterChannelConfig;
3801
3804 friend class CppMasterChannelConfigFriend;
3805
3806private:
3814
3815public:
3816 MasterChannelConfig() = delete;
3817
3828
3829
3831 uint16_t address;
3842};
3843
3844class MasterChannel;
3845
3847
3850 friend class CppWriteDeadBandRequestFriend;
3851 // pointer to the underlying C type
3852 void* self;
3853 // constructor only accessible internally
3854 WriteDeadBandRequest(void* self): self(self) {}
3855 // non-copyable
3857 WriteDeadBandRequest& operator=(const WriteDeadBandRequest&) = delete;
3858 // no move assignment
3859 WriteDeadBandRequest& operator=(WriteDeadBandRequest&& other) = delete;
3860
3861public:
3865 WriteDeadBandRequest(WriteDeadBandRequest&& other) noexcept : self(other.self) { other.self = nullptr; }
3866
3870
3873
3880 void add_g34v1_u8(uint8_t index, uint16_t dead_band);
3881
3888 void add_g34v2_u8(uint8_t index, uint32_t dead_band);
3889
3896 void add_g34v3_u8(uint8_t index, float dead_band);
3897
3904 void add_g34v1_u16(uint16_t index, uint16_t dead_band);
3905
3912 void add_g34v2_u16(uint16_t index, uint32_t dead_band);
3913
3920 void add_g34v3_u16(uint16_t index, float dead_band);
3921
3927};
3928
3932 ok = 0,
3934 rejected_by_iin2 = 1,
3938 iin_error = 3,
3940 bad_response = 4,
3942 response_timeout = 5,
3944 write_error = 6,
3946 no_connection = 7,
3948 shutdown = 8,
3952 bad_encoding = 10,
3953};
3954
3959
3961class EmptyResponseException : public std::logic_error {
3962public:
3967};
3968
3973public:
3974 virtual ~EmptyResponseCallback() = default;
3975
3979 virtual void on_complete(Nothing result) = 0;
3980
3985
3986};
3987
3988struct AssociationId;
3989
3992 friend class CppAssociationIdFriend;
3993
3994private:
3995
3999 AssociationId(uint16_t address);
4000
4001 AssociationId() = delete;
4002
4004 uint16_t address;
4005};
4006
4007struct PollId;
4008
4010struct PollId {
4011 friend class CppPollIdFriend;
4012
4013private:
4014
4019 PollId(uint16_t association_id, uint64_t id);
4020
4021 PollId() = delete;
4022
4024 uint16_t association_id;
4026 uint64_t id;
4027};
4028
4029struct EventClasses;
4030
4033 friend class CppEventClassesFriend;
4034
4035 EventClasses() = delete;
4036
4043
4044
4054
4055
4065
4066
4073};
4074
4075struct Classes;
4076
4078struct Classes {
4079 friend class CppClassesFriend;
4080
4081 Classes() = delete;
4082
4089 Classes(bool class0, bool class1, bool class2, bool class3);
4090
4091
4101 static Classes all();
4102
4103
4113 static Classes none();
4114
4115
4124};
4125
4127enum class AutoTimeSync {
4129 none = 0,
4131 lan = 1,
4133 non_lan = 2,
4134};
4135
4139const char* to_string(AutoTimeSync value);
4140
4141struct AssociationConfig;
4142
4145 friend class CppAssociationConfigFriend;
4146
4147private:
4161
4162public:
4163 AssociationConfig() = delete;
4164
4181
4182
4184 std::chrono::steady_clock::duration response_timeout;
4200 std::chrono::steady_clock::duration keep_alive_timeout;
4207};
4208
4209struct UtcTimestamp;
4210
4215 friend class CppUtcTimestampFriend;
4216
4217private:
4222 UtcTimestamp(uint64_t value, bool is_valid);
4223
4224public:
4225 UtcTimestamp() = delete;
4226
4234 static UtcTimestamp valid(uint64_t value);
4235
4236
4245
4246
4250 uint64_t value;
4253};
4254
4259public:
4260 virtual ~AssociationHandler() = default;
4261
4270
4271};
4272
4273namespace functional {
4274
4277template <class T>
4279{
4280 static_assert(std::is_copy_constructible<T>::value, "Lambda expression must be copy constructible. Does it contain something that is move-only?");
4281
4282 T lambda;
4283
4284public:
4287 AssociationHandlerLambda(const T& lambda) : lambda(lambda) {}
4288
4291 {
4292 return lambda();
4293 }
4294};
4295
4300template <class T>
4301std::unique_ptr<AssociationHandler> association_handler(const T& lambda)
4302{
4303 return std::make_unique<AssociationHandlerLambda<T>>(lambda); ;
4304}
4305
4306} // end namespace functional
4307
4309enum class TaskType {
4311 user_read = 0,
4313 periodic_poll = 1,
4317 auto_event_scan = 3,
4319 command = 4,
4327 time_sync = 8,
4329 restart = 9,
4331 write_dead_bands = 10,
4335 file_read = 12,
4337 get_file_info = 13,
4339 file_auth = 14,
4341 file_open = 15,
4343 file_write_block = 16,
4345 file_close = 17,
4346};
4347
4351const char* to_string(TaskType value);
4352
4354enum class TaskError {
4358 iin_error = 1,
4360 bad_response = 2,
4362 response_timeout = 3,
4364 write_error = 4,
4366 no_connection = 5,
4368 shutdown = 6,
4372 bad_encoding = 8,
4373};
4374
4378const char* to_string(TaskError value);
4379
4384public:
4385 virtual ~AssociationInformation() = default;
4386
4392 virtual void task_start(TaskType task_type, FunctionCode function_code, uint8_t seq) = 0;
4393
4399 virtual void task_success(TaskType task_type, FunctionCode function_code, uint8_t seq) = 0;
4400
4405 virtual void task_fail(TaskType task_type, TaskError error) = 0;
4406
4411 virtual void unsolicited_response(bool is_duplicate, uint8_t seq) = 0;
4412
4413};
4414
4415class Request;
4416
4420class Request {
4421 friend class CppRequestFriend;
4422 // pointer to the underlying C type
4423 void* self;
4424 // constructor only accessible internally
4425 Request(void* self): self(self) {}
4426 // non-copyable
4427 Request(const Request&) = delete;
4428 Request& operator=(const Request&) = delete;
4429 // no move assignment
4430 Request& operator=(Request&& other) = delete;
4431
4432public:
4436 Request(Request&& other) noexcept : self(other.self) { other.self = nullptr; }
4437
4441
4444
4450 void add_one_byte_range_header(Variation variation, uint8_t start, uint8_t stop);
4451
4457 void add_two_byte_range_header(Variation variation, uint16_t start, uint16_t stop);
4458
4463
4468 void add_one_byte_limited_count_header(Variation variation, uint8_t count);
4469
4474 void add_two_byte_limited_count_header(Variation variation, uint16_t count);
4475
4482 void add_time_and_interval(uint64_t time, uint32_t interval_ms);
4483
4488 void add_specific_attribute(uint8_t variation, uint8_t set);
4489
4495 void add_string_attribute(uint8_t variation, uint8_t set, const std::string& value);
4496
4502 void add_uint_attribute(uint8_t variation, uint8_t set, uint32_t value);
4503
4513 static Request class_request(bool class0, bool class1, bool class2, bool class3);
4514
4521 static Request all_objects(Variation variation);
4522
4531 static Request one_byte_range(Variation variation, uint8_t start, uint8_t stop);
4532
4541 static Request two_byte_range(Variation variation, uint16_t start, uint16_t stop);
4542
4550 static Request one_byte_limited_count(Variation variation, uint8_t count);
4551
4559 static Request two_byte_limited_count(Variation variation, uint16_t count);
4560};
4561
4563enum class ReadError {
4565 ok = 0,
4569 iin_error = 2,
4571 bad_response = 3,
4573 response_timeout = 4,
4575 write_error = 5,
4577 no_connection = 6,
4579 shutdown = 7,
4583 bad_encoding = 9,
4584};
4585
4589const char* to_string(ReadError value);
4590
4592class ReadException : public std::logic_error {
4593public:
4598};
4599
4604public:
4605 virtual ~ReadTaskCallback() = default;
4606
4610 virtual void on_complete(Nothing result) = 0;
4611
4615 virtual void on_failure(ReadError error) = 0;
4616
4617};
4618
4619class CommandSet;
4620
4623 friend class CppCommandSetFriend;
4624 // pointer to the underlying C type
4625 void* self;
4626 // constructor only accessible internally
4627 CommandSet(void* self): self(self) {}
4628 // non-copyable
4629 CommandSet(const CommandSet&) = delete;
4630 CommandSet& operator=(const CommandSet&) = delete;
4631 // no move assignment
4632 CommandSet& operator=(CommandSet&& other) = delete;
4633
4634public:
4638 CommandSet(CommandSet&& other) noexcept : self(other.self) { other.self = nullptr; }
4639
4643
4646
4651 void add_g12_v1_u8(uint8_t idx, const Group12Var1& header);
4652
4657 void add_g12_v1_u16(uint16_t idx, const Group12Var1& header);
4658
4663 void add_g41_v1_u8(uint8_t idx, int32_t value);
4664
4669 void add_g41_v1_u16(uint16_t idx, int32_t value);
4670
4675 void add_g41_v2_u8(uint8_t idx, int16_t value);
4676
4681 void add_g41_v2_u16(uint16_t idx, int16_t value);
4682
4687 void add_g41_v3_u8(uint8_t idx, float value);
4688
4693 void add_g41_v3_u16(uint16_t idx, float value);
4694
4699 void add_g41_v4_u8(uint8_t idx, double value);
4700
4705 void add_g41_v4_u16(uint16_t idx, double value);
4706
4710};
4711
4713enum class CommandMode {
4715 direct_operate = 0,
4718};
4719
4723const char* to_string(CommandMode value);
4724
4726enum class CommandError {
4728 ok = 0,
4730 bad_status = 1,
4732 header_mismatch = 2,
4736 iin_error = 4,
4738 bad_response = 5,
4740 response_timeout = 6,
4742 write_error = 7,
4744 no_connection = 8,
4746 shutdown = 9,
4750 bad_encoding = 11,
4751};
4752
4756const char* to_string(CommandError value);
4757
4759class CommandException : public std::logic_error {
4760public:
4765};
4766
4771public:
4772 virtual ~CommandTaskCallback() = default;
4773
4777 virtual void on_complete(Nothing result) = 0;
4778
4782 virtual void on_failure(CommandError error) = 0;
4783
4784};
4785
4787enum class TimeSyncMode {
4789 lan = 0,
4791 non_lan = 1,
4792};
4793
4797const char* to_string(TimeSyncMode value);
4798
4800enum class TimeSyncError {
4802 ok = 0,
4804 clock_rollback = 1,
4810 overflow = 4,
4812 still_needs_time = 5,
4818 iin_error = 8,
4820 bad_response = 9,
4822 response_timeout = 10,
4824 write_error = 11,
4826 no_connection = 12,
4828 shutdown = 13,
4832 bad_encoding = 15,
4833};
4834
4838const char* to_string(TimeSyncError value);
4839
4841class TimeSyncException : public std::logic_error {
4842public:
4847};
4848
4853public:
4854 virtual ~TimeSyncTaskCallback() = default;
4855
4859 virtual void on_complete(Nothing result) = 0;
4860
4864 virtual void on_failure(TimeSyncError error) = 0;
4865
4866};
4867
4869enum class RestartError {
4871 ok = 0,
4875 iin_error = 2,
4877 bad_response = 3,
4879 response_timeout = 4,
4881 write_error = 5,
4883 no_connection = 6,
4885 shutdown = 7,
4889 bad_encoding = 9,
4890};
4891
4895const char* to_string(RestartError value);
4896
4898class RestartException : public std::logic_error {
4899public:
4904};
4905
4910public:
4911 virtual ~RestartTaskCallback() = default;
4912
4916 virtual void on_complete(std::chrono::steady_clock::duration result) = 0;
4917
4921 virtual void on_failure(RestartError error) = 0;
4922
4923};
4924
4929public:
4930 virtual ~FileInfoCallback() = default;
4931
4935 virtual void on_complete(const FileInfo& result) = 0;
4936
4940 virtual void on_failure(FileError error) = 0;
4941
4942};
4943
4948public:
4949 virtual ~FileReader() = default;
4950
4957 virtual bool opened(uint32_t size) = 0;
4958
4966 virtual bool block_received(uint32_t block_num, ByteIterator& data) = 0;
4967
4971 virtual void aborted(FileError error) = 0;
4972
4975 virtual void completed() = 0;
4976
4977};
4978
4979struct FileReadConfig;
4980
4983 friend class CppFileReadConfigFriend;
4984
4985private:
4990 FileReadConfig(uint16_t max_block_size, uint32_t max_file_size);
4991
4992public:
4993 FileReadConfig() = delete;
4994
5003
5004
5009};
5010
5011struct DirReadConfig;
5012
5015 friend class CppDirReadConfigFriend;
5016
5017private:
5022 DirReadConfig(uint16_t max_block_size, uint32_t max_file_size);
5023
5024public:
5025 DirReadConfig() = delete;
5026
5035
5036
5041};
5042
5043class FileInfoIterator;
5044
5056class FileInfoIterator final {
5057
5058 friend class CppFileInfoIteratorFriend;
5059
5060 // underlying opaque c type
5061 void* iter;
5062 // pointer to the last retrieved c value
5063 void* current;
5064
5065 // internal constructor
5066 FileInfoIterator(void* iter) : iter(iter), current(nullptr) {}
5067
5068 FileInfoIterator() = delete; // no default construction
5069 FileInfoIterator(const FileInfoIterator&) = delete; // no copies
5070 FileInfoIterator& operator=(const FileInfoIterator&) = delete; // no self-assignment
5071 FileInfoIterator& operator=(FileInfoIterator&&) = delete; // no move self-assignment
5072
5073public:
5074
5077
5080 bool next();
5081
5086};
5087
5092public:
5093 virtual ~ReadDirectoryCallback() = default;
5094
5098 virtual void on_complete(FileInfoIterator& result) = 0;
5099
5103 virtual void on_failure(FileError error) = 0;
5104
5105};
5106
5110 ok = 0,
5116 iin_error = 3,
5118 bad_response = 4,
5120 response_timeout = 5,
5122 write_error = 6,
5124 no_connection = 7,
5126 shutdown = 8,
5130 bad_encoding = 10,
5131};
5132
5136const char* to_string(LinkStatusError value);
5137
5139class LinkStatusException : public std::logic_error {
5140public:
5145};
5146
5151public:
5152 virtual ~LinkStatusCallback() = default;
5153
5157 virtual void on_complete(Nothing result) = 0;
5158
5163
5164};
5165
5172 friend class CppMasterChannelFriend;
5173 // pointer to the underlying C type
5174 void* self;
5175 // constructor only accessible internally
5176 MasterChannel(void* self): self(self) {}
5177 // non-copyable
5178 MasterChannel(const MasterChannel&) = delete;
5179 MasterChannel& operator=(const MasterChannel&) = delete;
5180 // no move assignment
5181 MasterChannel& operator=(MasterChannel&& other) = delete;
5182
5183public:
5187 MasterChannel(MasterChannel&& other) noexcept : self(other.self) { other.self = nullptr; }
5188
5191
5195 void enable();
5196
5200 void disable();
5201
5211 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);
5212
5223 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);
5224
5230
5235 void set_decode_level(const DecodeLevel& decode_level);
5236
5242
5252 PollId add_poll(const AssociationId& id, Request& request, std::chrono::steady_clock::duration period);
5253
5260 void remove_poll(const PollId& poll_id);
5261
5270 void demand_poll(const PollId& poll_id);
5271
5279 void read_file(const AssociationId& association, const std::string& remote_file_path, const FileReadConfig& config, std::unique_ptr<FileReader> reader);
5280
5292 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);
5293
5304 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);
5305
5319 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);
5320
5332 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);
5333
5348 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);
5349
5362 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);
5363
5375 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);
5376
5385 void read(const AssociationId& association, Request& request, std::unique_ptr<ReadTaskCallback> callback);
5386
5387
5397 void read_with_handler(const AssociationId& association, Request& request, std::unique_ptr<ReadHandler> handler, std::unique_ptr<ReadTaskCallback> callback);
5398
5399
5407 void operate(const AssociationId& association, CommandMode mode, CommandSet& command, std::unique_ptr<CommandTaskCallback> callback);
5408
5409
5416 void synchronize_time(const AssociationId& association, TimeSyncMode mode, std::unique_ptr<TimeSyncTaskCallback> callback);
5417
5418
5424 void cold_restart(const AssociationId& association, std::unique_ptr<RestartTaskCallback> callback);
5425
5426
5432 void warm_restart(const AssociationId& association, std::unique_ptr<RestartTaskCallback> callback);
5433
5434
5441 void write_dead_bands(const AssociationId& association, WriteDeadBandRequest& request, std::unique_ptr<EmptyResponseCallback> callback);
5442
5443
5455 void send_and_expect_empty_response(const AssociationId& association, FunctionCode function, Request& headers, std::unique_ptr<EmptyResponseCallback> callback);
5456
5457
5464 void get_file_info(const AssociationId& association, const std::string& file_name, std::unique_ptr<FileInfoCallback> callback);
5465
5466
5474 void get_file_auth_key(const AssociationId& association, const std::string& username, const std::string& password, std::unique_ptr<FileAuthCallback> callback);
5475
5476
5488 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);
5489
5490
5500 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);
5501
5502
5509 void close_file(const AssociationId& association, uint32_t handle, std::unique_ptr<FileOperationCallback> callback);
5510
5511
5519 void read_directory(const AssociationId& association, const std::string& dir_path, const DirReadConfig& config, std::unique_ptr<ReadDirectoryCallback> callback);
5520
5521
5531 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);
5532
5533
5539 void check_link_status(const AssociationId& association, std::unique_ptr<LinkStatusCallback> callback);
5540
5541};
5542
5543class AcceptHandler;
5544
5547 friend class CppAcceptHandlerFriend;
5548 // pointer to the underlying C type
5549 void* self;
5550 // constructor only accessible internally
5551 AcceptHandler(void* self): self(self) {}
5552 // non-copyable
5553 AcceptHandler(const AcceptHandler&) = delete;
5554 AcceptHandler& operator=(const AcceptHandler&) = delete;
5555 // no move assignment
5556 AcceptHandler& operator=(AcceptHandler&& other) = delete;
5557
5558public:
5562 AcceptHandler(AcceptHandler&& other) noexcept : self(other.self) { other.self = nullptr; }
5563
5570
5577};
5578
5580
5583 friend class CppIdentifiedLinkHandlerFriend;
5584 // pointer to the underlying C type
5585 void* self;
5586 // constructor only accessible internally
5587 IdentifiedLinkHandler(void* self): self(self) {}
5588 // non-copyable
5590 IdentifiedLinkHandler& operator=(const IdentifiedLinkHandler&) = delete;
5591 // no move assignment
5592 IdentifiedLinkHandler& operator=(IdentifiedLinkHandler&& other) = delete;
5593
5594public:
5598 IdentifiedLinkHandler(IdentifiedLinkHandler&& other) noexcept : self(other.self) { other.self = nullptr; }
5599
5606};
5607
5612public:
5613 virtual ~ConnectionHandler() = default;
5614
5619 virtual void accept(const char* remote_addr, AcceptHandler& acceptor) = 0;
5620
5627 virtual void start(const char* remote_addr, MasterChannel& channel) = 0;
5628
5635 virtual void accept_with_link_id(const char* remote_addr, uint16_t source, uint16_t destination, IdentifiedLinkHandler& acceptor) = 0;
5636
5645 virtual void start_with_link_id(const char* remote_addr, uint16_t source, uint16_t destination, MasterChannel& channel) = 0;
5646
5647};
5648
5649class MasterServer;
5650
5651struct LinkIdConfig;
5652
5655 friend class CppLinkIdConfigFriend;
5656
5657private:
5663 LinkIdConfig(uint16_t max_tasks, std::chrono::steady_clock::duration timeout, PhysDecodeLevel decode_level);
5664
5665public:
5666
5676
5677
5679 uint16_t max_tasks;
5681 std::chrono::steady_clock::duration timeout;
5684};
5685
5688 friend class CppMasterServerFriend;
5689 // pointer to the underlying C type
5690 void* self;
5691 // constructor only accessible internally
5692 MasterServer(void* self): self(self) {}
5693 // non-copyable
5694 MasterServer(const MasterServer&) = delete;
5695 MasterServer& operator=(const MasterServer&) = delete;
5696 // no move assignment
5697 MasterServer& operator=(MasterServer&& other) = delete;
5698
5699public:
5703 MasterServer(MasterServer&& other) noexcept : self(other.self) { other.self = nullptr; }
5704
5707
5718 static MasterServer create_tcp_server(Runtime& runtime, const std::string& local_addr, const LinkIdConfig& link_id_config, std::unique_ptr<ConnectionHandler> connection_handler);
5719};
5720
5721class Database;
5722
5724enum class EventClass {
5726 none = 0,
5728 class1 = 1,
5730 class2 = 2,
5732 class3 = 3,
5733};
5734
5738const char* to_string(EventClass value);
5739
5741enum class UpdateResult {
5743 no_point = 0,
5745 no_event = 1,
5747 created = 2,
5749 overflow = 3,
5750};
5751
5755const char* to_string(UpdateResult value);
5756
5757struct UpdateInfo;
5758
5761 friend class CppUpdateInfoFriend;
5762
5763private:
5769 UpdateInfo(UpdateResult result, uint64_t created, uint64_t discarded);
5770
5771public:
5772 UpdateInfo() = delete;
5773
5777 uint64_t created;
5779 uint64_t discarded;
5780};
5781
5783enum class EventMode {
5787 detect = 0,
5789 force = 1,
5791 suppress = 2,
5792};
5793
5797const char* to_string(EventMode value);
5798
5799struct UpdateOptions;
5800
5805 friend class CppUpdateOptionsFriend;
5806
5807private:
5813
5814public:
5815 UpdateOptions() = delete;
5816
5825
5826
5835
5836
5841};
5842
5846 binary_input = 0,
5852 counter = 3,
5854 frozen_counter = 4,
5856 analog_input = 5,
5859};
5860
5864const char* to_string(UpdateFlagsType value);
5865
5869 group1_var1 = 0,
5871 group1_var2 = 1,
5872};
5873
5878
5882 group2_var1 = 0,
5884 group2_var2 = 1,
5886 group2_var3 = 2,
5887};
5888
5893
5894struct BinaryInputConfig;
5895
5898 friend class CppBinaryInputConfigFriend;
5899
5900
5906
5907
5916
5917
5922};
5923
5927 group3_var1 = 0,
5929 group3_var2 = 1,
5930};
5931
5936
5940 group4_var1 = 0,
5942 group4_var2 = 1,
5944 group4_var3 = 2,
5945};
5946
5951
5953
5956 friend class CppDoubleBitBinaryInputConfigFriend;
5957
5958
5964
5965
5974
5975
5980};
5981
5985 group10_var1 = 0,
5987 group10_var2 = 1,
5988};
5989
5994
5998 group11_var1 = 0,
6000 group11_var2 = 1,
6001};
6002
6007
6009
6012 friend class CppBinaryOutputStatusConfigFriend;
6013
6014
6020
6021
6030
6031
6036};
6037
6041 group20_var1 = 0,
6043 group20_var2 = 1,
6045 group20_var5 = 2,
6047 group20_var6 = 3,
6048};
6049
6054
6058 group22_var1 = 0,
6060 group22_var2 = 1,
6062 group22_var5 = 2,
6064 group22_var6 = 3,
6065};
6066
6071
6072struct CounterConfig;
6073
6076 friend class CppCounterConfigFriend;
6077
6078
6085
6086
6096
6097
6103 uint32_t deadband;
6104};
6105
6109 group21_var1 = 0,
6111 group21_var2 = 1,
6113 group21_var5 = 2,
6115 group21_var6 = 3,
6117 group21_var9 = 4,
6119 group21_var10 = 5,
6120};
6121
6126
6130 group23_var1 = 0,
6132 group23_var2 = 1,
6134 group23_var5 = 2,
6136 group23_var6 = 3,
6137};
6138
6143
6144struct FrozenCounterConfig;
6145
6148 friend class CppFrozenCounterConfigFriend;
6149
6150
6157
6158
6168
6169
6175 uint32_t deadband;
6176};
6177
6181 group30_var1 = 0,
6183 group30_var2 = 1,
6185 group30_var3 = 2,
6187 group30_var4 = 3,
6189 group30_var5 = 4,
6191 group30_var6 = 5,
6192};
6193
6198
6202 group32_var1 = 0,
6204 group32_var2 = 1,
6206 group32_var3 = 2,
6208 group32_var4 = 3,
6210 group32_var5 = 4,
6212 group32_var6 = 5,
6214 group32_var7 = 6,
6216 group32_var8 = 7,
6217};
6218
6223
6224struct AnalogInputConfig;
6225
6228 friend class CppAnalogInputConfigFriend;
6229
6230
6237
6238
6248
6249
6255 double deadband;
6256};
6257
6261 group40_var1 = 0,
6263 group40_var2 = 1,
6265 group40_var3 = 2,
6267 group40_var4 = 3,
6268};
6269
6274
6278 group42_var1 = 0,
6280 group42_var2 = 1,
6282 group42_var3 = 2,
6284 group42_var4 = 3,
6286 group42_var5 = 4,
6288 group42_var6 = 5,
6290 group42_var7 = 6,
6292 group42_var8 = 7,
6293};
6294
6299
6301
6304 friend class CppAnalogOutputStatusConfigFriend;
6305
6306
6313
6314
6324
6325
6331 double deadband;
6332};
6333
6335enum class AttrDefError {
6337 ok = 0,
6339 already_defined = 1,
6343 bad_type = 3,
6345 not_writable = 4,
6346};
6347
6351const char* to_string(AttrDefError value);
6352
6357 friend class CppDatabaseFriend;
6358 // pointer to the underlying C type
6359 void* self;
6360 // constructor only accessible internally
6361 Database(void* self): self(self) {}
6362 // non-copyable
6363 Database(const Database&) = delete;
6364 Database& operator=(const Database&) = delete;
6365 // no move assignment
6366 Database& operator=(Database&& other) = delete;
6367
6368public:
6372 Database(Database&& other) noexcept : self(other.self) { other.self = nullptr; }
6373
6384 UpdateInfo update_flags(uint16_t index, UpdateFlagsType flags_type, const Flags& flags, const Timestamp& time, const UpdateOptions& options);
6385
6392 bool add_binary_input(uint16_t index, EventClass point_class, const BinaryInputConfig& config);
6393
6398 bool remove_binary_input(uint16_t index);
6399
6405 bool update_binary_input(const BinaryInput& value, const UpdateOptions& options);
6406
6413
6420
6427 bool add_double_bit_binary_input(uint16_t index, EventClass point_class, const DoubleBitBinaryInputConfig& config);
6428
6434
6441
6448
6455
6462 bool add_binary_output_status(uint16_t index, EventClass point_class, const BinaryOutputStatusConfig& config);
6463
6468 bool remove_binary_output_status(uint16_t index);
6469
6476
6483
6490
6497 bool add_counter(uint16_t index, EventClass point_class, const CounterConfig& config);
6498
6503 bool remove_counter(uint16_t index);
6504
6510 bool update_counter(const Counter& value, const UpdateOptions& options);
6511
6517 UpdateInfo update_counter_2(const Counter& value, const UpdateOptions& options);
6518
6524 Counter get_counter(uint16_t index);
6525
6532 bool add_frozen_counter(uint16_t index, EventClass point_class, const FrozenCounterConfig& config);
6533
6538 bool remove_frozen_counter(uint16_t index);
6539
6545 bool update_frozen_counter(const FrozenCounter& value, const UpdateOptions& options);
6546
6553
6560
6567 bool add_analog_input(uint16_t index, EventClass point_class, const AnalogInputConfig& config);
6568
6573 bool remove_analog_input(uint16_t index);
6574
6580 bool update_analog_input(const AnalogInput& value, const UpdateOptions& options);
6581
6588
6595
6602 bool add_analog_output_status(uint16_t index, EventClass point_class, const AnalogOutputStatusConfig& config);
6603
6608 bool remove_analog_output_status(uint16_t index);
6609
6616
6623
6630
6636 bool add_octet_string(uint16_t index, EventClass point_class);
6637
6642 bool remove_octet_string(uint16_t index);
6643
6650 bool update_octet_string(uint16_t index, const std::vector<uint8_t>& value, const UpdateOptions& options);
6651
6658 UpdateInfo update_octet_string_2(uint16_t index, const std::vector<uint8_t>& value, const UpdateOptions& options);
6659
6667 AttrDefError define_string_attr(uint8_t set, bool writable, uint8_t variation, const std::string& value);
6668
6676 AttrDefError define_int_attr(uint8_t set, bool writable, uint8_t variation, int32_t value);
6677
6685 AttrDefError define_uint_attr(uint8_t set, bool writable, uint8_t variation, uint32_t value);
6686
6694 AttrDefError define_time_attr(uint8_t set, bool writable, uint8_t variation, uint64_t value);
6695
6703 AttrDefError define_bool_attr(uint8_t set, bool writable, uint8_t variation, bool value);
6704
6712 AttrDefError define_float_attr(uint8_t set, bool writable, uint8_t variation, float value);
6713
6721 AttrDefError define_double_attr(uint8_t set, bool writable, uint8_t variation, double value);
6722};
6723
6728public:
6729 virtual ~DatabaseTransaction() = default;
6730
6734 virtual void execute(Database& database) = 0;
6735
6736};
6737
6738namespace functional {
6739
6742template <class T>
6744{
6745 static_assert(std::is_copy_constructible<T>::value, "Lambda expression must be copy constructible. Does it contain something that is move-only?");
6746
6747 T lambda;
6748
6749public:
6752 DatabaseTransactionLambda(const T& lambda) : lambda(lambda) {}
6753
6755 void execute(Database& database) override
6756 {
6757 lambda(database);
6758 }
6759};
6760
6765template <class T>
6767{
6768 return DatabaseTransactionLambda<T>(lambda);
6769}
6770
6771} // end namespace functional
6772
6773class DatabaseHandle;
6774
6779 friend class CppDatabaseHandleFriend;
6780 // pointer to the underlying C type
6781 void* self;
6782 // constructor only accessible internally
6783 DatabaseHandle(void* self): self(self) {}
6784 // non-copyable
6785 DatabaseHandle(const DatabaseHandle&) = delete;
6786 DatabaseHandle& operator=(const DatabaseHandle&) = delete;
6787 // no move assignment
6788 DatabaseHandle& operator=(DatabaseHandle&& other) = delete;
6789
6790public:
6794 DatabaseHandle(DatabaseHandle&& other) noexcept : self(other.self) { other.self = nullptr; }
6795
6800};
6801
6802struct EventBufferConfig;
6803
6808 friend class CppEventBufferConfigFriend;
6809
6810 EventBufferConfig() = delete;
6811
6823
6824
6839
6840
6842 uint16_t max_binary;
6848 uint16_t max_counter;
6852 uint16_t max_analog;
6857};
6858
6859struct ClassZeroConfig;
6860
6863 friend class CppClassZeroConfigFriend;
6864
6865private:
6877
6878public:
6879
6894
6895
6914};
6915
6916struct OutstationFeatures;
6917
6920 friend class CppOutstationFeaturesFriend;
6921
6922private:
6930
6931public:
6932
6943
6944
6955};
6956
6957struct OutstationConfig;
6958
6961 friend class CppOutstationConfigFriend;
6962
6963private:
6982 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);
6983
6984public:
6985 OutstationConfig() = delete;
6986
7009
7010
7032 std::chrono::steady_clock::duration confirm_timeout;
7034 std::chrono::steady_clock::duration select_timeout;
7040 std::chrono::steady_clock::duration unsolicited_retry_delay;
7044 std::chrono::steady_clock::duration keep_alive_timeout;
7053};
7054
7058 not_supported = 0,
7060 seconds = 1,
7062 milli_seconds = 2,
7063};
7064
7068const char* to_string(RestartDelayType value);
7069
7070struct RestartDelay;
7071
7076 friend class CppRestartDelayFriend;
7077
7078private:
7084
7085public:
7086 RestartDelay() = delete;
7087
7096
7097
7105 static RestartDelay seconds(uint16_t value);
7106
7107
7116
7117
7121 uint16_t value;
7122};
7123
7127 ok = 0,
7129 parameter_error = 1,
7131 not_supported = 2,
7132};
7133
7137const char* to_string(WriteTimeResult value);
7138
7140enum class FreezeType {
7142 immediate_freeze = 0,
7144 freeze_and_clear = 1,
7145};
7146
7150const char* to_string(FreezeType value);
7151
7153enum class FreezeResult {
7155 ok = 0,
7157 parameter_error = 1,
7159 not_supported = 2,
7160};
7161
7165const char* to_string(FreezeResult value);
7166
7167struct ApplicationIin;
7168
7171 friend class CppApplicationIinFriend;
7172
7173private:
7181
7182public:
7183
7194
7195
7204};
7205
7206struct ClassCount;
7207
7210 friend class CppClassCountFriend;
7211
7212private:
7218 ClassCount(uint32_t num_class_1, uint32_t num_class_2, uint32_t num_class_3);
7219
7220public:
7221 ClassCount() = delete;
7222
7224 uint32_t num_class_1;
7226 uint32_t num_class_2;
7228 uint32_t num_class_3;
7229};
7230
7231struct TypeCount;
7232
7235 friend class CppTypeCountFriend;
7236
7237private:
7249
7250public:
7251 TypeCount() = delete;
7252
7260 uint32_t num_counter;
7264 uint32_t num_analog;
7269};
7270
7271struct BufferState;
7272
7275 friend class CppBufferStateFriend;
7276
7277private:
7283
7284public:
7285 BufferState() = delete;
7286
7291};
7292
7297public:
7298 virtual ~OutstationApplication() = default;
7299
7309 virtual uint16_t get_processing_delay_ms() = 0;
7310
7315 virtual WriteTimeResult write_absolute_time(uint64_t time) = 0;
7316
7321
7328
7335
7343 virtual FreezeResult freeze_counters_all(FreezeType freeze_type, DatabaseHandle& database_handle) {
7345 }
7346
7357 virtual FreezeResult freeze_counters_all_at_time(DatabaseHandle& database_handle, uint64_t time, uint32_t interval) {
7359 }
7360
7370 virtual FreezeResult freeze_counters_range(uint16_t start, uint16_t stop, FreezeType freeze_type, DatabaseHandle& database_handle) {
7372 }
7373
7386 virtual FreezeResult freeze_counters_range_at_time(uint16_t start, uint16_t stop, DatabaseHandle& database_handle, uint64_t time, uint32_t interval) {
7388 }
7389
7406 return false;
7407 }
7408
7414
7425 virtual void write_analog_dead_band(uint16_t index, double dead_band) {};
7426
7434
7444 virtual bool write_string_attr(uint8_t set, uint8_t variation, StringAttr attr_type, const char* value) {
7445 return false;
7446 }
7447
7457 virtual bool write_float_attr(uint8_t set, uint8_t variation, FloatAttr attr_type, float value) {
7458 return false;
7459 }
7460
7470 virtual bool write_double_attr(uint8_t set, uint8_t variation, FloatAttr attr_type, double value) {
7471 return false;
7472 }
7473
7483 virtual bool write_uint_attr(uint8_t set, uint8_t variation, UintAttr attr_type, uint32_t value) {
7484 return false;
7485 }
7486
7496 virtual bool write_int_attr(uint8_t set, uint8_t variation, IntAttr attr_type, int32_t value) {
7497 return false;
7498 }
7499
7509 virtual bool write_octet_string_attr(uint8_t set, uint8_t variation, OctetStringAttr attr_type, ByteIterator& value) {
7510 return false;
7511 }
7512
7522 virtual bool write_bit_string_attr(uint8_t set, uint8_t variation, BitStringAttr attr_type, ByteIterator& value) {
7523 return false;
7524 }
7525
7535 virtual bool write_time_attr(uint8_t set, uint8_t variation, TimeAttr attr_type, uint64_t value) {
7536 return false;
7537 }
7538
7543 virtual void begin_confirm() {};
7544
7550 virtual void event_cleared(uint64_t id) {};
7551
7557 virtual void end_confirm(const BufferState& state) {};
7558
7559};
7560
7561struct RequestHeader;
7562
7565 friend class CppRequestHeaderFriend;
7566
7567private:
7573
7574public:
7575 RequestHeader() = delete;
7576
7581};
7582
7586 processed = 0,
7593};
7594
7598const char* to_string(BroadcastAction value);
7599
7606public:
7607 virtual ~OutstationInformation() = default;
7608
7613
7618 virtual void broadcast_received(FunctionCode function_code, BroadcastAction action) = 0;
7619
7623 virtual void enter_solicited_confirm_wait(uint8_t ecsn) = 0;
7624
7628 virtual void solicited_confirm_timeout(uint8_t ecsn) = 0;
7629
7633 virtual void solicited_confirm_received(uint8_t ecsn) = 0;
7634
7638
7643 virtual void wrong_solicited_confirm_seq(uint8_t ecsn, uint8_t seq) = 0;
7644
7649 virtual void unexpected_confirm(bool unsolicited, uint8_t seq) = 0;
7650
7654 virtual void enter_unsolicited_confirm_wait(uint8_t ecsn) = 0;
7655
7660 virtual void unsolicited_confirm_timeout(uint8_t ecsn, bool retry) = 0;
7661
7665 virtual void unsolicited_confirmed(uint8_t ecsn) = 0;
7666
7669 virtual void clear_restart_iin() = 0;
7670
7671};
7672
7674enum class OperateType {
7678 direct_operate = 1,
7681};
7682
7686const char* to_string(OperateType value);
7687
7692public:
7693 virtual ~ControlHandler() = default;
7694
7697 virtual void begin_fragment() = 0;
7698
7702 virtual void end_fragment(DatabaseHandle& database) = 0;
7703
7714 virtual CommandStatus select_g12v1(const Group12Var1& value, uint16_t index, DatabaseHandle& database_handle) = 0;
7715
7723 virtual CommandStatus operate_g12v1(const Group12Var1& value, uint16_t index, OperateType op_type, DatabaseHandle& database_handle) = 0;
7724
7735 virtual CommandStatus select_g41v1(int32_t value, uint16_t index, DatabaseHandle& database_handle) = 0;
7736
7744 virtual CommandStatus operate_g41v1(int32_t value, uint16_t index, OperateType op_type, DatabaseHandle& database_handle) = 0;
7745
7756 virtual CommandStatus select_g41v2(int16_t value, uint16_t index, DatabaseHandle& database_handle) = 0;
7757
7765 virtual CommandStatus operate_g41v2(int16_t value, uint16_t index, OperateType op_type, DatabaseHandle& database_handle) = 0;
7766
7777 virtual CommandStatus select_g41v3(float value, uint16_t index, DatabaseHandle& database_handle) = 0;
7778
7786 virtual CommandStatus operate_g41v3(float value, uint16_t index, OperateType op_type, DatabaseHandle& database_handle) = 0;
7787
7798 virtual CommandStatus select_g41v4(double value, uint16_t index, DatabaseHandle& database_handle) = 0;
7799
7807 virtual CommandStatus operate_g41v4(double value, uint16_t index, OperateType op_type, DatabaseHandle& database_handle) = 0;
7808
7809};
7810
7814 connected = 0,
7816 disconnected = 1,
7817};
7818
7822const char* to_string(ConnectionState value);
7823
7828public:
7829 virtual ~ConnectionStateListener() = default;
7830
7834 virtual void on_change(ConnectionState state) = 0;
7835
7836};
7837
7838namespace functional {
7839
7842template <class T>
7844{
7845 static_assert(std::is_copy_constructible<T>::value, "Lambda expression must be copy constructible. Does it contain something that is move-only?");
7846
7847 T lambda;
7848
7849public:
7852 ConnectionStateListenerLambda(const T& lambda) : lambda(lambda) {}
7853
7855 void on_change(ConnectionState state) override
7856 {
7857 lambda(state);
7858 }
7859};
7860
7865template <class T>
7866std::unique_ptr<ConnectionStateListener> connection_state_listener(const T& lambda)
7867{
7868 return std::make_unique<ConnectionStateListenerLambda<T>>(lambda); ;
7869}
7870
7871} // end namespace functional
7872
7873class Outstation;
7874
7875struct OutstationUdpConfig;
7876
7879 friend class CppOutstationUdpConfigFriend;
7880
7881private:
7889 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);
7890
7891public:
7892 OutstationUdpConfig() = delete;
7893
7904 OutstationUdpConfig(const std::string& local_endpoint, const std::string& remote_endpoint);
7905
7906
7908 std::string local_endpoint;
7910 std::string remote_endpoint;
7916 std::chrono::steady_clock::duration retry_delay;
7917};
7918
7923 friend class CppOutstationFriend;
7924 // pointer to the underlying C type
7925 void* self;
7926 // constructor only accessible internally
7927 Outstation(void* self): self(self) {}
7928 // non-copyable
7929 Outstation(const Outstation&) = delete;
7930 Outstation& operator=(const Outstation&) = delete;
7931 // no move assignment
7932 Outstation& operator=(Outstation&& other) = delete;
7933
7934public:
7938 Outstation(Outstation&& other) noexcept : self(other.self) { other.self = nullptr; }
7939
7944
7948 void enable();
7949
7953 void disable();
7954
7959
7964 void set_decode_level(const DecodeLevel& level);
7965
7981 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);
7982
7995 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);
7996
8010 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);
8011
8026 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);
8027
8043 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);
8044
8055 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);
8056};
8057
8058class AddressFilter;
8059
8064 friend class CppAddressFilterFriend;
8065 // pointer to the underlying C type
8066 void* self;
8067 // constructor only accessible internally
8068 AddressFilter(void* self): self(self) {}
8069 // non-copyable
8070 AddressFilter(const AddressFilter&) = delete;
8071 AddressFilter& operator=(const AddressFilter&) = delete;
8072 // no move assignment
8073 AddressFilter& operator=(AddressFilter&& other) = delete;
8074
8075public:
8079 AddressFilter(AddressFilter&& other) noexcept : self(other.self) { other.self = nullptr; }
8080
8089 AddressFilter(const std::string& address);
8090
8093
8098 void add(const std::string& address);
8099
8104};
8105
8106struct TlsServerConfig;
8107
8110 friend class CppTlsServerConfigFriend;
8111
8112private:
8123 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);
8124
8125public:
8126 TlsServerConfig() = delete;
8127
8141 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);
8142
8143
8147 std::string dns_name;
8149 std::string peer_cert_path;
8151 std::string local_cert_path;
8153 std::string private_key_path;
8159 std::string password;
8166};
8167
8168class OutstationServer;
8169
8176 friend class CppOutstationServerFriend;
8177 // pointer to the underlying C type
8178 void* self;
8179 // constructor only accessible internally
8180 OutstationServer(void* self): self(self) {}
8181 // non-copyable
8182 OutstationServer(const OutstationServer&) = delete;
8183 OutstationServer& operator=(const OutstationServer&) = delete;
8184 // no move assignment
8185 OutstationServer& operator=(OutstationServer&& other) = delete;
8186
8187public:
8191 OutstationServer(OutstationServer&& other) noexcept : self(other.self) { other.self = nullptr; }
8192
8195
8210 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);
8211
8215 void bind();
8216
8226 static OutstationServer create_tcp_server(Runtime& runtime, LinkErrorMode link_error_mode, const std::string& address);
8227
8238 static OutstationServer create_tls_server(Runtime& runtime, LinkErrorMode link_error_mode, const std::string& address, const TlsServerConfig& tls_config);
8239};
8240
8241} // end namespace dnp3
Class used to accept a connection, reject it, or defer it to link identification.
Definition: dnp3.hpp:5546
AcceptHandler(AcceptHandler &&other) noexcept
Transfer ownership of the underlying C-type to this instance and invalidate the other instance.
Definition: dnp3.hpp:5562
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:8063
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:8079
~AddressFilter()
Destroy an address filter.
void add(const std::string &address)
Add an accepted IP address to the filter.
Iterator over AnalogInput instances.
Definition: dnp3.hpp:1080
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:1400
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:1224
AnalogOutputStatus get()
retrieve the current value
bool next()
move the iterator to the next value
AnalogOutputStatusIterator(AnalogOutputStatusIterator &&)=default
move constructor for the iterator
Callbacks for a particular outstation association.
Definition: dnp3.hpp:4258
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:4383
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:2219
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:720
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:1302
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:864
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:1513
ByteIterator(ByteIterator &&)=default
move constructor for the iterator
uint8_t get()
retrieve the current value
bool next()
move the iterator to the next value
Callback for monitoring the client TCP connection state.
Definition: dnp3.hpp:2355
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:4759
CommandException(CommandError error)
construct the exception with an instance of the enum
Definition: dnp3.hpp:4764
CommandError error
underlying error enum
Definition: dnp3.hpp:4762
Builder type used to construct command requests.
Definition: dnp3.hpp:4622
~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:4638
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:4770
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:1615
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:1631
~ConnectOptions()
Destroy an instance.
ConnectOptions()
Initialize to the defaults.
Callbacks to user code that determine how the server processes connections.
Definition: dnp3.hpp:5611
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.
Callback interface for connection state events.
Definition: dnp3.hpp:7827
virtual void on_change(ConnectionState state)=0
Called when the connection state changes.
Callbacks for handling controls.
Definition: dnp3.hpp:7691
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:936
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:6778
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:6794
Database transaction interface.
Definition: dnp3.hpp:6727
virtual void execute(Database &database)=0
Execute a transaction on the provided database.
Internal database access.
Definition: dnp3.hpp:6356
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:6372
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.
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:792
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:3972
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:3961
EmptyResponseException(EmptyResponseError error)
construct the exception with an instance of the enum
Definition: dnp3.hpp:3966
EmptyResponseError error
underlying error enum
Definition: dnp3.hpp:3964
List of IP endpoints.
Definition: dnp3.hpp:1659
EndpointList(EndpointList &&other) noexcept
Transfer ownership of the underlying C-type to this instance and invalidate the other instance.
Definition: dnp3.hpp:1675
~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:3145
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:3059
FileException(FileError error)
construct the exception with an instance of the enum
Definition: dnp3.hpp:3064
FileError error
underlying error enum
Definition: dnp3.hpp:3062
Callback interface for retrieving file info asynchronously.
Definition: dnp3.hpp:4928
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:5056
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:3107
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:3126
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:4947
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:1152
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:1008
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:5582
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:5598
Handler for link status check.
Definition: dnp3.hpp:5150
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:5139
LinkStatusError error
underlying error enum
Definition: dnp3.hpp:5142
LinkStatusException(LinkStatusError error)
construct the exception with an instance of the enum
Definition: dnp3.hpp:5144
Logging interface that receives the log messages and writes them somewhere.
Definition: dnp3.hpp:3301
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:3349
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:5171
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(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:5187
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:5687
MasterServer(MasterServer &&other) noexcept
Transfer ownership of the underlying C-type to this instance and invalidate the other instance.
Definition: dnp3.hpp:5703
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.
Iterator over OctetString instances.
Definition: dnp3.hpp:1580
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:7296
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:7370
virtual RestartDelay warm_restart()=0
Request that the outstation perform a warm restart (IEEE-1815 2012, p. 58)
virtual void event_cleared(uint64_t id)
Called when an event is cleared from the buffer due to master acknowledgement.
Definition: dnp3.hpp:7550
virtual void end_confirm(const BufferState &state)
Called when all relevant events have been cleared.
Definition: dnp3.hpp:7557
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:7509
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:7483
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:7444
virtual FreezeResult freeze_counters_all(FreezeType freeze_type, DatabaseHandle &database_handle)
Freeze all the counters.
Definition: dnp3.hpp:7343
virtual void write_analog_dead_band(uint16_t index, double dead_band)
Called when the outstation begins processing a header to write analog dead-bands.
Definition: dnp3.hpp:7425
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:7357
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:7457
virtual RestartDelay cold_restart()=0
Request that the outstation perform a cold restart (IEEE-1815 2012, p. 58)
virtual ApplicationIin get_application_iin()=0
Returns the application-controlled IIN bits.
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:7496
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:7386
virtual void end_write_analog_dead_bands()
Called when the outstation completes processing a header to write analog dead-bands.
Definition: dnp3.hpp:7433
virtual bool support_write_analog_dead_bands()
Controls outstation support for writing group 34, analog input dead-bands.
Definition: dnp3.hpp:7405
virtual void begin_confirm()
Called when a CONFIRM is received to a response or unsolicited response, but before any previously tr...
Definition: dnp3.hpp:7543
virtual void begin_write_analog_dead_bands()
Called when the outstation begins processing a header to write analog dead-bands.
Definition: dnp3.hpp:7413
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:7470
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:7535
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:7522
Informational callbacks that the outstation doesn't rely on to function.
Definition: dnp3.hpp:7605
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:8175
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:8191
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:7922
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 running on a serial port which is tolerant to the serial port being add...
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:7938
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.
Exception type corresponding to the underlying error enum ParamError.
Definition: dnp3.hpp:133
ParamError error
underlying error enum
Definition: dnp3.hpp:136
ParamException(ParamError error)
construct the exception with an instance of the enum
Definition: dnp3.hpp:138
Callback interface for receiving updates about the state of a serial port.
Definition: dnp3.hpp:2282
virtual void on_change(PortState state)=0
Invoked when the serial port changes state.
Callback interface for retrieving a directory list.
Definition: dnp3.hpp:5091
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:4592
ReadException(ReadError error)
construct the exception with an instance of the enum
Definition: dnp3.hpp:4597
ReadError error
underlying error enum
Definition: dnp3.hpp:4595
Callback interface used to received measurement values received from the outstation.
Definition: dnp3.hpp:3579
virtual void handle_binary_input(const HeaderInfo &info, BinaryInputIterator &values)
Handle binary input data.
Definition: dnp3.hpp:3605
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:3739
virtual void handle_analog_output_status(const HeaderInfo &info, AnalogOutputStatusIterator &values)
Handle analog output status data.
Definition: dnp3.hpp:3661
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:3785
virtual void handle_binary_output_command_event(const HeaderInfo &info, BinaryOutputCommandEventIterator &values)
Handle binary output command events.
Definition: dnp3.hpp:3669
virtual void handle_double_bit_binary_input(const HeaderInfo &info, DoubleBitBinaryInputIterator &values)
Handle double-bit binary input data.
Definition: dnp3.hpp:3613
virtual void handle_frozen_counter(const HeaderInfo &info, FrozenCounterIterator &values)
Handle frozen counter input data.
Definition: dnp3.hpp:3637
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:3752
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:3597
virtual void handle_analog_output_command_event(const HeaderInfo &info, AnalogOutputCommandEventIterator &values)
Handle analog output command events.
Definition: dnp3.hpp:3677
virtual void handle_octet_string(const HeaderInfo &info, OctetStringIterator &values)
Handle octet string data.
Definition: dnp3.hpp:3693
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:3774
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:3589
virtual void handle_binary_output_status(const HeaderInfo &info, BinaryOutputStatusIterator &values)
Handle binary output status data.
Definition: dnp3.hpp:3621
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:3726
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:3715
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:3704
virtual void handle_counter(const HeaderInfo &info, CounterIterator &values)
Handle counter data.
Definition: dnp3.hpp:3629
virtual void handle_analog_input(const HeaderInfo &info, AnalogInputIterator &values)
Handle analog input data.
Definition: dnp3.hpp:3645
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:3763
virtual void handle_frozen_analog_input(const HeaderInfo &info, FrozenAnalogInputIterator &values)
Handle frozen analog input data.
Definition: dnp3.hpp:3653
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:3796
virtual void handle_unsigned_integer(const HeaderInfo &info, UnsignedIntegerIterator &values)
Handle unsigned integer values (g102)
Definition: dnp3.hpp:3685
Handler for read tasks.
Definition: dnp3.hpp:4603
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:4420
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:4436
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 one-byte start/stop header 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 one-byte start/stop header containing 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 one-byte start/stop header containing 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:4898
RestartException(RestartError error)
construct the exception with an instance of the enum
Definition: dnp3.hpp:4903
RestartError error
underlying error enum
Definition: dnp3.hpp:4901
Handler for restart tasks.
Definition: dnp3.hpp:4909
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:359
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:375
Global TCP/TLS configuration settings.
Definition: dnp3.hpp:52
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:4841
TimeSyncError error
underlying error enum
Definition: dnp3.hpp:4844
TimeSyncException(TimeSyncError error)
construct the exception with an instance of the enum
Definition: dnp3.hpp:4846
Handler for time synchronization tasks.
Definition: dnp3.hpp:4852
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:1468
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:3849
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:3865
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:4279
AssociationHandlerLambda(const T &lambda)
constructor
Definition: dnp3.hpp:4287
UtcTimestamp get_current_time() override
implement virtual method from base class
Definition: dnp3.hpp:4290
class that implements ClientStateListener in terms of a lambda expression
Definition: dnp3.hpp:2372
ClientStateListenerLambda(const T &lambda)
constructor
Definition: dnp3.hpp:2380
void on_change(ClientState state) override
implement virtual method from base class
Definition: dnp3.hpp:2383
class that implements ConnectionStateListener in terms of a lambda expression
Definition: dnp3.hpp:7844
ConnectionStateListenerLambda(const T &lambda)
constructor
Definition: dnp3.hpp:7852
void on_change(ConnectionState state) override
implement virtual method from base class
Definition: dnp3.hpp:7855
class that implements DatabaseTransaction in terms of a lambda expression
Definition: dnp3.hpp:6744
DatabaseTransactionLambda(const T &lambda)
constructor
Definition: dnp3.hpp:6752
void execute(Database &database) override
implement virtual method from base class
Definition: dnp3.hpp:6755
class that implements Logger in terms of a lambda expression
Definition: dnp3.hpp:3319
LoggerLambda(const T &lambda)
constructor
Definition: dnp3.hpp:3327
void on_message(LogLevel level, const char *message) override
implement virtual method from base class
Definition: dnp3.hpp:3330
class that implements PortStateListener in terms of a lambda expression
Definition: dnp3.hpp:2300
void on_change(PortState state) override
implement virtual method from base class
Definition: dnp3.hpp:2311
PortStateListenerLambda(const T &lambda)
constructor
Definition: dnp3.hpp:2308
constexpr uint8_t max_binary_input_index
Maximum binary input point index.
Definition: dnp3.hpp:1913
constexpr uint8_t user_assigned_id
User assigned ID code/number.
Definition: dnp3.hpp:1929
constexpr uint8_t supports_frozen_analog_inputs
Supports frozen analog input events.
Definition: dnp3.hpp:1897
constexpr uint8_t device_manufacturers_name
Device manufacturer's name.
Definition: dnp3.hpp:1939
constexpr uint8_t user_specific_attributes
Identification of user-specific attributes.
Definition: dnp3.hpp:1859
constexpr uint8_t device_location_longitude
Longitude of the device from reference meridian (-180.0 to 180.0 deg)
Definition: dnp3.hpp:1845
constexpr uint8_t num_counter
Number of counter points.
Definition: dnp3.hpp:1895
constexpr uint8_t num_master_defined_data_sets
Number of master defined data-sets.
Definition: dnp3.hpp:1865
constexpr uint8_t duration_of_time_accuracy
Duration of time accuracy (seconds)
Definition: dnp3.hpp:1873
constexpr uint8_t num_analog_input
Number of analog input points.
Definition: dnp3.hpp:1903
constexpr uint8_t device_subset_and_conformance
DNP3 subset and conformance.
Definition: dnp3.hpp:1935
constexpr uint8_t num_binary_input
Number of binary input points.
Definition: dnp3.hpp:1915
constexpr uint8_t max_analog_input_index
Maximum analog input point index.
Definition: dnp3.hpp:1901
constexpr uint8_t config_build_date
Time and date that the outstation's current configuration was built defined.
Definition: dnp3.hpp:1833
constexpr uint8_t supports_binary_input_events
Support binary input events.
Definition: dnp3.hpp:1911
constexpr uint8_t num_outstation_defined_data_sets
Number of outstation defined data-sets.
Definition: dnp3.hpp:1867
constexpr uint8_t user_assigned_primary_operator_name
User-assigned primary operator name.
Definition: dnp3.hpp:1851
constexpr uint8_t supports_counter_events
Supports counter events.
Definition: dnp3.hpp:1891
constexpr uint8_t device_manufacturer_software_version
Device manufacturer software version.
Definition: dnp3.hpp:1921
constexpr uint8_t num_binary_outputs
Number of binary outputs.
Definition: dnp3.hpp:1885
constexpr uint8_t supports_frozen_counter_events
Supports frozen counter events.
Definition: dnp3.hpp:1887
constexpr uint8_t config_version
Configuration version.
Definition: dnp3.hpp:1831
constexpr uint8_t device_serial_number
Device serial number.
Definition: dnp3.hpp:1933
constexpr uint8_t supports_double_bit_binary_input_events
Supports double-bit binary input events.
Definition: dnp3.hpp:1905
constexpr uint8_t user_assigned_owner_name
User-assigned owner name.
Definition: dnp3.hpp:1925
constexpr uint8_t num_analog_outputs
Number of analog outputs.
Definition: dnp3.hpp:1879
constexpr uint8_t max_double_bit_binary_input_index
Maximum double-bit binary input point index.
Definition: dnp3.hpp:1907
constexpr uint8_t max_analog_output_index
Maximum analog output index.
Definition: dnp3.hpp:1877
constexpr uint8_t config_id
Configuration id.
Definition: dnp3.hpp:1829
constexpr uint8_t supports_analog_output_events
Supports analog output events.
Definition: dnp3.hpp:1875
constexpr uint8_t all_attributes_request
Non-specific all attributes request.
Definition: dnp3.hpp:1941
constexpr uint8_t list_of_variations
List of attribute variations.
Definition: dnp3.hpp:1943
constexpr uint8_t user_assigned_system_name
User-assigned system name.
Definition: dnp3.hpp:1853
constexpr uint8_t config_last_change_date
Time and date that the outstation's configuration was last modified.
Definition: dnp3.hpp:1835
constexpr uint8_t num_security_stats_per_assoc
Number of security statistics per association.
Definition: dnp3.hpp:1857
constexpr uint8_t num_master_defined_data_set_proto
Number of master defined data-set prototypes.
Definition: dnp3.hpp:1861
constexpr uint8_t product_name_and_model
Device manufacturer's product name and model.
Definition: dnp3.hpp:1937
constexpr uint8_t supports_frozen_counters
Supports frozen counters.
Definition: dnp3.hpp:1889
constexpr uint8_t max_binary_output_index
Maximum binary output index.
Definition: dnp3.hpp:1883
constexpr uint8_t config_digest
Digest (aka fingerprint) of the configuration using a CRC, HASH, MAC, or public key signature.
Definition: dnp3.hpp:1837
constexpr uint8_t supports_analog_input_events
Supports analog input events.
Definition: dnp3.hpp:1899
constexpr uint8_t user_assigned_device_name
User assigned device name.
Definition: dnp3.hpp:1931
constexpr uint8_t device_manufacturer_hardware_version
Device manufacturer hardware version.
Definition: dnp3.hpp:1923
constexpr uint8_t supports_binary_output_events
Supports binary output events.
Definition: dnp3.hpp:1881
constexpr uint8_t max_counter_index
Maximum counter point index.
Definition: dnp3.hpp:1893
constexpr uint8_t max_rx_fragment_size
Maximum receive fragment size.
Definition: dnp3.hpp:1919
constexpr uint8_t local_timing_accuracy
Local timing accuracy (microseconds)
Definition: dnp3.hpp:1871
constexpr uint8_t device_location_latitude
Latitude of the device from the equator (90.0 to -90.0 deg)
Definition: dnp3.hpp:1847
constexpr uint8_t config_digest_algorithm
Configuration digest algorithm.
Definition: dnp3.hpp:1839
constexpr uint8_t max_tx_fragment_size
Maximum transmit fragment size.
Definition: dnp3.hpp:1917
constexpr uint8_t num_outstation_defined_data_set_proto
Number of outstation defined data-set prototypes.
Definition: dnp3.hpp:1863
constexpr uint8_t user_assigned_secondary_operator_name
User-assigned secondary operator name.
Definition: dnp3.hpp:1849
constexpr uint8_t master_resource_id
Master resource id (mRID)
Definition: dnp3.hpp:1841
constexpr uint8_t num_double_bit_binary_input
Number of double-bit binary input points.
Definition: dnp3.hpp:1909
constexpr uint8_t max_binary_output_per_request
Maximum number of binary outputs per request.
Definition: dnp3.hpp:1869
constexpr uint8_t device_location_altitude
Altitude of the device.
Definition: dnp3.hpp:1843
constexpr uint8_t user_assigned_location
User assigned location name.
Definition: dnp3.hpp:1927
constexpr uint8_t secure_auth_version
Secure authentication version.
Definition: dnp3.hpp:1855
constexpr uint8_t restart
Object value has not been updated since device restart.
Definition: dnp3.hpp:197
constexpr uint8_t discontinuity
Reported counter value cannot be compared against a prior value to obtain the correct count differenc...
Definition: dnp3.hpp:209
constexpr uint8_t chatter_filter
Object value is changing state rapidly (device dependent meaning)
Definition: dnp3.hpp:205
constexpr uint8_t reference_err
Object's value might not have the expected level of accuracy.
Definition: dnp3.hpp:211
constexpr uint8_t over_range
Object's true exceeds the measurement range of the reported variation.
Definition: dnp3.hpp:207
constexpr uint8_t remote_forced
Object value is overridden in a downstream reporting device.
Definition: dnp3.hpp:201
constexpr uint8_t local_forced
Object value is overridden by the device reporting this flag.
Definition: dnp3.hpp:203
constexpr uint8_t online
Object value is 'good' / 'valid' / 'nominal'.
Definition: dnp3.hpp:195
constexpr uint8_t comm_lost
Object value represents the last value available before a communication failure occurred....
Definition: dnp3.hpp:199
std::unique_ptr< ConnectionStateListener > connection_state_listener(const T &lambda)
construct an implementation of ConnectionStateListener based on a lambda expression
Definition: dnp3.hpp:7866
std::unique_ptr< Logger > logger(const T &lambda)
construct an implementation of Logger based on a lambda expression
Definition: dnp3.hpp:3341
std::unique_ptr< PortStateListener > port_state_listener(const T &lambda)
construct an implementation of PortStateListener based on a lambda expression
Definition: dnp3.hpp:2322
std::unique_ptr< ClientStateListener > client_state_listener(const T &lambda)
construct an implementation of ClientStateListener based on a lambda expression
Definition: dnp3.hpp:2394
DatabaseTransactionLambda< T > database_transaction(const T &lambda)
construct an implementation of DatabaseTransaction based on a lambda expression
Definition: dnp3.hpp:6766
std::unique_ptr< AssociationHandler > association_handler(const T &lambda)
construct an implementation of AssociationHandler based on a lambda expression
Definition: dnp3.hpp:4301
main namespace for the dnp3 library
Definition: dnp3.hpp:39
AutoTimeSync
Automatic time synchronization configuration.
Definition: dnp3.hpp:4127
@ non_lan
Perform automatic time sync with Delay Measurement (0x17) function code.
@ lan
Perform automatic time sync with Record Current Time (0x18) function code.
EventBinaryOutputStatusVariation
Event binary output status variation.
Definition: dnp3.hpp:5996
ResponseFunction
Type of response.
Definition: dnp3.hpp:3365
FileType
File type enumeration used in Group 70 objects.
Definition: dnp3.hpp:2905
@ 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:2108
@ 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.
TimeFormat
Describes if and how the time will be formatted in log messages.
Definition: dnp3.hpp:3243
@ 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:4713
@ select_before_operate
Perform a Select and Operate (0x03 then 0x04)
StringAttr
Enumeration of all the default string attributes.
Definition: dnp3.hpp:1960
@ 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:2714
@ 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:3558
@ 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:5783
@ 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:6276
BoolAttr
Enumeration of all the known boolean attributes.
Definition: dnp3.hpp:2079
@ 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:3209
@ 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:6335
@ reserved_variation
Variation is reserved and cannot be defined.
@ 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:2731
@ none
No flow control.
@ hardware
Flow control using RTS/CTS signals.
@ software
Flow control using XON/XOFF bytes.
EventAnalogInputVariation
Event analog variation.
Definition: dnp3.hpp:6200
WriteTimeResult
Write time result used by OutstationApplication::write_absolute_time()
Definition: dnp3.hpp:7125
@ parameter_error
The request parameters are nonsensical.
StaticBinaryOutputStatusVariation
Static binary output status variation.
Definition: dnp3.hpp:5983
TransportDecodeLevel
Controls how transmitted and received transport segments are decoded at the INFO log level.
Definition: dnp3.hpp:232
@ payload
Decode the header and the raw payload as hexadecimal.
FloatAttr
Enumeration of all known float attributes.
Definition: dnp3.hpp:2147
@ 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:1335
@ 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:4800
@ overflow
Overflow in calculation.
@ system_time_not_unix
The system time cannot be converted to a Unix timestamp.
@ system_time_not_available
System time not available.
@ 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:4309
@ file_read
Read a file from the outstation.
@ command
Command request.
@ user_read
User-defined read request.
@ auto_event_scan
Automatic event scan caused by RESTART IIN bit detection.
@ 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:2402
@ group41_var4
Analog Output - Double-precision floating point.
@ group42_var1
Analog Output Event - 32-bit without time.
@ group23_var2
Frozen Counter Event - 16-bit with flags.
@ group31_var7
Frozen Analog Input - Single-precision floating point with flags.
@ group13_var2
Binary Output Command Event - command status with time.
@ group40_var3
Analog Output Status - Single-precision floating point with flags.
@ group60_var4
Class objects - Class 3 data.
@ group21_var9
Frozen Counter - 32-bit without flag.
@ group33_var8
Frozen Analog Input Event - Double-precision floating point with time.
@ group31_var0
Frozen Analog Input - Default variation.
@ group31_var5
Frozen Analog Input - 32-bit without flags.
@ group21_var2
Frozen Counter - 16-bit with flags.
@ group13_var1
Binary Output Command Event - command status without time.
@ group40_var1
Analog Output Status - 32-bit with flags.
@ group30_var3
Analog Input - 32-bit without flag.
@ 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 with flags.
@ 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 - Default 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 flags and 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 objects - Class 1 data.
@ group20_var2
Counter - 16-bit with flags.
@ group70_var6
File control - file transport status.
@ group2_var0
Binary Input Event - Default variation.
@ group21_var5
Frozen Counter - 32-bit with flags and time.
@ group70_var8
File control - file specification string.
@ group0
Device Attributes - Variations 0 to 253 and 255.
@ group2_var3
Binary Input Event - With relative time.
@ group42_var6
Analog Output Event - Double-precision floating point without time.
@ group32_var0
Analog Input Event - Default variation.
@ group33_var7
Frozen Analog Input Event - Single-precision floating point with time.
@ group22_var6
Counter Event - 16-bit with flags and time.
@ group20_var1
Counter - 32-bit with flags.
@ group33_var4
Frozen Analog Input Event - 16-bit with time.
@ 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 flags and time.
@ group0_var254
Device Attributes - Non-Specific All Attributes Request.
@ group60_var1
Class objects - Class 0 data.
@ 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.
@ 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 - Default variation.
@ group21_var0
Frozen Counter - Default 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 - Absolute time, unsynchronized.
@ group40_var0
Analog Output Status - Default 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 absolute time and long interval.
@ group52_var1
Time delay - Coarse.
@ group51_var1
Time and date CTO - Absolute time, synchronized.
@ group52_var2
Time delay - Fine.
@ group50_var2
Time and Date - Absolute time and interval.
@ group34_var0
Analog Input Reporting Deadband - Default variation.
@ group20_var0
Counter - Default variation.
@ group32_var7
Analog Input Event - Single-precision floating point with time.
@ group3_var0
Double-bit Binary Input - Default 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 with flags.
@ group70_var3
File control - file command.
@ group42_var0
Analog Output Event - Default variation.
@ group33_var3
Frozen Analog Input Event - 32-bit with time.
@ group23_var0
Frozen Counter Event - Default variation.
@ group31_var6
Frozen Analog Input - 16-bit without flags.
@ group50_var3
Time and Date - Absolute time at last recorded time.
@ group22_var0
Counter Event - Default variation.
@ group30_var2
Analog Input - 16-bit with flags.
@ group20_var5
Counter - 32-bit without flag.
@ 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 - Default 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 - Default variation.
@ group60_var3
Class objects - Class 2 data.
@ group102_var0
Unsigned Integer - Default Variation.
@ group32_var5
Analog Input Event - Single-precision floating point without time.
@ group21_var10
Frozen Counter - 16-bit without flag.
@ 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 flag.
@ group41_var1
Analog Output - 32-bit.
@ group20_var6
Counter - 16-bit without flag.
@ 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 - Default variation.
@ group23_var1
Frozen Counter Event - 32-bit with flags.
@ group111
Octet String Event.
@ group2_var2
Binary Input Event - With absolute time.
@ group23_var6
Frozen Counter Event - 16-bit with flags and time.
@ group4_var3
Double-bit Binary Input Event - With relative time.
@ group4_var0
Double-bit Binary Input Event - Default variation.
OpType
Operation Type field, used in conjunction with TripCloseCode to specify a control operation.
Definition: dnp3.hpp:449
@ 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:2136
EventCounterVariation
Event counter variation.
Definition: dnp3.hpp:6056
OperateType
Enumeration describing how the master requested the control operation.
Definition: dnp3.hpp:7674
@ direct_operate_no_ack
operate the control via a DirectOperateNoAck request
EventDoubleBitBinaryInputVariation
Event double-bit binary input variation.
Definition: dnp3.hpp:5938
UdpSocketMode
Describes how the UDP socket reads and writes datagrams from remote endpoint(s)
Definition: dnp3.hpp:3177
@ 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:6259
CommandStatus
Enumeration received from an outstation in response to command request.
Definition: dnp3.hpp:142
@ 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:3162
@ append
Specifies that the file is to be opened for writing, appending to the end of the file.
TimeQuality
Timestamp quality.
Definition: dnp3.hpp:595
@ 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:42
StaticDoubleBitBinaryInputVariation
Static double-bit binary input variation.
Definition: dnp3.hpp:5925
UpdateResult
Defines what occurred during an update operation and which fields of UpdateInfo are valid.
Definition: dnp3.hpp:5741
@ 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 variation.
Definition: dnp3.hpp:6179
LinkReadMode
Controls how the link-layer parser treats frames that span multiple calls to read of the physical lay...
Definition: dnp3.hpp:3194
@ 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:2830
@ 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:2252
StaticBinaryInputVariation
Static binary input variation.
Definition: dnp3.hpp:5867
RestartDelayType
Type of restart delay value. Used by RestartDelay.
Definition: dnp3.hpp:7056
@ 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:247
CertificateMode
Determines how the certificate(s) presented by the peer are validated.
Definition: dnp3.hpp:1746
@ 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:1947
@ list_of_variations
Variation 255 - List of attribute variations.
UintAttr
Enumeration of all the default uint attributes.
Definition: dnp3.hpp:2007
@ 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:4726
@ 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:5880
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:664
@ 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:6107
StopBits
Number of stop bits.
Definition: dnp3.hpp:2761
@ two
Two stop bits.
@ one
One stop bit.
ReadError
Errors that can occur during a read operation.
Definition: dnp3.hpp:4563
FreezeType
Freeze operation type.
Definition: dnp3.hpp:7140
@ 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:46
AppDecodeLevel
Controls how transmitted and received application-layer fragments are decoded at the INFO log level.
Definition: dnp3.hpp:215
@ 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:6128
FreezeResult
Result of a freeze operation.
Definition: dnp3.hpp:7153
@ not_supported
The demanded freeze operation is not supported by this device.
OctetStringAttr
Enumeration of all known octet-string attributes.
Definition: dnp3.hpp:2123
@ 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:44
FileError
Errors that can occur during file transfer.
Definition: dnp3.hpp:3018
@ 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
@ 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 object headers
@ bad_block_num
Received an unexpected block number.
@ 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:3505
@ 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:2817
@ 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:3930
@ 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:48
TaskError
Task error used in AssociationInformation.
Definition: dnp3.hpp:4354
RestartError
Errors that can occur during a cold/warm restart operation.
Definition: dnp3.hpp:4869
ParamError
Error type used throughout the library.
Definition: dnp3.hpp:72
@ 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:5844
@ 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:5724
@ class3
Class 3 event.
@ class1
Class 1 event.
@ class2
Class 2 event.
TimeSyncMode
Time synchronization mode.
Definition: dnp3.hpp:4787
LinkStatusError
Errors that can occur during a manually initiated link status check. See MasterChannel::check_link_st...
Definition: dnp3.hpp:5108
@ unexpected_response
There was activity on the link, but it wasn't a LINK_STATUS.
StaticCounterVariation
Static counter variation.
Definition: dnp3.hpp:6039
BroadcastAction
Enumeration describing how the outstation processed a broadcast request.
Definition: dnp3.hpp:7584
@ 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:7812
@ disconnected
Disconnected from the master.
TripCloseCode
Trip-Close Code field, used in conjunction with OpType to specify a control operation.
Definition: dnp3.hpp:432
@ reserved
RESERVED (3)
MinTlsVersion
Minimum TLS version to allow.
Definition: dnp3.hpp:1731
@ v12
Allow TLS 1.2 and 1.3.
@ v13
Only allow TLS 1.3.
LogOutputFormat
Describes how each log event is formatted.
Definition: dnp3.hpp:3230
@ text
A simple text-based format.
@ json
Output formatted as JSON.
Parity
Parity checking modes.
Definition: dnp3.hpp:2746
@ 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:2263
@ 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:2332
@ 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:2066
PhysDecodeLevel
Controls how data transmitted at the physical layer (TCP, serial, etc) is logged.
Definition: dnp3.hpp:262
@ 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:6227
double deadband
Deadband value.
Definition: dnp3.hpp:6255
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:6251
EventAnalogInputVariation event_variation
Default event variation.
Definition: dnp3.hpp:6253
analog_input point
Definition: dnp3.hpp:1043
Timestamp time
Point timestamp.
Definition: dnp3.hpp:1064
uint16_t index
Point index.
Definition: dnp3.hpp:1058
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:1062
double value
Point value.
Definition: dnp3.hpp:1060
Event transferred from master to outstation when the outstation receives a corresponding command.
Definition: dnp3.hpp:1358
double commanded_value
Commanded state of the binary output.
Definition: dnp3.hpp:1380
AnalogCommandType command_type
Describes how the value was encoded in the protocol.
Definition: dnp3.hpp:1382
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:1376
uint16_t index
Index of the command event.
Definition: dnp3.hpp:1374
Timestamp time
Associated timestamp.
Definition: dnp3.hpp:1384
Analog Output Status configuration.
Definition: dnp3.hpp:6303
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:6331
StaticAnalogOutputStatusVariation static_variation
Default static variation.
Definition: dnp3.hpp:6327
EventAnalogOutputStatusVariation event_variation
Default event variation.
Definition: dnp3.hpp:6329
AnalogOutputStatusConfig()
Initialize to defaults.
analog_output_status point
Definition: dnp3.hpp:1187
Timestamp time
Point timestamp.
Definition: dnp3.hpp:1208
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:1202
Flags flags
Point flags.
Definition: dnp3.hpp:1206
double value
Point value.
Definition: dnp3.hpp:1204
Application-controlled IIN bits.
Definition: dnp3.hpp:7170
bool config_corrupt
IIN2.5 - Configuration corrupt.
Definition: dnp3.hpp:7203
bool need_time
IIN1.4 - Time synchronization is required.
Definition: dnp3.hpp:7197
bool local_control
IIN1.5 - Some output points are in local mode.
Definition: dnp3.hpp:7199
bool device_trouble
IIN1.6 - Device trouble.
Definition: dnp3.hpp:7201
ApplicationIin()
Initialize all fields in ApplicationIin to false.
Association configuration.
Definition: dnp3.hpp:4144
Classes startup_integrity_classes
Startup integrity classes to ask on master startup and when an outstation restart is detected.
Definition: dnp3.hpp:4192
std::chrono::steady_clock::duration keep_alive_timeout
Delay of inactivity before sending a REQUEST_LINK_STATUS to the outstation.
Definition: dnp3.hpp:4200
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:4194
EventClasses enable_unsol_classes
Classes to enable unsolicited responses at startup.
Definition: dnp3.hpp:4188
EventClasses event_scan_on_events_available
Classes to automatically send reads when the IIN bit is asserted.
Definition: dnp3.hpp:4204
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:4206
EventClasses disable_unsol_classes
Classes to disable unsolicited responses at startup.
Definition: dnp3.hpp:4186
bool auto_integrity_scan_on_buffer_overflow
Automatic integrity scan when an EVENT_BUFFER_OVERFLOW is detected.
Definition: dnp3.hpp:4202
RetryStrategy auto_tasks_retry_strategy
Automatic tasks retry strategy.
Definition: dnp3.hpp:4196
std::chrono::steady_clock::duration response_timeout
Timeout for receiving a response on this association.
Definition: dnp3.hpp:4184
Association identifier.
Definition: dnp3.hpp:3991
An attribute variation and properties pair returned in Group0Var255.
Definition: dnp3.hpp:2187
uint8_t variation
Variation of the attribute.
Definition: dnp3.hpp:2201
AttrProp properties
Properties of the attribute.
Definition: dnp3.hpp:2203
Attribute properties returned in Group0Var255.
Definition: dnp3.hpp:2168
bool is_writable
Indicate if the property can be used in a WRITE operation.
Definition: dnp3.hpp:2181
Binary Input configuration.
Definition: dnp3.hpp:5897
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:5919
EventBinaryInputVariation event_variation
Default event variation.
Definition: dnp3.hpp:5921
BinaryInputConfig()
Initialize to defaults.
binary_input point
Definition: dnp3.hpp:683
uint16_t index
Point index.
Definition: dnp3.hpp:698
Timestamp time
Point timestamp.
Definition: dnp3.hpp:704
bool value
Point value.
Definition: dnp3.hpp:700
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:702
Event transferred from master to outstation when the outstation receives a corresponding command.
Definition: dnp3.hpp:1263
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:1284
uint16_t index
Index of the binary command event.
Definition: dnp3.hpp:1278
Timestamp time
Associated timestamp.
Definition: dnp3.hpp:1286
CommandStatus status
Status from processing the command that triggered this event.
Definition: dnp3.hpp:1280
Binary Output Status configuration.
Definition: dnp3.hpp:6011
EventBinaryOutputStatusVariation event_variation
Default event variation.
Definition: dnp3.hpp:6035
StaticBinaryOutputStatusVariation static_variation
Default static variation.
Definition: dnp3.hpp:6033
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:827
uint16_t index
Point index.
Definition: dnp3.hpp:842
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:844
Flags flags
Point flags.
Definition: dnp3.hpp:846
Timestamp time
Point timestamp.
Definition: dnp3.hpp:848
Information about the state of buffer after a CONFIRM has been processed.
Definition: dnp3.hpp:7274
ClassCount classes
Remaining number of events in the buffer on a per-class basis.
Definition: dnp3.hpp:7288
TypeCount types
Remaining number of events in the buffer on a per-type basis.
Definition: dnp3.hpp:7290
Remaining number of events in the buffer after a confirm on a per-class basis.
Definition: dnp3.hpp:7209
uint32_t num_class_1
Number of class 1 events remaining in the buffer.
Definition: dnp3.hpp:7224
uint32_t num_class_2
Number of class 2 events remaining in the buffer.
Definition: dnp3.hpp:7226
uint32_t num_class_3
Number of class 3 events remaining in the buffer.
Definition: dnp3.hpp:7228
Controls which types are reported during a Class 0 read.
Definition: dnp3.hpp:6862
ClassZeroConfig()
Initialize to default values.
bool analog_output_status
Include Analog Output Status in Class 0 reads.
Definition: dnp3.hpp:6909
bool binary
Include Binary Inputs in Class 0 reads.
Definition: dnp3.hpp:6897
bool frozen_counter
Include Frozen Counters in Class 0 reads.
Definition: dnp3.hpp:6905
bool analog
Include Analog Inputs in Class 0 reads.
Definition: dnp3.hpp:6907
bool octet_string
Include Octet Strings in Class 0 reads.
Definition: dnp3.hpp:6913
bool binary_output_status
Include Binary Output Status in Class 0 reads.
Definition: dnp3.hpp:6901
bool double_bit_binary
Include Double-Bit Binary Inputs in Class 0 reads.
Definition: dnp3.hpp:6899
bool counter
Include Counters in Class 0 reads.
Definition: dnp3.hpp:6903
Class 0, 1, 2 and 3 config.
Definition: dnp3.hpp:4078
bool class3
Class 3 events.
Definition: dnp3.hpp:4123
bool class0
Class 0 (static data)
Definition: dnp3.hpp:4117
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:4119
bool class2
Class 2 events.
Definition: dnp3.hpp:4121
Timing parameters for connection attempts.
Definition: dnp3.hpp:1698
std::chrono::steady_clock::duration reconnect_delay
Delay before attempting a connection after a disconnect.
Definition: dnp3.hpp:1727
std::chrono::steady_clock::duration min_connect_delay
Minimum delay between two connection attempts, doubles up to the maximum delay.
Definition: dnp3.hpp:1723
std::chrono::steady_clock::duration max_connect_delay
Maximum delay between two connection attempts.
Definition: dnp3.hpp:1725
ConnectStrategy()
Initialize to default values.
CROB (Group12Var1) control code.
Definition: dnp3.hpp:470
bool clear
Support for this field is optional. When the clear bit is set, the device shall remove pending contro...
Definition: dnp3.hpp:528
OpType op_type
This field is used in conjunction with the ControlCode::tcc field to specify a control operation.
Definition: dnp3.hpp:532
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:530
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:526
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:403
bool fir
First fragment in the message.
Definition: dnp3.hpp:420
bool uns
Unsolicited response.
Definition: dnp3.hpp:426
bool fin
Final fragment of the message.
Definition: dnp3.hpp:422
bool con
Requires confirmation.
Definition: dnp3.hpp:424
uint8_t seq
Sequence number.
Definition: dnp3.hpp:428
Counter configuration.
Definition: dnp3.hpp:6075
StaticCounterVariation static_variation
Default static variation.
Definition: dnp3.hpp:6099
uint32_t deadband
Deadband value.
Definition: dnp3.hpp:6103
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:6101
counter point
Definition: dnp3.hpp:899
uint16_t index
Point index.
Definition: dnp3.hpp:914
Timestamp time
Point timestamp.
Definition: dnp3.hpp:920
Flags flags
Point flags.
Definition: dnp3.hpp:918
uint32_t value
Point value.
Definition: dnp3.hpp:916
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:279
TransportDecodeLevel transport
Controls transport segment layer decoding.
Definition: dnp3.hpp:320
DecodeLevel()
Initialize log levels to defaults.
AppDecodeLevel application
Controls application fragment decoding.
Definition: dnp3.hpp:318
LinkDecodeLevel link
Controls link frame decoding.
Definition: dnp3.hpp:322
static DecodeLevel nothing()
Initialize log levels to nothing.
PhysDecodeLevel physical
Controls the logging of physical layer read/write.
Definition: dnp3.hpp:324
Configuration related to reading a file.
Definition: dnp3.hpp:5014
uint16_t max_block_size
Maximum block size requested by the master during the file open.
Definition: dnp3.hpp:5038
uint32_t max_file_size
Maximum number of bytes that may be accumulated while reading directory information.
Definition: dnp3.hpp:5040
static DirReadConfig defaults()
Initialize the configuration to default values.
Double-Bit Binary Input configuration.
Definition: dnp3.hpp:5955
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:5979
StaticDoubleBitBinaryInputVariation static_variation
Default static variation.
Definition: dnp3.hpp:5977
DoubleBitBinaryInputConfig()
Initialize to defaults.
double_bit_binary_input point
Definition: dnp3.hpp:755
DoubleBit value
Point value.
Definition: dnp3.hpp:772
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:774
uint16_t index
Point index.
Definition: dnp3.hpp:770
Timestamp time
Point timestamp.
Definition: dnp3.hpp:776
Maximum number of events for each type.
Definition: dnp3.hpp:6807
uint16_t max_counter
Maximum number of Counter events (g22)
Definition: dnp3.hpp:6848
uint16_t max_frozen_counter
Maximum number of Frozen Counter events (g23)
Definition: dnp3.hpp:6850
uint16_t max_binary
Maximum number of Binary Input events (g2)
Definition: dnp3.hpp:6842
uint16_t max_analog_output_status
Maximum number of Analog Output Status events (g42)
Definition: dnp3.hpp:6854
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:6856
uint16_t max_analog
Maximum number of Analog Input events (g32)
Definition: dnp3.hpp:6852
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:6846
uint16_t max_double_bit_binary
Maximum number of Double-Bit Binary Input events (g4)
Definition: dnp3.hpp:6844
Event classes.
Definition: dnp3.hpp:4032
bool class2
Class 2 events.
Definition: dnp3.hpp:4070
static EventClasses none()
Initialize all classes to false.
bool class1
Class 1 events.
Definition: dnp3.hpp:4068
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:4072
Information about a file or directory returned from the outstation.
Definition: dnp3.hpp:3072
uint64_t time_created
DNP3 timestamp.
Definition: dnp3.hpp:3099
Permissions permissions
Outstation permissions for the file.
Definition: dnp3.hpp:3101
uint32_t size
Size of the file in bytes.
Definition: dnp3.hpp:3095
FileType file_type
Simple file or directory.
Definition: dnp3.hpp:3091
std::string file_name
Name of the file or directory.
Definition: dnp3.hpp:3089
Configuration related to reading a file.
Definition: dnp3.hpp:4982
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:5006
uint32_t max_file_size
Maximum file size accepted by the master.
Definition: dnp3.hpp:5008
Collection of individual flag bits represented by an underlying mask value.
Definition: dnp3.hpp:579
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:591
frozen_analog_input point
Definition: dnp3.hpp:1115
Timestamp time
Point timestamp.
Definition: dnp3.hpp:1136
uint16_t index
Point index.
Definition: dnp3.hpp:1130
Flags flags
Point flags.
Definition: dnp3.hpp:1134
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:1132
Frozen Counter configuration.
Definition: dnp3.hpp:6147
FrozenCounterConfig()
Initialize to defaults.
uint32_t deadband
Deadband value.
Definition: dnp3.hpp:6175
StaticFrozenCounterVariation static_variation
Default static variation.
Definition: dnp3.hpp:6171
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:6173
frozen_counter point
Definition: dnp3.hpp:971
Flags flags
Point flags.
Definition: dnp3.hpp:990
Timestamp time
Point timestamp.
Definition: dnp3.hpp:992
uint16_t index
Point index.
Definition: dnp3.hpp:986
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:988
Control Relay Output Block.
Definition: dnp3.hpp:538
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:573
uint32_t on_time
Duration the output drive remains active (in milliseconds)
Definition: dnp3.hpp:571
uint8_t count
Count.
Definition: dnp3.hpp:569
ControlCode code
Control code.
Definition: dnp3.hpp:567
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:3532
bool has_flags
true if a flags byte is present on the underlying variation, false otherwise
Definition: dnp3.hpp:3554
QualifierCode qualifier
Qualifier code used in the response.
Definition: dnp3.hpp:3550
Variation variation
underlying variation in the response
Definition: dnp3.hpp:3548
bool is_event
true if the received variation is an event type, false otherwise
Definition: dnp3.hpp:3552
First IIN byte.
Definition: dnp3.hpp:3380
bool need_time
Outstation requires time synchronization.
Definition: dnp3.hpp:3408
bool class_2_events
Outstation has unreported Class 2 events.
Definition: dnp3.hpp:3404
bool device_trouble
An abnormal, device-specific condition exists in the outstation.
Definition: dnp3.hpp:3412
bool local_control
One or more of the outstation’s points are in local control mode.
Definition: dnp3.hpp:3410
bool class_1_events
Outstation has unreported Class 1 events.
Definition: dnp3.hpp:3402
bool class_3_events
Outstation has unreported Class 3 events.
Definition: dnp3.hpp:3406
bool broadcast
Broadcast message was received.
Definition: dnp3.hpp:3400
bool device_restart
Outstation restarted.
Definition: dnp3.hpp:3414
Second IIN byte.
Definition: dnp3.hpp:3420
bool object_unknown
Outstation does not support requested operation for objects in the request.
Definition: dnp3.hpp:3442
bool config_corrupt
The outstation detected corrupt configuration (optional support)
Definition: dnp3.hpp:3450
bool reserved_2
Reserved for future use - should always be set to 0.
Definition: dnp3.hpp:3452
bool event_buffer_overflow
An event buffer overflow condition exists in the outstation, and at least one unconfirmed event was l...
Definition: dnp3.hpp:3446
bool no_func_code_support
Outstation does not support this function code.
Definition: dnp3.hpp:3440
bool reserved_1
Reserved for future use - should always be set to 0.
Definition: dnp3.hpp:3454
bool already_executing
The operation requested is already executing (optional support)
Definition: dnp3.hpp:3448
bool parameter_error
Outstation does not support requested operation for objects in the request.
Definition: dnp3.hpp:3444
Pair of IIN bytes.
Definition: dnp3.hpp:3460
Iin2 iin2
Second IIN byte.
Definition: dnp3.hpp:3476
Iin1 iin1
First IIN byte.
Definition: dnp3.hpp:3474
Configuration that controls how the server performs remote link identification.
Definition: dnp3.hpp:5654
std::chrono::steady_clock::duration timeout
Maximum time period to wait before receiving a link frame from the outstation.
Definition: dnp3.hpp:5681
PhysDecodeLevel decode_level
Set the decode level to use when reading the link header used for identification.
Definition: dnp3.hpp:5683
LinkIdConfig()
Initialize to default values.
uint16_t max_tasks
Set the maximum number of simultaneous tasks used to perform link identification.
Definition: dnp3.hpp:5679
Logging configuration options.
Definition: dnp3.hpp:3258
LogOutputFormat output_format
output formatting options
Definition: dnp3.hpp:3289
bool print_level
optionally print the log level as part to the message string
Definition: dnp3.hpp:3293
LoggingConfig()
Initialize the configuration to default values.
TimeFormat time_format
optional time format
Definition: dnp3.hpp:3291
bool print_module_info
optionally print the underlying Rust module information to the message string
Definition: dnp3.hpp:3295
LogLevel level
logging level
Definition: dnp3.hpp:3287
Configuration for a MasterChannel that is independent of the physical layer.
Definition: dnp3.hpp:3803
DecodeLevel decode_level
Decoding level for this master. You can modify this later on with MasterChannel::set_decode_level().
Definition: dnp3.hpp:3833
uint16_t address
Local DNP3 data-link address.
Definition: dnp3.hpp:3831
MasterChannelConfig(uint16_t address)
Initialize MasterChannelConfig to default values.
uint16_t tx_buffer_size
TX buffer size.
Definition: dnp3.hpp:3837
uint16_t rx_buffer_size
RX buffer size.
Definition: dnp3.hpp:3841
Octet String point.
Definition: dnp3.hpp:1548
uint16_t index
Point index.
Definition: dnp3.hpp:1562
ByteIterator value
Point value.
Definition: dnp3.hpp:1564
The result of opening a file on the outstation.
Definition: dnp3.hpp:2991
uint16_t max_block_size
Maximum block size returned by the outstation.
Definition: dnp3.hpp:3014
uint32_t file_handle
The handle assigned to the file by the outstation.
Definition: dnp3.hpp:3008
uint32_t file_size
Size of the file returned by the outstation.
Definition: dnp3.hpp:3010
Outstation configuration.
Definition: dnp3.hpp:6960
uint32_t max_unsolicited_retries
Maximum number of unsolicited retries.
Definition: dnp3.hpp:7038
uint16_t max_controls_per_request
Maximum number of controls in a single request.
Definition: dnp3.hpp:7050
DecodeLevel decode_level
Decoding level.
Definition: dnp3.hpp:7030
uint16_t unsolicited_buffer_size
Unsolicited response buffer size.
Definition: dnp3.hpp:7024
OutstationFeatures features
Optional features.
Definition: dnp3.hpp:7036
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:7034
std::chrono::steady_clock::duration unsolicited_retry_delay
Delay to wait before retrying an unsolicited response.
Definition: dnp3.hpp:7040
std::chrono::steady_clock::duration keep_alive_timeout
Delay of inactivity before sending a REQUEST_LINK_STATUS to the master.
Definition: dnp3.hpp:7044
std::chrono::steady_clock::duration confirm_timeout
Confirmation timeout.
Definition: dnp3.hpp:7032
ClassZeroConfig class_zero
Controls responses to Class 0 reads.
Definition: dnp3.hpp:7052
uint16_t max_read_request_headers
Maximum number of headers that will be processed in a READ request.
Definition: dnp3.hpp:7048
uint16_t master_address
Link-layer master address.
Definition: dnp3.hpp:7014
EventBufferConfig event_buffer_config
Event buffer sizes configuration.
Definition: dnp3.hpp:7016
uint16_t outstation_address
Link-layer outstation address.
Definition: dnp3.hpp:7012
uint16_t solicited_buffer_size
Solicited response buffer size.
Definition: dnp3.hpp:7020
uint16_t rx_buffer_size
Receive buffer size.
Definition: dnp3.hpp:7028
Optional outstation features that can be enabled or disabled.
Definition: dnp3.hpp:6919
bool broadcast
Process valid broadcast messages.
Definition: dnp3.hpp:6948
OutstationFeatures()
Initialize to default values.
bool self_address
Respond to the self address.
Definition: dnp3.hpp:6946
bool unsolicited
Respond to enable/disable unsolicited response and produce unsolicited responses.
Definition: dnp3.hpp:6950
bool respond_to_any_master
Outstation will process every request as if it came from the configured master address.
Definition: dnp3.hpp:6954
UDP outstation configuration.
Definition: dnp3.hpp:7878
std::string remote_endpoint
Remote endpoint where outbound requests are sent. Must be a socket address (ip:port)
Definition: dnp3.hpp:7910
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:7916
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:7912
std::string local_endpoint
Local endpoint to which the UDP socket is bound. Must be a socket address (ip:port)
Definition: dnp3.hpp:7908
LinkReadMode link_read_mode
Read mode to use, this should typically be set to LinkReadMode::datagram
Definition: dnp3.hpp:7914
Defines read, write, execute permissions for particular group or user.
Definition: dnp3.hpp:2922
bool execute
Permission to execute.
Definition: dnp3.hpp:2946
bool read
Permission to read.
Definition: dnp3.hpp:2950
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:2948
Permissions for world, group, and owner.
Definition: dnp3.hpp:2956
PermissionSet owner
Owner permissions.
Definition: dnp3.hpp:2985
PermissionSet group
Group permissions.
Definition: dnp3.hpp:2983
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:2981
Poll identifier.
Definition: dnp3.hpp:4010
Application-layer header for requests.
Definition: dnp3.hpp:7564
ControlField control_field
Control field.
Definition: dnp3.hpp:7578
FunctionCode function
Function code.
Definition: dnp3.hpp:7580
Response header information.
Definition: dnp3.hpp:3482
ResponseFunction func
Response type.
Definition: dnp3.hpp:3499
Iin iin
IIN bytes.
Definition: dnp3.hpp:3501
ControlField control_field
Application control field.
Definition: dnp3.hpp:3497
Restart delay used by OutstationApplication::cold_restart() and OutstationApplication::warm_restart()
Definition: dnp3.hpp:7075
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:7121
static RestartDelay seconds(uint16_t value)
RestartDelay with a count of seconds.
RestartDelayType restart_type
Indicates what RestartDelay::value is.
Definition: dnp3.hpp:7119
Retry strategy configuration.
Definition: dnp3.hpp:2685
RetryStrategy()
Initialize to defaults.
std::chrono::steady_clock::duration max_delay
Maximum delay between two retries.
Definition: dnp3.hpp:2710
std::chrono::steady_clock::duration min_delay
Minimum delay between two retries.
Definition: dnp3.hpp:2708
Runtime configuration.
Definition: dnp3.hpp:332
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:355
RuntimeConfig()
Initialize the configuration to default values.
Serial port settings.
Definition: dnp3.hpp:2776
StopBits stop_bits
Number of bits to use to signal the end of a character.
Definition: dnp3.hpp:2813
FlowControl flow_control
Type of signalling to use for controlling data transfer.
Definition: dnp3.hpp:2809
Parity parity
Type of parity to use for error checking.
Definition: dnp3.hpp:2811
SerialSettings()
Initialize to default values.
uint32_t baud_rate
Baud rate (in symbols-per-second)
Definition: dnp3.hpp:2805
DataBits data_bits
Number of bits used to represent a character sent on the line.
Definition: dnp3.hpp:2807
Timestamp associated with particular measurement from the outstation. The validity of the value depen...
Definition: dnp3.hpp:612
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:660
static Timestamp unsynchronized_timestamp(uint64_t value)
Creates an unsynchronized timestamp struct.
uint64_t value
Count of milliseconds since UNIX epoch.
Definition: dnp3.hpp:658
TLS client configuration.
Definition: dnp3.hpp:1767
MinTlsVersion min_tls_version
Minimum TLS version allowed.
Definition: dnp3.hpp:1819
CertificateMode certificate_mode
Certificate validation mode.
Definition: dnp3.hpp:1821
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:1823
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:1807
std::string local_cert_path
Path to the PEM-encoded local certificate.
Definition: dnp3.hpp:1809
std::string private_key_path
Path to the the PEM-encoded private key.
Definition: dnp3.hpp:1811
std::string password
Optional password if the private key file is encrypted.
Definition: dnp3.hpp:1817
std::string dns_name
Subject name which is verified in the presented server certificate, from the SAN extension or in the ...
Definition: dnp3.hpp:1805
TLS server configuration.
Definition: dnp3.hpp:8109
std::string dns_name
Subject name which is verified in the presented client certificate, from the SAN extension or in the ...
Definition: dnp3.hpp:8147
CertificateMode certificate_mode
Certificate validation mode.
Definition: dnp3.hpp:8163
std::string local_cert_path
Path to the PEM-encoded local certificate.
Definition: dnp3.hpp:8151
MinTlsVersion min_tls_version
Minimum TLS version allowed.
Definition: dnp3.hpp:8161
std::string password
Optional password if the private key file is encrypted.
Definition: dnp3.hpp:8159
std::string peer_cert_path
Path to the PEM-encoded certificate of the peer.
Definition: dnp3.hpp:8149
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:8165
std::string private_key_path
Path to the PEM-encoded private key.
Definition: dnp3.hpp:8153
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:7234
uint32_t num_counter
Number of counter events remaining in the buffer.
Definition: dnp3.hpp:7260
uint32_t num_frozen_counter
Number of frozen counter events remaining in the buffer.
Definition: dnp3.hpp:7262
uint32_t num_double_bit_binary_input
Number of double-bit binary input events remaining in the buffer.
Definition: dnp3.hpp:7256
uint32_t num_binary_output_status
Number of binary output status events remaining in the buffer.
Definition: dnp3.hpp:7258
uint32_t num_binary_input
Number of binary input events remaining in the buffer.
Definition: dnp3.hpp:7254
uint32_t num_analog_output_status
Number of analog output status events remaining in the buffer.
Definition: dnp3.hpp:7266
uint32_t num_analog
Number of analog events remaining in the buffer.
Definition: dnp3.hpp:7264
uint32_t num_octet_string
Number octet string events remaining in the buffer.
Definition: dnp3.hpp:7268
Unsigned byte corresponding to group 102 variation 1.
Definition: dnp3.hpp:1437
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:1452
uint16_t index
Index of the object.
Definition: dnp3.hpp:1450
Defines what occurred during an update operation. Only certain id fields are valid depending on the v...
Definition: dnp3.hpp:5760
UpdateResult result
Defines what happened and which id fields are valid.
Definition: dnp3.hpp:5775
uint64_t discarded
The id of the discarded event if the result is UpdateResult::overflow
Definition: dnp3.hpp:5779
uint64_t created
The id of the created event if the result is UpdateResult::created or UpdateResult::overflow
Definition: dnp3.hpp:5777
Options that control how the update is performed.
Definition: dnp3.hpp:5804
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:5840
bool update_static
Optionally bypass updating the static database (the current value)
Definition: dnp3.hpp:5838
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:4214
static UtcTimestamp invalid()
Construct an invalid UtcTimestamp.
uint64_t value
Count of milliseconds since UNIX epoch.
Definition: dnp3.hpp:4250
static UtcTimestamp valid(uint64_t value)
Construct a valid UtcTimestamp.
bool is_valid
True if the timestamp is valid, false otherwise.
Definition: dnp3.hpp:4252