# gokulshiva77/bluez-sample-dbus architecture

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

- Interactive diagram: https://gitdiagram.com/gokulshiva77/bluez-sample-dbus
- Repository: https://github.com/gokulshiva77/bluez-sample-dbus

## Overview

This is a menu-driven Linux Bluetooth application using BlueZ over D-Bus. The user workflow runs from menu commands through the application orchestrator to adapter discovery and device lifecycle management, then to pairing, device/profile connections, and SPP data transfer. Supporting branches handle authentication and profile registration, while ObjectManager signals feed discovered-device events into the registry. The map follows documented capabilities and shown references; unsampled implementation details are omitted, and broader BlueZ interactions are based on README statements.

Main entry points: [`Src/Application.cpp`](https://github.com/gokulshiva77/bluez-sample-dbus/blob/main/Src/Application.cpp) (Application), [`Src/ProfileManager/ProfileManager.cpp`](https://github.com/gokulshiva77/bluez-sample-dbus/blob/main/Src/ProfileManager/ProfileManager.cpp) (Profile registration), [`Src/DeviceManager/DeviceManager.cpp`](https://github.com/gokulshiva77/bluez-sample-dbus/blob/main/Src/DeviceManager/DeviceManager.cpp) (Device registry), [`Src/Menu/Menu.cpp`](https://github.com/gokulshiva77/bluez-sample-dbus/blob/main/Src/Menu/Menu.cpp) (Interactive menu)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["User interface"]
  node_menu["Interactive menu<br/>[Menu.cpp]"]
end

subgraph group_orchestration["Application orchestration"]
  node_app["Application<br/>[Application.cpp]"]
end

subgraph group_bluetooth["Bluetooth management"]
  node_adapter["Adapter control<br/>[Adapter.cpp]"]
  node_adapter_proxy["Adapter D-Bus proxy<br/>[AdapterProxy.cpp]"]
  node_object_manager["Object monitoring"]
  node_device_manager["Device registry<br/>[DeviceManager.cpp]"]
  node_device["Device operations<br/>[Device.cpp]"]
  node_device_proxy["Device D-Bus proxy<br/>[DeviceProxy.cpp]"]
  node_agent_manager["Agent registration<br/>[AgentManager.cpp]"]
  node_agent_proxy["Agent manager proxy"]
  node_agent["Pairing agent<br/>[Agent.cpp]"]
  node_agent_callbacks["Agent D-Bus callbacks<br/>[AgentProxy.cpp]"]
end

subgraph group_profiles["Profiles and data"]
  node_profile_manager["Profile registration<br/>[ProfileManager.cpp]"]
  node_profile_manager_proxy["Profile manager proxy"]
  node_profile["SPP profile<br/>[ProfileProxy.cpp]"]
  node_spp["SPP data handler<br/>[SPPHandler.cpp]"]
end

subgraph group_support["Shared support"]
  node_device_properties["Device properties<br/>[DeviceHelper.h]"]
  node_logger["Logging<br/>[Logger.cpp]"]
end

node_user(("User"))
node_bluez{{"BlueZ D-Bus service"}}

node_user -->|"uses"| node_menu
node_menu -->|"invokes operations"| node_app
node_app -->|"controls discovery"| node_adapter
node_app -->|"starts monitoring"| node_object_manager
node_object_manager -->|"forwards device events"| node_device_manager
node_device_manager -->|"creates and manages"| node_device
node_device -->|"uses D-Bus proxy"| node_device_proxy
node_device_proxy -->|"uses property model"| node_device_properties
node_app -->|"manages devices"| node_device_manager
node_app -->|"starts registration"| node_agent_manager
node_app -->|"manages pairing"| node_agent
node_agent_manager -->|"uses manager proxy"| node_agent_proxy
node_agent -->|"uses agent proxy"| node_agent_callbacks
node_app -->|"registers SPP"| node_profile_manager
node_profile_manager -->|"registers profiles"| node_profile_manager_proxy
node_profile_manager -->|"manages profile"| node_profile
node_profile -->|"uses data handler"| node_spp
node_adapter -->|"uses D-Bus proxy"| node_adapter_proxy
node_adapter_proxy -->|"controls adapter"| node_bluez
node_device_proxy -->|"device operations"| node_bluez
node_object_manager -->|"monitors object events"| node_bluez
node_agent_manager -->|"registers agent"| node_bluez
node_profile_manager -->|"registers profile"| node_bluez
node_menu -->|"logs activity"| node_logger
node_device_manager -->|"logs lifecycle"| node_logger

click node_menu "https://github.com/gokulshiva77/bluez-sample-dbus/blob/main/Src/Menu/Menu.cpp"
click node_app "https://github.com/gokulshiva77/bluez-sample-dbus/blob/main/Src/Application.cpp"
click node_adapter "https://github.com/gokulshiva77/bluez-sample-dbus/blob/main/Src/Adapter/Adapter.cpp"
click node_adapter_proxy "https://github.com/gokulshiva77/bluez-sample-dbus/blob/main/Src/Adapter/AdapterProxy.cpp"
click node_object_manager "https://github.com/gokulshiva77/bluez-sample-dbus/blob/main/Src/ObjectManager/ObjectManagerProxy.cpp"
click node_device_manager "https://github.com/gokulshiva77/bluez-sample-dbus/blob/main/Src/DeviceManager/DeviceManager.cpp"
click node_device "https://github.com/gokulshiva77/bluez-sample-dbus/blob/main/Src/Device/Device.cpp"
click node_device_proxy "https://github.com/gokulshiva77/bluez-sample-dbus/blob/main/Src/Device/DeviceProxy.cpp"
click node_device_properties "https://github.com/gokulshiva77/bluez-sample-dbus/blob/main/Inc/DeviceHelper.h"
click node_agent_manager "https://github.com/gokulshiva77/bluez-sample-dbus/blob/main/Src/AgentManager/AgentManager.cpp"
click node_agent_proxy "https://github.com/gokulshiva77/bluez-sample-dbus/blob/main/Src/AgentManager/AgentManagerProxy.cpp"
click node_agent "https://github.com/gokulshiva77/bluez-sample-dbus/blob/main/Src/Agent/Agent.cpp"
click node_agent_callbacks "https://github.com/gokulshiva77/bluez-sample-dbus/blob/main/Src/Agent/AgentProxy.cpp"
click node_profile_manager "https://github.com/gokulshiva77/bluez-sample-dbus/blob/main/Src/ProfileManager/ProfileManager.cpp"
click node_profile_manager_proxy "https://github.com/gokulshiva77/bluez-sample-dbus/blob/main/Src/ProfileManager/ProfileManagerProxy.cpp"
click node_profile "https://github.com/gokulshiva77/bluez-sample-dbus/blob/main/Src/Profile/ProfileProxy.cpp"
click node_spp "https://github.com/gokulshiva77/bluez-sample-dbus/blob/main/Src/SPPHandler/SPPHandler.cpp"
click node_logger "https://github.com/gokulshiva77/bluez-sample-dbus/blob/main/Src/Logger/Logger.cpp"

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_menu,node_user toneBlue
class node_app toneAmber
class node_adapter,node_adapter_proxy,node_object_manager,node_device_manager,node_device,node_device_proxy,node_agent_manager,node_agent_proxy,node_agent,node_agent_callbacks toneMint
class node_profile_manager,node_profile_manager_proxy,node_profile,node_spp toneRose
class node_device_properties,node_logger,node_bluez toneIndigo
```

## Components

### User interface

- [Interactive menu](https://github.com/gokulshiva77/bluez-sample-dbus/blob/main/Src/Menu/Menu.cpp): `Src/Menu/Menu.cpp`

### Application orchestration

- [Application](https://github.com/gokulshiva77/bluez-sample-dbus/blob/main/Src/Application.cpp): `Src/Application.cpp`

### Bluetooth management

- [Adapter control](https://github.com/gokulshiva77/bluez-sample-dbus/blob/main/Src/Adapter/Adapter.cpp): `Src/Adapter/Adapter.cpp`
- [Adapter D-Bus proxy](https://github.com/gokulshiva77/bluez-sample-dbus/blob/main/Src/Adapter/AdapterProxy.cpp): `Src/Adapter/AdapterProxy.cpp`
- [Object monitoring](https://github.com/gokulshiva77/bluez-sample-dbus/blob/main/Src/ObjectManager/ObjectManagerProxy.cpp): `Src/ObjectManager/ObjectManagerProxy.cpp`
- [Device registry](https://github.com/gokulshiva77/bluez-sample-dbus/blob/main/Src/DeviceManager/DeviceManager.cpp): `Src/DeviceManager/DeviceManager.cpp`
- [Device operations](https://github.com/gokulshiva77/bluez-sample-dbus/blob/main/Src/Device/Device.cpp): `Src/Device/Device.cpp`
- [Device D-Bus proxy](https://github.com/gokulshiva77/bluez-sample-dbus/blob/main/Src/Device/DeviceProxy.cpp): `Src/Device/DeviceProxy.cpp`
- [Agent registration](https://github.com/gokulshiva77/bluez-sample-dbus/blob/main/Src/AgentManager/AgentManager.cpp): `Src/AgentManager/AgentManager.cpp`
- [Agent manager proxy](https://github.com/gokulshiva77/bluez-sample-dbus/blob/main/Src/AgentManager/AgentManagerProxy.cpp): `Src/AgentManager/AgentManagerProxy.cpp`
- [Pairing agent](https://github.com/gokulshiva77/bluez-sample-dbus/blob/main/Src/Agent/Agent.cpp): `Src/Agent/Agent.cpp`
- [Agent D-Bus callbacks](https://github.com/gokulshiva77/bluez-sample-dbus/blob/main/Src/Agent/AgentProxy.cpp): `Src/Agent/AgentProxy.cpp`

### Profiles and data

- [Profile registration](https://github.com/gokulshiva77/bluez-sample-dbus/blob/main/Src/ProfileManager/ProfileManager.cpp): `Src/ProfileManager/ProfileManager.cpp`
- [Profile manager proxy](https://github.com/gokulshiva77/bluez-sample-dbus/blob/main/Src/ProfileManager/ProfileManagerProxy.cpp): `Src/ProfileManager/ProfileManagerProxy.cpp`
- [SPP profile](https://github.com/gokulshiva77/bluez-sample-dbus/blob/main/Src/Profile/ProfileProxy.cpp): `Src/Profile/ProfileProxy.cpp`
- [SPP data handler](https://github.com/gokulshiva77/bluez-sample-dbus/blob/main/Src/SPPHandler/SPPHandler.cpp): `Src/SPPHandler/SPPHandler.cpp`

### Shared support

- [Device properties](https://github.com/gokulshiva77/bluez-sample-dbus/blob/main/Inc/DeviceHelper.h): `Inc/DeviceHelper.h`
- [Logging](https://github.com/gokulshiva77/bluez-sample-dbus/blob/main/Src/Logger/Logger.cpp): `Src/Logger/Logger.cpp`

### Other components

- **User**
- **BlueZ D-Bus service**

## Connections

- User → Interactive menu: uses
- Interactive menu → Application: invokes operations
- Application → Adapter control: controls discovery
- Application → Object monitoring: starts monitoring
- Object monitoring → Device registry: forwards device events
- Device registry → Device operations: creates and manages (evidence: `Src/DeviceManager/DeviceManager.cpp`)
- Device operations → Device D-Bus proxy: uses D-Bus proxy
- Device D-Bus proxy → Device properties: uses property model
- Application → Device registry: manages devices
- Application → Agent registration: starts registration
- Application → Pairing agent: manages pairing
- Agent registration → Agent manager proxy: uses manager proxy
- Pairing agent → Agent D-Bus callbacks: uses agent proxy
- Application → Profile registration: registers SPP
- Profile registration → Profile manager proxy: registers profiles
- Profile registration → SPP profile: manages profile
- SPP profile → SPP data handler: uses data handler
- Adapter control → Adapter D-Bus proxy: uses D-Bus proxy
- Adapter D-Bus proxy → BlueZ D-Bus service: controls adapter
- Device D-Bus proxy → BlueZ D-Bus service: device operations
- Object monitoring → BlueZ D-Bus service: monitors object events
- Agent registration → BlueZ D-Bus service: registers agent
- Profile registration → BlueZ D-Bus service: registers profile
- Interactive menu → Logging: logs activity (evidence: `Src/Menu/Menu.cpp`)
- Device registry → Logging: logs lifecycle (evidence: `Src/DeviceManager/DeviceManager.cpp`)
