├── .github └── workflows │ └── quickstart.yml ├── .gitignore ├── .static ├── logo.svg ├── logo_embedded_font.png └── logo_embedded_font.svg ├── CHANGELOG.md ├── Cargo.toml ├── LICENSE-APACHE ├── LICENSE-MIT ├── README.md ├── docs.sh ├── examples ├── decoder.rs ├── decoder_streaming.rs ├── embedded │ ├── esp32c3-power-meter-mock │ │ ├── .cargo │ │ │ └── config.toml │ │ ├── .gitignore │ │ ├── .vscode │ │ │ └── settings.json │ │ ├── Cargo.lock │ │ ├── Cargo.toml │ │ ├── README.md │ │ ├── build.rs │ │ ├── rust-toolchain.toml │ │ └── src │ │ │ └── main.rs │ ├── esp32c3-sml-reader-async │ │ ├── .cargo │ │ │ └── config.toml │ │ ├── .gitignore │ │ ├── .vscode │ │ │ └── settings.json │ │ ├── Cargo.lock │ │ ├── Cargo.toml │ │ ├── README.md │ │ ├── build.rs │ │ ├── rust-toolchain.toml │ │ └── src │ │ │ └── main.rs │ └── esp32c3-sml-reader │ │ ├── .cargo │ │ └── config.toml │ │ ├── .gitignore │ │ ├── .vscode │ │ └── settings.json │ │ ├── Cargo.lock │ │ ├── Cargo.toml │ │ ├── README.md │ │ ├── build.rs │ │ ├── rust-toolchain.toml │ │ └── src │ │ └── main.rs └── serialport │ ├── Cargo.toml │ └── serialport.rs ├── sample.bin ├── src ├── lib.rs ├── parser │ ├── common.rs │ ├── complete.rs │ ├── mod.rs │ ├── num.rs │ ├── octet_string.rs │ ├── streaming.rs │ └── tlf.rs ├── transport │ ├── decode.rs │ ├── decoder_reader.rs │ ├── encode.rs │ └── mod.rs └── util.rs └── tests ├── README.md ├── libsml-testing.rs ├── libsml-testing ├── .github │ ├── check.py │ └── workflows │ │ └── ci.yaml ├── DZG_DVS-7412.2_jmberg.bin ├── DZG_DVS-7412.2_jmberg.hex ├── DZG_DVS-7420.2V.G2_mtr0.bin ├── DZG_DVS-7420.2V.G2_mtr0.hex ├── DZG_DVS-7420.2V.G2_mtr1.bin ├── DZG_DVS-7420.2V.G2_mtr1.hex ├── DZG_DVS-7420.2V.G2_mtr1_error.bin ├── DZG_DVS-7420.2V.G2_mtr1_error.hex ├── DZG_DVS-7420.2V.G2_mtr2.bin ├── DZG_DVS-7420.2V.G2_mtr2.hex ├── DZG_DVS-7420.2V.G2_mtr2_neg.bin ├── DZG_DVS-7420.2V.G2_mtr2_neg.hex ├── DrNeuhaus_SMARTY_ix-130.bin ├── DrNeuhaus_SMARTY_ix-130.hex ├── EMH-ED300L_consumption.bin ├── EMH-ED300L_consumption.hex ├── EMH-ED300L_delivery.bin ├── EMH-ED300L_delivery.hex ├── EMH_eHZ-GW8E2A500AK2.bin ├── EMH_eHZ-GW8E2A500AK2.hex ├── EMH_eHZ-HW8E2A5L0EK2P.bin ├── EMH_eHZ-HW8E2A5L0EK2P.hex ├── EMH_eHZ-HW8E2A5L0EK2P_1.bin ├── EMH_eHZ-HW8E2A5L0EK2P_1.hex ├── EMH_eHZ-HW8E2A5L0EK2P_2.bin ├── EMH_eHZ-HW8E2A5L0EK2P_2.hex ├── EMH_eHZ-HW8E2AWL0EK2P.bin ├── EMH_eHZ-HW8E2AWL0EK2P.hex ├── EMH_eHZ-IW8E2A5L0EK2P_with_error.bin ├── EMH_eHZ-IW8E2A5L0EK2P_with_error.hex ├── EMH_eHZ-IW8E2AWL0EK2P.bin ├── EMH_eHZ-IW8E2AWL0EK2P.hex ├── EMH_eHZ361L5R.bin ├── EMH_eHZ361L5R.hex ├── EMH_eHZ361L5R_1.bin ├── EMH_eHZ361L5R_1.hex ├── EMH_mME40-AE6AKF0K0.bin ├── EMH_mME40-AE6AKF0K0.hex ├── EasyMeter_Q3A_A1064V1009.bin ├── EasyMeter_Q3A_A1064V1009.hex ├── FILES ├── HOLLEY_DTZ541-BDBA_with_PIN.bin ├── HOLLEY_DTZ541-BDBA_with_PIN.hex ├── HOLLEY_DTZ541-BDBA_without_PIN.bin ├── HOLLEY_DTZ541-BDBA_without_PIN.hex ├── HOLLEY_DTZ541-ZDBA.bin ├── HOLLEY_DTZ541-ZDBA.hex ├── ISKRA_MT175_D1A52-V22-K0t.bin ├── ISKRA_MT175_D1A52-V22-K0t.hex ├── ISKRA_MT175_eHZ.bin ├── ISKRA_MT175_eHZ.hex ├── ISKRA_MT631-D1A52-K0z-H01_with_PIN.bin ├── ISKRA_MT631-D1A52-K0z-H01_with_PIN.hex ├── ISKRA_MT631-D1A52-K0z-H01_without_PIN.bin ├── ISKRA_MT631-D1A52-K0z-H01_without_PIN.hex ├── ISKRA_MT631-D2A51-V22-K0z_with_PIN.bin ├── ISKRA_MT631-D2A51-V22-K0z_with_PIN.hex ├── ISKRA_MT631-D2A51-V22-K0z_without_PIN.bin ├── ISKRA_MT631-D2A51-V22-K0z_without_PIN.hex ├── ISKRA_MT691_eHZ-MS2020.bin ├── ISKRA_MT691_eHZ-MS2020.hex ├── ITRON_OpenWay-3.HZ.bin ├── ITRON_OpenWay-3.HZ.hex ├── ITRON_OpenWay-3.HZ_with_PIN.bin ├── ITRON_OpenWay-3.HZ_with_PIN.hex ├── ITRON_OpenWay-3.HZ_without_PIN.bin ├── ITRON_OpenWay-3.HZ_without_PIN.hex ├── README.md ├── dzg_dwsb20_2th_2byte.bin ├── dzg_dwsb20_2th_2byte.hex ├── dzg_dwsb20_2th_3byte.bin ├── dzg_dwsb20_2th_3byte.hex ├── eBZ_DD3_DD32R06DTA-SMZ1.bin ├── eBZ_DD3_DD32R06DTA-SMZ1.hex ├── eBZ_DD3_DD3BZ06DTA-SMZ1_without_PIN.bin └── eBZ_DD3_DD3BZ06DTA-SMZ1_without_PIN.hex └── snapshots ├── libsml_testing__files@DZG_DVS-7412.2_jmberg.bin.snap ├── libsml_testing__files@DZG_DVS-7420.2V.G2_mtr0.bin.snap ├── libsml_testing__files@DZG_DVS-7420.2V.G2_mtr1.bin.snap ├── libsml_testing__files@DZG_DVS-7420.2V.G2_mtr1_error.bin.snap ├── libsml_testing__files@DZG_DVS-7420.2V.G2_mtr2.bin.snap ├── libsml_testing__files@DZG_DVS-7420.2V.G2_mtr2_neg.bin.snap ├── libsml_testing__files@DrNeuhaus_SMARTY_ix-130.bin.snap ├── libsml_testing__files@EMH-ED300L_consumption.bin.snap ├── libsml_testing__files@EMH-ED300L_delivery.bin.snap ├── libsml_testing__files@EMH_eHZ-GW8E2A500AK2.bin.snap ├── libsml_testing__files@EMH_eHZ-HW8E2A5L0EK2P.bin.snap ├── libsml_testing__files@EMH_eHZ-HW8E2A5L0EK2P_1.bin.snap ├── libsml_testing__files@EMH_eHZ-HW8E2A5L0EK2P_2.bin.snap ├── libsml_testing__files@EMH_eHZ-HW8E2AWL0EK2P.bin.snap ├── libsml_testing__files@EMH_eHZ-IW8E2A5L0EK2P_with_error.bin.snap ├── libsml_testing__files@EMH_eHZ-IW8E2AWL0EK2P.bin.snap ├── libsml_testing__files@EMH_eHZ361L5R.bin.snap ├── libsml_testing__files@EMH_eHZ361L5R_1.bin.snap ├── libsml_testing__files@EMH_mME40-AE6AKF0K0.bin.snap ├── libsml_testing__files@EasyMeter_Q3A_A1064V1009.bin.snap ├── libsml_testing__files@HOLLEY_DTZ541-BDBA_with_PIN.bin.snap ├── libsml_testing__files@HOLLEY_DTZ541-BDBA_without_PIN.bin.snap ├── libsml_testing__files@HOLLEY_DTZ541-ZDBA.bin.snap ├── libsml_testing__files@ISKRA_MT175_D1A52-V22-K0t.bin.snap ├── libsml_testing__files@ISKRA_MT175_eHZ.bin.snap ├── libsml_testing__files@ISKRA_MT631-D1A52-K0z-H01_with_PIN.bin.snap ├── libsml_testing__files@ISKRA_MT631-D1A52-K0z-H01_without_PIN.bin.snap ├── libsml_testing__files@ISKRA_MT631-D2A51-V22-K0z_with_PIN.bin.snap ├── libsml_testing__files@ISKRA_MT631-D2A51-V22-K0z_without_PIN.bin.snap ├── libsml_testing__files@ISKRA_MT691_eHZ-MS2020.bin.snap ├── libsml_testing__files@ITRON_OpenWay-3.HZ.bin.snap ├── libsml_testing__files@ITRON_OpenWay-3.HZ_with_PIN.bin.snap ├── libsml_testing__files@ITRON_OpenWay-3.HZ_without_PIN.bin.snap ├── libsml_testing__files@dzg_dwsb20_2th_2byte.bin.snap ├── libsml_testing__files@dzg_dwsb20_2th_3byte.bin.snap ├── libsml_testing__files@eBZ_DD3_DD32R06DTA-SMZ1.bin.snap └── libsml_testing__files@eBZ_DD3_DD3BZ06DTA-SMZ1_without_PIN.bin.snap /.github/workflows/quickstart.yml: -------------------------------------------------------------------------------- 1 | on: 2 | push: 3 | branches: 4 | - main 5 | pull_request: 6 | 7 | name: CI 8 | 9 | jobs: 10 | check: 11 | name: Check 12 | runs-on: ubuntu-latest 13 | steps: 14 | - uses: actions/checkout@v4 15 | - uses: dtolnay/rust-toolchain@stable 16 | - run: cargo check 17 | 18 | test: 19 | name: Test Suite 20 | runs-on: ubuntu-latest 21 | continue-on-error: true 22 | steps: 23 | - uses: actions/checkout@v4 24 | - uses: dtolnay/rust-toolchain@stable 25 | - run: cargo test 26 | - run: cargo test --no-default-features 27 | - run: cargo test --no-default-features --features=alloc 28 | - run: cargo test --no-default-features --features=embedded-hal-02 29 | - run: cargo test --no-default-features --features=embedded-hal-02,alloc 30 | - run: cargo test --no-default-features --features=embedded-hal-02,alloc,std 31 | - run: cargo test --no-default-features --features=embedded-hal-02,alloc,std,serde 32 | 33 | build_examples: 34 | name: Build Examples 35 | runs-on: ubuntu-latest 36 | steps: 37 | - run: sudo apt install libudev-dev 38 | - uses: actions/checkout@v4 39 | - uses: dtolnay/rust-toolchain@stable 40 | - run: cargo build -p sml-rs-serialport-example 41 | 42 | build_esp_examples: 43 | name: ESP Examples 44 | runs-on: ubuntu-latest 45 | strategy: 46 | fail-fast: false 47 | matrix: 48 | project: 49 | - esp32c3-power-meter-mock 50 | - esp32c3-sml-reader 51 | - esp32c3-sml-reader-async 52 | action: 53 | - command: build 54 | args: --release 55 | - command: build 56 | args: --release --all-features 57 | - command: fmt 58 | args: --all -- --check --color always 59 | - command: clippy 60 | args: --all-features --workspace -- -D warnings 61 | steps: 62 | - uses: actions/checkout@v4 63 | - uses: dtolnay/rust-toolchain@v1 64 | with: 65 | target: riscv32imc-unknown-none-elf 66 | toolchain: nightly 67 | components: rust-src, rustfmt, clippy 68 | - name: Build 69 | working-directory: examples/embedded/${{ matrix.project }} 70 | run: cargo ${{ matrix.action.command }} ${{ matrix.action.args }} 71 | 72 | lints: 73 | name: Lints 74 | runs-on: ubuntu-latest 75 | steps: 76 | - uses: actions/checkout@v4 77 | - uses: dtolnay/rust-toolchain@stable 78 | with: 79 | components: rustfmt, clippy 80 | - run: cargo fmt --all -- --check 81 | - run: cargo clippy -- -D warnings 82 | 83 | semver_checks: 84 | name: Semver Checks 85 | runs-on: ubuntu-latest 86 | steps: 87 | - uses: actions/checkout@v4 88 | - uses: obi1kenobi/cargo-semver-checks-action@v2 89 | 90 | check_subtrees_up_to_date: 91 | name: Check subtrees are up to date 92 | runs-on: ubuntu-latest 93 | steps: 94 | - uses: actions/checkout@v4 95 | with: 96 | fetch-depth: 0 97 | - name: check libsml-testing subtree 98 | run: | 99 | git subtree pull \ 100 | --prefix tests/libsml-testing \ 101 | https://github.com/devZer0/libsml-testing.git \ 102 | master --squash 2>&1 | tee output.txt 103 | cat output.txt | grep -q "Subtree is already at commit" 104 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | /Cargo.lock 3 | /.vscode -------------------------------------------------------------------------------- /.static/logo.svg: -------------------------------------------------------------------------------- 1 | 2 | 4 | sml-rs logo 5 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 36 | 37 | 38 | 39 | 46 | 52 | 59 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | s 74 | m 75 | l 76 | r 77 | s 78 | 79 | 80 | 81 | 82 | -------------------------------------------------------------------------------- /.static/logo_embedded_font.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/felixwrt/sml-rs/17c1a8d73c9c992bc9b4de6560de987ec47de6ae/.static/logo_embedded_font.png -------------------------------------------------------------------------------- /.static/logo_embedded_font.svg: -------------------------------------------------------------------------------- 1 | 2 | 4 | sml-rs logo 5 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 36 | 37 | 38 | 39 | 40 | 41 | 48 | 54 | 61 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | All notable changes to this project will be documented in this file. 4 | 5 | The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), 6 | and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). 7 | 8 | ## [Unreleased] 9 | 10 | ### Added 11 | 12 | - Embedded examples for the ESP32-C3 (#37) 13 | - Added `serde` feature which implements `Serialize` and `Deserialize` on most error types (#33) 14 | - **BREAKING:** The `DecodeErr::InvalidMessage` variant has a new boolean member `invalid_padding_bytes` (#43) 15 | 16 | ### Changed 17 | 18 | - Decoder improvements (#43) 19 | - **BREAKING:** Renamed `*Reader` types to `*ByteSource` (e.g. `IoReader` to `IoByteSource`) (#45) 20 | - Refactored `ByteSourceErr` trait (#46) 21 | - **BREAKING:** Renamed feature `embedded_hal` to `embedded-hal-02` (#47) 22 | 23 | 24 | ## [0.4.0] - 2024-06-04 25 | 26 | ### Added 27 | 28 | - `SmlReader` type that provides an API for reading, decoding and parsing SML messages from several input sources. 29 | - CI: Checks for SemVer violations 30 | - Implement `std::error::Error` for all error types 31 | 32 | ### Changed 33 | 34 | - CI script cleanup 35 | - Changed `tests/libsml-testing` from submodule to subtree 36 | - Updated maintenance badge for 2024 37 | - Updated hex-literal to 0.4.1 38 | 39 | ## 0.3.0 - 2023-03-24 40 | 41 | 42 | [Unreleased]: https://github.com/felixwrt/sml-rs/compare/v0.4.0...HEAD 43 | [0.4.0]: https://github.com/felixwrt/sml-rs/compare/v0.3.0...v0.4.0 -------------------------------------------------------------------------------- /Cargo.toml: -------------------------------------------------------------------------------- 1 | [workspace] 2 | members = [".", "examples/serialport"] 3 | 4 | [package] 5 | name = "sml-rs" 6 | version = "0.5.0-unreleased" 7 | authors = ["Felix Wirth "] 8 | description = "Smart Message Language (SML) parser written in Rust" 9 | repository = "https://github.com/felixwrt/sml-rs" 10 | license = "MIT OR Apache-2.0" 11 | edition = "2021" 12 | 13 | [features] 14 | default = ["std"] 15 | std = ["alloc"] 16 | alloc = [] 17 | embedded-hal-02 = ["nb", "dep:embedded-hal-02"] 18 | serde = ["dep:serde"] 19 | 20 | [dependencies] 21 | crc = "3" 22 | embedded-hal-02 = { version = "0.2", package = "embedded-hal", optional = true } 23 | nb = { version = "1", optional = true } 24 | serde = { version = "1", features = ["derive"], optional = true } 25 | 26 | [dev-dependencies] 27 | insta = { version = "1.21.0", features = ["yaml", "glob"] } 28 | hex-literal = "0.4.1" 29 | hex = "0.4.3" 30 | 31 | # docs.rs-specific configuration 32 | [package.metadata.docs.rs] 33 | # document all features 34 | all-features = true 35 | # defines the configuration attribute `docsrs` 36 | rustdoc-args = ["--cfg", "docsrs"] 37 | 38 | [profile.dev.package.insta] 39 | opt-level = 3 40 | 41 | [profile.dev.package.similar] 42 | opt-level = 3 43 | 44 | [[example]] 45 | name = "decoder" 46 | path = "examples/decoder.rs" 47 | required-features = ["std"] 48 | 49 | [[example]] 50 | name = "decoder-streaming" 51 | path = "examples/decoder_streaming.rs" 52 | required-features = ["std"] 53 | -------------------------------------------------------------------------------- /LICENSE-MIT: -------------------------------------------------------------------------------- 1 | Permission is hereby granted, free of charge, to any 2 | person obtaining a copy of this software and associated 3 | documentation files (the "Software"), to deal in the 4 | Software without restriction, including without 5 | limitation the rights to use, copy, modify, merge, 6 | publish, distribute, sublicense, and/or sell copies of 7 | the Software, and to permit persons to whom the Software 8 | is furnished to do so, subject to the following 9 | conditions: 10 | 11 | The above copyright notice and this permission notice 12 | shall be included in all copies or substantial portions 13 | of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF 16 | ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED 17 | TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 18 | PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT 19 | SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 20 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 21 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR 22 | IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 23 | DEALINGS IN THE SOFTWARE. 24 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |
2 | sml-rs 3 |

4 | Crate Info 5 | API Docs 6 | CI 7 | Maintenance 8 |

9 |
10 | 11 | 12 | # *sml-rs* 13 | 14 | Smart Message Language (SML) parser written in Rust. 15 | 16 | Modern German power meters periodically send SML-encoded data via an optical interface. The main use-case of this library is to decode that data. 17 | 18 | **Status:** This library is ready to be used! We're still working on it and there may be breaking changes in the future, but the basics (transport encoding/decoding, parsing) are in good shape now. See section "Implementation Status" for details on the implementation status and be sure to let us know what you think about the library! Comments, feedback, issues, feature requests welcome! 19 | 20 | ## Design goals 21 | 22 | The following list shows the goals guiding development of the library. While we haven't achieved all of them yet, the goal is to get there eventually. Feedback on the goals is greatly appreciated. 23 | 24 | - **Practicality**: The main purpose of this library is to work seamlessly when reading SML data from power meters. Practicality includes means designing APIs that are accessible, resisting the temptation of going too fancy and implementing workarounds for buggy power meters. 25 | - **Focus**: This library only implements the subset of SML that's actually used in power meters and can therefore be tested. 26 | - **Correctness**: The implementation is correct according to the SML V1.04 Spec (see below). The only exception to this are workarounds for power meter bugs (see "Practicality"). The library only returns data that is complete and correct (verified by CRC checksums). 27 | - **Efficiency**: The implementation should be as efficient as possible as long as that doesn't conflict with the previous goals. 28 | - **Reliability**: The library does not crash / panic, even when provided malformed / malicious data. Every error is modeled in the API such that users of the library can decide what to do with the error. The library doesn't use `unsafe` Rust. 29 | - **Completeness**: The library provides access to all data members that are part of the parsed SML data structures. It provides the data in a way that doesn't loose information (e.g. due to int-to-float conversions). 30 | - **Testability**: The library aims for good test coverage, both in unit tests as well as using real-world data. 31 | - **Learnability**: The library should be easy to use, which includes great examples and documentation. 32 | - **Flexibility**: APIs should allow diverse use cases (e.g. decoding the transport layer only; parsing only; doing all at once using a simplified API; ...) 33 | - **Embedded-Friendly**: The library works in `no_std` environments and can be used without an allocator. 34 | - **DevOps-Friendly**: Dependencies are limited as much as possible. Non-essential dependencies are feature-gated. This provides good compile times and less surface for supply chain attacks. 35 | 36 | - Non-goals: 37 | - Implementing the full SML spec, even though it isn't used anywhere. 38 | - Implementing encoding of SML Files (mainly because we don't have use-cases for it. If you need to encode SML data, let us know!) 39 | 40 | ## Spec 41 | 42 | - SML V1.04 Spec [[pdf]][smlpdf] [[archive.org]][smlarchive] 43 | 44 | ## Implementation status 45 | 46 | - [x] Transport v1 47 | - [x] Encode 48 | - [x] Encode streaming 49 | - [x] Decode 50 | - [x] Decode streaming 51 | - [x] Parsing 52 | - [x] Complete (using allocations) 53 | - [x] Streaming (no_alloc compatible) 54 | - [x] no_std / no_alloc support 55 | - [ ] High-level APIs? 56 | - [ ] Great documentation and examples (part done) 57 | - [ ] Review (possibly tool-assisted) for panic paths. 58 | - [ ] ... 59 | 60 | 61 | #### License 62 | 63 | 64 | Licensed under either of Apache License, Version 65 | 2.0 or MIT license at your option. 66 | 67 | 68 |
69 | 70 | 71 | Unless you explicitly state otherwise, any contribution intentionally submitted 72 | for inclusion in this crate by you, as defined in the Apache-2.0 license, shall 73 | be dual licensed as above, without any additional terms or conditions. 74 | 75 | 76 | [smlpdf]: https://www.bsi.bund.de/SharedDocs/Downloads/DE/BSI/Publikationen/TechnischeRichtlinien/TR03109/TR-03109-1_Anlage_Feinspezifikation_Drahtgebundene_LMN-Schnittstelle_Teilb.pdf;jsessionid=F2323041EE7292926D80680DA407BA3F.internet082?__blob=publicationFile&v=1 77 | [smlarchive]: https://web.archive.org/web/20211217153839/https://www.bsi.bund.de/SharedDocs/Downloads/DE/BSI/Publikationen/TechnischeRichtlinien/TR03109/TR-03109-1_Anlage_Feinspezifikation_Drahtgebundene_LMN-Schnittstelle_Teilb.pdf;jsessionid=F2323041EE7292926D80680DA407BA3F.internet082?__blob=publicationFile&v=1 -------------------------------------------------------------------------------- /docs.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | RUSTDOCFLAGS="--cfg docsrs" cargo +nightly doc --all-features $@ -------------------------------------------------------------------------------- /examples/decoder.rs: -------------------------------------------------------------------------------- 1 | //! Reads bytes from stdin and prints decoded messages / errors 2 | //! 3 | //! Example usage: 4 | //! 5 | //! ``` 6 | //! cat tests/libsml-testing/dzg_dwsb20_2th_3byte.bin | cargo run --example decoder 7 | //! ``` 8 | 9 | use sml_rs::parser::complete::File; 10 | 11 | fn main() -> Result<(), std::io::Error> { 12 | let stdin = std::io::stdin().lock(); 13 | 14 | let mut reader = sml_rs::SmlReader::from_reader(stdin); 15 | 16 | while let Some(res) = reader.next::() { 17 | match res { 18 | Ok(file) => println!("{:#?}", file), 19 | Err(e) => println!("Err({:?})", e), 20 | } 21 | } 22 | 23 | println!("Done."); 24 | 25 | Ok(()) 26 | } 27 | -------------------------------------------------------------------------------- /examples/decoder_streaming.rs: -------------------------------------------------------------------------------- 1 | //! Reads bytes from stdin and prints decoded messages / errors 2 | //! 3 | //! Example usage: 4 | //! 5 | //! ``` 6 | //! cat tests/libsml-testing/dzg_dwsb20_2th_3byte.bin | cargo run --example decoder 7 | //! ``` 8 | 9 | use sml_rs::parser::streaming::Parser; 10 | 11 | fn main() -> Result<(), std::io::Error> { 12 | let stdin = std::io::stdin().lock(); 13 | 14 | let mut reader = sml_rs::SmlReader::from_reader(stdin); 15 | 16 | while let Some(res) = reader.next::() { 17 | match res { 18 | Ok(parser) => { 19 | println!("Parsing SML:"); 20 | for item in parser { 21 | println!("{:#?}", item); 22 | } 23 | println!("\n\n") 24 | } 25 | Err(e) => println!("Err({:?})", e), 26 | } 27 | } 28 | 29 | println!("Done."); 30 | 31 | Ok(()) 32 | } 33 | -------------------------------------------------------------------------------- /examples/embedded/esp32c3-power-meter-mock/.cargo/config.toml: -------------------------------------------------------------------------------- 1 | [target.riscv32imc-unknown-none-elf] 2 | runner = "espflash flash --monitor" 3 | 4 | 5 | [env] 6 | ESP_LOGLEVEL="INFO" 7 | 8 | [build] 9 | rustflags = [ 10 | # Required to obtain backtraces (e.g. when using the "esp-backtrace" crate.) 11 | # NOTE: May negatively impact performance of produced code 12 | "-C", "force-frame-pointers", 13 | ] 14 | 15 | target = "riscv32imc-unknown-none-elf" 16 | 17 | [unstable] 18 | build-std = ["core"] 19 | -------------------------------------------------------------------------------- /examples/embedded/esp32c3-power-meter-mock/.gitignore: -------------------------------------------------------------------------------- 1 | # Generated by Cargo 2 | # will have compiled files and executables 3 | debug/ 4 | target/ 5 | 6 | # These are backup files generated by rustfmt 7 | **/*.rs.bk 8 | 9 | # MSVC Windows builds of rustc generate these, which store debugging information 10 | *.pdb 11 | -------------------------------------------------------------------------------- /examples/embedded/esp32c3-power-meter-mock/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "rust-analyzer.check.allTargets": false, 3 | } 4 | -------------------------------------------------------------------------------- /examples/embedded/esp32c3-power-meter-mock/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "esp32c3-power-meter-mock" 3 | version = "0.1.0" 4 | authors = ["Felix Wirth "] 5 | edition = "2021" 6 | license = "MIT OR Apache-2.0" 7 | 8 | [workspace] 9 | 10 | [dependencies] 11 | embedded-io = "0.6.1" 12 | esp-backtrace = { version = "0.13.0", features = [ 13 | "esp32c3", 14 | "exception-handler", 15 | "panic-handler", 16 | "println", 17 | ] } 18 | esp-hal = { version = "0.19.0", features = ["embedded-io", "esp32c3"] } 19 | esp-hal-smartled = { version = "0.12.0", features = ["esp32c3"], optional = true} 20 | esp-println = { version = "0.10.0", features = ["esp32c3", "log"] } 21 | hex-literal = "0.4.1" 22 | log = { version = "0.4.21" } 23 | smart-leds = { version = "0.4.0", optional = true } 24 | 25 | [features] 26 | smart-led = ["dep:smart-leds", "dep:esp-hal-smartled"] 27 | 28 | [profile.dev] 29 | # Rust debug is too slow. 30 | # For debug builds always builds with some optimization 31 | opt-level = "s" 32 | 33 | [profile.release] 34 | codegen-units = 1 # LLVM can perform better optimizations using a single thread 35 | debug = 2 36 | debug-assertions = false 37 | incremental = false 38 | lto = 'fat' 39 | opt-level = 's' 40 | overflow-checks = false 41 | -------------------------------------------------------------------------------- /examples/embedded/esp32c3-power-meter-mock/README.md: -------------------------------------------------------------------------------- 1 | # esp32c3 Power Meter Mock 2 | 3 | This is a simple program for the ESP32-C3 that continuously sends sml messages via UART. 4 | 5 | The example is used to mock a digital german power meter and test the [`sml-rs`][1] library. 6 | 7 | It sends an sml message approximately every second and turns an LED on while sending the data. 8 | 9 | ## Configuration 10 | 11 | By default, the following pins are used: 12 | 13 | - GPIO 9: UART TX pin used to send data 14 | - GPIO 10: UART RX pin (unused, but needs to be provided to the UART peripheral) 15 | - GPIO 18: LED pin (see below) 16 | 17 | You can adapt the pin configuration in the source code (see the comment block "Pin configuration"). 18 | 19 | ### Led configuration 20 | 21 | This project can use either a smart RGB LED (such as the one found on the [ESP32-C3-DevKitC-02][2]) or a simple LED that can 22 | be driven by setting the output to high / low. 23 | 24 | By default, this project assumes a regular LED. Activate the `smart-led` feature to use a smart RGB LED: 25 | 26 | ``` 27 | cargo ... --features smart-led 28 | ``` 29 | 30 | ## Usage 31 | 32 | Install [`espflash`][3]: 33 | 34 | ``` 35 | cargo install espflash 36 | ``` 37 | 38 | Flash and run the example: 39 | 40 | ``` 41 | cargo run --release 42 | ``` 43 | 44 | When using a smart RGB LED: 45 | 46 | ``` 47 | cargo run --release --features smart-led 48 | ``` 49 | 50 | [1]: https://github.com/felixwrt/sml-rs 51 | [2]: https://docs.espressif.com/projects/esp-idf/en/latest/esp32c3/hw-reference/esp32c3/user-guide-devkitc-02.html 52 | [3]: https://github.com/esp-rs/espflash/tree/main/espflash -------------------------------------------------------------------------------- /examples/embedded/esp32c3-power-meter-mock/build.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | println!("cargo:rustc-link-arg-bins=-Tlinkall.x"); 3 | } 4 | -------------------------------------------------------------------------------- /examples/embedded/esp32c3-power-meter-mock/rust-toolchain.toml: -------------------------------------------------------------------------------- 1 | [toolchain] 2 | channel = "nightly" 3 | components = ["rust-src"] 4 | targets = ["riscv32imc-unknown-none-elf"] 5 | 6 | -------------------------------------------------------------------------------- /examples/embedded/esp32c3-power-meter-mock/src/main.rs: -------------------------------------------------------------------------------- 1 | #![no_std] 2 | #![no_main] 3 | 4 | use esp_backtrace as _; 5 | #[cfg(not(feature = "smart-led"))] 6 | use esp_hal::gpio::AnyOutput; 7 | use esp_hal::{ 8 | clock::ClockControl, 9 | delay::Delay, 10 | gpio::{Io, Level}, 11 | peripherals::Peripherals, 12 | prelude::*, 13 | system::SystemControl, 14 | uart::{ 15 | config::{Config, StopBits}, 16 | Uart, 17 | }, 18 | }; 19 | use hex_literal::hex; 20 | 21 | #[cfg(feature = "smart-led")] 22 | use esp_hal::rmt::Rmt; 23 | #[cfg(feature = "smart-led")] 24 | use esp_hal_smartled::{smartLedBuffer, SmartLedsAdapter}; 25 | #[cfg(feature = "smart-led")] 26 | use smart_leds::RGB; 27 | 28 | use embedded_io::Write; 29 | 30 | // test data taken from https://github.com/devZer0/libsml-testing/blob/master/ISKRA_MT631-D1A52-K0z-H01_with_PIN.hex 31 | const TEST_DATA: &[&[u8]] = &[ 32 | &hex!("1B1B1B1B010101017605099DFAAC6200620072630101760101050334A8E40B0A0149534B00047A5544726201650334A737620163D0BB007605099DFAAD620062007263070177010B0A0149534B00047A5544070100620AFFFF726201650334A737757707010060320101010101010449534B0177070100600100FF010101010B0A0149534B00047A55440177070100010800FF650010010401621E52FF650137C0C70177070100020800FF0101621E52FF62000177070100100700FF0101621B52005300C101010163F376007605099DFAAE620062007263020171016342DD001B1B1B1B1A0038EB"), 33 | &hex!("1B1B1B1B010101017605099DFAAF6200620072630101760101050334A8E50B0A0149534B00047A5544726201650334A73862016303AF007605099DFAB0620062007263070177010B0A0149534B00047A5544070100620AFFFF726201650334A738757707010060320101010101010449534B0177070100600100FF010101010B0A0149534B00047A55440177070100010800FF650010010401621E52FF650137C0C80177070100020800FF0101621E52FF62000177070100100700FF0101621B52005300C201010163EA6F007605099DFAB162006200726302017101634BB0001B1B1B1B1A000705"), 34 | &hex!("1B1B1B1B010101017605099DFAB26200620072630101760101050334A8E60B0A0149534B00047A5544726201650334A739620163DC95007605099DFAB3620062007263070177010B0A0149534B00047A5544070100620AFFFF726201650334A739757707010060320101010101010449534B0177070100600100FF010101010B0A0149534B00047A55440177070100010800FF650010010401621E52FF650137C0C80177070100020800FF0101621E52FF62000177070100100700FF0101621B52005300C101010163B703007605099DFAB462006200726302017101638FBB001B1B1B1B1A00D07B"), 35 | &hex!("1B1B1B1B010101017605099DFAB56200620072630101760101050334A8E70B0A0149534B00047A5544726201650334A73A620163AE9F007605099DFAB6620062007263070177010B0A0149534B00047A5544070100620AFFFF726201650334A73A757707010060320101010101010449534B0177070100600100FF010101010B0A0149534B00047A55440177070100010800FF650010010401621E52FF650137C0C90177070100020800FF0101621E52FF62000177070100100700FF0101621B52005300C20101016324B6007605099DFAB762006200726302017101633C45001B1B1B1B1A00C2C5"), 36 | &hex!("1B1B1B1B010101017605099DFAB86200620072630101760101050334A8E80B0A0149534B00047A5544726201650334A73B620163B08E007605099DFAB9620062007263070177010B0A0149534B00047A5544070100620AFFFF726201650334A73B757707010060320101010101010449534B0177070100600100FF010101010B0A0149534B00047A55440177070100010800FF650010010401621E52FF650137C0C90177070100020800FF0101621E52FF62000177070100100700FF0101621B52005300C201010163EAD0007605099DFABA620062007263020171016352F2001B1B1B1B1A00382E"), 37 | ]; 38 | 39 | #[entry] 40 | fn main() -> ! { 41 | let peripherals = Peripherals::take(); 42 | let system = SystemControl::new(peripherals.SYSTEM); 43 | let clocks = ClockControl::max(system.clock_control).freeze(); 44 | let delay = Delay::new(&clocks); 45 | let io = Io::new(peripherals.GPIO, peripherals.IO_MUX); 46 | 47 | // ----------------------------------------------------------------------- 48 | // Pin configuration - adapt to your board 49 | // ----------------------------------------------------------------------- 50 | let led_pin = io.pins.gpio18; 51 | let tx_pin = io.pins.gpio9; 52 | // rx is unused, but needs to be provided for UART 53 | let rx_pin = io.pins.gpio10; 54 | // ----------------------------------------------------------------------- 55 | // ----------------------------------------------------------------------- 56 | // ----------------------------------------------------------------------- 57 | 58 | // Init logging 59 | esp_println::logger::init_logger_from_env(); 60 | 61 | // LED Configuration 62 | let mut led; 63 | #[cfg(feature = "smart-led")] 64 | { 65 | let rmt = Rmt::new(peripherals.RMT, 80.MHz(), &clocks, None).unwrap(); 66 | let rmt_buffer = smartLedBuffer!(1); 67 | led = SmartLedsAdapter::new(rmt.channel0, led_pin, rmt_buffer, &clocks); 68 | } 69 | #[cfg(not(feature = "smart-led"))] 70 | { 71 | led = AnyOutput::new(led_pin, Level::High); 72 | } 73 | 74 | // UART Configuration 75 | let uart_config = Config::default() 76 | .baudrate(9600) 77 | .parity_none() 78 | .stop_bits(StopBits::STOP1); 79 | let mut uart1 = Uart::new_with_config( 80 | peripherals.UART1, 81 | uart_config, 82 | &clocks, 83 | None, 84 | tx_pin, 85 | rx_pin, 86 | ) 87 | .unwrap(); 88 | 89 | // Main Loop 90 | let mut data_iter = TEST_DATA.iter().cycle(); 91 | loop { 92 | let data = data_iter.next().unwrap(); 93 | log::info!("Sending data!"); 94 | led_write(&mut led, Level::High); 95 | 96 | uart1.write(data).unwrap(); 97 | 98 | led_write(&mut led, Level::Low); 99 | delay.delay(1000.millis()); 100 | } 101 | } 102 | 103 | #[cfg(feature = "smart-led")] 104 | fn led_write(led: &mut S, level: Level) 105 | where 106 | S: smart_leds::SmartLedsWrite>, 107 | S::Error: core::fmt::Debug, 108 | { 109 | let color = match level { 110 | Level::High => RGB::new(0, 0, 2), 111 | Level::Low => RGB::new(0, 0, 0), 112 | }; 113 | led.write([color]).unwrap() 114 | } 115 | #[cfg(not(feature = "smart-led"))] 116 | fn led_write(led: &mut AnyOutput, level: Level) { 117 | led.set_level(level) 118 | } 119 | -------------------------------------------------------------------------------- /examples/embedded/esp32c3-sml-reader-async/.cargo/config.toml: -------------------------------------------------------------------------------- 1 | [target.riscv32imc-unknown-none-elf] 2 | runner = "espflash flash --monitor" 3 | 4 | 5 | [env] 6 | ESP_LOGLEVEL="INFO" 7 | 8 | [build] 9 | rustflags = [ 10 | # Required to obtain backtraces (e.g. when using the "esp-backtrace" crate.) 11 | # NOTE: May negatively impact performance of produced code 12 | "-C", "force-frame-pointers", 13 | ] 14 | 15 | target = "riscv32imc-unknown-none-elf" 16 | 17 | [unstable] 18 | build-std = ["core"] 19 | -------------------------------------------------------------------------------- /examples/embedded/esp32c3-sml-reader-async/.gitignore: -------------------------------------------------------------------------------- 1 | # Generated by Cargo 2 | # will have compiled files and executables 3 | debug/ 4 | target/ 5 | 6 | # These are backup files generated by rustfmt 7 | **/*.rs.bk 8 | 9 | # MSVC Windows builds of rustc generate these, which store debugging information 10 | *.pdb 11 | -------------------------------------------------------------------------------- /examples/embedded/esp32c3-sml-reader-async/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "rust-analyzer.check.allTargets": false, 3 | } 4 | -------------------------------------------------------------------------------- /examples/embedded/esp32c3-sml-reader-async/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "esp32c3-sml-reader-async" 3 | version = "0.1.0" 4 | authors = ["Felix Wirth "] 5 | edition = "2021" 6 | license = "MIT OR Apache-2.0" 7 | 8 | [workspace] 9 | 10 | [dependencies] 11 | embassy-executor = { version = "0.5.0", features = ["task-arena-size-40960"] } 12 | embassy-time = { version = "0.3.0", features = ["generic-queue-8"] } 13 | embedded-io-async = "0.6.1" 14 | esp-backtrace = { version = "0.13.0", features = [ 15 | "esp32c3", 16 | "exception-handler", 17 | "panic-handler", 18 | "println", 19 | ] } 20 | esp-hal = { version = "0.19.0", features = ["embedded-io-async", "esp32c3", "async"] } 21 | esp-hal-embassy = { version = "0.2.0", features = ["esp32c3"] } 22 | esp-hal-smartled = { version = "0.12.0", features = ["esp32c3"], optional = true} 23 | esp-println = { version = "0.10.0", features = ["esp32c3", "log"] } 24 | log = { version = "0.4.21" } 25 | smart-leds = { version = "0.4.0", optional = true } 26 | sml-rs = { version = "0.4.0", default-features = false } 27 | static_cell = "2.1.0" 28 | 29 | [features] 30 | smart-led = ["dep:smart-leds", "dep:esp-hal-smartled"] 31 | 32 | [profile.dev] 33 | # Rust debug is too slow. 34 | # For debug builds always builds with some optimization 35 | opt-level = "s" 36 | 37 | [profile.release] 38 | codegen-units = 1 # LLVM can perform better optimizations using a single thread 39 | debug = 2 40 | debug-assertions = false 41 | incremental = false 42 | lto = 'fat' 43 | opt-level = 's' 44 | overflow-checks = false 45 | -------------------------------------------------------------------------------- /examples/embedded/esp32c3-sml-reader-async/README.md: -------------------------------------------------------------------------------- 1 | # esp32c3 Async SML Reader 2 | 3 | This is a simple program for the ESP32-C3 that reads sml messages from a UART pin. 4 | 5 | The example shows how to use the [`sml-rs`][1] library in an async embedded context. 6 | 7 | It receives data from a UART pin, tries to parse it as an sml message and prints the result on the terminal. 8 | Additionally, it toggles an LED whenever a byte is received on the UART pin. 9 | 10 | Note: also take a look at the [`esp32c3-power-meter-mock`](../esp32c3-power-meter-mock/) example which can be used to generate 11 | sml messages that can be consumed by this example. 12 | 13 | ## Configuration 14 | 15 | By default, the following pins are used: 16 | 17 | - GPIO 10: UART TX pin (unused, but needs to be provided to the UART peripheral) 18 | - GPIO 9: UART RX pin used to receive data 19 | - GPIO 8: LED pin (see below) 20 | 21 | You can adapt the pin configuration in the source code (see the comment block "Pin configuration"). 22 | 23 | ### Led configuration 24 | 25 | This project can use either a smart RGB LED (such as the one found on the [ESP32-C3-DevKitC-02][2]) or a simple LED that can 26 | be driven by setting the output to high / low. 27 | 28 | By default, this project assumes a regular LED. Activate the `smart-led` feature to use a smart RGB LED: 29 | 30 | ``` 31 | cargo ... --features smart-led 32 | ``` 33 | 34 | ## Usage 35 | 36 | Install [`espflash`][3]: 37 | 38 | ``` 39 | cargo install espflash 40 | ``` 41 | 42 | Flash and run the example: 43 | 44 | ``` 45 | cargo run --release 46 | ``` 47 | 48 | When using a smart RGB LED: 49 | 50 | ``` 51 | cargo run --release --features smart-led 52 | ``` 53 | 54 | [1]: https://github.com/felixwrt/sml-rs 55 | [2]: https://docs.espressif.com/projects/esp-idf/en/latest/esp32c3/hw-reference/esp32c3/user-guide-devkitc-02.html 56 | [3]: https://github.com/esp-rs/espflash/tree/main/espflash 57 | -------------------------------------------------------------------------------- /examples/embedded/esp32c3-sml-reader-async/build.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | println!("cargo:rustc-link-arg-bins=-Tlinkall.x"); 3 | } 4 | -------------------------------------------------------------------------------- /examples/embedded/esp32c3-sml-reader-async/rust-toolchain.toml: -------------------------------------------------------------------------------- 1 | [toolchain] 2 | channel = "nightly" 3 | components = ["rust-src"] 4 | targets = ["riscv32imc-unknown-none-elf"] 5 | 6 | -------------------------------------------------------------------------------- /examples/embedded/esp32c3-sml-reader-async/src/main.rs: -------------------------------------------------------------------------------- 1 | #![no_std] 2 | #![no_main] 3 | 4 | use core::slice; 5 | 6 | use embassy_executor::Spawner; 7 | use embassy_time::{Duration, Timer}; 8 | use esp_backtrace as _; 9 | #[cfg(not(feature = "smart-led"))] 10 | use esp_hal::gpio::AnyOutput; 11 | use esp_hal::{ 12 | clock::ClockControl, 13 | gpio::{Io, Level}, 14 | peripherals::{Peripherals, UART1}, 15 | prelude::*, 16 | system::SystemControl, 17 | timer::{timg::TimerGroup, ErasedTimer, OneShotTimer}, 18 | uart::{ 19 | config::{Config, StopBits}, 20 | Uart, UartRx, 21 | }, 22 | Async, 23 | }; 24 | 25 | #[cfg(feature = "smart-led")] 26 | use esp_hal::rmt::Rmt; 27 | #[cfg(feature = "smart-led")] 28 | use esp_hal_smartled::{smartLedBuffer, SmartLedsAdapter}; 29 | #[cfg(feature = "smart-led")] 30 | use smart_leds::RGB; 31 | 32 | use sml_rs::{transport::Decoder, util::ArrayBuf}; 33 | 34 | macro_rules! mk_static { 35 | ($t:ty,$val:expr) => {{ 36 | static STATIC_CELL: static_cell::StaticCell<$t> = static_cell::StaticCell::new(); 37 | #[deny(unused_attributes)] 38 | let x = STATIC_CELL.uninit().write(($val)); 39 | x 40 | }}; 41 | } 42 | 43 | #[main] 44 | async fn main(spawner: Spawner) { 45 | let peripherals = Peripherals::take(); 46 | let system = SystemControl::new(peripherals.SYSTEM); 47 | let clocks = ClockControl::boot_defaults(system.clock_control).freeze(); 48 | let io = Io::new(peripherals.GPIO, peripherals.IO_MUX); 49 | 50 | let timg0 = TimerGroup::new(peripherals.TIMG0, &clocks, None); 51 | let timer0 = OneShotTimer::new(timg0.timer0.into()); 52 | let timers = [timer0]; 53 | let timers = mk_static!([OneShotTimer; 1], timers); 54 | 55 | // ----------------------------------------------------------------------- 56 | // Pin configuration - adapt to your board 57 | // ----------------------------------------------------------------------- 58 | let led_pin = io.pins.gpio8; 59 | // tx is unused, but needs to be provided for UART 60 | let tx_pin = io.pins.gpio10; 61 | let rx_pin = io.pins.gpio9; 62 | // ----------------------------------------------------------------------- 63 | // ----------------------------------------------------------------------- 64 | // ----------------------------------------------------------------------- 65 | 66 | // Init logging 67 | esp_println::logger::init_logger_from_env(); 68 | 69 | let mut led; 70 | // LED Configuration 71 | #[cfg(feature = "smart-led")] 72 | { 73 | let rmt = Rmt::new(peripherals.RMT, 80.MHz(), &clocks, None).unwrap(); 74 | let rmt_buffer = smartLedBuffer!(1); 75 | led = SmartLedsAdapter::new(rmt.channel0, led_pin, rmt_buffer, &clocks); 76 | } 77 | #[cfg(not(feature = "smart-led"))] 78 | { 79 | led = AnyOutput::new(led_pin, Level::High); 80 | } 81 | 82 | // UART Configuration 83 | let uart_config = Config::default() 84 | .baudrate(9600) 85 | .parity_none() 86 | .stop_bits(StopBits::STOP1) 87 | .rx_fifo_full_threshold(0); 88 | let uart1 = 89 | Uart::new_async_with_config(peripherals.UART1, uart_config, &clocks, tx_pin, rx_pin) 90 | .unwrap(); 91 | let (_tx, rx) = uart1.split(); 92 | 93 | // Init embassy 94 | log::info!("Initializing embassy..."); 95 | esp_hal_embassy::init(&clocks, timers); 96 | 97 | // Test LED 98 | log::info!("Testing LED..."); 99 | let mut led_state = false; 100 | for _ in 0..8 { 101 | toggle_led(&mut led_state, &mut led); 102 | Timer::after(Duration::from_millis(200)).await; 103 | } 104 | 105 | // Spawn print task 106 | log::info!("Spawning print task..."); 107 | spawner.spawn(print()).ok(); 108 | 109 | // Spawn reader task 110 | log::info!("Spawning reader task..."); 111 | spawner.spawn(reader(rx, led)).ok(); 112 | } 113 | 114 | #[embassy_executor::task] 115 | async fn reader(mut rx: UartRx<'static, UART1, Async>, mut led: LedTy) { 116 | log::info!("Starting reader task!"); 117 | let mut led_state = false; 118 | 119 | let buf = ArrayBuf::<4069>::default(); 120 | let mut decoder = Decoder::from_buf(buf); 121 | 122 | loop { 123 | // read byte from the pin 124 | let mut b = 0u8; 125 | let r = embedded_io_async::Read::read(&mut rx, slice::from_mut(&mut b)).await; 126 | 127 | // toggle the LED 128 | toggle_led(&mut led_state, &mut led); 129 | 130 | match r { 131 | Ok(_) => { 132 | // process the read byte 133 | match decoder.push_byte(b) { 134 | Ok(None) => { 135 | continue; 136 | } 137 | Ok(Some(bytes)) => { 138 | log::info!("Got data: {bytes:?}") 139 | } 140 | Err(e) => { 141 | log::info!("Error receiving data: {e}") 142 | } 143 | } 144 | } 145 | Err(e) => { 146 | log::warn!("UART RX Error: {:?}", e) 147 | } 148 | } 149 | } 150 | } 151 | 152 | #[embassy_executor::task] 153 | async fn print() { 154 | loop { 155 | log::info!("Hello from the print task!"); 156 | Timer::after(Duration::from_millis(5000)).await; 157 | } 158 | } 159 | 160 | #[cfg(feature = "smart-led")] 161 | type LedTy = SmartLedsAdapter, 25>; 162 | #[cfg(not(feature = "smart-led"))] 163 | type LedTy = AnyOutput<'static>; 164 | 165 | #[cfg(feature = "smart-led")] 166 | fn led_write(led: &mut S, level: Level) 167 | where 168 | S: smart_leds::SmartLedsWrite>, 169 | S::Error: core::fmt::Debug, 170 | { 171 | let color = match level { 172 | Level::High => RGB::new(0, 0, 2), 173 | Level::Low => RGB::new(0, 0, 0), 174 | }; 175 | led.write([color]).unwrap() 176 | } 177 | #[cfg(not(feature = "smart-led"))] 178 | fn led_write(led: &mut AnyOutput, level: Level) { 179 | led.set_level(level) 180 | } 181 | 182 | fn toggle_led(state: &mut bool, led: &mut LedTy) { 183 | *state = !*state; 184 | led_write(led, (*state).into()) 185 | } 186 | -------------------------------------------------------------------------------- /examples/embedded/esp32c3-sml-reader/.cargo/config.toml: -------------------------------------------------------------------------------- 1 | [target.riscv32imc-unknown-none-elf] 2 | runner = "espflash flash --monitor" 3 | 4 | 5 | [env] 6 | ESP_LOGLEVEL="INFO" 7 | 8 | [build] 9 | rustflags = [ 10 | # Required to obtain backtraces (e.g. when using the "esp-backtrace" crate.) 11 | # NOTE: May negatively impact performance of produced code 12 | "-C", "force-frame-pointers", 13 | ] 14 | 15 | target = "riscv32imc-unknown-none-elf" 16 | 17 | [unstable] 18 | build-std = ["core"] 19 | -------------------------------------------------------------------------------- /examples/embedded/esp32c3-sml-reader/.gitignore: -------------------------------------------------------------------------------- 1 | # Generated by Cargo 2 | # will have compiled files and executables 3 | debug/ 4 | target/ 5 | 6 | # These are backup files generated by rustfmt 7 | **/*.rs.bk 8 | 9 | # MSVC Windows builds of rustc generate these, which store debugging information 10 | *.pdb 11 | -------------------------------------------------------------------------------- /examples/embedded/esp32c3-sml-reader/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "rust-analyzer.check.allTargets": false, 3 | } 4 | -------------------------------------------------------------------------------- /examples/embedded/esp32c3-sml-reader/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "esp32c3-sml-reader" 3 | version = "0.1.0" 4 | authors = ["Felix Wirth "] 5 | edition = "2021" 6 | license = "MIT OR Apache-2.0" 7 | 8 | [workspace] 9 | 10 | [dependencies] 11 | embedded-io = "0.6.1" 12 | esp-backtrace = { version = "0.13.0", features = [ 13 | "esp32c3", 14 | "exception-handler", 15 | "panic-handler", 16 | "println", 17 | ] } 18 | esp-hal = { version = "0.19.0", features = ["embedded-io", "esp32c3"] } 19 | esp-hal-smartled = { version = "0.12.0", features = ["esp32c3"], optional = true} 20 | esp-println = { version = "0.10.0", features = ["esp32c3", "log"] } 21 | log = { version = "0.4.21" } 22 | smart-leds = { version = "0.4.0", optional = true } 23 | sml-rs = { version = "0.4.0", default-features = false } 24 | 25 | [features] 26 | smart-led = ["dep:smart-leds", "dep:esp-hal-smartled"] 27 | polling = [] 28 | 29 | [profile.dev] 30 | # Rust debug is too slow. 31 | # For debug builds always builds with some optimization 32 | opt-level = "s" 33 | 34 | [profile.release] 35 | codegen-units = 1 # LLVM can perform better optimizations using a single thread 36 | debug = 2 37 | debug-assertions = false 38 | incremental = false 39 | lto = 'fat' 40 | opt-level = 's' 41 | overflow-checks = false 42 | -------------------------------------------------------------------------------- /examples/embedded/esp32c3-sml-reader/README.md: -------------------------------------------------------------------------------- 1 | # esp32c3 SML Reader 2 | 3 | This is a simple program for the ESP32-C3 that reads sml messages from a UART pin. 4 | 5 | The example shows how to use the [`sml-rs`][1] library in an embedded context. 6 | 7 | It receives data from a UART pin, tries to parse it as an sml message and prints the result on the terminal. 8 | Additionally, it toggles an LED whenever a byte is received on the UART pin. 9 | 10 | Note: also take a look at the [`esp32c3-power-meter-mock`](../esp32c3-power-meter-mock/) example which can be used to generate 11 | sml messages that can be consumed by this example. 12 | 13 | ## Configuration 14 | 15 | By default, the following pins are used: 16 | 17 | - GPIO 10: UART TX pin (unused, but needs to be provided to the UART peripheral) 18 | - GPIO 9: UART RX pin used to receive data 19 | - GPIO 8: LED pin (see below) 20 | 21 | You can adapt the pin configuration in the source code (see the comment block "Pin configuration"). 22 | 23 | ### Led configuration 24 | 25 | This project can use either a smart RGB LED (such as the one found on the [ESP32-C3-DevKitC-02][2]) or a simple LED that can 26 | be driven by setting the output to high / low. 27 | 28 | By default, this project assumes a regular LED. Activate the `smart-led` feature to use a smart RGB LED: 29 | 30 | ``` 31 | cargo ... --features smart-led 32 | ``` 33 | 34 | ## Usage 35 | 36 | Install [`espflash`][3]: 37 | 38 | ``` 39 | cargo install espflash 40 | ``` 41 | 42 | Flash and run the example: 43 | 44 | ``` 45 | cargo run --release 46 | ``` 47 | 48 | When using a smart RGB LED: 49 | 50 | ``` 51 | cargo run --release --features smart-led 52 | ``` 53 | 54 | ### Polling mode 55 | 56 | The example contains two working modes: blocking (default) and polling. In the blocking mode, the implementation 57 | continuously tries to read from the UART pin, which blocks if no data is available currently. This is simple to implement, but 58 | also means that it's not possible to concurrently work on several tasks within the main loop. 59 | 60 | In the polling mode, the implementation first checks whether data is available and only reads from the pin if that is the case. 61 | This allows doing additional work in the main loop. The example prints a message to the terminal every 5 seconds. 62 | 63 | Note: also take a look at the [`esp32c3-sml-reader-async`](../esp32c3-sml-reader-async/) example which uses `embassy` and `async/await` to enable multitasking. 64 | 65 | The polling mode can be activated using the `polling` feature: 66 | 67 | ``` 68 | cargo run --release --features polling 69 | ``` 70 | 71 | Or, when using a smart RGB LED: 72 | 73 | ``` 74 | cargo run --release --features smart-led,polling 75 | ``` 76 | 77 | [1]: https://github.com/felixwrt/sml-rs 78 | [2]: https://docs.espressif.com/projects/esp-idf/en/latest/esp32c3/hw-reference/esp32c3/user-guide-devkitc-02.html 79 | [3]: https://github.com/esp-rs/espflash/tree/main/espflash -------------------------------------------------------------------------------- /examples/embedded/esp32c3-sml-reader/build.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | println!("cargo:rustc-link-arg-bins=-Tlinkall.x"); 3 | } 4 | -------------------------------------------------------------------------------- /examples/embedded/esp32c3-sml-reader/rust-toolchain.toml: -------------------------------------------------------------------------------- 1 | [toolchain] 2 | channel = "nightly" 3 | components = ["rust-src"] 4 | targets = ["riscv32imc-unknown-none-elf"] 5 | 6 | -------------------------------------------------------------------------------- /examples/embedded/esp32c3-sml-reader/src/main.rs: -------------------------------------------------------------------------------- 1 | #![no_std] 2 | #![no_main] 3 | 4 | use core::slice; 5 | 6 | use esp_backtrace as _; 7 | #[cfg(not(feature = "smart-led"))] 8 | use esp_hal::gpio::AnyOutput; 9 | use esp_hal::{ 10 | clock::ClockControl, 11 | delay::Delay, 12 | gpio::{Io, Level}, 13 | peripherals::Peripherals, 14 | prelude::*, 15 | system::SystemControl, 16 | uart::{ 17 | config::{Config, StopBits}, 18 | Uart, 19 | }, 20 | }; 21 | 22 | #[cfg(feature = "smart-led")] 23 | use esp_hal::rmt::Rmt; 24 | #[cfg(feature = "smart-led")] 25 | use esp_hal_smartled::{smartLedBuffer, SmartLedsAdapter}; 26 | #[cfg(feature = "smart-led")] 27 | use smart_leds::RGB; 28 | 29 | use sml_rs::{transport::Decoder, util::ArrayBuf}; 30 | 31 | #[entry] 32 | fn main() -> ! { 33 | let peripherals = Peripherals::take(); 34 | let system = SystemControl::new(peripherals.SYSTEM); 35 | let clocks = ClockControl::max(system.clock_control).freeze(); 36 | let delay = Delay::new(&clocks); 37 | let io = Io::new(peripherals.GPIO, peripherals.IO_MUX); 38 | 39 | // ----------------------------------------------------------------------- 40 | // Pin configuration - adapt to your board 41 | // ----------------------------------------------------------------------- 42 | let led_pin = io.pins.gpio8; 43 | // tx is unused, but needs to be provided for UART 44 | let tx_pin = io.pins.gpio10; 45 | let rx_pin = io.pins.gpio9; 46 | // ----------------------------------------------------------------------- 47 | // ----------------------------------------------------------------------- 48 | // ----------------------------------------------------------------------- 49 | 50 | // Init logging 51 | esp_println::logger::init_logger_from_env(); 52 | 53 | // LED Configuration 54 | let mut led; 55 | #[cfg(feature = "smart-led")] 56 | { 57 | let rmt = Rmt::new(peripherals.RMT, 80.MHz(), &clocks, None).unwrap(); 58 | let rmt_buffer = smartLedBuffer!(1); 59 | led = SmartLedsAdapter::new(rmt.channel0, led_pin, rmt_buffer, &clocks); 60 | } 61 | #[cfg(not(feature = "smart-led"))] 62 | { 63 | led = AnyOutput::new(led_pin, Level::High); 64 | } 65 | 66 | // UART Configuration 67 | let uart_config = Config::default() 68 | .baudrate(9600) 69 | .parity_none() 70 | .stop_bits(StopBits::STOP1); 71 | let mut uart1 = Uart::new_with_config( 72 | peripherals.UART1, 73 | uart_config, 74 | &clocks, 75 | None, 76 | tx_pin, 77 | rx_pin, 78 | ) 79 | .unwrap(); 80 | 81 | // Closure toggling the LED 82 | let mut led_state = false; 83 | let mut toggle_led = || { 84 | led_state = !led_state; 85 | led_write(&mut led, led_state.into()); 86 | }; 87 | 88 | // Test LED 89 | log::info!("Testing LED..."); 90 | for _ in 0..8 { 91 | toggle_led(); 92 | delay.delay(200.millis()); 93 | } 94 | 95 | log::info!("Reading SML messages..."); 96 | 97 | #[cfg(not(feature = "polling"))] 98 | { 99 | read_blocking(&mut uart1, toggle_led) 100 | } 101 | #[cfg(feature = "polling")] 102 | { 103 | read_polling(&mut uart1, toggle_led) 104 | } 105 | } 106 | 107 | #[allow(unused)] 108 | fn read_blocking(pin: &mut impl embedded_io::Read, mut toggle_led: impl FnMut()) -> ! { 109 | let buf = ArrayBuf::<4069>::default(); 110 | let mut decoder = Decoder::from_buf(buf); 111 | 112 | loop { 113 | // read byte from the pin 114 | let mut b = 0u8; 115 | let r = pin.read(slice::from_mut(&mut b)); 116 | 117 | // toggle the LED 118 | toggle_led(); 119 | 120 | match r { 121 | Ok(_) => { 122 | // process the read byte 123 | match decoder.push_byte(b) { 124 | Ok(None) => { 125 | continue; 126 | } 127 | Ok(Some(bytes)) => { 128 | log::info!("Got data: {bytes:?}") 129 | } 130 | Err(e) => { 131 | log::error!("Error receiving data: {e}") 132 | } 133 | } 134 | } 135 | Err(e) => { 136 | log::warn!("UART RX Error: {:?}", e) 137 | } 138 | } 139 | } 140 | } 141 | 142 | #[allow(unused)] 143 | fn read_polling( 144 | pin: &mut PIN, 145 | mut toggle_led: impl FnMut(), 146 | ) -> ! { 147 | let buf = ArrayBuf::<4069>::default(); 148 | let mut decoder = Decoder::from_buf(buf); 149 | 150 | let mut last_print_time = 0; 151 | 152 | // main loop 153 | loop { 154 | // reading only when data is available (non-blocking) 155 | if pin.read_ready().unwrap() { 156 | // read byte from the pin 157 | let mut b = 0u8; 158 | let r = pin.read(slice::from_mut(&mut b)); 159 | 160 | // toggle the LED 161 | toggle_led(); 162 | 163 | match r { 164 | Ok(_) => { 165 | // process the read byte 166 | match decoder.push_byte(b) { 167 | Ok(None) => { 168 | continue; 169 | } 170 | Ok(Some(bytes)) => { 171 | log::info!("Got data: {bytes:?}") 172 | } 173 | Err(e) => { 174 | log::error!("Error receiving data: {e}") 175 | } 176 | } 177 | } 178 | Err(e) => { 179 | log::warn!("UART RX Error: {:?}", e) 180 | } 181 | } 182 | } 183 | 184 | // print a message every 5 seconds 185 | let mut secs_since_start = esp_hal::time::current_time() 186 | .duration_since_epoch() 187 | .to_secs(); 188 | if secs_since_start >= last_print_time + 5 { 189 | last_print_time = secs_since_start; 190 | log::info!("Hello from the print task!"); 191 | } 192 | } 193 | } 194 | 195 | #[cfg(feature = "smart-led")] 196 | fn led_write(led: &mut S, level: Level) 197 | where 198 | S: smart_leds::SmartLedsWrite>, 199 | S::Error: core::fmt::Debug, 200 | { 201 | let color = match level { 202 | Level::High => RGB::new(0, 0, 2), 203 | Level::Low => RGB::new(0, 0, 0), 204 | }; 205 | led.write([color]).unwrap() 206 | } 207 | #[cfg(not(feature = "smart-led"))] 208 | fn led_write(led: &mut AnyOutput, level: Level) { 209 | led.set_level(level) 210 | } 211 | -------------------------------------------------------------------------------- /examples/serialport/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "sml-rs-serialport-example" 3 | version = "0.1.0" 4 | authors = ["Felix Wirth "] 5 | description = "Example of using `sml-rs` with `serialport`" 6 | repository = "https://github.com/felixwrt/sml-rs" 7 | license = "MIT OR Apache-2.0" 8 | edition = "2021" 9 | 10 | [[bin]] 11 | name = "sml-rs-serialport-example" 12 | path = "serialport.rs" 13 | 14 | [dependencies] 15 | sml-rs = { path = "../../" } 16 | serialport = { version = "4.2.0" } 17 | -------------------------------------------------------------------------------- /examples/serialport/serialport.rs: -------------------------------------------------------------------------------- 1 | //! Reads data from a serial port and prints the contained sml messages to stdout 2 | 3 | use std::io::{self, Write}; 4 | use std::time::Duration; 5 | 6 | use serialport::{Parity, SerialPortInfo, SerialPortType, StopBits, UsbPortInfo}; 7 | use sml_rs::parser::complete::File; 8 | use sml_rs::ReadParsedError; 9 | 10 | fn main() -> std::io::Result<()> { 11 | let ports = serialport::available_ports().expect("No ports found!"); 12 | 13 | let port_name = select_port(&ports)?; 14 | 15 | println!("Connecting to port {}", port_name); 16 | let port = serialport::new(port_name, 9_600) 17 | .stop_bits(StopBits::One) 18 | .parity(Parity::None) 19 | .timeout(Duration::from_millis(5000)) 20 | .open() 21 | .expect("Failed to open port"); 22 | 23 | let mut reader = sml_rs::SmlReader::from_reader(port); 24 | loop { 25 | match reader.read::() { 26 | Ok(file) => println!("{:?}", file), 27 | Err(ReadParsedError::IoErr(e, _)) => { 28 | println!("IO Error: {:?}", e); 29 | println!("Exiting."); 30 | break; 31 | } 32 | Err(e) => { 33 | println!("Error: {:?}", e); 34 | } 35 | } 36 | } 37 | 38 | Ok(()) 39 | } 40 | 41 | fn select_port(ports: &[SerialPortInfo]) -> std::io::Result<&String> { 42 | if ports.is_empty() { 43 | panic!("No serial ports found."); 44 | } 45 | 46 | println!("Please select a port:"); 47 | // print available ports 48 | for (idx, p) in ports.iter().enumerate() { 49 | let prod_str = if let SerialPortType::UsbPort(UsbPortInfo { 50 | product: Some(prod), 51 | .. 52 | }) = &p.port_type 53 | { 54 | format!("({prod})") 55 | } else { 56 | "".to_string() 57 | }; 58 | println!(" {idx}: {} {}", p.port_name, prod_str); 59 | } 60 | 61 | print!("Enter port number: "); 62 | std::io::stdout().flush()?; 63 | 64 | // let user select serial port 65 | let mut input_line = String::new(); 66 | io::stdin().read_line(&mut input_line)?; 67 | let selected_idx: usize = input_line.trim().parse().expect("Input not an integer"); 68 | 69 | let Some(port_name) = ports.get(selected_idx).map(|x| &x.port_name) else { 70 | panic!("Invalid port number."); 71 | }; 72 | 73 | Ok(port_name) 74 | } 75 | -------------------------------------------------------------------------------- /sample.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/felixwrt/sml-rs/17c1a8d73c9c992bc9b4de6560de987ec47de6ae/sample.bin -------------------------------------------------------------------------------- /src/parser/num.rs: -------------------------------------------------------------------------------- 1 | //! Parsers for number types and booleans 2 | 3 | use super::{ 4 | map, take_byte, take_n, 5 | tlf::{Ty, TypeLengthField}, 6 | ResTy, SmlParseTlf, 7 | }; 8 | 9 | fn parse_num<'i, const SIZE: usize, const IS_SIGNED: bool>( 10 | input: &'i [u8], 11 | tlf: &TypeLengthField, 12 | ) -> ResTy<'i, [u8; SIZE]> { 13 | // read bytes 14 | let (input, bytes) = take_n(input, tlf.len as usize)?; 15 | 16 | // determine fill bytes depending on the type and sign of the number 17 | let fill_byte = if IS_SIGNED { 18 | let is_negative = bytes[0] > 0x7F; 19 | if is_negative { 20 | 0xFF 21 | } else { 22 | 0x00 23 | } 24 | } else { 25 | 0x00 26 | }; 27 | 28 | // initialize buffer of Self's size with fill bytes 29 | let mut buffer = [fill_byte; SIZE]; 30 | 31 | // copy read bytes into the buffer 32 | let num_skipped_bytes = SIZE - tlf.len as usize; 33 | buffer[num_skipped_bytes..].copy_from_slice(bytes); 34 | 35 | Ok((input, buffer)) 36 | } 37 | 38 | macro_rules! impl_num { 39 | (($($t:ty),+), $int_ty:expr) => { 40 | $( 41 | // compile time check to ensure that the second argument to `impl_num` can only be `Ty::Unsigned` or `Ty::Integer` 42 | const _: () = if !matches!($int_ty, Ty::Unsigned | Ty::Integer) { 43 | panic!("impl_num used with invalid type argument. Only Ty::Unsigned and Ty::Integer are allowed"); 44 | }; 45 | 46 | impl<'i> SmlParseTlf<'i> for $t { 47 | fn check_tlf(tlf: &TypeLengthField) -> bool { 48 | // size of the number type (in bytes) 49 | const SIZE: usize = core::mem::size_of::<$t>(); 50 | 51 | tlf.ty == $int_ty && tlf.len as usize <= SIZE && tlf.len != 0 52 | } 53 | 54 | fn parse_with_tlf(input: &'i [u8], tlf: &TypeLengthField) -> ResTy<'i, Self> { 55 | // size of the number type (in bytes) 56 | const SIZE: usize = core::mem::size_of::<$t>(); 57 | const IS_SIGNED: bool = matches!($int_ty, Ty::Integer); 58 | 59 | map(parse_num::(input, tlf), Self::from_be_bytes) 60 | } 61 | } 62 | )+ 63 | }; 64 | } 65 | 66 | impl_num!((u8, u16, u32, u64), Ty::Unsigned); 67 | impl_num!((i8, i16, i32, i64), Ty::Integer); 68 | 69 | // Boolean 70 | impl<'i> SmlParseTlf<'i> for bool { 71 | fn check_tlf(tlf: &TypeLengthField) -> bool { 72 | *tlf == TypeLengthField::new(Ty::Boolean, core::mem::size_of::() as u32) 73 | } 74 | 75 | fn parse_with_tlf(input: &'i [u8], _tlf: &TypeLengthField) -> ResTy<'i, Self> { 76 | let (input, b) = take_byte(input)?; 77 | Ok((input, b > 0)) 78 | } 79 | } 80 | 81 | #[cfg(test)] 82 | mod test { 83 | use crate::parser::SmlParse; 84 | 85 | #[test] 86 | fn parse_nums() { 87 | assert_eq!(u8::parse_complete(&[0x62, 0x05]), Ok(5)); 88 | assert_eq!(u16::parse_complete(&[0x63, 0x01, 0x01]), Ok(257)); 89 | assert_eq!(u32::parse_complete(&[0x65, 0x0, 0x0, 0x0, 0x1]), Ok(1)); 90 | assert_eq!( 91 | u64::parse_complete(&[0x69, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1]), 92 | Ok(1) 93 | ); 94 | 95 | assert_eq!(i8::parse_complete(&[0x52, 0xFF]), Ok(-1)); 96 | assert_eq!(i16::parse_complete(&[0x53, 0xEC, 0x78]), Ok(-5000)); 97 | assert_eq!( 98 | i32::parse_complete(&[0x55, 0xFF, 0xFF, 0xEC, 0x78]), 99 | Ok(-5000) 100 | ); 101 | assert_eq!( 102 | i64::parse_complete(&[0x59, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF]), 103 | Ok(-1) 104 | ); 105 | } 106 | 107 | #[test] 108 | fn parse_nums_error() { 109 | // tlf if for u32, but we're trying to parse as u8 110 | assert!(u8::parse_complete(&[0x65, 0x0, 0x0, 0x0, 0x1]).is_err()); 111 | } 112 | 113 | #[test] 114 | fn parse_fewer_bytes() { 115 | assert_eq!(u32::parse_complete(&[0x64, 0x01, 0x00, 0x01]), Ok(65537)); 116 | assert_eq!( 117 | u64::parse_complete(&[0x67, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1]), 118 | Ok(1) 119 | ); 120 | assert_eq!(u64::parse_complete(&[0x65, 0x0, 0x0, 0x0, 0x1]), Ok(1)); 121 | assert_eq!(u64::parse_complete(&[0x62, 0x1]), Ok(1)); 122 | 123 | assert_eq!(i64::parse_complete(&[0x55, 0xFF, 0xFF, 0xFF, 0xFF]), Ok(-1)); 124 | assert_eq!(i16::parse_complete(&[0x52, 0x01]), Ok(1)) 125 | } 126 | 127 | #[test] 128 | fn parse_optional_num() { 129 | assert_eq!(Option::::parse_complete(&[0x01]), Ok(None)); 130 | assert_eq!(Option::::parse_complete(&[0x62, 0x0F]), Ok(Some(15))); 131 | 132 | assert_eq!(Option::::parse_complete(&[0x01]), Ok(None)); 133 | } 134 | 135 | #[test] 136 | fn parse_boolean() { 137 | assert_eq!(bool::parse_complete(&[0x42, 0x00]), Ok(false)); 138 | for i in 0x01..=0xFF { 139 | assert_eq!(bool::parse_complete(&[0x42, i]), Ok(true)); 140 | } 141 | } 142 | } 143 | -------------------------------------------------------------------------------- /src/parser/octet_string.rs: -------------------------------------------------------------------------------- 1 | //! An OctetString in SML is a sequence of bytes. 2 | 3 | use super::{ 4 | take_n, 5 | tlf::{Ty, TypeLengthField}, 6 | ResTy, SmlParseTlf, 7 | }; 8 | 9 | // #[cfg(feature = "alloc")] 10 | // /// OctetString is the owned version of a sequence of bytes. 11 | // pub type OctetString = alloc::vec::Vec; 12 | 13 | // #[cfg(feature = "alloc")] 14 | // impl<'i> SmlParseTlf<'i> for OctetString { 15 | // fn check_tlf(tlf: &TypeLengthField) -> bool { 16 | // OctetStr::check_tlf(tlf) 17 | // } 18 | 19 | // fn parse_with_tlf(input: &'i [u8], tlf: &TypeLengthField) -> ResTy<'i, Self> { 20 | // let (input, octet_str) = OctetStr::parse_with_tlf(input, tlf)?; 21 | // Ok((input, octet_str.to_vec())) 22 | // } 23 | // } 24 | 25 | /// OctetStr is the borrowed version of a sequence of bytes. 26 | pub type OctetStr<'i> = &'i [u8]; 27 | 28 | impl<'i> SmlParseTlf<'i> for OctetStr<'i> { 29 | fn check_tlf(tlf: &TypeLengthField) -> bool { 30 | matches!(tlf.ty, Ty::OctetString) 31 | } 32 | 33 | fn parse_with_tlf(input: &'i [u8], tlf: &TypeLengthField) -> ResTy<'i, Self> { 34 | take_n(input, tlf.len as usize) 35 | } 36 | } 37 | 38 | #[cfg(test)] 39 | mod test { 40 | 41 | use super::*; 42 | use crate::parser::SmlParse; 43 | use hex_literal::hex; 44 | 45 | #[test] 46 | fn test_octet_str() { 47 | // simple 48 | assert_eq!( 49 | OctetStr::parse_complete(&hex!("0648656C6C6F")).expect("Decode Error"), 50 | &b"Hello"[..] 51 | ); 52 | 53 | // long 54 | assert_eq!( 55 | <&[u8]>::parse_complete(b"\x81\x0Cqwertzuiopasdfghjklyxcvbnm").expect("Decode Error"), 56 | &b"qwertzuiopasdfghjklyxcvbnm"[..] 57 | ); 58 | 59 | // optional 60 | assert_eq!( 61 | Option::<&[u8]>::parse_complete(b"\x01").expect("Decode Error"), 62 | None 63 | ); 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /src/transport/mod.rs: -------------------------------------------------------------------------------- 1 | //! SML transport protocol (version 1). 2 | //! 3 | //! *Hint: This crate currently only implements version 1 of the SML transport 4 | //! protocol. If you need support for version 2, let me know!* 5 | //! 6 | //! # SML Transport Protocol - Version 1 7 | //! 8 | //! Version 1 of the SML Transport Protocol is a simple format that encodes binary messages using escape sequences. A message consists of the following parts (numbers in hex): 9 | //! 10 | //! - **Start sequence**: `1b1b1b1b 01010101` 11 | //! - **Escaped data**: The data that should be encoded. If the escape sequence (`1b1b1b1b`) occurs in the data, it is escaped by an escape sequence (`1b1b1b1b`). For example, the data `001b1b1b 1b010203` would be encoded as `001b1b1b 1b1b1b1b 1b010203`. 12 | //! - **Padding**: The data is zero-padded to the next multiple of four. Therefore, zero to three `0x00` bytes are inserted. 13 | //! - **End sequence**: `1b1b1b1b 1aXXYYZZ` 14 | //! - `XX`: number of padding bytes 15 | //! - `YY`/`ZZ`: CRC checksum 16 | //! 17 | //! ## Encoding 18 | //! 19 | //! This crate implements both a streaming and a more traditional encoder. 20 | //! 21 | //! - `encode`: takes a sequence of bytes as input and returns a buffer containing the encoded message 22 | //! - `encode_streaming`: an iterator adapter that encodes the input on the fly 23 | //! 24 | //! 25 | //! ## Decoding 26 | //! 27 | //! - `decode`: takes a sequence of bytes and decodes them into a vector of messages / errors. Requires feature "alloc". 28 | //! - `decode_streaming`: takes a sequence of bytes and returns an iterator over the decoded messages / errors. 29 | //! - using `Decoder` directly: instantiate a `Decoder` manually, call `push_byte()` on it when data becomes available. Call `finalize()` when all data has been pushed. 30 | 31 | mod decode; 32 | mod decoder_reader; 33 | mod encode; 34 | 35 | #[cfg(feature = "alloc")] 36 | pub use decode::decode; 37 | pub use decode::{decode_streaming, DecodeErr, DecodeIterator, Decoder}; 38 | pub use decoder_reader::{DecoderReader, ReadDecodedError}; 39 | pub use encode::{encode, encode_streaming, Encoder}; 40 | -------------------------------------------------------------------------------- /tests/README.md: -------------------------------------------------------------------------------- 1 | # Testing with real-world data 2 | 3 | The [`libsml-testing`](https://github.com/devZer0/libsml-testing) repository contains data dumps of many real-world smart meters. This data is included as a `git subtree` here and used for integration testing. 4 | 5 | To update the subtree, run the following git command: 6 | 7 | ```bash 8 | git subtree pull --prefix tests/libsml-testing https://github.com/devZer0/libsml-testing.git master --squash 9 | ``` -------------------------------------------------------------------------------- /tests/libsml-testing.rs: -------------------------------------------------------------------------------- 1 | use std::iter::FromIterator; 2 | use std::{ 3 | collections::HashSet, 4 | ffi::{OsStr, OsString}, 5 | }; 6 | 7 | #[test] 8 | fn test_repo_validation() { 9 | let dir = std::fs::read_dir("./tests/libsml-testing").expect("test folder does not exist"); 10 | let mut bin_filenames = HashSet::new(); 11 | let mut hex_filenames = HashSet::new(); 12 | for entry in dir { 13 | let entry = entry.unwrap().path(); 14 | match (entry.file_stem(), entry.extension().and_then(OsStr::to_str)) { 15 | (Some(name), Some("bin")) => { 16 | bin_filenames.insert(name.to_os_string()); 17 | } 18 | (Some(name), Some("hex")) => { 19 | hex_filenames.insert(name.to_os_string()); 20 | } 21 | _ => {} // ignore other files 22 | } 23 | } 24 | 25 | assert_eq!(bin_filenames, hex_filenames); 26 | 27 | if bin_filenames.is_empty() { 28 | panic!("There are no test files in tests/libsml-testing.\n") 29 | } 30 | 31 | // check that bin and hex files contain the same content 32 | for filename in bin_filenames { 33 | let path = std::path::Path::new("./tests/libsml-testing"); 34 | 35 | let bin_path = path.join(OsString::from_iter([ 36 | filename.clone(), 37 | ".bin".to_string().into(), 38 | ])); 39 | let bin_bytes = std::fs::read(bin_path).expect("Couldn't read file"); 40 | let hex_path = path.join(OsString::from_iter([filename, ".hex".to_string().into()])); 41 | let hex_string = std::fs::read_to_string(hex_path).expect("Couldn't read file"); 42 | let hex_bytes = hex::decode(hex_string.trim()).expect("Couldn't decode hex string"); 43 | 44 | assert_eq!(bin_bytes, hex_bytes); 45 | } 46 | } 47 | 48 | #[cfg(feature = "alloc")] 49 | #[test] 50 | fn test_files() { 51 | use std::fmt::Write; 52 | 53 | insta::glob!("libsml-testing/*.bin", |path| { 54 | let bytes = std::fs::read(path).unwrap(); 55 | 56 | let mut decoder = 57 | sml_rs::transport::decode_streaming::>(bytes); 58 | 59 | let mut s = String::new(); 60 | while let Some(result) = decoder.next() { 61 | // write!(s, "{:?}\n", result.map(|x| x.len())).unwrap(); 62 | write!( 63 | s, 64 | "{:#?}\n", 65 | result.map(|x| { 66 | let res = sml_rs::parser::complete::parse(x); 67 | res.expect("Error while parsing:").messages 68 | }) 69 | ) 70 | .unwrap(); 71 | } 72 | insta::assert_snapshot!(s); 73 | }); 74 | } 75 | -------------------------------------------------------------------------------- /tests/libsml-testing/.github/check.py: -------------------------------------------------------------------------------- 1 | """ 2 | Script that checks that no .bin/.hex files are missing and that these files 3 | have matching content. 4 | """ 5 | from pathlib import Path 6 | import sys 7 | 8 | bin_files = [] 9 | hex_files = [] 10 | for filename in Path(".").iterdir(): 11 | if filename.suffix == ".bin": 12 | bin_files.append(filename.stem) 13 | elif filename.suffix == ".hex": 14 | hex_files.append(filename.stem) 15 | 16 | 17 | error = False 18 | bin_files.sort() 19 | hex_files.sort() 20 | 21 | if bin_files != hex_files: 22 | # check for .bin files without corresponding .hex files 23 | for bin_file in bin_files: 24 | if bin_file not in hex_files: 25 | print("Missing .hex file for `{}`.".format(bin_file+".bin"), file=sys.stderr) 26 | error = True 27 | # check for .hex files without corresponding .bin files 28 | for hex_file in hex_files: 29 | if hex_file not in bin_files: 30 | print("Missing .bin file for `{}`.".format(hex_file+".hex"), file=sys.stderr) 31 | error = True 32 | 33 | # check that hex and bin files contain matching 34 | for filename in bin_files: 35 | if filename not in hex_files: 36 | continue 37 | bin_bytes = Path(filename+".bin").read_bytes() 38 | hex_bytes = bytes.fromhex(Path(filename+".hex").read_text()) 39 | if bin_bytes != hex_bytes: 40 | print(f"Content mismatch for {filename}.[hex/bin]:\n bin: {bin_bytes.hex()}\n hex: {hex_bytes.hex()}", file=sys.stderr) 41 | error = True 42 | 43 | if error: 44 | sys.exit(1) 45 | -------------------------------------------------------------------------------- /tests/libsml-testing/.github/workflows/ci.yaml: -------------------------------------------------------------------------------- 1 | on: [push, pull_request] 2 | 3 | name: CI 4 | 5 | jobs: 6 | check: 7 | runs-on: ubuntu-latest 8 | name: Check 9 | steps: 10 | - name: Checkout sources 11 | uses: actions/checkout@v3 12 | 13 | - name: Consistency checks 14 | run: python3 .github/check.py 15 | -------------------------------------------------------------------------------- /tests/libsml-testing/DZG_DVS-7412.2_jmberg.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/felixwrt/sml-rs/17c1a8d73c9c992bc9b4de6560de987ec47de6ae/tests/libsml-testing/DZG_DVS-7412.2_jmberg.bin -------------------------------------------------------------------------------- /tests/libsml-testing/DZG_DVS-7412.2_jmberg.hex: -------------------------------------------------------------------------------- 1 | 1B1B1B1B010101017605F12CAD07620062007263010176010102310B0A01445A47000282225E7262016505E748D7620263955C007605F22CAD07620062007263070177010B0A01445A47000282225E070100620AFFFF7262016505E748D77577070100603201010172620162006200520004445A470177070100600100FF017262016200620052000B0A01445A47000282225E0177070100010800FF641C01047262016200621E52FF65033C93890177070100020800FF017262016200621E52FF650FA49A9E0177070100100700FF017262016200621B52FE538B28010101636B99007605F32CAD076200620072630201710163D90C00001B1B1B1B1A01C3E1 -------------------------------------------------------------------------------- /tests/libsml-testing/DZG_DVS-7420.2V.G2_mtr0.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/felixwrt/sml-rs/17c1a8d73c9c992bc9b4de6560de987ec47de6ae/tests/libsml-testing/DZG_DVS-7420.2V.G2_mtr0.bin -------------------------------------------------------------------------------- /tests/libsml-testing/DZG_DVS-7420.2V.G2_mtr0.hex: -------------------------------------------------------------------------------- 1 | 1B1B1B1B0101010176057123AF01620062007263010176010102310B0A01445A4700039E2054726201648FCCB4620263379A0076057223AF01620062007263070177010B0A01445A4700039E2054070100620AFFFF726201648FCCB47577070100603201010172620162006200520004445A470177070100600100FF017262016200620052000B0A01445A4700039E20540177070100010800FF641C01047262016200621E52FF645CB0670177070100020800FF017262016200621E52FF64C149960177070100100700FF017262016200621B52FE53545F0101016308DD0076057323AF016200620072630201710163E04800001B1B1B1B1A0119671B1B1B1B0101010176057423AF01620062007263010176010102310B0A01445A4700039E2054726201648FCCB5620263EA830076057523AF -------------------------------------------------------------------------------- /tests/libsml-testing/DZG_DVS-7420.2V.G2_mtr1.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/felixwrt/sml-rs/17c1a8d73c9c992bc9b4de6560de987ec47de6ae/tests/libsml-testing/DZG_DVS-7420.2V.G2_mtr1.bin -------------------------------------------------------------------------------- /tests/libsml-testing/DZG_DVS-7420.2V.G2_mtr1.hex: -------------------------------------------------------------------------------- 1 | 1B1B1B1B010101017605D225AF01620062007263010176010102310B0A01445A4700039E2055726201648FCD5C6202630172007605D325AF01620062007263070177010B0A01445A4700039E2055070100620AFFFF726201648FCD5C7777070100603201010172620162006200520004445A470177070100600100FF017262016200620052000B0A01445A4700039E20550177070100010800FF641C00047262016200621E52FF65016723B90177070100010801FF017262016200621E52FF6405E4340177070100010802FF017262016200621E52FF6501613F850177070100020800FF017262016200621E52FF62000177070100100700FF017262016200621B52FE53026E01010163BA5B007605D425AF016200620072630201710163E806000000001B1B1B1B1A0311641B1B1B1B010101017605D525AF01620062007263010176010102310B0A01445A4700039E2055726201648FCD5D6202637317007605D625AF01620062007263070177010B0A01445A4700039E2055070100620AFFFF726201648FCD5D7777070100603201010172620162006200520004445A470177070100600100FF017262016200620052000B0A01445A4700039E20550177070100010800FF641C00047262016200621E52FF65016723B90177070100010801FF017262016200621E52FF6405E4340177070100010802FF017262016200621E52FF6501613F850177070100020800FF017262016200621E52FF62000177070100100700FF017262016200621B52FE530254010101635543007605D725AF016200620072630201710163D685000000001B1B1B1B1A0358AF1B1B1B1B010101017605D825AF01620062007263010176010102310B0A01445A4700039E2055726201648FCD5E620263BB41007605D925AF01620062007263070177010B0A01445A4700039E2055070100620AFFFF726201648FCD5E7777070100603201010172620162006200520004445A470177070100600100FF017262016200620052000B0A01445A4700039E20550177070100010800FF641C00047262016200621E52FF65016723B90177070100010801FF017262016200621E52FF6405E4340177070100010802FF017262016200621E52FF6501613F850177070100020800FF017262016200621E52FF62000177070100100700FF017262016200621B52FE53026D010101630067007605DA25AF016200620072630201710163E6E7000000001B1B1B1B1A0314151B1B1B1B010101017605DB25AF01620062007263010176010102310B0A01445A4700039E2055726201648FCD5F62026397DD007605DC25AF01620062007263070177010B0A01445A4700039E2055070100620AFFFF726201648FCD5F7777070100603201010172620162006200520004445A470177070100600100FF017262016200620052000B0A01445A4700039E20550177070100010800FF641C00047262016200621E52FF65016723B90177070100010801FF017262016200621E52FF6405E4340177070100010802FF017262016200621E52FF6501613F850177070100020800FF017262016200621E52FF62000177070100100700FF017262016200621B52FE53024301010163A2CE007605DD25AF0162006200726302017101636197000000001B1B1B1B1A035AC11B1B1B1B010101017605DE25AF01620062007263010176010102310B0A01445A4700039E2055726201648FCD60620263FF52007605DF25AF01620062007263070177010B0A01445A4700039E205507010062 -------------------------------------------------------------------------------- /tests/libsml-testing/DZG_DVS-7420.2V.G2_mtr1_error.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/felixwrt/sml-rs/17c1a8d73c9c992bc9b4de6560de987ec47de6ae/tests/libsml-testing/DZG_DVS-7420.2V.G2_mtr1_error.bin -------------------------------------------------------------------------------- /tests/libsml-testing/DZG_DVS-7420.2V.G2_mtr1_error.hex: -------------------------------------------------------------------------------- 1 | 1B1B1B1B010101017605FDFA489E205572620165016DC0456202630B5A007605FEFA48620062007263070177010B0A9E2055070100620AFFFF72620165016DC04577770701006032010101726201620062005200445A470177070100600100FF017262016200620052000B0A007262016200621E52FF65026F64E80177070100010801FF017262016200621E52FF6409C90177070100010802FF017262016200621E52FF6502659BE40177070100020800FF017262016200621E52FF62000177070100100700FF017262016200621B52FE53025701010163628C007605FFFA4801C9D21B1B1B1B01010101760500FB48620062007263010176010102310B0A9E205572620165016DC0466202633C5D00760501FB48620062007263070177010B0A9E2055070100620AFFFF72620165016DC04677770701006032010101726201620062005200445A470177070100600100FF017262016200620052000B0A007262016200621E52FF65026F64E80177070100010801FF017262016200621E52FF6409C90177070100010802FF017262016200621E52FF6502659BE40177070100020800FF017262016200621E52FF62000177070100100700FF017262016200621B52FE53027E01010163CDF700760502FB4862006200726302017101630AFB48620062007263010176010102310B0A9E205572620165016DC047620263A9F0007605FB48620062007263070177010B0A9E2055070100620AFFFF72620165016DC04777770701006032010101726201620062005200445A470177070100600100FF017262016200620052000B0A007262016200621E52FF65026F64E80177070100010801FF017262016200621E52FF6409C90177070100010802FF017262016200621E52FF6502659BE40177070100020800FF017262016200621E52FF62000177070100100700FF017262016200621B52FE5302640101016395B700760505FB48016DEC1B1B1B1B01010101760506FB48620062007263010176010102310B0A9E205572620165016DC048620263A4AB00760507FB48620062007263070177010B0A9E2055070100620AFFFF72620165016DC04877770701006032010101726201620062005200445A470177070100600100FF017262016200620052000B0A007262016200621E52FF65026F64E80177070100010801FF017262016200621E52FF6409C90177070100010802FF017262016200621E52FF6502659BE40177070100020800FF017262016200621E52FF62000177070100100700FF017262016200621B52FE53025A01010163353100760508FB4801A4C81B1B1B1B01010101760509FB48620062007263010176010102310B0A9E205572620165016DC04962026326C30076050AFB48620062007263070177010B0A9E2055070100620AFFFF72620165016DC04977770701006032010101726201620062005200445A470177070100600100FF017262016200620052000B0A007262016200621E52FF65026F64E80177070100010801FF017262016200621E52FF6409C90177070100010802FF017262016200621E52FF6502659BE40177070100020800FF017262016200621E52FF62000177070100100700FF017262016200621B52FE530270010101636A390076050BFB48017A1B1B1B1B0101010176050CFB48620062007263010176010102310B0A9E205572620165016DC04A620263883D0076050AFB48620062007263070177010B0A9E2055070100620AFFFF72620165016DC04A77770701006032010101726201620062005200445A470177070100600100FF017262016200620052000B0A007262016200621E52FF65026F64E80177070100010801FF017262016200621E52FF6409C90177070100010802FF017262016200621E52FF6502659BE40177070100020800FF017262016200621E52FF62000177070100100700FF017262016200621B52FE53027A01010163C8000076050EFB480155931B1B1B1B0101010176050FFB48620062007263010176010102310B0A9E205572620165016DC04B6202631D9000760510FB48620062007263070177010B0A9E2055070100620AFFFF72620165016DC04B77770701006032010101726201620062005200445A470177070100600100FF017262016200620052000B0A007262016200621E52FF65026F64E80177070100010801FF017262016200621E52FF6409C90100E41B1B1B1B010101017605FB48620062007263010176010102310B0A9E205572620165016DC04C620263ED8F007605FB48620062007263070177010B0A9E2055070100620AFFFF72620165016DC04C77770701006032010101726201620062005200445A470177070100600100FF017262016200620052000B0A007262016200621E52FF65026F64E80177070100010801FF017262016200621E52FF6409C90177070100010802FF017262016200621E52FF6502659BE40177070100020800FF017262016200621E52FF62000177070100100700FF017262016200621B52FE530237010101635600760514FB48FB48620062007263010176010102310B0A9E205572620165016DC04D6202637A99007605FB48620062007263070177010B0A9E2055070100620AFFFF72620165016DC04D77770701006032010101726201620062005200445A470177070100600100FF017262016200620052000B0A007262016200621E52FF65026F64E80177070100010801FF017262016200621E52FF6409C90177070100010802FF017262016200621E52FF6502659BE40177070100020800FF017262016200621E52FF62000177070100100700FF017262016200621B52FE5302880101016321DA00FB48010E9D1B1B1B1B01010101760518FB48620062007263010176010102310B0A9E205572620165016DC04E620263C11900760519FB48620062007263070177010B0A9E2055070100620AFFFF72620165016DC04E77770701006032010101726201620062005200007262016200621E52FF65026F64E80177070100010801FF017262016200621E52FF6409C9FB48 -------------------------------------------------------------------------------- /tests/libsml-testing/DZG_DVS-7420.2V.G2_mtr2.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/felixwrt/sml-rs/17c1a8d73c9c992bc9b4de6560de987ec47de6ae/tests/libsml-testing/DZG_DVS-7420.2V.G2_mtr2.bin -------------------------------------------------------------------------------- /tests/libsml-testing/DZG_DVS-7420.2V.G2_mtr2.hex: -------------------------------------------------------------------------------- 1 | 1B1B1B1B010101017605CA24AF01620062007263010176010102310B0A01445A4700039E2053726201648FCC6F6202630B44007605CB24AF01620062007263070177010B0A01445A4700039E2053070100620AFFFF726201648FCC6F7577070100603201010172620162006200520004445A470177070100600100FF017262016200620052000B0A01445A4700039E20530177070100010800FF641C00047262016200621E52FF640200E80177070100020800FF017262016200621E52FF64E4D65D0177070100100700FF017262016200621B52FE5302A501010163720B007605CC24AF016200620072630201710163F13A00001B1B1B1B1A01AAE41B1B1B1B010101017605CD24AF01620062007263010176010102310B0A01445A4700039E2053726201648FCC70620263F7B4007605CE24AF01620062007263070177010B0A01445A4700039E2053070100620AFFFF726201648FCC707577070100603201010172620162006200520004445A470177070100600100FF017262016200620052000B0A01445A4700039E20530177070100010800FF641C00047262016200621E52FF640200E80177070100020800FF017262016200621E52FF64E4D65D0177070100100700FF017262016200621B52FE5302900101016330C3007605CF24AF016200620072630201710163CFB900001B1B1B1B1A013DD31B1B1B1B010101017605D024AF01620062007263010176010102310B0A01445A4700039E2053726201648FCC71620263CCAA007605D124AF01620062007263070177010B0A01445A4700039E2053070100620AFFFF726201648FCC717577070100603201010172620162006200520004445A470177070100600100FF017262016200620052000B0A01445A4700039E20530177070100010800FF641C00047262016200621E52FF640200E80177070100020800FF017262016200621E52FF64E4D65D0177070100100700FF017262016200621B52FE53029C01010163E184007605D224AF016200620072630201710163280D00001B1B1B1B1A01E334 -------------------------------------------------------------------------------- /tests/libsml-testing/DZG_DVS-7420.2V.G2_mtr2_neg.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/felixwrt/sml-rs/17c1a8d73c9c992bc9b4de6560de987ec47de6ae/tests/libsml-testing/DZG_DVS-7420.2V.G2_mtr2_neg.bin -------------------------------------------------------------------------------- /tests/libsml-testing/DZG_DVS-7420.2V.G2_mtr2_neg.hex: -------------------------------------------------------------------------------- 1 | 1B1B1B1B0101010176051338B301620062007263010176010102310B0A01445A4700039E2053726201649128386202632F2B0076051438B301620062007263070177010B0A01445A4700039E2053070100620AFFFF726201649128387577070100603201010172620162006200520004445A470177070100600100FF017262016200620052000B0A01445A4700039E20530177070100010800FF641C69047262016200621E52FF640204E90177070100020800FF017262016200621E52FF64E4EE4D0177070100100700FF017262016200621B52FE53D6CA01010163A8900076051538B301620062007263020171016350C300001B1B1B1B1A010DE31B1B1B1B0101010176051638B301620062007263010176010102310B0A01445A4700039E205372620164912839620263F2320076051738B301620062007263070177010B0A01445A4700039E2053070100620AFFFF726201649128397577070100603201010172620162006200520004445A470177070100600100FF017262016200620052000B0A01445A4700039E20530177070100010800FF641C69047262016200621E52FF640204E90177070100020800FF017262016200621E52FF64E4EE4E0177070100100700FF017262016200621B52FE53D64A010101636A9B0076051838B301620062007263020171016360A100001B1B1B1B1A0156B71B1B1B1B0101010176051938B301620062007263010176010102310B0A01445A4700039E20537262016491283A62026395180076051A38B301620062007263070177010B0A01445A4700039E2053070100620AFFFF7262016491283A7577070100603201010172620162006200520004445A470177070100600100FF017262016200620052000B0A01445A4700039E20530177070100010800FF641C69047262016200621E52FF640204E90177070100020800FF017262016200621E52FF64E4EE4E0177070100100700FF017262016200621B52FE53D73A0101016371820076051B38B30162006200726302017101635E2200001B1B1B1B1A014BA01B1B1B1B0101010176051C38B301620062007263010176010102310B0A01445A4700039E20537262016491283B62026348010076051D38B301620062007263070177010B0A01445A4700039E2053070100620AFFFF7262016491283B7577070100603201010172620162006200520004445A470177070100600100FF017262016200620052000B0A01445A4700039E20530177070100010800FF641C69047262016200621E52FF640204E90177070100020800FF017262016200621E52FF64E4EE4E017707010010 -------------------------------------------------------------------------------- /tests/libsml-testing/DrNeuhaus_SMARTY_ix-130.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/felixwrt/sml-rs/17c1a8d73c9c992bc9b4de6560de987ec47de6ae/tests/libsml-testing/DrNeuhaus_SMARTY_ix-130.bin -------------------------------------------------------------------------------- /tests/libsml-testing/EMH-ED300L_consumption.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/felixwrt/sml-rs/17c1a8d73c9c992bc9b4de6560de987ec47de6ae/tests/libsml-testing/EMH-ED300L_consumption.bin -------------------------------------------------------------------------------- /tests/libsml-testing/EMH-ED300L_delivery.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/felixwrt/sml-rs/17c1a8d73c9c992bc9b4de6560de987ec47de6ae/tests/libsml-testing/EMH-ED300L_delivery.bin -------------------------------------------------------------------------------- /tests/libsml-testing/EMH-ED300L_delivery.hex: -------------------------------------------------------------------------------- 1 | 1B0107165336620063010107166505064D0171CD0163DC07165337000063770B454802564501626565F47781C70301044D0107000001010B45480256CD070008FF01011E004714770101016252560A2D0107010201625256000001070007FF011B52000401078182FF01010230EFA3DC460527CB80B2FD7A16B286B13C194298DBA00163497600160F62627202716383001B1B1A211B1B01010716533C620063010107166505454802564501567600040F62627263770B4548025645016565F87781C70301014548770100000101064D0171CD7701010063B0621E004714770101016252560A2D010708FF011EFF000077010F0001625200B97781C7050183E85118880B0527CB80B2FD7A16B286B13C19429806010167000716400000630101C11B1B1AED1B1B0101071653426262720176071665054548025645014807165343000063014548025645016565FC7781C703010104454D480107000001010B454802CD070008FF01011E00471477010101011EFF004714770708FF011EFF000001070007FF011B5200040181C705010102A3460527CB80B2FD7A1674D0DB571942980601012F00071653460000630101B6001B1B01501B1B01010716534862630101071665054D0171CD0163A10716534900006301064D0171CD010F9D770781820301044D01070000FF0101064D0171CD070008FF01011E004714770101016252560A2D010708FF011EFF000077010F000162520401078182FF0183E85118880B052FB9CBA3959C501627B286B13C1942980601014B0007166262720271633E1B1B1A0E1B1B01017600040F6272017601000F05454802564501280716534F00006301064D0171CD016565057781C7030101454877010000010101CD070008FF01011E00471477010101011EFF004714770708FF011EFF000001070007FF011B52000401078182FF0183E85118880B0527CB80B2FD7A1674D0DB57BE384298A00163B0760016520000630101A61B1B1A371B1B0101071653546272017601000F05454802564501F507165355000063770B454802564501010F9D770781820301044D010700000101064D0171CD070008FF01011E00471477010101011EFF004714770708FF011EFF000001070007FF011B5200047781C70501010230EFA3DC46052FB9CBA3959C501674D0DB57BE384298DBA001634F7600165800006301012E001B1B01AD1B1B01017600040F620063010107166505064D0171CD01635F0716535B0000630101064D0171CD01010F9D7707818203010145487701000001010B45480256CD7701010063B0621E560A2D01070008016252560A2D010701020162525600000077010F00016252000401078182FF01010230EFA3DC46052FB9CBA3959C501674D0DB57BE384298DBA00163E57600165E000063010159001B1B01BF1B1B017600040F6272017601000F05454802564501270716536100006301064D025645016565127781C70301044D010700000101064D0171CD070008FF01621E004714770101016252560A2D010708FF011EFF000077010F00016252000401078182FF0183E85118880B0527CB80B2FD7A16B286B13C194298060101D10007166400006301011E1B1B1A011B0101071653666200630101071665050B454802564501AE0716536700006301064D0171CD01010F9D7707818203010145487701000009FF010101010B06454D4801027156CD450177070100010800FF6301B001621E52FF56000A472D140177070100010801FF0101621E52FF56000A472D140177070100010802FF0101621E52FF56000000000001770701000F0700FF0101621B52FF55000005130177078181C78205FF010101018302E83051EF18A388DC0B4605DBFF2F27B9CBCB80A3B295FD9C7A5016D42774B2D086DBB1573CBE193842429840EDDB06A0010101636AE4007607001604530F6A6200620072630201710163C37000001B1B1B1B1A01CB2A1B1B1B1B010101017607001604530F6C62006200726301017601010700160F6505240B06454D4801027156CD4501016324A8007607001604530F6D620062007263070177010B06454D4801027156CD4501726201650F659D1B7777078181C78203FF0101010104454D480177070100000009FF010101010B06454D4801027156CD450177070100010800FF6301B001621E52FF56000A472D140177070100010801FF0101621E52FF56000A472D140177070100010802FF0101621E52FF56000000000001770701000F0700FF0101621B52FF55000004F20177078181C78205FF010101018302E83051EF18A388DC0B4605DBFF2F27B9CBCB80A3B295FD9C7A5016D42774B2D086DBB1573CBE193842429840EDDB06A0010101639803007607001604530F7062006200726302017101630E1600001B1B1B1B1A0114D81B1B1B1B010101017607001604530F7262006200726301017601010700160F6505260B06454D4801027156CD45010163D983007607001604530F73620062007263070177010B06454D4801027156CD4501726201650F659D1F7777078181C78203FF0101010104454D480177070100000009FF010101010B06454D4801027156CD450177070100010800FF6301B001621E52FF56000A472D140177070100010801FF0101621E52FF56000A472D140177070100010802FF0101621E52FF56000000000001770701000F0700FF0101621B52FF55000004F10177078181C78205FF010101018302E83051EF18A388DC0B4605DBFF2F27B9CBCB80A3B295FD9C7A5016D42774B2D086DBB1573CBE193842429840EDDB06A001010163A1F7007607001604530F76620062007263020171016379E300001B1B1B1B1A012BE41B1B1B0101071653786272017601000F05454802564501300716537900006301064D0171CD016565247781C703014548770100000101064D0171CD01010063B0621E004714770101016252560A2D01070102016252560077010F0001625200E67781C7050183E85118880B0527CB80B2FD7A1674D0DB57BE38429840EDDB06A00101016327B900760700167C6272027163F11B1B1AA21B1B01010716537E6272017601000F05454802564501B97600040F62627263770B4548025645016565287781C70301044D010700000101064D0171CD070008FF01011E0A2D010700080114770708FF011EFF000077010F0001625200F47781C7050183E85118880B05B9CBA3959C5016B286B13C19429806010187000716820000630101FD1B1B1A811B01017600040F6272017601000F05064D0171CD01631D7600040F62627263770B4548024501010F9D770781820301044D0107000001010B45480256CD7701010063B0621E560A2D0107000801011EFF0047147707010201625256000001070007FF011B52000401078182FF0183E85118880B0527CBA3959C501674D0DB57BE384298DBA001638D760016880000630101751B1B1AE81B1B01017600040F6272017601000F050B454802564501B763770B454802564501010F9D770781820301044D0107000001010B45480256CD070008FF01011E004714770101016252560A2D010708FF011EFF000077010F0001625200B57781C7050183E85118880B0527CB80B2FD7A16B286B13C1942980601015F0007168E0000630101021B1B1AF41B1B01017600040F620063010107166505064D0171CD01DE7600040F62627263770B4548025601010F9D7707818203010145487701000001010B45480256CD770008FF01011E560A2D77010101011EFF004714770701020162525600000107000701625200997781C70501010230EFA3DC052FB9CBA3959C501674D0DB57BE384298DBA00163987600160F626272027163CF001B1B01B81B1B0101071653966272017601000F05064D0171CD0163577600040F62627263770B4548025645016565397781C70301044D010700000101064D0171CD070008FF01011E00471477010101011EFF004714770708FF011EFF000077010F0001625200317781C7050183E85118880B0527CB80B29C50167486B13C194298060101C70007160F6262630101121B1B1A0D1B1B01017600040F6200160F05454802564501DD0716539D00726301064D0171CD0165653E7781C70301044D010700000101064D0171CD070008FF01011E560A2D01070008016252560A2D010708FF011EFF000077010F0001625200BC7781C7050183E85118880B0527CB80B2FD7A16B286B13C194298060101D4000716A00000630101551B1B1A2C1B1B0101071653A26272017601000F05450171CD01638E071653A300006301064D0171CD016565427781C70301044D010700000101064D0171CD070008FF01011E004714770101016252560A2D010708FF011EFF000077010F0001625200B97781C7050183E85118880B052FB9CBA3FD7A16B286B13C19429806010142000716A60000630101221B1B1AE11B1B01017600040F6200630101071665050B454802564501677600040F6262726301064D0171CD01010F9D7707818203010145487701000001010B45480256CD070008FF01011E0047147701010162520047147707010201625256000001070007FF011B52000501078182FF0183E85118880B0527CBA3959C5016B286B13C194298DBA0010000160F626272027163AA1B1B1A291B1B0101071653AE620063010107166505064D01564501EE7600040F62627263770B454802564501010F9D770781820301014548770100000101064D0171CD7701010063B0621E560A2D0107000801011EFF00471477070008FF011EFF000001070007FF011B52C70501010230EFA3DC46052FB9CBA3959C5016B286B13C194298ED0601019B000716B20000630101321B1B1AB21B1B0101071653B4620063010107166505064D0171CD016333071653B5000063770B454802564501010F9D77078182030101044D0107000001010B45CD7701010063B0621E56471477010101011EFF004714770708FF011EFF000077010F0001625200050181C7050183E85118880B0527CB80B2FD7A16B286B13C194298DBA001631D7600160F626272027163BA001B1B01F01B0101071653BA62006301010716650545480256450199071653BB00006301064D0171CD01010F9D770781820301044D010700000101064D0171CD7701010063B0621E560A2D0107000801011EFF0047147707010201625256000001070007FF011B52000401078182FF01010230EFA3DC46052FB9CBA3959C5016B286B13C19429806010119000716BE0000630101CD001B1B018A1B1B010062006200726301017601010700160F6505400B06454D4801027156CD45010163C335007607001604530FC1620062007263070177010B06454D4801027156CD4501726201650F659D587777078181C78203FF0101010104454D4801770701000000027156CD450177070100010800FF6301B001621E52FF56000A472D140177070100010801FF0101621E52FF56000A472D140177070100010802FF0101621E52FF56000000000001770701000F0700FF0101621B52FF55000005150177078181C78205FF010101018302E83051EF18A388DC0B4605DBFF2F27B9CBCB80A3B295FD9C7A5016D42774B2D086DBB1573CBE193842429840EDDB06A00101016306C8007607001604530FC462006200726302017101638F4900001B1B1B1B1A011D051B1B1B1B010101017607001604530FC6 -------------------------------------------------------------------------------- /tests/libsml-testing/EMH_eHZ-GW8E2A500AK2.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/felixwrt/sml-rs/17c1a8d73c9c992bc9b4de6560de987ec47de6ae/tests/libsml-testing/EMH_eHZ-GW8E2A500AK2.bin -------------------------------------------------------------------------------- /tests/libsml-testing/EMH_eHZ-GW8E2A500AK2.hex: -------------------------------------------------------------------------------- 1 | 1B1B1B1B010101017607004300001D256200620072630101760101070043044D09B7093032323830383136010163F8CC007607004300001D26620062007263070177010930323238303831360172620165044DE7ED7677078181C78203FF0101010104454D480177070100000000FF010101010930323238303831360177070100010801FF63018001621E52FF560008D203490177070100010802FF63018001621E52FF560000004E9C01770700006001FFFF010101010B303030323238303831360177070100010700FF0101621B52FF550000008A010101635D81007607004300001D276200620072630201710163C18000001B1B1B1B1A01443A1B1B1B1B010101017607004300001D286200620072630101760101070043044D09B80930323238303831360101633AE8007607004300001D29620062007263070177010930323238303831360172620165044DE7F07677078181C78203FF0101010104454D480177070100000000FF010101010930323238303831360177070100010801FF63018201621E52FF560008D2034A0177070100010802FF63018201621E52FF560000004E9C01770700006001FFFF010101010B303030323238303831360177070100010700FF0101621B52FF5500000093010101632545007607004300001D2A6200620072630201710163AF3700001B1B1B1B1A01354D1B1B1B1B010101017607004300001D2B6200620072630101760101070043044D09B90930323238303831360101637A0C007607004300001D2C620062007263070177010930323238303831360172620165044DE7F57677078181C78203FF0101010104454D480177070100000000FF010101010930323238303831360177070100010801FF63018001621E52FF560008D2034A0177070100010802FF63018001621E52FF560000004E9C01770700006001FFFF010101010B303030323238303831360177070100010700FF0101621B52FF550000009501010163485A007607004300001D2D6200620072630201710163499700001B1B1B1B1A01D5081B1B1B1B010101017607004300001D2E6200620072630101760101070043044D09BA093032323830383136010163AB28007607004300001D2F620062007263070177010930323238303831360172620165044DE7F97677078181C78203FF0101010104454D480177070100000000FF010101010930323238303831360177070100010801FF63018001621E52FF560008D2034A0177070100010802FF63018001621E52FF560000004E9C01770700006001FFFF010101010B303030323238303831360177070100010700FF0101621B52FF550000008E010101631B9F007607004300001D306200620072630201710163625100001B1B1B1B1A0134D31B1B1B1B010101017607004300001D316200620072630101760101070043044D09BB093032323830383136010163BC5F007607004300001D32620062007263070177010930323238303831360172620165044DE7FD7677078181C78203FF0101010104454D480177070100000000FF010101010930323238303831360177070100010801FF63018001621E52FF560008D2034A0177070100010802FF63018001621E52FF560000004E9C01770700006001FFFF010101010B303030323238303831360177070100010700FF0101621B52FF5500000094010101635B8A007607004300001D336200620072630201710163D1AF00001B1B1B1B1A01D18E1B1B1B1B010101017607004300001D346200620072630101760101070043044D09BC0930323238303831360101631B7E007607004300001D35620062007263070177010930323238303831360172620165044DE8027677078181C78203FF0101010104454D480177070100000000FF010101010930323238303831360177070100010801FF63018001621E52FF560008D2034A0177070100010802FF63018001621E52FF560000004E9C01770700006001FFFF010101010B303030323238303831360177070100010700FF0101621B52FF5500000091010101636BE2007607004300001D36620062007263020171016315A400001B1B1B1B1A0143861B1B1B1B010101017607004300001D376200620072630101760101070043044D09BD0930323238303831360101635B9A007607004300001D38620062007263070177010930323238303831360172620165044DE8067677078181C78203FF0101010104454D480177070100000000FF010101010930323238303831360177070100010801FF63018001621E52FF560008D2034A0177070100010802FF63018001621E52FF560000004E9C01770700006001FFFF010101010B303030323238303831360177070100010700FF0101621B52FF550000009201010163FE55007607004300001D39620062007263020171016359B800001B1B1B1B1A011D5C1B1B1B1B010101017607004300001D3A6200620072630101760101070043044D09BE09303232383038313601016303B1007607004300001D3B620062007263070177010930323238303831360172620165044DE8097677078181C78203FF0101010104454D480177070100000000FF010101010930323238303831360177070100010801FF63018201621E52FF560008D2034B0177070100010802FF63018201621E52FF560000004E9C01770700006001FFFF010101010B303030323238303831360177070100010700FF0101621B52FF5500000094010101638DB4007607004300001D3C62006200726302017101639DB300001B1B1B1B1A01AE7F1B1B1B1B010101017607004300001D3D6200620072630101760101070043044D09BF0930323238303831360101638FD6007607004300001D3E620062007263070177010930323238303831360172620165044DE80D7677078181C78203FF0101010104454D480177070100000000FF010101010930323238303831360177070100010801FF63018001621E52FF560008D2034B0177070100010802FF63018001621E52FF560000004E9C01770700006001FFFF010101010B303030323238303831360177070100010700FF0101621B52FF55000000910101016338BE007607004300001D3F62006200726302017101632E4D00001B1B1B1B1A0195D11B1B1B1B010101017607004300001D406200620072630101760101070043044D09C00930323238303831360101633BC6007607004300001D41620062007263070177010930323238303831360172620165044DE8117677078181C78203FF0101010104454D480177070100000000FF010101010930323238303831360177070100010801FF63018001621E52FF560008D2034B0177070100010802FF63018001621E52FF560000004E9C01770700006001FFFF010101010B303030323238303831360177070100010700FF0101621B52FF5500000090010101635B85007607004300001D4262006200726302017101638AA400001B1B1B1B1A01A46D1B1B1B1B010101017607004300001D436200620072630101760101070043044D09C10930323238303831360101637B22007607004300001D44620062007263070177010930323238303831360172620165044DE8167677078181C78203FF0101010104454D480177070100000000FF010101010930323238303831360177070100010801FF63018001621E52FF560008D2034B0177070100010802FF63018001621E52FF560000004E9C01770700006001FFFF010101010B303030323238303831360177070100010700FF0101621B52FF55000000920101016349B6007607004300001D4562006200726302017101636C0400001B1B1B1B1A018B951B1B1B1B010101017607004300001D466200620072630101760101070043044D09C2093032323830383136010163AA06007607004300001D47620062007263070177010930323238303831360172620165044DE81A7677078181C78203FF0101010104454D480177070100000000FF010101010930323238303831360177070100010801FF63018001621E52FF560008D2034B0177070100010802FF63018001621E52FF560000004E9C01770700006001FFFF010101010B303030323238303831360177070100010700FF0101621B52FF550000009401010163343B007607004300001D48620062007263020171016302B300001B1B1B1B1A0122721B1B1B1B010101017607004300001D496200620072630101760101070043044D09C3093032323830383136010163AF6E007607004300001D4A620062007263070177010930323238303831360172620165044DE81E7677078181C78203FF0101010104454D480177070100000000FF010101010930323238303831360177070100010801FF63018001621E52FF560008D2034B0177070100010802FF63018001621E52FF560000004E9C01770700006001FFFF010101010B303030323238303831360177070100010700FF0101621B52FF550000009201010163F6E2007607004300001D4B6200620072630201710163B14D00001B1B1B1B1A01DD931B1B1B1B010101017607004300001D4C6200620072630101760101070043044D09C4093032323830383136010163084F007607004300001D4D620062007263070177010930323238303831360172620165044DE8217677078181C78203FF0101010104454D480177070100000000FF010101010930323238303831360177070100010801FF63018201621E52FF560008D2034C0177070100010802FF63018201621E52FF560000004E9C01770700006001FFFF010101010B303030323238303831360177070100010700FF0101621B52FF55000000940101016319C7007607004300001D4E6200620072630201710163754600001B1B1B1B1A0170191B1B1B1B010101017607004300001D4F6200620072630101760101070043044D09C509303232383038313601016348AB007607004300001D50620062007263070177010930323238303831360172620165044DE8267677078181C78203FF0101010104454D480177070100000000FF010101010930323238303831360177070100010801FF63018001621E52FF560008D2034C0177070100010802FF63018001621E52FF560000004E9C01770700006001FFFF010101010B303030323238303831360177070100010700FF0101621B52FF5500000092010101634AE8007607004300001D5162006200726302017101637C2B00001B1B1B1B1A01C21A1B1B1B1B010101017607004300001D526200620072630101760101070043044D09C6093032323830383136010163029F007607004300001D53620062007263070177010930323238303831360172620165044DE82A7677078181C78203FF0101010104454D480177070100000000FF010101010930323238303831360177070100010801FF63018001621E52FF560008D2034C0177070100010802FF63018001621E52FF560000004E9C01770700006001FFFF010101010B303030323238303831360177070100010700FF0101621B52FF550000009001010163DB17007607004300001D546200620072630201710163B82000001B1B1B1B1A0140E51B1B1B1B010101017607004300001D556200620072630101760101070043044D09C70930323238303831360101638EF8007607004300001D5662006200726307 -------------------------------------------------------------------------------- /tests/libsml-testing/EMH_eHZ-HW8E2A5L0EK2P.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/felixwrt/sml-rs/17c1a8d73c9c992bc9b4de6560de987ec47de6ae/tests/libsml-testing/EMH_eHZ-HW8E2A5L0EK2P.bin -------------------------------------------------------------------------------- /tests/libsml-testing/EMH_eHZ-HW8E2A5L0EK2P.hex: -------------------------------------------------------------------------------- 1 | 1B1B1B1B01010101760700280482F5B6620062007263010176010107002806EAFC920B06454D4801027153C8C6010163DC0000760700280482F5B7620062007263070177010B06454D4801027153C8C6017262016506EA2F7A7777078181C78203FF0101010104454D480177070100000009FF010101010B06454D4801027153C8C60177070100010800FF63018201621E52FF5600050076C80177070100010801FF0101621E52FF560005006EEC0177070100010802FF0101621E52FF5600000007DC01770701000F0700FF0101621B52FF55000006630177078181C78205FF01010101830228ABDBF441A5EF6335EC38BD9C0E0A79030DA5F4A4D7395F6952EF7A0B0FF3FCD137F866D114154CF0A95242DEAAB17D010101631BC700760700280482F5BA62006200726302017101632B6D00001B1B1B1B1A01C5351B1B1B1B01010101760700280482F5BC620062007263010176010107002806EAFC940B06454D4801027153C8C6010163564300760700280482F5BD620062007263070177010B06454D4801027153C8C6017262016506EA2F7D7777078181C78203FF0101010104454D480177070100000009FF010101010B06454D4801027153C8C60177070100010800FF63018201621E52FF5600050076C90177070100010801FF0101621E52FF560005006EED0177070100010802FF0101621E52FF5600000007DC01770701000F0700FF0101621B52FF55000006610177078181C78205FF01010101830228ABDBF441A5EF6335EC38BD9C0E0A79030DA5F4A4D7395F6952EF7A0B0FF3FCD137F866D114154CF0A95242DEAAB17D0101016345C300760700280482F5C06200620072630201710163692400001B1B1B1B1A01A4EF1B1B1B1B01010101760700280482F5C2620062007263010176010107002806EAFC960B06454D4801027153C8C601016348C500760700280482F5C3620062007263070177010B06454D4801027153C8C6017262016506EA2F7F7777078181C78203FF0101010104454D480177070100000009FF010101010B06454D4801027153C8C60177070100010800FF63018201621E52FF5600050076CA0177070100010801FF0101621E52FF560005006EEE0177070100010802FF0101621E52FF5600000007DC01770701000F0700FF0101621B52FF55000006620177078181C78205FF01010101830228ABDBF441A5EF6335EC38BD9C0E0A79030DA5F4A4D7395F6952EF7A0B0FF3FCD137F866D114154CF0A95242DEAAB17D01010163130E00760700280482F5C662006200726302017101631ED100001B1B1B1B1A01CB5B1B1B1B1B01010101760700280482F5C8620062007263010176010107002806EAFC980B06454D4801027153C8C6010163A16900760700280482F5C9620062007263070177010B06454D4801027153C8C6017262016506EA2F817777078181C78203FF0101010104454D480177070100000009FF010101010B06454D4801027153C8C60177070100010800FF63018201621E52FF5600050076CB0177070100010801FF0101621E52FF560005006EEF0177070100010802FF0101621E52FF5600000007DC01770701000F0700FF0101621B52FF55000006640177078181C78205FF01010101830228ABDBF441A5EF6335EC38BD9C0E0A79030DA5F4A4D7395F6952EF7A0B0FF3FCD137F866D114154CF0A95242DEAAB17D01010163FA4F00760700280482F5CC620062007263020171016396C600001B1B1B1B1A01F3811B1B1B1B01010101760700280482F5CE620062007263010176010107002806EAFC9A0B06454D4801027153C8C601016328AF00760700280482F5CF620062007263070177010B06454D4801027153C8C6017262016506EA2F837777078181C78203FF0101010104454D480177070100000009FF010101010B06454D4801027153C8C60177070100010800FF63018201621E52FF5600050076CC0177070100010801FF0101621E52FF560005006EF00177070100010802FF0101621E52FF5600000007DC01770701000F0700FF0101621B52FF55000006640177078181C78205FF01010101830228ABDBF441A5EF6335EC38BD9C0E0A79030DA5F4A4D7395F6952EF7A0B0FF3FCD137F866D114154CF0A95242DEAAB17D010101635FAF00760700280482F5D262006200726302017101630EFE00001B1B1B1B1A01E3EA1B1B1B1B01010101760700280482F5D4620062007263010176010107002806EAFC9C0B06454D4801027153C8C6010163F5A200760700280482F5D5620062007263070177010B06454D4801027153C8C6017262016506EA2F857777078181C78203FF0101010104454D480177070100000009FF010101010B06454D4801027153C8C60177070100010800FF63018201621E52FF5600050076CD0177070100010801FF0101621E52FF560005006EF10177070100010802FF0101621E52FF5600000007DC01770701000F0700FF0101621B52FF55000006610177078181C78205FF01010101830228ABDBF441A5EF6335EC38BD9C0E0A79030DA5F4A4D7395F6952EF7A0B0FF3FCD137F866D114154CF0A95242DEAAB17D0101016352FC00760700280482F5D8620062007263020171016386E900001B1B1B1B1A0110FE1B1B1B1B01010101760700280482F5DA620062007263010176010107002806EAFC9E0B06454D4801027153C8C60101635FC700760700280482F5DB620062007263070177010B06454D4801027153C8C6017262016506EA2F887777078181C78203FF0101010104454D480177070100000009FF010101010B06454D4801027153C8C60177070100010800FF63018201621E52FF5600050076CE0177070100010801FF0101621E52FF560005006EF20177070100010802FF0101621E52FF5600000007DC01770701000F0700FF0101621B52FF55000006750177078181C78205FF01010101830228ABDBF441A5EF6335EC38BD9C0E0A79030DA5F4A4D7395F6952EF7A0B0FF3FCD137F866D114154CF0A95242DEAAB17D01010163CEE200760700280482F5DE6200620072630201710163F11C00001B1B1B1B1A01AB1C1B1B1B1B01010101760700280482F5E0620062007263010176010107002806EAFCA00B06454D4801027153C8C601016327CA00760700280482F5E1620062007263070177010B06454D4801027153C8C6017262016506EA2F8A7777078181C78203FF0101010104454D480177070100000009FF010101010B06454D4801027153C8C60177070100010800FF63018201621E52FF5600050076CF0177070100010801FF0101621E52FF560005006EF30177070100010802FF0101621E52FF5600000007DC01770701000F0700FF0101621B52FF550000067A0177078181C78205FF01010101830228ABDBF441A5EF6335EC38BD9C0E0A79030DA5F4A4D7395F6952EF7A0B0FF3FCD137F866D114154CF0A95242DEAAB17D0101016366C000760700280482F5E46200620072630201710163B69800001B1B1B1B1A0195501B1B1B1B01010101760700280482F5E6620062007263010176010107002806EAFCA20B06454D4801027153C8C6010163AE0C00760700280482F5E7620062007263070177010B06454D4801027153C8C6017262016506EA2F8C7777078181C78203FF0101010104454D480177070100000009FF010101010B06454D4801027153C8C60177070100010800FF63018201621E52FF5600050076D00177070100010801FF0101621E52FF560005006EF40177070100010802FF0101621E52FF5600000007DC01770701000F0700FF0101621B52FF55000006640177078181C78205FF01010101830228ABDBF441A5EF6335EC38BD9C0E0A79030DA5F4A4D7395F6952EF7A0B0FF3FCD137F866D114154CF0A95242DEAAB17D010101638F9D00760700280482F5EA62006200726302017101636BD100001B1B1B1B1A01C3F51B1B1B1B01010101760700280482F5EC620062007263010176010107002806EAFCA40B06454D4801027153C8C6010163244F00760700280482F5ED620062007263070177010B06454D4801027153C8C6017262016506EA2F8E7777078181C78203FF0101010104454D480177070100000009FF010101010B06454D4801027153C8C60177070100010800FF63018201621E52FF5600050076D10177070100010801FF0101621E52FF560005006EF50177070100010802FF0101621E52FF5600000007DC01770701000F0700FF0101621B52FF55000006690177078181C78205FF01010101830228ABDBF441A5EF6335EC38BD9C0E0A79030DA5F4A4D7395F6952EF7A0B0FF3FCD137F866D114154CF0A95242DEAAB17D01010163DCFE00760700280482F5F06200620072630201710163A6B700001B1B1B1B1A01E1961B1B1B1B01010101760700280482F5F2620062007263010176010107002806EAFCA60B06454D4801027153C8C6010163D96400760700280482F5F3620062007263070177010B06454D4801027153C8C6017262016506EA2F907777078181C78203FF0101010104454D480177070100000009FF010101010B06454D4801027153C8C60177070100010800FF63018201621E52FF5600050076D20177070100010801FF0101621E52FF560005006EF60177070100010802FF0101621E52FF5600000007DC01770701000F0700FF0101621B52FF55000006600177078181C78205FF01010101830228ABDBF441A5EF6335EC38BD9C0E0A79030DA5F4A4D7395F6952EF7A0B0FF3FCD137F866D114154CF0A95242DEAAB17D01010163EC5D00760700280482F5F66200620072630201710163D14200001B1B1B1B1A01F1A81B1B1B1B01010101760700280482F5F8620062007263010176010107002806EAFCA80B06454D4801027153C8C601016330C800760700280482F5F9620062007263070177010B06454D4801027153C8C6017262016506EA2F937777078181C78203FF0101010104454D480177070100000009FF010101010B06454D4801027153C8C60177070100010800FF63018201621E52FF5600050076D30177070100010801FF0101621E52FF560005006EF70177070100010802FF0101621E52FF5600000007DC01770701000F0700FF0101621B52FF55000006690177078181C78205FF01010101830228ABDBF441A5EF6335EC38BD9C0E0A79030DA5F4A4D7395F6952EF7A0B0FF3FCD137F866D114154CF0A95242DEAAB17D010101636E4600760700280482F5FC6200620072630201710163595500001B1B1B1B1A01F6B71B1B1B1B01010101760700280482F5FE620062007263010176010107002806EAFCAA0B06454D4801027153C8C6010163B90E00760700280482F5FF620062007263070177010B06454D4801027153C8C6017262016506EA2F957777078181C78203FF0101010104454D480177070100000009FF010101010B06454D4801027153C8C60177070100010800FF63018201621E52FF5600050076D40177070100010801FF0101621E52FF560005006EF80177070100010802FF0101621E52FF5600000007DC01770701000F0700FF0101621B52FF550000066B0177078181C78205FF01010101830228ABDBF441A5EF6335EC38BD9C0E0A79030DA5F4A4D7395F6952EF7A0B0FF3FCD137F866D114154CF0A95242DEAAB17D01010163375200760700280482F6026200620072630201710163 -------------------------------------------------------------------------------- /tests/libsml-testing/EMH_eHZ-HW8E2A5L0EK2P_1.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/felixwrt/sml-rs/17c1a8d73c9c992bc9b4de6560de987ec47de6ae/tests/libsml-testing/EMH_eHZ-HW8E2A5L0EK2P_1.bin -------------------------------------------------------------------------------- /tests/libsml-testing/EMH_eHZ-HW8E2A5L0EK2P_2.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/felixwrt/sml-rs/17c1a8d73c9c992bc9b4de6560de987ec47de6ae/tests/libsml-testing/EMH_eHZ-HW8E2A5L0EK2P_2.bin -------------------------------------------------------------------------------- /tests/libsml-testing/EMH_eHZ-HW8E2A5L0EK2P_2.hex: -------------------------------------------------------------------------------- 1 | 1B1B1B1B01010101760700190055E90062006200726301017601010700190EA6A3000B06454D4801027158205101016388C200760700190055E901620062007263070177010B06454D4801027158205101726201650EA6E0AC7777078181C78203FF0101010104454D480177070100000009FF010101010B06454D480102715820510177070100010800FF63018201621E52FF560007EF52F10177070100010801FF0101621E52FF560007EF52F10177070100010802FF0101621E52FF56000000000001770701000F0700FF0101621B52FF55000005720177078181C78205FF01010101830219921A526564ACBAE3026E61352675EC28276683F02DBB32FA701E3A753B34218B6466B15064DF5919F9F13F84B5B2C90101016340B600760700190055E9046200620072630201710163AE8C00001B1B1B1B1A018BDD -------------------------------------------------------------------------------- /tests/libsml-testing/EMH_eHZ-HW8E2AWL0EK2P.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/felixwrt/sml-rs/17c1a8d73c9c992bc9b4de6560de987ec47de6ae/tests/libsml-testing/EMH_eHZ-HW8E2AWL0EK2P.bin -------------------------------------------------------------------------------- /tests/libsml-testing/EMH_eHZ-HW8E2AWL0EK2P.hex: -------------------------------------------------------------------------------- 1 | 1B1B1B1B010101017607001906406FC86200620072630101760101070019070A7A980A01A815986480020102010163F210007607001906406FC9620062007263070177010A01A8159864800201020172620165070AA24D7777078181C78203FF0101010104454D480177070100000009FF010101010A01A8159864800201020177070100010800FF63018201621E52FF56000334B19E0177070100010801FF0101621E52FF56000334B19E0177070100010802FF0101621E52FF56000000000001770701000F0700FF0101621B52FF550000077F0177078181C78205FF010101018302C2FB2883402AD87C9EA27ACCFD0428206FBD06566BA7957C5EB0DE5054A440ABD55A6D94D677176FDDF805C23F8DEF1E010101639A17007607001906406FCC6200620072630201710163B381001B1B1B1B1A00893A1B1B1B1B010101017607001906406FCE6200620072630101760101070019070A7A9A0A01A8159864800201020101633295007607001906406FCF620062007263070177010A01A8159864800201020172620165070AA24F7777078181C78203FF0101010104454D480177070100000009FF010101010A01A8159864800201020177070100010800FF63018201621E52FF56000334B19F0177070100010801FF0101621E52FF56000334B19F0177070100010802FF0101621E52FF56000000000001770701000F0700FF0101621B52FF550000076E0177078181C78205FF010101018302C2FB2883402AD87C9EA27ACCFD0428206FBD06566BA7957C5EB0DE5054A440ABD55A6D94D677176FDDF805C23F8DEF1E010101632AA0007607001906406FD262006200726302017101632BB9001B1B1B1B1A002B191B1B1B1B010101017607001906406FD46200620072630101760101070019070A7A9C0A01A815986480020102010163EF20007607001906406FD5620062007263070177010A01A8159864800201020172620165070AA2517777078181C78203FF0101010104454D480177070100000009FF010101010A01A8159864800201020177070100010800FF63018201621E52FF56000334B1A00177070100010801FF0101621E52FF56000334B1A00177070100010802FF0101621E52FF56000000000001770701000F0700FF0101621B52FF55000007750177078181C78205FF010101018302C2FB2883402AD87C9EA27ACCFD0428206FBD06566BA7957C5EB0DE5054A440ABD55A6D94D677176FDDF805C23F8DEF1E01010163DC25007607001906406FD86200620072630201710163A3AE001B1B1B1B1A00C6C71B1B1B1B010101017607001906406FDA6200620072630101760101070019070A7A9E0A01A815986480020102010163E9BC007607001906406FDB620062007263070177010A01A8159864800201020172620165070AA2537777078181C78203FF0101010104454D480177070100000009FF010101010A01A8159864800201020177070100010800FF63018201621E52FF56000334B1A10177070100010801FF0101621E52FF56000334B1A10177070100010802FF0101621E52FF56000000000001770701000F0700FF0101621B52FF55000007720177078181C78205FF010101018302C2FB2883402AD87C9EA27ACCFD0428206FBD06566BA7957C5EB0DE5054A440ABD55A6D94D677176FDDF805C23F8DEF1E0101016379CC007607001906406FDE6200620072630201710163D45B001B1B1B1B1A0002141B1B1B1B010101017607001906406FE06200620072630101760101070019070A7AA00A01A81598648002010201016334AC007607001906406FE1620062007263070177010A01A8159864800201020172620165070AA2557777078181C78203FF0101010104454D480177070100000009FF010101010A01A8159864800201020177070100010800FF63018201621E52FF56000334B1A20177070100010801FF0101621E52FF56000334B1A20177070100010802FF0101621E52FF56000000000001770701000F0700FF0101621B52FF550000077D0177078181C78205FF010101018302C2FB2883402AD87C9EA27ACCFD0428206FBD06566BA7957C5EB0DE5054A440ABD55A6D94D677176FDDF805C23F8DEF1E01010163CD5C007607001906406FE4620062007263020171016393DF001B1B1B1B1A00548B1B1B1B1B010101017607001906406FE66200620072630101760101070019070A7AA20A01A815986480020102010163F429007607001906406FE7620062007263070177010A01A8159864800201020172620165070AA2577777078181C78203FF0101010104454D480177070100000009FF010101010A01A8159864800201020177070100010800FF63018201621E52FF56000334B1A30177070100010801FF0101621E52FF56000334B1A30177070100010802FF0101621E52FF56000000000001770701000F0700FF0101621B52FF550000077D0177078181C78205FF010101018302C2FB2883402AD87C9EA27ACCFD0428206FBD06566BA7957C5EB0DE5054A440ABD55A6D94D677176FDDF805C23F8DEF1E01010163993F007607001906406FEA62006200726302017101634E96001B1B1B1B1A00CA0D1B1B1B1B010101017607001906406FEC6200620072630101760101070019070A7AA40A01A815986480020102010163A5AF007607001906406FED620062007263070177010A01A8159864800201020172620165070AA2587777078181C78203FF0101010104454D480177070100000009FF010101010A01A8159864800201020177070100010800FF63018201621E52FF56000334B1A40177070100010801FF0101621E52FF56000334B1A40177070100010802FF0101621E52FF56000000000001770701000F0700FF0101621B52FF550000078F0177078181C78205FF010101018302C2FB2883402AD87C9EA27ACCFD0428206FBD06566BA7957C5EB0DE5054A440ABD55A6D94D677176FDDF805C23F8DEF1E01010163E2FE007607001906406FF0620062007263020171016383F0001B1B1B1B1A00CF621B1B1B1B010101017607001906406FF26200620072630101760101070019070A7AA60A01A8159864800201020101632F00007607001906406FF3620062007263070177010A01A8159864800201020172620165070AA25A7777078181C78203FF0101010104454D480177070100000009FF010101010A01A8159864800201020177070100010800FF63018201621E52FF56000334B1A50177070100010801FF0101621E52FF56000334B1A50177070100010802FF0101621E52FF56000000000001770701000F0700FF0101621B52FF550000077A0177078181C78205FF010101018302C2FB2883402AD87C9EA27ACCFD0428206FBD06566BA7957C5EB0DE5054A440ABD55A6D94D677176FDDF805C23F8DEF1E0101016386D0007607001906406FF66200620072630201710163F405001B1B1B1B1A00F6251B1B1B1B010101017607001906406FF86200620072630101760101070019070A7AA80A01A81598648002010201016316AB007607001906406FF9620062007263070177010A01A8159864800201020172620165070AA25D7777078181C78203FF0101010104454D480177070100000009FF010101010A01A8159864800201020177070100010800FF63018201621E52FF56000334B1A60177070100010801FF0101621E52FF56000334B1A60177070100010802FF0101621E52FF56000000000001770701000F0700FF0101621B52FF550000065B0177078181C78205FF010101018302C2FB2883402AD87C9EA27ACCFD0428206FBD06566BA7957C5EB0DE5054A440ABD55A6D94D677176FDDF805C23F8DEF1E01010163DF02007607001906406FFC62006200726302017101637C12001B1B1B1B1A00DEF11B1B1B1B010101017607001906406FFE6200620072630101760101070019070A7AAA0A01A815986480020102010163D62E007607001906406FFF620062007263070177010A01A8159864800201020172620165070AA25F7777078181C78203FF0101010104454D480177070100000009FF010101010A01A8159864800201020177070100010800FF63018201621E52FF56000334B1A70177070100010801FF0101621E52FF56000334B1A70177070100010802FF0101621E52FF56000000000001770701000F0700FF0101621B52FF550000054D0177078181C78205FF010101018302C2FB2883402AD87C9EA27ACCFD0428206FBD06566BA7957C5EB0DE5054A440ABD55A6D94D677176FDDF805C23F8DEF1E0101016335CC0076070019064070026200620072630201710163DC0A001B1B1B1B1A00B0931B1B1B1B0101010176070019064070046200620072630101760101070019070A7AAC0A01A8159864800201020101631907007607001906407005620062007263070177010A01A8159864800201020172620165070AA2627777078181C78203FF0101010104454D480177070100000009FF010101010A01A8159864800201020177070100010800FF63018201621E52FF56000334B1A80177070100010801FF0101621E52FF56000334B1A80177070100010802FF0101621E52FF56000000000001770701000F0700FF0101621B52FF55000005480177078181C78205FF010101018302C2FB2883402AD87C9EA27ACCFD0428206FBD06566BA7957C5EB0DE5054A440ABD55A6D94D677176FDDF805C23F8DEF1E0101016349670076070019064070086200620072630201710163541D001B1B1B1B1A00D17A1B1B1B1B01010101760700190640700A6200620072630101760101070019070A7AAE0A01A8159864800201020101631F9B00760700190640700B620062007263070177010A01A8159864800201020172620165070AA2647777078181C78203FF0101010104454D480177070100000009FF010101010A01A8159864800201020177070100010800FF63018201621E52FF56000334B1A90177070100010801FF0101621E52FF56000334B1A90177070100010802FF0101621E52FF56000000000001770701000F0700FF0101621B52FF55000007BE0177078181C78205FF010101018302C2FB2883402AD87C9EA27ACCFD0428206FBD06566BA7957C5EB0DE5054A440ABD55A6D94D677176FDDF805C23F8DEF1E01010163FA5300760700190640700E620062007263020171016323E8001B1B1B1B1A00A9EF1B1B1B1B0101010176070019064070106200620072630101760101070019070A7AB00A01A8159864800201020101637A59007607001906407011620062007263070177010A01A8159864800201020172620165070AA2667777078181C78203FF0101010104454D480177070100000009FF010101010A01A8159864800201020177070100010800FF63018201621E52FF56000334B1AA0177070100010801FF0101621E52FF56000334B1AA0177070100010802FF0101621E52FF56000000000001770701000F0700FF0101621B52FF550000077D0177078181C78205FF010101018302C2FB2883402AD87C9EA27ACCFD0428206FBD06566BA7957C5EB0DE5054A440ABD55A6D94D677176FDDF805C23F8DEF1E01010163B7870076070019064070146200620072630201710163EE8E001B1B1B1B1A0040DB1B1B1B1B0101010176070019064070166200620072630101760101070019070A7AB20A01A8159864 -------------------------------------------------------------------------------- /tests/libsml-testing/EMH_eHZ-IW8E2A5L0EK2P_with_error.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/felixwrt/sml-rs/17c1a8d73c9c992bc9b4de6560de987ec47de6ae/tests/libsml-testing/EMH_eHZ-IW8E2A5L0EK2P_with_error.bin -------------------------------------------------------------------------------- /tests/libsml-testing/EMH_eHZ-IW8E2AWL0EK2P.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/felixwrt/sml-rs/17c1a8d73c9c992bc9b4de6560de987ec47de6ae/tests/libsml-testing/EMH_eHZ-IW8E2AWL0EK2P.bin -------------------------------------------------------------------------------- /tests/libsml-testing/EMH_eHZ-IW8E2AWL0EK2P.hex: -------------------------------------------------------------------------------- 1 | 000C1B1B1B1B010101017607001C00026DDD620062007263010176010107001C0C0ECF4A0A01A81513357703010201016328A0007607001C00026DDE620062007263070177010A01A815133577030102070100620AFFFF726201650C0E50E27777078181C78203FF0101010104454D480177070100000009FF010101010A01A8151335770301020177070100010800FF6400010001621E52FF5600035632670177070100010801FF0101621E52FF5600035632670177070100010802FF0101621E52FF5600000000000177070100100700FF0101621B52FF55000000000177078181C78205FF01726201650C0E50E201018302A814610F69457A6AC0E83C08E19AF8ECAA4CB0919A1651577B9EE62EF5F3488433A65D735785255BB21C8807F4B8B092010101631C94007607001C00026DE0620062007263020171016388850000001B1B1B1B1A0261A11B1B1B1B010101017607001C00026DE3620062007263010176010107001C0C0ECF4C0A01A8151335770301020101630E7E007607001C00026DE4620062007263070177010A01A815133577030102070100620AFFFF726201650C0E50E37777078181C78203FF0101010104454D480177070100000009FF010101010A01A8151335770301020177070100010800FF6400010001621E52FF5600035632670177070100010801FF0101621E52FF5600035632670177070100010802FF0101621E52FF5600000000000177070100100700FF0101621B52FF55000000000177078181C78205FF01726201650C0E50E301018302A814610F69457A6AC0E83C08E19AF8ECAA4CB0919A1651577B9EE62EF5F3488433A65D735785255BB21C8807F4B8B09201010163302D007607001C00026DE66200620072630201710163FF700000001B1B1B1B1A025F391B1B1B1B010101017607001C00026DE9620062007263010176010107001C0C0ECF4E0A01A815133577030102010163EBEE007607001C00026DEA620062007263070177010A01A815133577030102070100620AFFFF726201650C0E50E57777078181C78203FF0101010104454D480177070100000009FF010101010A01A8151335770301020177070100010800FF6400010001621E52FF5600035632670177070100010801FF0101621E52FF5600035632670177070100010802FF0101621E52FF5600000000000177070100100700FF0101621B52FF55000000000177078181C78205FF01726201650C0E50E501018302A814610F69457A6AC0E83C08E19AF8ECAA4CB0919A1651577B9EE62EF5F3488433A65D735785255BB21C8807F4B8B0920101016377A1007607001C00026DEC620062007263020171016377670000001B1B1B1B1A02B48B1B1B1B1B010101017607001C00026DEF620062007263010176010107001C0C0ECF500A01A815133577030102010163270A007607001C00026DF0620062007263070177010A01A815133577030102070100620AFFFF726201650C0E50E67777078181C78203FF0101010104454D480177070100000009FF010101010A01A8151335770301020177070100010800FF6400010001621E52FF5600035632670177070100010801FF0101621E52FF5600035632670177070100010802FF0101621E52FF5600000000000177070100100700FF0101621B52FF55000000000177078181C78205FF01726201650C0E50E601018302A814610F69457A6AC0E83C08E19AF8ECAA4CB0919A1651577B9EE62EF5F3488433A65D735785255BB21C8807F4B8B09201010163B124007607001C00026DF26200620072630201710163EF5F0000001B1B1B1B1A02247E1B1B1B1B010101017607001C00026DF5620062007263010176010107001C0C0ECF520A01A8151335770301020101634EA9007607001C00026DF6620062007263070177010A01A815133577030102070100620AFFFF726201650C0E50E77777078181C78203FF0101010104454D480177070100000009FF010101010A01A8151335770301020177070100010800FF6400010001621E52FF5600035632670177070100010801FF0101621E52FF5600035632670177070100010802FF0101621E52FF5600000000000177070100100700FF0101621B52FF55000000000177078181C78205FF01726201650C0E50E701018302A814610F69457A6AC0E83C08E19AF8ECAA4CB0919A1651577B9EE62EF5F3488433A65D735785255BB21C8807F4B8B092010101637DB8007607001C00026DF8620062007263020171016367480000001B1B1B1B1A02CC651B1B1B1B010101017607001C00026DFB620062007263010176010107001C0C0ECF540A01A815133577030102010163FC23007607001C00026DFC620062007263070177010A01A815133577030102070100620AFFFF726201650C0E50E97777078181C78203FF0101010104454D480177070100000009FF010101010A01A8151335770301020177070100010800FF6400010001621E52FF5600035632670177070100010801FF0101621E52FF5600035632670177070100010802FF0101621E52FF5600000000000177070100100700FF0101621B52FF55000000000177078181C78205FF01726201650C0E50E901018302A814610F69457A6AC0E83C08E19AF8ECAA4CB0919A1651577B9EE62EF5F3488433A65D735785255BB21C8807F4B8B09201010163B747007607001C00026DFE620062007263020171016310BD0000001B1B1B1B1A02FC5F1B1B1B1B010101017607001C00026E01620062007263010176010107001C0C0ECF560A01A8151335770301020101636A24007607001C00026E02620062007263070177010A01A815133577030102070100620AFFFF726201650C0E50EA7777078181C78203FF0101010104454D480177070100000009FF010101010A01A8151335770301020177070100010800FF6400010001621E52FF5600035632670177070100010801FF0101621E52FF5600035632670177070100010802FF0101621E52FF5600000000000177070100100700FF0101621B52FF55000000000177078181C78205FF01726201650C0E50EA01018302A814610F69457A6AC0E83C08E19AF8ECAA4CB0919A1651577B9EE62EF5F3488433A65D735785255BB21C8807F4B8B092010101636F7A007607001C00026E046200620072630201710163A7E10000001B1B1B1B1A02C3531B1B1B1B010101017607001C00026E07620062007263010176010107001C0C0ECF580A01A815133577030102010163769A007607001C00026E08620062007263070177010A01A815133577030102070100620AFFFF726201650C0E50EB7777078181C78203FF0101010104454D480177070100000009FF010101010A01A8151335770301020177070100010800FF6400010001621E52FF5600035632670177070100010801FF0101621E52FF5600035632670177070100010802FF0101621E52FF5600000000000177070100100700FF0101621B52FF55000000000177078181C78205FF01726201650C0E50EB01018302A814610F69457A6AC0E83C08E19AF8ECAA4CB0919A1651577B9EE62EF5F3488433A65D735785255BB21C8807F4B8B09201010163C6BA007607001C00026E0A62006200726302017101637AA80000001B1B1B1B1A0223A71B1B1B1B010101017607001C00026E0D620062007263010176010107001C0C0ECF5A0A01A815133577030102010163930A007607001C00026E0E620062007263070177010A01A815133577030102070100620AFFFF726201650C0E50ED7777078181C78203FF0101010104454D480177070100000009FF010101010A01A8151335770301020177070100010800FF6400010001621E52FF5600035632670177070100010801FF0101621E52FF5600035632670177070100010802FF0101621E52FF5600000000000177070100100700FF0101621B52FF55000000000177078181C78205FF01726201650C0E50ED01018302A814610F69457A6AC0E83C08E19AF8ECAA4CB0919A1651577B9EE62EF5F3488433A65D735785255BB21C8807F4B8B09201010163C8A6007607001C00026E106200620072630201710163B7CE0000001B1B1B1B1A0228EE1B1B1B1B010101017607001C00026E13620062007263010176010107001C0C0ECF5C0A01A815133577030102010163ADB3007607001C00026E14620062007263070177010A01A815133577030102070100620AFFFF726201650C0E50EE7777078181C78203FF0101010104454D480177070100000009FF010101010A01A8151335770301020177070100010800FF6400010001621E52FF5600035632670177070100010801FF0101621E52FF5600035632670177070100010802FF0101621E52FF5600000000000177070100100700FF0101621B52FF55000000000177078181C78205FF01726201650C0E50EE01018302A814610F69457A6AC0E83C08E19AF8ECAA4CB0919A1651577B9EE62EF5F3488433A65D735785255BB21C8807F4B8B092010101630E23007607001C00026E166200620072630201710163C03B0000001B1B1B1B1A0269301B1B1B1B010101017607001C00026E19620062007263010176010107001C0C0ECF5E0A01A8151335770301020101634823007607001C00026E1A620062007263070177010A01A815133577030102070100620AFFFF726201650C0E50EF7777078181C78203FF0101010104454D480177070100000009FF010101010A01A8151335770301020177070100010800FF6400010001621E52FF5600035632670177070100010801FF0101621E52FF5600035632670177070100010802FF0101621E52FF5600000000000177070100100700FF0101621B52FF55000000000177078181C78205FF01726201650C0E50F001018302A814610F69457A6AC0E83C08E19AF8ECAA4CB0919A1651577B9EE62EF5F3488433A65D735785255BB21C8807F4B8B092010101637D81007607001C00026E1C6200620072630201710163482C0000001B1B1B1B1A0230221B1B1B1B010101017607001C00026E1F620062007263010176010107001C0C0ECF600A01A8151335770301020101632472007607001C00026E20620062007263070177010A01A815133577030102070100620AFFFF726201650C0E50F17777078181C78203FF0101010104454D480177070100000009FF010101010A01A8151335770301020177070100010800FF6400010001621E52FF5600035632670177070100010801FF0101621E52FF5600035632670177070100010802FF0101621E52FF5600000000000177070100100700FF0101621B52FF55000000000177078181C78205FF01726201650C0E50F101018302A814610F69457A6AC0E83C08E19AF8ECAA4CB0919A1651577B9EE62EF5F3488433A65D735785255BB21C8807F4B8B0920101016397DE007607001C00026E2262006200726302017101635AF60000001B1B1B1B1A02DDD21B1B1B1B010101017607001C00026E25620062007263010176010107001C0C0ECF620A01A81513357703010201016355B6007607001C00026E26620062007263070177010A01A815133577030102070100620AFFFF726201650C0E50F27777078181C78203FF0101010104454D480177070100000009FF010101010A01A8151335770301020177070100010800FF6400010001621E52FF56000356326701 -------------------------------------------------------------------------------- /tests/libsml-testing/EMH_eHZ361L5R.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/felixwrt/sml-rs/17c1a8d73c9c992bc9b4de6560de987ec47de6ae/tests/libsml-testing/EMH_eHZ361L5R.bin -------------------------------------------------------------------------------- /tests/libsml-testing/EMH_eHZ361L5R.hex: -------------------------------------------------------------------------------- 1 | 1B1B1B1B01010101760598E0CE95620062007263010176010108486167084219AD08313030313138350101635B2000760598E0CE9662006200726307017701083130303131383501017577078181C78203FF010101010648414745520177070100000000FF0101010108313030313138350177070100020801FF628201621E52FF690000000041C4988F01770700006001FFFF010101010B303030303131363931370177070100010701FF628201621B52FC55FCA4988401010163FEDB00760598E0CE9762006200726302017101631B000000001B1B1B1B1A02DB3A -------------------------------------------------------------------------------- /tests/libsml-testing/EMH_eHZ361L5R_1.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/felixwrt/sml-rs/17c1a8d73c9c992bc9b4de6560de987ec47de6ae/tests/libsml-testing/EMH_eHZ361L5R_1.bin -------------------------------------------------------------------------------- /tests/libsml-testing/EMH_eHZ361L5R_1.hex: -------------------------------------------------------------------------------- 1 | 1B1B1B1B01010101760599AA9CAB62006200726301017601010848616708855E5F0831303031313835010163798000760599AA9CAC62006200726307017701083130303131383501017577078181C78203FF010101010648414745520177070100000000FF0101010108313030313138350177070100020801FF628201621E52FF690000000044343C6401770700006001FFFF010101010B303030303131363931370177070100010701FF628201621B52FC55FF8A8CEE01010163DC4B00760599AA9CAD6200620072630201710163D6FF0000001B1B1B1B1A02705E -------------------------------------------------------------------------------- /tests/libsml-testing/EMH_mME40-AE6AKF0K0.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/felixwrt/sml-rs/17c1a8d73c9c992bc9b4de6560de987ec47de6ae/tests/libsml-testing/EMH_mME40-AE6AKF0K0.bin -------------------------------------------------------------------------------- /tests/libsml-testing/EMH_mME40-AE6AKF0K0.hex: -------------------------------------------------------------------------------- 1 | 00261B1B1B1B0101010176050017D2B96200620072630101760107FFFFFFFFFFFF050007F0E90B0A01454D480000A1BD3472620165001E9BD26201637CAC0076050017D2BA62006200726307017707FFFFFFFFFFFF0B0A01454D480000A1BD34070100620AFFFF72620165001E9BD27777070100603201010101010104454D480177070100600100FF010101010B0A01454D480000A1BD340177070100010800FF641C010472620165001E9BD2621E52FF6900000000004171C40177070100240700FF0172620165001E9BD2621B520055000009310177070100380700FF0172620165001E9BD2621B5200550000004101770701004C0700FF0172620165001E9BD2621B520055000000CD0177070100100700FF0172620165001E9BD2621B52005500000A3F01010163FEE80076050017D2BB620062007263020171016386F700001B1B1B1B1A01B10A1B1B1B1B0101010176050017D2BC6200620072630101760107FFFFFFFFFFFF050007F0EA0B0A01454D480000A1BD3472620165001E9BD36201632F940076050017D2BD62006200726307017707FFFFFFFFFFFF0B0A01454D480000A1BD34070100620AFFFF72620165001E9BD37777070100603201010101010104454D480177070100600100FF010101010B0A01454D480000A1BD340177070100010800FF641C010472620165001E9BD3621E52FF6900000000004171CB0177070100240700FF0172620165001E9BD3621B5200550000092F0177070100380700FF0172620165001E9BD3621B5200550000004001770701004C0700FF0172620165001E9BD3621B520055000000CA0177070100100700FF0172620165001E9BD3621B52005500000A3B010101630AF70076050017D2BE620062007263020171016342FC00001B1B1B1B1A0123AB1B1B1B1B0101010176050017D2BF6200620072630101760107FFFFFFFFFFFF050007F0EB0B0A01454D480000A1BD3472620165001E9BD4620163AF390076050017D2C062006200726307017707FFFFFFFFFFFF0B0A01454D480000A1BD34070100620AFFFF72620165001E9BD47777070100603201010101010104454D480177070100600100FF010101010B0A01454D480000A1BD340177070100010800FF641C010472620165001E9BD4621E52FF6900000000004171D30177070100240700FF0172620165001E9BD4621B5200550000092A0177070100380700FF0172620165001E9BD4621B5200550000004101770701004C0700FF0172620165001E9BD4621B520055000000CA0177070100100700FF0172620165001E9BD4621B52005500000A360101016343DB0076050017D2C16200620072630201710163C4BE00001B1B1B1B1A0128D11B1B1B1B0101010176050017D2C26200620072630101760107FFFFFFFFFFFF050007F0EC0B0A01454D480000A1BD3472620165001E9BD56201632F400076050017D2C362006200726307017707FFFFFFFFFFFF0B0A01454D480000A1BD34070100620AFFFF72620165001E9BD57777070100603201010101010104454D480177070100600100FF010101010B0A01454D480000A1BD340177070100010800FF641C010472620165001E9BD5621E52FF6900000000004171DA0177070100240700FF0172620165001E9BD5621B520055000009210177070100380700FF0172620165001E9BD5621B5200550000004101770701004C0700FF0172620165001E9BD5621B520055000000C80177070100100700FF0172620165001E9BD5621B52005500000A2A0101016351730076050017D2C4620062007263020171016300B500001B1B1B1B1A016BCB1B1B1B1B0101010176050017D2C56200620072630101760107FFFFFFFFFFFF050007F0ED0B0A01454D480000A1BD3472620165001E9BD6620163F09F0076050017D2C662006200726307017707FFFFFFFFFFFF0B0A01454D480000A1BD34070100620AFFFF72620165001E9BD67777070100603201010101010104454D480177070100600100FF010101010B0A01454D480000A1BD340177070100010800FF641C010472620165001E9BD6621E52FF6900000000004171E10177070100240700FF0172620165001E9BD6621B5200550000091C0177070100380700FF0172620165001E9BD6621B5200550000004101770701004C0700FF0172620165001E9BD6621B520055000000C70177070100100700FF0172620165001E9BD6621B52005500000A2501010163C7570076050017D2C76200620072630201710163B34B00001B1B1B1B1A019BC41B1B1B1B0101010176050017D2C86200620072630101760107FFFFFFFFFFFF050007F0EE0B0A01454D480000A1BD3472620165001E9BD7620163DF850076050017D2C962006200726307017707FFFFFFFFFFFF0B0A01454D480000A1BD34070100620AFFFF72620165001E9BD77777070100603201010101010104454D480177070100600100FF010101010B0A01454D480000A1BD340177070100010800FF641C010472620165001E9BD7621E52FF6900000000004171E80177070100240700FF0172620165001E9BD7621B520055000009140177070100380700FF0172620165001E9BD7621B5200550000004201770701004C0700FF0172620165001E9BD7621B520055000000C70177070100100700FF0172620165001E9BD7621B52005500000A1F01010163F4300076050017D2CA6200620072630201710163DDFC00001B1B1B1B1A01D9EA1B1B1B1B0101010176050017D2CB6200620072630101760107FFFFFFFFFFFF050007F0EF0B0A01454D480000A1BD3472620165001E9BD86201639DEE0076050017D2CC62006200726307017707FFFFFFFFFFFF0B0A01454D480000A1BD34070100620AFFFF72620165001E9BD87777070100603201010101010104454D480177070100600100FF010101010B0A01454D480000A1BD340177070100010800FF641C010472620165001E9BD8621E52FF6900000000004171EF0177070100240700FF0172620165001E9BD8621B5200550000090D0177070100380700FF0172620165001E9BD8621B5200550000004301770701004C0700FF0172620165001E9BD8621B520055000000C70177070100100700FF0172620165001E9BD8621B52005500000A1801010163AB280076050017D2CD62006200726302017101633B5C00001B1B1B1B1A01EC621B1B1B1B0101010176050017D2CE6200620072630101760107FFFFFFFFFFFF050007F0F00B0A01454D480000A1BD3472620165001E9BD96201635FC40076050017D2CF62006200726307017707FFFFFFFFFFFF0B0A01454D480000A1BD34070100620AFFFF72620165001E9BD97777070100603201010101010104454D480177070100600100FF010101010B0A01454D480000A1BD340177070100010800FF641C010472620165001E9BD9621E52FF6900000000004171F70177070100240700FF0172620165001E9BD9621B520055000009050177070100380700FF0172620165001E9BD9621B5200550000004501770701004C0700FF0172620165001E9BD9621B520055000000C80177070100100700FF0172620165001E9BD9621B52005500000A130101016396380076050017D2D06200620072630201710163109A00001B1B1B1B1A01ED961B1B1B1B0101010176050017D2D16200620072630101760107FFFFFFFFFFFF050007F0F10B0A01454D480000A1BD3472620165001E9BDA620163047D0076050017D2D262006200726307017707FFFFFFFFFFFF0B0A01454D480000A1BD34070100620AFFFF72620165001E9BDA7777070100603201010101010104454D480177070100600100FF010101010B0A01454D480000A1BD340177070100010800FF641C010472620165001E9BDA621E52FF6900000000004171FE0177070100240700FF0172620165001E9BDA621B520055000008FE0177070100380700FF0172620165001E9BDA621B5200550000004301770701004C0700FF0172620165001E9BDA621B520055000000C80177070100100700FF0172620165001E9BDA621B52005500000A0A01010163D5970076050017D2D36200620072630201710163A36400001B1B1B1B1A01B3191B1B1B1B0101010176050017D2D46200620072630101760107FFFFFFFFFFFF050007F0F20B0A01454D480000A1BD3472620165001E9BDB62016357450076050017D2D562006200726307017707FFFFFFFFFFFF0B0A01454D480000A1BD34070100620AFFFF72620165001E9BDB7777070100603201010101010104454D480177070100600100FF010101010B0A01454D480000A1BD340177070100010800FF641C010472620165001E9BDB621E52FF6900000000004172050177070100240700FF0172620165001E9BDB621B520055000008F90177070100380700FF0172620165001E9BDB621B5200550000004401770701004C0700FF0172620165001E9BDB621B520055000000C80177070100100700FF0172620165001E9BDB621B52005500000A06010101632CC80076050017D2D66200620072630201710163676F00001B1B1B1B1A01410F1B1B1B1B0101010176050017D2D76200620072630101760107FFFFFFFFFFFF050007F0F30B0A01454D480000A1BD3472620165001E9BDC620163D7E80076050017D2D862006200726307017707FFFFFFFFFFFF0B0A01454D480000A1BD34070100620AFFFF72620165001E9BDC7777070100603201010101010104454D480177070100600100FF010101010B0A01454D480000A1BD340177070100010800FF641C010472620165001E9BDC621E52FF69000000000041720C0177070100240700FF0172620165001E9BDC621B520055000008F60177070100380700FF0172620165001E9BDC621B5200550000004501770701004C0700FF0172620165001E9BDC621B520055000000CA0177070100100700FF0172620165001E9BDC621B52005500000A06010101634D340076050017D2D962006200726302017101632B7300001B1B1B1B1A0110D01B1B1B1B0101010176050017D2DA6200620072630101760107FFFFFFFFFFFF050007F0F40B0A01454D480000A1BD3472620165001E9BDD620163AE470076050017D2DB62006200726307017707FFFFFFFFFFFF0B0A01454D480000A1BD34070100620AFFFF72620165001E9BDD7777070100603201010101010104454D480177070100600100FF010101010B0A01454D480000A1BD340177070100010800FF641C010472620165001E9BDD621E52FF6900000000004172130177070100240700FF0172620165001E9BDD621B520055000008F60177070100380700FF0172620165001E9BDD621B5200550000004601770701004C0700FF0172620165001E9BDD621B520055000000CA0177070100100700FF0172620165001E9BDD621B52005500000A070101016325ED0076050017D2DC6200620072630201710163EF7800001B1B1B1B1A011CA21B1B1B1B0101010176050017D2DD6200620072630101760107FFFFFFFFFFFF050007F0F50B0A01454D480000A1BD3472620165001E9BDE62016371980076050017D2DE62006200726307017707FFFFFFFFFFFF0B0A01454D480000A1BD34070100620AFFFF72620165001E9BDE7777070100603201010101010104454D480177070100600100FF010101010B0A01454D480000A1BD340177070100010800 -------------------------------------------------------------------------------- /tests/libsml-testing/EasyMeter_Q3A_A1064V1009.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/felixwrt/sml-rs/17c1a8d73c9c992bc9b4de6560de987ec47de6ae/tests/libsml-testing/EasyMeter_Q3A_A1064V1009.bin -------------------------------------------------------------------------------- /tests/libsml-testing/FILES: -------------------------------------------------------------------------------- 1 | filename submitter contact comment 2 | -------- --------- ------- ------- 3 | 4 | DZG_DVS-7412.2_jmberg.bin https://github.com/jmberg Wrongly encoded power value 356.24 as -299.12 5 | DZG_DVS-7420.2V.G2_mtr0.bin https://github.com/dbeyer Dirk.Beyer AT sosy-lab.org Household, has values for: 1.8.0, 2.8.0, 16.7.0 6 | DZG_DVS-7420.2V.G2_mtr1.bin https://github.com/dbeyer Dirk.Beyer AT sosy-lab.org Heat pump, has values for: 1.8.1, 1.8.2, 16.7.0 7 | DZG_DVS-7420.2V.G2_mtr2.bin https://github.com/dbeyer Dirk.Beyer AT sosy-lab.org Generator, has values for: 2.8.0, 16.7.0 8 | DZG_DVS-7420.2V.G2_mtr2_neg.bin https://github.com/dbeyer Dirk.Beyer AT sosy-lab.org Generator, has 2-bytes negative value 16.7.0 9 | EMH_eHZ-GW8E2A500AK2 https://github.com/devZer0 devzero AT web.de 10 | EMH_eHZ-HW8E2AWL0EK2P https://github.com/devZer0 devzero AT web.de 11 | EMH_eHZ_IW8E2A5L0EK2P_with_error varaktor koenichii AT gmx.de seems to contain invalid data, formerly crashing libsml 12 | EMH_eHZ-HW8E2A5L0EK2P https://github.com/r3wald 13 | EMH_eHZ-HW8E2A5L0EK2P_1 https://github.com/r3wald 14 | EMH_eHZ-HW8E2A5L0EK2P_2 https://github.com/wbeck77 15 | EMH_eHZ361L5R https://github.com/wbeck77 16 | DrNeuhaus_SMARTY_ix-130 https://github.com/devZer0 devzero AT web.de 17 | ISKRA_MT691_eHZ-MS2020 https://github.com/devZer0 devzero AT web.de 18 | EMH_eHZ-IW8E2AWL0EK2P René Simon 19 | HOLLEY_DTZ541-ZDBA https://github.com/magicWF git@weidemann.online provide no standard SML 20 | ITRON_OpenWay-3.HZ https://github.com/SaimenSays https://github.com/volkszaehler/libsml/issues/83 (crc issue) 21 | ISKRA_MT175_eHZ https://github.com/erniberni 22 | -------------------------------------------------------------------------------- /tests/libsml-testing/HOLLEY_DTZ541-BDBA_with_PIN.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/felixwrt/sml-rs/17c1a8d73c9c992bc9b4de6560de987ec47de6ae/tests/libsml-testing/HOLLEY_DTZ541-BDBA_with_PIN.bin -------------------------------------------------------------------------------- /tests/libsml-testing/HOLLEY_DTZ541-BDBA_with_PIN.hex: -------------------------------------------------------------------------------- 1 | 1B1B1B1B01010101760400000162006200726500000101760101070000017162A80B0A01484C5902000D6BE672620165017162A801638C88007604000002620062007265000007017707FFFFFFFFFFFF0B0A01484C5902000D6BE6070100620AFFFF72620165017162A87477070100603201010101010104484C590177070100600100FF010101010B0A01484C5902000D6BE60177070100010800FF65001C010472620165017162A8621E52FF6501677C7A0177070100100700FF0101621B520053017801010163764D00760400000362006200726500000201710163E823001B1B1B1B1A001B4C1B1B1B1B01010101760400000162006200726500000101760101070000017162A90B0A01484C5902000D6BE672620165017162A9016338A6007604000002620062007265000007017707FFFFFFFFFFFF0B0A01484C5902000D6BE6070100620AFFFF72620165017162A97477070100603201010101010104484C590177070100600100FF010101010B0A01484C5902000D6BE60177070100010800FF65001C010472620165017162A9621E52FF6501677C7B0177070100100700FF0101621B5200530176010101635C6B00760400000362006200726500000201710163E823001B1B1B1B1A0040E7 2 | -------------------------------------------------------------------------------- /tests/libsml-testing/HOLLEY_DTZ541-BDBA_without_PIN.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/felixwrt/sml-rs/17c1a8d73c9c992bc9b4de6560de987ec47de6ae/tests/libsml-testing/HOLLEY_DTZ541-BDBA_without_PIN.bin -------------------------------------------------------------------------------- /tests/libsml-testing/HOLLEY_DTZ541-BDBA_without_PIN.hex: -------------------------------------------------------------------------------- 1 | 1B1B1B1B01010101760400000162006200726500000101760101070000016C54B00B0A01484C5902000D6BE672620165016C54B00163BFB2007604000002620062007265000007017707FFFFFFFFFFFF0B0A01484C5902000D6BE6070100620AFFFF72620165016C54B07377070100603201010101010104484C590177070100600100FF010101010B0A01484C5902000D6BE60177070100010800FF65001C010472620165016C54B0621E5203630914010101637EB800760400000362006200726500000201710163E823001B1B1B1B1A004C50 2 | -------------------------------------------------------------------------------- /tests/libsml-testing/HOLLEY_DTZ541-ZDBA.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/felixwrt/sml-rs/17c1a8d73c9c992bc9b4de6560de987ec47de6ae/tests/libsml-testing/HOLLEY_DTZ541-ZDBA.bin -------------------------------------------------------------------------------- /tests/libsml-testing/ISKRA_MT175_D1A52-V22-K0t.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/felixwrt/sml-rs/17c1a8d73c9c992bc9b4de6560de987ec47de6ae/tests/libsml-testing/ISKRA_MT175_D1A52-V22-K0t.bin -------------------------------------------------------------------------------- /tests/libsml-testing/ISKRA_MT175_eHZ.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/felixwrt/sml-rs/17c1a8d73c9c992bc9b4de6560de987ec47de6ae/tests/libsml-testing/ISKRA_MT175_eHZ.bin -------------------------------------------------------------------------------- /tests/libsml-testing/ISKRA_MT175_eHZ.hex: -------------------------------------------------------------------------------- 1 | 1B1B1B1B0101010176050F1A20606200620072630101760101050508B5760B090149534B000403DF63010163C4BA0076050F1A2061620062007263070177010B090149534B000403DF63070100620AFFFF7262016507AFF5DC7A77078181C78203FF010101010449534B0177070100000009FF010101010B090149534B000403DF630177070100010800FF650000018201621E52FF59000000000D637E080177070100010801FF0101621E52FF59000000000D637E080177070100010802FF0101621E52FF5900000000000000000177070100100700FF0101621B520055000000A80177070100240700FF0101621B520055000000750177070100380700FF0101621B5200550000001601770701004C0700FF0101621B5200550000001D0177078181C78205FF0101010183020C2DE05C56024E1CD45280F4A0769A95E629CAE205C55C9F1683CA5419778E1D9BCFA1C577A6B36A92709EBF05EA21BD01010163291C0076050F1A206262006200726302017101630054001B1B1B1B1A00AE841B1B1B1B0101010176050F1A20636200620072630101760101050508B5770B090149534B000403DF630101633BA50076050F1A2064620062007263070177010B090149534B000403DF63070100620AFFFF7262016507AFF5DE7A77078181C78203FF010101010449534B0177070100000009FF010101010B090149534B000403DF630177070100010800FF650000018201621E52FF59000000000D637E090177070100010801FF0101621E52FF59000000000D637E090177070100010802FF0101621E52FF5900000000000000000177070100100700FF0101621B520055000000AB0177070100240700FF0101621B520055000000770177070100380700FF0101621B5200550000001601770701004C0700FF0101621B5200550000001D0177078181C78205FF0101010183020C2DE05C56024E1CD45280F4A0769A95E629CAE205C55C9F1683CA5419778E1D9BCFA1C577A6B36A92709EBF05EA21BD01010163D1350076050F1A20656200620072630201710163E6F4001B1B1B1B1A00116D1B1B1B1B0101010176050F1A20666200620072630101760101050508B5780B090149534B000403DF63010163E0990076050F1A2067620062007263070177010B090149534B000403DF63070100620AFFFF7262016507AFF5E07A77078181C78203FF010101010449534B0177070100000009FF010101010B090149534B000403DF630177070100010800FF650000018201621E52FF59000000000D637E0A0177070100010801FF0101621E52FF59000000000D637E0A0177070100010802FF0101621E52FF5900000000000000000177070100100700FF0101621B520055000000AD0177070100240700FF0101621B520055000000760177070100380700FF0101621B5200550000001601770701004C0700FF0101621B520055000000200177078181C78205FF0101010183020C2DE05C56024E1CD45280F4A0769A95E629CAE205C55C9F1683CA5419778E1D9BCFA1C577A6B36A92709EBF05EA21BD01010163A3070076050F1A206862006200726302017101638843001B1B1B1B1A0017831B1B1B1B0101010176050F1A20696200620072630101760101050508B5790B090149534B000403DF630101635A0A0076050F1A206A620062007263070177010B090149534B000403DF63070100620AFFFF7262016507AFF5E27A77078181C78203FF010101010449534B0177070100000009FF010101010B090149534B000403DF630177070100010800FF650000018201621E52FF59000000000D637E0B0177070100010801FF0101621E52FF59000000000D637E0B0177070100010802FF0101621E52FF5900000000000000000177070100100700FF0101621B520055000000A80177070100240700FF0101621B520055000000750177070100380700FF0101621B5200550000001501770701004C0700FF0101621B5200550000001D0177078181C78205FF0101010183020C2DE05C56024E1CD45280F4A0769A95E629CAE205C55C9F1683CA5419778E1D9BCFA1C577A6B36A92709EBF05EA21BD01010163C54E0076050F1A206B62006200726302017101633BBD001B1B1B1B1A004A711B1B1B1B0101010176050F1A206C6200620072630101760101050508B57A0B090149534B000403DF630101635B2A0076050F1A206D620062007263070177010B090149534B000403DF63070100620AFFFF7262016507AFF5E47A77078181C78203FF010101010449534B0177070100000009FF010101010B090149534B000403DF630177070100010800FF650000018201621E52FF59000000000D637E0C0177070100010801FF0101621E52FF59000000000D637E0C0177070100010802FF0101621E52FF5900000000000000000177070100100700FF0101621B520055000000A80177070100240700FF0101621B520055000000750177070100380700FF0101621B5200550000001601770701004C0700FF0101621B5200550000001C0177078181C78205FF0101010183020C2DE05C56024E1CD45280F4A0769A95E629CAE205C55C9F1683CA5419778E1D9BCFA1C577A6B36A92709EBF05EA21BD01010163F6E70076050F1A206E6200620072630201710163FFB6001B1B1B1B1A0055D51B1B1B1B0101010176050F1A206F6200620072630101760101050508B57B0B090149534B000403DF63010163A4350076050F1A2070620062007263070177010B090149534B000403DF63070100620AFFFF7262016507AFF5E67A77078181C78203FF010101010449534B0177070100000009FF010101010B090149534B000403DF630177070100010800FF650000018201621E52FF59000000000D637E0D0177070100010801FF0101621E52FF59000000000D637E0D0177070100010802FF0101621E52FF5900000000000000000177070100100700FF0101621B520055000000AA0177070100240700FF0101621B520055000000750177070100380700FF0101621B5200550000001701770701004C0700FF0101621B5200550000001D0177078181C78205FF0101010183020C2DE05C56024E1CD45280F4A0769A95E629CAE205C55C9F1683CA5419778E1D9BCFA1C577A6B36A92709EBF05EA21BD010101631FF20076050F1A20716200620072630201710163F6DB001B1B1B1B1A00AC491B1B1B1B0101010176050F1A20726200620072630101760101050508B57C0B090149534B000403DF6301016387F60076050F1A2073620062007263070177010B090149534B000403DF63070100620AFFFF7262016507AFF5E87A77078181C78203FF010101010449534B0177070100000009FF010101010B090149534B000403DF630177070100010800FF650000018201621E52FF59000000000D637E0E0177070100010801FF0101621E52FF59000000000D637E0E0177070100010802FF0101621E52FF5900000000000000000177070100100700FF0101621B520055000000AB0177070100240700FF0101621B520055000000770177070100380700FF0101621B5200550000001701770701004C0700FF0101621B5200550000001D0177078181C78205FF0101010183020C2DE05C56024E1CD45280F4A0769A95E629CAE205C55C9F1683CA5419778E1D9BCFA1C577A6B36A92709EBF05EA21BD01010163C8560076050F1A2074620062007263020171016332D0001B1B1B1B1A00D6DE1B1B1B1B0101010176050F1A20756200620072630101760101050508B57D0B090149534B000403DF63010163B46A0076050F1A2076620062007263070177010B090149534B000403DF63070100620AFFFF7262016507AFF5EA7A77078181C78203FF010101010449534B0177070100000009FF010101010B090149534B000403DF630177070100010800FF650000018201621E52FF59000000000D637E0F0177070100010801FF0101621E52FF59000000000D637E0F0177070100010802FF0101621E52FF5900000000000000000177070100100700FF0101621B520055000000AA0177070100240700FF0101621B520055000000760177070100380700FF0101621B5200550000001601770701004C0700FF0101621B5200550000001D0177078181C78205FF0101010183020C2DE05C56024E1CD45280F4A0769A95E629CAE205C55C9F1683CA5419778E1D9BCFA1C577A6B36A92709EBF05EA21BD01010163FF510076050F1A20776200620072630201710163812E001B1B1B1B1A00F5921B1B1B1B0101010176050F1A20786200620072630101760101050508B57E0B090149534B000403DF630101633C450076050F1A2079620062007263070177010B090149534B000403DF63070100620AFFFF7262016507AFF5EC7A77078181C78203FF010101010449534B0177070100000009FF010101010B090149534B000403DF630177070100010800FF650000018201621E52FF59000000000D637E100177070100010801FF0101621E52FF59000000000D637E100177070100010802FF0101621E52FF5900000000000000000177070100100700FF0101621B520055000000AB0177070100240700FF0101621B520055000000770177070100380700FF0101621B5200550000001501770701004C0700FF0101621B5200550000001E0177078181C78205FF0101010183020C2DE05C56024E1CD45280F4A0769A95E629CAE205C55C9F1683CA5419778E1D9BCFA1C577A6B36A92709EBF05EA21BD01010163AD3C0076050F1A207A6200620072630201710163EF99001B1B1B1B1A0039751B1B1B1B0101010176050F1A207B6200620072630101760101050508B57F0B090149534B000403DF63010163C35A0076050F1A207C620062007263070177010B090149534B000403DF63070100620AFFFF7262016507AFF5EE7A77078181C78203FF010101010449534B0177070100000009FF010101010B090149534B000403DF630177070100010800FF650000018201621E52FF59000000000D637E110177070100010801FF0101621E52FF59000000000D637E110177070100010802FF0101621E52FF5900000000000000000177070100100700FF0101621B520055000000A90177070100240700FF0101621B520055000000760177070100380700FF0101621B5200550000001601770701004C0700FF0101621B5200550000001C0177078181C78205FF0101010183020C2DE05C56024E1CD45280F4A0769A95E629CAE205C55C9F1683CA5419778E1D9BCFA1C577A6B36A92709EBF05EA21BD0101016347B00076050F1A207D62006200726302017101630939001B1B1B1B1A00D0A31B1B1B1B0101010176050F1A207E6200620072630101760101050508B5800B090149534B000403DF63010163C1D00076050F1A207F620062007263070177010B090149534B000403DF63070100620AFFFF7262016507AFF5F17A77078181C78203FF010101010449534B0177070100000009FF010101010B090149534B000403DF630177070100010800FF650000018201621E52FF59000000000D637E120177070100010801FF0101621E52FF59000000000D637E120177070100010802FF0101621E52FF5900000000000000000177070100100700FF0101621B520055000000AA0177070100240700FF0101621B520055000000740177070100380700FF01 -------------------------------------------------------------------------------- /tests/libsml-testing/ISKRA_MT631-D1A52-K0z-H01_with_PIN.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/felixwrt/sml-rs/17c1a8d73c9c992bc9b4de6560de987ec47de6ae/tests/libsml-testing/ISKRA_MT631-D1A52-K0z-H01_with_PIN.bin -------------------------------------------------------------------------------- /tests/libsml-testing/ISKRA_MT631-D1A52-K0z-H01_with_PIN.hex: -------------------------------------------------------------------------------- 1 | 1B1B1B1B010101017605099DFAAC6200620072630101760101050334A8E40B0A0149534B00047A5544726201650334A737620163D0BB007605099DFAAD620062007263070177010B0A0149534B00047A5544070100620AFFFF726201650334A737757707010060320101010101010449534B0177070100600100FF010101010B0A0149534B00047A55440177070100010800FF650010010401621E52FF650137C0C70177070100020800FF0101621E52FF62000177070100100700FF0101621B52005300C101010163F376007605099DFAAE620062007263020171016342DD001B1B1B1B1A0038EB1B1B1B1B010101017605099DFAAF6200620072630101760101050334A8E50B0A0149534B00047A5544726201650334A73862016303AF007605099DFAB0620062007263070177010B0A0149534B00047A5544070100620AFFFF726201650334A738757707010060320101010101010449534B0177070100600100FF010101010B0A0149534B00047A55440177070100010800FF650010010401621E52FF650137C0C80177070100020800FF0101621E52FF62000177070100100700FF0101621B52005300C201010163EA6F007605099DFAB162006200726302017101634BB0001B1B1B1B1A0007051B1B1B1B010101017605099DFAB26200620072630101760101050334A8E60B0A0149534B00047A5544726201650334A739620163DC95007605099DFAB3620062007263070177010B0A0149534B00047A5544070100620AFFFF726201650334A739757707010060320101010101010449534B0177070100600100FF010101010B0A0149534B00047A55440177070100010800FF650010010401621E52FF650137C0C80177070100020800FF0101621E52FF62000177070100100700FF0101621B52005300C101010163B703007605099DFAB462006200726302017101638FBB001B1B1B1B1A00D07B1B1B1B1B010101017605099DFAB56200620072630101760101050334A8E70B0A0149534B00047A5544726201650334A73A620163AE9F007605099DFAB6620062007263070177010B0A0149534B00047A5544070100620AFFFF726201650334A73A757707010060320101010101010449534B0177070100600100FF010101010B0A0149534B00047A55440177070100010800FF650010010401621E52FF650137C0C90177070100020800FF0101621E52FF62000177070100100700FF0101621B52005300C20101016324B6007605099DFAB762006200726302017101633C45001B1B1B1B1A00C2C51B1B1B1B010101017605099DFAB86200620072630101760101050334A8E80B0A0149534B00047A5544726201650334A73B620163B08E007605099DFAB9620062007263070177010B0A0149534B00047A5544070100620AFFFF726201650334A73B757707010060320101010101010449534B0177070100600100FF010101010B0A0149534B00047A55440177070100010800FF650010010401621E52FF650137C0C90177070100020800FF0101621E52FF62000177070100100700FF0101621B52005300C201010163EAD0007605099DFABA620062007263020171016352F2001B1B1B1B1A00382E -------------------------------------------------------------------------------- /tests/libsml-testing/ISKRA_MT631-D1A52-K0z-H01_without_PIN.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/felixwrt/sml-rs/17c1a8d73c9c992bc9b4de6560de987ec47de6ae/tests/libsml-testing/ISKRA_MT631-D1A52-K0z-H01_without_PIN.bin -------------------------------------------------------------------------------- /tests/libsml-testing/ISKRA_MT631-D1A52-K0z-H01_without_PIN.hex: -------------------------------------------------------------------------------- 1 | 1B1B1B1B010101017605099DF3EC6200620072630101760101050334A6A40B0A0149534B00047A5544726201650334A4F7620163F23E007605099DF3ED620062007263070177010B0A0149534B00047A5544070100620AFFFF726201650334A4F7747707010060320101010101010449534B0177070100600100FF010101010B0A0149534B00047A55440177070100010800FF650010010401621E52036307FB0177070100020800FF0101621E5203620001010163D9E6007605099DF3EE6200620072630201710163FE9F001B1B1B1B1A0021011B1B1B1B010101017605099DF3EF6200620072630101760101050334A6A50B0A0149534B00047A5544726201650334A4F8620163212A007605099DF3F0620062007263070177010B0A0149534B00047A5544070100620AFFFF726201650334A4F8747707010060320101010101010449534B0177070100600100FF010101010B0A0149534B00047A55440177070100010800FF650010010401621E52036307FB0177070100020800FF0101621E52036200010101638C3E007605099DF3F16200620072630201710163F7F2001B1B1B1B1A00D4C11B1B1B1B010101017605099DF3F26200620072630101760101050334A6A60B0A0149534B00047A5544726201650334A4F9620163FE10007605099DF3F3620062007263070177010B0A0149534B00047A5544070100620AFFFF726201650334A4F9747707010060320101010101010449534B0177070100600100FF010101010B0A0149534B00047A55440177070100010800FF650010010401621E52036307FB0177070100020800FF0101621E52036200010101630C6E007605099DF3F4620062007263020171016333F9001B1B1B1B1A00CE391B1B1B1B010101017605099DF3F56200620072630101760101050334A6A70B0A0149534B00047A5544726201650334A4FA6201638C1A007605099DF3F6620062007263070177010B0A0149534B00047A5544070100620AFFFF726201650334A4FA747707010060320101010101010449534B0177070100600100FF010101010B0A0149534B00047A55440177070100010800FF650010010401621E52036307FB0177070100020800FF0101621E52036200010101638C9F007605099DF3F762006200726302017101638007001B1B1B1B1A00FDD71B1B1B1B010101017605099DF3F86200620072630101760101050334A6A80B0A0149534B00047A5544726201650334A4FB620163920B007605099DF3F9620062007263070177010B0A0149534B00047A5544070100620AFFFF726201650334A4FB747707010060320101010101010449534B0177070100600100FF010101010B0A0149534B00047A55440177070100010800FF650010010401621E52036307FB0177070100020800FF0101621E5203620001010163EA38007605099DF3FA6200620072630201710163EEB0001B1B1B1B1A002A60 -------------------------------------------------------------------------------- /tests/libsml-testing/ISKRA_MT631-D2A51-V22-K0z_with_PIN.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/felixwrt/sml-rs/17c1a8d73c9c992bc9b4de6560de987ec47de6ae/tests/libsml-testing/ISKRA_MT631-D2A51-V22-K0z_with_PIN.bin -------------------------------------------------------------------------------- /tests/libsml-testing/ISKRA_MT631-D2A51-V22-K0z_with_PIN.hex: -------------------------------------------------------------------------------- 1 | 1B1B1B1B0101010176051331B4C46200620072630101760101050665E6EC0B0A0149534B000454A95F726201650665E8A5620163EB950076051331B4C5620062007263070177010B0A0149534B000454A95F070100620AFFFF726201650665E8A5767707010060320101010101010449534B0177070100600100FF010101010B0A0149534B000454A95F0177070100010800FF65001C000401621E52FF650A0744F50177070100010801FF0101621E52FF63B3630177070100010802FF0101621E52FF650A0691920177070100100700FF0101621B5200520001010163C5240076051331B4C662006200726302017101639898001B1B1B1B1A001AB11B1B1B1B0101010176051331B4C76200620072630101760101050665E6ED0B0A0149534B000454A95F726201650665E8A66201639B240076051331B4C8620062007263070177010B0A0149534B000454A95F070100620AFFFF726201650665E8A6767707010060320101010101010449534B0177070100600100FF010101010B0A0149534B000454A95F0177070100010800FF65001C000401621E52FF650A0744F50177070100010801FF0101621E52FF63B3630177070100010802FF0101621E52FF650A0691920177070100100700FF0101621B520052000101016359D00076051331B4C96200620072630201710163D484001B1B1B1B1A0028CE1B1B1B1B0101010176051331B4CA6200620072630101760101050665E6EE0B0A0149534B000454A95F726201650665E8A76201636EE20076051331B4CB620062007263070177010B0A0149534B000454A95F070100620AFFFF726201650665E8A7767707010060320101010101010449534B0177070100600100FF010101010B0A0149534B000454A95F0177070100010800FF65001C000401621E52FF650A0744F50177070100010801FF0101621E52FF63B3630177070100010802FF0101621E52FF650A0691920177070100100700FF0101621B520052000101016338510076051331B4CC6200620072630201710163108F001B1B1B1B1A0058D81B1B1B1B0101010176051331B4CD6200620072630101760101050665E6EF0B0A0149534B000454A95F726201650665E8A8620163BF4D0076051331B4CE620062007263070177010B0A0149534B000454A95F070100620AFFFF726201650665E8A8767707010060320101010101010449534B0177070100600100FF010101010B0A0149534B000454A95F0177070100010800FF65001C000401621E52FF650A0744F50177070100010801FF0101621E52FF63B3630177070100010802FF0101621E52FF650A0691920177070100100700FF0101621B5200520001010163AB250076051331B4CF6200620072630201710163A371001B1B1B1B1A001BC4 2 | -------------------------------------------------------------------------------- /tests/libsml-testing/ISKRA_MT631-D2A51-V22-K0z_without_PIN.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/felixwrt/sml-rs/17c1a8d73c9c992bc9b4de6560de987ec47de6ae/tests/libsml-testing/ISKRA_MT631-D2A51-V22-K0z_without_PIN.bin -------------------------------------------------------------------------------- /tests/libsml-testing/ISKRA_MT631-D2A51-V22-K0z_without_PIN.hex: -------------------------------------------------------------------------------- 1 | 1B1B1B1B01010101760513008891620062007263010176010105065582DB0B0A0149534B000454A95F726201650655848E620163A4FF00760513008892620062007263070177010B0A0149534B000454A95F070100620AFFFF726201650655848E757707010060320101010101010449534B0177070100600100FF010101010B0A0149534B000454A95F0177070100010800FF65001C000401621E52036341920177070100010801FF0101621E520362040177070100010802FF0101621E520363418E01010163524D00760513008893620062007263020171016333F40000001B1B1B1B1A02400D1B1B1B1B01010101760513008894620062007263010176010105065582DC0B0A0149534B000454A95F726201650655848F62016312F200760513008895620062007263070177010B0A0149534B000454A95F070100620AFFFF726201650655848F757707010060320101010101010449534B0177070100600100FF010101010B0A0149534B000454A95F0177070100010800FF65001C000401621E52036341920177070100010801FF0101621E520362040177070100010802FF0101621E520363418E010101639389007605130088966200620072630201710163F7FF0000001B1B1B1B1A02123F 2 | -------------------------------------------------------------------------------- /tests/libsml-testing/ISKRA_MT691_eHZ-MS2020.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/felixwrt/sml-rs/17c1a8d73c9c992bc9b4de6560de987ec47de6ae/tests/libsml-testing/ISKRA_MT691_eHZ-MS2020.bin -------------------------------------------------------------------------------- /tests/libsml-testing/ITRON_OpenWay-3.HZ.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/felixwrt/sml-rs/17c1a8d73c9c992bc9b4de6560de987ec47de6ae/tests/libsml-testing/ITRON_OpenWay-3.HZ.bin -------------------------------------------------------------------------------- /tests/libsml-testing/ITRON_OpenWay-3.HZ.hex: -------------------------------------------------------------------------------- 1 | 1B1B1B1B010101017609E4060000099987D96200620072650000010176010109000000000333342C0B0A01495452000348F58E72620165033336980163C6A3007609E4060000099987DA6200620072650000070177010B0A01495452000348F58E070100620AFFFF726201650333369874770701006032010101010101044954520177070100600100FF010101010B0A01495452000348F58E0177070100010800FF65001C010401621E52FF690000000004E1A20D0177070100100700FF0101621B5200550000026501010163DD64007609E4060000099987DB62006200726500000201710163419A0000001B1B1B1B1A02EB0F -------------------------------------------------------------------------------- /tests/libsml-testing/ITRON_OpenWay-3.HZ_with_PIN.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/felixwrt/sml-rs/17c1a8d73c9c992bc9b4de6560de987ec47de6ae/tests/libsml-testing/ITRON_OpenWay-3.HZ_with_PIN.bin -------------------------------------------------------------------------------- /tests/libsml-testing/ITRON_OpenWay-3.HZ_with_PIN.hex: -------------------------------------------------------------------------------- 1 | 1B1B1B1B0101010176099B62240606D5DAC2620062007265000001017601010900000000086BAB860B0A01495452000347F04072620165086BAD42016315FC0076099B62240606D5DAC36200620072650000070177010B0A01495452000347F040070100620AFFFF72620165086BAD4274770701006032010101010101044954520177070100600100FF010101010B0A01495452000347F0400177070100010800FF65001C010401621E52FF69000000000F6EEC910177070100100700FF0101621B5200550000021E01010163294A0076099B62240606D5DAC462006200726500000201710163392F0000001B1B1B1B1A0259CF1B1B1B1B0101010176099B62240606D5DAC5620062007265000001017601010900000000086BAB870B0A01495452000347F04072620165086BAD430163ECD50076099B62240606D5DAC66200620072650000070177010B0A01495452000347F040070100620AFFFF72620165086BAD4374770701006032010101010101044954520177070100600100FF010101010B0A01495452000347F0400177070100010800FF65001C010401621E52FF69000000000F6EEC920177070100100700FF0101621B5200550000021E01010163D7B00076099B62240606D5DAC762006200726500000201710163CE210000001B1B1B1B1A02822B1B1B1B1B0101010176099B62240606D5DAC8620062007265000001017601010900000000086BAB880B0A01495452000347F04072620165086BAD44016347110076099B62240606D5DAC96200620072650000070177010B0A01495452000347F040070100620AFFFF72620165086BAD4474770701006032010101010101044954520177070100600100FF010101010B0A01495452000347F0400177070100010800FF65001C010401621E52FF69000000000F6EEC940177070100100700FF0101621B5200550000021E0101016344050076099B62240606D5DACA62006200726500000201710163BF1F0000001B1B1B1B1A022B991B1B1B1B0101010176099B62240606D5DACB620062007265000001017601010900000000086BAB890B0A01495452000347F04072620165086BAD450163BF8F0076099B62240606D5DACC6200620072650000070177010B0A01495452000347F040070100620AFFFF72620165086BAD4574770701006032010101010101044954520177070100600100FF010101010B0A01495452000347F0400177070100010800FF65001C010401621E52FF69000000000F6EEC950177070100100700FF0101621B5200550000021E0101016332490076099B62240606D5DACD62006200726500000201710163FC070000001B1B1B1B1A0256AA1B1B1B1B0101010176099B62240606D5DACE620062007265000001017601010900000000086BAB8A0B0A01495452000347F04072620165086BAD460163A6240076099B62240606D5DACF6200620072650000070177010B0A01495452000347F040070100620AFFFF72620165086BAD4674770701006032010101010101044954520177070100600100FF010101010B0A01495452000347F0400177070100010800FF65001C010401621E52FF69000000000F6EEC970177070100100700FF0101621B5200550000021E0101016390C70076099B62240606D5DAD0620062007265000002017101635D630000001B1B1B1B1A02668E 2 | -------------------------------------------------------------------------------- /tests/libsml-testing/ITRON_OpenWay-3.HZ_without_PIN.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/felixwrt/sml-rs/17c1a8d73c9c992bc9b4de6560de987ec47de6ae/tests/libsml-testing/ITRON_OpenWay-3.HZ_without_PIN.bin -------------------------------------------------------------------------------- /tests/libsml-testing/ITRON_OpenWay-3.HZ_without_PIN.hex: -------------------------------------------------------------------------------- 1 | 1B1B1B1B0101010176099B62240606A4AFD3620062007265000001017601010900000000085B47E10B0A01495452000347F04072620165085B49910163D0D20076099B62240606A4AFD46200620072650000070177010B0A01495452000347F040070100620AFFFF72620165085B499173770701006032010101010101044954520177070100600100FF010101010B0A01495452000347F0400177070100010800FF65001C010401621E52036900000000000064580101016351EF0076099B62240606A4AFD562006200726500000201710163B5F10000001B1B1B1B1A0252921B1B1B1B0101010176099B62240606A4AFD6620062007265000001017601010900000000085B47E20B0A01495452000347F04072620165085B49920163C9790076099B62240606A4AFD76200620072650000070177010B0A01495452000347F040070100620AFFFF72620165085B499273770701006032010101010101044954520177070100600100FF010101010B0A01495452000347F0400177070100010800FF65001C010401621E520369000000000000645801010163EF070076099B62240606A4AFD862006200726500000201710163C4CF0000001B1B1B1B1A022CB5 2 | -------------------------------------------------------------------------------- /tests/libsml-testing/README.md: -------------------------------------------------------------------------------- 1 | ``` 2 | #libsml-testing 3 | 4 | this is a collection of SML messages from real-world Smart Meters 5 | 6 | The Open-Source Smart-Metering community would like to get some realworld data 7 | from all those SML Smart Meters out there, so please submit some data from 8 | your SML capable device. 9 | 10 | 11 | This is very valuable information to test SML parsers, to know about the 12 | capabilities of different Smart Meters and to get an impression on how good 13 | Smart Meters behave according to the specs. 14 | 15 | Create dumps in binary and hex format from your smartmeter and submit those as 16 | follows: 17 | 18 | 1. Do proper initialization of the serial interface via stty, vzlogger, 19 | (serial interface should remain initialized 20 | after terminating vzlogger etc) 21 | 22 | 2. Dump binary data to a file like this: 23 | dd if=/dev/ttyUSB0 of=yoursmldump.bin bs=1 count=4096 iflag=fullblock 24 | 25 | 3. Convert your .bin file into .hex like this: 26 | cat yoursmldump.bin |hexdump -ve '1/1 "%.2X"' >yoursmldump.hex 27 | 28 | If you have sml data in hex format already, you can convert it into binary like this: 29 | cat yoursmldump.hex | xxd -r -p >yoursmldump.bin 30 | 31 | 4. Name your files like this: _-.bin|hex, e.g. 32 | EMH_eHZ-HW8E2AWL0EK2P.bin and EMH_eHZ-HW8E2AWL0EK2P.hex 33 | 34 | 5. If you like, add some owner/contact information, so others may contact you 35 | about your smart meter and ask questions (see FILES) 36 | 37 | 6. Please submit your files via Pull-Request, see 38 | https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/about-pull-requests 39 | If you don't like git or don't understand how to do that, you can send files via mail 40 | to devzero AT web.de . 41 | 42 | 7. Discuss about SML with others on volkszaehler-dev@lists.volkszaehler.org. 43 | 44 | 8. For decoding the binary sml data you can use the libsml parser example program from 45 | https://github.com/volkszaehler/libsml 46 | 47 | Use it like this for example: 48 | 49 | $ cat ../../libsml-testing/EMH_eHZ-GW8E2A500AK2.bin | ./sml_server - | head -n10 50 | 129-129:199.130.3*255#EMH# 51 | 1-0:0.0.0*255#02280816# 52 | 1-0:1.8.1*255#14798112.9#Wh 53 | 1-0:1.8.2*255#2012.4#Wh 54 | 0-0:96.1.255*255#0002280816# 55 | 1-0:1.7.0*255#13.8#W 56 | 129-129:199.130.3*255#EMH# 57 | 1-0:0.0.0*255#02280816# 58 | 1-0:1.8.1*255#14798113.0#Wh 59 | 1-0:1.8.2*255#2012.4#Wh 60 | 61 | 9. Do NOT use libsml from dailab github repo, as this is unmaintained. 62 | Please use https://github.com/volkszaehler/libsml , this is the official and maintained version. 63 | Report Bugs to: https://github.com/volkszaehler/libsml/issues 64 | 65 | 10. If your sml program which should process binary sml does not support stdin, you can 66 | feed binary sml via a serial fake device the following way. use that instead of 67 | /dev/ttyUSB0 or /dev/ttyS0 68 | Effectively, you simulate a serially attached smart meter this way 69 | 70 | get socat and execute 71 | # socat -d -d pty,raw,echo=0 pty,raw,echo=0 72 | 73 | socat will connect two pty's and output should look like this: 74 | 75 | # socat -d -d pty,raw,echo=0 pty,raw,echo=0 76 | 2018/01/20 22:08:48 socat[8029] N PTY is /dev/pts/6 77 | 2018/01/20 22:08:48 socat[8029] N PTY is /dev/pts/9 78 | 2018/01/20 22:08:48 socat[8029] N starting data transfer loop with FDs [5,5] and [7,7] 79 | 80 | connect your favourite SML parser/tool to one of the pty's socat did attach to: 81 | 82 | # ./sml_server /dev/pts/6 83 | 84 | now feed a binary sml dump to the other pty's: 85 | 86 | # cat EMH_eHZ-GW8E2A500AK2.bin >/dev/pts/9 87 | 88 | you can throttle the data rate with "pv" (pipe viewer) to simulate serial line slowness: 89 | 90 | # cat EMH_eHZ-GW8E2A500AK2.bin | pv -L 9600 >/dev/pts/9 91 | 92 | now watch output from your favourite SML parser/tool or troubleshoot/debug... 93 | 94 | 95 | ``` 96 | -------------------------------------------------------------------------------- /tests/libsml-testing/dzg_dwsb20_2th_2byte.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/felixwrt/sml-rs/17c1a8d73c9c992bc9b4de6560de987ec47de6ae/tests/libsml-testing/dzg_dwsb20_2th_2byte.bin -------------------------------------------------------------------------------- /tests/libsml-testing/dzg_dwsb20_2th_3byte.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/felixwrt/sml-rs/17c1a8d73c9c992bc9b4de6560de987ec47de6ae/tests/libsml-testing/dzg_dwsb20_2th_3byte.bin -------------------------------------------------------------------------------- /tests/libsml-testing/eBZ_DD3_DD32R06DTA-SMZ1.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/felixwrt/sml-rs/17c1a8d73c9c992bc9b4de6560de987ec47de6ae/tests/libsml-testing/eBZ_DD3_DD32R06DTA-SMZ1.bin -------------------------------------------------------------------------------- /tests/libsml-testing/eBZ_DD3_DD32R06DTA-SMZ1.hex: -------------------------------------------------------------------------------- 1 | 00FF6401018001621E520365000032E00177070100010801FF0101621E520365000032DF0177070100010802FF0101621E520365000000010177070100020800FF6401018001621E520365000000010101016316AD0076050116E8836200620072650000020171016354ED000000001B1B1B1B1A03A7331B1B1B1B0101010176050116E887620062007265000001017601010765425A4444330B090145425A010002EC3B010163B78E0076050116E8886200620072650000070177010B090145425A010002EC3B0172620165063B99057677078181C78203FF010101010445425A0177070100000009FF010101010B090145425A010002EC3B0177070100010800FF6401018001621E520365000032E00177070100010801FF0101621E520365000032DF0177070100010802FF0101621E520365000000010177070100020800FF6401018001621E52036500000001010101630B2D0076050116E8896200620072650000020171016366CB000000001B1B1B1B1A037CD71B1B1B1B0101010176050116E88D620062007265000001017601010765425A4444330B090145425A010002EC3B010163C7B30076050116E88E6200620072650000070177010B090145425A010002EC3B0172620165063B99067677078181C78203FF010101010445425A0177070100000009FF010101010B090145425A010002EC3B0177070100010800FF6401018001621E520365000032E00177070100010801FF0101621E520365000032DF0177070100010802FF0101621E520365000000010177070100020800FF6401018001621E520365000000010101016349050076050116E88F6200620072650000020171016388D6000000001B1B1B1B1A03E0181B1B1B1B0101010176050116E893620062007265000001017601010765425A4444330B090145425A010002EC3B01016357F40076050116E8946200620072650000070177010B090145425A010002EC3B0172620165063B99077677078181C78203FF010101010445425A0177070100000009FF010101010B090145425A010002EC3B0177070100010800FF6401018001621E520365000032E00177070100010801FF0101621E520365000032DF0177070100010802FF0101621E520365000000010177070100020800FF6401018001621E52036500000001010101630C450076050116E895620062007265000002017101636AAA000000001B1B1B1B1A0339E61B1B1B1B0101010176050116E899620062007265000001017601010765425A4444330B090145425A010002EC3B01016327C90076050116E89A6200620072650000070177010B090145425A010002EC3B0172620165063B99087677078181C78203FF010101010445425A0177070100000009FF010101010B090145425A010002EC3B0177070100010800FF6401018001621E520365000032E00177070100010801FF0101621E520365000032DF0177070100010802FF0101621E520365000000010177070100020800FF6401018001621E52036500000001010101631E0C0076050116E89B62006200726500000201710163EC9A000000001B1B1B1B1A03714F -------------------------------------------------------------------------------- /tests/libsml-testing/eBZ_DD3_DD3BZ06DTA-SMZ1_without_PIN.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/felixwrt/sml-rs/17c1a8d73c9c992bc9b4de6560de987ec47de6ae/tests/libsml-testing/eBZ_DD3_DD3BZ06DTA-SMZ1_without_PIN.bin -------------------------------------------------------------------------------- /tests/libsml-testing/eBZ_DD3_DD3BZ06DTA-SMZ1_without_PIN.hex: -------------------------------------------------------------------------------- 1 | 1B1B1B1B01010101760503507117620062007265000001017601010765425A4444330B090145425A0100104C780101631F21007605035071186200620072650000070177010B090145425A0100104C78017262016502AB4BFA7577078181C78203FF010101010445425A0177070100000009FF010101010B090145425A0100104C780177070100010800FF6401018001621E520365000011750177070100010801FF0101621E520365000011740177070100010802FF0101621E5203650000000101010163BF760076050350711962006200726500000201710163FAA10000001B1B1B1B1A0200DE1B1B1B1B0101010176050350711D620062007265000001017601010765425A4444330B090145425A0100104C780101636F1C0076050350711E6200620072650000070177010B090145425A0100104C78017262016502AB4BFB7577078181C78203FF010101010445425A0177070100000009FF010101010B090145425A0100104C780177070100010800FF6401018001621E520365000011750177070100010801FF0101621E520365000011740177070100010802FF0101621E52036500000001010101631D190076050350711F6200620072650000020171016314BC0000001B1B1B1B1A028940 2 | -------------------------------------------------------------------------------- /tests/snapshots/libsml_testing__files@DZG_DVS-7412.2_jmberg.bin.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: tests/libsml-testing.rs 3 | expression: s 4 | input_file: tests/libsml-testing/DZG_DVS-7412.2_jmberg.bin 5 | --- 6 | Ok( 7 | [ 8 | Message { 9 | transaction_id: [241, 44, 173, 7], 10 | group_no: 0, 11 | abort_on_error: 0, 12 | message_body: OpenResponse { 13 | req_file_id: [49], 14 | server_id: [10, 1, 68, 90, 71, 0, 2, 130, 34, 94], 15 | ref_time: SecIndex(99043543), 16 | sml_version: 2, 17 | }, 18 | }, 19 | Message { 20 | transaction_id: [242, 44, 173, 7], 21 | group_no: 0, 22 | abort_on_error: 0, 23 | message_body: GetListResponse { 24 | server_id: [10, 1, 68, 90, 71, 0, 2, 130, 34, 94], 25 | list_name: [1, 0, 98, 10, 255, 255], 26 | act_sensor_time: SecIndex(99043543), 27 | val_list: [ 28 | ListEntry { 29 | obj_name: [1, 0, 96, 50, 1, 1], 30 | val_time: SecIndex(0), 31 | unit: 0, 32 | scaler: 0, 33 | value: [68, 90, 71], 34 | }, 35 | ListEntry { 36 | obj_name: [1, 0, 96, 1, 0, 255], 37 | val_time: SecIndex(0), 38 | unit: 0, 39 | scaler: 0, 40 | value: [10, 1, 68, 90, 71, 0, 2, 130, 34, 94], 41 | }, 42 | ListEntry { 43 | obj_name: [1, 0, 1, 8, 0, 255], 44 | status: 1835268u32, 45 | val_time: SecIndex(0), 46 | unit: 30, 47 | scaler: -1, 48 | value: 54301577u32, 49 | }, 50 | ListEntry { 51 | obj_name: [1, 0, 2, 8, 0, 255], 52 | val_time: SecIndex(0), 53 | unit: 30, 54 | scaler: -1, 55 | value: 262445726u32, 56 | }, 57 | ListEntry { 58 | obj_name: [1, 0, 16, 7, 0, 255], 59 | val_time: SecIndex(0), 60 | unit: 27, 61 | scaler: -2, 62 | value: -29912i16, 63 | }, 64 | ], 65 | }, 66 | }, 67 | Message { 68 | transaction_id: [243, 44, 173, 7], 69 | group_no: 0, 70 | abort_on_error: 0, 71 | message_body: CloseResponse, 72 | }, 73 | ], 74 | ) 75 | 76 | -------------------------------------------------------------------------------- /tests/snapshots/libsml_testing__files@DZG_DVS-7420.2V.G2_mtr0.bin.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: tests/libsml-testing.rs 3 | expression: s 4 | input_file: tests/libsml-testing/DZG_DVS-7420.2V.G2_mtr0.bin 5 | --- 6 | Ok( 7 | [ 8 | Message { 9 | transaction_id: [113, 35, 175, 1], 10 | group_no: 0, 11 | abort_on_error: 0, 12 | message_body: OpenResponse { 13 | req_file_id: [49], 14 | server_id: [10, 1, 68, 90, 71, 0, 3, 158, 32, 84], 15 | ref_time: SecIndex(9424052), 16 | sml_version: 2, 17 | }, 18 | }, 19 | Message { 20 | transaction_id: [114, 35, 175, 1], 21 | group_no: 0, 22 | abort_on_error: 0, 23 | message_body: GetListResponse { 24 | server_id: [10, 1, 68, 90, 71, 0, 3, 158, 32, 84], 25 | list_name: [1, 0, 98, 10, 255, 255], 26 | act_sensor_time: SecIndex(9424052), 27 | val_list: [ 28 | ListEntry { 29 | obj_name: [1, 0, 96, 50, 1, 1], 30 | val_time: SecIndex(0), 31 | unit: 0, 32 | scaler: 0, 33 | value: [68, 90, 71], 34 | }, 35 | ListEntry { 36 | obj_name: [1, 0, 96, 1, 0, 255], 37 | val_time: SecIndex(0), 38 | unit: 0, 39 | scaler: 0, 40 | value: [10, 1, 68, 90, 71, 0, 3, 158, 32, 84], 41 | }, 42 | ListEntry { 43 | obj_name: [1, 0, 1, 8, 0, 255], 44 | status: 1835268u32, 45 | val_time: SecIndex(0), 46 | unit: 30, 47 | scaler: -1, 48 | value: 6074471u32, 49 | }, 50 | ListEntry { 51 | obj_name: [1, 0, 2, 8, 0, 255], 52 | val_time: SecIndex(0), 53 | unit: 30, 54 | scaler: -1, 55 | value: 12667286u32, 56 | }, 57 | ListEntry { 58 | obj_name: [1, 0, 16, 7, 0, 255], 59 | val_time: SecIndex(0), 60 | unit: 27, 61 | scaler: -2, 62 | value: 21599i16, 63 | }, 64 | ], 65 | }, 66 | }, 67 | Message { 68 | transaction_id: [115, 35, 175, 1], 69 | group_no: 0, 70 | abort_on_error: 0, 71 | message_body: CloseResponse, 72 | }, 73 | ], 74 | ) 75 | Err( 76 | DiscardedBytes( 77 | 56, 78 | ), 79 | ) 80 | 81 | -------------------------------------------------------------------------------- /tests/snapshots/libsml_testing__files@DZG_DVS-7420.2V.G2_mtr1_error.bin.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: tests/libsml-testing.rs 3 | expression: s 4 | input_file: tests/libsml-testing/DZG_DVS-7420.2V.G2_mtr1_error.bin 5 | --- 6 | Err( 7 | DiscardedBytes( 8 | 227, 9 | ), 10 | ) 11 | Err( 12 | DiscardedBytes( 13 | 481, 14 | ), 15 | ) 16 | Err( 17 | DiscardedBytes( 18 | 242, 19 | ), 20 | ) 21 | Err( 22 | DiscardedBytes( 23 | 241, 24 | ), 25 | ) 26 | Err( 27 | DiscardedBytes( 28 | 242, 29 | ), 30 | ) 31 | Err( 32 | DiscardedBytes( 33 | 163, 34 | ), 35 | ) 36 | Err( 37 | DiscardedBytes( 38 | 463, 39 | ), 40 | ) 41 | Err( 42 | DiscardedBytes( 43 | 138, 44 | ), 45 | ) 46 | 47 | -------------------------------------------------------------------------------- /tests/snapshots/libsml_testing__files@EMH-ED300L_consumption.bin.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: tests/libsml-testing.rs 3 | expression: s 4 | input_file: tests/libsml-testing/EMH-ED300L_consumption.bin 5 | --- 6 | Err( 7 | DiscardedBytes( 8 | 3281, 9 | ), 10 | ) 11 | Ok( 12 | [ 13 | Message { 14 | transaction_id: [0, 22, 4, 82, 202, 120], 15 | group_no: 0, 16 | abort_on_error: 0, 17 | message_body: OpenResponse { 18 | req_file_id: [0, 22, 15, 101, 238, 40], 19 | server_id: [6, 69, 77, 72, 1, 2, 113, 86, 205, 69], 20 | }, 21 | }, 22 | Message { 23 | transaction_id: [0, 22, 4, 82, 202, 121], 24 | group_no: 0, 25 | abort_on_error: 0, 26 | message_body: GetListResponse { 27 | server_id: [6, 69, 77, 72, 1, 2, 113, 86, 205, 69], 28 | act_sensor_time: SecIndex(258307811), 29 | val_list: [ 30 | ListEntry { 31 | obj_name: [129, 129, 199, 130, 3, 255], 32 | value: [69, 77, 72], 33 | }, 34 | ListEntry { 35 | obj_name: [1, 0, 0, 0, 9, 255], 36 | value: [6, 69, 77, 72, 1, 2, 113, 86, 205, 69], 37 | }, 38 | ListEntry { 39 | obj_name: [1, 0, 1, 8, 0, 255], 40 | status: 386u16, 41 | unit: 30, 42 | scaler: -1, 43 | value: 172433683i64, 44 | }, 45 | ListEntry { 46 | obj_name: [1, 0, 1, 8, 1, 255], 47 | unit: 30, 48 | scaler: -1, 49 | value: 172433683i64, 50 | }, 51 | ListEntry { 52 | obj_name: [1, 0, 1, 8, 2, 255], 53 | unit: 30, 54 | scaler: -1, 55 | value: 0i64, 56 | }, 57 | ListEntry { 58 | obj_name: [1, 0, 15, 7, 0, 255], 59 | unit: 27, 60 | scaler: -1, 61 | value: 1371i32, 62 | }, 63 | ListEntry { 64 | obj_name: [129, 129, 199, 130, 5, 255], 65 | value: [232, 48, 81, 239, 24, 163, 136, 220, 11, 70, 5, 219, 255, 47, 39, 185, 203, 203, 128, 163, 178, 149, 253, 156, 122, 80, 22, 212, 39, 116, 178, 208, 134, 219, 177, 87, 60, 190, 25, 56, 66, 66, 152, 64, 237, 219, 6, 160], 66 | }, 67 | ], 68 | }, 69 | }, 70 | Message { 71 | transaction_id: [0, 22, 4, 82, 202, 124], 72 | group_no: 0, 73 | abort_on_error: 0, 74 | message_body: CloseResponse, 75 | }, 76 | ], 77 | ) 78 | Err( 79 | DiscardedBytes( 80 | 499, 81 | ), 82 | ) 83 | 84 | -------------------------------------------------------------------------------- /tests/snapshots/libsml_testing__files@EMH-ED300L_delivery.bin.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: tests/libsml-testing.rs 3 | expression: s 4 | input_file: tests/libsml-testing/EMH-ED300L_delivery.bin 5 | --- 6 | Err( 7 | DiscardedBytes( 8 | 1420, 9 | ), 10 | ) 11 | Ok( 12 | [ 13 | Message { 14 | transaction_id: [0, 22, 4, 83, 15, 108], 15 | group_no: 0, 16 | abort_on_error: 0, 17 | message_body: OpenResponse { 18 | req_file_id: [0, 22, 15, 101, 5, 36], 19 | server_id: [6, 69, 77, 72, 1, 2, 113, 86, 205, 69], 20 | }, 21 | }, 22 | Message { 23 | transaction_id: [0, 22, 4, 83, 15, 109], 24 | group_no: 0, 25 | abort_on_error: 0, 26 | message_body: GetListResponse { 27 | server_id: [6, 69, 77, 72, 1, 2, 113, 86, 205, 69], 28 | act_sensor_time: SecIndex(258317595), 29 | val_list: [ 30 | ListEntry { 31 | obj_name: [129, 129, 199, 130, 3, 255], 32 | value: [69, 77, 72], 33 | }, 34 | ListEntry { 35 | obj_name: [1, 0, 0, 0, 9, 255], 36 | value: [6, 69, 77, 72, 1, 2, 113, 86, 205, 69], 37 | }, 38 | ListEntry { 39 | obj_name: [1, 0, 1, 8, 0, 255], 40 | status: 432u16, 41 | unit: 30, 42 | scaler: -1, 43 | value: 172436756i64, 44 | }, 45 | ListEntry { 46 | obj_name: [1, 0, 1, 8, 1, 255], 47 | unit: 30, 48 | scaler: -1, 49 | value: 172436756i64, 50 | }, 51 | ListEntry { 52 | obj_name: [1, 0, 1, 8, 2, 255], 53 | unit: 30, 54 | scaler: -1, 55 | value: 0i64, 56 | }, 57 | ListEntry { 58 | obj_name: [1, 0, 15, 7, 0, 255], 59 | unit: 27, 60 | scaler: -1, 61 | value: 1266i32, 62 | }, 63 | ListEntry { 64 | obj_name: [129, 129, 199, 130, 5, 255], 65 | value: [232, 48, 81, 239, 24, 163, 136, 220, 11, 70, 5, 219, 255, 47, 39, 185, 203, 203, 128, 163, 178, 149, 253, 156, 122, 80, 22, 212, 39, 116, 178, 208, 134, 219, 177, 87, 60, 190, 25, 56, 66, 66, 152, 64, 237, 219, 6, 160], 66 | }, 67 | ], 68 | }, 69 | }, 70 | Message { 71 | transaction_id: [0, 22, 4, 83, 15, 112], 72 | group_no: 0, 73 | abort_on_error: 0, 74 | message_body: CloseResponse, 75 | }, 76 | ], 77 | ) 78 | Ok( 79 | [ 80 | Message { 81 | transaction_id: [0, 22, 4, 83, 15, 114], 82 | group_no: 0, 83 | abort_on_error: 0, 84 | message_body: OpenResponse { 85 | req_file_id: [0, 22, 15, 101, 5, 38], 86 | server_id: [6, 69, 77, 72, 1, 2, 113, 86, 205, 69], 87 | }, 88 | }, 89 | Message { 90 | transaction_id: [0, 22, 4, 83, 15, 115], 91 | group_no: 0, 92 | abort_on_error: 0, 93 | message_body: GetListResponse { 94 | server_id: [6, 69, 77, 72, 1, 2, 113, 86, 205, 69], 95 | act_sensor_time: SecIndex(258317599), 96 | val_list: [ 97 | ListEntry { 98 | obj_name: [129, 129, 199, 130, 3, 255], 99 | value: [69, 77, 72], 100 | }, 101 | ListEntry { 102 | obj_name: [1, 0, 0, 0, 9, 255], 103 | value: [6, 69, 77, 72, 1, 2, 113, 86, 205, 69], 104 | }, 105 | ListEntry { 106 | obj_name: [1, 0, 1, 8, 0, 255], 107 | status: 432u16, 108 | unit: 30, 109 | scaler: -1, 110 | value: 172436756i64, 111 | }, 112 | ListEntry { 113 | obj_name: [1, 0, 1, 8, 1, 255], 114 | unit: 30, 115 | scaler: -1, 116 | value: 172436756i64, 117 | }, 118 | ListEntry { 119 | obj_name: [1, 0, 1, 8, 2, 255], 120 | unit: 30, 121 | scaler: -1, 122 | value: 0i64, 123 | }, 124 | ListEntry { 125 | obj_name: [1, 0, 15, 7, 0, 255], 126 | unit: 27, 127 | scaler: -1, 128 | value: 1265i32, 129 | }, 130 | ListEntry { 131 | obj_name: [129, 129, 199, 130, 5, 255], 132 | value: [232, 48, 81, 239, 24, 163, 136, 220, 11, 70, 5, 219, 255, 47, 39, 185, 203, 203, 128, 163, 178, 149, 253, 156, 122, 80, 22, 212, 39, 116, 178, 208, 134, 219, 177, 87, 60, 190, 25, 56, 66, 66, 152, 64, 237, 219, 6, 160], 133 | }, 134 | ], 135 | }, 136 | }, 137 | Message { 138 | transaction_id: [0, 22, 4, 83, 15, 118], 139 | group_no: 0, 140 | abort_on_error: 0, 141 | message_body: CloseResponse, 142 | }, 143 | ], 144 | ) 145 | Err( 146 | DiscardedBytes( 147 | 2028, 148 | ), 149 | ) 150 | Err( 151 | DiscardedBytes( 152 | 16, 153 | ), 154 | ) 155 | 156 | -------------------------------------------------------------------------------- /tests/snapshots/libsml_testing__files@EMH_eHZ-HW8E2A5L0EK2P_2.bin.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: tests/libsml-testing.rs 3 | expression: s 4 | input_file: tests/libsml-testing/EMH_eHZ-HW8E2A5L0EK2P_2.bin 5 | --- 6 | Ok( 7 | [ 8 | Message { 9 | transaction_id: [0, 25, 0, 85, 233, 0], 10 | group_no: 0, 11 | abort_on_error: 0, 12 | message_body: OpenResponse { 13 | req_file_id: [0, 25, 14, 166, 163, 0], 14 | server_id: [6, 69, 77, 72, 1, 2, 113, 88, 32, 81], 15 | }, 16 | }, 17 | Message { 18 | transaction_id: [0, 25, 0, 85, 233, 1], 19 | group_no: 0, 20 | abort_on_error: 0, 21 | message_body: GetListResponse { 22 | server_id: [6, 69, 77, 72, 1, 2, 113, 88, 32, 81], 23 | act_sensor_time: SecIndex(245817516), 24 | val_list: [ 25 | ListEntry { 26 | obj_name: [129, 129, 199, 130, 3, 255], 27 | value: [69, 77, 72], 28 | }, 29 | ListEntry { 30 | obj_name: [1, 0, 0, 0, 9, 255], 31 | value: [6, 69, 77, 72, 1, 2, 113, 88, 32, 81], 32 | }, 33 | ListEntry { 34 | obj_name: [1, 0, 1, 8, 0, 255], 35 | status: 386u16, 36 | unit: 30, 37 | scaler: -1, 38 | value: 133124849i64, 39 | }, 40 | ListEntry { 41 | obj_name: [1, 0, 1, 8, 1, 255], 42 | unit: 30, 43 | scaler: -1, 44 | value: 133124849i64, 45 | }, 46 | ListEntry { 47 | obj_name: [1, 0, 1, 8, 2, 255], 48 | unit: 30, 49 | scaler: -1, 50 | value: 0i64, 51 | }, 52 | ListEntry { 53 | obj_name: [1, 0, 15, 7, 0, 255], 54 | unit: 27, 55 | scaler: -1, 56 | value: 1394i32, 57 | }, 58 | ListEntry { 59 | obj_name: [129, 129, 199, 130, 5, 255], 60 | value: [25, 146, 26, 82, 101, 100, 172, 186, 227, 2, 110, 97, 53, 38, 117, 236, 40, 39, 102, 131, 240, 45, 187, 50, 250, 112, 30, 58, 117, 59, 52, 33, 139, 100, 102, 177, 80, 100, 223, 89, 25, 249, 241, 63, 132, 181, 178, 201], 61 | }, 62 | ], 63 | }, 64 | }, 65 | Message { 66 | transaction_id: [0, 25, 0, 85, 233, 4], 67 | group_no: 0, 68 | abort_on_error: 0, 69 | message_body: CloseResponse, 70 | }, 71 | ], 72 | ) 73 | 74 | -------------------------------------------------------------------------------- /tests/snapshots/libsml_testing__files@EMH_eHZ361L5R.bin.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: tests/libsml-testing.rs 3 | expression: s 4 | input_file: tests/libsml-testing/EMH_eHZ361L5R.bin 5 | --- 6 | Ok( 7 | [ 8 | Message { 9 | transaction_id: [152, 224, 206, 149], 10 | group_no: 0, 11 | abort_on_error: 0, 12 | message_body: OpenResponse { 13 | req_file_id: [72, 97, 103, 8, 66, 25, 173], 14 | server_id: [49, 48, 48, 49, 49, 56, 53], 15 | }, 16 | }, 17 | Message { 18 | transaction_id: [152, 224, 206, 150], 19 | group_no: 0, 20 | abort_on_error: 0, 21 | message_body: GetListResponse { 22 | server_id: [49, 48, 48, 49, 49, 56, 53], 23 | val_list: [ 24 | ListEntry { 25 | obj_name: [129, 129, 199, 130, 3, 255], 26 | value: [72, 65, 71, 69, 82], 27 | }, 28 | ListEntry { 29 | obj_name: [1, 0, 0, 0, 0, 255], 30 | value: [49, 48, 48, 49, 49, 56, 53], 31 | }, 32 | ListEntry { 33 | obj_name: [1, 0, 2, 8, 1, 255], 34 | status: 130u8, 35 | unit: 30, 36 | scaler: -1, 37 | value: 1103403151u64, 38 | }, 39 | ListEntry { 40 | obj_name: [0, 0, 96, 1, 255, 255], 41 | value: [48, 48, 48, 48, 49, 49, 54, 57, 49, 55], 42 | }, 43 | ListEntry { 44 | obj_name: [1, 0, 1, 7, 1, 255], 45 | status: 130u8, 46 | unit: 27, 47 | scaler: -4, 48 | value: -56321916i32, 49 | }, 50 | ], 51 | }, 52 | }, 53 | Message { 54 | transaction_id: [152, 224, 206, 151], 55 | group_no: 0, 56 | abort_on_error: 0, 57 | message_body: CloseResponse, 58 | }, 59 | ], 60 | ) 61 | 62 | -------------------------------------------------------------------------------- /tests/snapshots/libsml_testing__files@EMH_eHZ361L5R_1.bin.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: tests/libsml-testing.rs 3 | expression: s 4 | input_file: tests/libsml-testing/EMH_eHZ361L5R_1.bin 5 | --- 6 | Ok( 7 | [ 8 | Message { 9 | transaction_id: [153, 170, 156, 171], 10 | group_no: 0, 11 | abort_on_error: 0, 12 | message_body: OpenResponse { 13 | req_file_id: [72, 97, 103, 8, 133, 94, 95], 14 | server_id: [49, 48, 48, 49, 49, 56, 53], 15 | }, 16 | }, 17 | Message { 18 | transaction_id: [153, 170, 156, 172], 19 | group_no: 0, 20 | abort_on_error: 0, 21 | message_body: GetListResponse { 22 | server_id: [49, 48, 48, 49, 49, 56, 53], 23 | val_list: [ 24 | ListEntry { 25 | obj_name: [129, 129, 199, 130, 3, 255], 26 | value: [72, 65, 71, 69, 82], 27 | }, 28 | ListEntry { 29 | obj_name: [1, 0, 0, 0, 0, 255], 30 | value: [49, 48, 48, 49, 49, 56, 53], 31 | }, 32 | ListEntry { 33 | obj_name: [1, 0, 2, 8, 1, 255], 34 | status: 130u8, 35 | unit: 30, 36 | scaler: -1, 37 | value: 1144274020u64, 38 | }, 39 | ListEntry { 40 | obj_name: [0, 0, 96, 1, 255, 255], 41 | value: [48, 48, 48, 48, 49, 49, 54, 57, 49, 55], 42 | }, 43 | ListEntry { 44 | obj_name: [1, 0, 1, 7, 1, 255], 45 | status: 130u8, 46 | unit: 27, 47 | scaler: -4, 48 | value: -7697170i32, 49 | }, 50 | ], 51 | }, 52 | }, 53 | Message { 54 | transaction_id: [153, 170, 156, 173], 55 | group_no: 0, 56 | abort_on_error: 0, 57 | message_body: CloseResponse, 58 | }, 59 | ], 60 | ) 61 | 62 | -------------------------------------------------------------------------------- /tests/snapshots/libsml_testing__files@HOLLEY_DTZ541-BDBA_with_PIN.bin.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: tests/libsml-testing.rs 3 | expression: s 4 | input_file: tests/libsml-testing/HOLLEY_DTZ541-BDBA_with_PIN.bin 5 | --- 6 | Ok( 7 | [ 8 | Message { 9 | transaction_id: [0, 0, 1], 10 | group_no: 0, 11 | abort_on_error: 0, 12 | message_body: OpenResponse { 13 | req_file_id: [0, 0, 1, 113, 98, 168], 14 | server_id: [10, 1, 72, 76, 89, 2, 0, 13, 107, 230], 15 | ref_time: SecIndex(24208040), 16 | }, 17 | }, 18 | Message { 19 | transaction_id: [0, 0, 2], 20 | group_no: 0, 21 | abort_on_error: 0, 22 | message_body: GetListResponse { 23 | client_id: [255, 255, 255, 255, 255, 255], 24 | server_id: [10, 1, 72, 76, 89, 2, 0, 13, 107, 230], 25 | list_name: [1, 0, 98, 10, 255, 255], 26 | act_sensor_time: SecIndex(24208040), 27 | val_list: [ 28 | ListEntry { 29 | obj_name: [1, 0, 96, 50, 1, 1], 30 | value: [72, 76, 89], 31 | }, 32 | ListEntry { 33 | obj_name: [1, 0, 96, 1, 0, 255], 34 | value: [10, 1, 72, 76, 89, 2, 0, 13, 107, 230], 35 | }, 36 | ListEntry { 37 | obj_name: [1, 0, 1, 8, 0, 255], 38 | status: 1835268u32, 39 | val_time: SecIndex(24208040), 40 | unit: 30, 41 | scaler: -1, 42 | value: 23559290u32, 43 | }, 44 | ListEntry { 45 | obj_name: [1, 0, 16, 7, 0, 255], 46 | unit: 27, 47 | scaler: 0, 48 | value: 376i16, 49 | }, 50 | ], 51 | }, 52 | }, 53 | Message { 54 | transaction_id: [0, 0, 3], 55 | group_no: 0, 56 | abort_on_error: 0, 57 | message_body: CloseResponse, 58 | }, 59 | ], 60 | ) 61 | Ok( 62 | [ 63 | Message { 64 | transaction_id: [0, 0, 1], 65 | group_no: 0, 66 | abort_on_error: 0, 67 | message_body: OpenResponse { 68 | req_file_id: [0, 0, 1, 113, 98, 169], 69 | server_id: [10, 1, 72, 76, 89, 2, 0, 13, 107, 230], 70 | ref_time: SecIndex(24208041), 71 | }, 72 | }, 73 | Message { 74 | transaction_id: [0, 0, 2], 75 | group_no: 0, 76 | abort_on_error: 0, 77 | message_body: GetListResponse { 78 | client_id: [255, 255, 255, 255, 255, 255], 79 | server_id: [10, 1, 72, 76, 89, 2, 0, 13, 107, 230], 80 | list_name: [1, 0, 98, 10, 255, 255], 81 | act_sensor_time: SecIndex(24208041), 82 | val_list: [ 83 | ListEntry { 84 | obj_name: [1, 0, 96, 50, 1, 1], 85 | value: [72, 76, 89], 86 | }, 87 | ListEntry { 88 | obj_name: [1, 0, 96, 1, 0, 255], 89 | value: [10, 1, 72, 76, 89, 2, 0, 13, 107, 230], 90 | }, 91 | ListEntry { 92 | obj_name: [1, 0, 1, 8, 0, 255], 93 | status: 1835268u32, 94 | val_time: SecIndex(24208041), 95 | unit: 30, 96 | scaler: -1, 97 | value: 23559291u32, 98 | }, 99 | ListEntry { 100 | obj_name: [1, 0, 16, 7, 0, 255], 101 | unit: 27, 102 | scaler: 0, 103 | value: 374i16, 104 | }, 105 | ], 106 | }, 107 | }, 108 | Message { 109 | transaction_id: [0, 0, 3], 110 | group_no: 0, 111 | abort_on_error: 0, 112 | message_body: CloseResponse, 113 | }, 114 | ], 115 | ) 116 | 117 | -------------------------------------------------------------------------------- /tests/snapshots/libsml_testing__files@HOLLEY_DTZ541-BDBA_without_PIN.bin.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: tests/libsml-testing.rs 3 | expression: s 4 | input_file: tests/libsml-testing/HOLLEY_DTZ541-BDBA_without_PIN.bin 5 | --- 6 | Ok( 7 | [ 8 | Message { 9 | transaction_id: [0, 0, 1], 10 | group_no: 0, 11 | abort_on_error: 0, 12 | message_body: OpenResponse { 13 | req_file_id: [0, 0, 1, 108, 84, 176], 14 | server_id: [10, 1, 72, 76, 89, 2, 0, 13, 107, 230], 15 | ref_time: SecIndex(23876784), 16 | }, 17 | }, 18 | Message { 19 | transaction_id: [0, 0, 2], 20 | group_no: 0, 21 | abort_on_error: 0, 22 | message_body: GetListResponse { 23 | client_id: [255, 255, 255, 255, 255, 255], 24 | server_id: [10, 1, 72, 76, 89, 2, 0, 13, 107, 230], 25 | list_name: [1, 0, 98, 10, 255, 255], 26 | act_sensor_time: SecIndex(23876784), 27 | val_list: [ 28 | ListEntry { 29 | obj_name: [1, 0, 96, 50, 1, 1], 30 | value: [72, 76, 89], 31 | }, 32 | ListEntry { 33 | obj_name: [1, 0, 96, 1, 0, 255], 34 | value: [10, 1, 72, 76, 89, 2, 0, 13, 107, 230], 35 | }, 36 | ListEntry { 37 | obj_name: [1, 0, 1, 8, 0, 255], 38 | status: 1835268u32, 39 | val_time: SecIndex(23876784), 40 | unit: 30, 41 | scaler: 3, 42 | value: 2324u16, 43 | }, 44 | ], 45 | }, 46 | }, 47 | Message { 48 | transaction_id: [0, 0, 3], 49 | group_no: 0, 50 | abort_on_error: 0, 51 | message_body: CloseResponse, 52 | }, 53 | ], 54 | ) 55 | 56 | -------------------------------------------------------------------------------- /tests/snapshots/libsml_testing__files@ISKRA_MT631-D2A51-V22-K0z_without_PIN.bin.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: tests/libsml-testing.rs 3 | expression: s 4 | input_file: tests/libsml-testing/ISKRA_MT631-D2A51-V22-K0z_without_PIN.bin 5 | --- 6 | Ok( 7 | [ 8 | Message { 9 | transaction_id: [19, 0, 136, 145], 10 | group_no: 0, 11 | abort_on_error: 0, 12 | message_body: OpenResponse { 13 | req_file_id: [6, 85, 130, 219], 14 | server_id: [10, 1, 73, 83, 75, 0, 4, 84, 169, 95], 15 | ref_time: SecIndex(106267790), 16 | sml_version: 1, 17 | }, 18 | }, 19 | Message { 20 | transaction_id: [19, 0, 136, 146], 21 | group_no: 0, 22 | abort_on_error: 0, 23 | message_body: GetListResponse { 24 | server_id: [10, 1, 73, 83, 75, 0, 4, 84, 169, 95], 25 | list_name: [1, 0, 98, 10, 255, 255], 26 | act_sensor_time: SecIndex(106267790), 27 | val_list: [ 28 | ListEntry { 29 | obj_name: [1, 0, 96, 50, 1, 1], 30 | value: [73, 83, 75], 31 | }, 32 | ListEntry { 33 | obj_name: [1, 0, 96, 1, 0, 255], 34 | value: [10, 1, 73, 83, 75, 0, 4, 84, 169, 95], 35 | }, 36 | ListEntry { 37 | obj_name: [1, 0, 1, 8, 0, 255], 38 | status: 1835012u32, 39 | unit: 30, 40 | scaler: 3, 41 | value: 16786u16, 42 | }, 43 | ListEntry { 44 | obj_name: [1, 0, 1, 8, 1, 255], 45 | unit: 30, 46 | scaler: 3, 47 | value: 4u8, 48 | }, 49 | ListEntry { 50 | obj_name: [1, 0, 1, 8, 2, 255], 51 | unit: 30, 52 | scaler: 3, 53 | value: 16782u16, 54 | }, 55 | ], 56 | }, 57 | }, 58 | Message { 59 | transaction_id: [19, 0, 136, 147], 60 | group_no: 0, 61 | abort_on_error: 0, 62 | message_body: CloseResponse, 63 | }, 64 | ], 65 | ) 66 | Ok( 67 | [ 68 | Message { 69 | transaction_id: [19, 0, 136, 148], 70 | group_no: 0, 71 | abort_on_error: 0, 72 | message_body: OpenResponse { 73 | req_file_id: [6, 85, 130, 220], 74 | server_id: [10, 1, 73, 83, 75, 0, 4, 84, 169, 95], 75 | ref_time: SecIndex(106267791), 76 | sml_version: 1, 77 | }, 78 | }, 79 | Message { 80 | transaction_id: [19, 0, 136, 149], 81 | group_no: 0, 82 | abort_on_error: 0, 83 | message_body: GetListResponse { 84 | server_id: [10, 1, 73, 83, 75, 0, 4, 84, 169, 95], 85 | list_name: [1, 0, 98, 10, 255, 255], 86 | act_sensor_time: SecIndex(106267791), 87 | val_list: [ 88 | ListEntry { 89 | obj_name: [1, 0, 96, 50, 1, 1], 90 | value: [73, 83, 75], 91 | }, 92 | ListEntry { 93 | obj_name: [1, 0, 96, 1, 0, 255], 94 | value: [10, 1, 73, 83, 75, 0, 4, 84, 169, 95], 95 | }, 96 | ListEntry { 97 | obj_name: [1, 0, 1, 8, 0, 255], 98 | status: 1835012u32, 99 | unit: 30, 100 | scaler: 3, 101 | value: 16786u16, 102 | }, 103 | ListEntry { 104 | obj_name: [1, 0, 1, 8, 1, 255], 105 | unit: 30, 106 | scaler: 3, 107 | value: 4u8, 108 | }, 109 | ListEntry { 110 | obj_name: [1, 0, 1, 8, 2, 255], 111 | unit: 30, 112 | scaler: 3, 113 | value: 16782u16, 114 | }, 115 | ], 116 | }, 117 | }, 118 | Message { 119 | transaction_id: [19, 0, 136, 150], 120 | group_no: 0, 121 | abort_on_error: 0, 122 | message_body: CloseResponse, 123 | }, 124 | ], 125 | ) 126 | 127 | -------------------------------------------------------------------------------- /tests/snapshots/libsml_testing__files@ITRON_OpenWay-3.HZ.bin.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: tests/libsml-testing.rs 3 | expression: s 4 | input_file: tests/libsml-testing/ITRON_OpenWay-3.HZ.bin 5 | --- 6 | Ok( 7 | [ 8 | Message { 9 | transaction_id: [228, 6, 0, 0, 9, 153, 135, 217], 10 | group_no: 0, 11 | abort_on_error: 0, 12 | message_body: OpenResponse { 13 | req_file_id: [0, 0, 0, 0, 3, 51, 52, 44], 14 | server_id: [10, 1, 73, 84, 82, 0, 3, 72, 245, 142], 15 | ref_time: SecIndex(53687960), 16 | }, 17 | }, 18 | Message { 19 | transaction_id: [228, 6, 0, 0, 9, 153, 135, 218], 20 | group_no: 0, 21 | abort_on_error: 0, 22 | message_body: GetListResponse { 23 | server_id: [10, 1, 73, 84, 82, 0, 3, 72, 245, 142], 24 | list_name: [1, 0, 98, 10, 255, 255], 25 | act_sensor_time: SecIndex(53687960), 26 | val_list: [ 27 | ListEntry { 28 | obj_name: [1, 0, 96, 50, 1, 1], 29 | value: [73, 84, 82], 30 | }, 31 | ListEntry { 32 | obj_name: [1, 0, 96, 1, 0, 255], 33 | value: [10, 1, 73, 84, 82, 0, 3, 72, 245, 142], 34 | }, 35 | ListEntry { 36 | obj_name: [1, 0, 1, 8, 0, 255], 37 | status: 1835268u32, 38 | unit: 30, 39 | scaler: -1, 40 | value: 81895949u64, 41 | }, 42 | ListEntry { 43 | obj_name: [1, 0, 16, 7, 0, 255], 44 | unit: 27, 45 | scaler: 0, 46 | value: 613i32, 47 | }, 48 | ], 49 | }, 50 | }, 51 | Message { 52 | transaction_id: [228, 6, 0, 0, 9, 153, 135, 219], 53 | group_no: 0, 54 | abort_on_error: 0, 55 | message_body: CloseResponse, 56 | }, 57 | ], 58 | ) 59 | 60 | -------------------------------------------------------------------------------- /tests/snapshots/libsml_testing__files@ITRON_OpenWay-3.HZ_without_PIN.bin.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: tests/libsml-testing.rs 3 | expression: s 4 | input_file: tests/libsml-testing/ITRON_OpenWay-3.HZ_without_PIN.bin 5 | --- 6 | Ok( 7 | [ 8 | Message { 9 | transaction_id: [155, 98, 36, 6, 6, 164, 175, 211], 10 | group_no: 0, 11 | abort_on_error: 0, 12 | message_body: OpenResponse { 13 | req_file_id: [0, 0, 0, 0, 8, 91, 71, 225], 14 | server_id: [10, 1, 73, 84, 82, 0, 3, 71, 240, 64], 15 | ref_time: SecIndex(140200337), 16 | }, 17 | }, 18 | Message { 19 | transaction_id: [155, 98, 36, 6, 6, 164, 175, 212], 20 | group_no: 0, 21 | abort_on_error: 0, 22 | message_body: GetListResponse { 23 | server_id: [10, 1, 73, 84, 82, 0, 3, 71, 240, 64], 24 | list_name: [1, 0, 98, 10, 255, 255], 25 | act_sensor_time: SecIndex(140200337), 26 | val_list: [ 27 | ListEntry { 28 | obj_name: [1, 0, 96, 50, 1, 1], 29 | value: [73, 84, 82], 30 | }, 31 | ListEntry { 32 | obj_name: [1, 0, 96, 1, 0, 255], 33 | value: [10, 1, 73, 84, 82, 0, 3, 71, 240, 64], 34 | }, 35 | ListEntry { 36 | obj_name: [1, 0, 1, 8, 0, 255], 37 | status: 1835268u32, 38 | unit: 30, 39 | scaler: 3, 40 | value: 25688u64, 41 | }, 42 | ], 43 | }, 44 | }, 45 | Message { 46 | transaction_id: [155, 98, 36, 6, 6, 164, 175, 213], 47 | group_no: 0, 48 | abort_on_error: 0, 49 | message_body: CloseResponse, 50 | }, 51 | ], 52 | ) 53 | Ok( 54 | [ 55 | Message { 56 | transaction_id: [155, 98, 36, 6, 6, 164, 175, 214], 57 | group_no: 0, 58 | abort_on_error: 0, 59 | message_body: OpenResponse { 60 | req_file_id: [0, 0, 0, 0, 8, 91, 71, 226], 61 | server_id: [10, 1, 73, 84, 82, 0, 3, 71, 240, 64], 62 | ref_time: SecIndex(140200338), 63 | }, 64 | }, 65 | Message { 66 | transaction_id: [155, 98, 36, 6, 6, 164, 175, 215], 67 | group_no: 0, 68 | abort_on_error: 0, 69 | message_body: GetListResponse { 70 | server_id: [10, 1, 73, 84, 82, 0, 3, 71, 240, 64], 71 | list_name: [1, 0, 98, 10, 255, 255], 72 | act_sensor_time: SecIndex(140200338), 73 | val_list: [ 74 | ListEntry { 75 | obj_name: [1, 0, 96, 50, 1, 1], 76 | value: [73, 84, 82], 77 | }, 78 | ListEntry { 79 | obj_name: [1, 0, 96, 1, 0, 255], 80 | value: [10, 1, 73, 84, 82, 0, 3, 71, 240, 64], 81 | }, 82 | ListEntry { 83 | obj_name: [1, 0, 1, 8, 0, 255], 84 | status: 1835268u32, 85 | unit: 30, 86 | scaler: 3, 87 | value: 25688u64, 88 | }, 89 | ], 90 | }, 91 | }, 92 | Message { 93 | transaction_id: [155, 98, 36, 6, 6, 164, 175, 216], 94 | group_no: 0, 95 | abort_on_error: 0, 96 | message_body: CloseResponse, 97 | }, 98 | ], 99 | ) 100 | 101 | -------------------------------------------------------------------------------- /tests/snapshots/libsml_testing__files@eBZ_DD3_DD3BZ06DTA-SMZ1_without_PIN.bin.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: tests/libsml-testing.rs 3 | expression: s 4 | input_file: tests/libsml-testing/eBZ_DD3_DD3BZ06DTA-SMZ1_without_PIN.bin 5 | --- 6 | Ok( 7 | [ 8 | Message { 9 | transaction_id: [3, 80, 113, 23], 10 | group_no: 0, 11 | abort_on_error: 0, 12 | message_body: OpenResponse { 13 | req_file_id: [101, 66, 90, 68, 68, 51], 14 | server_id: [9, 1, 69, 66, 90, 1, 0, 16, 76, 120], 15 | }, 16 | }, 17 | Message { 18 | transaction_id: [3, 80, 113, 24], 19 | group_no: 0, 20 | abort_on_error: 0, 21 | message_body: GetListResponse { 22 | server_id: [9, 1, 69, 66, 90, 1, 0, 16, 76, 120], 23 | act_sensor_time: SecIndex(44780538), 24 | val_list: [ 25 | ListEntry { 26 | obj_name: [129, 129, 199, 130, 3, 255], 27 | value: [69, 66, 90], 28 | }, 29 | ListEntry { 30 | obj_name: [1, 0, 0, 0, 9, 255], 31 | value: [9, 1, 69, 66, 90, 1, 0, 16, 76, 120], 32 | }, 33 | ListEntry { 34 | obj_name: [1, 0, 1, 8, 0, 255], 35 | status: 65920u32, 36 | unit: 30, 37 | scaler: 3, 38 | value: 4469u32, 39 | }, 40 | ListEntry { 41 | obj_name: [1, 0, 1, 8, 1, 255], 42 | unit: 30, 43 | scaler: 3, 44 | value: 4468u32, 45 | }, 46 | ListEntry { 47 | obj_name: [1, 0, 1, 8, 2, 255], 48 | unit: 30, 49 | scaler: 3, 50 | value: 1u32, 51 | }, 52 | ], 53 | }, 54 | }, 55 | Message { 56 | transaction_id: [3, 80, 113, 25], 57 | group_no: 0, 58 | abort_on_error: 0, 59 | message_body: CloseResponse, 60 | }, 61 | ], 62 | ) 63 | Ok( 64 | [ 65 | Message { 66 | transaction_id: [3, 80, 113, 29], 67 | group_no: 0, 68 | abort_on_error: 0, 69 | message_body: OpenResponse { 70 | req_file_id: [101, 66, 90, 68, 68, 51], 71 | server_id: [9, 1, 69, 66, 90, 1, 0, 16, 76, 120], 72 | }, 73 | }, 74 | Message { 75 | transaction_id: [3, 80, 113, 30], 76 | group_no: 0, 77 | abort_on_error: 0, 78 | message_body: GetListResponse { 79 | server_id: [9, 1, 69, 66, 90, 1, 0, 16, 76, 120], 80 | act_sensor_time: SecIndex(44780539), 81 | val_list: [ 82 | ListEntry { 83 | obj_name: [129, 129, 199, 130, 3, 255], 84 | value: [69, 66, 90], 85 | }, 86 | ListEntry { 87 | obj_name: [1, 0, 0, 0, 9, 255], 88 | value: [9, 1, 69, 66, 90, 1, 0, 16, 76, 120], 89 | }, 90 | ListEntry { 91 | obj_name: [1, 0, 1, 8, 0, 255], 92 | status: 65920u32, 93 | unit: 30, 94 | scaler: 3, 95 | value: 4469u32, 96 | }, 97 | ListEntry { 98 | obj_name: [1, 0, 1, 8, 1, 255], 99 | unit: 30, 100 | scaler: 3, 101 | value: 4468u32, 102 | }, 103 | ListEntry { 104 | obj_name: [1, 0, 1, 8, 2, 255], 105 | unit: 30, 106 | scaler: 3, 107 | value: 1u32, 108 | }, 109 | ], 110 | }, 111 | }, 112 | Message { 113 | transaction_id: [3, 80, 113, 31], 114 | group_no: 0, 115 | abort_on_error: 0, 116 | message_body: CloseResponse, 117 | }, 118 | ], 119 | ) 120 | 121 | --------------------------------------------------------------------------------