The MTP Data Types library implements the MTP data types. The implemented data types closely represent the raw MTP data streaming encoding and are optimized for the streaming performance.
The DLL that provides the functionality and the library to which your code must link is identified below.
There are two kinds of MTP data defined in the MTP specification:
Data used in MTP operations, responses or events. It can be data passed as a parameter to an MTP operation, response or event, or dataset transferred for an operation request. For example, if a host PC sends the GetServiceInfo operation request to a device, the host PC expects the ServiceInfo dataset from the device.
Media data file transferred between an initiator and a responder. The MTP specification refers it to as binary object data or object data. The GetObject operation and SendObject operations transfer the object binary data.
The MTP Data Types library supports the above kinds of MTP data. When the Symbian MTP Framework receives a request (from a host PC or a device) for MTP data, it loads the corresponding data providers. The data providers process the dataset or binary data file using the Data Types library and pass it to the Framework. The Framework can then transfer the data to the host PC, or use it as a parameter in an operation, response or event.
The Data Types library provides four types of data: Simple, Flat, Complex and Compound. Simple data type implements MTP integer data types while Flat, Complex and Compound data types implement MMTPType interface.
Note: Binary object data is represented by CMTPTypeFile which is a complex data type.
Simple data type –a single integer value.
API | Description |
---|---|
Implements the MTP signed 8, 16, 32, 64, and 128-bit integer data types respectively. |
|
Implements the MTP unsigned 8, 16, 32, 64, and 128-bit integer data types respectively. |
Flat data type –a fixed-length collection of simple descrete data values. For example,TMTPTypeEvent consists of seven elements. Each is a simple data type which can be different.
class TMTPTypeEvent : public TMTPTypeFlatBase { public: /** MTP event dataset element identifiers. */ enum TElements { /** Event Code, */ EEventCode, //TMTPTypeUint32 /** SessionID. */ EEventSessionID, //TMTPTypeUint32 /** TransactionID */ EEventTransactionID, //TMTPTypeUint32 /** Parameter 1. */ EEventParameter1, //TMTPTypeUint32 /** Parameter 2. */ EEventParameter2, //TMTPTypeUint32 /** Parameter 3. */ EEventParameter3, //TMTPTypeUint32 /** The number of dataset elements. */ ENumElements, //TMTPTypeUint32 };
The following diagram shows the flat classes and their relationships.
API | Description |
---|---|
The base class of MTP flat data types. |
|
Represents MTP event dataset. |
|
Represents MTP operation request dataset. |
|
Represents MTP operation response dataset. |
Complex data type –a variable-length contiguous array or string. The following diagram shows the complex classes and their relationships.
API | Description |
---|---|
Represents MTP array data type. |
|
Represents MTP binary object data type. |
|
Represents MTP string data type. |
Compound data type –a mixed sequence of simple, flat, complex and compound types.
Compound classes were initially derived from CMTPTypeCompoundBase. The derived class can represent a list dataset or an element of a list dataset. For example, CMTPTypeObjectPropListElement is an element of CMTPTypeObjectPropList. They are both derived from CMTPTypeCompoundBase.
CMTTypeList is then added to represent list dataset. It derives from CMTPTypeCompoundBase. The list classes added later are derived from CMTTypeList. For example, CMTPTypeServicePropertyList is derived from CMTTypeList and its elment CMTPTypeServicePropertyElement is derived from CMTPTypeCompoundBase.
Note:CMTPTypeCompoundBase::ChunkAppendL() can be used to append any MMTPType data types to the compound data.
The following diagram and table describe the compound base classes. For a complete set of the derived classes, refer the MTP API references.
API | Description |
---|---|
The base class of MTP compound data types. |
|
The base class of MTP list dataset. |
|
The general class for containing, accessing, and manipulating a reference to any MMTPType -derived data type. |
MTP data providers use the MTP Data Types library to process datasets for MTP operations and events. Device creators can provide their extended data types.
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.