Skip to content

Commit 62ecfde

Browse files
committed
Add the test files from libmbus and test them
Now that I can parse my personal test files, I decided to grab libmbus's ones for more standardised testing. Tragically I can only parse a small fraction of them, but it's nice to have a todo list I suppose!
1 parent 7a78584 commit 62ecfde

File tree

269 files changed

+17916
-22
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

269 files changed

+17916
-22
lines changed

Cargo.lock

+211
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,4 @@ chrono = "0.4.23"
1515
encoding_rs = "0.8.32"
1616
winnow = "0.6.5"
1717
libmbus_macros = { path = "./libmbus_macros" }
18+
rstest = "0.19.0"

libmbus_test_data/NOTICE

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
The files in this directory are from the rSCADA/libmbus project by Raditex
2+
Control AB which is released under the BSD 3-Clause License
3+
Copyright (c) 2010-2012, Raditex Control AB
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
68 04 04 68 08 01 70 08 81 16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="ISO-8859-1"?>
2+
<MBusData>
3+
4+
<SlaveInformation>
5+
<Error>Application busy</Error>
6+
</SlaveInformation>
7+
8+
</MBusData>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
68 04 04 68 08 01 70 02 7B 16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="ISO-8859-1"?>
2+
<MBusData>
3+
4+
<SlaveInformation>
5+
<Error>Buffer too long, truncated</Error>
6+
</SlaveInformation>
7+
8+
</MBusData>
+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
68 03 03 68 08 01 70 79 16
+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="ISO-8859-1"?>
2+
<MBusData>
3+
4+
<SlaveInformation>
5+
<Error>Unspecified error</Error>
6+
</SlaveInformation>
7+
8+
</MBusData>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
68 1C 1C 68 08 02 72 78 56 34 12 24 40 01 07 55 00 00 00 03 13 15 31 00 DA 02 3B 13 01 8B 60 04 C7 16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
68 1E 1E 68 08 02 72 78 56 34 12 24 40 01 07 55 00 00 00 03 13 15 31 00 DA 02 3B 13 01 8B 60 04 37 18 16 16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
68 1A 1A 68 08 02 72 78 56 34 12 24 40 01 07 55 00 00 00 03 13 15 31 00 DA 02 3B 13 01 8B 63 16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
68 1B 1B 68 08 02 72 78 56 34 12 24 40 01 07 55 00 00 00 03 13 15 31 00 DA 02 3B 13 01 8B 8B EE 16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
68 04 04 68 08 01 70 04 7D 16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="ISO-8859-1"?>
2+
<MBusData>
3+
4+
<SlaveInformation>
5+
<Error>Premature end of record</Error>
6+
</SlaveInformation>
7+
8+
</MBusData>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
68 2E 2E 68 08 05 72 34 08 00 54 96 15 32 00 F2 00 00 00 01 FD 1B 00 02 FC 03 48 52 25 74 D4 11 22 FC 03 48 52 25 74 C8 11 12 FC 13 48 52 25 74 B4 16 5B 16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
68 1B 1B 68 08 02 72 78 56 34 12 24 40 01 07 55 00 00 00 03 13 15 31 00 DA 02 3B 13 01 8B 60 C3 16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
68 2E 2E 68 08 05 72 34 08 00 54 96 15 32 00 F2 00 00 00 01 FD 1B 00 02 FC 03 48 52 25 74 D4 11 22 FC 03 48 52 25 74 C8 11 12 FC F3 48 52 25 74 B4 16 3B 16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
68 29 29 68 08 02 72 78 56 34 12 24 40 01 07 55 00 00 00 03 13 15 31 00 DA 02 3B 13 01 8B 8B 8B 8B 8B 8B 8B 8B 8B 8B 8B 60 04 37 18 02 86 16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
68 04 04 68 08 01 70 05 7E 16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="ISO-8859-1"?>
2+
<MBusData>
3+
4+
<SlaveInformation>
5+
<Error>More than 10 DIFE´s</Error>
6+
</SlaveInformation>
7+
8+
</MBusData>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
68 04 04 68 08 01 70 09 82 16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="ISO-8859-1"?>
2+
<MBusData>
3+
4+
<SlaveInformation>
5+
<Error>Too many readouts</Error>
6+
</SlaveInformation>
7+
8+
</MBusData>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
68 04 04 68 08 01 70 03 7C 16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="ISO-8859-1"?>
2+
<MBusData>
3+
4+
<SlaveInformation>
5+
<Error>Too many records</Error>
6+
</SlaveInformation>
7+
8+
</MBusData>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
68 2A 2A 68 08 02 72 78 56 34 12 24 40 01 07 55 00 00 00 03 13 15 31 00 DA 02 3B 13 01 8B 60 84 84 84 84 84 84 84 84 84 84 84 04 37 18 02 C4 16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
68 04 04 68 08 01 70 06 7F 16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="ISO-8859-1"?>
2+
<MBusData>
3+
4+
<SlaveInformation>
5+
<Error>More than 10 VIFE´s</Error>
6+
</SlaveInformation>
7+
8+
</MBusData>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
68 08 08 68 08 02 72 78 56 34 12 24 B4 16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
68 04 04 68 08 01 70 01 7A 16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="ISO-8859-1"?>
2+
<MBusData>
3+
4+
<SlaveInformation>
5+
<Error>Unimplemented CI-Field</Error>
6+
</SlaveInformation>
7+
8+
</MBusData>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
68 04 04 68 08 01 70 00 79 16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="ISO-8859-1"?>
2+
<MBusData>
3+
4+
<SlaveInformation>
5+
<Error>Unspecified error</Error>
6+
</SlaveInformation>
7+
8+
</MBusData>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
68 3C 3C 68 08 08 72 78 03 49 11 77 04 0E 16 0A 00 00 00 0C 78 78 03 49 11 04 13 31 D4 00 00 42 6C 00 00 44 13 00 00 00 00 04 6D 0B 0B CD 13 02 27 00 00 09 FD 0E 02 09 FD 0F 06 0F 00 01 75 13 D3 16

0 commit comments

Comments
 (0)