Home2L - C/C++ API  v1.2-2-ga4fe (2023-04-15)
Smart Tools for a Private Home
Home2L - C/C++ API Documentation

This is the documentation of the C/C++ API of the Home2L suite. It is meant as a reference for developers of

  • resource drivers,
  • new WallClock applets and
  • new software tools using the Home2L Resources library.

The main documentation of the Home2L project can be found in the Home2L Book. Automation rules are best written using the Python API.

To get started, navigate to the Modules page.

Notes

Coding Conventions

Obviously, the source files are no pure C, but have a C++ suffix, are compiled with a C++ compiler, and contain classes. However, for portability, efficiency and readability reasons, C++ language features are used only in a limited way. The reason for using C++ at all instead of pure C are the base classes and the UI modules, where operand overloading (base classes) and inheritance with virtual mathods (UI classes) are very helpful to improve the readability of code.

For these reasons, the following conventions apply:

  1. All C code is C99-compliant and C++-compliant. All C++ code complies to C++98 (the GCC default in GCC 6.1).
  2. No classes or templates from standard C++ libraries are used (STL/libstdc++).
  3. From C++, only the following syntax constructs are generally used:
    • classes with constructors, destructors, methods, either virtual or not
    • operators 'new' and 'delete'
    • no reference arguments to methods (unless for copy constructors)
  4. Only in modules Strings and Containers, the following additional constructs may occur:
    • overloaded operator []
    • templates (to be used very carefully)