Lines Matching refs:packet

130 bool MtpProperty::read(MtpDataPacket& packet) {  in read()  argument
133 if (!packet.getUInt16(mCode)) return false; in read()
135 if (!packet.getUInt16(mType)) return false; in read()
136 if (!packet.getUInt8(temp8)) return false; in read()
149 mDefaultArrayValues = readArrayValues(packet, mDefaultArrayLength); in read()
152 mCurrentArrayValues = readArrayValues(packet, mCurrentArrayLength); in read()
157 if (!readValue(packet, mDefaultValue)) return false; in read()
159 if (!readValue(packet, mCurrentValue)) return false; in read()
163 if (!packet.getUInt32(mGroupCode)) return false; in read()
165 if (!packet.getUInt8(mFormFlag)) return false; in read()
168 if (!readValue(packet, mMinimumValue)) return false; in read()
169 if (!readValue(packet, mMaximumValue)) return false; in read()
170 if (!readValue(packet, mStepSize)) return false; in read()
172 if (!packet.getUInt16(mEnumLength)) return false; in read()
175 if (!readValue(packet, mEnumValues[i])) return false; in read()
182 void MtpProperty::write(MtpDataPacket& packet) { in write() argument
185 packet.putUInt16(mCode); in write()
186 packet.putUInt16(mType); in write()
187 packet.putUInt8(mWriteable ? 1 : 0); in write()
200 writeArrayValues(packet, mDefaultArrayValues, mDefaultArrayLength); in write()
202 writeArrayValues(packet, mCurrentArrayValues, mCurrentArrayLength); in write()
205 writeValue(packet, mDefaultValue); in write()
207 writeValue(packet, mCurrentValue); in write()
210 packet.putUInt32(mGroupCode); in write()
211 packet.putUInt8(mFormFlag); in write()
213 writeValue(packet, mMinimumValue); in write()
214 writeValue(packet, mMaximumValue); in write()
215 writeValue(packet, mStepSize); in write()
217 packet.putUInt16(mEnumLength); in write()
219 writeValue(packet, mEnumValues[i]); in write()
243 void MtpProperty::setCurrentValue(MtpDataPacket& packet) { in setCurrentValue() argument
246 readValue(packet, mCurrentValue); in setCurrentValue()
438 bool MtpProperty::readValue(MtpDataPacket& packet, MtpPropertyValue& value) { in readValue() argument
444 if (!packet.getInt8(value.u.i8)) return false; in readValue()
448 if (!packet.getUInt8(value.u.u8)) return false; in readValue()
452 if (!packet.getInt16(value.u.i16)) return false; in readValue()
456 if (!packet.getUInt16(value.u.u16)) return false; in readValue()
460 if (!packet.getInt32(value.u.i32)) return false; in readValue()
464 if (!packet.getUInt32(value.u.u32)) return false; in readValue()
468 if (!packet.getInt64(value.u.i64)) return false; in readValue()
472 if (!packet.getUInt64(value.u.u64)) return false; in readValue()
476 if (!packet.getInt128(value.u.i128)) return false; in readValue()
480 if (!packet.getUInt128(value.u.u128)) return false; in readValue()
483 if (!packet.getString(stringBuffer)) return false; in readValue()
493 void MtpProperty::writeValue(MtpDataPacket& packet, MtpPropertyValue& value) { in writeValue() argument
499 packet.putInt8(value.u.i8); in writeValue()
503 packet.putUInt8(value.u.u8); in writeValue()
507 packet.putInt16(value.u.i16); in writeValue()
511 packet.putUInt16(value.u.u16); in writeValue()
515 packet.putInt32(value.u.i32); in writeValue()
519 packet.putUInt32(value.u.u32); in writeValue()
523 packet.putInt64(value.u.i64); in writeValue()
527 packet.putUInt64(value.u.u64); in writeValue()
531 packet.putInt128(value.u.i128); in writeValue()
535 packet.putUInt128(value.u.u128); in writeValue()
539 packet.putString(value.str); in writeValue()
541 packet.putEmptyString(); in writeValue()
548 MtpPropertyValue* MtpProperty::readArrayValues(MtpDataPacket& packet, uint32_t& length) { in readArrayValues() argument
549 if (!packet.getUInt32(length)) return NULL; in readArrayValues()
561 if (!readValue(packet, result[i])) { in readArrayValues()
568 void MtpProperty::writeArrayValues(MtpDataPacket& packet, MtpPropertyValue* values, uint32_t length… in writeArrayValues() argument
569 packet.putUInt32(length); in writeArrayValues()
571 writeValue(packet, values[i]); in writeArrayValues()