summaryrefslogtreecommitdiff
path: root/doc/battery-api.txt
blob: 9a6b4fd3931da87632664ae5e870cd432b35c855 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
BlueZ D-Bus Battery API description
***********************************


Battery hierarchy
=================

Service		org.bluez
Interface	org.bluez.Battery1
Object path	[variable prefix]/{hci0,hci1,...}/dev_XX_XX_XX_XX_XX_XX

Properties	byte Percentage [readonly]

			The percentage of battery left as an unsigned 8-bit integer.

		string Source [readonly, optional, experimental]

			Describes where the battery information comes from
			This property is informational only and may be useful
			for debugging purposes.
			Providers from BatteryProvider1 may make use of this
			property to indicate where the battery report comes from
			(e.g. "HFP 1.7", "HID", or the profile UUID).


Battery Provider Manager hierarchy
==================================
A battery provider starts by registering itself as a battery provider with the
RegisterBatteryProvider method passing an object path as the provider ID. Then,
it can start exposing org.bluez.BatteryProvider1 objects having the path
starting with the given provider ID. It can also remove objects at any time.
The objects and their properties exposed by battery providers will be reflected
on org.bluez.Battery1 interface.

BlueZ will stop monitoring these exposed and removed objects after
UnregisterBatteryProvider is called for that provider ID.

Service		org.bluez
Interface	org.bluez.BatteryProviderManager1 [experimental]
Object path	/org/bluez/{hci0,hci1,...}

Methods		void RegisterBatteryProvider(object provider)

			This registers a battery provider. A registered
			battery provider can then expose objects with
			org.bluez.BatteryProvider1 interface described below.

		void UnregisterBatteryProvider(object provider)

			This unregisters a battery provider. After
			unregistration, the BatteryProvider1 objects provided
			by this client are ignored by BlueZ.


Battery Provider hierarchy
==========================

Service		<client D-Bus address>
Interface	org.bluez.BatteryProvider1 [experimental]
Object path	{provider_root}/{unique battery object path}

Properties	Objects provided on this interface contain the same properties
		as org.bluez.Battery1 interface. Additionally, this interface
		needs to have the Device property indicating the object path
		of the device this battery provides.

		object Device [readonly]

			The object path of the device that has this battery.