1/*
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
17#ifndef _MTP_TYPES_H
18#define _MTP_TYPES_H
19
20#include <stdint.h>
21#include "utils/String8.h"
22#include "utils/Vector.h"
23
24namespace android {
25
26typedef int32_t int128_t[4];
27typedef uint32_t uint128_t[4];
28
29typedef uint16_t MtpOperationCode;
30typedef uint16_t MtpResponseCode;
31typedef uint16_t MtpEventCode;
32typedef uint32_t MtpSessionID;
33typedef uint32_t MtpStorageID;
34typedef uint32_t MtpTransactionID;
35typedef uint16_t MtpPropertyCode;
36typedef uint16_t MtpDataType;
37typedef uint16_t MtpObjectFormat;
38typedef MtpPropertyCode MtpDeviceProperty;
39typedef MtpPropertyCode MtpObjectProperty;
40
41// object handles are unique across all storage but only within a single session.
42// object handles cannot be reused after an object is deleted.
43// values 0x00000000 and 0xFFFFFFFF are reserved for special purposes.
44typedef uint32_t MtpObjectHandle;
45
46// Special values
47#define MTP_PARENT_ROOT         0xFFFFFFFF       // parent is root of the storage
48#define kInvalidObjectHandle    0xFFFFFFFF
49
50class MtpStorage;
51class MtpDevice;
52class MtpProperty;
53
54typedef Vector<MtpStorage *> MtpStorageList;
55typedef Vector<MtpDevice*> MtpDeviceList;
56typedef Vector<MtpProperty*> MtpPropertyList;
57
58typedef Vector<uint8_t> UInt8List;
59typedef Vector<uint16_t> UInt16List;
60typedef Vector<uint32_t> UInt32List;
61typedef Vector<uint64_t> UInt64List;
62typedef Vector<int8_t> Int8List;
63typedef Vector<int16_t> Int16List;
64typedef Vector<int32_t> Int32List;
65typedef Vector<int64_t> Int64List;
66
67typedef UInt16List MtpObjectPropertyList;
68typedef UInt16List MtpDevicePropertyList;
69typedef UInt16List MtpObjectFormatList;
70typedef UInt32List MtpObjectHandleList;
71typedef UInt16List MtpObjectPropertyList;
72typedef UInt32List MtpStorageIDList;
73
74typedef String8    MtpString;
75
76}; // namespace android
77
78#endif // _MTP_TYPES_H
79