Skip to content

Commit

Permalink
adding documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
maebli committed Mar 31, 2024
1 parent 43f1cdf commit 0caafeb
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
5 changes: 5 additions & 0 deletions CONTRIBUTING.md
Expand Up @@ -4,6 +4,11 @@ This docuement is new, so its much appreciated, if you ask question or give feed

This document aims to provide a guideline for people wanting to contribute to the project. It does not aim to describe the project, please see the README.md for this.

# Playful start


Before diving into the code a good starting point for understanding what the project is about and what one of the use cases is, you can play with the (live decode in javascript called tmbus)[https://dev-lab.github.io/tmbus/tmbus.htm]. This will provide a good intuition for what the project is about. Go to the folder `tests/rscada/test-frames` and copy the hex string into the input field of the tmbus website. See what the expected output is. Try to undestand the output. Change the input and see how the output changes. Note, becasue there is a check sum changing the input manually is not trivial and requires calculating the right checksum for the frame.

# Conduct

Code of conduct is taken form the [rust project code of conduct](https://www.rust-lang.org/policies/code-of-conduct).
Expand Down
7 changes: 6 additions & 1 deletion README.md
Expand Up @@ -6,19 +6,24 @@

### Introduction

** For contributing see [CONTRIBUTING.md](./CONTRIBUTING.md) **

m-bus-parser is an open source parser (sometimes also refered to as decoder and/or deserializer) of **wired** m-bus portocol and is written in rust.

"M-Bus or Meter-Bus is a European standard (EN 13757-2 physical and link layer, EN 13757-3 application layer) for the remote reading of water, gas or electricity meters. M-Bus is also usable for other types of consumption meters, such as heating systems or water meters. The M-Bus interface is made for communication on two wires, making it cost-effective." - [Wikipedia](https://en.wikipedia.org/wiki/Meter-Bus)

An outdated specification is available freely on the [m-bus website](https://m-bus.com/documentation). This document is a good starting point for understanding the protocol. There have been many other implementations of the specification.
An outdated specification is available freely on the [m-bus website](https://m-bus.com/documentation). This document is a good starting point for understanding the protocol. There have been many other implementations of the specification.

Furthermore, the Open Metering System (OMS) Group has published a specification for the m-bus protocol. This specification is available for free on the [OMS website](https://www.oms-group.org/en/) or more specificially [here](https://oms-group.org/en/open-metering-system/oms-specification).


such as a no longer maitained [ m-bus encoder and decoder by rscada](https://github.com/rscada/libmbus) written in **c**, [jMbus](https://github.com/qvest-digital/jmbus) written in **java**,[Valley.Net.Protocols.MeterBus](https://github.com/sympthom/Valley.Net.Protocols.MeterBus/) written in **C#**, [tmbus](https://dev-lab.github.io/tmbus/) written in javascript or [pyMeterBus](https://github.com/ganehag/pyMeterBus) written in python.


### Visualization of Library Function

Do not get confused about the different types of frame types. The most important one to understand at first is the `LongFrame` which is the most common frame type. The others are for example for searching for a slave or for setting the primary address of a slave. This is not of primary intrest for most users. Visualization was made with the help of the tool [excalidraw](https://excalidraw.com/).

![](./resources/function.png)

### Visualization of Serialized Application Layer
Expand Down

0 comments on commit 0caafeb

Please sign in to comment.