pub-sdbus

The pub-<MsgEnv> for Linux. The ME is D-Bus, used through systemd’s sd-bus library; the tool talks on the system bus.

Repository

https://gitlab.com/industry-of-integrations/pub-sdbus

Wrapper library

https://github.com/IPSME/cpp-msgenv-sdbus

USAGE: pub-sdbus <0|1> <string>

What it does

  1. Installs a handler for ^C.

  2. Subscribes to the ME.

  3. Publishes <string> as a D-Bus signal carrying a single string argument.

  4. Loops, processing requests every 500 ms. With 1 it loops until ^C; a second ^C exits at once. With 0 it makes one pass and exits.

Every signal heard whose first argument is a string is printed to stdout as handler_str_: […​]. A signal with any other first argument is reported as handler_: DROP!, which is the IPSME rule of dropping what is not understood. The tool’s own signal comes back and is printed like any other.

On the wire

Bus

system

Object path

/dev/IPSME

Interface

dev.IPSME

Signal

IPSME

Body

one string, signature s

Source and build

The repository holds main.cpp and a Makefile. The wrapper library cpp-msgenv-sdbus comes in as a git submodule and provides IPSME_MsgEnv (subscribe(), publish(), process_requests()).

make         # g++ -std=c++17, links libsystemd through pkg-config
./pub-sdbus 1 "hello"

The only build dependency is the libsystemd development package.