Mike Lockwood | 5bae7f6 | 2010-05-19 10:33:39 -0400 | [diff] [blame] | 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 | |
| 24 | namespace android { |
| 25 | |
Mike Lockwood | 90f4873 | 2010-06-05 22:45:01 -0400 | [diff] [blame] | 26 | typedef int32_t int128_t[4]; |
| 27 | typedef uint32_t uint128_t[4]; |
| 28 | |
Mike Lockwood | 5bae7f6 | 2010-05-19 10:33:39 -0400 | [diff] [blame] | 29 | typedef uint16_t MtpOperationCode; |
| 30 | typedef uint16_t MtpResponseCode; |
Mike Lockwood | be125a5 | 2010-07-12 18:54:16 -0400 | [diff] [blame] | 31 | typedef uint16_t MtpEventCode; |
Mike Lockwood | 5bae7f6 | 2010-05-19 10:33:39 -0400 | [diff] [blame] | 32 | typedef uint32_t MtpSessionID; |
| 33 | typedef uint32_t MtpStorageID; |
| 34 | typedef uint32_t MtpTransactionID; |
Mike Lockwood | 90f4873 | 2010-06-05 22:45:01 -0400 | [diff] [blame] | 35 | typedef uint16_t MtpPropertyCode; |
| 36 | typedef uint16_t MtpDataType; |
Mike Lockwood | 5bae7f6 | 2010-05-19 10:33:39 -0400 | [diff] [blame] | 37 | typedef uint16_t MtpObjectFormat; |
Mike Lockwood | 90f4873 | 2010-06-05 22:45:01 -0400 | [diff] [blame] | 38 | typedef MtpPropertyCode MtpDeviceProperty; |
| 39 | typedef MtpPropertyCode MtpObjectProperty; |
Mike Lockwood | 5bae7f6 | 2010-05-19 10:33:39 -0400 | [diff] [blame] | 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. |
| 44 | typedef uint32_t MtpObjectHandle; |
| 45 | |
Mike Lockwood | 3743365 | 2010-05-19 15:12:14 -0400 | [diff] [blame] | 46 | // Special values |
| 47 | #define MTP_PARENT_ROOT 0xFFFFFFFF // parent is root of the storage |
Mike Lockwood | 5bae7f6 | 2010-05-19 10:33:39 -0400 | [diff] [blame] | 48 | #define kInvalidObjectHandle 0xFFFFFFFF |
| 49 | |
Mike Lockwood | 5bae7f6 | 2010-05-19 10:33:39 -0400 | [diff] [blame] | 50 | class MtpStorage; |
Mike Lockwood | 755fd61 | 2010-05-25 19:08:48 -0400 | [diff] [blame] | 51 | class MtpDevice; |
Mike Lockwood | 90f4873 | 2010-06-05 22:45:01 -0400 | [diff] [blame] | 52 | class MtpProperty; |
Mike Lockwood | 5bae7f6 | 2010-05-19 10:33:39 -0400 | [diff] [blame] | 53 | |
Mike Lockwood | 755fd61 | 2010-05-25 19:08:48 -0400 | [diff] [blame] | 54 | typedef Vector<MtpStorage *> MtpStorageList; |
| 55 | typedef Vector<MtpDevice*> MtpDeviceList; |
Mike Lockwood | 90f4873 | 2010-06-05 22:45:01 -0400 | [diff] [blame] | 56 | typedef Vector<MtpProperty*> MtpPropertyList; |
Mike Lockwood | 5bae7f6 | 2010-05-19 10:33:39 -0400 | [diff] [blame] | 57 | |
Mike Lockwood | 755fd61 | 2010-05-25 19:08:48 -0400 | [diff] [blame] | 58 | typedef Vector<uint8_t> UInt8List; |
Mike Lockwood | 90f4873 | 2010-06-05 22:45:01 -0400 | [diff] [blame] | 59 | typedef Vector<uint16_t> UInt16List; |
Mike Lockwood | 755fd61 | 2010-05-25 19:08:48 -0400 | [diff] [blame] | 60 | typedef Vector<uint32_t> UInt32List; |
| 61 | typedef Vector<uint64_t> UInt64List; |
| 62 | typedef Vector<int8_t> Int8List; |
Mike Lockwood | 90f4873 | 2010-06-05 22:45:01 -0400 | [diff] [blame] | 63 | typedef Vector<int16_t> Int16List; |
Mike Lockwood | 755fd61 | 2010-05-25 19:08:48 -0400 | [diff] [blame] | 64 | typedef Vector<int32_t> Int32List; |
| 65 | typedef Vector<int64_t> Int64List; |
Mike Lockwood | 5bae7f6 | 2010-05-19 10:33:39 -0400 | [diff] [blame] | 66 | |
Mike Lockwood | 4b322ce | 2010-08-10 07:37:50 -0400 | [diff] [blame] | 67 | typedef UInt16List MtpObjectPropertyList; |
Mike Lockwood | 5bae7f6 | 2010-05-19 10:33:39 -0400 | [diff] [blame] | 68 | typedef UInt16List MtpDevicePropertyList; |
| 69 | typedef UInt16List MtpObjectFormatList; |
| 70 | typedef UInt32List MtpObjectHandleList; |
| 71 | typedef UInt16List MtpObjectPropertyList; |
| 72 | typedef UInt32List MtpStorageIDList; |
| 73 | |
Mike Lockwood | 755fd61 | 2010-05-25 19:08:48 -0400 | [diff] [blame] | 74 | typedef String8 MtpString; |
Mike Lockwood | 5bae7f6 | 2010-05-19 10:33:39 -0400 | [diff] [blame] | 75 | |
| 76 | }; // namespace android |
| 77 | |
| 78 | #endif // _MTP_TYPES_H |