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 |
|
|---|---|
Wrapper library |
USAGE: pub-sdbus <0|1> <string>
What it does
-
Installs a handler for ^C.
-
Subscribes to the ME.
-
Publishes
<string>as a D-Bus signal carrying a single string argument. -
Loops, processing requests every 500 ms. With
1it loops until ^C; a second ^C exits at once. With0it 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 |
|
Interface |
|
Signal |
|
Body |
one string, signature |
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.