Skip to content

Instantly share code, notes, and snippets.

@parthitce
Last active June 24, 2024 17:18
Show Gist options
  • Save parthitce/24a0834a3e019544519c7608002b3345 to your computer and use it in GitHub Desktop.
Save parthitce/24a0834a3e019544519c7608002b3345 to your computer and use it in GitHub Desktop.
DBUS + Bluez: Referesh
@startuml
actor User
group Application and D-Bus Interaction
participant Application #LightBlue
participant "D-Bus" as DbusDaemon #LightYellow
participant "Bluez D-BUS Service" as BluezAdapter #LightGreen
end
User -> Application: Initiate read/write\n"Powered" property
activate Application
Application -> DbusDaemon: D-Bus method call\n(org.freedesktop.DBus.Properties.Get)
activate DbusDaemon
DbusDaemon -> BluezAdapter: Get\norg.bluez.Adapter1.Powered
activate BluezAdapter
BluezAdapter --> DbusDaemon: Powered=true
deactivate BluezAdapter
DbusDaemon --> Application: Response with Powered=true
deactivate DbusDaemon
User -> Application: Initiate write\n"Powered" property = false
activate Application
Application -> DbusDaemon: D-Bus method call\n(org.freedesktop.DBus.Properties.Set)
activate DbusDaemon
Application -> BluezAdapter: Set\norg.bluez.Adapter1.Powered = false
activate BluezAdapter
BluezAdapter --> DbusDaemon: Success
deactivate BluezAdapter
DbusDaemon --> Application: Response with Success
deactivate DbusDaemon
@enduml
@parthitce
Copy link
Author

dbus_bluez

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment