diff options
| author | Mike Lockwood <mike@spruce.(none)> | 2010-05-19 10:33:39 -0400 |
|---|---|---|
| committer | Mike Lockwood <lockwood@android.com> | 2010-05-19 12:38:03 -0400 |
| commit | 5bae7f615b6375820f61b28f6792cb2d01aab54b (patch) | |
| tree | 1ec1b1e6ccc4af9a97e1fdc89ad856e6e8fa35ba /media/mtp/MtpDataPacket.cpp | |
| parent | ec4eff80cd18fcfc086698e0a31e1aeda1fe0bcd (diff) | |
| download | frameworks_base-5bae7f615b6375820f61b28f6792cb2d01aab54b.zip frameworks_base-5bae7f615b6375820f61b28f6792cb2d01aab54b.tar.gz frameworks_base-5bae7f615b6375820f61b28f6792cb2d01aab54b.tar.bz2 | |
More work on PTP host support.
Change-Id: Ifbd5bd5efa3cdb750ae1a2aae38181457554d34d
Signed-off-by: Mike Lockwood <mike@spruce.(none)>
Diffstat (limited to 'media/mtp/MtpDataPacket.cpp')
| -rw-r--r-- | media/mtp/MtpDataPacket.cpp | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/media/mtp/MtpDataPacket.cpp b/media/mtp/MtpDataPacket.cpp index 71dcaee..fa086c5 100644 --- a/media/mtp/MtpDataPacket.cpp +++ b/media/mtp/MtpDataPacket.cpp @@ -75,6 +75,70 @@ void MtpDataPacket::getString(MtpStringBuffer& string) string.readFromPacket(this); } +Int8List* MtpDataPacket::getAInt8() { + Int8List* result = new Int8List; + int count = getUInt32(); + for (int i = 0; i < count; i++) + result->push(getInt8()); + return result; +} + +UInt8List* MtpDataPacket::getAUInt8() { + UInt8List* result = new UInt8List; + int count = getUInt32(); + for (int i = 0; i < count; i++) + result->push(getUInt8()); + return result; +} + +Int16List* MtpDataPacket::getAInt16() { + Int16List* result = new Int16List; + int count = getUInt32(); + for (int i = 0; i < count; i++) + result->push(getInt16()); + return result; +} + +UInt16List* MtpDataPacket::getAUInt16() { + UInt16List* result = new UInt16List; + int count = getUInt32(); + for (int i = 0; i < count; i++) + result->push(getUInt16()); + return result; +} + +Int32List* MtpDataPacket::getAInt32() { + Int32List* result = new Int32List; + int count = getUInt32(); + for (int i = 0; i < count; i++) + result->push(getInt32()); + return result; +} + +UInt32List* MtpDataPacket::getAUInt32() { + UInt32List* result = new UInt32List; + int count = getUInt32(); + for (int i = 0; i < count; i++) + result->push(getUInt32()); + return result; +} + +Int64List* MtpDataPacket::getAInt64() { + Int64List* result = new Int64List; + int count = getUInt32(); + for (int i = 0; i < count; i++) + result->push(getInt64()); + return result; +} + +UInt64List* MtpDataPacket::getAUInt64() { + UInt64List* result = new UInt64List; + int count = getUInt32(); + for (int i = 0; i < count; i++) + result->push(getUInt64()); + return result; +} + void MtpDataPacket::putInt8(int8_t value) { allocate(mOffset + 1); mBuffer[mOffset++] = (uint8_t)value; |
