This is an implementation of the DLMS/Cosem protocol in the MIT Open Source and permissive license. This protocol is mainly used in gas/water/electricity meters but is enough generic to target any IoT device.
See the official organization group to learn more: http://www.dlms.com.
This repository provides C code, mainly framing encoding/decoding functions. There is no any integration in a complete stand-alone examples. See other repositories for that purpose.
This Cosem stack has the following goals :
- Pure portable and stand-alone ANSI C99 code
- Fully unit tested with pre-defined vectors
- Client/server implementation, LogicalName referencing, LLS, HLS3, 4 and 5, security policy 1
- Examples using Cosem over TCP/IP
- Memory efficient / no dynamic allocation (static, configurable at build-time)
- Full traces
- Memory protected against buffer overflow using Array utility
- Utilities (buffer utilities)
- BER coder/decoder
- Association coders and decoders AARQ/AARE/RLRQ/RLRE (LLS)
- Secure HLS5 GMAC Authentication
- Get Request normal/by block
- Set request normal
- Action service
- Exception response in case of problem
- HDLC framing utility
- Serial port HAL (Win32/Linux)
cosemlib
: kernel files of the DLMS/Cosem protocolclient
: specific utilities to write a DLMS/Cosem clientserver
: specific utilities to write a DLMS/Cosem serverexamples
: Client/server examplestests
: Unit tests for the protocol with raw frames and application objects
You must have CMake and a C/C++ compiler. Examples generate stand alone executables, other repositories generate static libraries.
The rop level cmake file will build everything.
mkdir build
cd build
cmake ..
make
FIXME: before writing this section, wait for stabilization of the HAL/Cosem API and utilities
- LN with ciphering Security Policy 0 (Authenticated & encrypted)
- HLS 3, 4, 5, 6
- Multiple logical devices support
- ACCESS service
- GBT service
- ECDSA
- ECDSA data transport cyphering