Utility framework in C++ for creating single threaded mainloop event based applications (such as vdcd, of which p44utils were always a part of), abstractions for gpio, spi, i2c, pwm
Switch branches/tags
Nothing to show
Clone or download
plan44 SPI: WIP: testing MC3002 on Omega2/MT7688, figuring out if it can be …
…made work with real HW SPI or needs kmod-spi-gpio-custom
Latest commit f79a1d5 Jul 12, 2018
Permalink
Failed to load latest commit information.
tests httpcomm/civetweb: bugfix, setServerCertVfy() was not working at all.… May 29, 2018
thirdparty httpcomm/civetweb: bugfix, setServerCertVfy() was not working at all.… May 29, 2018
.gitignore Added .gitignore for autotools in-tree builds Jun 30, 2016
README.md Updated README.md Jan 14, 2017
analogio.cpp SPI: added support for MCP3008 10bit A/D converter Feb 20, 2018
analogio.hpp AnalogIo/DigitalIo: better comments documenting "pinspec" Jul 11, 2018
application.cpp MainLoop: MLTicket is now an object, which can be used almost the sam… May 2, 2018
application.hpp Application: initialize datapath to /tmp Mar 24, 2018
colorutils.cpp global copyright notice update for 2017 Feb 7, 2017
colorutils.hpp global copyright notice update for 2017 Feb 7, 2017
consolekey.cpp MainLoop: MLTicket is now an object, which can be used almost the sam… May 2, 2018
consolekey.hpp New MainLoop implementation and API Aug 18, 2017
crc32.cpp Added Crc32 (same algorithm as BSD/OSX cksum -o3) May 6, 2014
crc32.hpp crc32: still referenced old p44_common.hpp instead of p44utils_common… Jun 30, 2016
digitalio.cpp MainLoop: MLTicket is now an object, which can be used almost the sam… May 2, 2018
digitalio.hpp AnalogIo/DigitalIo: better comments documenting "pinspec" Jul 11, 2018
error.cpp Expressions: add error reporting and aNullText to substituteExpressio… Jun 12, 2018
error.hpp Expressions: add error reporting and aNullText to substituteExpressio… Jun 12, 2018
expressions.cpp Expressions: add error reporting and aNullText to substituteExpressio… Jun 12, 2018
expressions.hpp Expressions: add error reporting and aNullText to substituteExpressio… Jun 12, 2018
fdcomm.cpp MainLoop: MLTicket is now an object, which can be used almost the sam… May 2, 2018
fdcomm.hpp New MainLoop implementation and API Aug 18, 2017
fnv.cpp Fnv: add addString() method Apr 19, 2018
fnv.hpp Fnv: add addString() method Apr 19, 2018
gpio.cpp New MainLoop implementation and API Aug 18, 2017
gpio.h Separated generic p44 utility sources into p44utils subfolder (will b… Jul 10, 2013
gpio.hpp New MainLoop implementation and API Aug 18, 2017
httpcomm.cpp 23865 double free on mgConn Jul 11, 2018
httpcomm.hpp httpcomm/civetweb: bugfix, setServerCertVfy() was not working at all.… May 29, 2018
i2c.cpp i2c+spi: improved auto-disable #ifdefs Mar 1, 2018
i2c.hpp Added support for LM75 i2c temperature sensor, and in general better … Sep 29, 2017
igmp.cpp global copyright notice update for 2017 Feb 7, 2017
igmp.hpp global copyright notice update for 2017 Feb 7, 2017
iopin.cpp MainLoop: MLTicket is now an object, which can be used almost the sam… May 2, 2018
iopin.hpp Added support for LM75 i2c temperature sensor, and in general better … Sep 29, 2017
jsoncomm.cpp global copyright notice update for 2017 Feb 7, 2017
jsoncomm.hpp global copyright notice update for 2017 Feb 7, 2017
jsonobject.cpp JsonObject - add const qualifier to getter methods Apr 16, 2018
jsonobject.hpp JsonObject - add const qualifier to getter methods Apr 16, 2018
jsonrpccomm.cpp global copyright notice update for 2017 Feb 7, 2017
jsonrpccomm.hpp global copyright notice update for 2017 Feb 7, 2017
jsonwebclient.cpp JsonWebClient: In LOG_DEBUG, not only show JSON response, but also er… May 8, 2017
jsonwebclient.hpp httpcomm, jsonwebclient: more options for returning errors and respon… Mar 24, 2017
ledchaincomm.cpp ledchaincomm: fixed WS2812 color order (GBR instead of GRB), added ne… Mar 7, 2018
ledchaincomm.hpp ledchaincomm: fixed WS2812 color order (GBR instead of GRB), added ne… Mar 7, 2018
logger.cpp Logger - fix locking issue reported by coverity Apr 10, 2018
logger.hpp Logger: now can show time in mS spent between log lines Aug 18, 2017
macaddress.cpp macaddress: now should work for network interface configurations with… Jun 21, 2017
macaddress.hpp macaddress: added aIfName parameter to specify network interface for … Mar 2, 2017
mainloop.cpp MainLoop: MLTicket::cancel() and MainLoop::cancelExecutionTicket() mu… May 6, 2018
mainloop.hpp Mainloop: docs comment fix: executeOnce does not have a return value May 8, 2018
operationqueue.cpp MainLoop: MLTicket is now an object, which can be used almost the sam… May 2, 2018
operationqueue.hpp New MainLoop implementation and API Aug 18, 2017
p44obj.cpp P44Obj: added isMemberVariable(). This can be called to make sure ref… Apr 25, 2017
p44obj.hpp P44Obj: added isMemberVariable(). This can be called to make sure ref… Apr 25, 2017
p44utils_common.hpp global copyright notice update for 2017 Feb 7, 2017
persistentparams.cpp PersistentParams: comment cosmetics Apr 23, 2018
persistentparams.hpp PersistentParams: enhanced for working with tables that contain objec… Oct 12, 2017
pwm.cpp Added support for LM75 i2c temperature sensor, and in general better … Sep 29, 2017
pwm.hpp Added support for LM75 i2c temperature sensor, and in general better … Sep 29, 2017
regexp.cpp regexp/slre: added older free version of SLRE regex and simple wrappe… Mar 14, 2017
regexp.hpp regexp: include slre header with path, to avoid extra include path Mar 21, 2017
serialcomm.cpp MainLoop: MLTicket is now an object, which can be used almost the sam… May 2, 2018
serialcomm.hpp MainLoop: MLTicket is now an object, which can be used almost the sam… May 2, 2018
serialqueue.cpp global copyright notice update for 2017 Feb 7, 2017
serialqueue.hpp global copyright notice update for 2017 Feb 7, 2017
socketcomm.cpp SocketComm: macOS does not support SO_BINDTODEVICE. As macOS is not a… May 29, 2018
socketcomm.hpp SocketComm - add parameter to setConnectionParams to be able to speci… May 22, 2018
spi.cpp SPI: WIP: testing MC3002 on Omega2/MT7688, figuring out if it can be … Jul 13, 2018
spi.hpp SPI: added support for MCP3002 A/D converter Jul 12, 2018
sqlite3persistence.cpp global copyright notice update for 2017 Feb 7, 2017
sqlite3persistence.hpp global copyright notice update for 2017 Feb 7, 2017
ssdpsearch.cpp MainLoop: MLTicket is now an object, which can be used almost the sam… May 2, 2018
ssdpsearch.hpp New MainLoop implementation and API Aug 18, 2017
utils.cpp utils: added pathstring_format_append() to add path elements to a string Jul 20, 2017
utils.hpp utils: added pathstring_format_append() to add path elements to a string Jul 20, 2017
valueunits.cpp Fix unit string mapping for mperm2 and literpersecond Apr 23, 2018
valueunits.hpp valueutils: duration formatting routine added Feb 22, 2018

README.md

p44utils

Flattr this git repo

"p44utils" is a set of free (opensource, GPLv3) C++ utility classes and functions for creating single-threaded, mainloop event based applications, mainly targeted at linux deamons for automation.

"p44utils" have been developed as part of the vdcd project (a digitalSTROM virtual device container daemon), but are of more generic use, and thus have been separated from the vdcd repository (and made vdcd and other tools use p44utils as a submodule)

"p44utils" makes very light use of boost (intrusive_ptr, bind), and has some classes that use mongoose, sqlitepp, rpi_ws281x, json-c.

Usage

p44utils are meant to be included as .cpp and .hpp files into a project and compiled together with the project's other sources.

License

p44utils are licensed under the GPLv3 License (see COPYING).

If that's a problem for your particular application, I am open to provide a commercial license, please contact me at luz@plan44.ch.

Some of the p44utils make use of third party project's code (mongoose, sqlitepp, rpi_ws281x), which is under less strict licenses such as MIT or BSD. This code is included in the "thirdparty" subfolder. Please see the LICENSE files or license header comments in the individual projects included in that folder.

Features

  • common base class implementing a reference counted memory management model via boost intrusive_ptr (more efficient and easier to use than shared_ptr)
  • Mainloop as central event dispatcher, supports timers, I/O based events and idle handlers.
  • Application base class implementing command line parsing, option handling and usage message formatting
  • logging with loglevels, efficiently avoiding disabled log levels to waste CPU time
  • support for using unix file descriptors with the I/O based mainloop events
  • helper classes for serial line communication
  • helper class for socket communication
  • helper class for socket based generic JSON and JSON RPC 2 protocols
  • wrapper class for json-c JSON objects
  • helper class for implementing persistent storage of parameters for object trees with automatic schema updating
  • support for a simple http client (mainly targeted at automation APIs)
  • support for JSON based http APIs
  • wrappers to abstract various sources of digital and analog inputs (such as GPIO, I2C and SPI peripherals) into easy to use input or output objects, including debouncing for inputs and blinking sequences for indicator outputs.
  • helper class for serial data controlled RGB and RGBW LED chains (WS281x, SK6812; APA102 planned)
  • other stuff :-)

(c) 2013-2017 by Lukas Zeller / plan44.ch