1 Commits

Author SHA1 Message Date
61f6942448 Fix Frame Count Bit handling
Extend mbus_send_request_frame() to set FCB
Set FCB in case of primary adressing
2015-06-27 12:55:12 +02:00
276 changed files with 851 additions and 18278 deletions

View File

@ -1,2 +0,0 @@
/_build
/build

View File

@ -1,58 +0,0 @@
name: CMake
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: build examples and tests
run: |
rm -rf build || true
mkdir -p build
cd build
cmake .. -DLIBMBUS_BUILD_EXAMPLES=ON -DLIBMBUS_BUILD_TESTS=ON -DLIBMBUS_ENABLE_COVERAGE=ON && cmake --build . -j
cd ..
- name: generate test frames
run: |
./test/generate-xml.sh test/test-frames
echo "NOTE: error-frames have about 30 parse errors, and unsupported-frames have 12"
./test/generate-xml.sh test/error-frames || true
./test/generate-xml.sh test/unsupported-frames || true
- name: install and run gcovr
run: sudo pip install gcovr && gcovr build/.
debian:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: build debian package
run: |
rm -rf build || true
mkdir -p build
cd build
cmake .. -DLIBMBUS_PACKAGE_DEB=ON
cpack ..
sudo dpkg -i *.deb
ls /usr/lib
doc:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: build doxygen documentation
run: sudo apt install -y doxygen
- name: build doxygen documentation
run: |
rm -rf build || true
mkdir build
cd build
cmake .. -DLIBMBUS_BUILD_DOCS=ON
cmake --build . --target doc

17
.gitignore vendored
View File

@ -10,6 +10,7 @@ test/Makefile.in
/compile /compile
config.guess config.guess
config.sub config.sub
config.h.in
configure configure
/depcomp /depcomp
/install-sh /install-sh
@ -51,7 +52,6 @@ bin/mbus-serial-request-data-multi-reply
bin/mbus-serial-scan bin/mbus-serial-scan
bin/mbus-serial-scan-secondary bin/mbus-serial-scan-secondary
bin/mbus-serial-select-secondary bin/mbus-serial-select-secondary
bin/mbus-serial-set-address
bin/mbus-serial-switch-baudrate bin/mbus-serial-switch-baudrate
bin/mbus-tcp-raw-send bin/mbus-tcp-raw-send
bin/mbus-tcp-request-data bin/mbus-tcp-request-data
@ -62,18 +62,3 @@ bin/mbus-tcp-select-secondary
bin/mbus-tcp-application-reset bin/mbus-tcp-application-reset
!*.c !*.c
# test binaries
test/mbus_parse
test/mbus_parse_hex
# test cases temp files
test/test-frames/*.xml.new
test/error-frames/*.xml.new
test/unsupported-frames/*.xml.new
/build/
_build/
# IDE
/.vscode/
CMakeLists.txt.user

View File

@ -4,12 +4,4 @@ compiler:
- gcc - gcc
- clang - clang
os: script: ./build.sh
- linux
- osx
script:
- ./build.sh
- cd test && make && ./generate-xml.sh test-frames
- cd test && make && ./generate-xml.sh test/error-frames || true
- cd test && make && ./generate-xml.sh test/unsupported-frames || true

View File

@ -1,309 +0,0 @@
cmake_minimum_required(VERSION 3.5)
project(
libmbus
LANGUAGES CXX C
VERSION "0.9.0")
if(CMAKE_BUILD_TYPE STREQUAL "")
message(STATUS "CMAKE_BUILD_TYPE empty setting to Debug")
set(CMAKE_BUILD_TYPE "Debug")
endif()
# ##############################################################################
# default options -> changed with e.g. cd build && cmake ..
# -DLIBMBUS_BUILD_TESTS=ON
# ##############################################################################
option(LIBMBUS_BUILD_EXAMPLES "build examples" OFF)
option(LIBMBUS_BUILD_TESTS "build tests" OFF)
option(LIBMBUS_ENABLE_COVERAGE "build with coverage support" OFF)
option(LIBMBUS_RUN_CLANG_TIDY "use Clang-Tidy for static analysis" OFF)
option(LIBMBUS_PACKAGE_DEB "build debian package" OFF)
option(LIBMBUS_PACKAGE_RPM "build rpm package" OFF)
option(LIBMBUS_BUILD_DOCS "build documentation" OFF)
option(BUILD_SHARED_LIBS "build shared lib" ON)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_C_STANDARD 11)
# Append our module directory to CMake
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake" "${CMAKE_BINARY_DIR}")
# Set the output of the libraries and executables.
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
set(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib)
# ##############################################################################
# static analysis
# ##############################################################################
if(LIBMBUS_RUN_CLANG_TIDY)
find_program(
CLANG_TIDY_EXE
NAMES "clang-tidy"
DOC "/usr/bin/clang-tidy")
if(NOT CLANG_TIDY_EXE)
message(WARNING "clang-tidy not found.")
else()
message(STATUS "clang-tidy found: ${CLANG_TIDY_EXE}")
endif()
endif(LIBMBUS_RUN_CLANG_TIDY)
if(LIBMBUS_ENABLE_COVERAGE)
if(NOT CMAKE_BUILD_TYPE MATCHES "(Debug)|(RelWithDebInfo)")
message(WARNING "Code coverage results with an optimised (non-Debug) build may be misleading")
endif()
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
# using Clang
message(STATUS "Not doing coverage...")
elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
# using GCC
message(STATUS "Building with code coverage...")
set(CMAKE_BUILD_TYPE DEBUG)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -ggdb3 -O0 --coverage -fprofile-arcs -ftest-coverage")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC -ggdb3 -O0 --coverage -fprofile-arcs -ftest-coverage ")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_CXX_FLAGS} --coverage -fprofile-arcs -ftest-coverage ")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_CXX_FLAGS} --coverage -fprofile-arcs -ftest-coverage ")
link_libraries(-lgcov)
endif()
endif()
include(CheckIncludeFile)
check_include_file(dlfcn.h HAVE_DLFCN_H)
check_include_file(inttypes.h HAVE_INTTYPES_H)
check_include_file(memory.h HAVE_MEMORY_H)
check_include_file(stdlib.h HAVE_STDINT_H)
check_include_file(stdint.h HAVE_STDLIB_H)
check_include_file(strings.h HAVE_STRINGS_H)
check_include_file(string.h HAVE_STRING_H)
check_include_file(sys/stat.h HAVE_SYS_STAT_H)
check_include_file(sys/types.h HAVE_SYS_TYPES_H)
check_include_file(unistd.h HAVE_UNISTD_H)
# ##############################################################################
# library
# ##############################################################################
set(PACKAGE_STRING "${PROJECT_NAME} ${PROJECT_VERSION}")
set(PACKAGE_VERSION "${PROJECT_VERSION}")
set(VERSION "${PROJECT_VERSION}")
configure_file(${CMAKE_CURRENT_LIST_DIR}/mbus/config.h.in ${CMAKE_CURRENT_LIST_DIR}/config.h @ONLY)
# list of source files
add_library(objlib OBJECT
"${CMAKE_CURRENT_LIST_DIR}/mbus/mbus-protocol.c"
"${CMAKE_CURRENT_LIST_DIR}/mbus/mbus-protocol.h"
"${CMAKE_CURRENT_LIST_DIR}/mbus/mbus-tcp.c"
"${CMAKE_CURRENT_LIST_DIR}/mbus/mbus-tcp.h"
"${CMAKE_CURRENT_LIST_DIR}/mbus/mbus.c"
"${CMAKE_CURRENT_LIST_DIR}/mbus/mbus.h"
"${CMAKE_CURRENT_LIST_DIR}/mbus/mbus-protocol-aux.c"
"${CMAKE_CURRENT_LIST_DIR}/mbus/mbus-protocol-aux.h"
"${CMAKE_CURRENT_LIST_DIR}/mbus/mbus-serial.c"
"${CMAKE_CURRENT_LIST_DIR}/mbus/mbus-serial.h")
# shared and static libraries built from the same object files
add_library(${PROJECT_NAME} SHARED $<TARGET_OBJECTS:objlib>)
add_library(libmbus_static STATIC $<TARGET_OBJECTS:objlib>)
set_property(TARGET objlib PROPERTY POSITION_INDEPENDENT_CODE 1)
set_target_properties(libmbus_static PROPERTIES OUTPUT_NAME mbus)
target_include_directories(
${PROJECT_NAME}
PUBLIC "$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}>" "$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>"
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>")
if(CMAKE_SYSTEM_NAME STREQUAL "Linux" OR CMAKE_SYSTEM_NAME STREQUAL "Android")
target_link_libraries(${PROJECT_NAME} PRIVATE m)
endif()
if(NOT MSVC)
target_compile_options(${PROJECT_NAME} PRIVATE -Wall -Wextra -Wno-pedantic)
endif()
set_target_properties(${PROJECT_NAME}
PROPERTIES PREFIX ""
SOVERSION ${VERSION})
if(CLANG_TIDY_EXE)
set_target_properties(${PROJECT_NAME} PROPERTIES CXX_CLANG_TIDY "${CLANG_TIDY_EXE}")
endif()
add_library(${PROJECT_NAME}::${PROJECT_NAME} ALIAS ${PROJECT_NAME})
# ##############################################################################
# examples
# ##############################################################################
if(LIBMBUS_BUILD_EXAMPLES)
message(STATUS "building examples")
add_subdirectory(bin)
endif()
# ##############################################################################
# tests
# ##############################################################################
if(LIBMBUS_BUILD_TESTS)
message(STATUS "building tests")
enable_testing()
add_subdirectory(test)
endif()
# ##############################################################################
# install
# ##############################################################################
include(GNUInstallDirs)
include(CMakePackageConfigHelpers)
set(INSTALL_PKGCONFIG_DIR
"${CMAKE_INSTALL_DATAROOTDIR}/pkgconfig"
CACHE PATH "Installation directory for pkgconfig (.pc) files")
set(INSTALL_INC_DIR
"${CMAKE_INSTALL_INCLUDEDIR}/mbus"
CACHE PATH "Installation directory for headers")
set(INSTALL_LIB_DIR
"${CMAKE_INSTALL_LIBDIR}"
CACHE PATH "Installation directory for libraries")
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/libmbus.pc.in ${CMAKE_CURRENT_BINARY_DIR}/libmbus.pc @ONLY)
install(
FILES ${CMAKE_CURRENT_BINARY_DIR}/libmbus.pc
DESTINATION "${INSTALL_PKGCONFIG_DIR}"
COMPONENT dev)
set(LIBMBUS_CONFIG_INSTALL_DIR ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME})
install(
TARGETS ${PROJECT_NAME}
EXPORT ${PROJECT_NAME}Targets
LIBRARY DESTINATION "${INSTALL_LIB_DIR}" COMPONENT lib
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" COMPONENT lib)
install(
EXPORT ${PROJECT_NAME}Targets
DESTINATION "${LIBMBUS_CONFIG_INSTALL_DIR}"
NAMESPACE ${PROJECT_NAME}::
COMPONENT dev)
configure_package_config_file(cmake/Config.cmake.in ${PROJECT_NAME}Config.cmake INSTALL_DESTINATION
"${LIBMBUS_CONFIG_INSTALL_DIR}")
write_basic_package_version_file(${PROJECT_NAME}ConfigVersion.cmake COMPATIBILITY SameMajorVersion)
install(
FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake
${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake
DESTINATION "${LIBMBUS_CONFIG_INSTALL_DIR}"
COMPONENT dev)
install(
DIRECTORY "${CMAKE_CURRENT_LIST_DIR}/mbus/"
DESTINATION "${INSTALL_INC_DIR}"
COMPONENT dev
FILES_MATCHING
PATTERN "*.h")
install(
TARGETS libmbus_static
ARCHIVE DESTINATION "${INSTALL_LIB_DIR}" COMPONENT dev)
# ##############################################################################
# package
# mkdir build ; cd build ; cmake .. -DLIBMBUS_PACKAGE_DEB=ON ; cpack ..
# ##############################################################################
include(InstallRequiredSystemLibraries)
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Open source M-bus (Meter-Bus) library.")
set(CPACK_PACKAGE_DESCRIPTION
"libmbus is an open source library for the M-bus (Meter-Bus) protocol.
The Meter-Bus is a standard for reading out meter data from electricity meters,
heat meters, gas meters, etc. The M-bus standard deals with both the electrical
signals on the M-Bus, and the protocol and data format used in transmissions
on the M-Bus. The role of libmbus is to decode/encode M-bus data, and to handle
the communication with M-Bus devices.
For more information see http://www.rscada.se/libmbus")
set(CPACK_PACKAGE_VENDOR "Raditex Control AB")
set(CPACK_PACKAGE_CONTACT "Stefan Wahren <info@lategoodbye.de>")
set(CPACK_PACKAGE_HOMEPAGE_URL "https://github.com/rscada/libmbus/")
set(CPACK_RESOURCE_FILE_LICENSE ${PROJECT_SOURCE_DIR}/LICENSE)
set(CPACK_PACKAGE_VERSION_MAJOR "${PROJECT_VERSION_MAJOR}")
set(CPACK_PACKAGE_VERSION_MINOR "${PROJECT_VERSION_MINOR}")
set(CPACK_PACKAGE_VERSION_PATCH "${PROJECT_VERSION_PATCH}")
set(CPACK_DEB_COMPONENT_INSTALL ON)
set(CPACK_DEBIAN_PACKAGE_DEBUG ON)
set(CPACK_PACKAGE_RELEASE 1)
# create 2 components, libmbus, libmbus-dev
set(CPACK_COMPONENTS_ALL lib dev)
set(CPACK_COMPONENT_LIB_DESCRIPTION "FreeSCADA M-Bus Library.
A free and open-source library for M-Bus (Meter Bus) from the rSCADA project.")
set(CPACK_DEBIAN_LIB_PACKAGE_SECTION libs)
set(CPACK_COMPONENT_DEVEL_DESCRIPTION
"FreeSCADA M-Bus Library Development files.
A free and open-source library for M-Bus (Meter Bus) from the rSCADA project,
including development files.")
set(CPACK_DEBIAN_DEVEL_PACKAGE_SECTION libdevel)
set(CPACK_COMPONENT_DEVEL_DEPENDS lib)
set(CPACK_PACKAGE_VERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}")
set(CPACK_PACKAGE_FILE_NAME
"${CMAKE_PROJECT_NAME}_${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
if(LIBMBUS_PACKAGE_DEB)
set(CPACK_GENERATOR "DEB")
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "Stefan Wahren <info@lategoodbye.de>")
set(CPACK_DEBIAN_PACKAGE_SECTION "Development/Languages/C and C++")
set(CPACK_DEBIAN_ARCHITECTURE ${CMAKE_SYSTEM_PROCESSOR})
set(CPACK_DEBIAN_PACKAGE_VERSION
"${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}-${CPACK_PACKAGE_RELEASE}"
)
endif()
if(LIBMBUS_PACKAGE_RPM)
set(CPACK_GENERATOR "RPM")
set(CPACK_RPM_PACKAGE_LICENSE "BSD")
endif()
include(CPack)
# ##############################################################################
# doc
# mkdir build ; cd build ; cmake .. -DLIBMBUS_BUILD_DOCS=ON ; cmake --build . --target doc
# ##############################################################################
if(LIBMBUS_BUILD_DOCS)
message(STATUS "building with documentation")
# Generate targets for documentation
# check if Doxygen is installed
find_package(Doxygen)
if(Doxygen_FOUND)
# set input and output files
set(DOXYGEN_IN ${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in)
set(DOXYGEN_OUT ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile)
# request to configure the file
configure_file(${DOXYGEN_IN} ${DOXYGEN_OUT} @ONLY)
# note the option ALL which allows to build the docs together with the application
add_custom_target(
doc ALL
COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYGEN_OUT}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMENT "Generating API documentation with Doxygen"
VERBATIM)
message(STATUS "Setup up the Doxygen documention build")
else(Doxygen_FOUND)
message(WARNING "Doxygen need to be installed to generate the doxygen documentation")
endif(Doxygen_FOUND)
endif()

14
COPYING
View File

@ -22,3 +22,17 @@ Contributers:
* Uwe Grohnwaldt * Uwe Grohnwaldt
* Markus Bergkvist * Markus Bergkvist
LICENSE (the BSD license):
Copyright (c) 2010-2012, Raditex Control AB
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
* Neither the name of the Raditex Control AB nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

View File

@ -1,14 +0,0 @@
# docker build . -f Dockerfile.deb -t deb_builder
FROM ubuntu
RUN apt update -y && apt install -y cmake gcc g++ make
COPY . /tmp
RUN cd /tmp && \
mkdir build && \
cd build && \
cmake .. -DLIBMBUS_PACKAGE_DEB=ON && \
cpack .. && \
ls -al && \
dpkg -i *.deb

View File

@ -1,14 +0,0 @@
# docker build . -f Dockerfile.rpm -t rpm_builder
FROM fedora
RUN dnf install -y cmake gcc g++ make rpm-build
COPY . /tmp
RUN cd /tmp && \
mkdir build && \
cd build && \
cmake .. -DLIBMBUS_PACKAGE_RPM=ON && \
cpack .. && \
ls -al && \
rpm -i *.rpm

View File

@ -1,18 +0,0 @@
# docker build . -f Dockerfile.test -t test_builder
FROM ubuntu
RUN apt update -y && apt install -y cmake gcc g++ make
COPY . /tmp
RUN cd /tmp && \
mkdir build && \
cd build && \
cmake .. -DLIBMBUS_BUILD_EXAMPLES=ON -DLIBMBUS_BUILD_TESTS=ON -DLIBMBUS_ENABLE_COVERAGE=ON && \
cmake --build . -j && \
cd .. && \
./test/generate-xml.sh test/test-frames
RUN cd /tmp && \
echo "NOTE: error-frames have about 30 parse errors, and unsupported-frames have 12" && \
./test/generate-xml.sh test/error-frames || true ; \
./test/generate-xml.sh test/unsupported-frames || true

View File

@ -14,7 +14,7 @@ Basic Installation
Briefly, the shell commands `./configure; make; make install' should Briefly, the shell commands `./configure; make; make install' should
configure, build, and install this package. The following configure, build, and install this package. The following
more-detailed instructions are generic; see the `README.md' file for more-detailed instructions are generic; see the `README' file for
instructions specific to this package. Some packages provide this instructions specific to this package. Some packages provide this
`INSTALL' file but do not implement all of the features documented `INSTALL' file but do not implement all of the features documented
below. The lack of an optional feature in a given package is not below. The lack of an optional feature in a given package is not
@ -38,7 +38,7 @@ cache files.
If you need to do unusual things to compile the package, please try If you need to do unusual things to compile the package, please try
to figure out how `configure' could check whether to do them, and mail to figure out how `configure' could check whether to do them, and mail
diffs or instructions to the address given in the `README.md' so they can diffs or instructions to the address given in the `README' so they can
be considered for the next release. If you are using the cache, and at be considered for the next release. If you are using the cache, and at
some point `config.cache' contains results you don't want to keep, you some point `config.cache' contains results you don't want to keep, you
may remove or edit it. may remove or edit it.
@ -200,7 +200,7 @@ option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
`configure', where FEATURE indicates an optional part of the package. `configure', where FEATURE indicates an optional part of the package.
They may also pay attention to `--with-PACKAGE' options, where PACKAGE They may also pay attention to `--with-PACKAGE' options, where PACKAGE
is something like `gnu-as' or `x' (for the X Window System). The is something like `gnu-as' or `x' (for the X Window System). The
`README.md' should mention any `--enable-' and `--with-' options that the `README' should mention any `--enable-' and `--with-' options that the
package recognizes. package recognizes.
For packages that use the X Window System, `configure' can usually For packages that use the X Window System, `configure' can usually

29
LICENSE
View File

@ -1,29 +0,0 @@
BSD 3-Clause License
Copyright (c) 2010-2012, Raditex Control AB
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

25
Makefile-static Normal file
View File

@ -0,0 +1,25 @@
# Copyright (c) 2010
# Robert Johansson
# Raditex AB.
# All rights reserved.
LIB = libmbus.so
CFLAGS = -Wall -W -g -fPIC -I.
HEADERS = mbus.h mbus-protocol.h
OBJS = mbus.o mbus-protocol.o
$(LIB): $(OBJS)
gcc -shared -o $(LIB) $(OBJS)
all: $(LIB)
clean:
rm -rf *.o *core core $(LIB)
test:
(cd test && make)
install: all
cp $(LIB) /usr/local/freescada/lib
cp $(HEADERS) /usr/local/freescada/include

20
Makefile.am Normal file
View File

@ -0,0 +1,20 @@
#
#
#
PACKAGE = @PACKAGE@
VERSION = @VERSION@
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = libmbus.pc
docdir = $(datadir)/doc/$(PACKAGE)-$(VERSION)
dist_docdir = $(DESTDIR)$(docdir)
doc_DATA = README \
COPYING \
hardware/MBus_USB.pdf \
hardware/MBus_USB.txt
SUBDIRS = mbus bin
ACLOCAL = aclocal -I .
ACLOCAL_AMFLAGS = -Werror -I m4

7
README Normal file
View File

@ -0,0 +1,7 @@
libmbus: M-bus Library from Raditex Control (http://www.rscada.se)
libmbus is an open source library for the M-bus (Meter-Bus) protocol. The Meter-Bus is a standard for reading out meter data from electricity meters, heat meters, gas meters, etc. The M-bus standard deals with both the electrical signals on the M-Bus, and the protocol and data format used in transmissions on the M-Bus. The role of libmbus is to decode/encode M-bus data, and to handle the communication with M-Bus devices.
For more information see http://www.rscada.se/libmbus

View File

@ -1,41 +0,0 @@
# libmbus: M-bus Library from Raditex Control (http://www.rscada.se) <span style="float:right;"><a href="https://travis-ci.org/rscada/libmbus" style="border-bottom:none">
![Build Status](https://travis-ci.org/rscada/libmbus.svg?branch=master)</a></span>
libmbus is an open source library for the M-bus (Meter-Bus) protocol.
The Meter-Bus is a standard for reading out meter data from electricity meters,
heat meters, gas meters, etc. The M-bus standard deals with both the electrical
signals on the M-Bus, and the protocol and data format used in transmissions on
the M-Bus. The role of libmbus is to decode/encode M-bus data, and to handle
the communication with M-Bus devices.
## BUILD
with cmake
```bash
rm -rf _build
mkdir _build
cd _build
# configure
# e.g. on linux
cmake .. -DLIBMBUS_BUILD_EXAMPLES=ON
# e.g. for a target device
cmake .. -DLIBMBUS_BUILD_EXAMPLES=ON -DCMAKE_TOOLCHAIN_FILE=/path/to/toolchain/foo-bar-baz.cmake
# compile
cmake --build . -j
# install - optional
cmake --build . --target install
```
## CONSUME
```cmake
find_package(libmbus)
add_executable(my_app main.cpp)
target_link_libraries(my_app libmbus::libmbus)
```
For more information see http://www.rscada.se/libmbus

View File

@ -1,19 +0,0 @@
function(add_example SRCS)
add_executable(${SRCS} ${CMAKE_CURRENT_LIST_DIR}/${SRCS}.c)
target_link_libraries(${SRCS} PRIVATE libmbus::libmbus)
endfunction()
add_example(mbus-serial-request-data)
add_example(mbus-serial-request-data-multi-reply)
add_example(mbus-serial-scan)
add_example(mbus-serial-scan-secondary)
add_example(mbus-serial-select-secondary)
add_example(mbus-serial-set-address)
add_example(mbus-serial-switch-baudrate)
add_example(mbus-tcp-application-reset)
add_example(mbus-tcp-raw-send)
add_example(mbus-tcp-request-data)
add_example(mbus-tcp-request-data-multi-reply)
add_example(mbus-tcp-scan)
add_example(mbus-tcp-scan-secondary)
add_example(mbus-tcp-select-secondary)

24
bin/Makefile-static Normal file
View File

@ -0,0 +1,24 @@
#
# Copyright (C) 2011, Robert Johansson, Raditex AB
# All rights reserved.
#
# rSCADA
# http://www.rSCADA.se
# info@rscada.se
#
CFLAGS=-Wall -g -I..
LDFLAGS=-L.. -lm -lmbus
all: mbus-tcp-scan mbus-tcp-request-data
%.o: %.c
$(CC) -c $(CFLAGS) $< -o $@
mbus-tcp-scan: mbus-tcp-scan.o mbus-tcp.o
gcc -o $@ $^ $(LDFLAGS)
mbus-tcp-request-data: mbus-tcp-request-data.o mbus-tcp.o
gcc -o $@ $^ $(LDFLAGS)
clean:
rm -rf mbus-tcp-request-data mbus-tcp-scan *.o *~

97
bin/Makefile.am Normal file
View File

@ -0,0 +1,97 @@
# ------------------------------------------------------------------------------
# Copyright (C) 2010, Raditex AB
# All rights reserved.
#
# rSCADA
# http://www.rSCADA.se
# info@rscada.se
#
# ------------------------------------------------------------------------------
PACKAGE = @PACKAGE@
VERSION = @VERSION@
AM_CPPFLAGS = -I$(top_builddir) -I$(top_srcdir) -I$(top_srcdir)/src
noinst_HEADERS =
bin_PROGRAMS = mbus-tcp-scan mbus-tcp-request-data mbus-tcp-request-data-multi-reply \
mbus-tcp-select-secondary mbus-tcp-scan-secondary \
mbus-serial-scan mbus-serial-request-data mbus-serial-request-data-multi-reply \
mbus-serial-select-secondary mbus-serial-scan-secondary \
mbus-serial-switch-baudrate mbus-tcp-raw-send mbus-tcp-application-reset
# tcp
mbus_tcp_scan_LDFLAGS = -L$(top_builddir)/mbus
mbus_tcp_scan_LDADD = -lmbus -lm
mbus_tcp_scan_SOURCES = mbus-tcp-scan.c
mbus_tcp_request_data_LDFLAGS = -L$(top_builddir)/mbus
mbus_tcp_request_data_LDADD = -lmbus -lm
mbus_tcp_request_data_SOURCES = mbus-tcp-request-data.c
mbus_tcp_request_data_multi_reply_LDFLAGS = -L$(top_builddir)/mbus
mbus_tcp_request_data_multi_reply_LDADD = -lmbus -lm
mbus_tcp_request_data_multi_reply_SOURCES = mbus-tcp-request-data-multi-reply.c
mbus_tcp_select_secondary_LDFLAGS = -L$(top_builddir)/mbus
mbus_tcp_select_secondary_LDADD = -lmbus -lm
mbus_tcp_select_secondary_SOURCES = mbus-tcp-select-secondary.c
mbus_tcp_scan_secondary_LDFLAGS = -L$(top_builddir)/mbus
mbus_tcp_scan_secondary_LDADD = -lmbus -lm
mbus_tcp_scan_secondary_SOURCES = mbus-tcp-scan-secondary.c
mbus_tcp_raw_send_LDFLAGS = -L$(top_builddir)/mbus
mbus_tcp_raw_send_LDADD = -lmbus -lm
mbus_tcp_raw_send_SOURCES = mbus-tcp-raw-send.c
mbus_tcp_application_reset_LDFLAGS = -L$(top_builddir)/mbus
mbus_tcp_application_reset_LDADD = -lmbus -lm
mbus_tcp_application_reset_SOURCES = mbus-tcp-application-reset.c
# serial
mbus_serial_scan_LDFLAGS = -L$(top_builddir)/mbus
mbus_serial_scan_LDADD = -lmbus -lm
mbus_serial_scan_SOURCES = mbus-serial-scan.c
mbus_serial_request_data_LDFLAGS = -L$(top_builddir)/mbus
mbus_serial_request_data_LDADD = -lmbus -lm
mbus_serial_request_data_SOURCES = mbus-serial-request-data.c
mbus_serial_request_data_multi_reply_LDFLAGS = -L$(top_builddir)/mbus
mbus_serial_request_data_multi_reply_LDADD = -lmbus -lm
mbus_serial_request_data_multi_reply_SOURCES = mbus-serial-request-data-multi-reply.c
mbus_serial_select_secondary_LDFLAGS = -L$(top_builddir)/mbus
mbus_serial_select_secondary_LDADD = -lmbus -lm
mbus_serial_select_secondary_SOURCES = mbus-serial-select-secondary.c
mbus_serial_scan_secondary_LDFLAGS = -L$(top_builddir)/mbus
mbus_serial_scan_secondary_LDADD = -lmbus -lm
mbus_serial_scan_secondary_SOURCES = mbus-serial-scan-secondary.c
mbus_serial_switch_baudrate_LDFLAGS = -L$(top_builddir)/mbus
mbus_serial_switch_baudrate_LDADD = -lmbus -lm
mbus_serial_switch_baudrate_SOURCES = mbus-serial-switch-baudrate.c
# man pages
dist_man_MANS = libmbus.1 \
mbus-tcp-scan.1 \
mbus-tcp-request-data.1 \
mbus-tcp-request-data-multi-reply.1 \
mbus-tcp-select-secondary.1 \
mbus-tcp-scan-secondary.1 \
mbus-tcp-raw-send.1 \
mbus-serial-scan.1 \
mbus-serial-request-data.1 \
mbus-serial-request-data-multi-reply.1 \
mbus-serial-select-secondary.1 \
mbus-serial-scan-secondary.1 \
mbus-serial-switch-baudrate.1
.pod.1:
pod2man --release=$(VERSION) --center=$(PACKAGE) $< \
>.pod2man.tmp.$$$$ 2>/dev/null && mv -f .pod2man.tmp.$$$$ $@ || true
@if grep '\<POD ERRORS\>' $@ >/dev/null 2>&1; \
then \
echo "$@ has some POD errors!"; false; \
fi

View File

@ -10,8 +10,6 @@ the communication with M-Bus devices.
B<mbus-serial-switch-baudrate> [-b BAUDRATE] device address target-baudrate B<mbus-serial-switch-baudrate> [-b BAUDRATE] device address target-baudrate
B<mbus-serial-set-address> [-d] [-b BAUDRATE] device mbus-address new-primary-address
B<mbus-serial-scan> [-d] [-b BAUDRATE] [-r RETRIES] device B<mbus-serial-scan> [-d] [-b BAUDRATE] [-r RETRIES] device
B<mbus-tcp-scan> [-d] [-r RETRIES] host port B<mbus-tcp-scan> [-d] [-r RETRIES] host port

View File

@ -56,6 +56,7 @@ main(int argc, char **argv)
char *device, *addr_str, *xml_result; char *device, *addr_str, *xml_result;
int address; int address;
char fcb;
long baudrate = 9600; long baudrate = 9600;
memset((void *)&reply, 0, sizeof(mbus_frame)); memset((void *)&reply, 0, sizeof(mbus_frame));
@ -159,14 +160,16 @@ main(int argc, char **argv)
// else MBUS_PROBE_SINGLE // else MBUS_PROBE_SINGLE
address = MBUS_ADDRESS_NETWORK_LAYER; address = MBUS_ADDRESS_NETWORK_LAYER;
fcb = 0;
} }
else else
{ {
// primary addressing // primary addressing
address = atoi(addr_str); address = atoi(addr_str);
fcb = 1;
} }
if (mbus_send_request_frame(handle, address) == -1) if (mbus_send_request_frame(handle, address, fcb) == -1)
{ {
fprintf(stderr, "Failed to send M-Bus request frame.\n"); fprintf(stderr, "Failed to send M-Bus request frame.\n");
mbus_disconnect(handle); mbus_disconnect(handle);

View File

@ -96,7 +96,7 @@ main(int argc, char **argv)
if (mbus_frame_type(&reply) == MBUS_FRAME_TYPE_ACK) if (mbus_frame_type(&reply) == MBUS_FRAME_TYPE_ACK)
{ {
if (mbus_send_request_frame(handle, MBUS_ADDRESS_NETWORK_LAYER) == -1) if (mbus_send_request_frame(handle, MBUS_ADDRESS_NETWORK_LAYER, 0) == -1)
{ {
fprintf(stderr,"Failed to send request to selected secondary device: %s\n", mbus_error_str()); fprintf(stderr,"Failed to send request to selected secondary device: %s\n", mbus_error_str());
return 1; return 1;

View File

@ -1,2 +0,0 @@
.so man1/libmbus.1

View File

@ -1,229 +0,0 @@
//------------------------------------------------------------------------------
// Copyright (C) 2011, Robert Johansson, Raditex AB
// All rights reserved.
//
// rSCADA
// http://www.rSCADA.se
// info@rscada.se
//
//------------------------------------------------------------------------------
#include <string.h>
#include <stdio.h>
#include <mbus/mbus.h>
static int debug = 0;
//
// init slave to get really the beginning of the records
//
static int
init_slaves(mbus_handle *handle)
{
if (debug)
printf("%s: debug: sending init frame #1\n", __PRETTY_FUNCTION__);
if (mbus_send_ping_frame(handle, MBUS_ADDRESS_NETWORK_LAYER, 1) == -1)
{
return 0;
}
//
// resend SND_NKE, maybe the first get lost
//
if (debug)
printf("%s: debug: sending init frame #2\n", __PRETTY_FUNCTION__);
if (mbus_send_ping_frame(handle, MBUS_ADDRESS_NETWORK_LAYER, 1) == -1)
{
return 0;
}
return 1;
}
//------------------------------------------------------------------------------
// set primary address
//------------------------------------------------------------------------------
int
main(int argc, char **argv)
{
mbus_handle *handle = NULL;
mbus_frame reply;
char *device, *old_address_str, *xml_result;
int old_address, new_address;
long baudrate = 9600;
int ret;
if (argc == 4)
{
device = argv[1];
old_address_str = argv[2];
new_address = atoi(argv[3]);
}
else if (argc == 5 && strcmp(argv[1], "-d") == 0)
{
device = argv[2];
old_address_str = argv[3];
new_address = atoi(argv[4]);
debug = 1;
}
else if (argc == 6 && strcmp(argv[1], "-b") == 0)
{
baudrate = atol(argv[2]);
device = argv[3];
old_address_str = argv[4];
new_address = atoi(argv[5]);
}
else if (argc == 7 && strcmp(argv[1], "-d") == 0 && strcmp(argv[2], "-b") == 0)
{
baudrate = atol(argv[3]);
device = argv[4];
old_address_str = argv[5];
new_address = atoi(argv[6]);
debug = 1;
}
else
{
fprintf(stderr, "usage: %s [-d] [-b BAUDRATE] device mbus-address new-primary-address\n", argv[0]);
fprintf(stderr, " optional flag -d for debug printout\n");
fprintf(stderr, " optional flag -b for selecting baudrate\n");
return 0;
}
if (mbus_is_primary_address(new_address) == 0)
{
fprintf(stderr, "Invalid new primary address\n");
return -1;
}
switch (new_address)
{
case MBUS_ADDRESS_NETWORK_LAYER:
case MBUS_ADDRESS_BROADCAST_REPLY:
case MBUS_ADDRESS_BROADCAST_NOREPLY:
fprintf(stderr, "Invalid new primary address\n");
return -1;
}
if ((handle = mbus_context_serial(device)) == NULL)
{
fprintf(stderr, "Could not initialize M-Bus context: %s\n", mbus_error_str());
return 1;
}
if (debug)
{
mbus_register_send_event(handle, &mbus_dump_send_event);
mbus_register_recv_event(handle, &mbus_dump_recv_event);
}
if (mbus_connect(handle) == -1)
{
fprintf(stderr,"Failed to setup connection to M-bus gateway\n");
mbus_context_free(handle);
return 1;
}
if (mbus_serial_set_baudrate(handle, baudrate) == -1)
{
fprintf(stderr,"Failed to set baud rate.\n");
mbus_disconnect(handle);
mbus_context_free(handle);
return 1;
}
if (init_slaves(handle) == 0)
{
mbus_disconnect(handle);
mbus_context_free(handle);
return 1;
}
if (mbus_send_ping_frame(handle, new_address, 0) == -1)
{
fprintf(stderr, "Verification failed. Could not send ping frame: %s\n", mbus_error_str());
mbus_disconnect(handle);
mbus_context_free(handle);
return 1;
}
if (mbus_recv_frame(handle, &reply) != MBUS_RECV_RESULT_TIMEOUT)
{
fprintf(stderr, "Verification failed. Got a response from new address\n");
mbus_disconnect(handle);
mbus_context_free(handle);
return 1;
}
if (mbus_is_secondary_address(old_address_str))
{
// secondary addressing
ret = mbus_select_secondary_address(handle, old_address_str);
if (ret == MBUS_PROBE_COLLISION)
{
fprintf(stderr, "%s: Error: The address mask [%s] matches more than one device.\n", __PRETTY_FUNCTION__, old_address_str);
mbus_disconnect(handle);
mbus_context_free(handle);
return 1;
}
else if (ret == MBUS_PROBE_NOTHING)
{
fprintf(stderr, "%s: Error: The selected secondary address does not match any device [%s].\n", __PRETTY_FUNCTION__, old_address_str);
mbus_disconnect(handle);
mbus_context_free(handle);
return 1;
}
else if (ret == MBUS_PROBE_ERROR)
{
fprintf(stderr, "%s: Error: Failed to select secondary address [%s].\n", __PRETTY_FUNCTION__, old_address_str);
mbus_disconnect(handle);
mbus_context_free(handle);
return 1;
}
// else MBUS_PROBE_SINGLE
old_address = MBUS_ADDRESS_NETWORK_LAYER;
}
else
{
// primary addressing
old_address = atoi(old_address_str);
}
if (mbus_set_primary_address(handle, old_address, new_address) == -1)
{
fprintf(stderr, "Failed to send set primary address frame: %s\n", mbus_error_str());
mbus_disconnect(handle);
mbus_context_free(handle);
return 1;
}
memset(&reply, 0, sizeof(mbus_frame));
ret = mbus_recv_frame(handle, &reply);
if (ret == MBUS_RECV_RESULT_TIMEOUT)
{
fprintf(stderr, "No reply from device\n");
mbus_disconnect(handle);
mbus_context_free(handle);
return 1;
}
else if (mbus_frame_type(&reply) != MBUS_FRAME_TYPE_ACK)
{
fprintf(stderr, "Unknown reply:\n");
mbus_frame_print(&reply);
}
else
{
printf("Set primary address of device to %d\n", new_address);
}
mbus_disconnect(handle);
mbus_context_free(handle);
return 0;
}

View File

@ -86,7 +86,7 @@ main(int argc, char **argv)
} }
else else
{ {
printf("Switched baud rate of device to %ld\n", target_baudrate); printf("Switched baud rate of device to %lu\n", target_baudrate);
} }
mbus_disconnect(handle); mbus_disconnect(handle);

View File

@ -102,7 +102,7 @@ main(int argc, char **argv)
} }
// else MBUS_PROBE_SINGLE // else MBUS_PROBE_SINGLE
if (mbus_send_request_frame(handle, MBUS_ADDRESS_NETWORK_LAYER) == -1) if (mbus_send_request_frame(handle, MBUS_ADDRESS_NETWORK_LAYER, 0) == -1)
{ {
fprintf(stderr, "Failed to send M-Bus request frame.\n"); fprintf(stderr, "Failed to send M-Bus request frame.\n");
return 1; return 1;
@ -113,7 +113,7 @@ main(int argc, char **argv)
// primary addressing // primary addressing
address = atoi(addr_str); address = atoi(addr_str);
if (mbus_send_request_frame(handle, address) == -1) if (mbus_send_request_frame(handle, address, 1) == -1)
{ {
fprintf(stderr, "Failed to send M-Bus request frame.\n"); fprintf(stderr, "Failed to send M-Bus request frame.\n");
return 1; return 1;

View File

@ -87,7 +87,7 @@ main(int argc, char **argv)
if (mbus_frame_type(&reply) == MBUS_FRAME_TYPE_ACK) if (mbus_frame_type(&reply) == MBUS_FRAME_TYPE_ACK)
{ {
if (mbus_send_request_frame(handle, MBUS_ADDRESS_NETWORK_LAYER) == -1) if (mbus_send_request_frame(handle, MBUS_ADDRESS_NETWORK_LAYER, 0) == -1)
{ {
fprintf(stderr,"Failed to send request to selected secondary device: %s\n", mbus_error_str()); fprintf(stderr,"Failed to send request to selected secondary device: %s\n", mbus_error_str());
return 1; return 1;

View File

@ -8,5 +8,18 @@
# #
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
if [ ! -f Makefile ]; then
#
# regenerate automake files
#
echo "Running autotools..."
autoheader \
&& aclocal \
&& libtoolize --ltdl --copy --force \
&& automake --add-missing --copy \
&& autoconf
fi
debuild -i -us -uc -b debuild -i -us -uc -b
#sudo pbuilder build $(NAME)_$(VERSION)-1.dsc #sudo pbuilder build $(NAME)_$(VERSION)-1.dsc

View File

@ -1,24 +1,23 @@
#!/bin/sh #!/bin/sh
#
if [ -f Makefile ]; then
#
# use existing automake files
#
echo >> /dev/null
else
#
# regenerate automake files
#
echo "Running autotools..."
rm -rf build autoheader \
mkdir build && aclocal \
cd build && libtoolize --ltdl --copy --force \
cmake .. -DLIBMBUS_BUILD_EXAMPLES=ON -DLIBMBUS_BUILD_TESTS=ON && automake --add-missing --copy \
cmake --build . && autoconf \
&& ./configure
fi
# build deb make
# rm -rf build
# mkdir build
# cd build
# cmake .. -DLIBMBUS_PACKAGE_DEB=ON
# cpack ..
# dpkg -i *.deb
# build doc
# mkdir build
# cd build
# cmake .. -DLIBMBUS_BUILD_DOCS=ON
# cmake --build . --target doc

View File

@ -1,15 +0,0 @@
# https://github.com/cheshirekow/cmake_format
# How wide to allow formatted cmake files
line_width: 120
# How many spaces to tab for indent
tab_size: 2
# Format command names consistently as 'lower' or 'upper' case
command_case: "lower"
first_comment_is_literal: False
# enable comment markup parsing and reflow
enable_markup: False

View File

@ -1,4 +0,0 @@
@PACKAGE_INIT@
include("${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@Targets.cmake")
check_required_components("@PROJECT_NAME@")

44
configure.ac Normal file
View File

@ -0,0 +1,44 @@
dnl ----------------------------------------------------------------------------
dnl Copyright (C) 2010, Raditex AB
dnl All rights reserved.
dnl
dnl rSCADA
dnl http://www.rSCADA.se
dnl info@rscada.se
dnl
dnl ----------------------------------------------------------------------------
LT_CONFIG_LTDL_DIR([libltdl])
AC_INIT([libmbus], [0.8.0], [info@rscada.se], [libmbus], [http://www.rscada.se/libmbus/])
AC_CONFIG_AUX_DIR([libltdl/config])
AM_INIT_AUTOMAKE([-Wall -Werror foreign])
AM_PROG_LIBTOOL
# fix for automake 1.11 & 1.12
m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
LDFLAGS="$LDFLAGS -version-info 0:8:0"
dnl ----------------------
dnl
AC_PROG_CC
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_FILES([Makefile mbus/Makefile test/Makefile bin/Makefile libmbus.pc])
AC_OUTPUT
echo \
"----------------------------------------------------------
Configuration:
Source location: ${srcdir}
Compile: ${CC}
Compiler flags: ${CFLAGS}
Linker flags: ${LDFLAGS}
Host system type: ${host}
Install path: ${prefix}
See config.h for further configuration.
----------------------------------------------------------"

2
debian/rules vendored
View File

@ -3,7 +3,7 @@
#export DH_VERBOSE=1 #export DH_VERBOSE=1
%: %:
dh $@ dh --with autoreconf $@
.PHONY: override_dh_strip .PHONY: override_dh_strip
override_dh_strip: override_dh_strip:

View File

@ -25,13 +25,13 @@ DOXYFILE_ENCODING = UTF-8
# The PROJECT_NAME tag is a single word (or a sequence of words surrounded # The PROJECT_NAME tag is a single word (or a sequence of words surrounded
# by quotes) that should identify the project. # by quotes) that should identify the project.
PROJECT_NAME = "@CMAKE_PROJECT_NAME@" PROJECT_NAME = libmbus
# The PROJECT_NUMBER tag can be used to enter a project or revision number. # The PROJECT_NUMBER tag can be used to enter a project or revision number.
# This could be handy for archiving the generated documentation or # This could be handy for archiving the generated documentation or
# if some version control system is used. # if some version control system is used.
PROJECT_NUMBER = @VERSION_MAJOR@.@VERSION_MINOR@.@VERSION_PATCH@ PROJECT_NUMBER =
# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
# base path where the generated documentation will be put. # base path where the generated documentation will be put.
@ -581,7 +581,7 @@ WARN_LOGFILE =
# directories like "/usr/src/myproject". Separate the files or directories # directories like "/usr/src/myproject". Separate the files or directories
# with spaces. # with spaces.
INPUT = @CMAKE_CURRENT_LIST_DIR@/mbus INPUT = mbus
# This tag can be used to specify the character encoding of the source files # This tag can be used to specify the character encoding of the source files
# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is # that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
@ -1628,6 +1628,3 @@ GENERATE_LEGEND = YES
# the various graphs. # the various graphs.
DOT_CLEANUP = YES DOT_CLEANUP = YES
USE_MDFILE_AS_MAINPAGE = @CMAKE_CURRENT_LIST_DIR@/README.md

View File

@ -1,12 +1,12 @@
prefix=@CMAKE_INSTALL_PREFIX@ prefix=@prefix@
exec_prefix=@CMAKE_INSTALL_PREFIX@ exec_prefix=@exec_prefix@
libdir=@INSTALL_LIB_DIR@ libdir=@libdir@
includedir=@INSTALL_INC_DIR@ includedir=@includedir@
Name: libmbus Name: libmbus
Description: Open source M-bus (Meter-Bus) library. Description: Open source M-bus (Meter-Bus) library.
Requires: Requires:
Version: @PROJECT_VERSION@ Version: @PACKAGE_VERSION@
URL: http://www.rscada.se/libmbus/ URL: http://www.rscada.se/libmbus/
Libs: -L${libdir} -lmbus -lm Libs: -L${libdir} -lmbus -lm
Cflags: -I${includedir} Cflags: -I${includedir}

84
libmbus.spec Normal file
View File

@ -0,0 +1,84 @@
#
# spec file for package libmbus
#
# Copyright (c) 2010-2013, Raditex Control AB
# All rights reserved.
#
# rSCADA
# http://www.rSCADA.se
# info@rscada.se
#
Summary: Open source M-bus (Meter-Bus) library
Name: libmbus
Version: 0.8.0
Release: 1
Source: http://www.rscada.se/public-dist/%{name}-%{version}.tar.gz
URL: http://www.rscada.se/libmbus/
License: BSD
Vendor: Raditex Control AB
Packager: Stefan Wahren <info@lategoodbye.de>
Group: Development/Languages/C and C++
BuildRoot: {_tmppath}/%{name}-%{version}-build
AutoReqProv: on
%description
libmbus: M-bus Library from Raditex Control (http://www.rscada.se)
libmbus is an open source library for the M-bus (Meter-Bus) protocol.
The Meter-Bus is a standard for reading out meter data from electricity meters,
heat meters, gas meters, etc. The M-bus standard deals with both the electrical
signals on the M-Bus, and the protocol and data format used in transmissions
on the M-Bus. The role of libmbus is to decode/encode M-bus data, and to handle
the communication with M-Bus devices.
For more information see http://www.rscada.se/libmbus
%package devel
License: BSD
Summary: Development libraries and header files for using the M-bus library
Group: Development/Libraries/C and C++
AutoReqProv: on
Requires: %{name} = %{version}
%description devel
This package contains all necessary include files and libraries needed
to compile and link applications which use the M-bus (Meter-Bus) library.
%prep -q
%setup -q
# workaround to get it's build
autoreconf
%build
./configure --prefix=/usr
make
%install
rm -Rf "%buildroot"
mkdir "%buildroot"
make install DESTDIR="%buildroot"
%clean
rm -rf "%buildroot"
%files
%defattr (-,root,root)
%doc COPYING README
%{_bindir}/mbus-serial-*
%{_bindir}/mbus-tcp-*
%{_libdir}/libmbus.so*
# man pages doesn't exist in this version
# %{_mandir}/man1/libmbus.1
# %{_mandir}/man1/mbus-*
%files devel
%defattr (-,root,root)
%{_includedir}/mbus
%{_libdir}/libmbus.a
%{_libdir}/libmbus.la
%{_libdir}/pkgconfig/libmbus.pc
%changelog
* Fri Mar 29 2013 Stefan Wahren <info@lategoodbye.de> - 0.8.0-1
- Initial package based on the last official release

20
mbus/Makefile.am Normal file
View File

@ -0,0 +1,20 @@
# ------------------------------------------------------------------------------
# Copyright (C) 2010, Raditex AB
# All rights reserved.
#
# rSCADA
# http://www.rSCADA.se
# info@rscada.se
#
# ------------------------------------------------------------------------------
PACKAGE = @PACKAGE@
VERSION = @VERSION@
AM_CPPFLAGS = -I$(top_builddir) -I$(top_srcdir)
includedir = $(prefix)/include/mbus
include_HEADERS = mbus.h mbus-protocol.h mbus-tcp.h mbus-serial.h mbus-protocol-aux.h
lib_LTLIBRARIES = libmbus.la
libmbus_la_SOURCES = mbus.c mbus-protocol.c mbus-tcp.c mbus-serial.c mbus-protocol-aux.c

View File

@ -1,56 +0,0 @@
/* Define to 1 if you have the <dlfcn.h> header file. */
#cmakedefine HAVE_DLFCN_H "@HAVE_DLFCN_H@"
/* Define to 1 if you have the <inttypes.h> header file. */
#cmakedefine HAVE_INTTYPES_H "@HAVE_INTTYPES_H@"
/* Define to 1 if you have the <memory.h> header file. */
#cmakedefine HAVE_MEMORY_H "@HAVE_MEMORY_H@"
/* Define to 1 if you have the <stdint.h> header file. */
#cmakedefine HAVE_STDINT_H "@HAVE_STDINT_H@"
/* Define to 1 if you have the <stdlib.h> header file. */
#cmakedefine HAVE_STDLIB_H "@HAVE_STDLIB_H@"
/* Define to 1 if you have the <strings.h> header file. */
#cmakedefine HAVE_STRINGS_H "@HAVE_STRINGS_H@"
/* Define to 1 if you have the <string.h> header file. */
#cmakedefine HAVE_STRING_H "@HAVE_STRING_H@"
/* Define to 1 if you have the <sys/stat.h> header file. */
#cmakedefine HAVE_SYS_STAT_H "@HAVE_SYS_STAT_H@"
/* Define to 1 if you have the <sys/types.h> header file. */
#cmakedefine HAVE_SYS_TYPES_H "@HAVE_SYS_TYPES_H@"
/* Define to 1 if you have the <unistd.h> header file. */
#cmakedefine HAVE_UNISTD_H "@HAVE_UNISTD_H@"
/* Define to the sub-directory where libtool stores uninstalled libraries. */
#define LT_OBJDIR ".libs/"
/* Name of package */
#define PACKAGE "@PROJECT_NAME@"
/* Define to the address where bug reports for this package should be sent. */
#define PACKAGE_BUGREPORT "info@rscada.se"
/* Define to the full name of this package. */
#define PACKAGE_NAME "@PROJECT_NAME@"
/* Define to the full name and version of this package. */
#cmakedefine PACKAGE_STRING "@PACKAGE_STRING@"
/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "@PROJECT_NAME@"
/* Define to the home page for this package. */
#define PACKAGE_URL "http://www.rscada.se/libmbus/"
/* Define to the version of this package. */
#cmakedefine PACKAGE_VERSION "@PACKAGE_VERSION@"
/* Version number of package */
#cmakedefine VERSION "@PACKAGE_VERSION@"

View File

@ -154,17 +154,17 @@ mbus_variable_vif vif_table[] = {
{ 0x56, 1.0e3, "kg/h", "Mass flow" }, { 0x56, 1.0e3, "kg/h", "Mass flow" },
{ 0x57, 1.0e4, "kg/h", "Mass flow" }, { 0x57, 1.0e4, "kg/h", "Mass flow" },
/* E101 10nn Flow Temperature °C (0.001°C to 1°C) */ /* E101 10nn Flow Temperature <EFBFBD>C (0.001<EFBFBD>C to 1<EFBFBD>C) */
{ 0x58, 1.0e-3, "°C", "Flow temperature" }, { 0x58, 1.0e-3, "<EFBFBD>C", "Flow temperature" },
{ 0x59, 1.0e-2, "°C", "Flow temperature" }, { 0x59, 1.0e-2, "<EFBFBD>C", "Flow temperature" },
{ 0x5A, 1.0e-1, "°C", "Flow temperature" }, { 0x5A, 1.0e-1, "<EFBFBD>C", "Flow temperature" },
{ 0x5B, 1.0e0, "°C", "Flow temperature" }, { 0x5B, 1.0e0, "<EFBFBD>C", "Flow temperature" },
/* E101 11nn Return Temperature °C (0.001°C to 1°C) */ /* E101 11nn Return Temperature <EFBFBD>C (0.001<EFBFBD>C to 1<EFBFBD>C) */
{ 0x5C, 1.0e-3, "°C", "Return temperature" }, { 0x5C, 1.0e-3, "<EFBFBD>C", "Return temperature" },
{ 0x5D, 1.0e-2, "°C", "Return temperature" }, { 0x5D, 1.0e-2, "<EFBFBD>C", "Return temperature" },
{ 0x5E, 1.0e-1, "°C", "Return temperature" }, { 0x5E, 1.0e-1, "<EFBFBD>C", "Return temperature" },
{ 0x5F, 1.0e0, "°C", "Return temperature" }, { 0x5F, 1.0e0, "<EFBFBD>C", "Return temperature" },
/* E110 00nn Temperature Difference K (mK to K) */ /* E110 00nn Temperature Difference K (mK to K) */
{ 0x60, 1.0e-3, "K", "Temperature difference" }, { 0x60, 1.0e-3, "K", "Temperature difference" },
@ -172,11 +172,11 @@ mbus_variable_vif vif_table[] = {
{ 0x62, 1.0e-1, "K", "Temperature difference" }, { 0x62, 1.0e-1, "K", "Temperature difference" },
{ 0x63, 1.0e0, "K", "Temperature difference" }, { 0x63, 1.0e0, "K", "Temperature difference" },
/* E110 01nn External Temperature °C (0.001°C to 1°C) */ /* E110 01nn External Temperature <EFBFBD>C (0.001<EFBFBD>C to 1<EFBFBD>C) */
{ 0x64, 1.0e-3, "°C", "External temperature" }, { 0x64, 1.0e-3, "<EFBFBD>C", "External temperature" },
{ 0x65, 1.0e-2, "°C", "External temperature" }, { 0x65, 1.0e-2, "<EFBFBD>C", "External temperature" },
{ 0x66, 1.0e-1, "°C", "External temperature" }, { 0x66, 1.0e-1, "<EFBFBD>C", "External temperature" },
{ 0x67, 1.0e0, "°C", "External temperature" }, { 0x67, 1.0e0, "<EFBFBD>C", "External temperature" },
/* E110 10nn Pressure bar (1mbar to 1000mbar) */ /* E110 10nn Pressure bar (1mbar to 1000mbar) */
{ 0x68, 1.0e-3, "bar", "Pressure" }, { 0x68, 1.0e-3, "bar", "Pressure" },
@ -201,10 +201,10 @@ mbus_variable_vif vif_table[] = {
{ 0x73, 86400.0, "s", "Averaging Duration" }, /* days */ { 0x73, 86400.0, "s", "Averaging Duration" }, /* days */
/* E111 01nn Actuality Duration s */ /* E111 01nn Actuality Duration s */
{ 0x74, 1.0, "s", "Actuality Duration" }, /* seconds */ { 0x74, 1.0, "s", "Averaging Duration" }, /* seconds */
{ 0x75, 60.0, "s", "Actuality Duration" }, /* minutes */ { 0x75, 60.0, "s", "Averaging Duration" }, /* minutes */
{ 0x76, 3600.0, "s", "Actuality Duration" }, /* hours */ { 0x76, 3600.0, "s", "Averaging Duration" }, /* hours */
{ 0x77, 86400.0, "s", "Actuality Duration" }, /* days */ { 0x77, 86400.0, "s", "Averaging Duration" }, /* days */
/* Fabrication No */ /* Fabrication No */
{ 0x78, 1.0, "", "Fabrication No" }, { 0x78, 1.0, "", "Fabrication No" },
@ -247,7 +247,7 @@ mbus_variable_vif vif_table[] = {
{ 0x108, 1.0e0, "", "Access Number (transmission count)" }, { 0x108, 1.0e0, "", "Access Number (transmission count)" },
/* E000 1001 Medium (as in fixed header) */ /* E000 1001 Medium (as in fixed header) */
{ 0x109, 1.0e0, "", "Medium" }, { 0x109, 1.0e0, "", "Device type" },
/* E000 1010 Manufacturer (as in fixed header) */ /* E000 1010 Manufacturer (as in fixed header) */
{ 0x10A, 1.0e0, "", "Manufacturer" }, { 0x10A, 1.0e0, "", "Manufacturer" },
@ -256,7 +256,7 @@ mbus_variable_vif vif_table[] = {
{ 0x10B, 1.0e0, "", "Parameter set identification" }, { 0x10B, 1.0e0, "", "Parameter set identification" },
/* E000 1100 Model / Version */ /* E000 1100 Model / Version */
{ 0x10C, 1.0e0, "", "Model / Version" }, { 0x10C, 1.0e0, "", "Device type" },
/* E000 1101 Hardware version # */ /* E000 1101 Hardware version # */
{ 0x10D, 1.0e0, "", "Hardware version" }, { 0x10D, 1.0e0, "", "Hardware version" },
@ -356,9 +356,9 @@ mbus_variable_vif vif_table[] = {
{ 0x130, 1.0e0, "Reserved", "Reserved" }, /* ???? */ { 0x130, 1.0e0, "Reserved", "Reserved" }, /* ???? */
/* E011 00nn Duration of tariff (nn=01 ..11: min to days) */ /* E011 00nn Duration of tariff (nn=01 ..11: min to days) */
{ 0x131, 60.0, "s", "Duration of tariff" }, /* minute(s) */ { 0x131, 60.0, "s", "Storage interval" }, /* minute(s) */
{ 0x132, 3600.0, "s", "Duration of tariff" }, /* hour(s) */ { 0x132, 3600.0, "s", "Storage interval" }, /* hour(s) */
{ 0x133, 86400.0, "s", "Duration of tariff" }, /* day(s) */ { 0x133, 86400.0, "s", "Storage interval" }, /* day(s) */
/* E011 01nn Period of tariff [sec(s) to day(s)] */ /* E011 01nn Period of tariff [sec(s) to day(s)] */
{ 0x134, 1.0, "s", "Period of tariff" }, /* seconds */ { 0x134, 1.0, "s", "Period of tariff" }, /* seconds */
@ -608,29 +608,29 @@ mbus_variable_vif vif_table[] = {
{ 0x256, 1.0e0, "Reserved", "Reserved" }, { 0x256, 1.0e0, "Reserved", "Reserved" },
{ 0x257, 1.0e0, "Reserved", "Reserved" }, { 0x257, 1.0e0, "Reserved", "Reserved" },
/* E101 10nn Flow Temperature 10(nn-3) °F 0.001°F to 1°F */ /* E101 10nn Flow Temperature 10(nn-3) <EFBFBD>F 0.001<EFBFBD>F to 1<EFBFBD>F */
{ 0x258, 1.0e-3, "°F", "Flow temperature" }, { 0x258, 1.0e-3, "<EFBFBD>F", "Flow temperature" },
{ 0x259, 1.0e-2, "°F", "Flow temperature" }, { 0x259, 1.0e-2, "<EFBFBD>F", "Flow temperature" },
{ 0x25A, 1.0e-1, "°F", "Flow temperature" }, { 0x25A, 1.0e-1, "<EFBFBD>F", "Flow temperature" },
{ 0x25B, 1.0e0, "°F", "Flow temperature" }, { 0x25B, 1.0e0, "<EFBFBD>F", "Flow temperature" },
/* E101 11nn Return Temperature 10(nn-3) °F 0.001°F to 1°F */ /* E101 11nn Return Temperature 10(nn-3) <EFBFBD>F 0.001<EFBFBD>F to 1<EFBFBD>F */
{ 0x25C, 1.0e-3, "°F", "Return temperature" }, { 0x25C, 1.0e-3, "<EFBFBD>F", "Return temperature" },
{ 0x25D, 1.0e-2, "°F", "Return temperature" }, { 0x25D, 1.0e-2, "<EFBFBD>F", "Return temperature" },
{ 0x25E, 1.0e-1, "°F", "Return temperature" }, { 0x25E, 1.0e-1, "<EFBFBD>F", "Return temperature" },
{ 0x25F, 1.0e0, "°F", "Return temperature" }, { 0x25F, 1.0e0, "<EFBFBD>F", "Return temperature" },
/* E110 00nn Temperature Difference 10(nn-3) °F 0.001°F to 1°F */ /* E110 00nn Temperature Difference 10(nn-3) <EFBFBD>F 0.001<EFBFBD>F to 1<EFBFBD>F */
{ 0x260, 1.0e-3, "°F", "Temperature difference" }, { 0x260, 1.0e-3, "<EFBFBD>F", "Temperature difference" },
{ 0x261, 1.0e-2, "°F", "Temperature difference" }, { 0x261, 1.0e-2, "<EFBFBD>F", "Temperature difference" },
{ 0x262, 1.0e-1, "°F", "Temperature difference" }, { 0x262, 1.0e-1, "<EFBFBD>F", "Temperature difference" },
{ 0x263, 1.0e0, "°F", "Temperature difference" }, { 0x263, 1.0e0, "<EFBFBD>F", "Temperature difference" },
/* E110 01nn External Temperature 10(nn-3) °F 0.001°F to 1°F */ /* E110 01nn External Temperature 10(nn-3) <EFBFBD>F 0.001<EFBFBD>F to 1<EFBFBD>F */
{ 0x264, 1.0e-3, "°F", "External temperature" }, { 0x264, 1.0e-3, "<EFBFBD>F", "External temperature" },
{ 0x265, 1.0e-2, "°F", "External temperature" }, { 0x265, 1.0e-2, "<EFBFBD>F", "External temperature" },
{ 0x266, 1.0e-1, "°F", "External temperature" }, { 0x266, 1.0e-1, "<EFBFBD>F", "External temperature" },
{ 0x267, 1.0e0, "°F", "External temperature" }, { 0x267, 1.0e0, "<EFBFBD>F", "External temperature" },
/* E110 1nnn Reserved */ /* E110 1nnn Reserved */
{ 0x268, 1.0e0, "Reserved", "Reserved" }, { 0x268, 1.0e0, "Reserved", "Reserved" },
@ -642,19 +642,19 @@ mbus_variable_vif vif_table[] = {
{ 0x26E, 1.0e0, "Reserved", "Reserved" }, { 0x26E, 1.0e0, "Reserved", "Reserved" },
{ 0x26F, 1.0e0, "Reserved", "Reserved" }, { 0x26F, 1.0e0, "Reserved", "Reserved" },
/* E111 00nn Cold / Warm Temperature Limit 10(nn-3) °F 0.001°F to 1°F */ /* E111 00nn Cold / Warm Temperature Limit 10(nn-3) <EFBFBD>F 0.001<EFBFBD>F to 1<EFBFBD>F */
{ 0x270, 1.0e-3, "°F", "Cold / Warm Temperature Limit" }, { 0x270, 1.0e-3, "<EFBFBD>F", "Cold / Warm Temperature Limit" },
{ 0x271, 1.0e-2, "°F", "Cold / Warm Temperature Limit" }, { 0x271, 1.0e-2, "<EFBFBD>F", "Cold / Warm Temperature Limit" },
{ 0x272, 1.0e-1, "°F", "Cold / Warm Temperature Limit" }, { 0x272, 1.0e-1, "<EFBFBD>F", "Cold / Warm Temperature Limit" },
{ 0x273, 1.0e0, "°F", "Cold / Warm Temperature Limit" }, { 0x273, 1.0e0, "<EFBFBD>F", "Cold / Warm Temperature Limit" },
/* E111 01nn Cold / Warm Temperature Limit 10(nn-3) °C 0.001°C to 1°C */ /* E111 01nn Cold / Warm Temperature Limit 10(nn-3) <EFBFBD>C 0.001<EFBFBD>C to 1<EFBFBD>C */
{ 0x274, 1.0e-3, "°C", "Cold / Warm Temperature Limit" }, { 0x274, 1.0e-3, "<EFBFBD>C", "Cold / Warm Temperature Limit" },
{ 0x275, 1.0e-2, "°C", "Cold / Warm Temperature Limit" }, { 0x275, 1.0e-2, "<EFBFBD>C", "Cold / Warm Temperature Limit" },
{ 0x276, 1.0e-1, "°C", "Cold / Warm Temperature Limit" }, { 0x276, 1.0e-1, "<EFBFBD>C", "Cold / Warm Temperature Limit" },
{ 0x277, 1.0e0, "°C", "Cold / Warm Temperature Limit" }, { 0x277, 1.0e0, "<EFBFBD>C", "Cold / Warm Temperature Limit" },
/* E111 1nnn cumul. count max power § 10(nnn-3) W 0.001W to 10000W */ /* E111 1nnn cumul. count max power <EFBFBD> 10(nnn-3) W 0.001W to 10000W */
{ 0x278, 1.0e-3, "W", "Cumul count max power" }, { 0x278, 1.0e-3, "W", "Cumul count max power" },
{ 0x279, 1.0e-3, "W", "Cumul count max power" }, { 0x279, 1.0e-3, "W", "Cumul count max power" },
{ 0x27A, 1.0e-1, "W", "Cumul count max power" }, { 0x27A, 1.0e-1, "W", "Cumul count max power" },
@ -730,7 +730,7 @@ mbus_variable_vif fixed_table[] = {
{ 0x36, 1.0e1, "m^3/h", "Volume flow" }, { 0x36, 1.0e1, "m^3/h", "Volume flow" },
{ 0x37, 1.0e2, "m^3/h", "Volume flow" }, { 0x37, 1.0e2, "m^3/h", "Volume flow" },
{ 0x38, 1.0e-3, "°C", "Temperature" }, { 0x38, 1.0e-3, "<EFBFBD>C", "Temperature" },
{ 0x39, 1.0e0, "Units for H.C.A.", "H.C.A." }, { 0x39, 1.0e0, "Units for H.C.A.", "H.C.A." },
@ -785,6 +785,8 @@ mbus_register_found_event(mbus_handle * handle, void (*event)(mbus_handle * hand
int mbus_fixed_normalize(int medium_unit, long medium_value, char **unit_out, double *value_out, char **quantity_out) int mbus_fixed_normalize(int medium_unit, long medium_value, char **unit_out, double *value_out, char **quantity_out)
{ {
double exponent = 0.0;
int i;
medium_unit = medium_unit & 0x3F; medium_unit = medium_unit & 0x3F;
if (unit_out == NULL || value_out == NULL || quantity_out == NULL) if (unit_out == NULL || value_out == NULL || quantity_out == NULL)
@ -805,7 +807,7 @@ int mbus_fixed_normalize(int medium_unit, long medium_value, char **unit_out, do
break; break;
default: default:
for(int i=0; fixed_table[i].vif < 0xfff; ++i) for(i=0; fixed_table[i].vif < 0xfff; ++i)
{ {
if (fixed_table[i].vif == medium_unit) if (fixed_table[i].vif == medium_unit)
{ {
@ -818,6 +820,7 @@ int mbus_fixed_normalize(int medium_unit, long medium_value, char **unit_out, do
*unit_out = strdup("Unknown"); *unit_out = strdup("Unknown");
*quantity_out = strdup("Unknown"); *quantity_out = strdup("Unknown");
exponent = 0.0;
*value_out = 0.0; *value_out = 0.0;
return -1; return -1;
} }
@ -832,6 +835,7 @@ int mbus_variable_value_decode(mbus_data_record *record, double *value_out_real,
unsigned char vif, vife; unsigned char vif, vife;
struct tm time; struct tm time;
int value_out_int; int value_out_int;
long value_out_long;
long long value_out_long_long; long long value_out_long_long;
*value_out_real = 0.0; *value_out_real = 0.0;
*value_out_str = NULL; *value_out_str = NULL;
@ -853,7 +857,6 @@ int mbus_variable_value_decode(mbus_data_record *record, double *value_out_real,
MBUS_ERROR("Unable to allocate memory"); MBUS_ERROR("Unable to allocate memory");
return -1; return -1;
} }
*value_out_str[0] = '\0';
*value_out_str_size = 0; *value_out_str_size = 0;
result = 0; result = 0;
break; break;
@ -874,7 +877,7 @@ int mbus_variable_value_decode(mbus_data_record *record, double *value_out_real,
return -1; return -1;
} }
*value_out_str_size = snprintf(*value_out_str, 11, "%04d-%02d-%02d", *value_out_str_size = snprintf(*value_out_str, 11, "%04d-%02d-%02d",
(time.tm_year + 1900), (time.tm_year + 2000),
(time.tm_mon + 1), (time.tm_mon + 1),
time.tm_mday); time.tm_mday);
result = 0; result = 0;
@ -900,13 +903,13 @@ int mbus_variable_value_decode(mbus_data_record *record, double *value_out_real,
((record->drh.vib.vif == 0xFD) && (vife == 0x70))) ((record->drh.vib.vif == 0xFD) && (vife == 0x70)))
{ {
mbus_data_tm_decode(&time, record->data, 4); mbus_data_tm_decode(&time, record->data, 4);
if ((*value_out_str = (char*) malloc(21)) == NULL) if ((*value_out_str = (char*) malloc(20)) == NULL)
{ {
MBUS_ERROR("Unable to allocate memory"); MBUS_ERROR("Unable to allocate memory");
return -1; return -1;
} }
*value_out_str_size = snprintf(*value_out_str, 21, "%04d-%02d-%02dT%02d:%02d:%02dZ", *value_out_str_size = snprintf(*value_out_str, 20, "%04d-%02d-%02dT%02d:%02d:%02d",
(time.tm_year + 1900), (time.tm_year + 2000),
(time.tm_mon + 1), (time.tm_mon + 1),
time.tm_mday, time.tm_mday,
time.tm_hour, time.tm_hour,
@ -927,33 +930,8 @@ int mbus_variable_value_decode(mbus_data_record *record, double *value_out_real,
break; break;
case 0x06: /* 6 byte integer (48 bit) */ case 0x06: /* 6 byte integer (48 bit) */
// E110 1101 Time Point (date/time)
// E011 0000 Start (date/time) of tariff
// E111 0000 Date and time of battery change
if ( (vif == 0x6D) ||
((record->drh.vib.vif == 0xFD) && (vife == 0x30)) ||
((record->drh.vib.vif == 0xFD) && (vife == 0x70)))
{
mbus_data_tm_decode(&time, record->data, 6);
if ((*value_out_str = (char*) malloc(21)) == NULL)
{
MBUS_ERROR("Unable to allocate memory");
return -1;
}
*value_out_str_size = snprintf(*value_out_str, 21, "%04d-%02d-%02dT%02d:%02d:%02dZ",
(time.tm_year + 1900),
(time.tm_mon + 1),
time.tm_mday,
time.tm_hour,
time.tm_min,
time.tm_sec);
result = 0;
}
else // normal integer
{
result = mbus_data_long_long_decode(record->data, 6, &value_out_long_long); result = mbus_data_long_long_decode(record->data, 6, &value_out_long_long);
*value_out_real = value_out_long_long; *value_out_real = value_out_long_long;
}
break; break;
case 0x07: /* 8 byte integer (64 bit) */ case 0x07: /* 8 byte integer (64 bit) */
@ -1034,6 +1012,7 @@ int
mbus_vif_unit_normalize(int vif, double value, char **unit_out, double *value_out, char **quantity_out) mbus_vif_unit_normalize(int vif, double value, char **unit_out, double *value_out, char **quantity_out)
{ {
int i; int i;
double exponent = 1.0;
unsigned newVif = vif & 0xF7F; /* clear extension bit */ unsigned newVif = vif & 0xF7F; /* clear extension bit */
MBUS_DEBUG("vif_unit_normalize = 0x%03X \n", vif); MBUS_DEBUG("vif_unit_normalize = 0x%03X \n", vif);
@ -1058,6 +1037,7 @@ mbus_vif_unit_normalize(int vif, double value, char **unit_out, double *value_ou
MBUS_ERROR("%s: Unknown VIF 0x%03X\n", __PRETTY_FUNCTION__, newVif); MBUS_ERROR("%s: Unknown VIF 0x%03X\n", __PRETTY_FUNCTION__, newVif);
*unit_out = strdup("Unknown (VIF=0x%.02X)"); *unit_out = strdup("Unknown (VIF=0x%.02X)");
*quantity_out = strdup("Unknown"); *quantity_out = strdup("Unknown");
exponent = 0.0;
*value_out = 0.0; *value_out = 0.0;
return -1; return -1;
} }
@ -1382,7 +1362,7 @@ mbus_data_variable_xml_normalized(mbus_data_variable *data)
mbus_data_record *record; mbus_data_record *record;
mbus_record *norm_record; mbus_record *norm_record;
char *buff = NULL, *new_buff = NULL; char *buff = NULL, *new_buff = NULL;
char str_encoded[768] = ""; char str_encoded[768];
size_t len = 0, buff_size = 8192; size_t len = 0, buff_size = 8192;
size_t i; size_t i;
@ -1418,7 +1398,7 @@ mbus_data_variable_xml_normalized(mbus_data_variable *data)
buff = new_buff; buff = new_buff;
} }
len += snprintf(&buff[len], buff_size - len, " <DataRecord id=\"%zu\">\n", i); len += snprintf(&buff[len], buff_size - len, " <DataRecord id=\"%zd\">\n", i);
if (norm_record != NULL) if (norm_record != NULL)
{ {
@ -1807,7 +1787,7 @@ mbus_send_switch_baudrate_frame(mbus_handle * handle, int address, long baudrate
control_information = MBUS_CONTROL_INFO_SET_BAUDRATE_38400; control_information = MBUS_CONTROL_INFO_SET_BAUDRATE_38400;
break; break;
default: default:
MBUS_ERROR("%s: invalid baudrate %ld\n", __PRETTY_FUNCTION__, baudrate); MBUS_ERROR("%s: invalid baudrate %lu\n", __PRETTY_FUNCTION__, baudrate);
return -1; return -1;
} }
@ -1892,7 +1872,7 @@ mbus_send_application_reset_frame(mbus_handle * handle, int address, int subcode
// send a request packet to from master to slave // send a request packet to from master to slave
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
int int
mbus_send_request_frame(mbus_handle * handle, int address) mbus_send_request_frame(mbus_handle * handle, int address, char frame_count_bit)
{ {
int retval = 0; int retval = 0;
mbus_frame *frame; mbus_frame *frame;
@ -1914,6 +1894,11 @@ mbus_send_request_frame(mbus_handle * handle, int address)
frame->control = MBUS_CONTROL_MASK_REQ_UD2 | MBUS_CONTROL_MASK_DIR_M2S; frame->control = MBUS_CONTROL_MASK_REQ_UD2 | MBUS_CONTROL_MASK_DIR_M2S;
frame->address = address; frame->address = address;
if (frame_count_bit)
{
frame->control |= MBUS_CONTROL_MASK_FCB;
}
if (mbus_send_frame(handle, frame) == -1) if (mbus_send_frame(handle, frame) == -1)
{ {
MBUS_ERROR("%s: failed to send mbus frame.\n", __PRETTY_FUNCTION__); MBUS_ERROR("%s: failed to send mbus frame.\n", __PRETTY_FUNCTION__);
@ -1947,7 +1932,7 @@ mbus_send_user_data_frame(mbus_handle * handle, int address, const unsigned char
if ((data_size > MBUS_FRAME_DATA_LENGTH) || (data_size == 0)) if ((data_size > MBUS_FRAME_DATA_LENGTH) || (data_size == 0))
{ {
MBUS_ERROR("%s: illegal data_size %zu\n", __PRETTY_FUNCTION__, data_size); MBUS_ERROR("%s: illegal data_size %d\n", __PRETTY_FUNCTION__, data_size);
return -1; return -1;
} }
@ -1975,33 +1960,6 @@ mbus_send_user_data_frame(mbus_handle * handle, int address, const unsigned char
return retval; return retval;
} }
//------------------------------------------------------------------------------
// send a request from master to slave in order to change the primary address
//------------------------------------------------------------------------------
int
mbus_set_primary_address(mbus_handle * handle, int old_address, int new_address)
{
/* primary address record, see chapter 6.4.2 */
unsigned char buffer[3] = { 0x01, 0x7A, new_address };
if (mbus_is_primary_address(new_address) == 0)
{
MBUS_ERROR("%s: invalid address %d\n", __PRETTY_FUNCTION__, new_address);
return -1;
}
switch (new_address)
{
case MBUS_ADDRESS_NETWORK_LAYER:
case MBUS_ADDRESS_BROADCAST_REPLY:
case MBUS_ADDRESS_BROADCAST_NOREPLY:
MBUS_ERROR("%s: invalid address %d\n", __PRETTY_FUNCTION__, new_address);
return -1;
}
return mbus_send_user_data_frame(handle, old_address, buffer, sizeof(buffer));
}
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// send a request from master to slave and collect the reply (replies) // send a request from master to slave and collect the reply (replies)
// from the slave. // from the slave.
@ -2288,7 +2246,7 @@ mbus_probe_secondary_address(mbus_handle *handle, const char *mask, char *matchi
if (ret == MBUS_PROBE_SINGLE) if (ret == MBUS_PROBE_SINGLE)
{ {
/* send a data request command to find out the full address */ /* send a data request command to find out the full address */
if (mbus_send_request_frame(handle, MBUS_ADDRESS_NETWORK_LAYER) == -1) if (mbus_send_request_frame(handle, MBUS_ADDRESS_NETWORK_LAYER, 0) == -1)
{ {
MBUS_ERROR("%s: Failed to send request to selected secondary device [mask %s]: %s.\n", MBUS_ERROR("%s: Failed to send request to selected secondary device [mask %s]: %s.\n",
__PRETTY_FUNCTION__, __PRETTY_FUNCTION__,
@ -2367,7 +2325,7 @@ int mbus_read_slave(mbus_handle * handle, mbus_address *address, mbus_frame * re
if (address->is_primary) if (address->is_primary)
{ {
if (mbus_send_request_frame(handle, address->primary) == -1) if (mbus_send_request_frame(handle, address->primary, 1) == -1)
{ {
MBUS_ERROR("%s: Failed to send M-Bus request frame.\n", MBUS_ERROR("%s: Failed to send M-Bus request frame.\n",
__PRETTY_FUNCTION__); __PRETTY_FUNCTION__);
@ -2411,7 +2369,7 @@ int mbus_read_slave(mbus_handle * handle, mbus_address *address, mbus_frame * re
} }
/* else MBUS_PROBE_SINGLE */ /* else MBUS_PROBE_SINGLE */
if (mbus_send_request_frame(handle, MBUS_ADDRESS_NETWORK_LAYER) == -1) if (mbus_send_request_frame(handle, MBUS_ADDRESS_NETWORK_LAYER, 0) == -1)
{ {
MBUS_ERROR("%s: Failed to send M-Bus request frame.\n", MBUS_ERROR("%s: Failed to send M-Bus request frame.\n",
__PRETTY_FUNCTION__); __PRETTY_FUNCTION__);

View File

@ -290,10 +290,11 @@ int mbus_send_switch_baudrate_frame(mbus_handle * handle, int address, long baud
* *
* @param handle Initialized handle * @param handle Initialized handle
* @param address Address (0-255) * @param address Address (0-255)
* @param frame_count_bit Frame Count Bit (0-1)
* *
* @return Zero when successful. * @return Zero when successful.
*/ */
int mbus_send_request_frame(mbus_handle * handle, int address); int mbus_send_request_frame(mbus_handle * handle, int address, char frame_count_bit);
/** /**
* Sends user data frame (SND_UD) to given slave using "unified" handle * Sends user data frame (SND_UD) to given slave using "unified" handle
@ -307,17 +308,6 @@ int mbus_send_request_frame(mbus_handle * handle, int address);
*/ */
int mbus_send_user_data_frame(mbus_handle * handle, int address, const unsigned char *data, size_t data_size); int mbus_send_user_data_frame(mbus_handle * handle, int address, const unsigned char *data, size_t data_size);
/**
* Sends frame to change primary address of given slave using "unified" handle
*
* @param handle Initialized handle
* @param old_address Old Address (0-255)
* @param new_address New Address (0-250)
*
* @return Zero when successful.
*/
int mbus_set_primary_address(mbus_handle * handle, int old_address, int new_address);
/** /**
* Sends a request and read replies until no more records available * Sends a request and read replies until no more records available
* or limit is reached. * or limit is reached.
@ -440,7 +430,7 @@ int mbus_data_fixed_normalize(int medium_unit_byte, long medium_value, char **un
* *
* @return zero when OK * @return zero when OK
*/ */
int mbus_variable_value_decode(mbus_data_record *record, double *value_out_real, char **value_out_str, int *value_out_str_size); int mbus_data_variable_value_decode(mbus_record *record, double *value_out_real, char **value_out_str, int *value_out_str_size);
/** /**
* Decode units and normalize value using VIF/VIFE (used internally by mbus_vib_unit_normalize) * Decode units and normalize value using VIF/VIFE (used internally by mbus_vib_unit_normalize)

File diff suppressed because it is too large Load Diff

View File

@ -487,27 +487,10 @@ typedef struct _mbus_data_secondary_address {
#define MBUS_VARIABLE_DATA_MEDIUM_HEAT_COOL 0x0D #define MBUS_VARIABLE_DATA_MEDIUM_HEAT_COOL 0x0D
#define MBUS_VARIABLE_DATA_MEDIUM_BUS 0x0E #define MBUS_VARIABLE_DATA_MEDIUM_BUS 0x0E
#define MBUS_VARIABLE_DATA_MEDIUM_UNKNOWN 0x0F #define MBUS_VARIABLE_DATA_MEDIUM_UNKNOWN 0x0F
#define MBUS_VARIABLE_DATA_MEDIUM_IRRIGATION 0x10
#define MBUS_VARIABLE_DATA_MEDIUM_WATER_LOGGER 0x11
#define MBUS_VARIABLE_DATA_MEDIUM_GAS_LOGGER 0x12
#define MBUS_VARIABLE_DATA_MEDIUM_GAS_CONV 0x13
#define MBUS_VARIABLE_DATA_MEDIUM_COLORIFIC 0x14
#define MBUS_VARIABLE_DATA_MEDIUM_BOIL_WATER 0x15
#define MBUS_VARIABLE_DATA_MEDIUM_COLD_WATER 0x16 #define MBUS_VARIABLE_DATA_MEDIUM_COLD_WATER 0x16
#define MBUS_VARIABLE_DATA_MEDIUM_DUAL_WATER 0x17 #define MBUS_VARIABLE_DATA_MEDIUM_DUAL_WATER 0x17
#define MBUS_VARIABLE_DATA_MEDIUM_PRESSURE 0x18 #define MBUS_VARIABLE_DATA_MEDIUM_PRESSURE 0x18
#define MBUS_VARIABLE_DATA_MEDIUM_ADC 0x19 #define MBUS_VARIABLE_DATA_MEDIUM_ADC 0x19
#define MBUS_VARIABLE_DATA_MEDIUM_SMOKE 0x1A
#define MBUS_VARIABLE_DATA_MEDIUM_ROOM_SENSOR 0x1B
#define MBUS_VARIABLE_DATA_MEDIUM_GAS_DETECTOR 0x1C
#define MBUS_VARIABLE_DATA_MEDIUM_BREAKER_E 0x20
#define MBUS_VARIABLE_DATA_MEDIUM_VALVE 0x21
#define MBUS_VARIABLE_DATA_MEDIUM_CUSTOMER_UNIT 0x25
#define MBUS_VARIABLE_DATA_MEDIUM_WASTE_WATER 0x28
#define MBUS_VARIABLE_DATA_MEDIUM_GARBAGE 0x29
#define MBUS_VARIABLE_DATA_MEDIUM_SERVICE_UNIT 0x30
#define MBUS_VARIABLE_DATA_MEDIUM_RC_SYSTEM 0x36
#define MBUS_VARIABLE_DATA_MEDIUM_RC_METER 0x37
// //
// Returns the manufacturer ID or zero if the given // Returns the manufacturer ID or zero if the given
@ -515,7 +498,7 @@ typedef struct _mbus_data_secondary_address {
// //
unsigned int mbus_manufacturer_id(char *manufacturer); unsigned int mbus_manufacturer_id(char *manufacturer);
// Since libmbus writes some special characters (ASCII > 0x7F) into the XML output (e.g. <20>C for centigrade == ASCII 0xB0) // Since libmbus writes some special characters (ASCII > 0x7F) into the XML output (e.g. <20>C for centigrade == ASCII 0xB0)
// it is useful to attach the appropriate code page for postprocessing. // it is useful to attach the appropriate code page for postprocessing.
#define MBUS_XML_PROCESSING_INSTRUCTION "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n" #define MBUS_XML_PROCESSING_INSTRUCTION "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n"
@ -571,8 +554,6 @@ const char *mbus_data_fixed_function(int status);
long mbus_data_record_storage_number(mbus_data_record *record); long mbus_data_record_storage_number(mbus_data_record *record);
long mbus_data_record_tariff(mbus_data_record *record); long mbus_data_record_tariff(mbus_data_record *record);
int mbus_data_record_device(mbus_data_record *record); int mbus_data_record_device(mbus_data_record *record);
const char *mbus_data_record_unit(mbus_data_record *record);
const char *mbus_data_record_value(mbus_data_record *record);
// //
// M-Bus frame data struct access/write functions // M-Bus frame data struct access/write functions
@ -588,7 +569,7 @@ mbus_slave_data *mbus_slave_data_get(size_t i);
// //
// XML generating functions // XML generating functions
// //
int mbus_str_xml_encode(unsigned char *dst, const unsigned char *src, size_t max_len); void mbus_str_xml_encode(unsigned char *dst, const unsigned char *src, size_t max_len);
char *mbus_data_xml(mbus_frame_data *data); char *mbus_data_xml(mbus_frame_data *data);
char *mbus_data_variable_xml(mbus_data_variable *data); char *mbus_data_variable_xml(mbus_data_variable *data);
char *mbus_data_fixed_xml(mbus_data_fixed *data); char *mbus_data_fixed_xml(mbus_data_fixed *data);
@ -627,7 +608,6 @@ int mbus_data_bcd_encode(unsigned char *bcd_data, size_t bcd_data_size, int valu
int mbus_data_int_encode(unsigned char *int_data, size_t int_data_size, int value); int mbus_data_int_encode(unsigned char *int_data, size_t int_data_size, int value);
long long mbus_data_bcd_decode(unsigned char *bcd_data, size_t bcd_data_size); long long mbus_data_bcd_decode(unsigned char *bcd_data, size_t bcd_data_size);
long long mbus_data_bcd_decode_hex(unsigned char *bcd_data, size_t bcd_data_size);
int mbus_data_int_decode(unsigned char *int_data, size_t int_data_size, int *value); int mbus_data_int_decode(unsigned char *int_data, size_t int_data_size, int *value);
int mbus_data_long_decode(unsigned char *int_data, size_t int_data_size, long *value); int mbus_data_long_decode(unsigned char *int_data, size_t int_data_size, long *value);
int mbus_data_long_long_decode(unsigned char *int_data, size_t int_data_size, long long *value); int mbus_data_long_long_decode(unsigned char *int_data, size_t int_data_size, long long *value);
@ -663,3 +643,4 @@ int mbus_is_secondary_address(const char * value);
#endif #endif
#endif /* _MBUS_PROTOCOL_H_ */ #endif /* _MBUS_PROTOCOL_H_ */

View File

@ -72,13 +72,10 @@ mbus_serial_connect(mbus_handle *handle)
// between the end of a master send telegram and the beginning of the response telegram of the slave shall be // between the end of a master send telegram and the beginning of the response telegram of the slave shall be
// between 11 bit times and (330 bit times + 50ms). // between 11 bit times and (330 bit times + 50ms).
// //
// Nowadays the usage of USB to serial adapter is very common, which could // For 2400Bd this means (330 + 11) / 2400 + 0.05 = 188.75 ms (added 11 bit periods to receive first byte).
// result in additional delay of 100 ms in worst case. // I.e. timeout of 0.2s seems appropriate for 2400Bd.
//
// For 2400Bd this means (330 + 11) / 2400 + 0.15 = 292 ms (added 11 bit periods to receive first byte).
// I.e. timeout of 0.3s seems appropriate for 2400Bd.
term->c_cc[VTIME] = (cc_t) 3; // Timeout in 1/10 sec term->c_cc[VTIME] = (cc_t) 2; // Timeout in 1/10 sec
cfsetispeed(term, B2400); cfsetispeed(term, B2400);
cfsetospeed(term, B2400); cfsetospeed(term, B2400);
@ -116,42 +113,42 @@ mbus_serial_set_baudrate(mbus_handle *handle, long baudrate)
{ {
case 300: case 300:
speed = B300; speed = B300;
serial_data->t.c_cc[VTIME] = (cc_t) 13; // Timeout in 1/10 sec serial_data->t.c_cc[VTIME] = (cc_t) 12; // Timeout in 1/10 sec
break; break;
case 600: case 600:
speed = B600; speed = B600;
serial_data->t.c_cc[VTIME] = (cc_t) 8; // Timeout in 1/10 sec serial_data->t.c_cc[VTIME] = (cc_t) 6; // Timeout in 1/10 sec
break; break;
case 1200: case 1200:
speed = B1200; speed = B1200;
serial_data->t.c_cc[VTIME] = (cc_t) 5; // Timeout in 1/10 sec serial_data->t.c_cc[VTIME] = (cc_t) 4; // Timeout in 1/10 sec
break; break;
case 2400: case 2400:
speed = B2400; speed = B2400;
serial_data->t.c_cc[VTIME] = (cc_t) 3; // Timeout in 1/10 sec serial_data->t.c_cc[VTIME] = (cc_t) 2; // Timeout in 1/10 sec
break; break;
case 4800: case 4800:
speed = B4800; speed = B4800;
serial_data->t.c_cc[VTIME] = (cc_t) 3; // Timeout in 1/10 sec serial_data->t.c_cc[VTIME] = (cc_t) 2; // Timeout in 1/10 sec
break; break;
case 9600: case 9600:
speed = B9600; speed = B9600;
serial_data->t.c_cc[VTIME] = (cc_t) 2; // Timeout in 1/10 sec serial_data->t.c_cc[VTIME] = (cc_t) 1; // Timeout in 1/10 sec
break; break;
case 19200: case 19200:
speed = B19200; speed = B19200;
serial_data->t.c_cc[VTIME] = (cc_t) 2; // Timeout in 1/10 sec serial_data->t.c_cc[VTIME] = (cc_t) 1; // Timeout in 1/10 sec
break; break;
case 38400: case 38400:
speed = B38400; speed = B38400;
serial_data->t.c_cc[VTIME] = (cc_t) 2; // Timeout in 1/10 sec serial_data->t.c_cc[VTIME] = (cc_t) 1; // Timeout in 1/10 sec
break; break;
default: default:
@ -191,13 +188,7 @@ mbus_serial_disconnect(mbus_handle *handle)
return -1; return -1;
} }
if (handle->fd < 0)
{
return -1;
}
close(handle->fd); close(handle->fd);
handle->fd = -1;
return 0; return 0;
} }
@ -380,3 +371,4 @@ mbus_serial_recv_frame(mbus_handle *handle, mbus_frame *frame)
return MBUS_RECV_RESULT_OK; return MBUS_RECV_RESULT_OK;
} }

View File

@ -127,13 +127,7 @@ mbus_tcp_disconnect(mbus_handle *handle)
return -1; return -1;
} }
if (handle->fd < 0)
{
return -1;
}
close(handle->fd); close(handle->fd);
handle->fd = -1;
return 0; return 0;
} }
@ -268,3 +262,4 @@ mbus_tcp_set_timeout_set(double seconds)
return 0; return 0;
} }

View File

@ -9,7 +9,6 @@
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
#include "mbus-protocol.h" #include "mbus-protocol.h"
#include "../config.h"
// //
// //
@ -20,4 +19,4 @@ int mbus_init() {return 0;}
/// Return current version of the library /// Return current version of the library
/// ///
const char* const char*
mbus_get_current_version() {return VERSION;} mbus_get_current_version() {return "0.8.0";}

View File

@ -1,14 +1,5 @@
Release notes for libmbus Release notes for libmbus
Version 0.9.0 (2019-02-22):
Added support for negative BCD numbers (type A) and date time CP48 (type I),
new program (set primary address), extended XML output (storage number,
tariff, device), echo cancelation and better retry handling. Also this version
has countless bug fixes.
Many thanks to all contributers
Version 0.8.0 (2012-06-18): Version 0.8.0 (2012-06-18):
-------------------------- --------------------------

View File

@ -1,5 +0,0 @@
add_executable(mbus_parse ${CMAKE_CURRENT_LIST_DIR}/mbus_parse.c)
target_link_libraries(mbus_parse PRIVATE libmbus::libmbus)
add_executable(mbus_parse_hex ${CMAKE_CURRENT_LIST_DIR}/mbus_parse_hex.c)
target_link_libraries(mbus_parse_hex PRIVATE libmbus::libmbus)

25
test/Makefile.am Normal file
View File

@ -0,0 +1,25 @@
# ------------------------------------------------------------------------------
# Copyright (C) 2010, Raditex AB
# All rights reserved.
#
# rSCADA
# http://www.rSCADA.se
# info@rscada.se
#
# ------------------------------------------------------------------------------
PACKAGE = @PACKAGE@
VERSION = @VERSION@
AM_CPPFLAGS = -I$(top_builddir) -I$(top_srcdir) -I$(top_srcdir)/mbus
noinst_HEADERS =
noinst_PROGRAMS = mbus_parse mbus_parse_hex
mbus_parse_LDFLAGS = -L$(top_builddir)/mbus
mbus_parse_LDADD = -lmbus -lm
mbus_parse_SOURCES = mbus_parse.c
mbus_parse_hex_LDFLAGS = -L$(top_builddir)/mbus
mbus_parse_hex_LDADD = -lmbus -lm
mbus_parse_hex_SOURCES = mbus_parse_hex.c

View File

@ -1,8 +0,0 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<MBusData>
<SlaveInformation>
<Error>Application busy</Error>
</SlaveInformation>
</MBusData>

View File

@ -1,8 +0,0 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<MBusData>
<SlaveInformation>
<Error>Buffer too long, truncated</Error>
</SlaveInformation>
</MBusData>

View File

@ -1,8 +0,0 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<MBusData>
<SlaveInformation>
<Error>Unspecified error</Error>
</SlaveInformation>
</MBusData>

View File

@ -1,8 +0,0 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<MBusData>
<SlaveInformation>
<Error>Premature end of record</Error>
</SlaveInformation>
</MBusData>

View File

@ -1,8 +0,0 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<MBusData>
<SlaveInformation>
<Error>More than 10 DIFE´s</Error>
</SlaveInformation>
</MBusData>

View File

@ -1,8 +0,0 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<MBusData>
<SlaveInformation>
<Error>Too many readouts</Error>
</SlaveInformation>
</MBusData>

View File

@ -1,8 +0,0 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<MBusData>
<SlaveInformation>
<Error>Too many records</Error>
</SlaveInformation>
</MBusData>

View File

@ -1,8 +0,0 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<MBusData>
<SlaveInformation>
<Error>More than 10 VIFE´s</Error>
</SlaveInformation>
</MBusData>

View File

@ -1,8 +0,0 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<MBusData>
<SlaveInformation>
<Error>Unimplemented CI-Field</Error>
</SlaveInformation>
</MBusData>

View File

@ -1,8 +0,0 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<MBusData>
<SlaveInformation>
<Error>Unspecified error</Error>
</SlaveInformation>
</MBusData>

View File

@ -12,130 +12,66 @@
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
NUMBER_OF_PARSING_ERRORS=0 # Check if mbus_parse_hex exists
FAILING_TESTS=failing_tests.txt if [ ! -x ./mbus_parse_hex ]; then
NEW_TESTS=new_tests.txt echo "mbus_parse_hex not found"
touch $FAILING_TESTS exit 3
touch $NEW_TESTS fi
# Check commandline parameter # Check commandline parameter
if [ $# -lt 1 ] || [ $# -gt 2 ]; then if [ $# -ne 1 ]; then
echo "usage: $0 path_to_directory_with_xml_files" echo "usage: $0 directory"
echo "or"
echo "usage: $0 path_to_directory_with_xml_files path_to_mbus_parse_hex_with_filename"
exit 3 exit 3
fi fi
directory="$1" directory="$1"
# # Check directory # Check directory
if [ ! -d "$directory" ]; then if [ ! -d "$directory" ]; then
echo "$directory not found" echo "usage: $0 directory"
exit 3 exit 3
fi fi
# Default location is this one
mbus_parse_hex="build/bin/mbus_parse_hex"
# though can be overriten
if [ $# -eq 2 ]; then
mbus_parse_hex="$2"
fi
# Check if mbus_parse_hex exists
if [ ! -x "$mbus_parse_hex" ]; then
echo "mbus_parse_hex not found"
echo "path to mbus_parse_hex: $mbus_parse_hex"
exit 3
fi
generate_xml() {
directory="$1"
hexfile="$2"
mode="$3"
filename=$(basename "$hexfile" .hex)
if [ "$mode" = "normalized" ]; then
options="-n"
mode=".norm"
else
options=""
mode=""
fi
# Parse hex file and write XML in file
"$mbus_parse_hex" $options "$hexfile" > "$directory/$filename$mode.xml.new"
result=$?
# Check parsing result
if [ $result -ne 0 ]; then
NUMBER_OF_PARSING_ERRORS=$((NUMBER_OF_PARSING_ERRORS + 1))
echo "Unable to generate XML for $hexfile"
rm "$directory/$filename$mode.xml.new"
return 1
fi
# Compare old XML with new XML and write in file
diff -u "$directory/$filename$mode.xml" "$directory/$filename$mode.xml.new" 2> /dev/null > "$directory/$filename$mode.dif"
result=$?
case "$result" in
0)
# XML equal -> remove new
rm "$directory/$filename$mode.xml.new"
rm "$directory/$filename$mode.dif"
;;
1)
# different -> print diff
echo "== $directory/$filename$mode failed"
cat "$directory/$filename$mode.dif" && rm "$directory/$filename$mode.dif"
echo ""
echo "$filename$mode" >> $FAILING_TESTS
;;
*)
# no old -> rename XML
echo "Create $filename$mode.xml"
mv "$directory/$filename$mode.xml.new" "$directory/$filename$mode.xml"
rm "$directory/$filename$mode.dif"
echo "$filename$mode" >> $NEW_TESTS
;;
esac
return $result
}
for hexfile in "$directory"/*.hex; do for hexfile in "$directory"/*.hex; do
if [ ! -f "$hexfile" ]; then if [ ! -f "$hexfile" ]; then
continue continue
fi fi
generate_xml "$directory" "$hexfile" "default" filename=`basename $hexfile .hex`
generate_xml "$directory" "$hexfile" "normalized" # Parse hex file and write XML in file
./mbus_parse_hex "$hexfile" > "$directory/$filename.xml.new"
result=$?
# Check parsing result
if [ $result -ne 0 ]; then
echo "Unable to generate XML for $hexfile"
rm "$directory/$filename.xml.new"
continue
fi
# Compare old XML with new XML and write in file
diff -u "$directory/$filename.xml" "$directory/$filename.xml.new" 2> /dev/null > "$directory/$filename.dif"
result=$?
case "$result" in
0)
# XML equal -> remove new
rm "$directory/$filename.xml.new"
rm "$directory/$filename.dif"
;;
1)
# different -> print diff
cat "$directory/$filename.dif" && rm "$directory/$filename.dif"
echo ""
;;
*)
# no old -> rename XML
echo "Create $filename.xml"
mv "$directory/$filename.xml.new" "$directory/$filename.xml"
rm "$directory/$filename.dif"
;;
esac
done done
# Check the size of the file $FAILING_TESTS. Make sure to indicate failure.
if [ -s $FAILING_TESTS ]; then
echo "** There were errors in the following file(s):"
cat $FAILING_TESTS
exit 1
else
rm $FAILING_TESTS
fi
if [ -s $NEW_TESTS ]; then
echo "** There were new test in the following file(s):"
cat $NEW_TESTS
else
rm $NEW_TESTS
fi
# Check that there was no files that failed to parse
if [ $NUMBER_OF_PARSING_ERRORS -ne 0 ]; then
echo "** There were $NUMBER_OF_PARSING_ERRORS files that did not parse, expected 0 files."
echo
exit $NUMBER_OF_PARSING_ERRORS
fi
DIRECTORY_BASENAME="$(basename "$directory")"
echo "** Tests executed successfully in \"$DIRECTORY_BASENAME\"."
echo

View File

@ -18,7 +18,7 @@ int
main(int argc, char *argv[]) main(int argc, char *argv[])
{ {
FILE *fp = NULL; FILE *fp = NULL;
size_t len; size_t buff_len, len;
int normalized = 0; int normalized = 0;
unsigned char buf[1024]; unsigned char buf[1024];
mbus_frame reply; mbus_frame reply;
@ -53,7 +53,6 @@ main(int argc, char *argv[])
if (ferror(fp) != 0) if (ferror(fp) != 0)
{ {
fprintf(stderr, "%s: failed to read '%s'\n", argv[0], file); fprintf(stderr, "%s: failed to read '%s'\n", argv[0], file);
fclose(fp);
return 1; return 1;
} }

View File

@ -18,7 +18,7 @@ int
main(int argc, char *argv[]) main(int argc, char *argv[])
{ {
FILE *fp = NULL; FILE *fp = NULL;
size_t buff_len; size_t buff_len, len;
int result, normalized = 0; int result, normalized = 0;
unsigned char raw_buff[4096], buff[4096]; unsigned char raw_buff[4096], buff[4096];
mbus_frame reply; mbus_frame reply;
@ -48,12 +48,11 @@ main(int argc, char *argv[])
} }
memset(raw_buff, 0, sizeof(raw_buff)); memset(raw_buff, 0, sizeof(raw_buff));
fread(raw_buff, 1, sizeof(raw_buff), fp); len = fread(raw_buff, 1, sizeof(raw_buff), fp);
if (ferror(fp) != 0) if (ferror(fp) != 0)
{ {
fprintf(stderr, "%s: failed to read '%s'\n", argv[0], file); fprintf(stderr, "%s: failed to read '%s'\n", argv[0], file);
fclose(fp);
return 1; return 1;
} }

0
test/test-frames/ACW_Itron-BM-plus-m.hex Normal file → Executable file
View File

View File

@ -1,87 +0,0 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<MBusData>
<SlaveInformation>
<Id>11490378</Id>
<Manufacturer>ACW</Manufacturer>
<Version>14</Version>
<ProductName>Itron BM +m</ProductName>
<Medium>Cold water</Medium>
<AccessNumber>10</AccessNumber>
<Status>00</Status>
<Signature>0000</Signature>
</SlaveInformation>
<DataRecord id="0">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit></Unit>
<Quantity>Fabrication No</Quantity>
<Value>11490378.000000</Value>
</DataRecord>
<DataRecord id="1">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>m^3</Unit>
<Quantity>Volume</Quantity>
<Value>54.321000</Value>
</DataRecord>
<DataRecord id="2">
<Function>Instantaneous value</Function>
<StorageNumber>1</StorageNumber>
<Unit>-</Unit>
<Quantity>Time point (date)</Quantity>
<Value>2000-00-00</Value>
</DataRecord>
<DataRecord id="3">
<Function>Instantaneous value</Function>
<StorageNumber>1</StorageNumber>
<Unit>m^3</Unit>
<Quantity>Volume</Quantity>
<Value>0.000000</Value>
</DataRecord>
<DataRecord id="4">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>-</Unit>
<Quantity>Time point (date &amp; time)</Quantity>
<Value>2014-03-13T11:11:00Z</Value>
</DataRecord>
<DataRecord id="5">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>s</Unit>
<Quantity>Operating time</Quantity>
<Value>0.000000</Value>
</DataRecord>
<DataRecord id="6">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit></Unit>
<Quantity>Firmware version</Quantity>
<Value>2.000000</Value>
</DataRecord>
<DataRecord id="7">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit></Unit>
<Quantity>Software version</Quantity>
<Value>6.000000</Value>
</DataRecord>
<DataRecord id="8">
<Function>Manufacturer specific</Function>
<StorageNumber>0</StorageNumber>
<Unit></Unit>
<Quantity></Quantity>
<Value>00 01 75 13</Value>
</DataRecord>
</MBusData>

View File

@ -1,76 +0,0 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<MBusData>
<SlaveInformation>
<Id>11490378</Id>
<Manufacturer>ACW</Manufacturer>
<Version>14</Version>
<ProductName>Itron BM +m</ProductName>
<Medium>Cold water</Medium>
<AccessNumber>10</AccessNumber>
<Status>00</Status>
<Signature>0000</Signature>
</SlaveInformation>
<DataRecord id="0">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>Fabrication number</Unit>
<Value>11490378</Value>
</DataRecord>
<DataRecord id="1">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>Volume (m m^3)</Unit>
<Value>54321</Value>
</DataRecord>
<DataRecord id="2">
<Function>Instantaneous value</Function>
<StorageNumber>1</StorageNumber>
<Unit>Time Point (date)</Unit>
<Value>2000-00-00</Value>
</DataRecord>
<DataRecord id="3">
<Function>Instantaneous value</Function>
<StorageNumber>1</StorageNumber>
<Unit>Volume (m m^3)</Unit>
<Value>0</Value>
</DataRecord>
<DataRecord id="4">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>Time Point (time &amp; date)</Unit>
<Value>2014-03-13T11:11:00</Value>
</DataRecord>
<DataRecord id="5">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>Operating time (days)</Unit>
<Value>0</Value>
</DataRecord>
<DataRecord id="6">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>Firmware version</Unit>
<Value>2</Value>
</DataRecord>
<DataRecord id="7">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>Software version</Unit>
<Value>6</Value>
</DataRecord>
<DataRecord id="8">
<Function>Manufacturer specific</Function>
<Value>00 01 75 13</Value>
</DataRecord>
</MBusData>

0
test/test-frames/ACW_Itron-CYBLE-M-Bus-14.hex Normal file → Executable file
View File

View File

@ -1,79 +0,0 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<MBusData>
<SlaveInformation>
<Id>9011523</Id>
<Manufacturer>ACW</Manufacturer>
<Version>20</Version>
<ProductName>Itron CYBLE M-Bus 1.4</ProductName>
<Medium>Water</Medium>
<AccessNumber>37</AccessNumber>
<Status>00</Status>
<Signature>0000</Signature>
</SlaveInformation>
<DataRecord id="0">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit></Unit>
<Quantity>Fabrication No</Quantity>
<Value>9011523.000000</Value>
</DataRecord>
<DataRecord id="1">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>-</Unit>
<Quantity>cust. ID</Quantity>
<Value>09LA076755</Value>
</DataRecord>
<DataRecord id="2">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>-</Unit>
<Quantity>Time point (date &amp; time)</Quantity>
<Value>2014-03-13T14:26:00Z</Value>
</DataRecord>
<DataRecord id="3">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>-</Unit>
<Quantity>bat. time</Quantity>
<Value>2516.000000</Value>
</DataRecord>
<DataRecord id="4">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>m^3</Unit>
<Quantity>Volume</Quantity>
<Value>0.031000</Value>
</DataRecord>
<DataRecord id="5">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>m^3</Unit>
<Quantity>Volume</Quantity>
<Value>0.000000</Value>
</DataRecord>
<DataRecord id="6">
<Function>Instantaneous value</Function>
<StorageNumber>1</StorageNumber>
<Unit>m^3</Unit>
<Quantity>Volume</Quantity>
<Value>0.031000</Value>
</DataRecord>
<DataRecord id="7">
<Function>Manufacturer specific</Function>
<StorageNumber>0</StorageNumber>
<Unit></Unit>
<Quantity></Quantity>
<Value>00 01 1F</Value>
</DataRecord>
</MBusData>

View File

@ -1,69 +0,0 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<MBusData>
<SlaveInformation>
<Id>9011523</Id>
<Manufacturer>ACW</Manufacturer>
<Version>20</Version>
<ProductName>Itron CYBLE M-Bus 1.4</ProductName>
<Medium>Water</Medium>
<AccessNumber>37</AccessNumber>
<Status>00</Status>
<Signature>0000</Signature>
</SlaveInformation>
<DataRecord id="0">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>Fabrication number</Unit>
<Value>9011523</Value>
</DataRecord>
<DataRecord id="1">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>cust. ID</Unit>
<Value>09LA076755</Value>
</DataRecord>
<DataRecord id="2">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>Time Point (time &amp; date)</Unit>
<Value>2014-03-13T14:26:00</Value>
</DataRecord>
<DataRecord id="3">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>bat. time</Unit>
<Value>2516</Value>
</DataRecord>
<DataRecord id="4">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>Volume (m m^3)</Unit>
<Value>31</Value>
</DataRecord>
<DataRecord id="5">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>Volume (m m^3)</Unit>
<Value>0</Value>
</DataRecord>
<DataRecord id="6">
<Function>Instantaneous value</Function>
<StorageNumber>1</StorageNumber>
<Unit>Volume (m m^3)</Unit>
<Value>31</Value>
</DataRecord>
<DataRecord id="7">
<Function>Manufacturer specific</Function>
<Value>00 01 1F</Value>
</DataRecord>
</MBusData>

View File

@ -1,231 +0,0 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<MBusData>
<SlaveInformation>
<Id>11120895</Id>
<Manufacturer>EDC</Manufacturer>
<Version>2</Version>
<ProductName></ProductName>
<Medium>Heat: Outlet</Medium>
<AccessNumber>23</AccessNumber>
<Status>00</Status>
<Signature>0000</Signature>
</SlaveInformation>
<DataRecord id="0">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Tariff>0</Tariff>
<Device>0</Device>
<Unit>Wh</Unit>
<Quantity>Energy</Quantity>
<Value>35000.000000</Value>
</DataRecord>
<DataRecord id="1">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Tariff>0</Tariff>
<Device>0</Device>
<Unit>Wh</Unit>
<Quantity>Energy</Quantity>
<Value>465000.000000</Value>
</DataRecord>
<DataRecord id="2">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Tariff>0</Tariff>
<Device>1</Device>
<Unit>Wh</Unit>
<Quantity>Energy</Quantity>
<Value>0.000000</Value>
</DataRecord>
<DataRecord id="3">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Tariff>0</Tariff>
<Device>1</Device>
<Unit>Wh</Unit>
<Quantity>Energy</Quantity>
<Value>0.000000</Value>
</DataRecord>
<DataRecord id="4">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Tariff>0</Tariff>
<Device>0</Device>
<Unit>°C</Unit>
<Quantity>Flow temperature</Quantity>
<Value>21.536703</Value>
</DataRecord>
<DataRecord id="5">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Tariff>0</Tariff>
<Device>0</Device>
<Unit>°C</Unit>
<Quantity>Return temperature</Quantity>
<Value>21.605042</Value>
</DataRecord>
<DataRecord id="6">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Tariff>0</Tariff>
<Device>1</Device>
<Unit>°C</Unit>
<Quantity>Flow temperature</Quantity>
<Value>92.000000</Value>
</DataRecord>
<DataRecord id="7">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Tariff>0</Tariff>
<Device>1</Device>
<Unit>°C</Unit>
<Quantity>Return temperature</Quantity>
<Value>92.000000</Value>
</DataRecord>
<DataRecord id="8">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Tariff>0</Tariff>
<Device>0</Device>
<Unit>m^3/h</Unit>
<Quantity>Volume flow</Quantity>
<Value>0.000707</Value>
</DataRecord>
<DataRecord id="9">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Tariff>0</Tariff>
<Device>1</Device>
<Unit>m^3/h</Unit>
<Quantity>Volume flow</Quantity>
<Value>0.000000</Value>
</DataRecord>
<DataRecord id="10">
<Function>Maximum value</Function>
<StorageNumber>0</StorageNumber>
<Tariff>0</Tariff>
<Device>0</Device>
<Unit>m^3/h</Unit>
<Quantity>Volume flow</Quantity>
<Value>0.357622</Value>
</DataRecord>
<DataRecord id="11">
<Function>Maximum value</Function>
<StorageNumber>0</StorageNumber>
<Tariff>0</Tariff>
<Device>1</Device>
<Unit>m^3/h</Unit>
<Quantity>Volume flow</Quantity>
<Value>0.000000</Value>
</DataRecord>
<DataRecord id="12">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Tariff>0</Tariff>
<Device>0</Device>
<Unit>W</Unit>
<Quantity>Power</Quantity>
<Value>0.000000</Value>
</DataRecord>
<DataRecord id="13">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Tariff>0</Tariff>
<Device>1</Device>
<Unit>W</Unit>
<Quantity>Power</Quantity>
<Value>0.000000</Value>
</DataRecord>
<DataRecord id="14">
<Function>Maximum value</Function>
<StorageNumber>0</StorageNumber>
<Tariff>0</Tariff>
<Device>0</Device>
<Unit>W</Unit>
<Quantity>Power</Quantity>
<Value>18511.912109</Value>
</DataRecord>
<DataRecord id="15">
<Function>Maximum value</Function>
<StorageNumber>0</StorageNumber>
<Tariff>0</Tariff>
<Device>1</Device>
<Unit>W</Unit>
<Quantity>Power</Quantity>
<Value>0.000000</Value>
</DataRecord>
<DataRecord id="16">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>-</Unit>
<Quantity>Time point (date &amp; time)</Quantity>
<Value>2012-07-10T15:25:00Z</Value>
</DataRecord>
<DataRecord id="17">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Tariff>0</Tariff>
<Device>0</Device>
<Unit>-</Unit>
<Quantity>C</Quantity>
<Value>3571.000000</Value>
</DataRecord>
<DataRecord id="18">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Tariff>0</Tariff>
<Device>1</Device>
<Unit>-</Unit>
<Quantity>C</Quantity>
<Value>413.000000</Value>
</DataRecord>
<DataRecord id="19">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Tariff>0</Tariff>
<Device>0</Device>
<Unit>-</Unit>
<Quantity>c</Quantity>
<Value>1.000000</Value>
</DataRecord>
<DataRecord id="20">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Tariff>0</Tariff>
<Device>1</Device>
<Unit>-</Unit>
<Quantity>c</Quantity>
<Value>1.000000</Value>
</DataRecord>
<DataRecord id="21">
<Function>Manufacturer specific</Function>
<StorageNumber>0</StorageNumber>
<Unit></Unit>
<Quantity></Quantity>
<Value></Value>
</DataRecord>
</MBusData>

View File

@ -1,207 +0,0 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<MBusData>
<SlaveInformation>
<Id>11120895</Id>
<Manufacturer>EDC</Manufacturer>
<Version>2</Version>
<ProductName></ProductName>
<Medium>Heat: Outlet</Medium>
<AccessNumber>23</AccessNumber>
<Status>00</Status>
<Signature>0000</Signature>
</SlaveInformation>
<DataRecord id="0">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Tariff>0</Tariff>
<Device>0</Device>
<Unit>Energy (kWh)</Unit>
<Value>35</Value>
</DataRecord>
<DataRecord id="1">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Tariff>0</Tariff>
<Device>0</Device>
<Unit>Energy (kWh)</Unit>
<Value>465</Value>
</DataRecord>
<DataRecord id="2">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Tariff>0</Tariff>
<Device>1</Device>
<Unit>Energy (kWh)</Unit>
<Value>0</Value>
</DataRecord>
<DataRecord id="3">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Tariff>0</Tariff>
<Device>1</Device>
<Unit>Energy (kWh)</Unit>
<Value>0</Value>
</DataRecord>
<DataRecord id="4">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Tariff>0</Tariff>
<Device>0</Device>
<Unit>Flow temperature (deg C)</Unit>
<Value>21.536703</Value>
</DataRecord>
<DataRecord id="5">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Tariff>0</Tariff>
<Device>0</Device>
<Unit>Return temperature (deg C)</Unit>
<Value>21.605042</Value>
</DataRecord>
<DataRecord id="6">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Tariff>0</Tariff>
<Device>1</Device>
<Unit>Flow temperature (deg C)</Unit>
<Value>92.000000</Value>
</DataRecord>
<DataRecord id="7">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Tariff>0</Tariff>
<Device>1</Device>
<Unit>Return temperature (deg C)</Unit>
<Value>92.000000</Value>
</DataRecord>
<DataRecord id="8">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Tariff>0</Tariff>
<Device>0</Device>
<Unit>Volume flow (m m^3/h)</Unit>
<Value>0.707039</Value>
</DataRecord>
<DataRecord id="9">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Tariff>0</Tariff>
<Device>1</Device>
<Unit>Volume flow (m m^3/h)</Unit>
<Value>0.000000</Value>
</DataRecord>
<DataRecord id="10">
<Function>Maximum value</Function>
<StorageNumber>0</StorageNumber>
<Tariff>0</Tariff>
<Device>0</Device>
<Unit>Volume flow (m m^3/h)</Unit>
<Value>357.621735</Value>
</DataRecord>
<DataRecord id="11">
<Function>Maximum value</Function>
<StorageNumber>0</StorageNumber>
<Tariff>0</Tariff>
<Device>1</Device>
<Unit>Volume flow (m m^3/h)</Unit>
<Value>0.000000</Value>
</DataRecord>
<DataRecord id="12">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Tariff>0</Tariff>
<Device>0</Device>
<Unit>Power (W)</Unit>
<Value>0.000000</Value>
</DataRecord>
<DataRecord id="13">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Tariff>0</Tariff>
<Device>1</Device>
<Unit>Power (W)</Unit>
<Value>0.000000</Value>
</DataRecord>
<DataRecord id="14">
<Function>Maximum value</Function>
<StorageNumber>0</StorageNumber>
<Tariff>0</Tariff>
<Device>0</Device>
<Unit>Power (W)</Unit>
<Value>18511.912109</Value>
</DataRecord>
<DataRecord id="15">
<Function>Maximum value</Function>
<StorageNumber>0</StorageNumber>
<Tariff>0</Tariff>
<Device>1</Device>
<Unit>Power (W)</Unit>
<Value>0.000000</Value>
</DataRecord>
<DataRecord id="16">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>Time Point (time &amp; date)</Unit>
<Value>2012-07-10T15:25:00</Value>
</DataRecord>
<DataRecord id="17">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Tariff>0</Tariff>
<Device>0</Device>
<Unit>C</Unit>
<Value>3571</Value>
</DataRecord>
<DataRecord id="18">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Tariff>0</Tariff>
<Device>1</Device>
<Unit>C</Unit>
<Value>413</Value>
</DataRecord>
<DataRecord id="19">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Tariff>0</Tariff>
<Device>0</Device>
<Unit>c</Unit>
<Value>1</Value>
</DataRecord>
<DataRecord id="20">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Tariff>0</Tariff>
<Device>1</Device>
<Unit>c</Unit>
<Value>1</Value>
</DataRecord>
<DataRecord id="21">
<Function>Manufacturer specific</Function>
<Value></Value>
</DataRecord>
</MBusData>

0
test/test-frames/EFE_Engelmann-Elster-SensoStar-2.hex Normal file → Executable file
View File

View File

@ -1,229 +0,0 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<MBusData>
<SlaveInformation>
<Id>24083345</Id>
<Manufacturer>EFE</Manufacturer>
<Version>0</Version>
<ProductName>Engelmann / Elster SensoStar 2</ProductName>
<Medium>Heat: Outlet</Medium>
<AccessNumber>102</AccessNumber>
<Status>27</Status>
<Signature>0000</Signature>
</SlaveInformation>
<DataRecord id="0">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit></Unit>
<Quantity>Fabrication No</Quantity>
<Value>24083345.000000</Value>
</DataRecord>
<DataRecord id="1">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>-</Unit>
<Quantity>Time point (date &amp; time)</Quantity>
<Value>2014-03-12T14:23:00Z</Value>
</DataRecord>
<DataRecord id="2">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>m^3</Unit>
<Quantity>Volume</Quantity>
<Value>0.000000</Value>
</DataRecord>
<DataRecord id="3">
<Function>Instantaneous value</Function>
<StorageNumber>1</StorageNumber>
<Unit>m^3</Unit>
<Quantity>Volume</Quantity>
<Value>0.000000</Value>
</DataRecord>
<DataRecord id="4">
<Function>Instantaneous value</Function>
<StorageNumber>2</StorageNumber>
<Tariff>0</Tariff>
<Device>0</Device>
<Unit>m^3</Unit>
<Quantity>Volume</Quantity>
<Value>0.000000</Value>
</DataRecord>
<DataRecord id="5">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>Wh</Unit>
<Quantity>Energy</Quantity>
<Value>0.000000</Value>
</DataRecord>
<DataRecord id="6">
<Function>Instantaneous value</Function>
<StorageNumber>1</StorageNumber>
<Unit>Wh</Unit>
<Quantity>Energy</Quantity>
<Value>0.000000</Value>
</DataRecord>
<DataRecord id="7">
<Function>Instantaneous value</Function>
<StorageNumber>2</StorageNumber>
<Tariff>0</Tariff>
<Device>0</Device>
<Unit>Wh</Unit>
<Quantity>Energy</Quantity>
<Value>0.000000</Value>
</DataRecord>
<DataRecord id="8">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Tariff>1</Tariff>
<Device>0</Device>
<Unit>Wh</Unit>
<Quantity>Energy</Quantity>
<Value>0.000000</Value>
</DataRecord>
<DataRecord id="9">
<Function>Instantaneous value</Function>
<StorageNumber>1</StorageNumber>
<Tariff>1</Tariff>
<Device>0</Device>
<Unit>Wh</Unit>
<Quantity>Energy</Quantity>
<Value>0.000000</Value>
</DataRecord>
<DataRecord id="10">
<Function>Instantaneous value</Function>
<StorageNumber>2</StorageNumber>
<Tariff>1</Tariff>
<Device>0</Device>
<Unit>Wh</Unit>
<Quantity>Energy</Quantity>
<Value>0.000000</Value>
</DataRecord>
<DataRecord id="11">
<Function>Instantaneous value</Function>
<StorageNumber>1</StorageNumber>
<Unit>-</Unit>
<Quantity>Time point (date)</Quantity>
<Value>2013-12-31</Value>
</DataRecord>
<DataRecord id="12">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>-</Unit>
<Quantity>Time point (date)</Quantity>
<Value>2014-12-31</Value>
</DataRecord>
<DataRecord id="13">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Tariff>2</Tariff>
<Device>0</Device>
<Unit>Wh</Unit>
<Quantity>Energy</Quantity>
<Value>0.000000</Value>
</DataRecord>
<DataRecord id="14">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Tariff>3</Tariff>
<Device>0</Device>
<Unit>Wh</Unit>
<Quantity>Energy</Quantity>
<Value>0.000000</Value>
</DataRecord>
<DataRecord id="15">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>m^3/h</Unit>
<Quantity>Volume flow</Quantity>
<Value>0.000000</Value>
</DataRecord>
<DataRecord id="16">
<Function>Maximum value</Function>
<StorageNumber>0</StorageNumber>
<Unit>m^3/h</Unit>
<Quantity>Volume flow</Quantity>
<Value>0.025000</Value>
</DataRecord>
<DataRecord id="17">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>W</Unit>
<Quantity>Power</Quantity>
<Value>0.000000</Value>
</DataRecord>
<DataRecord id="18">
<Function>Maximum value</Function>
<StorageNumber>0</StorageNumber>
<Unit>W</Unit>
<Quantity>Power</Quantity>
<Value>11.000000</Value>
</DataRecord>
<DataRecord id="19">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>°C</Unit>
<Quantity>Flow temperature</Quantity>
<Value>22.000000</Value>
</DataRecord>
<DataRecord id="20">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>°C</Unit>
<Quantity>Return temperature</Quantity>
<Value>21.000000</Value>
</DataRecord>
<DataRecord id="21">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>K</Unit>
<Quantity>Temperature difference</Quantity>
<Value>0.090000</Value>
</DataRecord>
<DataRecord id="22">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>s</Unit>
<Quantity>On time</Quantity>
<Value>45273600.000000</Value>
</DataRecord>
<DataRecord id="23">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit></Unit>
<Quantity>Error flags</Quantity>
<Value>0.000000</Value>
</DataRecord>
<DataRecord id="24">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>m^3</Unit>
<Quantity>Volume</Quantity>
<Value>0.000011</Value>
</DataRecord>
</MBusData>

View File

@ -1,204 +0,0 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<MBusData>
<SlaveInformation>
<Id>24083345</Id>
<Manufacturer>EFE</Manufacturer>
<Version>0</Version>
<ProductName>Engelmann / Elster SensoStar 2</ProductName>
<Medium>Heat: Outlet</Medium>
<AccessNumber>102</AccessNumber>
<Status>27</Status>
<Signature>0000</Signature>
</SlaveInformation>
<DataRecord id="0">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>Fabrication number</Unit>
<Value>24083345</Value>
</DataRecord>
<DataRecord id="1">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>Time Point (time &amp; date)</Unit>
<Value>2014-03-12T14:23:00</Value>
</DataRecord>
<DataRecord id="2">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>Volume (1e-1 m^3)</Unit>
<Value>0</Value>
</DataRecord>
<DataRecord id="3">
<Function>Instantaneous value</Function>
<StorageNumber>1</StorageNumber>
<Unit>Volume (1e-1 m^3)</Unit>
<Value>0</Value>
</DataRecord>
<DataRecord id="4">
<Function>Instantaneous value</Function>
<StorageNumber>2</StorageNumber>
<Tariff>0</Tariff>
<Device>0</Device>
<Unit>Volume (1e-1 m^3)</Unit>
<Value>0</Value>
</DataRecord>
<DataRecord id="5">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>Energy (kWh)</Unit>
<Value>0</Value>
</DataRecord>
<DataRecord id="6">
<Function>Instantaneous value</Function>
<StorageNumber>1</StorageNumber>
<Unit>Energy (kWh)</Unit>
<Value>0</Value>
</DataRecord>
<DataRecord id="7">
<Function>Instantaneous value</Function>
<StorageNumber>2</StorageNumber>
<Tariff>0</Tariff>
<Device>0</Device>
<Unit>Energy (kWh)</Unit>
<Value>0</Value>
</DataRecord>
<DataRecord id="8">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Tariff>1</Tariff>
<Device>0</Device>
<Unit>Energy (kWh)</Unit>
<Value>0</Value>
</DataRecord>
<DataRecord id="9">
<Function>Instantaneous value</Function>
<StorageNumber>1</StorageNumber>
<Tariff>1</Tariff>
<Device>0</Device>
<Unit>Energy (kWh)</Unit>
<Value>0</Value>
</DataRecord>
<DataRecord id="10">
<Function>Instantaneous value</Function>
<StorageNumber>2</StorageNumber>
<Tariff>1</Tariff>
<Device>0</Device>
<Unit>Energy (kWh)</Unit>
<Value>0</Value>
</DataRecord>
<DataRecord id="11">
<Function>Instantaneous value</Function>
<StorageNumber>1</StorageNumber>
<Unit>Time Point (date)</Unit>
<Value>2013-12-31</Value>
</DataRecord>
<DataRecord id="12">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>Time Point (date)</Unit>
<Value>2014-12-31</Value>
</DataRecord>
<DataRecord id="13">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Tariff>2</Tariff>
<Device>0</Device>
<Unit>Energy (kWh)</Unit>
<Value>0</Value>
</DataRecord>
<DataRecord id="14">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Tariff>3</Tariff>
<Device>0</Device>
<Unit>Energy (kWh)</Unit>
<Value>0</Value>
</DataRecord>
<DataRecord id="15">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>Volume flow (m m^3/h)</Unit>
<Value>0</Value>
</DataRecord>
<DataRecord id="16">
<Function>Maximum value</Function>
<StorageNumber>0</StorageNumber>
<Unit>Volume flow (m m^3/h)</Unit>
<Value>25</Value>
</DataRecord>
<DataRecord id="17">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>Power (W)</Unit>
<Value>0</Value>
</DataRecord>
<DataRecord id="18">
<Function>Maximum value</Function>
<StorageNumber>0</StorageNumber>
<Unit>Power (W)</Unit>
<Value>11</Value>
</DataRecord>
<DataRecord id="19">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>Flow temperature (deg C)</Unit>
<Value>22</Value>
</DataRecord>
<DataRecord id="20">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>Return temperature (deg C)</Unit>
<Value>21</Value>
</DataRecord>
<DataRecord id="21">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>Temperature Difference (1e-2 deg C)</Unit>
<Value>9</Value>
</DataRecord>
<DataRecord id="22">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>On time (days)</Unit>
<Value>524</Value>
</DataRecord>
<DataRecord id="23">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>Error flags</Unit>
<Value>0</Value>
</DataRecord>
<DataRecord id="24">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>Volume (my m^3)</Unit>
<Value>11</Value>
</DataRecord>
</MBusData>

0
test/test-frames/EFE_Engelmann-WaterStar.hex Normal file → Executable file
View File

View File

@ -1,113 +0,0 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<MBusData>
<SlaveInformation>
<Id>4990254</Id>
<Manufacturer>EFE</Manufacturer>
<Version>0</Version>
<ProductName>Engelmann WaterStar</ProductName>
<Medium>Warm water (30-90°C)</Medium>
<AccessNumber>12</AccessNumber>
<Status>27</Status>
<Signature>0000</Signature>
</SlaveInformation>
<DataRecord id="0">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit></Unit>
<Quantity>Fabrication No</Quantity>
<Value>4990254.000000</Value>
</DataRecord>
<DataRecord id="1">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>-</Unit>
<Quantity>Time point (date &amp; time)</Quantity>
<Value>2014-03-13T12:10:00Z</Value>
</DataRecord>
<DataRecord id="2">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>m^3</Unit>
<Quantity>Volume</Quantity>
<Value>0.332000</Value>
</DataRecord>
<DataRecord id="3">
<Function>Instantaneous value</Function>
<StorageNumber>1</StorageNumber>
<Unit>m^3</Unit>
<Quantity>Volume</Quantity>
<Value>0.331000</Value>
</DataRecord>
<DataRecord id="4">
<Function>Instantaneous value</Function>
<StorageNumber>2</StorageNumber>
<Tariff>0</Tariff>
<Device>0</Device>
<Unit>m^3</Unit>
<Quantity>Volume</Quantity>
<Value>0.332000</Value>
</DataRecord>
<DataRecord id="5">
<Function>Instantaneous value</Function>
<StorageNumber>1</StorageNumber>
<Unit>-</Unit>
<Quantity>Time point (date)</Quantity>
<Value>2013-12-31</Value>
</DataRecord>
<DataRecord id="6">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>-</Unit>
<Quantity>Time point (date)</Quantity>
<Value>2014-12-31</Value>
</DataRecord>
<DataRecord id="7">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>m^3/h</Unit>
<Quantity>Volume flow</Quantity>
<Value>0.000000</Value>
</DataRecord>
<DataRecord id="8">
<Function>Maximum value</Function>
<StorageNumber>0</StorageNumber>
<Unit>m^3/h</Unit>
<Quantity>Volume flow</Quantity>
<Value>2.070000</Value>
</DataRecord>
<DataRecord id="9">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>s</Unit>
<Quantity>On time</Quantity>
<Value>102902400.000000</Value>
</DataRecord>
<DataRecord id="10">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit></Unit>
<Quantity>Error flags</Quantity>
<Value>0.000000</Value>
</DataRecord>
<DataRecord id="11">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>m^3</Unit>
<Quantity>Volume</Quantity>
<Value>0.000008</Value>
</DataRecord>
</MBusData>

View File

@ -1,101 +0,0 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<MBusData>
<SlaveInformation>
<Id>4990254</Id>
<Manufacturer>EFE</Manufacturer>
<Version>0</Version>
<ProductName>Engelmann WaterStar</ProductName>
<Medium>Warm water (30-90°C)</Medium>
<AccessNumber>12</AccessNumber>
<Status>27</Status>
<Signature>0000</Signature>
</SlaveInformation>
<DataRecord id="0">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>Fabrication number</Unit>
<Value>4990254</Value>
</DataRecord>
<DataRecord id="1">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>Time Point (time &amp; date)</Unit>
<Value>2014-03-13T12:10:00</Value>
</DataRecord>
<DataRecord id="2">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>Volume (m m^3)</Unit>
<Value>332</Value>
</DataRecord>
<DataRecord id="3">
<Function>Instantaneous value</Function>
<StorageNumber>1</StorageNumber>
<Unit>Volume (m m^3)</Unit>
<Value>331</Value>
</DataRecord>
<DataRecord id="4">
<Function>Instantaneous value</Function>
<StorageNumber>2</StorageNumber>
<Tariff>0</Tariff>
<Device>0</Device>
<Unit>Volume (m m^3)</Unit>
<Value>332</Value>
</DataRecord>
<DataRecord id="5">
<Function>Instantaneous value</Function>
<StorageNumber>1</StorageNumber>
<Unit>Time Point (date)</Unit>
<Value>2013-12-31</Value>
</DataRecord>
<DataRecord id="6">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>Time Point (date)</Unit>
<Value>2014-12-31</Value>
</DataRecord>
<DataRecord id="7">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>Volume flow (m m^3/h)</Unit>
<Value>0</Value>
</DataRecord>
<DataRecord id="8">
<Function>Maximum value</Function>
<StorageNumber>0</StorageNumber>
<Unit>Volume flow (m m^3/h)</Unit>
<Value>2070</Value>
</DataRecord>
<DataRecord id="9">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>On time (days)</Unit>
<Value>1191</Value>
</DataRecord>
<DataRecord id="10">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>Error flags</Unit>
<Value>0</Value>
</DataRecord>
<DataRecord id="11">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>Volume (my m^3)</Unit>
<Value>8</Value>
</DataRecord>
</MBusData>

0
test/test-frames/ELS_Elster-F96-Plus.hex Normal file → Executable file
View File

View File

@ -1,151 +0,0 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<MBusData>
<SlaveInformation>
<Id>44493951</Id>
<Manufacturer>ELS</Manufacturer>
<Version>47</Version>
<ProductName>Elster F96 Plus</ProductName>
<Medium>Heat: Outlet</Medium>
<AccessNumber>161</AccessNumber>
<Status>70</Status>
<Signature>0000</Signature>
</SlaveInformation>
<DataRecord id="0">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>Wh</Unit>
<Quantity>Energy</Quantity>
<Value>0.000000</Value>
</DataRecord>
<DataRecord id="1">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Tariff>1</Tariff>
<Device>0</Device>
<Unit>Wh</Unit>
<Quantity>Energy</Quantity>
<Value>0.000000</Value>
</DataRecord>
<DataRecord id="2">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Tariff>2</Tariff>
<Device>0</Device>
<Unit>m^3</Unit>
<Quantity>Volume</Quantity>
<Value>0.000000</Value>
</DataRecord>
<DataRecord id="3">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>m^3</Unit>
<Quantity>Volume</Quantity>
<Value>0.000000</Value>
</DataRecord>
<DataRecord id="4">
<Function>Value during error state</Function>
<StorageNumber>0</StorageNumber>
<Unit>W</Unit>
<Quantity>Power</Quantity>
<Value>13131113.000000</Value>
</DataRecord>
<DataRecord id="5">
<Function>Value during error state</Function>
<StorageNumber>0</StorageNumber>
<Unit>m^3/h</Unit>
<Quantity>Volume flow</Quantity>
<Value>131.113000</Value>
</DataRecord>
<DataRecord id="6">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>°C</Unit>
<Quantity>Flow temperature</Quantity>
<Value>22.700000</Value>
</DataRecord>
<DataRecord id="7">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>°C</Unit>
<Quantity>Return temperature</Quantity>
<Value>22.600000</Value>
</DataRecord>
<DataRecord id="8">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>K</Unit>
<Quantity>Temperature difference</Quantity>
<Value>0.100000</Value>
</DataRecord>
<DataRecord id="9">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>s</Unit>
<Quantity>Operating time</Quantity>
<Value>63072000.000000</Value>
</DataRecord>
<DataRecord id="10">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>-</Unit>
<Quantity>Time point (date &amp; time)</Quantity>
<Value>2014-03-13T13:09:00Z</Value>
</DataRecord>
<DataRecord id="11">
<Function>Instantaneous value</Function>
<StorageNumber>1</StorageNumber>
<Unit>Wh</Unit>
<Quantity>Energy</Quantity>
<Value>0.000000</Value>
</DataRecord>
<DataRecord id="12">
<Function>Instantaneous value</Function>
<StorageNumber>1</StorageNumber>
<Unit>m^3</Unit>
<Quantity>Volume</Quantity>
<Value>0.000000</Value>
</DataRecord>
<DataRecord id="13">
<Function>Instantaneous value</Function>
<StorageNumber>1</StorageNumber>
<Tariff>1</Tariff>
<Device>0</Device>
<Unit>Wh</Unit>
<Quantity>Energy</Quantity>
<Value>0.000000</Value>
</DataRecord>
<DataRecord id="14">
<Function>Instantaneous value</Function>
<StorageNumber>1</StorageNumber>
<Tariff>2</Tariff>
<Device>0</Device>
<Unit>m^3</Unit>
<Quantity>Volume</Quantity>
<Value>0.000000</Value>
</DataRecord>
<DataRecord id="15">
<Function>Instantaneous value</Function>
<StorageNumber>1</StorageNumber>
<Unit>-</Unit>
<Quantity>Time point (date)</Quantity>
<Value>2013-05-31</Value>
</DataRecord>
</MBusData>

View File

@ -1,135 +0,0 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<MBusData>
<SlaveInformation>
<Id>44493951</Id>
<Manufacturer>ELS</Manufacturer>
<Version>47</Version>
<ProductName>Elster F96 Plus</ProductName>
<Medium>Heat: Outlet</Medium>
<AccessNumber>161</AccessNumber>
<Status>70</Status>
<Signature>0000</Signature>
</SlaveInformation>
<DataRecord id="0">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>Energy (kWh)</Unit>
<Value>0</Value>
</DataRecord>
<DataRecord id="1">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Tariff>1</Tariff>
<Device>0</Device>
<Unit>Energy (kWh)</Unit>
<Value>0</Value>
</DataRecord>
<DataRecord id="2">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Tariff>2</Tariff>
<Device>0</Device>
<Unit>Volume (m m^3)</Unit>
<Value>0</Value>
</DataRecord>
<DataRecord id="3">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>Volume (m m^3)</Unit>
<Value>0</Value>
</DataRecord>
<DataRecord id="4">
<Function>Value during error state</Function>
<StorageNumber>0</StorageNumber>
<Unit>Power (W)</Unit>
<Value>DDDDEBBD</Value>
</DataRecord>
<DataRecord id="5">
<Function>Value during error state</Function>
<StorageNumber>0</StorageNumber>
<Unit>Volume flow (m m^3/h)</Unit>
<Value>DDEBBD</Value>
</DataRecord>
<DataRecord id="6">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>Flow temperature (1e-1 deg C)</Unit>
<Value>227</Value>
</DataRecord>
<DataRecord id="7">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>Return temperature (1e-1 deg C)</Unit>
<Value>226</Value>
</DataRecord>
<DataRecord id="8">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>Temperature Difference (1e-1 deg C)</Unit>
<Value>1</Value>
</DataRecord>
<DataRecord id="9">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>Operating time (days)</Unit>
<Value>730</Value>
</DataRecord>
<DataRecord id="10">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>Time Point (time &amp; date)</Unit>
<Value>2014-03-13T13:09:00</Value>
</DataRecord>
<DataRecord id="11">
<Function>Instantaneous value</Function>
<StorageNumber>1</StorageNumber>
<Unit>Energy (kWh)</Unit>
<Value>0</Value>
</DataRecord>
<DataRecord id="12">
<Function>Instantaneous value</Function>
<StorageNumber>1</StorageNumber>
<Unit>Volume (m m^3)</Unit>
<Value>0</Value>
</DataRecord>
<DataRecord id="13">
<Function>Instantaneous value</Function>
<StorageNumber>1</StorageNumber>
<Tariff>1</Tariff>
<Device>0</Device>
<Unit>Energy (kWh)</Unit>
<Value>0</Value>
</DataRecord>
<DataRecord id="14">
<Function>Instantaneous value</Function>
<StorageNumber>1</StorageNumber>
<Tariff>2</Tariff>
<Device>0</Device>
<Unit>Volume (m m^3)</Unit>
<Value>0</Value>
</DataRecord>
<DataRecord id="15">
<Function>Instantaneous value</Function>
<StorageNumber>1</StorageNumber>
<Unit>Time Point (date)</Unit>
<Value>2013-05-31</Value>
</DataRecord>
</MBusData>

View File

@ -1 +0,0 @@
68 53 53 68 08 0B 72 61 15 01 24 96 15 16 00 3F 00 00 00 01 FD 1B 02 02 FC 03 48 52 25 74 22 15 22 FC 03 48 52 25 74 24 0D 12 FC 03 48 52 25 74 C3 1C 02 65 2E 08 22 65 5C 05 12 65 A2 0B 01 72 18 42 65 2C 08 82 01 65 1F 08 0C 78 61 15 01 24 03 FD 0F 00 00 04 1F BD 16

View File

@ -1,121 +0,0 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<MBusData>
<SlaveInformation>
<Id>24011561</Id>
<Manufacturer>ELV</Manufacturer>
<Version>22</Version>
<ProductName>Elvaco CMa10</ProductName>
<Medium>Other</Medium>
<AccessNumber>63</AccessNumber>
<Status>00</Status>
<Signature>0000</Signature>
</SlaveInformation>
<DataRecord id="0">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit></Unit>
<Quantity>Digital Input</Quantity>
<Value>2.000000</Value>
</DataRecord>
<DataRecord id="1">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>-</Unit>
<Quantity>%RH</Quantity>
<Value>54.100000</Value>
</DataRecord>
<DataRecord id="2">
<Function>Minimum value</Function>
<StorageNumber>0</StorageNumber>
<Unit>-</Unit>
<Quantity>%RH</Quantity>
<Value>33.640000</Value>
</DataRecord>
<DataRecord id="3">
<Function>Maximum value</Function>
<StorageNumber>0</StorageNumber>
<Unit>-</Unit>
<Quantity>%RH</Quantity>
<Value>73.630000</Value>
</DataRecord>
<DataRecord id="4">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>°C</Unit>
<Quantity>External temperature</Quantity>
<Value>20.940000</Value>
</DataRecord>
<DataRecord id="5">
<Function>Minimum value</Function>
<StorageNumber>0</StorageNumber>
<Unit>°C</Unit>
<Quantity>External temperature</Quantity>
<Value>13.720000</Value>
</DataRecord>
<DataRecord id="6">
<Function>Maximum value</Function>
<StorageNumber>0</StorageNumber>
<Unit>°C</Unit>
<Quantity>External temperature</Quantity>
<Value>29.780000</Value>
</DataRecord>
<DataRecord id="7">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>s</Unit>
<Quantity>Averaging Duration</Quantity>
<Value>86400.000000</Value>
</DataRecord>
<DataRecord id="8">
<Function>Instantaneous value</Function>
<StorageNumber>1</StorageNumber>
<Unit>°C</Unit>
<Quantity>External temperature</Quantity>
<Value>20.920000</Value>
</DataRecord>
<DataRecord id="9">
<Function>Instantaneous value</Function>
<StorageNumber>2</StorageNumber>
<Tariff>0</Tariff>
<Device>0</Device>
<Unit>°C</Unit>
<Quantity>External temperature</Quantity>
<Value>20.790000</Value>
</DataRecord>
<DataRecord id="10">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit></Unit>
<Quantity>Fabrication No</Quantity>
<Value>24011561.000000</Value>
</DataRecord>
<DataRecord id="11">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit></Unit>
<Quantity>Software version</Quantity>
<Value>262144.000000</Value>
</DataRecord>
<DataRecord id="12">
<Function>More records follow</Function>
<StorageNumber>0</StorageNumber>
<Unit></Unit>
<Quantity></Quantity>
<Value></Value>
</DataRecord>
</MBusData>

View File

@ -1,106 +0,0 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<MBusData>
<SlaveInformation>
<Id>24011561</Id>
<Manufacturer>ELV</Manufacturer>
<Version>22</Version>
<ProductName>Elvaco CMa10</ProductName>
<Medium>Other</Medium>
<AccessNumber>63</AccessNumber>
<Status>00</Status>
<Signature>0000</Signature>
</SlaveInformation>
<DataRecord id="0">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>Digital input (binary)</Unit>
<Value>2</Value>
</DataRecord>
<DataRecord id="1">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>1e-2 %RH</Unit>
<Value>5410</Value>
</DataRecord>
<DataRecord id="2">
<Function>Minimum value</Function>
<StorageNumber>0</StorageNumber>
<Unit>1e-2 %RH</Unit>
<Value>3364</Value>
</DataRecord>
<DataRecord id="3">
<Function>Maximum value</Function>
<StorageNumber>0</StorageNumber>
<Unit>1e-2 %RH</Unit>
<Value>7363</Value>
</DataRecord>
<DataRecord id="4">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>External temperature (1e-2 deg C)</Unit>
<Value>2094</Value>
</DataRecord>
<DataRecord id="5">
<Function>Minimum value</Function>
<StorageNumber>0</StorageNumber>
<Unit>External temperature (1e-2 deg C)</Unit>
<Value>1372</Value>
</DataRecord>
<DataRecord id="6">
<Function>Maximum value</Function>
<StorageNumber>0</StorageNumber>
<Unit>External temperature (1e-2 deg C)</Unit>
<Value>2978</Value>
</DataRecord>
<DataRecord id="7">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>Averaging Duration (hours)</Unit>
<Value>24</Value>
</DataRecord>
<DataRecord id="8">
<Function>Instantaneous value</Function>
<StorageNumber>1</StorageNumber>
<Unit>External temperature (1e-2 deg C)</Unit>
<Value>2092</Value>
</DataRecord>
<DataRecord id="9">
<Function>Instantaneous value</Function>
<StorageNumber>2</StorageNumber>
<Tariff>0</Tariff>
<Device>0</Device>
<Unit>External temperature (1e-2 deg C)</Unit>
<Value>2079</Value>
</DataRecord>
<DataRecord id="10">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>Fabrication number</Unit>
<Value>24011561</Value>
</DataRecord>
<DataRecord id="11">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>Software version</Unit>
<Value>262144</Value>
</DataRecord>
<DataRecord id="12">
<Function>More records follow</Function>
<Value></Value>
</DataRecord>
</MBusData>

0
test/test-frames/EMU_EMU-Professional-375-M-Bus.hex Normal file → Executable file
View File

View File

@ -1,287 +0,0 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<MBusData>
<SlaveInformation>
<Id>32629</Id>
<Manufacturer>EMU</Manufacturer>
<Version>16</Version>
<ProductName>EMU Professional 3/75 M-Bus</ProductName>
<Medium>Electricity</Medium>
<AccessNumber>2</AccessNumber>
<Status>00</Status>
<Signature>0000</Signature>
</SlaveInformation>
<DataRecord id="0">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit></Unit>
<Quantity>Fabrication No</Quantity>
<Value>32629.000000</Value>
</DataRecord>
<DataRecord id="1">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Tariff>1</Tariff>
<Device>0</Device>
<Unit>Wh</Unit>
<Quantity>Energy</Quantity>
<Value>1364.000000</Value>
</DataRecord>
<DataRecord id="2">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Tariff>2</Tariff>
<Device>0</Device>
<Unit>Wh</Unit>
<Quantity>Energy</Quantity>
<Value>0.000000</Value>
</DataRecord>
<DataRecord id="3">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Tariff>1</Tariff>
<Device>2</Device>
<Unit>Wh</Unit>
<Quantity>Energy</Quantity>
<Value>7854.000000</Value>
</DataRecord>
<DataRecord id="4">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Tariff>2</Tariff>
<Device>2</Device>
<Unit>Wh</Unit>
<Quantity>Energy</Quantity>
<Value>0.000000</Value>
</DataRecord>
<DataRecord id="5">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>W</Unit>
<Quantity>Power</Quantity>
<Value>-2.000000</Value>
</DataRecord>
<DataRecord id="6">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>W</Unit>
<Quantity>Power</Quantity>
<Value>0.000000</Value>
</DataRecord>
<DataRecord id="7">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>W</Unit>
<Quantity>Power</Quantity>
<Value>0.000000</Value>
</DataRecord>
<DataRecord id="8">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>W</Unit>
<Quantity>Power</Quantity>
<Value>-2.000000</Value>
</DataRecord>
<DataRecord id="9">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Tariff>0</Tariff>
<Device>2</Device>
<Unit>W</Unit>
<Quantity>Power</Quantity>
<Value>14.000000</Value>
</DataRecord>
<DataRecord id="10">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Tariff>0</Tariff>
<Device>2</Device>
<Unit>W</Unit>
<Quantity>Power</Quantity>
<Value>0.000000</Value>
</DataRecord>
<DataRecord id="11">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Tariff>0</Tariff>
<Device>2</Device>
<Unit>W</Unit>
<Quantity>Power</Quantity>
<Value>0.000000</Value>
</DataRecord>
<DataRecord id="12">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Tariff>0</Tariff>
<Device>2</Device>
<Unit>W</Unit>
<Quantity>Power</Quantity>
<Value>14.000000</Value>
</DataRecord>
<DataRecord id="13">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>V</Unit>
<Quantity>Voltage</Quantity>
<Value>225.700000</Value>
</DataRecord>
<DataRecord id="14">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>V</Unit>
<Quantity>Voltage</Quantity>
<Value>0.000000</Value>
</DataRecord>
<DataRecord id="15">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>V</Unit>
<Quantity>Voltage</Quantity>
<Value>0.000000</Value>
</DataRecord>
<DataRecord id="16">
<Function>Minimum value</Function>
<StorageNumber>0</StorageNumber>
<Unit>V</Unit>
<Quantity>Voltage</Quantity>
<Value>187.400000</Value>
</DataRecord>
<DataRecord id="17">
<Function>Minimum value</Function>
<StorageNumber>0</StorageNumber>
<Unit>V</Unit>
<Quantity>Voltage</Quantity>
<Value>0.000000</Value>
</DataRecord>
<DataRecord id="18">
<Function>Minimum value</Function>
<StorageNumber>0</StorageNumber>
<Unit>V</Unit>
<Quantity>Voltage</Quantity>
<Value>0.000000</Value>
</DataRecord>
<DataRecord id="19">
<Function>Maximum value</Function>
<StorageNumber>0</StorageNumber>
<Unit>V</Unit>
<Quantity>Voltage</Quantity>
<Value>241.000000</Value>
</DataRecord>
<DataRecord id="20">
<Function>Maximum value</Function>
<StorageNumber>0</StorageNumber>
<Unit>V</Unit>
<Quantity>Voltage</Quantity>
<Value>0.000000</Value>
</DataRecord>
<DataRecord id="21">
<Function>Maximum value</Function>
<StorageNumber>0</StorageNumber>
<Unit>V</Unit>
<Quantity>Voltage</Quantity>
<Value>0.000000</Value>
</DataRecord>
<DataRecord id="22">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>A</Unit>
<Quantity>Current</Quantity>
<Value>-0.066000</Value>
</DataRecord>
<DataRecord id="23">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>A</Unit>
<Quantity>Current</Quantity>
<Value>0.000000</Value>
</DataRecord>
<DataRecord id="24">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>A</Unit>
<Quantity>Current</Quantity>
<Value>0.000000</Value>
</DataRecord>
<DataRecord id="25">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>A</Unit>
<Quantity>Current</Quantity>
<Value>-0.066000</Value>
</DataRecord>
<DataRecord id="26">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit></Unit>
<Quantity>Manufacturer specific</Quantity>
<Value>13.000000</Value>
</DataRecord>
<DataRecord id="27">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit></Unit>
<Quantity>Manufacturer specific</Quantity>
<Value>0.000000</Value>
</DataRecord>
<DataRecord id="28">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit></Unit>
<Quantity>Manufacturer specific</Quantity>
<Value>0.000000</Value>
</DataRecord>
<DataRecord id="29">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit></Unit>
<Quantity>Manufacturer specific</Quantity>
<Value>500.000000</Value>
</DataRecord>
<DataRecord id="30">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit></Unit>
<Quantity>Reset counter</Quantity>
<Value>56.000000</Value>
</DataRecord>
<DataRecord id="31">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit></Unit>
<Quantity>Error flags</Quantity>
<Value>0.000000</Value>
</DataRecord>
</MBusData>

View File

@ -1,255 +0,0 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<MBusData>
<SlaveInformation>
<Id>32629</Id>
<Manufacturer>EMU</Manufacturer>
<Version>16</Version>
<ProductName>EMU Professional 3/75 M-Bus</ProductName>
<Medium>Electricity</Medium>
<AccessNumber>2</AccessNumber>
<Status>00</Status>
<Signature>0000</Signature>
</SlaveInformation>
<DataRecord id="0">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>Fabrication number</Unit>
<Value>32629</Value>
</DataRecord>
<DataRecord id="1">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Tariff>1</Tariff>
<Device>0</Device>
<Unit>Energy (Wh)</Unit>
<Value>1364</Value>
</DataRecord>
<DataRecord id="2">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Tariff>2</Tariff>
<Device>0</Device>
<Unit>Energy (Wh)</Unit>
<Value>0</Value>
</DataRecord>
<DataRecord id="3">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Tariff>1</Tariff>
<Device>2</Device>
<Unit>Energy (Wh)</Unit>
<Value>7854</Value>
</DataRecord>
<DataRecord id="4">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Tariff>2</Tariff>
<Device>2</Device>
<Unit>Energy (Wh)</Unit>
<Value>0</Value>
</DataRecord>
<DataRecord id="5">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>Power (W)</Unit>
<Value>-2</Value>
</DataRecord>
<DataRecord id="6">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>Power (W)</Unit>
<Value>0</Value>
</DataRecord>
<DataRecord id="7">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>Power (W)</Unit>
<Value>0</Value>
</DataRecord>
<DataRecord id="8">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>Power (W)</Unit>
<Value>-2</Value>
</DataRecord>
<DataRecord id="9">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Tariff>0</Tariff>
<Device>2</Device>
<Unit>Power (W)</Unit>
<Value>14</Value>
</DataRecord>
<DataRecord id="10">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Tariff>0</Tariff>
<Device>2</Device>
<Unit>Power (W)</Unit>
<Value>0</Value>
</DataRecord>
<DataRecord id="11">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Tariff>0</Tariff>
<Device>2</Device>
<Unit>Power (W)</Unit>
<Value>0</Value>
</DataRecord>
<DataRecord id="12">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Tariff>0</Tariff>
<Device>2</Device>
<Unit>Power (W)</Unit>
<Value>14</Value>
</DataRecord>
<DataRecord id="13">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>1e-1 V</Unit>
<Value>2257</Value>
</DataRecord>
<DataRecord id="14">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>1e-1 V</Unit>
<Value>0</Value>
</DataRecord>
<DataRecord id="15">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>1e-1 V</Unit>
<Value>0</Value>
</DataRecord>
<DataRecord id="16">
<Function>Minimum value</Function>
<StorageNumber>0</StorageNumber>
<Unit>1e-1 V</Unit>
<Value>1874</Value>
</DataRecord>
<DataRecord id="17">
<Function>Minimum value</Function>
<StorageNumber>0</StorageNumber>
<Unit>1e-1 V</Unit>
<Value>0</Value>
</DataRecord>
<DataRecord id="18">
<Function>Minimum value</Function>
<StorageNumber>0</StorageNumber>
<Unit>1e-1 V</Unit>
<Value>0</Value>
</DataRecord>
<DataRecord id="19">
<Function>Maximum value</Function>
<StorageNumber>0</StorageNumber>
<Unit>1e-1 V</Unit>
<Value>2410</Value>
</DataRecord>
<DataRecord id="20">
<Function>Maximum value</Function>
<StorageNumber>0</StorageNumber>
<Unit>1e-1 V</Unit>
<Value>0</Value>
</DataRecord>
<DataRecord id="21">
<Function>Maximum value</Function>
<StorageNumber>0</StorageNumber>
<Unit>1e-1 V</Unit>
<Value>0</Value>
</DataRecord>
<DataRecord id="22">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>m A</Unit>
<Value>-66</Value>
</DataRecord>
<DataRecord id="23">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>m A</Unit>
<Value>0</Value>
</DataRecord>
<DataRecord id="24">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>m A</Unit>
<Value>0</Value>
</DataRecord>
<DataRecord id="25">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>m A</Unit>
<Value>-66</Value>
</DataRecord>
<DataRecord id="26">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>Manufacturer specific</Unit>
<Value>13</Value>
</DataRecord>
<DataRecord id="27">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>Manufacturer specific</Unit>
<Value>0</Value>
</DataRecord>
<DataRecord id="28">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>Manufacturer specific</Unit>
<Value>0</Value>
</DataRecord>
<DataRecord id="29">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>Manufacturer specific</Unit>
<Value>500</Value>
</DataRecord>
<DataRecord id="30">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>Reset counter</Unit>
<Value>56</Value>
</DataRecord>
<DataRecord id="31">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>Error flags</Unit>
<Value>0</Value>
</DataRecord>
</MBusData>

View File

@ -1,133 +0,0 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<MBusData>
<SlaveInformation>
<Id>802657</Id>
<Manufacturer>SVM</Manufacturer>
<Version>8</Version>
<ProductName>Elster F2 / Deltamess F2</ProductName>
<Medium>Heat: Outlet</Medium>
<AccessNumber>70</AccessNumber>
<Status>00</Status>
<Signature>0000</Signature>
</SlaveInformation>
<DataRecord id="0">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>Wh</Unit>
<Quantity>Energy</Quantity>
<Value>5272000.000000</Value>
</DataRecord>
<DataRecord id="1">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>m^3</Unit>
<Quantity>Volume</Quantity>
<Value>1204.270000</Value>
</DataRecord>
<DataRecord id="2">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Tariff>0</Tariff>
<Device>1</Device>
<Unit>m^3</Unit>
<Quantity>Volume</Quantity>
<Value>917.690000</Value>
</DataRecord>
<DataRecord id="3">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>°C</Unit>
<Quantity>Flow temperature</Quantity>
<Value>28.000000</Value>
</DataRecord>
<DataRecord id="4">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>°C</Unit>
<Quantity>Return temperature</Quantity>
<Value>34.000000</Value>
</DataRecord>
<DataRecord id="5">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>K</Unit>
<Quantity>Temperature difference</Quantity>
<Value>0.000000</Value>
</DataRecord>
<DataRecord id="6">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>s</Unit>
<Quantity>On time</Quantity>
<Value>149014800.000000</Value>
</DataRecord>
<DataRecord id="7">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>s</Unit>
<Quantity>Operating time</Quantity>
<Value>149014800.000000</Value>
</DataRecord>
<DataRecord id="8">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>m^3/h</Unit>
<Quantity>Volume flow</Quantity>
<Value>0.000000</Value>
</DataRecord>
<DataRecord id="9">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>W</Unit>
<Quantity>Power</Quantity>
<Value>0.000000</Value>
</DataRecord>
<DataRecord id="10">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>-</Unit>
<Quantity>Time point (date &amp; time)</Quantity>
<Value>2013-06-29T12:12:00Z</Value>
</DataRecord>
<DataRecord id="11">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Tariff>0</Tariff>
<Device>1</Device>
<Unit>Units for H.C.A.</Unit>
<Quantity>H.C.A.</Quantity>
<Value>0.000000</Value>
</DataRecord>
<DataRecord id="12">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Tariff>0</Tariff>
<Device>2</Device>
<Unit>Units for H.C.A.</Unit>
<Quantity>H.C.A.</Quantity>
<Value>0.000000</Value>
</DataRecord>
<DataRecord id="13">
<Function>More records follow</Function>
<StorageNumber>0</StorageNumber>
<Unit></Unit>
<Quantity></Quantity>
<Value>C4 09 01 01 12 00 01 01 01 07 57 26 80 00 CD 4E 08 04 07 A3 FF 03 57 26 80 00 04 04 0D 02 FF 0F 05 3C FF 62 E7 62 96 0A 89 0A 02 00 15 40 17 01 00 00 63 42</Value>
</DataRecord>
</MBusData>

View File

@ -1,11 +1,10 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<MBusData> <MBusData>
<SlaveInformation> <SlaveInformation>
<Id>802657</Id> <Id>802657</Id>
<Manufacturer>SVM</Manufacturer> <Manufacturer>SVM</Manufacturer>
<Version>8</Version> <Version>8</Version>
<ProductName>Elster F2 / Deltamess F2</ProductName> <ProductName>Elster F2</ProductName>
<Medium>Heat: Outlet</Medium> <Medium>Heat: Outlet</Medium>
<AccessNumber>70</AccessNumber> <AccessNumber>70</AccessNumber>
<Status>00</Status> <Status>00</Status>

View File

@ -1 +0,0 @@
68 38 38 68 08 19 72 07 62 00 23 2E 19 23 02 92 00 00 00 8C 10 04 68 28 17 00 8C 11 04 68 28 17 00 02 FD C9 FF 01 E6 00 02 FD DB FF 01 06 00 02 AC FF 01 09 00 82 40 AC FF 01 FD FF 5B 16

View File

@ -1,69 +0,0 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<MBusData>
<SlaveInformation>
<Id>23006207</Id>
<Manufacturer>FIN</Manufacturer>
<Version>35</Version>
<ProductName></ProductName>
<Medium>Electricity</Medium>
<AccessNumber>146</AccessNumber>
<Status>00</Status>
<Signature>0000</Signature>
</SlaveInformation>
<DataRecord id="0">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Tariff>1</Tariff>
<Device>0</Device>
<Unit>Wh</Unit>
<Quantity>Energy</Quantity>
<Value>1728680.000000</Value>
</DataRecord>
<DataRecord id="1">
<Function>Instantaneous value</Function>
<StorageNumber>2</StorageNumber>
<Tariff>1</Tariff>
<Device>0</Device>
<Unit>Wh</Unit>
<Quantity>Energy</Quantity>
<Value>1728680.000000</Value>
</DataRecord>
<DataRecord id="2">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>V</Unit>
<Quantity>Voltage</Quantity>
<Value>230.000000</Value>
</DataRecord>
<DataRecord id="3">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>A</Unit>
<Quantity>Current</Quantity>
<Value>0.600000</Value>
</DataRecord>
<DataRecord id="4">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>W</Unit>
<Quantity>Power</Quantity>
<Value>90.000000</Value>
</DataRecord>
<DataRecord id="5">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Tariff>0</Tariff>
<Device>1</Device>
<Unit>W</Unit>
<Quantity>Power</Quantity>
<Value>-30.000000</Value>
</DataRecord>
</MBusData>

View File

@ -1,63 +0,0 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<MBusData>
<SlaveInformation>
<Id>23006207</Id>
<Manufacturer>FIN</Manufacturer>
<Version>35</Version>
<ProductName></ProductName>
<Medium>Electricity</Medium>
<AccessNumber>146</AccessNumber>
<Status>00</Status>
<Signature>0000</Signature>
</SlaveInformation>
<DataRecord id="0">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Tariff>1</Tariff>
<Device>0</Device>
<Unit>Energy (10 Wh)</Unit>
<Value>172868</Value>
</DataRecord>
<DataRecord id="1">
<Function>Instantaneous value</Function>
<StorageNumber>2</StorageNumber>
<Tariff>1</Tariff>
<Device>0</Device>
<Unit>Energy (10 Wh)</Unit>
<Value>172868</Value>
</DataRecord>
<DataRecord id="2">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit> V</Unit>
<Value>230</Value>
</DataRecord>
<DataRecord id="3">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>1e-1 A</Unit>
<Value>6</Value>
</DataRecord>
<DataRecord id="4">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>Power (10 W)</Unit>
<Value>9</Value>
</DataRecord>
<DataRecord id="5">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Tariff>0</Tariff>
<Device>1</Device>
<Unit>Power (10 W)</Unit>
<Value>-3</Value>
</DataRecord>
</MBusData>

View File

@ -1 +0,0 @@
68 1B 1B 68 08 01 72 07 20 18 00 E6 1E 35 07 4C 00 00 00 0C 78 07 20 18 00 0C 16 69 02 00 00 96 16

View File

@ -1,31 +0,0 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<MBusData>
<SlaveInformation>
<Id>182007</Id>
<Manufacturer>GWF</Manufacturer>
<Version>53</Version>
<ProductName></ProductName>
<Medium>Water</Medium>
<AccessNumber>76</AccessNumber>
<Status>00</Status>
<Signature>0000</Signature>
</SlaveInformation>
<DataRecord id="0">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit></Unit>
<Quantity>Fabrication No</Quantity>
<Value>182007.000000</Value>
</DataRecord>
<DataRecord id="1">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>m^3</Unit>
<Quantity>Volume</Quantity>
<Value>269.000000</Value>
</DataRecord>
</MBusData>

View File

@ -1,29 +0,0 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<MBusData>
<SlaveInformation>
<Id>182007</Id>
<Manufacturer>GWF</Manufacturer>
<Version>53</Version>
<ProductName></ProductName>
<Medium>Water</Medium>
<AccessNumber>76</AccessNumber>
<Status>00</Status>
<Signature>0000</Signature>
</SlaveInformation>
<DataRecord id="0">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>Fabrication number</Unit>
<Value>182007</Value>
</DataRecord>
<DataRecord id="1">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>Volume ( m^3)</Unit>
<Value>269</Value>
</DataRecord>
</MBusData>

View File

@ -1 +0,0 @@
68 40 40 68 08 01 72 58 20 08 12 E2 30 40 03 40 00 00 00 2F 2F 4C 13 92 40 83 10 46 6D 00 00 08 16 27 00 0D 78 11 34 31 38 35 30 32 38 30 32 31 39 35 37 31 30 30 47 89 40 FD 1A 01 01 FD 17 00 01 FD 67 0F 38 16

View File

@ -1,65 +0,0 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<MBusData>
<SlaveInformation>
<Id>12082058</Id>
<Manufacturer>LGB</Manufacturer>
<Version>64</Version>
<ProductName></ProductName>
<Medium>Gas</Medium>
<AccessNumber>64</AccessNumber>
<Status>00</Status>
<Signature>0000</Signature>
</SlaveInformation>
<DataRecord id="0">
<Function>Instantaneous value</Function>
<StorageNumber>1</StorageNumber>
<Unit>m^3</Unit>
<Quantity>Volume</Quantity>
<Value>10834.092000</Value>
</DataRecord>
<DataRecord id="1">
<Function>Instantaneous value</Function>
<StorageNumber>1</StorageNumber>
<Unit>-</Unit>
<Quantity>Time point (date &amp; time)</Quantity>
<Value>2016-07-22T08:00:00Z</Value>
</DataRecord>
<DataRecord id="2">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit></Unit>
<Quantity>Fabrication No</Quantity>
<Value>G0017591208205814</Value>
</DataRecord>
<DataRecord id="3">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Tariff>0</Tariff>
<Device>1</Device>
<Unit></Unit>
<Quantity>Digital Output</Quantity>
<Value>1.000000</Value>
</DataRecord>
<DataRecord id="4">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit></Unit>
<Quantity>Error flags</Quantity>
<Value>0.000000</Value>
</DataRecord>
<DataRecord id="5">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit></Unit>
<Quantity>Special supplier information</Quantity>
<Value>15.000000</Value>
</DataRecord>
</MBusData>

View File

@ -1,59 +0,0 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<MBusData>
<SlaveInformation>
<Id>12082058</Id>
<Manufacturer>LGB</Manufacturer>
<Version>64</Version>
<ProductName></ProductName>
<Medium>Gas</Medium>
<AccessNumber>64</AccessNumber>
<Status>00</Status>
<Signature>0000</Signature>
</SlaveInformation>
<DataRecord id="0">
<Function>Instantaneous value</Function>
<StorageNumber>1</StorageNumber>
<Unit>Volume (m m^3)</Unit>
<Value>10834092</Value>
</DataRecord>
<DataRecord id="1">
<Function>Instantaneous value</Function>
<StorageNumber>1</StorageNumber>
<Unit>Time Point (time &amp; date)</Unit>
<Value>2016-07-22T08:00:00</Value>
</DataRecord>
<DataRecord id="2">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>Fabrication number</Unit>
<Value>G0017591208205814</Value>
</DataRecord>
<DataRecord id="3">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Tariff>0</Tariff>
<Device>1</Device>
<Unit>Digital output (binary)</Unit>
<Value>1</Value>
</DataRecord>
<DataRecord id="4">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>Error flags</Unit>
<Value>0</Value>
</DataRecord>
<DataRecord id="5">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>Special supplier information</Unit>
<Value>15</Value>
</DataRecord>
</MBusData>

View File

@ -1 +0,0 @@
68 2F 2F 68 08 16 72 01 63 21 11 AC 48 41 03 B1 00 00 00 0C 14 81 60 87 02 04 6D A1 15 E9 17 42 6C DF 1C 4C 14 82 73 59 02 42 EC 7E FF 1C 0F C0 01 01 0C BD 16

View File

@ -1,63 +0,0 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<MBusData>
<SlaveInformation>
<Id>11216301</Id>
<Manufacturer>REL</Manufacturer>
<Version>65</Version>
<ProductName></ProductName>
<Medium>Gas</Medium>
<AccessNumber>177</AccessNumber>
<Status>00</Status>
<Signature>0000</Signature>
</SlaveInformation>
<DataRecord id="0">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>m^3</Unit>
<Quantity>Volume</Quantity>
<Value>28760.810000</Value>
</DataRecord>
<DataRecord id="1">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>-</Unit>
<Quantity>Time point (date &amp; time)</Quantity>
<Value>1900-01-00T00:00:00Z</Value>
</DataRecord>
<DataRecord id="2">
<Function>Instantaneous value</Function>
<StorageNumber>1</StorageNumber>
<Unit>-</Unit>
<Quantity>Time point (date)</Quantity>
<Value>2014-12-31</Value>
</DataRecord>
<DataRecord id="3">
<Function>Instantaneous value</Function>
<StorageNumber>1</StorageNumber>
<Unit>m^3</Unit>
<Quantity>Volume</Quantity>
<Value>25973.820000</Value>
</DataRecord>
<DataRecord id="4">
<Function>Instantaneous value</Function>
<StorageNumber>1</StorageNumber>
<Unit>-</Unit>
<Quantity>Time point (date)</Quantity>
<Value>2015-12-31</Value>
</DataRecord>
<DataRecord id="5">
<Function>Manufacturer specific</Function>
<StorageNumber>0</StorageNumber>
<Unit></Unit>
<Quantity></Quantity>
<Value>C0 01 01 0C</Value>
</DataRecord>
</MBusData>

View File

@ -1,55 +0,0 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<MBusData>
<SlaveInformation>
<Id>11216301</Id>
<Manufacturer>REL</Manufacturer>
<Version>65</Version>
<ProductName></ProductName>
<Medium>Gas</Medium>
<AccessNumber>177</AccessNumber>
<Status>00</Status>
<Signature>0000</Signature>
</SlaveInformation>
<DataRecord id="0">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>Volume (1e-2 m^3)</Unit>
<Value>2876081</Value>
</DataRecord>
<DataRecord id="1">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>Time Point (time &amp; date)</Unit>
<Value>1900-01-00T00:00:00</Value>
</DataRecord>
<DataRecord id="2">
<Function>Instantaneous value</Function>
<StorageNumber>1</StorageNumber>
<Unit>Time Point (date)</Unit>
<Value>2014-12-31</Value>
</DataRecord>
<DataRecord id="3">
<Function>Instantaneous value</Function>
<StorageNumber>1</StorageNumber>
<Unit>Volume (1e-2 m^3)</Unit>
<Value>2597382</Value>
</DataRecord>
<DataRecord id="4">
<Function>Instantaneous value</Function>
<StorageNumber>1</StorageNumber>
<Unit>Time Point (date)</Unit>
<Value>2015-12-31</Value>
</DataRecord>
<DataRecord id="5">
<Function>Manufacturer specific</Function>
<Value>C0 01 01 0C</Value>
</DataRecord>
</MBusData>

0
test/test-frames/SBC_Saia-Burgess-ALE3.hex Normal file → Executable file
View File

View File

@ -1,191 +0,0 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<MBusData>
<SlaveInformation>
<Id>19000055</Id>
<Manufacturer>SBC</Manufacturer>
<Version>22</Version>
<ProductName>Saia-Burgess ALE3</ProductName>
<Medium>Electricity</Medium>
<AccessNumber>191</AccessNumber>
<Status>00</Status>
<Signature>0000</Signature>
</SlaveInformation>
<DataRecord id="0">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Tariff>1</Tariff>
<Device>0</Device>
<Unit>Wh</Unit>
<Quantity>Energy</Quantity>
<Value>2930.000000</Value>
</DataRecord>
<DataRecord id="1">
<Function>Instantaneous value</Function>
<StorageNumber>2</StorageNumber>
<Tariff>1</Tariff>
<Device>0</Device>
<Unit>Wh</Unit>
<Quantity>Energy</Quantity>
<Value>2930.000000</Value>
</DataRecord>
<DataRecord id="2">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Tariff>2</Tariff>
<Device>0</Device>
<Unit>Wh</Unit>
<Quantity>Energy</Quantity>
<Value>60.000000</Value>
</DataRecord>
<DataRecord id="3">
<Function>Instantaneous value</Function>
<StorageNumber>2</StorageNumber>
<Tariff>2</Tariff>
<Device>0</Device>
<Unit>Wh</Unit>
<Quantity>Energy</Quantity>
<Value>60.000000</Value>
</DataRecord>
<DataRecord id="4">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>V</Unit>
<Quantity>Voltage</Quantity>
<Value>223.000000</Value>
</DataRecord>
<DataRecord id="5">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>A</Unit>
<Quantity>Current</Quantity>
<Value>0.000000</Value>
</DataRecord>
<DataRecord id="6">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>W</Unit>
<Quantity>Power</Quantity>
<Value>0.000000</Value>
</DataRecord>
<DataRecord id="7">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Tariff>0</Tariff>
<Device>1</Device>
<Unit>W</Unit>
<Quantity>Power</Quantity>
<Value>0.000000</Value>
</DataRecord>
<DataRecord id="8">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>V</Unit>
<Quantity>Voltage</Quantity>
<Value>0.000000</Value>
</DataRecord>
<DataRecord id="9">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>A</Unit>
<Quantity>Current</Quantity>
<Value>0.000000</Value>
</DataRecord>
<DataRecord id="10">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>W</Unit>
<Quantity>Power</Quantity>
<Value>0.000000</Value>
</DataRecord>
<DataRecord id="11">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Tariff>0</Tariff>
<Device>1</Device>
<Unit>W</Unit>
<Quantity>Power</Quantity>
<Value>0.000000</Value>
</DataRecord>
<DataRecord id="12">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>V</Unit>
<Quantity>Voltage</Quantity>
<Value>0.000000</Value>
</DataRecord>
<DataRecord id="13">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>A</Unit>
<Quantity>Current</Quantity>
<Value>0.000000</Value>
</DataRecord>
<DataRecord id="14">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>W</Unit>
<Quantity>Power</Quantity>
<Value>0.000000</Value>
</DataRecord>
<DataRecord id="15">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Tariff>0</Tariff>
<Device>1</Device>
<Unit>W</Unit>
<Quantity>Power</Quantity>
<Value>0.000000</Value>
</DataRecord>
<DataRecord id="16">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit></Unit>
<Quantity>Manufacturer specific</Quantity>
<Value>0.000000</Value>
</DataRecord>
<DataRecord id="17">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>W</Unit>
<Quantity>Power</Quantity>
<Value>0.000000</Value>
</DataRecord>
<DataRecord id="18">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Tariff>0</Tariff>
<Device>1</Device>
<Unit>W</Unit>
<Quantity>Power</Quantity>
<Value>0.000000</Value>
</DataRecord>
<DataRecord id="19">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit></Unit>
<Quantity>Manufacturer specific</Quantity>
<Value>0.000000</Value>
</DataRecord>
</MBusData>

View File

@ -1,171 +0,0 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<MBusData>
<SlaveInformation>
<Id>19000055</Id>
<Manufacturer>SBC</Manufacturer>
<Version>22</Version>
<ProductName>Saia-Burgess ALE3</ProductName>
<Medium>Electricity</Medium>
<AccessNumber>191</AccessNumber>
<Status>00</Status>
<Signature>0000</Signature>
</SlaveInformation>
<DataRecord id="0">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Tariff>1</Tariff>
<Device>0</Device>
<Unit>Energy (10 Wh)</Unit>
<Value>293</Value>
</DataRecord>
<DataRecord id="1">
<Function>Instantaneous value</Function>
<StorageNumber>2</StorageNumber>
<Tariff>1</Tariff>
<Device>0</Device>
<Unit>Energy (10 Wh)</Unit>
<Value>293</Value>
</DataRecord>
<DataRecord id="2">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Tariff>2</Tariff>
<Device>0</Device>
<Unit>Energy (10 Wh)</Unit>
<Value>6</Value>
</DataRecord>
<DataRecord id="3">
<Function>Instantaneous value</Function>
<StorageNumber>2</StorageNumber>
<Tariff>2</Tariff>
<Device>0</Device>
<Unit>Energy (10 Wh)</Unit>
<Value>6</Value>
</DataRecord>
<DataRecord id="4">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit> V</Unit>
<Value>223</Value>
</DataRecord>
<DataRecord id="5">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>1e-1 A</Unit>
<Value>0</Value>
</DataRecord>
<DataRecord id="6">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>Power (10 W)</Unit>
<Value>0</Value>
</DataRecord>
<DataRecord id="7">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Tariff>0</Tariff>
<Device>1</Device>
<Unit>Power (10 W)</Unit>
<Value>0</Value>
</DataRecord>
<DataRecord id="8">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit> V</Unit>
<Value>0</Value>
</DataRecord>
<DataRecord id="9">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>1e-1 A</Unit>
<Value>0</Value>
</DataRecord>
<DataRecord id="10">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>Power (10 W)</Unit>
<Value>0</Value>
</DataRecord>
<DataRecord id="11">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Tariff>0</Tariff>
<Device>1</Device>
<Unit>Power (10 W)</Unit>
<Value>0</Value>
</DataRecord>
<DataRecord id="12">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit> V</Unit>
<Value>0</Value>
</DataRecord>
<DataRecord id="13">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>1e-1 A</Unit>
<Value>0</Value>
</DataRecord>
<DataRecord id="14">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>Power (10 W)</Unit>
<Value>0</Value>
</DataRecord>
<DataRecord id="15">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Tariff>0</Tariff>
<Device>1</Device>
<Unit>Power (10 W)</Unit>
<Value>0</Value>
</DataRecord>
<DataRecord id="16">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>Manufacturer specific</Unit>
<Value>0</Value>
</DataRecord>
<DataRecord id="17">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>Power (10 W)</Unit>
<Value>0</Value>
</DataRecord>
<DataRecord id="18">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Tariff>0</Tariff>
<Device>1</Device>
<Unit>Power (10 W)</Unit>
<Value>0</Value>
</DataRecord>
<DataRecord id="19">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>Manufacturer specific</Unit>
<Value>0</Value>
</DataRecord>
</MBusData>

Some files were not shown because too many files have changed in this diff Show More