Media Transfer Protocol
Total Page:16
File Type:pdf, Size:1020Kb
Media Transfer Protocol Revision 1.1 April 6th, 2011 Revision 1.1 April 6th, 2011 1 USB Media Transfer Protocol Specification Copyright © 2011, USB Implementers Forum All Rights Reserved Copyright © 2011, USB Implementers Forum, Inc. All rights reserved. A LICENSE IS HEREBY GRANTED TO REPRODUCE THIS SPECIFICATION FOR INTERNAL USE ONLY. NO OTHER LICENSE, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, IS GRANTED OR INTENDED HEREBY. USB-IF AND THE AUTHORS OF THIS SPECIFICATION EXPRESSLY DISCLAIM ALL LIABILITY FOR INFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, RELATING TO IMPLEMENTATION OF INFORMATION IN THIS SPECIFICATION. USB-IF AND THE AUTHORS OF THIS SPECIFICATION ALSO DO NOT WARRANT OR REPRESENT THAT SUCH IMPLEMENTATION(S) WILL NOT INFRINGE THE INTELLECTUAL PROPERTY RIGHTS OF OTHERS. THIS SPECIFICATION IS PROVIDED "AS IS” AND WITH NO WARRANTIES, EXPRESS OR IMPLIED, STATUTORY OR OTHERWISE. ALL WARRANTIES ARE EXPRESSLY DISCLAIMED. NO WARRANTY OF MERCHANTABILITY, NO WARRANTY OF NON-INFRINGEMENT, NO WARRANTY OF FITNESS FOR ANY PARTICULAR PURPOSE, AND NO WARRANTY ARISING OUT OF ANY PROPOSAL, SPECIFICATION, OR SAMPLE. IN NO EVENT WILL USB-IF OR USB-IF MEMBERS BE LIABLE TO ANOTHER FOR THE COST OF PROCURING SUBSTITUTE GOODS OR SERVICES, LOST PROFITS, LOSS OF USE, LOSS OF DATA OR ANY INCIDENTAL, CONSEQUENTIAL, INDIRECT, OR SPECIAL DAMAGES, WHETHER UNDER CONTRACT, TORT, WARRANTY, OR OTHERWISE, ARISING IN ANY WAY OUT OF THE USE OF THIS SPECIFICATION, WHETHER OR NOT SUCH PARTY HAD ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. Please send comments via electronic mail to [email protected] Revision 1.1 April 6th, 2011 2 USB Media Transfer Protocol Specification Copyright © 2011, USB Implementers Forum All Rights Reserved Table of Contents Table of Contents .............................................................................................................. 3 1 Introduction ............................................................................................................. 15 1.1 Purpose ............................................................................................................ 15 1.2 MTP Device Model ......................................................................................... 15 1.3 MTP Object Model .......................................................................................... 15 1.4 Scope ............................................................................................................... 16 1.5 PTP Compatibility ........................................................................................... 16 2 Transport Requirements .......................................................................................... 17 2.1 Disconnection Events ...................................................................................... 17 2.2 Error-Free Data Transmission ......................................................................... 17 2.3 Asynchronous Events ...................................................................................... 17 2.4 Device Discovery and Enumeration ................................................................ 17 2.5 Security and Authentication ............................................................................ 17 2.6 Transport Independence .................................................................................. 17 2.7 MTP Device Enumeration ............................................................................... 18 3 Normative Reference ............................................................................................... 19 3.1 Data Formatting ............................................................................................... 19 3.1.1 Multi-byte Data ........................................................................................... 19 3.1.2 Bit Field Format .......................................................................................... 19 3.2 Simple Types ................................................................................................... 19 3.2.1 Simple Type Summary ................................................................................ 19 3.2.2 Arrays .......................................................................................................... 20 3.2.2.1 Array Definition .................................................................................. 20 3.2.3 Strings ......................................................................................................... 21 3.2.3.1 String Definition .................................................................................. 21 3.2.4 Decimal Types ............................................................................................. 21 3.2.5 DateTime ..................................................................................................... 21 3.3 Datacodes ........................................................................................................ 22 3.3.1 Datacode Summary ..................................................................................... 22 3.4 Object Handles ................................................................................................ 23 3.4.1 Assigning Object Handles ........................................................................... 23 3.5 Object Formats ................................................................................................ 24 3.5.1 Object Format Versions ............................................................................... 24 3.6 Associations .................................................................................................... 24 3.6.1 Association Types ....................................................................................... 25 3.6.2 Association Type Summary ......................................................................... 25 3.6.2.1 Generic Folder ..................................................................................... 25 3.6.2.2 Album .................................................................................................. 26 3.6.2.3 Time Sequence .................................................................................... 26 3.6.2.4 Horizontal Panoramic .......................................................................... 26 3.6.2.5 Vertical Panoramic .............................................................................. 26 3.6.2.6 2D Panoramic ...................................................................................... 26 Revision 1.1 April 6th, 2011 3 USB Media Transfer Protocol Specification Copyright © 2011, USB Implementers Forum All Rights Reserved 3.6.2.7 Ancillary Data ..................................................................................... 26 3.6.3 Associations as File System Folders ............................................................ 26 3.6.4 Associations and Object References ............................................................ 27 3.7 MTP Extensibility ........................................................................................... 27 3.7.1 Identifying Vendor Extension Support ........................................................ 27 3.7.2 Linking to Extension Documentation and Specification .............................. 28 3.7.3 Allowed Datacode Ranges ........................................................................... 28 4 Communication Model ............................................................................................ 29 4.1 Initiator/Responder Roles ................................................................................ 29 4.2 Unidirectional Data Flow ................................................................................ 29 4.3 MTP Transactions ........................................................................................... 29 4.3.1 Transaction Synchronicity ........................................................................... 30 4.3.2 Transaction Phases ...................................................................................... 30 4.3.3 Transaction IDs ........................................................................................... 30 4.4 Sessions ........................................................................................................... 30 4.4.1 Opening and Closing Sessions ..................................................................... 31 4.4.2 Choosing Session IDs .................................................................................. 31 4.5 Operations ....................................................................................................... 32 4.5.1 Operation Datacodes.................................................................................... 32 4.5.2 Operation Dataset ........................................................................................ 32 4.5.3 Operation Parameters .................................................................................. 33 4.5.3.1 Operation Code .................................................................................... 33 4.5.3.2 SessionID ............................................................................................. 33 4.5.3.3 TransactionID ...................................................................................... 33 4.5.3.4 Parameter n .......................................................................................... 33 4.6 Data Phases ....................................................................................................