blob: 720c854d9732c36f1eb98f0018cf6eb1d44d68d7 [file] [log] [blame]
Mike Lockwood5bae7f62010-05-19 10:33:39 -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
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
Mike Lockwood90f48732010-06-05 22:45:01 -040026typedef int32_t int128_t[4];
27typedef uint32_t uint128_t[4];
28
Mike Lockwood5bae7f62010-05-19 10:33:39 -040029typedef uint16_t MtpOperationCode;
30typedef uint16_t MtpResponseCode;
Mike Lockwoodbe125a52010-07-12 18:54:16 -040031typedef uint16_t MtpEventCode;
Mike Lockwood5bae7f62010-05-19 10:33:39 -040032typedef uint32_t MtpSessionID;
33typedef uint32_t MtpStorageID;
34typedef uint32_t MtpTransactionID;
Mike Lockwood90f48732010-06-05 22:45:01 -040035typedef uint16_t MtpPropertyCode;
36typedef uint16_t MtpDataType;
Mike Lockwood5bae7f62010-05-19 10:33:39 -040037typedef uint16_t MtpObjectFormat;
Mike Lockwood90f48732010-06-05 22:45:01 -040038typedef MtpPropertyCode MtpDeviceProperty;
39typedef MtpPropertyCode MtpObjectProperty;
Mike Lockwood5bae7f62010-05-19 10:33:39 -040040
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
Mike Lockwood37433652010-05-19 15:12:14 -040046// Special values
47#define MTP_PARENT_ROOT 0xFFFFFFFF // parent is root of the storage
Mike Lockwood5bae7f62010-05-19 10:33:39 -040048#define kInvalidObjectHandle 0xFFFFFFFF
49
Mike Lockwood5bae7f62010-05-19 10:33:39 -040050class MtpStorage;
Mike Lockwood755fd612010-05-25 19:08:48 -040051class MtpDevice;
Mike Lockwood90f48732010-06-05 22:45:01 -040052class MtpProperty;
Mike Lockwood5bae7f62010-05-19 10:33:39 -040053
Mike Lockwood755fd612010-05-25 19:08:48 -040054typedef Vector<MtpStorage *> MtpStorageList;
55typedef Vector<MtpDevice*> MtpDeviceList;
Mike Lockwood90f48732010-06-05 22:45:01 -040056typedef Vector<MtpProperty*> MtpPropertyList;
Mike Lockwood5bae7f62010-05-19 10:33:39 -040057
Mike Lockwood755fd612010-05-25 19:08:48 -040058typedef Vector<uint8_t> UInt8List;
Mike Lockwood90f48732010-06-05 22:45:01 -040059typedef Vector<uint16_t> UInt16List;
Mike Lockwood755fd612010-05-25 19:08:48 -040060typedef Vector<uint32_t> UInt32List;
61typedef Vector<uint64_t> UInt64List;
62typedef Vector<int8_t> Int8List;
Mike Lockwood90f48732010-06-05 22:45:01 -040063typedef Vector<int16_t> Int16List;
Mike Lockwood755fd612010-05-25 19:08:48 -040064typedef Vector<int32_t> Int32List;
65typedef Vector<int64_t> Int64List;
Mike Lockwood5bae7f62010-05-19 10:33:39 -040066
Mike Lockwood4b322ce2010-08-10 07:37:50 -040067typedef UInt16List MtpObjectPropertyList;
Mike Lockwood5bae7f62010-05-19 10:33:39 -040068typedef UInt16List MtpDevicePropertyList;
69typedef UInt16List MtpObjectFormatList;
70typedef UInt32List MtpObjectHandleList;
71typedef UInt16List MtpObjectPropertyList;
72typedef UInt32List MtpStorageIDList;
73
Mike Lockwood755fd612010-05-25 19:08:48 -040074typedef String8 MtpString;
Mike Lockwood5bae7f62010-05-19 10:33:39 -040075
76}; // namespace android
77
78#endif // _MTP_TYPES_H