How kunlinyu/dbus2http works
dbus2http is a D-Bus-to-HTTP/JSON bridge. HTTP clients discover services and invoke methods; the bridge uses introspection metadata to shape calls and replies. WebSocket clients can subscribe to matching D-Bus signals. The graph preserves the documented discovery and signal branches, plus the optional example service. Some implementation wiring is unsampled, so uncertain relationships are omitted or marked dashed.
Main entry points: DbusCaller.h Method caller · SignalSocket.cpp Signal WebSocket · InterfaceContext.h Interface context · main.cpp Server entry point
Components 17
Runtime
- Server entry point
src/main.cpp - Bridge lifecycle
src/Dbus2Http.cpp - Example service
include/dbus2http/ExampleService.h - Echo service
include/dbus2http/EchoService.h
D-Bus Discovery
- Service enumeration
src/DbusEnumerator.cpp - Introspection parser
include/dbus2http/entity/DbusSerialization.h
HTTP Invocation
- HTTP API
src/WebService.cpp - Method caller
include/dbus2http/DbusCaller.h - JSON request mapping
src/Json2Message.cpp - Reply mapping
src/Message2Json.cpp - Sample request generator
src/Rand2Json.cpp
Signal Streaming
- Signal WebSocket
src/SignalSocket.cpp
Metadata
- Interface context
include/dbus2http/entity/InterfaceContext.h - D-Bus metadata
include/dbus2http/entity/interface.h
Other components
- HTTP clients
- WebSocket clients
- D-Bus services
Connections 23
- HTTP clients → HTTP API: send requests
- HTTP API → Method caller: dispatches calls
- Method caller → JSON request mapping: fills messages
include/dbus2http/DbusCaller.h - Method caller → Reply mapping: extracts replies
include/dbus2http/DbusCaller.h - Method caller → D-Bus services: calls methods
include/dbus2http/DbusCaller.h - HTTP API → Interface context: serves discovery
- Service enumeration → D-Bus services: introspects services
- Service enumeration → Interface context: populates metadata
- Introspection parser → Interface context: parses introspection
include/dbus2http/entity/DbusSerialization.h - Introspection parser → D-Bus metadata: builds records
include/dbus2http/entity/DbusSerialization.h - Method caller → Interface context: reads signatures
include/dbus2http/DbusCaller.h - WebSocket clients → Signal WebSocket: subscribe to signals
- Signal WebSocket → D-Bus services: monitors signals
- Signal WebSocket → Reply mapping: converts signals
- Signal WebSocket → Interface context: uses metadata
- Server entry point → Bridge lifecycle: starts bridge
src/main.cpp - Server entry point → Signal WebSocket: starts socket
src/main.cpp - Server entry point → Example service: optionally starts
src/main.cpp - Server entry point → Echo service: constructs service
src/main.cpp - Bridge lifecycle → HTTP API: hosts API
- Example service → D-Bus services: exports example API
- Echo service → D-Bus services: exports echo API
- Method caller → Sample request generator: generates requests
include/dbus2http/DbusCaller.h