embassy-usb

Crates

git

Versions

default

Flavors

Skip to main content

Module types

Module types 

Source
Expand description

Media Transfer Protocol (MTP / PTP) constants, containers, and datasets.

Modules§

access
Storage access capability codes for StorageInfo.
assoc
Association type codes for ObjectInfo when object_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§

CommandBlock
Decoded MTP Command container (Bulk OUT).
ContainerHeader
12-byte MTP / PTP generic container header.
DeviceInfo
MTP DeviceInfo dataset returned by op::GET_DEVICE_INFO.
EventBlock
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.
ObjectInfo
MTP ObjectInfo dataset used by op::GET_OBJECT_INFO and op::SEND_OBJECT_INFO.
ResponseBlock
MTP Response container (Bulk IN).
StorageInfo
MTP StorageInfo dataset returned by op::GET_STORAGE_INFO.

Enums§

ContainerType
MTP / PTP container type.
MtpError
Errors produced by MTP transport, container framing, and dataset codecs.

Constants§

ASSOC_ROOT_ONLY
Special ParentObject parameter requesting only root-level objects in GetObjectHandles.
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 ObjectFormat matching all formats in GetNumObjects / GetObjectHandles.
MAX_COMMAND_LEN
Maximum length of an MTP Command container (12-byte header + up to five u32 parameters).
MAX_EVENT_LEN
Maximum length of an MTP Event container (12-byte header + up to three u32 parameters).
MAX_RESPONSE_LEN
Maximum length of an MTP Response container (12-byte header + up to five u32 parameters).
PARENT_ALL
Special ParentObject parameter indicating all objects regardless of hierarchy.
PARENT_ROOT
Special ParentObject handle 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 StorageID matching all storages in GetNumObjects / GetObjectHandles.
STREAMING_CONTAINER_LEN
Sentinel ContainerLength used when a Data container payload exceeds u32::MAX - 12 or 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).