Skip to content

This application was designed to support the role of a virtual end node (VEN) as defined in the OpenADR Alliance’s OpenADR 2.0 Profile B Specification, updated July 1, 2013. OpenADR is a machine-to-machine interface that defines the information model, transport and security mechanisms, and the manner in which data is exchanged between two end po…

License

Notifications You must be signed in to change notification settings

AnalyticsFire/OpenADR-VEN-Library

 
 

Repository files navigation

Intro

Copyright (c) 2016, Electric Power Research Institute (EPRI)

This project (OADRLIB) provides a basis for implementing an OpenADR2.0b VEN. Http pull is the only supported transport.

Dependencies

The library is built and tested on Ubuntu Linux 20.04.

apt-get update
apt-get install --yes   \
   libcurl4-gnutls-dev  \
   libxerces-c-dev

Compiler Cache

The project can use ccache in order to improve (re)compilation time. The ccache package is provided by Ubuntu Linux distribution:

apt-get install --yes ccache

After the first compilation (see the next paragraph), the compiler cache is saved to ~/.ccache directory.

Build Instructions

OADRLIB uses cmake. Here are general instructions for starting the build:

mkdir -p build/debug
cmake ../../
make

By default, these build steps will build the oadr and oadrsd libraries, and the samplevenmanager executable. Before build the unit test program testoadr, I recommend to install the follow libraries:

apt-get install --yes lcov
pip3 install fastcov==1.10

Then to build unit test, change the cmake command to the following:

cmake -DTEST=1 -DCOVERAGE=1 ../../

If you want to print code coverage report:

fastcov \
		--compiler-directory build \
		--exclude /usr/include xsd-4.0.0 oadrsd googletest-release \
		--jobs $(nproc) \
		--lcov \
		--output build/coverage.info

genhtml \
		--demangle-cpp \
		--legend \
		--output-directory build/coverage \
		--prefix /openadr-ven-library \
		--show-details \
		build/coverage.info

Running testoadr will execute the unit tests.

Sample VEN Manager

The samplevenmanager directory demonstrates how to use the library. The basic steps are:

  1. Create a class which implements the folloiwng interfaces: IEventService, IReportService, IOadrMessage, and IOADRExceptionService. In the sample, the class VENImpl implements these interfaces. The OpenADR library will call these functions at the appropriate time.

  2. Create a VENManagerConfig object and populate the interfaces pointers and timeouts. The interface pointers should point to your object (or objects) created in the previous step.

  3. Create a VENManager object by calling VENManager::init(), passing in the VENManagerConfig object created in the previous step.

  4. Call the run() function on the object created in the previous step to start the VEN. This function call will block. Start the VEN manager in its own thread if you don't want to block on the run function.

Build and Test with Docker

make -e COVERAGE=1
make test
make coverage

The code coverage report HTML will be saved into build/coverage directory.

About

This application was designed to support the role of a virtual end node (VEN) as defined in the OpenADR Alliance’s OpenADR 2.0 Profile B Specification, updated July 1, 2013. OpenADR is a machine-to-machine interface that defines the information model, transport and security mechanisms, and the manner in which data is exchanged between two end po…

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C++ 100.0%
  • CMake 0.0%
  • Shell 0.0%
  • Makefile 0.0%
  • Dockerfile 0.0%
  • C 0.0%