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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
|
BlueZ D-Bus Media API description
*********************************
Media hierarchy
===============
Service org.bluez
Interface org.bluez.Media1
Object path [variable prefix]/{hci0,hci1,...}
Methods void RegisterEndpoint(object endpoint, dict properties)
Register a local end point to sender, the sender can
register as many end points as it likes.
Note: If the sender disconnects the end points are
automatically unregistered.
possible properties:
string UUID:
UUID of the profile which the endpoint
is for.
byte Codec:
Assigned number of codec that the
endpoint implements. The values should
match the profile specification which
is indicated by the UUID.
array{byte} Capabilities:
Capabilities blob, it is used as it is
so the size and byte order must match.
Possible Errors: org.bluez.Error.InvalidArguments
org.bluez.Error.NotSupported - emitted
when interface for the end-point is
disabled.
void UnregisterEndpoint(object endpoint)
Unregister sender end point.
void RegisterPlayer(object player, dict properties,
dict metadata)
Register a media player object to sender, the sender
can register as many objects as it likes.
Note: If the sender disconnects its objects are
automatically unregistered.
Properties:
string Equalizer:
Possible values: "off" or "on"
string Repeat:
Possible values: "off", "singletrack",
"alltracks" or "group"
string Shuffle:
Possible values: "off", "alltracks" or
"group"
string Scan:
Possible values: "off", "alltracks" or
"group"
string Status:
Possible values: "playing", "stopped",
"paused",
"forward-seek",
"reverse-seek" or
"error"
uint32 Position
Playback position in milliseconds
Metadata:
string Title:
Track title name
string Artist:
Track artist name
string Album:
Track album name
string Genre:
Track genre name
uint32 NumberOfTracks:
Number of tracks in total
uint32 Number:
Track number
uint32 Duration:
Track duration in milliseconds
Possible Errors: org.bluez.Error.InvalidArguments
org.bluez.Error.NotSupported
void UnregisterPlayer(object player)
Unregister sender media player.
MediaPlayer1 hierarchy
======================
Service unique name (Target role)
Interface org.bluez.MediaPlayer1
Object path freely definable
Service org.bluez (Controller role)
Interface org.bluez.MediaPlayer1
Object path [variable prefix]/{hci0,hci1,...}/dev_XX_XX_XX_XX_XX_XX/playerX
Methods dict GetTrack()
Returns known metadata of the current track.
See TrackChanged for possible values.
void Release()
This method gets called when the service daemon
unregisters the player which can then perform
cleanup tasks. There is no need to unregister the
player, because when this method gets called it has
already been unregistered.
Signals TrackChanged(dict metadata)
This signal indicates that current track has changed.
All available metadata for the new track shall be set
at once in the metadata argument. Metadata cannot be
updated in parts, otherwise it will be interpreted as
multiple track changes.
Possible values:
string Title:
Track title name
string Artist:
Track artist name
string Album:
Track album name
string Genre:
Track genre name
uint32 NumberOfTracks:
Number of tracks in total
uint32 Number:
Track number
uint32 Duration:
Track duration in milliseconds
Properties string Equalizer [readwrite]
Possible values: "off" or "on"
string Repeat [readwrite]
Possible values: "off", "singletrack", "alltracks" or
"group"
string Shuffle [readwrite]
Possible values: "off", "alltracks" or "group"
string Scan [readwrite]
Possible values: "off", "alltracks" or "group"
string Status [readonly]
Possible status: "playing", "stopped", "paused",
"forward-seek", "reverse-seek" or
"error"
uint32 Position [readonly]
Playback position in milliseconds. Changing the
position may generate additional events that will be
sent to the remote device. When position is 0 it means
the track is starting and when it's greater than or
equal to track's duration the track has ended. Note
that even if duration is not available in metadata it's
possible to signal its end by setting position to the
maximum uint32 value.
MediaEndpoint1 hierarchy
========================
Service unique name
Interface org.bluez.MediaEndpoint1
Object path freely definable
Methods void SetConfiguration(object transport, dict properties)
Set configuration for the transport.
array{byte} SelectConfiguration(array{byte} capabilities)
Select preferable configuration from the supported
capabilities.
Returns a configuration which can be used to setup
a transport.
Note: There is no need to cache the selected
configuration since on success the configuration is
send back as parameter of SetConfiguration.
void ClearConfiguration(object transport)
Clear transport configuration.
void Release()
This method gets called when the service daemon
unregisters the endpoint. An endpoint can use it to do
cleanup tasks. There is no need to unregister the
endpoint, because when this method gets called it has
already been unregistered.
MediaTransport1 hierarchy
=========================
Service org.bluez
Interface org.bluez.MediaTransport1
Object path [variable prefix]/{hci0,hci1,...}/dev_XX_XX_XX_XX_XX_XX/fdX
Methods fd, uint16, uint16 Acquire()
Acquire transport file descriptor and the MTU for read
and write respectively.
fd, uint16, uint16 TryAcquire()
Acquire transport file descriptor only if the transport
is in "pending" state at the time the message is
received by BlueZ. Otherwise no request will be sent
to the remote device and the function will just fail.
void Release()
Releases file descriptor.
Properties object Device [readonly]
Device object which the transport is connected to.
string UUID [readonly]
UUID of the profile which the transport is for.
byte Codec [readonly]
Assigned number of codec that the transport support.
The values should match the profile specification which
is indicated by the UUID.
array{byte} Configuration [readonly]
Configuration blob, it is used as it is so the size and
byte order must match.
string State [readonly]
Indicates the state of the transport. Possible
values are:
"idle": not streaming
"pending": streaming but not acquired
"active": streaming and acquired
uint16 Delay [readwrite]
Optional. Transport delay in 1/10 of millisecond, this
property is only writeable when the transport was
acquired by the sender.
boolean NREC [readwrite]
Optional and HFP specific (external to BlueZ).
Indicates if echo cancelling and noise reduction
functions are active in the transport, this
property is only writeable when the transport
was acquired by the sender.
boolean InbandRingtone [readwrite]
Optional and HFP specific (external to BlueZ).
Indicates if the transport support sending
ringtones, this property is only writeable when
the transport was acquired by the sender.
string Routing [readonly]
Optional and HFP specific (external to BlueZ).
Indicates where is the transport being routed.
Possible Values: "HCI" or "PCM"
uint16 Volume [readwrite]
Optional. Indicates volume level of the transport,
this property is only writeable when the transport was
acquired by the sender.
Possible Values: 0-127
|