7 The purpose of this document is to describe the directory structure of
8 BlueZ settings storage. In effect, this document will serve as the primary,
9 up to date source of BlueZ storage information.
11 It is intended as reference for developers. Direct access to the storage
12 outside from bluetoothd is highly discouraged.
14 Adapter and remote device info are read form the storage during object
15 initialization. Write to storage is performed immediately on every value
18 Default storage directory is /var/lib/bluetooth. This can be adjusted
19 by the --localstatedir configure switch. Default is --localstatedir=/var.
21 All files are in ini-file format.
24 Storage directory structure
25 ===========================
27 There is one directory per adapter, named by its Bluetooth address, which
29 - a settings file for the local adapter
30 - an attributes file containing attributes of supported LE services
31 - a cache directory containing:
32 - one file per device, named by remote device address, which contains
34 - one directory per remote device, named by remote device address, which
37 - an attributes file containing attributes of remote LE services
38 - a ccc file containing persistent Client Characteristic Configuration
39 (CCC) descriptor information for GATT characteristics
41 So the directory structure is:
42 /var/lib/bluetooth/<adapter address>/
46 ./<remote device address>
47 ./<remote device address>
49 ./<remote device address>/
53 ./<remote device address>/
62 Settings file contains one [General] group with adapter info like:
64 Alias String Friendly user provided name advertised
67 This value overwrites the system
68 name (pretty hostname)
70 Discoverable Boolean Discoverability of the adapter
72 PairableTimeout Integer How long to stay in pairable mode
73 before going back to non-pairable.
74 The value is in seconds.
75 0 = disable timer, i.e. stay
78 DiscoverableTimeout Integer How long to stay in discoverable mode
79 before going back to non-discoverable.
80 The value is in seconds.
81 0 = disable timer, i.e. stay
84 #ifdef __TIZEN_PATCH__
85 LocalIrk String Identity resolving key for local
86 adapter. This key value is used to
87 generate the RPA to suport privacy feature.
88 If value is NULL, i.e IRK to be generated
98 #ifdef __TIZEN_PATCH__
103 Attributes file format
104 ======================
106 The attributes file lists all attributes supported by the local adapter or
109 Attributes are stored using their handle as group name (decimal format).
113 UUID String 128-bit UUID of the attribute
115 Value String Value of the attribute as hexadecimal encoded
118 EndGroupHandle Integer End group handle in decimal format
122 UUID=00002800-0000-1000-8000-00805f9b34fb
126 UUID=00002803-0000-1000-8000-00805f9b34fb
130 UUID=00002a00-0000-1000-8000-00805f9b34fb
131 Value=4578616D706C6520446576696365
135 ======================
137 The ccc file stores the current CCC descriptor values for GATT characteristics
138 which have notification/indication enabled by the remote device.
140 Information is stored using CCC attribute handle as group name (in decimal
145 Value String CCC descriptor value encoded in
149 Cache directory file format
150 ============================
152 Each file, named by remote device address, may includes multiple groups
153 (General, ServiceRecords, Attributes).
155 In ServiceRecords, SDP records are stored using their handle as key
156 (hexadecimal format).
158 In "Attributes" group GATT database is stored using attribute handle as key
159 (hexadecimal format). Value associated with this handle is serialized form of
160 all data required to re-create given attribute. ":" is used to separate fields.
162 [General] group contains:
164 Name String Remote device friendly name
166 ShortName String Remote device shortened name
168 [ServiceRecords] group contains
170 <0x...> String SDP record as hexadecimal encoded
173 In [Attributes] group value always starts with attribute type, that determines
174 how to interpret rest of value:
183 2802:start_handle:end_handle:uuid
186 2803:value_handle:properties:uuid
191 Sample Attributes section:
194 0002=2803:0003:20:2a05
196 0015=2803:0016:02:2a00
197 0017=2803:0018:02:2a01
198 0019=2803:001a:02:2aa6
199 0028=2800:ffff:0000180d-0000-1000-8000-00805f9b34fb
200 0029=2803:002a:10:00002a37-0000-1000-8000-00805f9b34fb
201 002b=2803:002c:02:00002a38-0000-1000-8000-00805f9b34fb
202 002d=2803:002e:08:00002a39-0000-1000-8000-00805f9b34fb
208 Info file may includes multiple groups (General, Device ID, Link key and
209 Long term key) related to a remote device.
211 [General] group contains:
213 Name String Remote device friendly name
215 Alias String Alias name
217 Class String Device class in hexadecimal,
220 Appearance String Device appearance in hexadecimal,
223 SupportedTechnologies List of List of technologies supported by
224 strings device, separated by ";"
225 Technologies can be BR/EDR or LE
227 AddressType String An address can be "static" or "public"
229 Trusted Boolean True if the remote device is trusted
231 Blocked Boolean True if the remote device is blocked
233 Services List of List of service UUIDs advertised by
234 strings remote in 128-bits UUID format,
238 [DeviceID] group contains:
240 Source Integer Assigner of Device ID
242 Vendor Integer Device vendor
244 Product Integer Device product
246 Version Integer Device version
249 [LinkKey] group contains:
251 Key String Key in hexadecimal format
253 Type Integer Type of link key
255 PINLength Integer Length of PIN
258 [LongTermKey] group contains:
260 Key String Long term key in hexadecimal format
262 Authenticated Boolean True if remote device has been
265 EncSize Integer Encrypted size
267 EDiv Integer Encrypted diversifier
269 Rand Integer Randomizer
272 [SlaveLongTermKey] group contains:
274 Same as the [LongTermKey] group, except for slave keys.
277 [ConnectionParameters] group contains:
279 MinInterval Integer Minimum Connection Interval
281 MaxInterval Integer Maximum Connection Interval
283 Latency Integer Connection Latency
285 Timeout Integer Supervision Timeout
288 [LocalSignatureKey] and [RemoteSignatureKey] groups contain:
290 Key String Key in hexadecimal format
292 Counter Integer Signing counter
294 Authenticated Boolean True if the key is authenticated
296 #ifdef __TIZEN_PATCH__
297 [IdentityResolvingKey] group contains:
299 Key String Identity Resolving key in hexadecimal format
301 IdentityAddress String Identity Address of the device
303 IdentityAddressType String Type of Identity Address of the device