org.bluez.Network(5)
π org.bluez.Network β the BlueZ D-Bus Network API, explained π
okay bestie, so this is a page from the BlueZ family of manual pages β section 5 of the manual, if you're keeping track β and it's literally the docs for org.bluez.Network, a.k.a. the BlueZ D-Bus Network API. no cap, that's the whole vibe: it's the D-Bus interface that lets you do Bluetooth networking stuff. let's get into it β¨
π NAME
org.bluez.Network β BlueZ D-Bus Network API documentation. that's it, that's the name, she's iconic π
π¦ INTERFACE
okay so before we get to the fun methods, here's the identity card for this interface β the way it introduces itself on the bus:
- Service β
org.bluez - Interface β
org.bluez.Network1 - Object path β
[variable prefix]/{hci0,hci1,...}/dev_{BDADDR}
like, the object path is giving "find me under the adapter directory, one per device" energy. the {hci0,hci1,...} bit is the adapter and the dev_{BDADDR} bit is the device address, iykyk π«Ά
β¨ METHODS
π string Connect(string uuid)
this one connects to the network device and hands you back the network interface name. literally returns a string, bestie β a whole interface name, slay.
and the uuid you pass in can be one of these cuties:
"panu","00001115-0000-1000-8000-00805f9b34fb"β Personal Network User role πΈ"nap","00001116-0000-1000-8000-00805f9b34fb"β Network Access Point role π"gn","00001117-0000-1000-8000-00805f9b34fb"β Group Network role π
big important note: the connection gets closed and the network device released either when you call Disconnect() or when the client disappears from the message bus. so like, if your client just vanishes, the bus notices and cleans up. no ghost connections, we love that for us π
possible errors it can throw at you:org.bluez.Error.InvalidArguments,org.bluez.Error.NotSupported,org.bluez.Error.InProgress,org.bluez.Error.Failedβ so if something's off, one of these π will be the one telling you
π§ void Disconnect()
disconnects from the network device. that's the whole job, and she does it well β¨
and here's a genuinely useful little detail: if your client hits errors or timeouts mid-connection-attempt and you need to abort the attempt, it's totally fine to just call this method. literally Disconnect() your way out of it, no drama π
possible errors here:org.bluez.Error.Failed,org.bluez.Error.NotConnectedβ the second one is very "bestie there was nothing to disconnect from" energy π
π PROPERTIES
boolean Connected[readonly] β indicates if the device is connected. simple, honest, main character energy πstring Interface[readonly, optional] β indicates the network interface name when available. key words: when available π¦string UUID[readonly, optional] β indicates the connection role when available. also when available, bestie, don't come for me π
and that's the whole page, fr fr β every method, every uuid, every error, every property, all accounted for π
so this lil doc came to you courtesy of BlueZ, dated October 2023, and it's filed under org.bluez.Network(5) β section 5 forever π bye bestie, go connect some networks π
π¦ where this page comes from
- arch rolling: bluez-utils 5.87-2 Β· GPL-2.0-only
- nixpkgs unstable: bluez 5.87
- ubuntu stonking: bluez 5.87-4 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms