# weareaudiofile/bluez-dbus-cpp architecture

> Architecture diagram of the GitHub repository weareaudiofile/bluez-dbus-cpp, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-04). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/weareaudiofile/bluez-dbus-cpp
- Repository: https://github.com/weareaudiofile/bluez-dbus-cpp

## Overview

bluez-dbus-cpp is a C++ sdbus-c++ wrapper for BlueZ, focused on LE advertising and GATT. The principal server workflow is to create a GATT application and services/characteristics, expose them over D-Bus, then register the application with BlueZ; advertising has a parallel advertisement-registration API. The graph also preserves client proxies and socket support. Source excerpts show the service/application relationship and manager calls; other links are dashed where implementation details were not shown.

Main entry points: [`include/bluez-dbus-cpp/GattApplication1.h`](https://github.com/weareaudiofile/bluez-dbus-cpp/blob/master/include/bluez-dbus-cpp/GattApplication1.h) (GATT application), [`src/GattCharacteristic1.cpp`](https://github.com/weareaudiofile/bluez-dbus-cpp/blob/master/src/GattCharacteristic1.cpp) (GATT characteristic), [`src/GattService1.cpp`](https://github.com/weareaudiofile/bluez-dbus-cpp/blob/master/src/GattService1.cpp) (GATT service), [`include/bluez-dbus-cpp/GattManager1.h`](https://github.com/weareaudiofile/bluez-dbus-cpp/blob/master/include/bluez-dbus-cpp/GattManager1.h) (GATT manager)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_gatt["GATT server"]
  node_application["GATT application<br/>[GattApplication1.h]"]
  node_service["GATT service<br/>[GattService1.cpp]"]
  node_characteristic["GATT characteristic"]
  node_descriptor["GATT descriptor"]
  node_adaptors["D-Bus adaptors"]
  node_gatt_manager["GATT manager<br/>[GattManager1.h]"]
  node_characteristic_builder["Characteristic builder"]
end

subgraph group_advertising["LE advertising"]
  node_advertisement["LE advertisement<br/>[LEAdvertisement1.h]"]
  node_advertising_manager["Advertising manager"]
end

subgraph group_client["BlueZ client"]
  node_adapter_proxy["Adapter proxy<br/>[Adapter1_proxy.h]"]
  node_device_proxy["Device proxy<br/>[Device1_proxy.h]"]
end

subgraph group_transport["Socket transport"]
  node_client_api["Client API<br/>[Client.h]"]
  node_socket_api["Socket API<br/>[Socket.h]"]
end

node_developer(("Library user"))
node_bluez(("BlueZ daemon"))

node_developer -.->|"creates"| node_application
node_service -->|"registers with"| node_application
node_application -.->|"exposes objects"| node_adaptors
node_characteristic -.->|"registers with"| node_service
node_descriptor -.->|"associates with"| node_characteristic
node_characteristic_builder -.->|"builds"| node_characteristic
node_developer -.->|"registers application"| node_gatt_manager
node_gatt_manager -->|"registers application"| node_bluez
node_developer -.->|"configures"| node_advertisement
node_advertisement -.->|"registers advertisement"| node_advertising_manager
node_advertising_manager -->|"registers advertisement"| node_bluez
node_developer -.->|"uses"| node_adapter_proxy
node_developer -.->|"uses"| node_device_proxy
node_client_api -->|"uses"| node_socket_api

click node_application "https://github.com/weareaudiofile/bluez-dbus-cpp/blob/master/include/bluez-dbus-cpp/GattApplication1.h"
click node_service "https://github.com/weareaudiofile/bluez-dbus-cpp/blob/master/src/GattService1.cpp"
click node_characteristic "https://github.com/weareaudiofile/bluez-dbus-cpp/blob/master/src/GattCharacteristic1.cpp"
click node_descriptor "https://github.com/weareaudiofile/bluez-dbus-cpp/blob/master/src/GattDescriptor1.cpp"
click node_adaptors "https://github.com/weareaudiofile/bluez-dbus-cpp/tree/master/include/bluez-dbus-cpp/adaptor"
click node_gatt_manager "https://github.com/weareaudiofile/bluez-dbus-cpp/blob/master/include/bluez-dbus-cpp/GattManager1.h"
click node_characteristic_builder "https://github.com/weareaudiofile/bluez-dbus-cpp/blob/master/include/bluez-dbus-cpp/GattCharacteristicBuilder.h"
click node_advertisement "https://github.com/weareaudiofile/bluez-dbus-cpp/blob/master/include/bluez-dbus-cpp/LEAdvertisement1.h"
click node_advertising_manager "https://github.com/weareaudiofile/bluez-dbus-cpp/blob/master/include/bluez-dbus-cpp/LEAdvertisingManager1.h"
click node_adapter_proxy "https://github.com/weareaudiofile/bluez-dbus-cpp/blob/master/include/bluez-dbus-cpp/proxy/Adapter1_proxy.h"
click node_device_proxy "https://github.com/weareaudiofile/bluez-dbus-cpp/blob/master/include/bluez-dbus-cpp/proxy/Device1_proxy.h"
click node_client_api "https://github.com/weareaudiofile/bluez-dbus-cpp/blob/master/include/bluez-dbus-cpp/Client.h"
click node_socket_api "https://github.com/weareaudiofile/bluez-dbus-cpp/blob/master/include/bluez-dbus-cpp/Socket.h"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_application,node_service,node_characteristic,node_descriptor,node_adaptors,node_gatt_manager,node_characteristic_builder,node_developer toneBlue
class node_advertisement,node_advertising_manager toneAmber
class node_adapter_proxy,node_device_proxy toneMint
class node_client_api,node_socket_api toneRose
class node_bluez toneIndigo
```

## Components

### GATT server

- [GATT application](https://github.com/weareaudiofile/bluez-dbus-cpp/blob/master/include/bluez-dbus-cpp/GattApplication1.h): `include/bluez-dbus-cpp/GattApplication1.h`
- [GATT service](https://github.com/weareaudiofile/bluez-dbus-cpp/blob/master/src/GattService1.cpp): `src/GattService1.cpp`
- [GATT characteristic](https://github.com/weareaudiofile/bluez-dbus-cpp/blob/master/src/GattCharacteristic1.cpp): `src/GattCharacteristic1.cpp`
- [GATT descriptor](https://github.com/weareaudiofile/bluez-dbus-cpp/blob/master/src/GattDescriptor1.cpp): `src/GattDescriptor1.cpp`
- [D-Bus adaptors](https://github.com/weareaudiofile/bluez-dbus-cpp/tree/master/include/bluez-dbus-cpp/adaptor): `include/bluez-dbus-cpp/adaptor`
- [GATT manager](https://github.com/weareaudiofile/bluez-dbus-cpp/blob/master/include/bluez-dbus-cpp/GattManager1.h): `include/bluez-dbus-cpp/GattManager1.h`
- [Characteristic builder](https://github.com/weareaudiofile/bluez-dbus-cpp/blob/master/include/bluez-dbus-cpp/GattCharacteristicBuilder.h): `include/bluez-dbus-cpp/GattCharacteristicBuilder.h`

### LE advertising

- [LE advertisement](https://github.com/weareaudiofile/bluez-dbus-cpp/blob/master/include/bluez-dbus-cpp/LEAdvertisement1.h): `include/bluez-dbus-cpp/LEAdvertisement1.h`
- [Advertising manager](https://github.com/weareaudiofile/bluez-dbus-cpp/blob/master/include/bluez-dbus-cpp/LEAdvertisingManager1.h): `include/bluez-dbus-cpp/LEAdvertisingManager1.h`

### BlueZ client

- [Adapter proxy](https://github.com/weareaudiofile/bluez-dbus-cpp/blob/master/include/bluez-dbus-cpp/proxy/Adapter1_proxy.h): `include/bluez-dbus-cpp/proxy/Adapter1_proxy.h`
- [Device proxy](https://github.com/weareaudiofile/bluez-dbus-cpp/blob/master/include/bluez-dbus-cpp/proxy/Device1_proxy.h): `include/bluez-dbus-cpp/proxy/Device1_proxy.h`

### Socket transport

- [Client API](https://github.com/weareaudiofile/bluez-dbus-cpp/blob/master/include/bluez-dbus-cpp/Client.h): `include/bluez-dbus-cpp/Client.h`
- [Socket API](https://github.com/weareaudiofile/bluez-dbus-cpp/blob/master/include/bluez-dbus-cpp/Socket.h): `include/bluez-dbus-cpp/Socket.h`

### Other components

- **Library user**
- **BlueZ daemon**

## Connections

- Library user → GATT application: creates
- GATT service → GATT application: registers with (evidence: `src/GattService1.cpp`)
- GATT application → D-Bus adaptors: exposes objects (evidence: `include/bluez-dbus-cpp/GattApplication1.h`)
- GATT characteristic → GATT service: registers with
- GATT descriptor → GATT characteristic: associates with
- Characteristic builder → GATT characteristic: builds
- Library user → GATT manager: registers application
- GATT manager → BlueZ daemon: registers application (evidence: `include/bluez-dbus-cpp/GattManager1.h`)
- Library user → LE advertisement: configures
- LE advertisement → Advertising manager: registers advertisement (evidence: `include/bluez-dbus-cpp/LEAdvertisement1.h`)
- Advertising manager → BlueZ daemon: registers advertisement (evidence: `include/bluez-dbus-cpp/LEAdvertisingManager1.h`)
- Library user → Adapter proxy: uses
- Library user → Device proxy: uses
- Client API → Socket API: uses (evidence: `include/bluez-dbus-cpp/Client.h`)
