1 OBEX client API description
2 ***************************
4 Copyright (C) 2007-2010 Marcel Holtmann <marcel@holtmann.org>
10 Service org.openobex.client
11 Interface org.openobex.Client
14 Methods void SendFiles(dict device, array{string} files, object agent)
16 Send one or multiple local files to the specified
17 device. The device is configured via properties. At
18 least the Destination property should be specified.
20 void PullBusinessCard(dict device, string file)
22 Request the business card from a remote device and
23 store it in the local file.
25 void ExchangeBusinessCards(dict device, string clientfile, string file)
27 Push the client's business card to the remote device
28 and then retrieve the remote business card and store
31 object CreateSession(dict device)
33 Create a new OBEX session. The device is configured
34 via properties like in SendFiles.
36 void RemoveSession(object session)
38 Unregister session and abort pending transfers.
40 string GetCapabilities(dict device)
42 Get remote device capabilities.
44 Properties string Target
56 Service org.openobex.client
57 Interface org.openobex.Session
58 Object path [variable prefix]/{session0,session1,...}
60 Methods dict GetProperties()
62 Returns all properties for the session.
64 void AssignAgent(object agent)
66 Assign an OBEX agent to this session. This allows
67 detailed progress reports about the transactions.
69 void ReleaseAgent(object agent)
71 Release a previously assigned OBEX agent.
73 Properties string Source [read-only]
75 string Destination [read-only]
77 byte Channel [read-only]
80 File Transfer hierarchy
81 =======================
83 Service org.openobex.client
84 Interface org.openobex.FileTransfer
85 Object path [variable prefix]/{session0,session1,...}
87 Methods void ChangeFolder(string folder)
89 Change the current folder of the remote device.
91 void CreateFolder(string folder)
93 Create a new folder in the remote device.
95 array{dict} ListFolder()
97 Returns a dictionary containing information about
98 the current folder content.
100 The following keys are defined:
102 string Name : Object name in UTF-8 format
103 string Type : Either "folder" or "file"
104 uint64 Size : Object size or number of items in folder
105 string Permission : Group, owner and other permission
106 guint64 Modified : Last change
107 guint64 Accessed : Last access
108 guint64 Created : Creation date
110 void GetFile(string targetfile, string sourcefile)
112 Copy the source file (from remote device) to the
113 target file (on local filesystem).
115 A new Transfer object is created to represent this
118 void PutFile(string sourcefile, string targetfile)
120 Copy the source file (from local filesystem) to the
121 target file (on remote device).
123 A new Transfer object is created to represent this
126 void CopyFile(string sourcefile, string targetfile)
128 Copy a file within the remote device from source file
131 void MoveFile(string sourcefile, string targetfile)
133 Move a file within the remote device from source file
136 void Delete(string file)
138 Deletes the specified file/folder.
141 Phonebook Access hierarchy
142 =======================
144 Service org.openobex.client
145 Interface org.openobex.PhonebookAccess
146 Object path [variable prefix]/{session0,session1,...}
148 Methods void Select(string location, string phonebook)
150 Select the phonebook object for other operations. Should
151 be call before all the other operations.
153 location : Where the phonebook is stored, possible inputs :
154 "INT" ( "INTERNAL" which is default )
159 phonebook : Possible inputs :
160 "pb" : phonebook for the saved contacts
161 "ich": incoming call history
162 "och": outgoing call history
163 "mch": missing call history
164 "cch": combination of ich och mch
168 Return the entire phonebook object from the PSE server
169 in plain string with vcard format.
171 array{string vcard, string name} List()
173 Return an array of vcard-listing data which contains the
174 vcard : name paired string, for example "1.vcf" : "John".
176 string Pull(string vcard)
178 Retrieve the vcard in the current phonebook object
179 for example : Pull("0.vcf")
181 array{string vcard, string name}
182 Search(string field, string value)
184 Return an array of vcard-listing data which contains the
185 vcard : name paired string match the search condition.
187 field : the field in the vcard to search with
188 { "name" (default) | "number" | "sound" }
189 value : the string value to search for
193 Return the number of the non-null entries in the selected
196 void SetFormat(string format)
198 Indicate the format of the vcard that should be return by
201 format : { "vcard21" (default) | "vcard30" }
203 void SetOrder(string order)
205 Indicate the sorting method of the vcard-listing data returned
206 by List and Search methods.
208 order : { "indexed" (default) | "alphanumeric" | "phonetic" }
210 void SetFilter(array{string})
212 Indicate fields that should be contained in vcards return by
215 Give an empty array will clear the filter and return all fields
216 available in vcards. And this is the default behavior.
218 Possible filter fields : "VERSION", "FN", ..., "ALL", "bit[0-63]"
220 array{string} ListFilterFields()
222 Return All Available fields that can be used in SefFilter method.
224 array{string} GetFilter()
226 Return the current filter setting
228 Synchronization hierarchy
229 =======================
231 Service org.openobex.client
232 Interface org.openobex.Synchronization
233 Object path [variable prefix]/{session0,session1,...}
235 Methods void SetLocation(string location)
237 Set the phonebook object store location for other operations. Should
238 be called before all the other operations.
240 location: Where the phonebook is stored, possible values:
241 "INT" ( "INTERNAL" which is default )
246 string GetPhonebook()
248 Retrieve an entire Phonebook Object store from remote device
250 void PutPhonebook(string obj)
252 Send an entire Phonebook Object store to remote device
254 Message Access hierarchy
255 =========================
257 Service org.openobex.client
258 Interface org.openobex.MessageAccess
259 Object path [variable prefix]/{session0,session1,...}
261 Methods void SetFolder(string name)
263 Set working directory for current session, *name* may
264 be the directory name or '..[/dir]'.
269 Service org.openobex.client
270 Interface org.openobex.Transfer
271 Object path [variable prefix]/{transfer0,transfer1,...}
273 Methods dict GetProperties()
275 Returns all properties for the transfer. See the
276 properties section for available properties.
280 Cancels this transfer.
282 Properties string Name [read-only]
284 Name of the transferred object.
286 uint64 Size [read-only]
288 Size of the transferred object. If the size is
289 unknown, then this property will not be present.
291 string Filename [read-only]
293 Complete name of the file being received or sent.
300 Interface org.openobex.Agent
301 Object path freely definable
303 Methods void Release()
305 This method gets called when the service daemon
306 unregisters the agent. An agent can use it to do
307 cleanup tasks. There is no need to unregister the
308 agent, because when this method gets called it has
309 already been unregistered.
311 string Request(object transfer)
313 Accept or reject a new transfer (client and server)
314 and provide the filename for it.
316 In case of incoming transfers it is the filename
317 where to store the file and for outgoing transfers
318 it is the filename to show the remote device. If left
319 empty it will be calculated automatically.
321 Possible errors: org.openobex.Error.Rejected
322 org.openobex.Error.Canceled
324 void Progress(object transfer, uint64 transferred)
326 Progress within the transfer has been made. The
327 number of transferred bytes is given as second
328 argument for convenience.
330 void Complete(object transfer)
332 Informs that the transfer has completed successfully.
334 void Error(object transfer, string message)
336 Informs that the transfer has been terminated because