ANSI C12.18 component for Espressif ESP32 ESP-IDF framework
ANSI C12.18 is a communication protocol for two-way communication with a metereing device through an ANSI Type 2 Optical port. This component implements ANSI C12.18 funcitonalities over UART port, which can be attached to a optical-serial adapter to interface with the metering device.
- Identification Service;
- Read (Total Read) Service;
- Write Service (Total Write);
- Security Service;
- Partial Read (offset/octet-count method);
- Partial Write (offset/octet-count method);
Clone this repository somewhere, e.g.:
cd ~/myprojects/esp
git clone https://github.com/tmedicci/esp-idf-ansic1218.git ansic1218
Add path to components in your CMakeLists.txt:
cmake_minimum_required(VERSION 3.5)
set(EXTRA_COMPONENT_DIRS /home/user/myprojects/esp)
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
project(my-esp-project)
esp-idf-ansic1218
uses esp-idf-libutils
as an external component in order to handle with commonly used functionalities.
In the same folder level of the esp-idf-ansic1218
, clone it:
cd ~/myprojects/esp
git clone https://github.com/tmedicci/esp-idf-libutils.git libutils
Examples directory provides the following usage examples:
To build examples, clone this repository somewhere, navigate to the example directory and build it with 'idf.py' e.g.:
cd ~/myprojects/esp
git clone https://github.com/tmedicci/esp-idf-ansic1218.git
cd examples/meter_identification
idf.py build