pict
Documentation for pict is still a work-in-progress
 
Loading...
Searching...
No Matches
ptp.h
Go to the documentation of this file.
1
2// This file describes Picture Transfer Protocol (ISO 15740)
3// And many vendor opcodes, property codes, and event codes.
4
5#ifndef PTP_H
6#define PTP_H
7
8#include <stdint.h>
9
10#pragma pack(push, 1)
11
12// PTP Packet container types
13#define PTP_PACKET_TYPE_COMMAND 0x1
14#define PTP_PACKET_TYPE_DATA 0x2
15#define PTP_PACKET_TYPE_RESPONSE 0x3
16#define PTP_PACKET_TYPE_EVENT 0x4
17
18// Standard USB-only packet
20 uint32_t length; // length of packet, in bytes
21 uint16_t type; // See PACKET_TYPE_*
22 uint16_t code; // See PTP_OC_*
23 uint32_t transaction;
24
25 // Parameters are only included in command packets,
26 // It is typically considered a part of payload in data packets
27 uint32_t params[5];
28
29 // Payload data follows, if any
30};
31
33 uint32_t length;
34 uint16_t type;
35 uint16_t code;
36 uint32_t transaction;
37
38 uint32_t params[3];
39};
40
42 uint32_t length;
43 uint32_t type;
44 uint32_t params[3];
45};
46
48 uint32_t length;
49 uint32_t type;
50 uint32_t data_phase;
51 uint16_t code;
52 uint32_t transaction;
53 uint32_t params[5];
54};
55
57 uint32_t length;
58 uint32_t type;
59 uint16_t code;
60 uint32_t transaction;
61 uint32_t params[5];
62};
63
65 uint32_t length;
66 uint32_t type;
67 uint32_t transaction;
68 uint64_t payload_length;
69};
70
72 uint32_t length;
73 uint32_t type;
74 uint32_t transaction;
75};
76
78 uint32_t length;
79 uint32_t type;
80 uint32_t guid1;
81 uint32_t guid2;
82 uint32_t guid3;
83 uint32_t guid4;
84 char device_name[8]; // Size ??
85 uint16_t major_ver;
86 uint16_t minor_ver;
87};
88
89// Standard PTP Operation Codes (OC)
90#define PTP_OC_GetDeviceInfo 0x1001
91#define PTP_OC_OpenSession 0x1002
92#define PTP_OC_CloseSession 0x1003
93#define PTP_OC_GetStorageIDs 0x1004
94#define PTP_OC_GetStorageInfo 0x1005
95#define PTP_OC_GetNumObjects 0x1006
96#define PTP_OC_GetObjectHandles 0x1007
97#define PTP_OC_GetObjectInfo 0x1008
98#define PTP_OC_GetObject 0x1009
99#define PTP_OC_GetThumb 0x100A
100#define PTP_OC_DeleteObject 0x100B
101#define PTP_OC_SendObjectInfo 0x100C
102#define PTP_OC_SendObject 0x100D
103#define PTP_OC_InitiateCapture 0x100E
104#define PTP_OC_FormatStore 0x100F
105#define PTP_OC_ResetDevice 0x1010
106#define PTP_OC_SelfTest 0x1011
107#define PTP_OC_SetObjectProtection 0x1012
108#define PTP_OC_PowerDown 0x1013
109#define PTP_OC_GetDevicePropDesc 0x1014
110#define PTP_OC_GetDevicePropValue 0x1015
111#define PTP_OC_SetDevicePropValue 0x1016
112#define PTP_OC_ResetDevicePropValue 0x1017
113#define PTP_OC_TerminateOpenCapture 0x1018
114#define PTP_OC_MoveObject 0x1019
115#define PTP_OC_CopyObject 0x101A
116#define PTP_OC_GetPartialObject 0x101B
117#define PTP_OC_InitiateOpenCapture 0x101C
118
119// Media Transfer Protocol (MTP) / Microsoft codes
120#define PTP_OC_MTP_GetObjectPropsSupported 0x9801
121#define PTP_OC_MTP_GetObjectPropDesc 0x9802
122#define PTP_OC_MTP_GetObjectPropValue 0x9803
123#define PTP_OC_MTP_SetObjectPropValue 0x9804
124#define PTP_OC_MTP_GetObjPropList 0x9805
125#define PTP_OC_MTP_SetObjPropList 0x9806
126#define PTP_OC_MTP_SendObjectPropList 0x9808
127#define PTP_OC_MTP_GetObjectReferences 0x9810
128#define PTP_OC_MTP_SetObjectReferences 0x9811
129#define PTP_OC_MTP_UpdateDeviceFirmware 0x9812
130#define PTP_OC_MTP_Skip 0x9820
131
132#define PTP_OC_NIKON_Capture 0x90C0
133#define PTP_OC_NIKON_AfCaptureSDRAM 0x90CB
134#define PTP_OC_NIKON_StartLiveView 0x9201
135#define PTP_OC_NIKON_EndLiveView 0x9202
136#define PTP_OC_NIKON_GetEvent 0x90C7
137
138// Non EOS (Canon point and shoot) operation codes
139#define PTP_OC_CANON_ViewFinderOn 0x900B
140#define PTP_OC_CANON_ViewFinderOff 0x900C
141#define PTP_OC_CANON_InitCaptureInRAM 0x901A
142#define PTP_OC_CANON_GetViewFinderImage 0x901D
143#define PTP_OC_CANON_LockUI 0x9004
144#define PTP_OC_CANON_UnlockUI 0x9005
145#define PTP_OC_CANON_DoNothing 0x902F
146
147// EOS specific
148#define PTP_OC_EOS_GetStorageIDs 0x9101
149#define PTP_OC_EOS_GetStorageInfo 0x9102
150#define PTP_OC_EOS_GetObjectInfoEx 0x9109
151#define PTP_OC_EOS_SetDevicePropValueEx 0x9110
152#define PTP_OC_EOS_SetRemoteMode 0x9114
153#define PTP_OC_EOS_SetEventMode 0x9115
154#define PTP_OC_EOS_GetEvent 0x9116
155#define PTP_OC_EOS_PCHDDCapacity 0x911A
156#define PTP_OC_EOS_SetUILock 0x911B
157#define PTP_OC_EOS_ResetUILock 0x911C
158#define PTP_OC_EOS_KeepDeviceOn 0x911D
159#define PTP_OC_EOS_UpdateFirmware 0x911F
160#define PTP_OC_EOS_BulbStart 0x9125
161#define PTP_OC_EOS_BulbEnd 0x9126
162#define PTP_OC_EOS_GetDevicePropValue 0x9127
163#define PTP_OC_EOS_RemoteReleaseOn 0x9128
164#define PTP_OC_EOS_RemoteReleaseOff 0x9129
165#define PTP_OC_EOS_DriveLens 0x9155
166#define PTP_OC_EOS_InitiateViewfinder 0x9151
167#define PTP_OC_EOS_TerminateViewfinder 0x9152
168#define PTP_OC_EOS_GetViewFinderData 0x9153
169#define PTP_OC_EOS_DoAutoFocus 0x9154
170#define PTP_OC_EOS_AfCancel 0x9160
171#define PTP_OC_EOS_SetDefaultSetting 0x91BE
172
173#define PTP_OC_EOS_EnableEventProc 0x9050
174#define PTP_OC_EOS_ExecuteEventProc 0x9052
175#define PTP_OC_EOS_GetEventProcReturnData 0x9053
176#define PTP_OC_EOS_IsEventProcRunning 0x9057
177
178#define EOS_DESTINATION_CAM 0x2
179#define EOS_DESTINATION_PC 0x4
180#define EOS_DESTINATION_BOTH 0x6
181
182// Return codes (RC)
183#define PTP_RC_Undefined 0x2000
184#define PTP_RC_OK 0x2001
185#define PTP_RC_GeneralError 0x2002
186#define PTP_RC_SessionNotOpen 0x2003
187#define PTP_RC_InvalidTransactionID 0x2004
188#define PTP_RC_OperationNotSupported 0x2005
189#define PTP_RC_ParameterNotSupported 0x2006
190#define PTP_RC_IncompleteTransfer 0x2007
191#define PTP_RC_InvalidStorageId 0x2008
192#define PTP_RC_InvalidObjectHandle 0x2009
193#define PTP_RC_DevicePropNotSupported 0x200A
194#define PTP_RC_InvalidObjectFormatCode 0x200B
195#define PTP_RC_StoreFull 0x200C
196#define PTP_RC_ObjectWriteProtected 0x200D
197#define PTP_RC_StoreReadOnly 0x200E
198#define PTP_RC_AccessDenied 0x200F
199#define PTP_RC_NoThumbnailPresent 0x2010
200#define PTP_RC_SelfTestFailed 0x2011
201#define PTP_RC_PartialDeletion 0x2012
202#define PTP_RC_StoreNotAvailable 0x2013
203#define PTP_RC_SpecByFormatUnsupported 0x2014
204#define PTP_RC_NoValidObjectInfo 0x2015
205#define PTP_RC_InvalidCodeFormat 0x2016
206#define PTP_RC_UnknownVendorCode 0x2017
207#define PTP_RC_CaptureAlreadyTerminated 0x2018
208#define PTP_RC_DeviceBusy 0x2019
209#define PTP_RC_InvalidParentObject 0x201A
210#define PTP_RC_InvalidDevicePropFormat 0x201B
211#define PTP_RC_InvalidDevicePropValue 0x201C
212#define PTP_RC_InvalidParameter 0x201D
213#define PTP_RC_SessionAlreadyOpened 0x201E
214#define PTP_RC_TransactionCanceled 0x201F
215#define PTP_RC_SpecOfDestinationUnsupported 0x2020
216
217// EOS or Canon?
218#define PTP_RC_CANON_Unknown 0xA001
219#define PTP_RC_CANON_NotReady 0xA102
220#define PTP_RC_CANON_BatteryLow 0xA101
221
222// MTP (Microsoft) extension
223#define PTP_RC_UndefinedMTP 0xA800
224#define PTP_RC_InvalidObjPropCode 0xA801
225#define PTP_RC_InvalidObjPropCodeFormat 0xA802
226#define PTP_RC_InvalidObjPropCodeValue 0xA803
227#define PTP_RC_InvalidObjReference 0xA804
228#define PTP_RC_InvalidDataset 0xA806
229#define PTP_RC_GroupSpecUnsupported 0xA807
230#define PTP_RC_DepthSpecUnsupported 0xA808
231#define PTP_RC_ObjectTooLarge 0xA809
232#define PTP_RC_ObjectPropUnsupported 0xA80A
233
234// Event Codes (EC)
235#define PTP_EC_Undefined 0x4000
236#define PTP_EC_CancelTransaction 0x4001
237#define PTP_EC_ObjectAdded 0x4002
238#define PTP_EC_ObjectRemoved 0x4003
239#define PTP_EC_StoreAdded 0x4004
240#define PTP_EC_StoreRemoved 0x4005
241#define PTP_EC_DevicePropChanged 0x4006
242#define PTP_EC_ObjectInfoChanged 0x4007
243#define PTP_EC_DeviceInfoChanged 0x4008
244#define PTP_EC_RequestObjectTransfer 0x4009
245#define PTP_EC_StoreFull 0x400A
246#define PTP_EC_DeviceReset 0x400B
247#define PTP_EC_StorageInfoChanged 0x400C
248#define PTP_EC_CaptureComplete 0x400D
249#define PTP_EC_UnreportedStatus 0x400E
250
251#define PTP_EC_Canon_RequestObjectTransfer 0xC009
252
253/* EOS events */
254#define PTP_EC_EOS_RequestGetEvent 0xC101
255#define PTP_EC_EOS_ObjectAddedEx 0xC181
256#define PTP_EC_EOS_ObjectRemoved 0xC182
257#define PTP_EC_EOS_RequestGetObjectInfoEx 0xC183
258#define PTP_EC_EOS_StorageStatusChanged 0xC184
259#define PTP_EC_EOS_StorageInfoChanged 0xC185
260#define PTP_EC_EOS_RequestObjectTransfer 0xc186
261#define PTP_EC_EOS_ObjectInfoChangedEx 0xC187
262#define PTP_EC_EOS_ObjectContentChanged 0xC188
263#define PTP_EC_EOS_PropValueChanged 0xC189
264#define PTP_EC_EOS_AvailListChanged 0xC18A
265#define PTP_EC_EOS_CameraStatusChanged 0xC18B
266#define PTP_EC_EOS_WillSoonShutdown 0xC18D
267#define PTP_EC_EOS_ShutdownTimerUpdated 0xC18E
268#define PTP_EC_EOS_RequestCancelTransfer 0xC18F
269#define PTP_EC_EOS_RequestObjectTransferDT 0xC190
270#define PTP_EC_EOS_RequestCancelTransferDT 0xC191
271#define PTP_EC_EOS_StoreAdded 0xC192
272#define PTP_EC_EOS_StoreRemoved 0xC193
273#define PTP_EC_EOS_BulbExposureTime 0xC194
274#define PTP_EC_EOS_RecordingTime 0xC195
275#define PTP_EC_EOS_RequestObjectTransferTS 0xC1A2
276#define PTP_EC_EOS_AfResult 0xC1A3
277#define PTP_EC_EOS_InfoCheckComplete 0xC1A4
278
279#define PTP_EC_Nikon_ObjectAddedInSDRAM 0xC101
280#define PTP_EC_Nikon_CaptureCompleteRecInSdram 0xC102
281
282// Object Formats (OF)
283#define PTP_OF_Undefined 0x3000
284#define PTP_OF_Association 0x3001 // Aka Folder
285#define PTP_OF_Script 0x3002
286#define PTP_OF_Executable 0x3003
287#define PTP_OF_Text 0x3004
288#define PTP_OF_HTML 0x3005
289#define PTP_OF_DPOF 0x3006
290#define PTP_OF_AIFF 0x3007
291#define PTP_OF_WAV 0x3008
292#define PTP_OF_MP3 0x3009
293#define PTP_OF_AVI 0x300A
294#define PTP_OF_MPEG 0x300B
295#define PTP_OF_ASF 0x300C
296#define PTP_OF_MOV 0x300D
297#define PTP_OF_JPEG 0x3801
298#define PTP_OF_TIFF_EP 0x3802
299#define PTP_OF_FlashPix 0x3803
300#define PTP_OF_BMP 0x3804
301#define PTP_OF_CIFF 0x3805
302#define PTP_OF_Reserved2 0x3806
303#define PTP_OF_GIF 0x3807
304#define PTP_OF_JFIF 0x3808
305#define PTP_OF_PCD 0x3809
306#define PTP_OF_PICT 0x380A
307#define PTP_OF_PNG 0x380B
308#define PTP_OF_Reserved1 0x380C
309#define PTP_OF_TIFF 0x380D
310#define PTP_OF_TIFF_IT 0x380E
311#define PTP_OF_JP2 0x380F
312#define PTP_OF_JPX 0x3810
313#define PTP_OF_Firmware 0xB802
314#define PTP_OF_WIF 0xB881
315#define PTP_OF_Audio 0xB900
316#define PTP_OF_WMA 0xb901
317#define PTP_OF_OGG 0xb902
318#define PTP_OF_AAC 0xb903
319#define PTP_OF_Audible 0xb904
320#define PTP_OF_FLAC 0xb906
321#define PTP_OF_SamsungPlaylist 0xb909
322#define PTP_OF_Video 0xb980
323#define PTP_OF_WMV 0xb981
324#define PTP_OF_MP4 0xb982
325#define PTP_OF_3GP 0xb984
326#define PTP_OF_MP2 0xb983
327
328// MTP specific Object Properties (copied from libgphoto2)
329#define PTP_OPC_StorageID 0xDC01
330#define PTP_OPC_ObjectFormat 0xDC02
331#define PTP_OPC_ProtectionStatus 0xDC03
332#define PTP_OPC_ObjectSize 0xDC04
333#define PTP_OPC_AssociationType 0xDC05
334#define PTP_OPC_AssociationDesc 0xDC06
335#define PTP_OPC_ObjectFileName 0xDC07
336#define PTP_OPC_DateCreated 0xDC08
337#define PTP_OPC_DateModified 0xDC09
338#define PTP_OPC_Keywords 0xDC0A
339#define PTP_OPC_ParentObject 0xDC0B
340#define PTP_OPC_AllowedFolderContents 0xDC0C
341#define PTP_OPC_Hidden 0xDC0D
342#define PTP_OPC_SystemObject 0xDC0E
343#define PTP_OPC_PersistantUniqueObjectIdentifier 0xDC41
344#define PTP_OPC_SyncID 0xDC42
345#define PTP_OPC_PropertyBag 0xDC43
346#define PTP_OPC_Name 0xDC44
347#define PTP_OPC_CreatedBy 0xDC45
348#define PTP_OPC_Artist 0xDC46
349#define PTP_OPC_DateAuthored 0xDC47
350#define PTP_OPC_Description 0xDC48
351#define PTP_OPC_URLReference 0xDC49
352#define PTP_OPC_LanguageLocale 0xDC4A
353#define PTP_OPC_CopyrightInformation 0xDC4B
354#define PTP_OPC_Source 0xDC4C
355#define PTP_OPC_OriginLocation 0xDC4D
356#define PTP_OPC_DateAdded 0xDC4E
357#define PTP_OPC_NonConsumable 0xDC4F
358#define PTP_OPC_CorruptOrUnplayable 0xDC50
359#define PTP_OPC_ProducerSerialNumber 0xDC51
360#define PTP_OPC_RepresentativeSampleFormat 0xDC81
361#define PTP_OPC_RepresentativeSampleSize 0xDC82
362#define PTP_OPC_RepresentativeSampleHeight 0xDC83
363#define PTP_OPC_RepresentativeSampleWidth 0xDC84
364#define PTP_OPC_RepresentativeSampleDuration 0xDC85
365#define PTP_OPC_RepresentativeSampleData 0xDC86
366#define PTP_OPC_Width 0xDC87
367#define PTP_OPC_Height 0xDC88
368#define PTP_OPC_Duration 0xDC89
369#define PTP_OPC_Rating 0xDC8A
370#define PTP_OPC_Track 0xDC8B
371#define PTP_OPC_Genre 0xDC8C
372#define PTP_OPC_Credits 0xDC8D
373#define PTP_OPC_Lyrics 0xDC8E
374#define PTP_OPC_SubscriptionContentID 0xDC8F
375#define PTP_OPC_ProducedBy 0xDC90
376#define PTP_OPC_UseCount 0xDC91
377#define PTP_OPC_SkipCount 0xDC92
378#define PTP_OPC_LastAccessed 0xDC93
379#define PTP_OPC_ParentalRating 0xDC94
380#define PTP_OPC_MetaGenre 0xDC95
381#define PTP_OPC_Composer 0xDC96
382#define PTP_OPC_EffectiveRating 0xDC97
383#define PTP_OPC_Subtitle 0xDC98
384#define PTP_OPC_OriginalReleaseDate 0xDC99
385#define PTP_OPC_AlbumName 0xDC9A
386#define PTP_OPC_AlbumArtist 0xDC9B
387#define PTP_OPC_Mood 0xDC9C
388#define PTP_OPC_DRMStatus 0xDC9D
389#define PTP_OPC_SubDescription 0xDC9E
390#define PTP_OPC_IsCropped 0xDCD1
391#define PTP_OPC_IsColorCorrected 0xDCD2
392#define PTP_OPC_ImageBitDepth 0xDCD3
393#define PTP_OPC_Fnumber 0xDCD4
394#define PTP_OPC_ExposureTime 0xDCD5
395#define PTP_OPC_ExposureIndex 0xDCD6
396#define PTP_OPC_DisplayName 0xDCE0
397#define PTP_OPC_BodyText 0xDCE1
398#define PTP_OPC_Subject 0xDCE2
399#define PTP_OPC_Priority 0xDCE3
400#define PTP_OPC_GivenName 0xDD00
401#define PTP_OPC_MiddleNames 0xDD01
402#define PTP_OPC_FamilyName 0xDD02
403#define PTP_OPC_Prefix 0xDD03
404#define PTP_OPC_Suffix 0xDD04
405#define PTP_OPC_PhoneticGivenName 0xDD05
406#define PTP_OPC_PhoneticFamilyName 0xDD06
407#define PTP_OPC_EmailPrimary 0xDD07
408#define PTP_OPC_EmailPersonal1 0xDD08
409#define PTP_OPC_EmailPersonal2 0xDD09
410#define PTP_OPC_EmailBusiness1 0xDD0A
411#define PTP_OPC_EmailBusiness2 0xDD0B
412#define PTP_OPC_EmailOthers 0xDD0C
413#define PTP_OPC_PhoneNumberPrimary 0xDD0D
414#define PTP_OPC_PhoneNumberPersonal 0xDD0E
415#define PTP_OPC_PhoneNumberPersonal2 0xDD0F
416#define PTP_OPC_PhoneNumberBusiness 0xDD10
417#define PTP_OPC_PhoneNumberBusiness2 0xDD11
418#define PTP_OPC_PhoneNumberMobile 0xDD12
419#define PTP_OPC_PhoneNumberMobile2 0xDD13
420#define PTP_OPC_FaxNumberPrimary 0xDD14
421#define PTP_OPC_FaxNumberPersonal 0xDD15
422#define PTP_OPC_FaxNumberBusiness 0xDD16
423#define PTP_OPC_PagerNumber 0xDD17
424#define PTP_OPC_PhoneNumberOthers 0xDD18
425#define PTP_OPC_PrimaryWebAddress 0xDD19
426#define PTP_OPC_PersonalWebAddress 0xDD1A
427#define PTP_OPC_BusinessWebAddress 0xDD1B
428#define PTP_OPC_InstantMessengerAddress 0xDD1C
429#define PTP_OPC_InstantMessengerAddress2 0xDD1D
430#define PTP_OPC_InstantMessengerAddress3 0xDD1E
431#define PTP_OPC_PostalAddressPersonalFull 0xDD1F
432#define PTP_OPC_PostalAddressPersonalFullLine1 0xDD20
433#define PTP_OPC_PostalAddressPersonalFullLine2 0xDD21
434#define PTP_OPC_PostalAddressPersonalFullCity 0xDD22
435#define PTP_OPC_PostalAddressPersonalFullRegion 0xDD23
436#define PTP_OPC_PostalAddressPersonalFullPostalCode 0xDD24
437#define PTP_OPC_PostalAddressPersonalFullCountry 0xDD25
438#define PTP_OPC_PostalAddressBusinessFull 0xDD26
439#define PTP_OPC_PostalAddressBusinessLine1 0xDD27
440#define PTP_OPC_PostalAddressBusinessLine2 0xDD28
441#define PTP_OPC_PostalAddressBusinessCity 0xDD29
442#define PTP_OPC_PostalAddressBusinessRegion 0xDD2A
443#define PTP_OPC_PostalAddressBusinessPostalCode 0xDD2B
444#define PTP_OPC_PostalAddressBusinessCountry 0xDD2C
445#define PTP_OPC_PostalAddressOtherFull 0xDD2D
446#define PTP_OPC_PostalAddressOtherLine1 0xDD2E
447#define PTP_OPC_PostalAddressOtherLine2 0xDD2F
448#define PTP_OPC_PostalAddressOtherCity 0xDD30
449#define PTP_OPC_PostalAddressOtherRegion 0xDD31
450#define PTP_OPC_PostalAddressOtherPostalCode 0xDD32
451#define PTP_OPC_PostalAddressOtherCountry 0xDD33
452#define PTP_OPC_OrganizationName 0xDD34
453#define PTP_OPC_PhoneticOrganizationName 0xDD35
454#define PTP_OPC_Role 0xDD36
455#define PTP_OPC_Birthdate 0xDD37
456#define PTP_OPC_MessageTo 0xDD40
457#define PTP_OPC_MessageCC 0xDD41
458#define PTP_OPC_MessageBCC 0xDD42
459#define PTP_OPC_MessageRead 0xDD43
460#define PTP_OPC_MessageReceivedTime 0xDD44
461#define PTP_OPC_MessageSender 0xDD45
462#define PTP_OPC_ActivityBeginTime 0xDD50
463#define PTP_OPC_ActivityEndTime 0xDD51
464#define PTP_OPC_ActivityLocation 0xDD52
465#define PTP_OPC_ActivityRequiredAttendees 0xDD54
466#define PTP_OPC_ActivityOptionalAttendees 0xDD55
467#define PTP_OPC_ActivityResources 0xDD56
468#define PTP_OPC_ActivityAccepted 0xDD57
469#define PTP_OPC_Owner 0xDD5D
470#define PTP_OPC_Editor 0xDD5E
471#define PTP_OPC_Webmaster 0xDD5F
472#define PTP_OPC_URLSource 0xDD60
473#define PTP_OPC_URLDestination 0xDD61
474#define PTP_OPC_TimeBookmark 0xDD62
475#define PTP_OPC_ObjectBookmark 0xDD63
476#define PTP_OPC_ByteBookmark 0xDD64
477#define PTP_OPC_LastBuildDate 0xDD70
478#define PTP_OPC_TimetoLive 0xDD71
479#define PTP_OPC_MediaGUID 0xDD72
480#define PTP_OPC_TotalBitRate 0xDE91
481#define PTP_OPC_BitRateType 0xDE92
482#define PTP_OPC_SampleRate 0xDE93
483#define PTP_OPC_NumberOfChannels 0xDE94
484#define PTP_OPC_AudioBitDepth 0xDE95
485#define PTP_OPC_ScanDepth 0xDE97
486#define PTP_OPC_AudioWAVECodec 0xDE99
487#define PTP_OPC_AudioBitRate 0xDE9A
488#define PTP_OPC_VideoFourCCCodec 0xDE9B
489#define PTP_OPC_VideoBitRate 0xDE9C
490#define PTP_OPC_FramesPerThousandSeconds 0xDE9D
491#define PTP_OPC_KeyFrameDistance 0xDE9E
492#define PTP_OPC_BufferSize 0xDE9F
493#define PTP_OPC_EncodingQuality 0xDEA0
494#define PTP_OPC_EncodingProfile 0xDEA1
495#define PTP_OPC_BuyFlag 0xD901
496
497// Multple vendors appear to use these
498#define PTP_OF_CANON_CRW 0xb101
499#define PTP_OF_RAW 0xb103
500#define PTP_OF_CANON_MOV 0xb104
501
502// Association types
503#define PTP_AT_Folder 0x1
504#define PTP_AT_Album 0x1
505
506// ISO Standard Property codes
507#define PTP_DPC_BatteryLevel 0x5001
508#define PTP_DPC_FunctionalMode 0x5002
509#define PTP_DPC_ImageSize 0x5003
510#define PTP_DPC_CompressionSetting 0x5004
511#define PTP_DPC_WhiteBalance 0x5005
512#define PTP_DPC_RGBGain 0x5006
513#define PTP_DPC_FNumber 0x5007
514#define PTP_DPC_FocalLength 0x5008
515#define PTP_DPC_FocalDistance 0x5009
516#define PTP_DPC_FocusMode 0x500A
517#define PTP_DPC_ExposureMeteringMode 0x500B
518#define PTP_DPC_FlashMode 0x500C
519#define PTP_DPC_ExposureTime 0x500D
520#define PTP_DPC_ExposureProgramMode 0x500E
521#define PTP_DPC_ExposureIndex 0x500F
522#define PTP_DPC_ExposureBiasCompensation 0x5010
523#define PTP_DPC_DateTime 0x5011
524#define PTP_DPC_CaptureDelay 0x5012
525#define PTP_DPC_StillCaptureMode 0x5013
526#define PTP_DPC_Contrast 0x5014
527#define PTP_DPC_Sharpness 0x5015
528#define PTP_DPC_DigitalZoom 0x5016
529#define PTP_DPC_EffectMode 0x5017
530#define PTP_DPC_BurstNumber 0x5018
531#define PTP_DPC_BurstInterval 0x5019
532#define PTP_DPC_TimelapseNumber 0x501A
533#define PTP_DPC_TimelapseInterval 0x501B
534#define PTP_DPC_FocusMeteringMode 0x501C
535#define PTP_DPC_UploadURL 0x501D
536#define PTP_DPC_Artist 0x501E
537#define PTP_DPC_CopyrightInfo 0x501F
538
539#define PTP_DPC_SupportedStreams 0x5020
540#define PTP_DPC_EnabledStreams 0x5021
541#define PTP_DPC_VideoFormat 0x5022
542#define PTP_DPC_VideoResolution 0x5023
543#define PTP_DPC_VideoQuality 0x5024
544#define PTP_DPC_VideoFrameRate 0x5025
545#define PTP_DPC_VideoContrast 0x5026
546#define PTP_DPC_VideoBrightness 0x5027
547#define PTP_DPC_AudioFormat 0x5028
548#define PTP_DPC_AudioBitrate 0x5029
549#define PTP_DPC_AudioSamplingRate 0x502A
550#define PTP_DPC_AudioBitPerSample 0x502B
551#define PTP_DPC_AudioVolume 0x502C
552
553// Canon (Not EOS) Property Codes
554#define PTP_DPC_CANON_BeepCode 0xD001
555#define PTP_DPC_CANON_ViewFinderMode 0xD003
556#define PTP_DPC_CANON_ImageQuality 0xD006
557#define PTP_DPC_CANON_ImageSize 0xD008
558#define PTP_DPC_CANON_FlashMode 0xD00a
559#define PTP_DPC_CANON_TvAvSetting 0xD00c
560#define PTP_DPC_CANON_MeteringMode 0xd010
561#define PTP_DPC_CANON_MacroMode 0xd011
562#define PTP_DPC_CANON_FocusingPoint 0xd012
563#define PTP_DPC_CANON_WhiteBalance 0xd013
564#define PTP_DPC_CANON_AFMode 0xD015
565#define PTP_DPC_CANON_Contrast 0xD017
566#define PTP_DPC_CANON_ISOSpeed 0xd01c
567#define PTP_DPC_CANON_Aperture 0xd01c
568#define PTP_DPC_CANON_ShutterSpeed 0xd01e
569#define PTP_DPC_CANON_ExpComp 0xd01f
570#define PTP_DPC_CANON_Zoom 0xd02a
571#define PTP_DPC_CANON_SizeQuality 0xd02c
572#define PTP_DPC_CANON_FlashMemory 0xd031
573#define PTP_DPC_CANON_CameraModel 0xd032
574#define PTP_DPC_CANON_CameraOwner 0xd033
575#define PTP_DPC_CANON_UnixTime 0xd032
576#define PTP_DPC_CANON_ViewFinderOut 0xD036
577#define PTP_DPC_CANON_RealImageWidth 0xD039
578#define PTP_DPC_CANON_PhotoEffect 0xD040
579#define PTP_DPC_CANON_AssistLight 0xD041
580
581// EOS Device Property Codes
582#define PTP_DPC_EOS_Aperture 0xD101
583#define PTP_DPC_EOS_ShutterSpeed 0xD102
584#define PTP_DPC_EOS_ISOSpeed 0xD103
585#define PTP_DPC_EOS_ExpCompensation 0xD104
586#define PTP_DPC_EOS_AutoExposureMode 0xD105
587#define PTP_DPC_EOS_DriveMode 0xD106
588#define PTP_DPC_EOS_MeteringMode 0xD107
589#define PTP_DPC_EOS_FocusMode 0xD108
590#define PTP_DPC_EOS_WhiteBalance 0xD109
591#define PTP_DPC_EOS_ColorTemperature 0xD10A
592#define PTP_DPC_EOS_WhiteBalanceAdjustA 0xD10B
593#define PTP_DPC_EOS_WhiteBalanceAdjustB 0xD10C
594#define PTP_DPC_EOS_WhiteBalanceXA 0xD10D
595#define PTP_DPC_EOS_WhiteBalanceXB 0xD10E
596#define PTP_DPC_EOS_ColorSpace 0xD10F
597#define PTP_DPC_EOS_PictureStyle 0xD110
598#define PTP_DPC_EOS_BatteryPower 0xD111
599#define PTP_DPC_EOS_BatterySelect 0xD112
600#define PTP_DPC_EOS_CameraTime 0xD113
601#define PTP_DPC_EOS_Owner 0xD115
602#define PTP_DPC_EOS_ModelID 0xD116
603#define PTP_DPC_EOS_PTPExtensionVersion 0xD119
604#define PTP_DPC_EOS_DPOFVersion 0xD11A
605#define PTP_DPC_EOS_AvailableShots 0xD11B
606#define PTP_DPC_EOS_CaptureDestination 0xD11C
607#define PTP_DPC_EOS_CurrentFolder 0xD11F
608#define PTP_DPC_EOS_ImageFormat 0xD120
609#define PTP_DPC_EOS_ImageFormatCF 0xD121
610#define PTP_DPC_EOS_ImageFormatSD 0xD122
611#define PTP_DPC_EOS_ImageFormatExtHD 0xD123
612#define PTP_DPC_EOS_AEModeDial 0xD138
613#define PTP_DPC_EOS_ShutterCounter 0xD1AC
614#define PTP_DPC_EOS_VF_Output 0xD1B0
615#define PTP_DPC_EOS_EVFMode 0xD1B1
616#define PTP_DPC_EOS_DOFPreview 0xD1B2
617#define PTP_DPC_EOS_VFSharp 0xD1B3
618#define PTP_DPC_EOS_EVFWBMode 0xD1B4
619#define PTP_DPC_EOS_FocusInfoEx 0xD1D3
620
621// Magic Lantern ptpview old opcodes
622#define PTP_OC_ML_LiveBmpRam 0x9996
623#define PTP_OC_ML_Live360x240 0x9997
624
625#define PTP_OC_MagicLantern 0x9998
626#define PTP_OC_CHDK 0x9999
627
628// Storage Types
629#define PTP_ST_Undefined 0x0
630#define PTP_ST_FixedROM 0x1
631#define PTP_ST_RemovableROM 0x2
632#define PTP_ST_FixedRAM 0x3
633#define PTP_ST_RemovableRAM 0x4
634
635// Filesystem Type
636#define PTP_FT_Undefined 0x0
637#define PTP_FT_GenericFlat 0x1
638#define PTP_FT_GenericHei 0x2
639#define PTP_FT_DCF 0x3
640
641// Access Capability
642#define PTP_AC_ReadWrite 0x0
643#define PTP_AC_Read 0x1
644#define PTP_AC_ReadDelete 0x2
645
646// Device type codes
647#define PTP_TC_UNDEF 0x0
648#define PTP_TC_INT8 0x1
649#define PTP_TC_UINT8 0x2
650#define PTP_TC_INT16 0x3
651#define PTP_TC_UINT16 0x4
652#define PTP_TC_INT32 0x5
653#define PTP_TC_UINT32 0x6
654#define PTP_TC_INT64 0x7
655#define PTP_TC_UINT64 0x8
656#define PTP_TC_INT128 0x9
657#define PTP_TC_UINT128 0xA
658#define PTP_TC_UINT8ARRAY 0x4002
659#define PTP_TC_UINT16ARRAY 0x4004
660#define PTP_TC_UINT32ARRAY 0x4006
661#define PTP_TC_UINT64ARRAY 0x4008
662#define PTP_TC_STRING 0xFFFF
663
664#define PTP_RangeForm 0x1
665#define PTP_EnumerationForm 0x2
666
667#define PTP_WB_Undefined 0x0
668#define PTP_WB_Manual 0x1
669#define PTP_WB_Automatic 0x2
670#define PTP_WB_Daylight 0x4
671#define PTP_WB_Florescent 0x5
672#define PTP_WB_Tungsten 0x5
673#define PTP_WB_Flash 0x7
674
675// Used for socket initialization
676#define PTPIP_INIT_COMMAND_REQ 0x1
677#define PTPIP_INIT_COMMAND_ACK 0x2
678#define PTPIP_INIT_EVENT_REQ 0x3
679#define PTPIP_INIT_EVENT_ACK 0x4
680
681// Packet type extensions for PTP/IP
682#define PTPIP_INIT_FAIL 0x5
683#define PTPIP_COMMAND_REQUEST 0x6
684#define PTPIP_COMMAND_RESPONSE 0x7
685#define PTPIP_EVENT 0x8
686#define PTPIP_DATA_PACKET_START 0x9
687#define PTPIP_DATA_PACKET 0xA
688#define PTPIP_CANCEL_TRANSACTION 0xB
689#define PTPIP_DATA_PACKET_END 0xC
690#define PTPIP_PING 0xD
691#define PTPIP_PONG 0xE
692
693#define USB_VENDOR_CANON 0x4A9
694
695// ISO number for PTP/IP
696#define PTP_IP_PORT 15740
697
698// Standard interface Class ID for PTP.
699// See https://en.wikipedia.org/wiki/USB#Device_classes
700#define PTP_CLASS_ID 6
701
702// bRequest codes
703#define MTP_REQ_CANCEL 0x64
704#define MTP_REQ_GET_EXT_EVENT_DATA 0x65
705#define USB_REQ_RESET 0x66
706#define USB_REQ_STATUS 0x67
707#define USB_REQ_GET_STATUS 0x00
708#define USB_REQ_CLEAR_FEATURE 0x01
709#define USB_REQ_SET_FEATURE 0x03
710
711// Data phase host to device, device to host
712#define USB_DP_HTD 0x0
713#define USB_DP_DTH 0x80
714
715#define USB_RECIP_DEVICE 0x00
716#define USB_RECIP_INTERFACE 0x01
717#define USB_RECIP_ENDPOINT 0x02
718#ifndef USB_TYPE_CLASS
719#define USB_TYPE_CLASS 0x20
720#endif
721
722#pragma pack(pop)
723
724#endif