~ubuntu-branches/ubuntu/wily/bluez/wily

« back to all changes in this revision

Viewing changes to doc/attribute-api.txt

ImportĀ upstreamĀ versionĀ 4.81

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
BlueZ D-Bus Attribute API description
 
2
*************************************
 
3
 
 
4
Copyright (C) 2004-2010  Marcel Holtmann <marcel@holtmann.org>
 
5
 
 
6
Service details
 
7
---------------
 
8
 
 
9
One service object path for every remote SDP record or service in the
 
10
attribute database. One service object path for every local SDP record
 
11
or service from attribute database.
 
12
 
 
13
Local services are children of the adapter object path. Remote services
 
14
are children of the remote device object path. This doesn't solve the
 
15
problem where local atttributes can have different instances based on
 
16
the remote device.
 
17
 
 
18
In general the idea is to also represent SDP records as services so that
 
19
new style application can just use the service interfaces to retrieve the
 
20
needed information. That way the usage of SDP and GATT would be mostly
 
21
fully transparent and a differentiation becomes unimportant in the future.
 
22
 
 
23
A service consists of some generic service information and a set of
 
24
characteristics. All characteristic are presented as object path as well.
 
25
 
 
26
 
 
27
Local Service hierarchy
 
28
=======================
 
29
 
 
30
Service         org.bluez
 
31
Interface       org.bluez.Service
 
32
                org.bluez.Characteristic
 
33
Object path     [prefix]/{hci0}/{service0, service1, ...}
 
34
 
 
35
Methods
 
36
 
 
37
Properties
 
38
 
 
39
 
 
40
Device Service hierarchy
 
41
========================
 
42
 
 
43
Service         org.bluez
 
44
Interface       org.bluez.Characteristic
 
45
Object path     [prefix]/{hci0}/{device0}/{service0, service1, ...}
 
46
                [prefix]/{hci0}/{device1}/{service0, service1, ...}
 
47
 
 
48
Methods         dict GetProperties()
 
49
 
 
50
                        Returns all properties for the interface. See the
 
51
                        Properties section for the available properties.
 
52
 
 
53
                RegisterCharacteristicsWatcher(object agent)
 
54
 
 
55
                        Register a watcher to monitor characteristic changes.
 
56
 
 
57
                        A watcher will be registered for this service and will
 
58
                        notify about any changed characteristics in the service.
 
59
                        This also notifies about any included characteristics.
 
60
 
 
61
                UnregisterCharacteristicsWatcher(object agent)
 
62
 
 
63
                        Unregister a watcher.
 
64
 
 
65
Properties      string Name (mandatory) [readonly]
 
66
 
 
67
                        General name of service
 
68
 
 
69
                string Description (optional) [readonly]
 
70
 
 
71
                        Description of service
 
72
 
 
73
                string UUID (mandatory) [readonly]
 
74
 
 
75
                        UUID of service. Service class value for SDP and GATT
 
76
                        UUID for attribute based services.
 
77
 
 
78
                array{object} Characteristics [readonly]
 
79
 
 
80
                        This list contains the characteristics owned by this
 
81
                        specific service and other characteristics from service
 
82
                        includes. That way no complicated service includes array
 
83
                        is needed.
 
84
 
 
85
 
 
86
Device Characteristic hierarchy
 
87
===============================
 
88
 
 
89
Service         org.bluez
 
90
Interface       org.bluez.Characteristic
 
91
Object path     [prefix]/{hci0}/{device0}/{service0}/{characteristic0,...}
 
92
                [prefix]/{hci0}/{device0}/{service1}/{characteristic0,...}
 
93
 
 
94
Methods         dict GetProperties()
 
95
 
 
96
                        Returns all properties for the characteristic. See the
 
97
                        properties section for available properties.
 
98
 
 
99
                void SetProperty(string name, variant value)
 
100
 
 
101
                        Changes the value of the specified property. Only
 
102
                        read-write properties can be changed. On success
 
103
                        this will emit a PropertyChanged signal.
 
104
 
 
105
                        Possible Errors: org.bluez.Error.InvalidArguments
 
106
 
 
107
Properties      string UUID [readonly]
 
108
 
 
109
                        UUID128 of this characteristic.
 
110
 
 
111
                string Name [readonly]
 
112
 
 
113
                        Optional field containing a friendly name for the
 
114
                        Characteristic UUID.
 
115
 
 
116
                string Description [readonly]
 
117
 
 
118
                        Textual optional characteristic descriptor describing
 
119
                        the Characteristic Value.
 
120
 
 
121
                struct Format [readonly]
 
122
 
 
123
                        Optional Characteristic descriptor which defines the
 
124
                        format of the Characteristic Value. For numeric
 
125
                        values, the actual value can be value * 10^Exponent.
 
126
                        NameSpace and Description are defined on the Assigned
 
127
                        Number Specification.
 
128
 
 
129
                          uint8  | Format: format of the value
 
130
                          uint8  | Exponent: Field to determine how the value is
 
131
                                 | further formatted.
 
132
                          uint16 | Unit: unit of the characteristic
 
133
                          uint8  | NameSpace: Name space of description.
 
134
                          uint16 | Description: Description of the characteristic defined
 
135
                                 | in a high layer profile.
 
136
 
 
137
                array{byte} Value [readwrite]
 
138
 
 
139
                        Raw value of the Characteristic Value attribute.
 
140
 
 
141
                string Representation (of the binary Value) [readonly]
 
142
 
 
143
                        Friendly representation of the Characteristic Value
 
144
                        based on the format attribute.
 
145
 
 
146
 
 
147
Characteristic Watcher hierarchy
 
148
===============================
 
149
 
 
150
Service         unique name
 
151
Interface       org.bluez.Watcher
 
152
Object path     freely definable
 
153
 
 
154
Methods         void ValueChanged(object characteristic, array{byte})
 
155
 
 
156
                        New raw value of the Characteristic Value attribute.