Added a new `docs/dbus.md` file with an overview of standardized D-Bus data types and their signatures. Updated `README.md` with a reference to the documentation. Signed-off-by: Sven Sager <s.sager@kunbus.com>
52 lines
2.0 KiB
Markdown
52 lines
2.0 KiB
Markdown
<!--
|
||
SPDX-FileCopyrightText: 2026 KUNBUS GmbH <support@kunbus.com>
|
||
|
||
SPDX-License-Identifier: GPL-2.0-or-later
|
||
-->
|
||
|
||
# D-Bus
|
||
|
||
## Datentypen
|
||
|
||
Hier ist eine **Liste der standardisierten D‑Bus-Datentypen** (Signaturen), wie
|
||
sie u. a. in Introspection/XML (`type="..."`) verwendet werden.
|
||
|
||
## Basis-Typen (Basic Types)
|
||
|
||
| Signatur | Bedeutung |
|
||
|----------|-------------------------------------|
|
||
| `y` | Byte (unsigned 8-bit) |
|
||
| `b` | Boolean |
|
||
| `n` | Int16 (signed) |
|
||
| `q` | UInt16 (unsigned) |
|
||
| `i` | Int32 (signed) |
|
||
| `u` | UInt32 (unsigned) |
|
||
| `x` | Int64 (signed) |
|
||
| `t` | UInt64 (unsigned) |
|
||
| `d` | Double (IEEE 754) |
|
||
| `s` | String (UTF‑8) |
|
||
| `o` | Object Path |
|
||
| `g` | Signature (Typ-Signatur als String) |
|
||
|
||
## Container-Typen (Compound/Container)
|
||
|
||
| Form | Bedeutung | Beispiel |
|
||
|------------|-------------------------------------------------|---------------------------------|
|
||
| `aX` | Array von `X` | `as` = Array von Strings |
|
||
| `(XYZ...)` | Struct/Tupel | `(is)` = (Int32, String) |
|
||
| `{KV}` | Dict-Entry (nur innerhalb eines Arrays erlaubt) | `a{sv}` = Dict String → Variant |
|
||
|
||
## Spezial-Typ
|
||
|
||
| Signatur | Bedeutung |
|
||
|----------|---------------------------------------------------|
|
||
| `v` | Variant (beliebiger Typ, zur Laufzeit festgelegt) |
|
||
|
||
## Häufig genutzte Kombis (Praxis)
|
||
|
||
- `as` → Liste von Strings
|
||
- `ao` → Liste von Object Paths
|
||
- `a{sv}` → „Properties“-Map (String → Variant), sehr verbreitet bei
|
||
`org.freedesktop.DBus.Properties`
|
||
- `a{ss}` → String → String Map
|