blob: 64e180cb4a6ff6a97f85b673975695bc1c28ee73 [file] [log] [blame]
bigbiff bigbiffc7eee6f2014-09-02 18:59:01 -04001/*
2 * Copyright (C) 2010 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 *
16 * Copyright (C) 2014 TeamWin - bigbiff and Dees_Troy mtp database conversion to C++
17 */
18
19#ifndef _MTP_TYPES_H
20#define _MTP_TYPES_H
21
22#include <stdint.h>
23#include <vector>
24#include <utils/Vector.h>
25#include <utils/String8.h>
26
27typedef int32_t int128_t[4];
28typedef uint32_t uint128_t[4];
29
30typedef uint16_t MtpOperationCode;
31typedef uint16_t MtpResponseCode;
32typedef uint16_t MtpEventCode;
33typedef uint32_t MtpSessionID;
34typedef uint32_t MtpStorageID;
35typedef uint32_t MtpTransactionID;
36typedef uint16_t MtpPropertyCode;
37typedef uint16_t MtpDataType;
38typedef uint16_t MtpObjectFormat;
39typedef MtpPropertyCode MtpDeviceProperty;
40typedef MtpPropertyCode MtpObjectProperty;
41
42// object handles are unique across all storage but only within a single session.
43// object handles cannot be reused after an object is deleted.
44// values 0x00000000 and 0xFFFFFFFF are reserved for special purposes.
45typedef uint32_t MtpObjectHandle;
46
47// Special values
48#define MTP_PARENT_ROOT 0xFFFFFFFF // parent is root of the storage
49#define kInvalidObjectHandle 0xFFFFFFFF
50
51class MtpStorage;
52class MtpDevice;
53class MtpProperty;
54
55typedef android::Vector<MtpStorage*> MtpStorageList;
56typedef android::Vector<MtpDevice*> MtpDeviceList;
57typedef android::Vector<MtpProperty*> MtpPropertyList;
58
59typedef android::Vector<uint8_t> UInt8List;
60typedef android::Vector<uint16_t> UInt16List;
61typedef android::Vector<uint32_t> UInt32List;
62typedef android::Vector<uint64_t> UInt64List;
63typedef android::Vector<int8_t> Int8List;
64typedef android::Vector<int16_t> Int16List;
65typedef android::Vector<int32_t> Int32List;
66typedef android::Vector<int64_t> Int64List;
67
68typedef UInt16List MtpObjectPropertyList;
69typedef UInt16List MtpDevicePropertyList;
70typedef UInt16List MtpObjectFormatList;
71typedef UInt32List MtpObjectHandleList;
72typedef UInt16List MtpObjectPropertyList;
73typedef UInt32List MtpStorageIDList;
74
75typedef android::String8 MtpString;
76
77
78#endif // _MTP_TYPES_H