1package main
2
3import (
4	"fmt"
5	"os"
6
7	"github.com/godbus/dbus/v5"
8)
9
10func main() {
11	conn, err := dbus.ConnectSystemBus()
12	if err != nil {
13		fmt.Fprintln(os.Stderr, "Failed to connect to SystemBus bus:", err)
14		os.Exit(1)
15	}
16	defer conn.Close()
17
18	var s string
19	err = conn.Object("org.bluez", "/").Call("org.freedesktop.DBus.Introspectable.Introspect", 0).Store(&s)
20	if err != nil {
21		fmt.Fprintln(os.Stderr, "Failed to introspect bluez", err)
22		os.Exit(1)
23	}
24
25	fmt.Println(s)
26}
27