--- title: "PTP reference" description: "Every PTP operation, property, event, response, format, datatype and dataset Slate defines, for the standard and for each camera maker." url: https://darkgrade.com/docs/slate/ptp-reference last_updated: 2026-12-04 docs_index: https://darkgrade.com/docs/llms.txt --- # PTP reference > Every PTP operation, property, event, response, format, datatype and dataset Slate defines, for the standard and for each camera maker. > ## Documentation Index > Fetch the complete documentation index at: https://darkgrade.com/docs/llms.txt > Use this file to discover all available pages before exploring further. Look up any PTP code Slate knows: what it means, how its value is laid out, and which [`Camera`](https://darkgrade.com/docs/slate/getting_started/camera.md) method or setting uses it. The pages are generated from Slate's own definitions, so they match what the code sends. You do not need this reference to use Slate: `Camera` covers every supported operation by name. Use it when you read a protocol trace, see a raw code in an error, or send commands yourself. New to the protocol? Start with [What is PTP?](https://darkgrade.com/docs/slate/getting_started/what-is-ptp.md). ## Find a code | Maker | Definitions | | - | - | | **Standard** | [45 properties](https://darkgrade.com/docs/slate/ptp-reference/property-definitions.md) · [42 operations](https://darkgrade.com/docs/slate/ptp-reference/operation-definitions.md) · [15 events](https://darkgrade.com/docs/slate/ptp-reference/event-definitions.md) · [36 responses](https://darkgrade.com/docs/slate/ptp-reference/response-definitions.md) · [31 formats](https://darkgrade.com/docs/slate/ptp-reference/format-definitions.md) | | **Canon** | [51 properties](https://darkgrade.com/docs/slate/ptp-reference/vendors/canon/canon-property-definitions.md) · [31 operations](https://darkgrade.com/docs/slate/ptp-reference/vendors/canon/canon-operation-definitions.md) · [5 events](https://darkgrade.com/docs/slate/ptp-reference/vendors/canon/canon-event-definitions.md) · [1 response](https://darkgrade.com/docs/slate/ptp-reference/vendors/canon/canon-response-definitions.md) | | **Sony** | [64 properties](https://darkgrade.com/docs/slate/ptp-reference/vendors/sony/sony-property-definitions.md) · [14 operations](https://darkgrade.com/docs/slate/ptp-reference/vendors/sony/sony-operation-definitions.md) · [41 events](https://darkgrade.com/docs/slate/ptp-reference/vendors/sony/sony-event-definitions.md) · [6 responses](https://darkgrade.com/docs/slate/ptp-reference/vendors/sony/sony-response-definitions.md) · [4 formats](https://darkgrade.com/docs/slate/ptp-reference/vendors/sony/sony-format-definitions.md) | | **Nikon** | [11 properties](https://darkgrade.com/docs/slate/ptp-reference/vendors/nikon/nikon-property-definitions.md) · [22 format properties](https://darkgrade.com/docs/slate/ptp-reference/vendors/nikon/nikon-format-property-definitions.md) · [26 shooting properties](https://darkgrade.com/docs/slate/ptp-reference/vendors/nikon/nikon-shooting-property-definitions.md) · [35 operations](https://darkgrade.com/docs/slate/ptp-reference/vendors/nikon/nikon-operation-definitions.md) · [9 events](https://darkgrade.com/docs/slate/ptp-reference/vendors/nikon/nikon-event-definitions.md) · [8 responses](https://darkgrade.com/docs/slate/ptp-reference/vendors/nikon/nikon-response-definitions.md) | | **Fujifilm** | [39 properties](https://darkgrade.com/docs/slate/ptp-reference/vendors/fujifilm/fujifilm-property-definitions.md) · [1 operation](https://darkgrade.com/docs/slate/ptp-reference/vendors/fujifilm/fujifilm-operation-definitions.md) | | **Panasonic** | [10 operations](https://darkgrade.com/docs/slate/ptp-reference/vendors/panasonic/panasonic-operation-definitions.md) | | **Olympus** | [7 operations](https://darkgrade.com/docs/slate/ptp-reference/vendors/olympus/olympus-operation-definitions.md) | | **Leica** | [2 operations](https://darkgrade.com/docs/slate/ptp-reference/vendors/leica/leica-operation-definitions.md) | | **Sigma** | [5 operations](https://darkgrade.com/docs/slate/ptp-reference/vendors/sigma/sigma-operation-definitions.md) | Slate has drivers for Sony, Canon and Nikon. For Fujifilm, Panasonic, Olympus, Leica and Sigma, these are the codes Slate knows by name: a camera from any other brand opens with the standard PTP driver, which sends none of them. See [Other brands](https://darkgrade.com/docs/slate/getting_started/camera-compatibility.md#other-brands). Have only a number from a trace or an error? The [PTP code lookup](https://darkgrade.com/docs/slate/ptp-reference/code-index.md) lists all 532 codes in numeric order, with every maker's meaning of each. Also: [Datatypes](https://darkgrade.com/docs/slate/ptp-reference/datatype-definitions.md) · [Vendor IDs](https://darkgrade.com/docs/slate/ptp-reference/vendor-ids.md) · [Datasets](#datasets) · [Types](#types) Each kind of code has its own range, so a code's first digit usually says what it is: | Kind | Codes | | - | - | | Operation | `0x1000`–`0x1fff` standard, `0x9000`–`0x9fff` vendor | | Response | `0x2000`–`0x2fff` standard, `0xa000`–`0xafff` vendor | | Format | `0x3000`–`0x3fff` standard, `0xb000`–`0xbfff` vendor | | Event | `0x4000`–`0x4fff` standard, `0xc000`–`0xcfff` vendor | | Property | `0x5000`–`0x5fff` standard, `0xd000`–`0xdfff` vendor | Vendor codes overlap between makers, which is why each maker has its own pages. A few codes sit outside these ranges: the MTP object-property operations (`0x9801`–`0x9805`) are listed with the standard operations, Sony has properties at `0xe0xx`, and some Nikon properties have 32-bit codes from `0x1d000`, read with [GetDevicePropDescEx](https://darkgrade.com/docs/slate/ptp-reference/vendors/nikon/nikon-operation-definitions.md#getdevicepropdescex-0x943a). ## Send a command yourself Raw commands go through `protocolSession(camera)`, which shares the camera's open session. See [Protocol access](https://darkgrade.com/docs/slate/getting_started/camera.md#protocol-access). ```typescript import { Camera } from '@darkgrade/slate' import { genericOperationRegistry, protocolSession, } from '@darkgrade/slate/protocol' const camera = new Camera() await camera.connect() const session = protocolSession(camera) const reply = await session.send(genericOperationRegistry.GetDeviceInfo, {}) console.log(reply.code, reply.data) ``` ## The pieces ### Operations An operation is one command from the computer to the camera: an operation code and up to five parameters, an optional data phase in one direction, then a response code with up to five parameters. [GetDeviceInfo](https://darkgrade.com/docs/slate/ptp-reference/operation-definitions.md#getdeviceinfo-0x1001) asks the camera what it is; [GetObject](https://darkgrade.com/docs/slate/ptp-reference/operation-definitions.md#getobject-0x1009) downloads a file. ### Responses A response code ends every operation. `OK` is `0x2001`; anything else says why the operation did not happen. See [Standard responses](https://darkgrade.com/docs/slate/ptp-reference/response-definitions.md). ### Properties A device property is one numbered value on the camera, such as ISO or battery level. [GetDevicePropDesc](https://darkgrade.com/docs/slate/ptp-reference/operation-definitions.md#getdevicepropdesc-0x1014) describes one (its datatype, current value and allowed values) as a [DevicePropDesc](https://darkgrade.com/docs/slate/ptp-reference/datasets/device-prop-desc-dataset.md); [GetDevicePropValue](https://darkgrade.com/docs/slate/ptp-reference/operation-definitions.md#getdevicepropvalue-0x1015) and [SetDevicePropValue](https://darkgrade.com/docs/slate/ptp-reference/operation-definitions.md#setdevicepropvalue-0x1016) read and write it. Makers add their own operations for their own properties. ### Events An event is a message the camera sends on its own: [ObjectAdded](https://darkgrade.com/docs/slate/ptp-reference/event-definitions.md#objectadded-0x4002) when a file is written, [DevicePropChanged](https://darkgrade.com/docs/slate/ptp-reference/event-definitions.md#devicepropchanged-0x4006) when a setting changes. Each carries up to three parameters. ### Formats An object format code says what kind of file an object is: a JPEG, a movie, a folder. See [Standard formats](https://darkgrade.com/docs/slate/ptp-reference/format-definitions.md). ### Datatypes A datatype code says how a value is laid out in bytes: signed and unsigned integers of 8 to 128 bits, arrays of them, and strings. See [Datatypes](https://darkgrade.com/docs/slate/ptp-reference/datatype-definitions.md). ### Datasets A dataset is a structured block of bytes in an operation's data phase. Slate decodes each one into an object. | Dataset | What it holds | | - | - | | [VariableValue](https://darkgrade.com/docs/slate/ptp-reference/datasets/codecs/variable-value-codec.md) | A value whose layout depends on a datatype code, as the default, current and allowed values of a DevicePropDesc are. | | [DeviceInfo](https://darkgrade.com/docs/slate/ptp-reference/datasets/device-info-dataset.md) | What a camera says about itself: its model, firmware version, and the operations, events, properties and formats it supports. | | [DevicePropDesc](https://darkgrade.com/docs/slate/ptp-reference/datasets/device-prop-desc-dataset.md) | One device property described in full: its datatype, access, current and default value, and the values the camera accepts now. | | [ObjectInfo](https://darkgrade.com/docs/slate/ptp-reference/datasets/object-info-dataset.md) | One object on the card described: its format, size, pixel dimensions, file name, capture date and parent folder. | | [StorageInfo](https://darkgrade.com/docs/slate/ptp-reference/datasets/storage-info-dataset.md) | One store described (a memory card): its capacity, free space in bytes and in images, and its label. | #### Vendor datasets (12) | Dataset | Used by | | - | - | | [`CanonEventRecord`](https://darkgrade.com/docs/slate/ptp-reference/datasets/vendors/canon/canon-event-data-dataset.md) | [`CanonGetEventData`](https://darkgrade.com/docs/slate/ptp-reference/vendors/canon/canon-operation-definitions.md#canongeteventdata-0x9116) | | [`CanonExtendedDeviceInfo`](https://darkgrade.com/docs/slate/ptp-reference/datasets/vendors/canon/canon-extended-device-info-dataset.md) | [`CanonGetExtendedDeviceInfo`](https://darkgrade.com/docs/slate/ptp-reference/vendors/canon/canon-operation-definitions.md#canongetextendeddeviceinfo-0x9108) | | [`CanonImageFormat`](https://darkgrade.com/docs/slate/ptp-reference/datasets/vendors/canon/canon-image-format-dataset.md) | [`CanonImageFormat`](https://darkgrade.com/docs/slate/ptp-reference/vendors/canon/canon-property-definitions.md#canonimageformat-0xd120), [`CanonImageFormatSd`](https://darkgrade.com/docs/slate/ptp-reference/vendors/canon/canon-property-definitions.md#canonimageformatsd-0xd122) | | [`CanonLiveViewFrame`](https://darkgrade.com/docs/slate/ptp-reference/datasets/vendors/canon/canon-live-view-dataset.md) | [`CanonGetViewfinderData`](https://darkgrade.com/docs/slate/ptp-reference/vendors/canon/canon-operation-definitions.md#canongetviewfinderdata-0x9153) | | [`CanonMovieFormat`](https://darkgrade.com/docs/slate/ptp-reference/datasets/vendors/canon/canon-movie-format-dataset.md) | [`CanonMovieFormat`](https://darkgrade.com/docs/slate/ptp-reference/vendors/canon/canon-property-definitions.md#canonmovieformat-0xd1cd) | | [`CanonMovieRecordValue`](https://darkgrade.com/docs/slate/ptp-reference/datasets/vendors/canon/canon-movie-record-dataset.md) | [`CanonMovieRecord`](https://darkgrade.com/docs/slate/ptp-reference/vendors/canon/canon-property-definitions.md#canonmovierecord-0xd29e) | | [`SonyExtendedDeviceInfo`](https://darkgrade.com/docs/slate/ptp-reference/datasets/vendors/sony/sdi-ext-device-info-dataset.md) | [`SDIO_GetExtDeviceInfo`](https://darkgrade.com/docs/slate/ptp-reference/vendors/sony/sony-operation-definitions.md#sdio_getextdeviceinfo-0x9202) | | [`SonyDevicePropDesc`](https://darkgrade.com/docs/slate/ptp-reference/datasets/vendors/sony/sdi-ext-device-prop-info-dataset.md) | [`SDIO_GetAllExtDevicePropInfo`](https://darkgrade.com/docs/slate/ptp-reference/vendors/sony/sony-operation-definitions.md#sdio_getallextdevicepropinfo-0x9209), [`SDIO_GetExtDevicePropValue`](https://darkgrade.com/docs/slate/ptp-reference/vendors/sony/sony-operation-definitions.md#sdio_getextdevicepropvalue-0x9251) | | [`Sony LiveViewDataset`](https://darkgrade.com/docs/slate/ptp-reference/datasets/vendors/sony/sony-live-view-dataset.md) | [`GetObject`](https://darkgrade.com/docs/slate/ptp-reference/operation-definitions.md#getobject-0x1009) | | [`Sony OsdImageDataset`](https://darkgrade.com/docs/slate/ptp-reference/datasets/vendors/sony/sony-osd-image-dataset.md) | [`SDIO_GetOsdImage`](https://darkgrade.com/docs/slate/ptp-reference/vendors/sony/sony-operation-definitions.md#sdio_getosdimage-0x9238) | | [`NikonQueuedEvent`](https://darkgrade.com/docs/slate/ptp-reference/datasets/vendors/nikon/nikon-event-list-dataset.md) | [`GetEvent`](https://darkgrade.com/docs/slate/ptp-reference/vendors/nikon/nikon-operation-definitions.md#getevent-0x90c7) | | [`NikonLiveViewDataset`](https://darkgrade.com/docs/slate/ptp-reference/datasets/vendors/nikon/nikon-live-view-dataset.md) | [`GetLiveViewImageEx`](https://darkgrade.com/docs/slate/ptp-reference/vendors/nikon/nikon-operation-definitions.md#getliveviewimageex-0x9428) | ### Types The TypeScript shapes the definitions are written in: [codec](https://darkgrade.com/docs/slate/ptp-reference/types/codec.md), [datatype](https://darkgrade.com/docs/slate/ptp-reference/types/datatype.md), [event](https://darkgrade.com/docs/slate/ptp-reference/types/event.md), [format](https://darkgrade.com/docs/slate/ptp-reference/types/format.md), [operation](https://darkgrade.com/docs/slate/ptp-reference/types/operation.md), [parameter](https://darkgrade.com/docs/slate/ptp-reference/types/parameter.md), [property](https://darkgrade.com/docs/slate/ptp-reference/types/property.md), [response](https://darkgrade.com/docs/slate/ptp-reference/types/response.md), [type-helpers](https://darkgrade.com/docs/slate/ptp-reference/types/type-helpers.md). ## Identifiers Parameters with these names mean the same thing in every operation and event. ### StorageID A `uint32` that names one store on the camera, such as a memory card. [GetStorageIDs](https://darkgrade.com/docs/slate/ptp-reference/operation-definitions.md#getstorageids-0x1004) lists the valid ones and [GetStorageInfo](https://darkgrade.com/docs/slate/ptp-reference/operation-definitions.md#getstorageinfo-0x1005) describes one as a [StorageInfo](https://darkgrade.com/docs/slate/ptp-reference/datasets/storage-info-dataset.md). [StoreAdded](https://darkgrade.com/docs/slate/ptp-reference/event-definitions.md#storeadded-0x4004) and [StoreRemoved](https://darkgrade.com/docs/slate/ptp-reference/event-definitions.md#storeremoved-0x4005) carry the StorageID of a store that was added or removed. Where an operation filters by store, `0xFFFFFFFF` means all stores. In Slate, [`getCardStatus()`](https://darkgrade.com/docs/functionality/media.md#card-space) reads the stores for you. ### ObjectHandle A `uint32` that names one object on the camera: a photo, a clip or a folder. [GetObjectHandles](https://darkgrade.com/docs/slate/ptp-reference/operation-definitions.md#getobjecthandles-0x1007) lists them, [GetObjectInfo](https://darkgrade.com/docs/slate/ptp-reference/operation-definitions.md#getobjectinfo-0x1008) describes one as an [ObjectInfo](https://darkgrade.com/docs/slate/ptp-reference/datasets/object-info-dataset.md), and [GetThumb](https://darkgrade.com/docs/slate/ptp-reference/operation-definitions.md#getthumb-0x100a), [GetObject](https://darkgrade.com/docs/slate/ptp-reference/operation-definitions.md#getobject-0x1009) and [GetPartialObject](https://darkgrade.com/docs/slate/ptp-reference/operation-definitions.md#getpartialobject-0x101b) read its bytes. [ObjectAdded](https://darkgrade.com/docs/slate/ptp-reference/event-definitions.md#objectadded-0x4002) carries the handle of a new file. An ObjectInfo's `parentObject` is the handle of the folder it is in. In Slate, [`listMedia()`](https://darkgrade.com/docs/functionality/media.md#list-photos-and-clips) and [`downloadMedia()`](https://darkgrade.com/docs/functionality/media.md#download-a-file) do this for you. ### ObjectFormatCode A [format code](https://darkgrade.com/docs/slate/ptp-reference/format-definitions.md) used as a filter or a description: [GetObjectHandles](https://darkgrade.com/docs/slate/ptp-reference/operation-definitions.md#getobjecthandles-0x1007) takes it as an optional filter (default `0`), and an [ObjectInfo](https://darkgrade.com/docs/slate/ptp-reference/datasets/object-info-dataset.md) carries its object's format as `objectFormat`. ### DevicePropCode The code of a device property: one from the [standard properties](https://darkgrade.com/docs/slate/ptp-reference/property-definitions.md) or from the camera maker's own pages. [DevicePropChanged](https://darkgrade.com/docs/slate/ptp-reference/event-definitions.md#devicepropchanged-0x4006) carries the code of the property that changed. ### SessionID and TransactionID [OpenSession](https://darkgrade.com/docs/slate/ptp-reference/operation-definitions.md#opensession-0x1002) starts a session with a SessionID the computer chooses; every operation after it is one transaction, numbered by a TransactionID that the data phase and the response repeat. Slate opens the session in `connect()` and numbers transactions for you.