Lines Matching refs:offset
94 uint16_t MtpPacket::getUInt16(int offset) const { in getUInt16()
95 if ((unsigned long)(offset+2) <= mBufferSize) { in getUInt16()
96 return ((uint16_t)mBuffer[offset + 1] << 8) | (uint16_t)mBuffer[offset]; in getUInt16()
104 uint32_t MtpPacket::getUInt32(int offset) const { in getUInt32()
105 if ((unsigned long)(offset+4) <= mBufferSize) { in getUInt32()
106 return ((uint32_t)mBuffer[offset + 3] << 24) | ((uint32_t)mBuffer[offset + 2] << 16) | in getUInt32()
107 ((uint32_t)mBuffer[offset + 1] << 8) | (uint32_t)mBuffer[offset]; in getUInt32()
115 void MtpPacket::putUInt16(int offset, uint16_t value) { in putUInt16() argument
116 if ((unsigned long)(offset+2) <= mBufferSize) { in putUInt16()
117 mBuffer[offset++] = (uint8_t)(value & 0xFF); in putUInt16()
118 mBuffer[offset++] = (uint8_t)((value >> 8) & 0xFF); in putUInt16()
125 void MtpPacket::putUInt32(int offset, uint32_t value) { in putUInt32() argument
126 if ((unsigned long)(offset+4) <= mBufferSize) { in putUInt32()
127 mBuffer[offset++] = (uint8_t)(value & 0xFF); in putUInt32()
128 mBuffer[offset++] = (uint8_t)((value >> 8) & 0xFF); in putUInt32()
129 mBuffer[offset++] = (uint8_t)((value >> 16) & 0xFF); in putUInt32()
130 mBuffer[offset++] = (uint8_t)((value >> 24) & 0xFF); in putUInt32()
170 int offset = MTP_CONTAINER_PARAMETER_OFFSET + (index - 1) * sizeof(uint32_t); in setParameter() local
171 if (mPacketSize < offset + sizeof(uint32_t)) in setParameter()
172 mPacketSize = offset + sizeof(uint32_t); in setParameter()
173 putUInt32(offset, value); in setParameter()