upgrade obexd to 0.47
[profile/ivi/obexd.git] / doc / client-api.txt
index fb5a8b2..839a78c 100644 (file)
@@ -2,86 +2,116 @@ OBEX client API description
 ***************************
 
 Copyright (C) 2007-2010  Marcel Holtmann <marcel@holtmann.org>
+Copyright (C) 2011-2012  BMW Car IT GmbH. All rights reserved.
 
 
 Client hierarchy
 ================
 
-Service                org.openobex.client
-Interface      org.openobex.Client
+Service                org.bluez.obex.client
+Interface      org.bluez.obex.Client
 Object path    /
 
-Methods                void SendFiles(dict device, array{string} files, object agent)
+Methods                object CreateSession(string destination, dict args)
 
-                       Send one or multiple local files to the specified
-                       device. The device is configured via properties. At
-                       least the Destination property should be specified.
+                       Create a new OBEX session for the given remote address.
 
-               void PullBusinessCard(dict device, string file)
+                       The last parameter is a dictionary to hold optional or
+                       type-specific parameters. Typical parameters that can
+                       be set in this dictionary include the following:
 
-                       Request the business card from a remote device and
-                       store it in the local file.
-
-               void ExchangeBusinessCards(dict device, string clientfile, string file)
-
-                       Push the client's business card to the remote device
-                       and then retrieve the remote business card and store
-                       it in a local file.
+                               string "Target" : type of session to be created
+                               string "Source" : local address to be used
+                               byte "Channel"
 
-               object CreateSession(dict device)
+                       The currently supported targets are the following:
 
-                       Create a new OBEX session. The device is configured
-                       via properties like in SendFiles.
+                               "FTP"
+                               "MAP"
+                               "OPP"
+                               "PBAP"
+                               "SYNC"
 
                void RemoveSession(object session)
 
                        Unregister session and abort pending transfers.
 
-               string GetCapabilities(dict device)
+Session hierarchy
+=================
 
-                       Get remote device capabilities.
+Service                org.bluez.obex.client
+Interface      org.bluez.obex.Session
+Object path    [variable prefix]/{session0,session1,...}
+
+Methods                dict GetProperties()
 
-Properties     string Target
+                       Returns all properties for the session.
 
-               string Source
+               string GetCapabilities()
 
-               string Destination
+                       Get remote device capabilities.
 
-               byte Channel
+Properties     string Source [readonly]
 
+               string Destination [readonly]
 
-Session hierarchy
-=================
+               byte Channel [readonly]
 
-Service                org.openobex.client
-Interface      org.openobex.Session
+Object Push hierarchy
+=====================
+
+Service                org.bluez.obex.client
+Interface      org.bluez.obex.ObjectPush
 Object path    [variable prefix]/{session0,session1,...}
 
-Methods                dict GetProperties()
+Methods                object, dict SendFile(string sourcefile)
 
-                       Returns all properties for the session.
+                       Send one local file to the remote device.
 
-               void AssignAgent(object agent)
+                       The returned path represents the newly created transfer,
+                       which should be used to find out if the content has been
+                       successfully transferred or if the operation fails.
 
-                       Assign an OBEX agent to this session. This allows
-                       detailed progress reports about the transactions.
+                       The properties of this transfer are also returned along
+                       with the object path, to avoid a call to GetProperties.
 
-               void ReleaseAgent(object agent)
+               object, dict PullBusinessCard(string targetfile)
 
-                       Release a previously assigned OBEX agent.
+                       Request the business card from a remote device and
+                       store it in the local file.
+
+                       If an empty target file is given, a name will be
+                       automatically calculated for the temporary file.
 
-Properties     string Source [read-only]
+                       The returned path represents the newly created transfer,
+                       which should be used to find out if the content has been
+                       successfully transferred or if the operation fails.
 
-               string Destination [read-only]
+                       The properties of this transfer are also returned along
+                       with the object path, to avoid a call to GetProperties.
 
-               byte Channel [read-only]
+               object, dict ExchangeBusinessCards(string clientfile,
+                                                       string targetfile)
 
+                       Push the client's business card to the remote device
+                       and then retrieve the remote business card and store
+                       it in a local file.
+
+                       If an empty target file is given, a name will be
+                       automatically calculated for the temporary file.
+
+                       The returned path represents the newly created transfer,
+                       which should be used to find out if the content has been
+                       successfully transferred or if the operation fails.
+
+                       The properties of this transfer are also returned along
+                       with the object path, to avoid a call to GetProperties.
 
 File Transfer hierarchy
 =======================
 
-Service                org.openobex.client
-Interface      org.openobex.FileTransfer
+Service                org.bluez.obex.client
+Interface      org.bluez.obex.FileTransfer
 Object path    [variable prefix]/{session0,session1,...}
 
 Methods                void ChangeFolder(string folder)
@@ -101,27 +131,40 @@ Methods           void ChangeFolder(string folder)
 
                                string Name : Object name in UTF-8 format
                                string Type : Either "folder" or "file"
-                               uint64 Size : Object size or number of items in folder
-                               string Permission : Group, owner and other permission
-                               guint64 Modified : Last change
-                               guint64 Accessed : Last access
-                               guint64 Created : Creation date
+                               uint64 Size : Object size or number of items in
+                                               folder
+                               string Permission : Group, owner and other
+                                                       permission
+                               uint64 Modified : Last change
+                               uint64 Accessed : Last access
+                               uint64 Created : Creation date
 
-               void GetFile(string targetfile, string sourcefile)
+               object, dict GetFile(string targetfile, string sourcefile)
 
                        Copy the source file (from remote device) to the
                        target file (on local filesystem).
 
-                       A new Transfer object is created to represent this
-                       transaction.
+                       If an empty target file is given, a name will be
+                       automatically calculated for the temporary file.
+
+                       The returned path represents the newly created transfer,
+                       which should be used to find out if the content has been
+                       successfully transferred or if the operation fails.
 
-               void PutFile(string sourcefile, string targetfile)
+                       The properties of this transfer are also returned along
+                       with the object path, to avoid a call to GetProperties.
+
+               object, dict PutFile(string sourcefile, string targetfile)
 
                        Copy the source file (from local filesystem) to the
                        target file (on remote device).
 
-                       A new Transfer object is created to represent this
-                       transaction.
+                       The returned path represents the newly created transfer,
+                       which should be used to find out if the content has been
+                       successfully transferred or if the operation fails.
+
+                       The properties of this transfer are also returned along
+                       with the object path, to avoid a call to GetProperties.
 
                void CopyFile(string sourcefile, string targetfile)
 
@@ -137,12 +180,11 @@ Methods           void ChangeFolder(string folder)
 
                        Deletes the specified file/folder.
 
-
 Phonebook Access hierarchy
 =======================
 
-Service                org.openobex.client
-Interface      org.openobex.PhonebookAccess
+Service                org.bluez.obex.client
+Interface      org.bluez.obex.PhonebookAccess
 Object path    [variable prefix]/{session0,session1,...}
 
 Methods                void Select(string location, string phonebook)
@@ -150,7 +192,8 @@ Methods             void Select(string location, string phonebook)
                        Select the phonebook object for other operations. Should
                        be call before all the other operations.
 
-                       location : Where the phonebook is stored, possible inputs :
+                       location : Where the phonebook is stored, possible
+                       inputs :
                                "INT" ( "INTERNAL" which is default )
                                "SIM" ( "SIM1" )
                                "SIM2"
@@ -163,25 +206,52 @@ Methods           void Select(string location, string phonebook)
                                "mch":  missing call history
                                "cch":  combination of ich och mch
 
-               string PullAll()
+               object, dict PullAll(string targetfile)
 
                        Return the entire phonebook object from the PSE server
-                       in plain string with vcard format.
+                       in plain string with vcard format, and store it in
+                       a local file.
+
+                       If an empty target file is given, a name will be
+                       automatically calculated for the temporary file.
+
+                       The returned path represents the newly created transfer,
+                       which should be used to find out if the content has been
+                       successfully transferred or if the operation fails.
+
+                       The properties of this transfer are also returned along
+                       with the object path, to avoid a call to GetProperties.
 
                array{string vcard, string name} List()
 
-                       Return an array of vcard-listing data which contains the
-                       vcard : name paired string, for example "1.vcf" : "John".
+                       Return an array of vcard-listing data where every entry
+                       consists of a pair of strings containing the vcard
+                       handle and the contact name. For example:
+                               "1.vcf" : "John"
+
+               object, dict Pull(string vcard, string targetfile)
+
+                       Given a vcard handle, retrieve the vcard in the current
+                       phonebook object and store it in a local file.
+
+                       If an empty target file is given, a name will be
+                       automatically calculated for the temporary file.
 
-               string Pull(string vcard)
+                       The returned path represents the newly created transfer,
+                       which should be used to find out if the content has been
+                       successfully transferred or if the operation fails.
 
-                       Retrieve the vcard in the current phonebook object
-                       for example : Pull("0.vcf")
+                       The properties of this transfer are also returned along
+                       with the object path, to avoid a call to GetProperties.
 
                array{string vcard, string name}
                Search(string field, string value)
 
-                       Return an array of vcard-listing data which contains the
+                       Search for entries matching the given condition and
+                       return an array of vcard-listing data where every entry
+                       consists of a pair of strings containing the vcard
+                       handle and the contact name.
+
                        vcard : name paired string match the search condition.
 
                        field : the field in the vcard to search with
@@ -190,36 +260,41 @@ Methods           void Select(string location, string phonebook)
 
                uint16 GetSize()
 
-                       Return the number of the non-null entries in the selected
-                       phonebook object.
+                       Return the number of entries in the selected phonebook
+                       object that are actually used (i.e. indexes that
+                       correspond to non-NULL entries).
 
                void SetFormat(string format)
 
-                       Indicate the format of the vcard that should be return by
-                       related methods.
+                       Indicate the format of the vcard that should be return
+                       by related methods.
 
                        format : { "vcard21" (default) | "vcard30" }
 
                void SetOrder(string order)
 
-                       Indicate the sorting method of the vcard-listing data returned
-                       by List and Search methods.
+                       Indicate the sorting method of the vcard-listing data
+                       returned by List and Search methods.
 
-                       order : { "indexed" (default) | "alphanumeric" | "phonetic" }
+                       order : { "indexed" (default) | "alphanumeric" |
+                                       "phonetic" }
 
                void SetFilter(array{string})
 
-                       Indicate fields that should be contained in vcards return by
-                       related methods.
+                       Indicate fields that should be contained in vcards
+                       return by related methods.
 
-                       Give an empty array will clear the filter and return all fields
-                       available in vcards. And this is the default behavior.
+                       Give an empty array will clear the filter and return
+                       all fields available in vcards. And this is the default
+                       behavior.
 
-                       Possible filter fields : "VERSION", "FN", ..., "ALL", "bit[0-63]"
+                       Possible filter fields : "VERSION", "FN", ..., "ALL",
+                       "bit[0-63]"
 
                array{string} ListFilterFields()
 
-                       Return All Available fields that can be used in SefFilter method.
+                       Return All Available fields that can be used in
+                       SetFilter method.
 
                array{string} GetFilter()
 
@@ -228,34 +303,54 @@ Methods           void Select(string location, string phonebook)
 Synchronization hierarchy
 =======================
 
-Service                org.openobex.client
-Interface      org.openobex.Synchronization
+Service                org.bluez.obex.client
+Interface      org.bluez.obex.Synchronization
 Object path    [variable prefix]/{session0,session1,...}
 
 Methods                void SetLocation(string location)
 
-                       Set the phonebook object store location for other operations. Should
-                       be called before all the other operations.
+                       Set the phonebook object store location for other
+                       operations. Should be called before all the other
+                       operations.
 
-                       location: Where the phonebook is stored, possible values:
+                       location: Where the phonebook is stored, possible
+                       values:
                                "INT" ( "INTERNAL" which is default )
                                "SIM1"
                                "SIM2"
                                ......
 
-               string GetPhonebook()
+               object, dict GetPhonebook(string targetfile)
+
+                       Retrieve an entire Phonebook Object store from remote
+                       device, and stores it in a local file.
+
+                       If an empty target file is given, a name will be
+                       automatically calculated for the temporary file.
+
+                       The returned path represents the newly created transfer,
+                       which should be used to find out if the content has been
+                       successfully transferred or if the operation fails.
+
+                       The properties of this transfer are also returned along
+                       with the object path, to avoid a call to GetProperties.
+
+               object, dict PutPhonebook(string sourcefile)
 
-                       Retrieve an entire Phonebook Object store from remote device
+                       Send an entire Phonebook Object store to remote device.
 
-               void PutPhonebook(string obj)
+                       The returned path represents the newly created transfer,
+                       which should be used to find out if the content has been
+                       successfully transferred or if the operation fails.
 
-                       Send an entire Phonebook Object store to remote device
+                       The properties of this transfer are also returned along
+                       with the object path, to avoid a call to GetProperties.
 
 Message Access hierarchy
 =========================
 
-Service                org.openobex.client
-Interface      org.openobex.MessageAccess
+Service                org.bluez.obex.client
+Interface      org.bluez.obex.MessageAccess
 Object path    [variable prefix]/{session0,session1,...}
 
 Methods                void SetFolder(string name)
@@ -263,11 +358,114 @@ Methods          void SetFolder(string name)
                        Set working directory for current session, *name* may
                        be the directory name or '..[/dir]'.
 
+               array{dict} GetFolderListing(dict filter)
+
+                       Returns a dictionary containing information about
+                       the current folder content.
+
+                       The following keys are defined:
+
+                               string Name : Folder name
+
+               array{object, dict} GetMessageListing(string folder,
+                                                               dict filter)
+
+                       Returns an array containing the messages found in the
+                       given folder.
+
+                       Each message is represented by an object path followed
+                       by a dictionary of the properties.
+
+                       Properties:
+
+                               string Subject:
+
+                                       Message subject
+
+                               string Timestamp:
+
+                                       Message timestamp
+
+                               string Sender:
+
+                                       Message sender name
+
+                               string SenderAddress:
+
+                                       Message sender address
+
+                               string ReplyTo:
+
+                                       Message Reply-To address
+
+                               string Recipient:
+
+                                       Message recipient name
+
+                               string RecipientAddress:
+
+                                       Message recipient address
+
+                               string Type:
+
+                                       Message type
+
+                                       Possible values: "EMAIL", "SMS_GSM",
+                                       "SMS_CDMA" and "MMS"
+
+                               uint64 Size:
+
+                                       Message size in bytes
+
+                               string Status:
+
+                                       Message reception status
+
+                                       Possible values: "complete",
+                                       "fractioned" and "notification"
+
+                               boolean Priority:
+
+                                       Message priority flag
+
+                               boolean Read:
+
+                                       Message read flag
+
+                               boolean Sent:
+
+                                       Message sent flag
+
+                               boolean Protected:
+
+                                       Message protected flag
+
+Message hierarchy
+=================
+
+Service                org.bluez.obex.client
+Interface      org.bluez.obex.Message
+Object path    [variable prefix]/{session0,session1,...}/{message0,...}
+
+Methods                object, dict Get(string targetfile)
+
+                       Download message and store it in the target file.
+
+                       If an empty target file is given, a temporary file
+                       will be automatically generated.
+
+                       The returned path represents the newly created transfer,
+                       which should be used to find out if the content has been
+                       successfully transferred or if the operation fails.
+
+                       The properties of this transfer are also returned along
+                       with the object path, to avoid a call to GetProperties.
+
 Transfer hierarchy
 ==================
 
-Service                org.openobex.client
-Interface      org.openobex.Transfer
+Service                org.bluez.obex.client
+Interface      org.bluez.obex.Transfer
 Object path    [variable prefix]/{transfer0,transfer1,...}
 
 Methods                dict GetProperties()
@@ -279,59 +477,34 @@ Methods           dict GetProperties()
 
                        Cancels this transfer.
 
-Properties     string Name [read-only]
+Properties     string Name [readonly]
 
                        Name of the transferred object.
 
-               uint64 Size [read-only]
+               uint64 Size [readonly]
 
                        Size of the transferred object. If the size is
                        unknown, then this property will not be present.
 
-               string Filename [read-only]
+               string Filename [readonly, optional]
 
                        Complete name of the file being received or sent.
 
+               uint64 Progress [readonly, optional]
 
-Agent hierarchy
-===============
-
-Service                unique name
-Interface      org.openobex.Agent
-Object path    freely definable
-
-Methods                void Release()
-
-                       This method gets called when the service daemon
-                       unregisters the agent. An agent can use it to do
-                       cleanup tasks. There is no need to unregister the
-                       agent, because when this method gets called it has
-                       already been unregistered.
-
-               string Request(object transfer)
-
-                       Accept or reject a new transfer (client and server)
-                       and provide the filename for it.
-
-                       In case of incoming transfers it is the filename
-                       where to store the file and for outgoing transfers
-                       it is the filename to show the remote device. If left
-                       empty it will be calculated automatically.
-
-                       Possible errors: org.openobex.Error.Rejected
-                                        org.openobex.Error.Canceled
+                       Number of bytes transferred. For queued transfers, this
+                       value will not be present.
 
-               void Progress(object transfer, uint64 transferred)
+Signals                PropertyChanged(string name, variant value)
 
-                       Progress within the transfer has been made. The
-                       number of transferred bytes is given as second
-                       argument for convenience.
+                       This signal indicates a changed value of the given
+                       property.
 
-               void Complete(object transfer)
+               void Complete()
 
                        Informs that the transfer has completed successfully.
 
-               void Error(object transfer, string message)
+               void Error(string code, string message)
 
                        Informs that the transfer has been terminated because
                        of some error.