#[repr(u16)]pub enum OperationCode {
Show 38 variants
GetDeviceInfo = 4_097,
OpenSession = 4_098,
CloseSession = 4_099,
GetStorageIds = 4_100,
GetStorageInfo = 4_101,
GetNumObjects = 4_102,
GetObjectHandles = 4_103,
GetObjectInfo = 4_104,
GetObject = 4_105,
GetThumb = 4_106,
DeleteObject = 4_107,
SendObjectInfo = 4_108,
SendObject = 4_109,
InitiateCapture = 4_110,
FormatStore = 4_111,
ResetDevice = 4_112,
SelfTest = 4_113,
SetObjectProtection = 4_114,
PowerDown = 4_115,
GetDevicePropDesc = 4_116,
GetDevicePropValue = 4_117,
SetDevicePropValue = 4_118,
ResetDevicePropValue = 4_119,
TerminateOpenCapture = 4_120,
MoveObject = 4_121,
CopyObject = 4_122,
GetPartialObject = 4_123,
InitiateOpenCapture = 4_124,
GetObjectPropsSupported = 38_913,
GetObjectPropDesc = 38_914,
GetObjectPropValue = 38_915,
SetObjectPropValue = 38_916,
GetObjectPropList = 38_917,
SetObjectPropList = 38_918,
GetObjectReferences = 38_928,
SetObjectReferences = 38_929,
GetPartialObject64 = 38_337,
Unknown(u16),
}Expand description
PTP operation codes (commands sent to device).
These codes identify the operation being requested in a PTP command container.
Variants§
GetDeviceInfo = 4_097
Get device information (capabilities, manufacturer, etc.).
OpenSession = 4_098
Open a session with the device.
CloseSession = 4_099
Close the current session.
GetStorageIds = 4_100
Get list of storage IDs.
GetStorageInfo = 4_101
Get information about a storage.
GetNumObjects = 4_102
Get the number of objects in a storage/folder.
GetObjectHandles = 4_103
Get list of object handles.
GetObjectInfo = 4_104
Get information about an object.
GetObject = 4_105
Download an object’s data.
GetThumb = 4_106
Get thumbnail for an object.
DeleteObject = 4_107
Delete an object.
SendObjectInfo = 4_108
Send object metadata (before sending object data).
SendObject = 4_109
Send object data (after SendObjectInfo).
InitiateCapture = 4_110
Initiate image capture on a camera.
FormatStore = 4_111
Format (erase) a storage.
ResetDevice = 4_112
Reset the device to its default state, closing all sessions.
SelfTest = 4_113
Run a device self-test.
SetObjectProtection = 4_114
Set the write/delete protection status of an object.
PowerDown = 4_115
Power down the device.
GetDevicePropDesc = 4_116
Get device property descriptor.
GetDevicePropValue = 4_117
Get current device property value.
SetDevicePropValue = 4_118
Set device property value.
ResetDevicePropValue = 4_119
Reset device property to default value.
TerminateOpenCapture = 4_120
Terminate an open capture session.
MoveObject = 4_121
Move an object to a different location.
CopyObject = 4_122
Copy an object.
GetPartialObject = 4_123
Get partial object data (range request). Offset is u32, so capped at 4 GB.
InitiateOpenCapture = 4_124
Initiate an open-ended capture session.
GetObjectPropsSupported = 38_913
Get the object properties the device supports for a format (MTP extension).
GetObjectPropDesc = 38_914
Get an object property descriptor (MTP extension).
GetObjectPropValue = 38_915
Get the value of an object property (MTP extension).
SetObjectPropValue = 38_916
Set the value of an object property (MTP extension).
GetObjectPropList = 38_917
Get a list of object properties in one call (MTP extension).
SetObjectPropList = 38_918
Set a list of object properties in one call (MTP extension).
GetObjectReferences = 38_928
Get the references (associations) of an object (MTP extension).
SetObjectReferences = 38_929
Set the references (associations) of an object (MTP extension).
GetPartialObject64 = 38_337
Get partial object data with 64-bit offset (Android/MTP extension). Supports files larger than 4 GB. Parameters: handle, offset_lo, offset_hi, max_bytes.
Unknown(u16)
Unknown or vendor-specific operation code.
Trait Implementations§
Source§impl Clone for OperationCode
impl Clone for OperationCode
Source§fn clone(&self) -> OperationCode
fn clone(&self) -> OperationCode
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for OperationCode
Source§impl Debug for OperationCode
impl Debug for OperationCode
impl Eq for OperationCode
Source§impl From<OperationCode> for u16
impl From<OperationCode> for u16
Source§fn from(enum_value: OperationCode) -> Self
fn from(enum_value: OperationCode) -> Self
Source§impl From<u16> for OperationCode
impl From<u16> for OperationCode
Source§impl FromPrimitive for OperationCode
impl FromPrimitive for OperationCode
Source§impl Hash for OperationCode
impl Hash for OperationCode
Source§impl PartialEq for OperationCode
impl PartialEq for OperationCode
Source§fn eq(&self, other: &OperationCode) -> bool
fn eq(&self, other: &OperationCode) -> bool
self and other values to be equal, and is used by ==.