DBus Interface Specifications
1. General
The exact interface specification including elaborate comments can be found in the "org.libmtp.mtpd.xml" file which is located in the "daemon/dbus" directory.
- The DBus interface shall provide the following APIs:
- device management
- file management
- folder management
- object management
- The following APIs shall be optional in a first version, but be implemented afterwards. They are therefore not detailed in the initial version of this document.
- track management
- playlist management
- album management
- The APIs shall be modelled as close as possible to the LIBMTP APIs
- If something cannot be modelled using DBus or a significantly better alternative exists another approach should be used
- For example callbacks are not possible: use DBus signals
- Filetypes should be matched and presented as mime-types and not MTP-internal filetypes
- If an operation cannot be executed due to another long-running operation all waiting programs shall be notified
- Client programs can then notify their users like this: "There is currently another operation active on the device. Please be patient!"
- Information about the daemon shall be made available as properties
- Optional information that is not part of the specification shall be made available, but marked as such
- e.g. If the daemon does internal caching the status can be exported as a property
2. Device Management
- The device access shall be neartly completely rewritten in contrast to the LIBMTP device management API to ensure useful usage of it
- As the daemon abstracts all device handling for the client the direct access API is not necessary
- The following interfaces shall be available
- listDevices
List all devices currently connected
- renameDevice
Set the friendlyName of the device to something else
- listStorages
List all storages for a device
- getMetadataforDevice
- getMetadataforStorage
- formatStorage
- The following interfaces for accessing device properties shall be modelled closely to the existing API
- LIBMTP_Get_String_From_Object
- LIBMTP_Get_u64_From_Object
- LIBMTP_Get_u32_From_Object
- LIBMTP_Get_u16_From_Object
- LIBMTP_Get_u8_From_Object
- LIBMTP_Set_Object_String
- LIBMTP_Set_Object_u32
- LIBMTP_Set_Object_u16
- LIBMTP_Set_Object_u8
- LIBMTP_Get_Property_Description
- LIBMTP_Is_Property_Supported
- LIBMTP_Get_Allowed_Property_Values
- The following interfaces still need to be discussed
- LIBMTP_Get_Syncpartner
- LIBMTP_Set_Syncpartner
3. File Management
- The following interfaces shall be adapted as closely as possible
- LIBMTP_Get_Files_And_Folders
Return type shall be a list
- LIBMTP_Get_Filelisting
Return type shall be a list
- LIBMTP_Get_Filemetadata
- LIBMTP_Set_File_Name
- LIBMTP_Get_Thumbnail
- The following interfaces shall be altered for easier access or usage of DBus simplifications
- LIBMTP_Get_File_To_File_Descriptor
Progress function shall be implemented as a signal. The get-function itself shall return a transaction-id that will be included in the progress signal. It shall be the applications responsibility to filter for transactions issued by it.
- LIBMTP_Send_File_From_File_Descriptor
Progress function shall be implemented as a signal. The send-function itself shall return a transaction-id that will be included in the progress signal. It shall be the applications responsibility to filter for transactions issued by it.
- The following interfaces shall not be implemented
- LIBMTP_new_file_t
- LIBMTP_destroy_file_t
- LIBMTP_Get_File_To_File
- LIBMTP_Send_File_From_File
- LIBMTP_new_filesampledata_t
- LIBMTP_destroy_filesampledata_t
- LIBMTP_Get_Filetype_Description
- LIBMTP_Get_Filelisting_With_Callback
- The following interfaces still need to be discussed
- LIBMTP_Get_File_To_Handler
- LIBMTP_Send_File_From_Handler
- LIBMTP_Get_Representative_Sample_Format
- LIBMTP_Send_Representative_Sample
- LIBMTP_Get_Representative_Sample
- LIBMTP_Read_Event
4. Folder Management
- The following interfaces shall be adapted as closely as possible
- LIBMTP_Get_Folder_List
- LIBMTP_Get_Folder_List_For_Storage
- LIBMTP_Create_Folder
- LIBMTP_Set_Folder_Name
- The following interfaces shall not be implemented
- LIBMTP_new_folder_t
- LIBMTP_destroy_folder_t
5. Object Management
- The following interfaces shall be adapted as closely as possible
- LIBMTP_Delete_Object
Shall ensure that objects are deleted recursively
- LIBMTP_Set_Object_Filename
- LIBMTP_GetPartialObject
- LIBMTP_SendPartialObject
- LIBMTP_BeginEditObject
- LIBMTP_EndEditObject
- LIBMTP_TruncateObject