Skip to content

Latest commit

 

History

History
57 lines (41 loc) · 1.82 KB

README.md

File metadata and controls

57 lines (41 loc) · 1.82 KB

ESP-IDF ANSI C12.18 Component

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.

Implemented Services

  • Identification Service;
  • Read (Total Read) Service;
  • Write Service (Total Write);
  • Security Service;
  • Partial Read (offset/octet-count method);
  • Partial Write (offset/octet-count method);

How to use

ANSI C12.18 Component

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)

External Components

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

ANSI C12.18 Examples

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