Expand description
Media Transfer Protocol (MTP / PTP) constants, containers, and datasets.
Modules§
- access
- Storage access capability codes for
StorageInfo. - assoc
- Association type codes for
ObjectInfowhenobject_format == format::ASSOCIATION. - dev_
prop - Standard MTP device property codes.
- event
- MTP / PTP asynchronous event codes (
EventCode). - format
- MTP / PTP object format codes (
ObjectFormatCode). - fs_type
- Filesystem hierarchy type codes for
StorageInfo. - obj_
prop - Standard MTP object property codes.
- op
- MTP / PTP operation codes (
OperationCode). - resp
- MTP / PTP response codes (
ResponseCode). - storage_
type - Storage media type codes for
StorageInfo.
Structs§
- Command
Block - Decoded MTP Command container (Bulk OUT).
- Container
Header - 12-byte MTP / PTP generic container header.
- Device
Info - MTP
DeviceInfodataset returned byop::GET_DEVICE_INFO. - Event
Block - MTP asynchronous Event container (Interrupt IN).
- MtpReader
- Cursor-based deserializer for little-endian MTP/PTP datasets and UTF-16LE strings.
- MtpWriter
- Cursor-based serializer for little-endian MTP/PTP datasets and UTF-16LE strings.
- Object
Info - MTP
ObjectInfodataset used byop::GET_OBJECT_INFOandop::SEND_OBJECT_INFO. - Response
Block - MTP Response container (Bulk IN).
- Storage
Info - MTP
StorageInfodataset returned byop::GET_STORAGE_INFO.
Enums§
- Container
Type - MTP / PTP container type.
- MtpError
- Errors produced by MTP transport, container framing, and dataset codecs.
Constants§
- ASSOC_
ROOT_ ONLY - Special
ParentObjectparameter requesting only root-level objects inGetObjectHandles. - CANCEL_
CODE_ CANCELLATION - Cancellation code carried in the first 2 bytes of
REQ_CANCEL. - CONTAINER_
HEADER_ LEN - Length of an MTP/PTP container header in bytes.
- FORMAT_
ALL - Special
ObjectFormatmatching all formats inGetNumObjects/GetObjectHandles. - MAX_
COMMAND_ LEN - Maximum length of an MTP Command container (12-byte header + up to five
u32parameters). - MAX_
EVENT_ LEN - Maximum length of an MTP Event container (12-byte header + up to three
u32parameters). - MAX_
RESPONSE_ LEN - Maximum length of an MTP Response container (12-byte header + up to five
u32parameters). - PARENT_
ALL - Special
ParentObjectparameter indicating all objects regardless of hierarchy. - PARENT_
ROOT - Special
ParentObjecthandle indicating the root folder of a storage. - REQ_
CANCEL - Class-specific control request: Cancel the current transaction (OUT, 6 bytes).
- REQ_
GET_ DEVICE_ STATUS - Class-specific control request: Get device status (IN, 4+ bytes).
- REQ_
GET_ EXT_ EVENT_ DATA - Class-specific control request: Get extended event data (IN).
- REQ_
RESET - Class-specific control request: Reset the MTP device transport state (OUT, 0 bytes).
- STANDARD_
VERSION_ 1_ 0 - Standard PTP/PIMA 15740 version reported in
DeviceInfo(100= 1.00). - STORAGE_
ALL - Special
StorageIDmatching all storages inGetNumObjects/GetObjectHandles. - STREAMING_
CONTAINER_ LEN - Sentinel
ContainerLengthused when a Data container payload exceedsu32::MAX - 12or its length is unknown upfront (streaming until short packet / ZLP). - USB_
CLASS_ STILL_ IMAGE - USB interface class code for Still Image Capture Devices (used by PTP/MTP).
- USB_
PROTOCOL_ MTP - USB interface protocol code for PTP/MTP Bulk-Only transport.
- USB_
SUBCLASS_ STILL_ IMAGE - USB interface subclass code for Still Image Capture Devices.
- VENDOR_
EXT_ DESC_ MICROSOFT_ MTP - Standard Microsoft MTP vendor extension description string.
- VENDOR_
EXT_ ID_ MICROSOFT_ MTP - Microsoft MTP vendor extension ID reported in
DeviceInfo. - VENDOR_
EXT_ VERSION_ MTP_ 1_ 0 - Standard Microsoft MTP vendor extension version (
100= 1.00).