1+ #pragma once
2+
3+ #include < cstdint>
4+ #include < map>
5+ #include < string>
6+
7+ namespace dlms ::test_data {
8+
9+ // Changes from Original File : ega_2025_komunikacni_rozhrani_rs485.pdf
10+
11+ // Changed this:
12+ // 0x02, 0x02, 0x16, 0x01, 0x01, 0x16, // structure(2) = {enum = 1, array = 22}
13+ //
14+ // To this (suspect OCR mistake) :
15+ // 0x02, 0x02, 0x16, 0x01, 0x01, 0x1B, // structure(2) = {enum = 1, array = 27}
16+
17+ // Changed this:
18+ // 0x02, 0x02, 0x00, 0x01, 0x00, 0x00, 0x2A, 0x00, 0x00, 0xFF, 0x02, 0x09, 0x10, 0x45, 0x47, 0x44, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, // structure(2) = {(0,1,0,0,42,0,0,255,2), octet-string(16) = "EGD012345"}
19+ //
20+ // To this (suspect error in the original document):
21+ // 0x02, 0x02, 0x00, 0x01, 0x00, 0x00, 0x2A, 0x00, 0x00, 0xFF, 0x02, 0x09, 0x09, 0x45, 0x47, 0x44, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, // structure(2) = {(0,1,0,0,42,0,0,255,2), octet-string(9) = "EGD012345"}
22+
23+ const uint8_t egd_example_raw_frame[] = {
24+ 0x0F , // data-notification --------------------------------------------------------------------------------------------------------------------
25+ 0x00 , 0x00 , 0x00 , 0x01 , // long-invoke-id-and-priority = 0x00000001
26+ 0x00 , // date-time = null
27+ 0x02 , 0x02 , 0x16 , 0x01 , 0x01 , 0x1B , // structure(2) = {enum = 1, array = 27}
28+ 0x02 , 0x02 , 0x00 , 0x01 , 0x00 , 0x00 , 0x2A , 0x00 , 0x00 , 0xFF , 0x02 , 0x09 , 0x09 , 0x45 , 0x47 , 0x44 , 0x30 , 0x31 , 0x32 , 0x33 , 0x34 , 0x35 , // structure(2) = {(0,1,0,0,42,0,0,255,2), octet-string(9) = "EGD012345"}
29+ 0x02 , 0x02 , 0x00 , 0x28 , 0x00 , 0x02 , 0x19 , 0x09 , 0x00 , 0xFF , 0x01 , 0x09 , 0x06 , 0x00 , 0x02 , 0x19 , 0x09 , 0x00 , 0xFF , // structure(2) = {(0,40,0,2,25,9,0,255,1), octet-string(6) = (0,2,25,9,0,255)}
30+ 0x02 , 0x02 , 0x00 , 0x01 , 0x00 , 0x00 , 0x60 , 0x01 , 0x00 , 0xFF , 0x02 , 0x09 , 0x0A , 0x30 , 0x31 , 0x32 , 0x33 , 0x34 , 0x35 , 0x36 , 0x37 , 0x38 , 0x39 , // structure(2) = {(0,1,0,0,96,1,0,255,2), octet-string(10) = "0123456789"}
31+ 0x02 , 0x02 , 0x00 , 0x46 , 0x00 , 0x00 , 0x60 , 0x03 , 0x0A , 0xFF , 0x03 , 0x16 , 0x01 , // structure(2) = {(0,70,0,0,96,3,10,255,3), enum = 1}
32+ 0x02 , 0x02 , 0x00 , 0x47 , 0x00 , 0x00 , 0x11 , 0x00 , 0x00 , 0xFF , 0x03 , 0x06 , 0x00 , 0x00 , 0x00 , 0x00 , // structure(2) = {(0,71,0,0,17,0,0,255,3), double-long-unsigned = 0}
33+ 0x02 , 0x02 , 0x00 , 0x46 , 0x00 , 0x01 , 0x60 , 0x03 , 0x0A , 0xFF , 0x03 , 0x16 , 0x01 , // structure(2) = {(0,70,0,1,96,3,10,255,3), enum = 1}
34+ 0x02 , 0x02 , 0x00 , 0x46 , 0x00 , 0x02 , 0x60 , 0x03 , 0x0A , 0xFF , 0x03 , 0x16 , 0x01 , // structure(2) = {(0,70,0,2,96,3,10,255,3), enum = 1}
35+ 0x02 , 0x02 , 0x00 , 0x46 , 0x00 , 0x03 , 0x60 , 0x03 , 0x0A , 0xFF , 0x03 , 0x16 , 0x00 , // structure(2) = {(0,70,0,3,96,3,10,255,3), enum = 0}
36+ 0x02 , 0x02 , 0x00 , 0x46 , 0x00 , 0x04 , 0x60 , 0x03 , 0x0A , 0xFF , 0x03 , 0x16 , 0x00 , // structure(2) = {(0,70,0,4,96,3,10,255,3), enum = 0}
37+ 0x02 , 0x02 , 0x00 , 0x46 , 0x00 , 0x05 , 0x60 , 0x03 , 0x0A , 0xFF , 0x03 , 0x16 , 0x00 , // structure(2) = {(0,70,0,5,96,3,10,255,3), enum = 0}
38+ 0x02 , 0x02 , 0x00 , 0x46 , 0x00 , 0x06 , 0x60 , 0x03 , 0x0A , 0xFF , 0x03 , 0x16 , 0x00 , // structure(2) = {(0,70,0,6,96,3,10,255,3), enum = 0}
39+ 0x02 , 0x02 , 0x00 , 0x01 , 0x00 , 0x00 , 0x60 , 0x0E , 0x00 , 0xFF , 0x02 , 0x09 , 0x02 , 0x54 , 0x33 , // structure(2) = {(0,1,0,0,96,14,0,255,2), octet-string = "T3"}
40+ 0x02 , 0x02 , 0x00 , 0x03 , 0x01 , 0x00 , 0x01 , 0x07 , 0x00 , 0xFF , 0x02 , 0x06 , 0x00 , 0x00 , 0x00 , 0x03 , // structure(2) = {(0,3,1,0,1,7,0,255,2), double-long-unsigned = 3}
41+ 0x02 , 0x02 , 0x00 , 0x03 , 0x01 , 0x00 , 0x15 , 0x07 , 0x00 , 0xFF , 0x02 , 0x06 , 0x00 , 0x00 , 0x00 , 0x01 , // structure(2) = {(0,3,1,0,21,7,0,255,2), double-long-unsigned = 1}
42+ 0x02 , 0x02 , 0x00 , 0x03 , 0x01 , 0x00 , 0x29 , 0x07 , 0x00 , 0xFF , 0x02 , 0x06 , 0x00 , 0x00 , 0x00 , 0x01 , // structure(2) = {(0,3,1,0,41,7,0,255,2), double-long-unsigned = 1}
43+ 0x02 , 0x02 , 0x00 , 0x03 , 0x01 , 0x00 , 0x3D , 0x07 , 0x00 , 0xFF , 0x02 , 0x06 , 0x00 , 0x00 , 0x00 , 0x01 , // structure(2) = {(0,3,1,0,61,7,0,255,2), double-long-unsigned = 1}
44+ 0x02 , 0x02 , 0x00 , 0x03 , 0x01 , 0x00 , 0x02 , 0x07 , 0x00 , 0xFF , 0x02 , 0x06 , 0x00 , 0x00 , 0x00 , 0x03 , // structure(2) = {(0,3,1,0,2,7,0,255,2), double-long-unsigned = 3}
45+ 0x02 , 0x02 , 0x00 , 0x03 , 0x01 , 0x00 , 0x16 , 0x07 , 0x00 , 0xFF , 0x02 , 0x06 , 0x00 , 0x00 , 0x00 , 0x01 , // structure(2) = {(0,3,1,0,22,7,0,255,2), double-long-unsigned = 1}
46+ 0x02 , 0x02 , 0x00 , 0x03 , 0x01 , 0x00 , 0x2A , 0x07 , 0x00 , 0xFF , 0x02 , 0x06 , 0x00 , 0x00 , 0x00 , 0x01 , // structure(2) = {(0,3,1,0,42,7,0,255,2), double-long-unsigned = 1}
47+ 0x02 , 0x02 , 0x00 , 0x03 , 0x01 , 0x00 , 0x3E , 0x07 , 0x00 , 0xFF , 0x02 , 0x06 , 0x00 , 0x00 , 0x00 , 0x01 , // structure(2) = {(0,3,1,0,62,7,0,255,2), double-long-unsigned = 1}
48+ 0x02 , 0x02 , 0x00 , 0x03 , 0x01 , 0x00 , 0x01 , 0x08 , 0x00 , 0xFF , 0x02 , 0x06 , 0x00 , 0x00 , 0x00 , 0x08 , // structure(2) = {(0,3,1,0,1,8,0,255,2), double-long-unsigned = 8}
49+ 0x02 , 0x02 , 0x00 , 0x03 , 0x01 , 0x00 , 0x01 , 0x08 , 0x01 , 0xFF , 0x02 , 0x06 , 0x00 , 0x00 , 0x00 , 0x00 , // structure(2) = {(0,3,1,0,1,8,1,255,2), double-long-unsigned = 0}
50+ 0x02 , 0x02 , 0x00 , 0x03 , 0x01 , 0x00 , 0x01 , 0x08 , 0x02 , 0xFF , 0x02 , 0x06 , 0x00 , 0x00 , 0x00 , 0x04 , // structure(2) = {(0,3,1,0,1,8,2,255,2), double-long-unsigned = 4}
51+ 0x02 , 0x02 , 0x00 , 0x03 , 0x01 , 0x00 , 0x01 , 0x08 , 0x03 , 0xFF , 0x02 , 0x06 , 0x00 , 0x00 , 0x00 , 0x04 , // structure(2) = {(0,3,1,0,1,8,3,255,2), double-long-unsigned = 4}
52+ 0x02 , 0x02 , 0x00 , 0x03 , 0x01 , 0x00 , 0x01 , 0x08 , 0x04 , 0xFF , 0x02 , 0x06 , 0x00 , 0x00 , 0x00 , 0x00 , // structure(2) = {(0,3,1,0,1,8,4,255,2), double-long-unsigned = 0}
53+ 0x02 , 0x02 , 0x00 , 0x03 , 0x01 , 0x00 , 0x02 , 0x08 , 0x00 , 0xFF , 0x02 , 0x06 , 0x00 , 0x00 , 0x00 , 0x04 , // structure(2) = {(0,3,1,0,2,8,0,255,2), double-long-unsigned = 4}
54+ 0x02 , 0x02 , 0x00 , 0x01 , 0x00 , 0x00 , 0x60 , 0x0D , 0x00 , 0xFF , 0x02 , 0x09 , 0x00 // structure(2) = {(0,1,0,0,96,13,0,255,2), octet-string = null}
55+ };
56+
57+ constexpr size_t egd_example_expected_count = 27 ;
58+
59+ const std::map<std::string, std::string> egd_example_expected_strings = {
60+ {" 0.0.96.14.0.255" , " T3" },
61+ {" 0.0.42.0.0.255" , " EGD012345" },
62+ {" 0.2.25.9.0.255" , " " }, // (0,2,25,9,0,255)
63+ {" 0.0.96.1.0.255" , " 0123456789" },
64+ {" 0.0.96.13.0.255" , " " }
65+ };
66+
67+ const std::map<std::string, float > egd_example_expected_floats = {
68+ {" 0.0.96.3.10.255" , 1 .0f },
69+ {" 0.0.17.0.0.255" , 0 .0f },
70+ {" 0.1.96.3.10.255" , 1 .0f },
71+ {" 0.2.96.3.10.255" , 1 .0f },
72+ {" 0.3.96.3.10.255" , 0 .0f },
73+ {" 0.4.96.3.10.255" , 0 .0f },
74+ {" 0.5.96.3.10.255" , 0 .0f },
75+ {" 0.6.96.3.10.255" , 0 .0f },
76+ {" 1.0.1.7.0.255" , 3 .0f },
77+ {" 1.0.21.7.0.255" , 1 .0f },
78+ {" 1.0.41.7.0.255" , 1 .0f },
79+ {" 1.0.61.7.0.255" , 1 .0f },
80+ {" 1.0.2.7.0.255" , 3 .0f },
81+ {" 1.0.22.7.0.255" , 1 .0f },
82+ {" 1.0.42.7.0.255" , 1 .0f },
83+ {" 1.0.62.7.0.255" , 1 .0f },
84+ {" 1.0.1.8.0.255" , 8 .0f },
85+ {" 1.0.1.8.1.255" , 0 .0f },
86+ {" 1.0.1.8.2.255" , 4 .0f },
87+ {" 1.0.1.8.3.255" , 4 .0f },
88+ {" 1.0.1.8.4.255" , 0 .0f },
89+ {" 1.0.2.8.0.255" , 4 .0f }
90+ };
91+
92+ } // namespace dlms::test_data
0 commit comments