-
Notifications
You must be signed in to change notification settings - Fork 329
/
Copy pathptp.h
3847 lines (3525 loc) · 150 KB
/
ptp.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/* ptp.h
*
* Copyright (C) 2001 Mariusz Woloszyn <[email protected]>
* Copyright (C) 2003-2017 Marcus Meissner <[email protected]>
* Copyright (C) 2006-2008 Linus Walleij <[email protected]>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301 USA
*/
#ifndef __PTP_H__
#define __PTP_H__
#include <stdarg.h>
#include <time.h>
#if defined(HAVE_ICONV) && defined(HAVE_LANGINFO_H)
#include <iconv.h>
#endif
#include "gphoto2-endian.h"
#include "device-flags.h"
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
/* PTP datalayer byteorder */
#define PTP_DL_BE 0xF0
#define PTP_DL_LE 0x0F
/* USB interface class */
#ifndef USB_CLASS_PTP
#define USB_CLASS_PTP 6
#endif
/* PTP request/response/event general PTP container (transport independent) */
struct _PTPContainer {
uint16_t Code;
uint32_t SessionID;
uint32_t Transaction_ID;
/* params may be of any type of size less or equal to uint32_t */
uint32_t Param1;
uint32_t Param2;
uint32_t Param3;
/* events can only have three parameters */
uint32_t Param4;
uint32_t Param5;
/* the number of meaningfull parameters */
uint8_t Nparam;
};
typedef struct _PTPContainer PTPContainer;
/* PTP USB Bulk-Pipe container */
/* USB bulk max packet length for high speed endpoints */
/* The max packet is set to 512 bytes. The spec says
* "end of data transfers are signaled by short packets or NULL
* packets". It never says anything about 512, but current
* implementations seem to have chosen this value, which also
* happens to be the size of an USB 2.0 HS endpoint, even though
* this is not necessary.
*
* Previously we had this as 4096 for MTP devices. We have found
* and fixed the bugs that made this necessary and it can be 512 again.
*
* USB 3.0 has now 1024 byte EPs.
*/
#define PTP_USB_BULK_HS_MAX_PACKET_LEN_WRITE 512
#define PTP_USB_BULK_HS_MAX_PACKET_LEN_READ 512
#define PTP_USB_BULK_SS_MAX_PACKET_LEN_WRITE 1024
#define PTP_USB_BULK_SS_MAX_PACKET_LEN_READ 1024
#define PTP_USB_BULK_HDR_LEN (2*sizeof(uint32_t)+2*sizeof(uint16_t))
#define PTP_USB_BULK_PAYLOAD_LEN_WRITE (PTP_USB_BULK_SS_MAX_PACKET_LEN_WRITE-PTP_USB_BULK_HDR_LEN)
#define PTP_USB_BULK_PAYLOAD_LEN_READ (PTP_USB_BULK_SS_MAX_PACKET_LEN_READ-PTP_USB_BULK_HDR_LEN)
#define PTP_USB_BULK_REQ_LEN (PTP_USB_BULK_HDR_LEN+5*sizeof(uint32_t))
struct _PTPUSBBulkContainer {
uint32_t length;
uint16_t type;
uint16_t code;
uint32_t trans_id;
union {
struct {
uint32_t param1;
uint32_t param2;
uint32_t param3;
uint32_t param4;
uint32_t param5;
} params;
/* this must be set to the maximum of PTP_USB_BULK_PAYLOAD_LEN_WRITE
* and PTP_USB_BULK_PAYLOAD_LEN_READ */
unsigned char data[PTP_USB_BULK_PAYLOAD_LEN_READ];
} payload;
};
typedef struct _PTPUSBBulkContainer PTPUSBBulkContainer;
/* PTP USB Asynchronous Event Interrupt Data Format */
struct _PTPUSBEventContainer {
uint32_t length;
uint16_t type;
uint16_t code;
uint32_t trans_id;
uint32_t param1;
uint32_t param2;
uint32_t param3;
};
typedef struct _PTPUSBEventContainer PTPUSBEventContainer;
struct _PTPCanon_directtransfer_entry {
uint32_t oid;
char *str;
};
typedef struct _PTPCanon_directtransfer_entry PTPCanon_directtransfer_entry;
/* USB container types */
#define PTP_USB_CONTAINER_UNDEFINED 0x0000
#define PTP_USB_CONTAINER_COMMAND 0x0001
#define PTP_USB_CONTAINER_DATA 0x0002
#define PTP_USB_CONTAINER_RESPONSE 0x0003
#define PTP_USB_CONTAINER_EVENT 0x0004
/* PTP/IP definitions */
#define PTPIP_INIT_COMMAND_REQUEST 1
#define PTPIP_INIT_COMMAND_ACK 2
#define PTPIP_INIT_EVENT_REQUEST 3
#define PTPIP_INIT_EVENT_ACK 4
#define PTPIP_INIT_FAIL 5
#define PTPIP_CMD_REQUEST 6
#define PTPIP_CMD_RESPONSE 7
#define PTPIP_EVENT 8
#define PTPIP_START_DATA_PACKET 9
#define PTPIP_DATA_PACKET 10
#define PTPIP_CANCEL_TRANSACTION 11
#define PTPIP_END_DATA_PACKET 12
#define PTPIP_PING 13
#define PTPIP_PONG 14
struct _PTPIPHeader {
uint32_t length;
uint32_t type;
};
typedef struct _PTPIPHeader PTPIPHeader;
/* Vendor IDs */
/* List is linked from here: http://www.imaging.org/site/IST/Standards/PTP_Standards.aspx */
#define PTP_VENDOR_EASTMAN_KODAK 0x00000001
#define PTP_VENDOR_SEIKO_EPSON 0x00000002
#define PTP_VENDOR_AGILENT 0x00000003
#define PTP_VENDOR_POLAROID 0x00000004
#define PTP_VENDOR_AGFA_GEVAERT 0x00000005
#define PTP_VENDOR_MICROSOFT 0x00000006
#define PTP_VENDOR_EQUINOX 0x00000007
#define PTP_VENDOR_VIEWQUEST 0x00000008
#define PTP_VENDOR_STMICROELECTRONICS 0x00000009
#define PTP_VENDOR_NIKON 0x0000000A
#define PTP_VENDOR_CANON 0x0000000B
#define PTP_VENDOR_FOTONATION 0x0000000C
#define PTP_VENDOR_PENTAX 0x0000000D
#define PTP_VENDOR_FUJI 0x0000000E
#define PTP_VENDOR_NDD_MEDICAL_TECHNOLOGIES 0x00000012
#define PTP_VENDOR_SAMSUNG 0x0000001a
#define PTP_VENDOR_PARROT 0x0000001b
#define PTP_VENDOR_PANASONIC 0x0000001c
/* not from standards papers, but from traces: */
#define PTP_VENDOR_SONY 0x00000011 /* observed in the A900 */
/* Vendor extension ID used for MTP (occasionaly, usualy 6 is used) */
#define PTP_VENDOR_MTP 0xffffffff
/* gphoto overrides */
#define PTP_VENDOR_GP_OLYMPUS 0x0000fffe
#define PTP_VENDOR_GP_OLYMPUS_OMD 0x0000fffd
/* Operation Codes */
/* PTP v1.0 operation codes */
#define PTP_OC_Undefined 0x1000
#define PTP_OC_GetDeviceInfo 0x1001
#define PTP_OC_OpenSession 0x1002
#define PTP_OC_CloseSession 0x1003
#define PTP_OC_GetStorageIDs 0x1004
#define PTP_OC_GetStorageInfo 0x1005
#define PTP_OC_GetNumObjects 0x1006
#define PTP_OC_GetObjectHandles 0x1007
#define PTP_OC_GetObjectInfo 0x1008
#define PTP_OC_GetObject 0x1009
#define PTP_OC_GetThumb 0x100A
#define PTP_OC_DeleteObject 0x100B
#define PTP_OC_SendObjectInfo 0x100C
#define PTP_OC_SendObject 0x100D
#define PTP_OC_InitiateCapture 0x100E
#define PTP_OC_FormatStore 0x100F
#define PTP_OC_ResetDevice 0x1010
#define PTP_OC_SelfTest 0x1011
#define PTP_OC_SetObjectProtection 0x1012
#define PTP_OC_PowerDown 0x1013
#define PTP_OC_GetDevicePropDesc 0x1014
#define PTP_OC_GetDevicePropValue 0x1015
#define PTP_OC_SetDevicePropValue 0x1016
#define PTP_OC_ResetDevicePropValue 0x1017
#define PTP_OC_TerminateOpenCapture 0x1018
#define PTP_OC_MoveObject 0x1019
#define PTP_OC_CopyObject 0x101A
#define PTP_OC_GetPartialObject 0x101B
#define PTP_OC_InitiateOpenCapture 0x101C
/* PTP v1.1 operation codes */
#define PTP_OC_StartEnumHandles 0x101D
#define PTP_OC_EnumHandles 0x101E
#define PTP_OC_StopEnumHandles 0x101F
#define PTP_OC_GetVendorExtensionMaps 0x1020
#define PTP_OC_GetVendorDeviceInfo 0x1021
#define PTP_OC_GetResizedImageObject 0x1022
#define PTP_OC_GetFilesystemManifest 0x1023
#define PTP_OC_GetStreamInfo 0x1024
#define PTP_OC_GetStream 0x1025
/* Eastman Kodak extension Operation Codes */
#define PTP_OC_EK_GetSerial 0x9003
#define PTP_OC_EK_SetSerial 0x9004
#define PTP_OC_EK_SendFileObjectInfo 0x9005
#define PTP_OC_EK_SendFileObject 0x9006
#define PTP_OC_EK_SetText 0x9008
/* Canon extension Operation Codes */
#define PTP_OC_CANON_GetPartialObjectInfo 0x9001
/* 9002 - sends 2 uint32, nothing back */
#define PTP_OC_CANON_SetObjectArchive 0x9002
#define PTP_OC_CANON_KeepDeviceOn 0x9003
#define PTP_OC_CANON_LockDeviceUI 0x9004
#define PTP_OC_CANON_UnlockDeviceUI 0x9005
#define PTP_OC_CANON_GetObjectHandleByName 0x9006
/* no 9007 observed yet */
#define PTP_OC_CANON_InitiateReleaseControl 0x9008
#define PTP_OC_CANON_TerminateReleaseControl 0x9009
#define PTP_OC_CANON_TerminatePlaybackMode 0x900A
#define PTP_OC_CANON_ViewfinderOn 0x900B
#define PTP_OC_CANON_ViewfinderOff 0x900C
#define PTP_OC_CANON_DoAeAfAwb 0x900D
/* 900e - send nothing, gets 5 uint16t in 32bit entities back in 20byte datablob */
#define PTP_OC_CANON_GetCustomizeSpec 0x900E
#define PTP_OC_CANON_GetCustomizeItemInfo 0x900F
#define PTP_OC_CANON_GetCustomizeData 0x9010
#define PTP_OC_CANON_SetCustomizeData 0x9011
#define PTP_OC_CANON_GetCaptureStatus 0x9012
#define PTP_OC_CANON_CheckEvent 0x9013
#define PTP_OC_CANON_FocusLock 0x9014
#define PTP_OC_CANON_FocusUnlock 0x9015
#define PTP_OC_CANON_GetLocalReleaseParam 0x9016
#define PTP_OC_CANON_SetLocalReleaseParam 0x9017
#define PTP_OC_CANON_AskAboutPcEvf 0x9018
#define PTP_OC_CANON_SendPartialObject 0x9019
#define PTP_OC_CANON_InitiateCaptureInMemory 0x901A
#define PTP_OC_CANON_GetPartialObjectEx 0x901B
#define PTP_OC_CANON_SetObjectTime 0x901C
#define PTP_OC_CANON_GetViewfinderImage 0x901D
#define PTP_OC_CANON_GetObjectAttributes 0x901E
#define PTP_OC_CANON_ChangeUSBProtocol 0x901F
#define PTP_OC_CANON_GetChanges 0x9020
#define PTP_OC_CANON_GetObjectInfoEx 0x9021
#define PTP_OC_CANON_InitiateDirectTransfer 0x9022
#define PTP_OC_CANON_TerminateDirectTransfer 0x9023
#define PTP_OC_CANON_SendObjectInfoByPath 0x9024
#define PTP_OC_CANON_SendObjectByPath 0x9025
#define PTP_OC_CANON_InitiateDirectTansferEx 0x9026
#define PTP_OC_CANON_GetAncillaryObjectHandles 0x9027
#define PTP_OC_CANON_GetTreeInfo 0x9028
#define PTP_OC_CANON_GetTreeSize 0x9029
#define PTP_OC_CANON_NotifyProgress 0x902A
#define PTP_OC_CANON_NotifyCancelAccepted 0x902B
/* 902c: no parms, read 3 uint32 in data, no response parms */
#define PTP_OC_CANON_902C 0x902C
#define PTP_OC_CANON_GetDirectory 0x902D
#define PTP_OC_CANON_902E 0x902E
#define PTP_OC_CANON_902F 0x902F /* used during camera init */
#define PTP_OC_CANON_SetPairingInfo 0x9030
#define PTP_OC_CANON_GetPairingInfo 0x9031
#define PTP_OC_CANON_DeletePairingInfo 0x9032
#define PTP_OC_CANON_GetMACAddress 0x9033 /* no args */
/*
0000 12 00 00 00 02 00 33 90-1a 00 00 00 2c 9e fc c8 ......3.....,...
0010 33 e3 - 3.
*/
/* 9034: 1 param, no parms returned */
#define PTP_OC_CANON_SetDisplayMonitor 0x9034
#define PTP_OC_CANON_PairingComplete 0x9035
#define PTP_OC_CANON_GetWirelessMAXChannel 0x9036
#define PTP_OC_CANON_GetWebServiceSpec 0x9068 /* no args */
/* data returned:
0000 1e 00 00 00 02 00 68 90-1a 00 00 00 00 01 08 00 ......h.........
0010 14 00 bc ce 00 00 78 00-78 00 00 14 00 00 ......x.x.....
*/
#define PTP_OC_CANON_GetWebServiceData 0x9069 /* no args */
#define PTP_OC_CANON_SetWebServiceData 0x906A
#define PTP_OC_CANON_DeleteWebServiceData 0x906B
#define PTP_OC_CANON_GetRootCertificateSpec 0x906C /* no args */
/*
0000 12 00 00 00 02 00 6c 90-1a 00 00 00 00 01 6c 30 ......l.......l0
0010 00 00 - ..
*/
#define PTP_OC_CANON_GetRootCertificateData 0x906D /* no args */
/* empty data on test */
#define PTP_OC_CANON_SetRootCertificateData 0x906F
#define PTP_OC_CANON_GetGpsMobilelinkObjectInfo 0x9075 /* 2 args: utcstart, utcend */
#define PTP_OC_CANON_SendGpsTagInfo 0x9076 /* 1 arg: oid */
#define PTP_OC_CANON_GetTranscodeApproxSize 0x9077 /* 1 arg: oid? */
#define PTP_OC_CANON_RequestTranscodeStart 0x9078 /* 1 arg: oid? */
#define PTP_OC_CANON_RequestTranscodeCancel 0x9079 /* 1 arg: oid? */
#define PTP_OC_CANON_SetRemoteShootingMode 0x9086
/* 9101: no args, 8 byte data (01 00 00 00 00 00 00 00), no resp data. */
#define PTP_OC_CANON_EOS_GetStorageIDs 0x9101
/* 9102: 1 arg (0)
* 0x28 bytes of data:
00000000: 34 00 00 00 02 00 02 91 0a 00 00 00 04 00 03 00
00000010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00000020: 00 00 ff ff ff ff 03 43 00 46 00 00 00 03 41 00
00000030: 3a 00 00 00
* no resp args
*/
#define PTP_OC_CANON_EOS_GetStorageInfo 0x9102
#define PTP_OC_CANON_EOS_GetObjectInfo 0x9103
#define PTP_OC_CANON_EOS_GetObject 0x9104
#define PTP_OC_CANON_EOS_DeleteObject 0x9105
#define PTP_OC_CANON_EOS_FormatStore 0x9106
#define PTP_OC_CANON_EOS_GetPartialObject 0x9107
#define PTP_OC_CANON_EOS_GetDeviceInfoEx 0x9108
/* sample1:
* 3 cmdargs: 1,0xffffffff,00 00 10 00;
* data:
00000000: 48 00 00 00 02 00 09 91 12 00 00 00 01 00 00 00
00000010: 38 00 00 00 00 00 00 30 01 00 00 00 01 30 00 00
00000020: 01 00 00 00 10 00 00 00 00 00 00 00 00 00 00 20
00000030: 00 00 00 30 44 43 49 4d 00 00 00 00 00 00 00 00 DCIM
00000040: 00 00 00 00 cc c3 01 46
* 2 respargs: 0x0, 0x3c
*
* sample2:
*
00000000: 18 00 00 00 01 00 09 91 15 00 00 00 01 00 00 00
00000010: 00 00 00 30 00 00 10 00
00000000: 48 00 00 00 02 00 09 91 15 00 00 00 01 00 00 00
00000010: 38 00 00 00 00 00 9c 33 01 00 00 00 01 30 00 00
00000020: 01 00 00 00 10 00 00 00 00 00 00 00 00 00 00 30
00000030: 00 00 9c 33 32 33 31 43 41 4e 4f 4e 00 00 00 00 231CANON
00000040: 00 00 00 00 cc c3 01 46
*/
#define PTP_OC_CANON_EOS_GetObjectInfoEx 0x9109
#define PTP_OC_CANON_EOS_GetThumbEx 0x910A
#define PTP_OC_CANON_EOS_SendPartialObject 0x910B
#define PTP_OC_CANON_EOS_SetObjectAttributes 0x910C
#define PTP_OC_CANON_EOS_GetObjectTime 0x910D
#define PTP_OC_CANON_EOS_SetObjectTime 0x910E
/* 910f: no args, no data, 1 response arg (0). */
#define PTP_OC_CANON_EOS_RemoteRelease 0x910F
/* Marcus: looks more like "Set DeviceProperty" in the trace.
*
* no cmd args
* data phase (0xc, 0xd11c, 0x1)
* no resp args
*/
#define PTP_OC_CANON_EOS_SetDevicePropValueEx 0x9110
#define PTP_OC_CANON_EOS_GetRemoteMode 0x9113
/* 9114: 1 arg (0x1), no data, no resp data. */
#define PTP_OC_CANON_EOS_SetRemoteMode 0x9114
/* 9115: 1 arg (0x1), no data, no resp data. */
#define PTP_OC_CANON_EOS_SetEventMode 0x9115
/* 9116: no args, data phase, no resp data. */
#define PTP_OC_CANON_EOS_GetEvent 0x9116
#define PTP_OC_CANON_EOS_TransferComplete 0x9117
#define PTP_OC_CANON_EOS_CancelTransfer 0x9118
#define PTP_OC_CANON_EOS_ResetTransfer 0x9119
/* 911a: 3 args (0xfffffff7, 0x00001000, 0x00000001), no data, no resp data. */
/* 911a: 3 args (0x001dfc60, 0x00001000, 0x00000001), no data, no resp data. */
#define PTP_OC_CANON_EOS_PCHDDCapacity 0x911A
/* 911b: no cmd args, no data, no resp args */
#define PTP_OC_CANON_EOS_SetUILock 0x911B
/* 911c: no cmd args, no data, no resp args */
#define PTP_OC_CANON_EOS_ResetUILock 0x911C
#define PTP_OC_CANON_EOS_KeepDeviceOn 0x911D /* no arg */
#define PTP_OC_CANON_EOS_SetNullPacketMode 0x911E /* 1 param */
#define PTP_OC_CANON_EOS_UpdateFirmware 0x911F
#define PTP_OC_CANON_EOS_TransferCompleteDT 0x9120
#define PTP_OC_CANON_EOS_CancelTransferDT 0x9121
#define PTP_OC_CANON_EOS_SetWftProfile 0x9122
#define PTP_OC_CANON_EOS_GetWftProfile 0x9123 /* 2 args: setnum, configid */
#define PTP_OC_CANON_EOS_SetProfileToWft 0x9124
#define PTP_OC_CANON_EOS_BulbStart 0x9125
#define PTP_OC_CANON_EOS_BulbEnd 0x9126
#define PTP_OC_CANON_EOS_RequestDevicePropValue 0x9127
/* 0x9128 args (0x1/0x2, 0x0), no data, no resp args */
#define PTP_OC_CANON_EOS_RemoteReleaseOn 0x9128
/* 0x9129 args (0x1/0x2), no data, no resp args */
#define PTP_OC_CANON_EOS_RemoteReleaseOff 0x9129
#define PTP_OC_CANON_EOS_RegistBackgroundImage 0x912A
#define PTP_OC_CANON_EOS_ChangePhotoStudioMode 0x912B
#define PTP_OC_CANON_EOS_GetPartialObjectEx 0x912C
#define PTP_OC_CANON_EOS_ResetMirrorLockupState 0x9130 /* no args */
#define PTP_OC_CANON_EOS_PopupBuiltinFlash 0x9131
#define PTP_OC_CANON_EOS_EndGetPartialObjectEx 0x9132
#define PTP_OC_CANON_EOS_MovieSelectSWOn 0x9133 /* no args */
#define PTP_OC_CANON_EOS_MovieSelectSWOff 0x9134 /* no args */
#define PTP_OC_CANON_EOS_GetCTGInfo 0x9135
#define PTP_OC_CANON_EOS_GetLensAdjust 0x9136
#define PTP_OC_CANON_EOS_SetLensAdjust 0x9137
#define PTP_OC_CANON_EOS_ReadyToSendMusic 0x9138
/* 3 paramaeters, no data, OFC, size, unknown */
#define PTP_OC_CANON_EOS_CreateHandle 0x9139
#define PTP_OC_CANON_EOS_SendPartialObjectEx 0x913A
#define PTP_OC_CANON_EOS_EndSendPartialObjectEx 0x913B
#define PTP_OC_CANON_EOS_SetCTGInfo 0x913C
#define PTP_OC_CANON_EOS_SetRequestOLCInfoGroup 0x913D
#define PTP_OC_CANON_EOS_SetRequestRollingPitchingLevel 0x913E /* 1 arg: onoff? */
/* 3 args, 0x21201020, 0x110, 0x1000000 (potentially reverse order) */
#define PTP_OC_CANON_EOS_GetCameraSupport 0x913F
#define PTP_OC_CANON_EOS_SetRating 0x9140 /* 2 args, objectid, rating? */
#define PTP_OC_CANON_EOS_RequestInnerDevelopStart 0x9141 /* 2 args: 1 type, 1 object? */
#define PTP_OC_CANON_EOS_RequestInnerDevelopParamChange 0x9142
#define PTP_OC_CANON_EOS_RequestInnerDevelopEnd 0x9143
#define PTP_OC_CANON_EOS_GpsLoggingDataMode 0x9144 /* 1 arg */
#define PTP_OC_CANON_EOS_GetGpsLogCurrentHandle 0x9145
#define PTP_OC_CANON_EOS_SetImageRecoveryData 0x9146 /* sends data? */
#define PTP_OC_CANON_EOS_GetImageRecoveryList 0x9147
#define PTP_OC_CANON_EOS_FormatImageRecoveryData 0x9148
#define PTP_OC_CANON_EOS_GetPresetLensAdjustParam 0x9149 /* no arg */
#define PTP_OC_CANON_EOS_GetRawDispImage 0x914A /* ? 2 args ? */
#define PTP_OC_CANON_EOS_SaveImageRecoveryData 0x914B
#define PTP_OC_CANON_EOS_RequestBLE 0x914C /* 2? args? */
#define PTP_OC_CANON_EOS_DrivePowerZoom 0x914D /* 1 arg */
#define PTP_OC_CANON_EOS_GetIptcData 0x914F
#define PTP_OC_CANON_EOS_SetIptcData 0x9150 /* sends data? */
#define PTP_OC_CANON_EOS_InitiateViewfinder 0x9151 /* no arg */
#define PTP_OC_CANON_EOS_TerminateViewfinder 0x9152
/* EOS M2 wlan: 2 params, 0x00200000 0x01000000 */
#define PTP_OC_CANON_EOS_GetViewFinderData 0x9153
#define PTP_OC_CANON_EOS_DoAf 0x9154
#define PTP_OC_CANON_EOS_DriveLens 0x9155
#define PTP_OC_CANON_EOS_DepthOfFieldPreview 0x9156 /* 1 arg */
#define PTP_OC_CANON_EOS_ClickWB 0x9157 /* 2 args: x,y */
#define PTP_OC_CANON_EOS_Zoom 0x9158 /* 1 arg: zoom */
#define PTP_OC_CANON_EOS_ZoomPosition 0x9159 /* 2 args: x,y */
#define PTP_OC_CANON_EOS_SetLiveAfFrame 0x915A /* sends data? */
#define PTP_OC_CANON_EOS_TouchAfPosition 0x915B /* 3 args: type,x,y */
#define PTP_OC_CANON_EOS_SetLvPcFlavoreditMode 0x915C /* 1 arg */
#define PTP_OC_CANON_EOS_SetLvPcFlavoreditParam 0x915D /* 1 arg */
#define PTP_OC_CANON_EOS_AfCancel 0x9160
#define PTP_OC_CANON_EOS_SetImageRecoveryDataEx 0x916B
#define PTP_OC_CANON_EOS_GetImageRecoveryListEx 0x916C
#define PTP_OC_CANON_EOS_NotifyAutoTransferStatus 0x916E
#define PTP_OC_CANON_EOS_GetReducedObject 0x916F
#define PTP_OC_CANON_EOS_GetObjectInfo64 0x9170 /* 1 arg: oid */
#define PTP_OC_CANON_EOS_GetObject64 0x9171 /* 1 arg: oid */
#define PTP_OC_CANON_EOS_GetPartialObject64 0x9172 /* args: oid, offset, maxbyte */
#define PTP_OC_CANON_EOS_GetObjectInfoEx64 0x9173 /* 2 args: storageid, oid ? */
#define PTP_OC_CANON_EOS_GetPartialObjectEX64 0x9174 /* args: oid, offset 64bit, maxbyte */
#define PTP_OC_CANON_EOS_CreateHandle64 0x9175
#define PTP_OC_CANON_EOS_NotifySaveComplete 0x9177
#define PTP_OC_CANON_EOS_NotifyEstimateNumberofImport 0x9182 /* 1 arg: importnumber */
#define PTP_OC_CANON_EOS_NotifyNumberofImported 0x9183 /* 1 arg: importnumber */
#define PTP_OC_CANON_EOS_NotifySizeOfPartialDataTransfer 0x9184 /* 4 args: filesizelow, filesizehigh, downloadsizelow, downloadsizehigh */
#define PTP_OC_CANON_EOS_NotifyFinish 0x9185 /* 1 arg: reason */
#define PTP_OC_CANON_EOS_GetObjectURL 0x91AB
#define PTP_OC_CANON_EOS_SetFELock 0x91B9
#define PTP_OC_CANON_EOS_SetDefaultCameraSetting 0x91BE
#define PTP_OC_CANON_EOS_GetAEData 0x91BF
#define PTP_OC_CANON_EOS_NotifyNetworkError 0x91E8 /* 1 arg: errorcode */
#define PTP_OC_CANON_EOS_AdapterTransferProgress 0x91E9
#define PTP_OC_CANON_EOS_TransferCompleteFTP 0x91F0
#define PTP_OC_CANON_EOS_CancelTransferFTP 0x91F1
#define PTP_OC_CANON_EOS_FAPIMessageTX 0x91FE
#define PTP_OC_CANON_EOS_FAPIMessageRX 0x91FF
/* A1E8 ... also seen? is an error code? */
/* Nikon extension Operation Codes */
#define PTP_OC_NIKON_GetProfileAllData 0x9006
#define PTP_OC_NIKON_SendProfileData 0x9007
#define PTP_OC_NIKON_DeleteProfile 0x9008
#define PTP_OC_NIKON_SetProfileData 0x9009
#define PTP_OC_NIKON_AdvancedTransfer 0x9010
#define PTP_OC_NIKON_GetFileInfoInBlock 0x9011
#define PTP_OC_NIKON_Capture 0x90C0 /* 1 param, no data */
#define PTP_OC_NIKON_AfDrive 0x90C1 /* no params, no data */
#define PTP_OC_NIKON_SetControlMode 0x90C2 /* 1 param, no data */
#define PTP_OC_NIKON_DelImageSDRAM 0x90C3 /* 1 param, no data */
#define PTP_OC_NIKON_GetLargeThumb 0x90C4
#define PTP_OC_NIKON_CurveDownload 0x90C5 /* 1 param, data in */
#define PTP_OC_NIKON_CurveUpload 0x90C6 /* 1 param, data out */
#define PTP_OC_NIKON_CheckEvent 0x90C7 /* no params, data in */
#define PTP_OC_NIKON_DeviceReady 0x90C8 /* no params, no data */
#define PTP_OC_NIKON_SetPreWBData 0x90C9 /* 3 params, data out */
#define PTP_OC_NIKON_GetVendorPropCodes 0x90CA /* 0 params, data in */
#define PTP_OC_NIKON_AfCaptureSDRAM 0x90CB /* no params, no data */
#define PTP_OC_NIKON_GetPictCtrlData 0x90CC /* 2 params, data in */
#define PTP_OC_NIKON_SetPictCtrlData 0x90CD /* 2 params, data out */
#define PTP_OC_NIKON_DelCstPicCtrl 0x90CE /* 1 param, no data */
#define PTP_OC_NIKON_GetPicCtrlCapability 0x90CF /* 1 param, data in */
/* Nikon Liveview stuff */
#define PTP_OC_NIKON_GetPreviewImg 0x9200
#define PTP_OC_NIKON_StartLiveView 0x9201 /* no params */
#define PTP_OC_NIKON_EndLiveView 0x9202 /* no params */
#define PTP_OC_NIKON_GetLiveViewImg 0x9203 /* no params, data in */
#define PTP_OC_NIKON_MfDrive 0x9204 /* 2 params */
#define PTP_OC_NIKON_ChangeAfArea 0x9205 /* 2 params */
#define PTP_OC_NIKON_AfDriveCancel 0x9206 /* no params */
/* 2 params:
* 0xffffffff == No AF before, 0xfffffffe == AF before capture
* sdram=1, card=0
*/
#define PTP_OC_NIKON_InitiateCaptureRecInMedia 0x9207 /* 1 params */
#define PTP_OC_NIKON_GetVendorStorageIDs 0x9209 /* no params, data in */
#define PTP_OC_NIKON_StartMovieRecInCard 0x920a /* no params, no data */
#define PTP_OC_NIKON_EndMovieRec 0x920b /* no params, no data */
#define PTP_OC_NIKON_TerminateCapture 0x920c /* 2 params */
#define PTP_OC_NIKON_GetDevicePTPIPInfo 0x90E0
#define PTP_OC_NIKON_GetPartialObjectHiSpeed 0x9400 /* 3 params, data in */
/* From Nikon V1 Trace */
#define PTP_OC_NIKON_GetDevicePropEx 0x9504 /* gets device prop data */
/* Casio EX-F1 (from http://code.google.com/p/exf1ctrl/ ) */
#define PTP_OC_CASIO_STILL_START 0x9001
#define PTP_OC_CASIO_STILL_STOP 0x9002
#define PTP_OC_CASIO_FOCUS 0x9007
#define PTP_OC_CASIO_CF_PRESS 0x9009
#define PTP_OC_CASIO_CF_RELEASE 0x900A
#define PTP_OC_CASIO_GET_OBJECT_INFO 0x900C
#define PTP_OC_CASIO_SHUTTER 0x9024
#define PTP_OC_CASIO_GET_STILL_HANDLES 0x9027
#define PTP_OC_CASIO_STILL_RESET 0x9028
#define PTP_OC_CASIO_HALF_PRESS 0x9029
#define PTP_OC_CASIO_HALF_RELEASE 0x902A
#define PTP_OC_CASIO_CS_PRESS 0x902B
#define PTP_OC_CASIO_CS_RELEASE 0x902C
#define PTP_OC_CASIO_ZOOM 0x902D
#define PTP_OC_CASIO_CZ_PRESS 0x902E
#define PTP_OC_CASIO_CZ_RELEASE 0x902F
#define PTP_OC_CASIO_MOVIE_START 0x9041
#define PTP_OC_CASIO_MOVIE_STOP 0x9042
#define PTP_OC_CASIO_MOVIE_PRESS 0x9043
#define PTP_OC_CASIO_MOVIE_RELEASE 0x9044
#define PTP_OC_CASIO_GET_MOVIE_HANDLES 0x9045
#define PTP_OC_CASIO_MOVIE_RESET 0x9046
#define PTP_OC_CASIO_GET_OBJECT 0x9025
#define PTP_OC_CASIO_GET_THUMBNAIL 0x9026
/* Sony stuff */
/* 9201:
* 3 params: 1,0,0 ; IN: data 8 bytes all 0
* or:
* 3 params: 2,0,0 ; IN: data 8 bytes all 0
* or
* 3 params: 3,0,0,: IN: data 8 butes all 0
*/
#define PTP_OC_SONY_SDIOConnect 0x9201
/* 9202: 1 param, 0xc8; IN data:
* 16 bit: 0xc8
* ptp array 32 bit: index, 16 bit values of propcodes */
#define PTP_OC_SONY_GetSDIOGetExtDeviceInfo 0x9202
#define PTP_OC_SONY_GetDevicePropdesc 0x9203
#define PTP_OC_SONY_GetDevicePropertyValue 0x9204
/* 1 param, 16bit propcode, SEND DATA: propvalue */
#define PTP_OC_SONY_SetControlDeviceA 0x9205
#define PTP_OC_SONY_GetControlDeviceDesc 0x9206
/* 1 param, 16bit propcode, SEND DATA: propvalue */
#define PTP_OC_SONY_SetControlDeviceB 0x9207
/* get all device property data at once */
#define PTP_OC_SONY_GetAllDevicePropData 0x9209 /* gets a 4126 byte blob of device props ?*/
/* Microsoft / MTP extension codes */
#define PTP_OC_MTP_GetObjectPropsSupported 0x9801
#define PTP_OC_MTP_GetObjectPropDesc 0x9802
#define PTP_OC_MTP_GetObjectPropValue 0x9803
#define PTP_OC_MTP_SetObjectPropValue 0x9804
#define PTP_OC_MTP_GetObjPropList 0x9805
#define PTP_OC_MTP_SetObjPropList 0x9806
#define PTP_OC_MTP_GetInterdependendPropdesc 0x9807
#define PTP_OC_MTP_SendObjectPropList 0x9808
#define PTP_OC_MTP_GetObjectReferences 0x9810
#define PTP_OC_MTP_SetObjectReferences 0x9811
#define PTP_OC_MTP_UpdateDeviceFirmware 0x9812
#define PTP_OC_MTP_Skip 0x9820
/*
* Windows Media Digital Rights Management for Portable Devices
* Extension Codes (microsoft.com/WMDRMPD: 10.1)
*/
#define PTP_OC_MTP_WMDRMPD_GetSecureTimeChallenge 0x9101
#define PTP_OC_MTP_WMDRMPD_GetSecureTimeResponse 0x9102
#define PTP_OC_MTP_WMDRMPD_SetLicenseResponse 0x9103
#define PTP_OC_MTP_WMDRMPD_GetSyncList 0x9104
#define PTP_OC_MTP_WMDRMPD_SendMeterChallengeQuery 0x9105
#define PTP_OC_MTP_WMDRMPD_GetMeterChallenge 0x9106
#define PTP_OC_MTP_WMDRMPD_SetMeterResponse 0x9107
#define PTP_OC_MTP_WMDRMPD_CleanDataStore 0x9108
#define PTP_OC_MTP_WMDRMPD_GetLicenseState 0x9109
#define PTP_OC_MTP_WMDRMPD_SendWMDRMPDCommand 0x910A
#define PTP_OC_MTP_WMDRMPD_SendWMDRMPDRequest 0x910B
/*
* Windows Media Digital Rights Management for Portable Devices
* Extension Codes (microsoft.com/WMDRMPD: 10.1)
* Below are operations that have no public documented identifier
* associated with them "Vendor-defined Command Code"
*/
#define PTP_OC_MTP_WMDRMPD_SendWMDRMPDAppRequest 0x9212
#define PTP_OC_MTP_WMDRMPD_GetWMDRMPDAppResponse 0x9213
#define PTP_OC_MTP_WMDRMPD_EnableTrustedFilesOperations 0x9214
#define PTP_OC_MTP_WMDRMPD_DisableTrustedFilesOperations 0x9215
#define PTP_OC_MTP_WMDRMPD_EndTrustedAppSession 0x9216
/* ^^^ guess ^^^ */
/*
* Microsoft Advanced Audio/Video Transfer
* Extensions (microsoft.com/AAVT: 1.0)
*/
#define PTP_OC_MTP_AAVT_OpenMediaSession 0x9170
#define PTP_OC_MTP_AAVT_CloseMediaSession 0x9171
#define PTP_OC_MTP_AAVT_GetNextDataBlock 0x9172
#define PTP_OC_MTP_AAVT_SetCurrentTimePosition 0x9173
/*
* Windows Media Digital Rights Management for Network Devices
* Extensions (microsoft.com/WMDRMND: 1.0) MTP/IP?
*/
#define PTP_OC_MTP_WMDRMND_SendRegistrationRequest 0x9180
#define PTP_OC_MTP_WMDRMND_GetRegistrationResponse 0x9181
#define PTP_OC_MTP_WMDRMND_GetProximityChallenge 0x9182
#define PTP_OC_MTP_WMDRMND_SendProximityResponse 0x9183
#define PTP_OC_MTP_WMDRMND_SendWMDRMNDLicenseRequest 0x9184
#define PTP_OC_MTP_WMDRMND_GetWMDRMNDLicenseResponse 0x9185
/*
* Windows Media Player Portiable Devices
* Extension Codes (microsoft.com/WMPPD: 11.1)
*/
#define PTP_OC_MTP_WMPPD_ReportAddedDeletedItems 0x9201
#define PTP_OC_MTP_WMPPD_ReportAcquiredItems 0x9202
#define PTP_OC_MTP_WMPPD_PlaylistObjectPref 0x9203
/*
* Undocumented Zune Operation Codes
* maybe related to WMPPD extension set?
*/
#define PTP_OC_MTP_ZUNE_GETUNDEFINED001 0x9204
/* WiFi Provisioning MTP Extension Codes (microsoft.com/WPDWCN: 1.0) */
#define PTP_OC_MTP_WPDWCN_ProcessWFCObject 0x9122
/* Olympus OMD series commands */
#define PTP_OC_OLYMPUS_OMD_Capture 0x9481
#define PTP_OC_OLYMPUS_GetLiveViewImage 0x9484 /* liveview */
#define PTP_OC_OLYMPUS_OMD_GetImage 0x9485 /* gets an JPEG image (from the capture? SDRAM style?) */
#define PTP_OC_OLYMPUS_OMD_ChangedProperties 0x9486
#define PTP_OC_OLYMPUS_OMD_MFDrive 0x9487
#define PTP_OC_OLYMPUS_OMD_SetProperties 0x9489 /* Sends to the device a PTP list of all 16 bit device properties , count 32bit, then 16bit vals */
/* Olympus E series commands */
#define PTP_OC_OLYMPUS_Capture 0x9101
#define PTP_OC_OLYMPUS_SelfCleaning 0x9103
#define PTP_OC_OLYMPUS_SetRGBGain 0x9106
#define PTP_OC_OLYMPUS_SetPresetMode 0x9107
#define PTP_OC_OLYMPUS_SetWBBiasAll 0x9108
#define PTP_OC_OLYMPUS_GetCameraControlMode 0x910a
#define PTP_OC_OLYMPUS_SetCameraControlMode 0x910b
#define PTP_OC_OLYMPUS_SetWBRGBGain 0x910c
#define PTP_OC_OLYMPUS_GetDeviceInfo 0x9301
#define PTP_OC_OLYMPUS_OpenSession 0x9302
#define PTP_OC_OLYMPUS_SetDateTime 0x9402
#define PTP_OC_OLYMPUS_GetDateTime 0x9482
#define PTP_OC_OLYMPUS_SetCameraID 0x9501
#define PTP_OC_OLYMPUS_GetCameraID 0x9581
/* Android Random I/O Extensions Codes */
#define PTP_OC_ANDROID_GetPartialObject64 0x95C1
#define PTP_OC_ANDROID_SendPartialObject 0x95C2
#define PTP_OC_ANDROID_TruncateObject 0x95C3
#define PTP_OC_ANDROID_BeginEditObject 0x95C4
#define PTP_OC_ANDROID_EndEditObject 0x95C5
/* Leica opcodes, from Lightroom tether plugin */
/* also from:
* https://alexhude.github.io/2019/01/24/hacking-leica-m240.html */
#define PTP_OC_LEICA_SetCameraSettings 0x9001
#define PTP_OC_LEICA_GetCameraSettings 0x9002
#define PTP_OC_LEICA_GetLensParameter 0x9003
/* probably 2 arguments.
* generic: releaseStage, stepSize
* Release(releasestage) = (releasestage,0)
* Release() = (0,0)
* AEStart() = (1,0)
* Autofocusrelease() = (2,0)
* AutofocusPush() = (1,0) ... same as AEStart?
* KeepCameraActive() = (0xe,0)
*/
#define PTP_OC_LEICA_Release 0x9004
#define PTP_OC_LEICA_OpenLESession 0x9005
#define PTP_OC_LEICA_CloseLESession 0x9006
#define PTP_OC_LEICA_RequestObjectTransferReady 0x9007
#define PTP_OC_LEICA_GetGeoTrackingData 0x9008
#define PTP_OC_LEICA_OpenDebugSession 0x900a
#define PTP_OC_LEICA_CloseDebugSession 0x900b
#define PTP_OC_LEICA_GetDebugBuffer 0x900c
#define PTP_OC_LEICA_DebugCommandString 0x900d
#define PTP_OC_LEICA_GetDebugRoute 0x900e
#define PTP_OC_LEICA_SetIPTCData 0x900f
#define PTP_OC_LEICA_GetIPTCData 0x9010
#define PTP_OC_LEICA_Get3DAxisData 0x9020
#define PTP_OC_LEICA_OpenLiveViewSession 0x9030
#define PTP_OC_LEICA_CloseLiveViewSession 0x9031
#define PTP_OC_LEICA_OpenProductionSession 0x9100
#define PTP_OC_LEICA_CloseProductionSession 0x9101
#define PTP_OC_LEICA_UpdateFirmware 0x9102
#define PTP_OC_LEICA_OpenOSDSession 0x9103
#define PTP_OC_LEICA_CloseOSDSession 0x9104
#define PTP_OC_LEICA_GetOSDData 0x9105
#define PTP_OC_LEICA_GetFirmwareStruct 0x9106
#define PTP_OC_LEICA_GetDebugMenu 0x910b
#define PTP_OC_LEICA_SetDebugMenu 0x910c
#define PTP_OC_LEICA_OdinMessage 0x910d
#define PTP_OC_LEICA_GetDebugObjectHandles 0x910e
#define PTP_OC_LEICA_GetDebugObject 0x910f
#define PTP_OC_LEICA_DeleteDebugObject 0x9110
#define PTP_OC_LEICA_GetDebugObjectInfo 0x9111
#define PTP_OC_LEICA_WriteDebugObject 0x9112
#define PTP_OC_LEICA_CreateDebugObject 0x9113
#define PTP_OC_LEICA_Calibrate3DAxis 0x9114
#define PTP_OC_LEICA_MagneticCalibration 0x9115
#define PTP_OC_LEICA_GetViewFinderData 0x9116
#define PTP_OC_PARROT_GetSunshineValues 0x9201
#define PTP_OC_PARROT_GetTemperatureValues 0x9202
#define PTP_OC_PARROT_GetAngleValues 0x9203
#define PTP_OC_PARROT_GetGpsValues 0x9204
#define PTP_OC_PARROT_GetGyroscopeValues 0x9205
#define PTP_OC_PARROT_GetAccelerometerValues 0x9206
#define PTP_OC_PARROT_GetMagnetometerValues 0x9207
#define PTP_OC_PARROT_GetImuValues 0x9208
#define PTP_OC_PARROT_GetStatusMask 0x9209
#define PTP_OC_PARROT_EjectStorage 0x920A
#define PTP_OC_PARROT_StartMagnetoCalib 0x9210
#define PTP_OC_PARROT_StopMagnetoCalib 0x9211
#define PTP_OC_PARROT_MagnetoCalibStatus 0x9212
#define PTP_OC_PARROT_SendFirmwareUpdate 0x9213
#define PTP_OC_PANASONIC_9101 0x9101
#define PTP_OC_PANASONIC_OpenSession 0x9102 /* opensession (1 arg, seems to be storage id 0x00010001)*/
#define PTP_OC_PANASONIC_CloseSession 0x9103 /* closesession (no arg) */
#define PTP_OC_PANASONIC_9104 0x9104 /* get ext device id (1 arg?) */
/* 9104 gets this data:
0000 24 00 00 00 02 00 04 91-04 00 00 00 01 00 01 00 $...............
0010 01 00 e1 07 10 00 00 00-00 00 00 00 00 00 00 00 ................
0020 00 00 00 00 - ....
*/
#define PTP_OC_PANASONIC_9107 0x9107 /* getsize? */
#define PTP_OC_PANASONIC_ListProperty 0x9108
#define PTP_OC_PANASONIC_9110 0x9110 /* Get_Object infos */
#define PTP_OC_PANASONIC_9112 0x9112 /* Get Partial Object , 4 args */
#define PTP_OC_PANASONIC_9113 0x9113 /* Skip Objects Transfer , 1 arg */
#define PTP_OC_PANASONIC_9401 0x9401
#define PTP_OC_PANASONIC_GetProperty 0x9402
#define PTP_OC_PANASONIC_SetProperty 0x9403
#define PTP_OC_PANASONIC_InitiateCapture 0x9404 /* Rec Ctrl Release */
#define PTP_OC_PANASONIC_9405 0x9405 /* Rec Ctrl AF AE */
#define PTP_OC_PANASONIC_9406 0x9406 /* Setup Ctrl various functions: Format, Sensor Cleaning, Menu Save, firmware update? */
#define PTP_OC_PANASONIC_9408 0x9408
#define PTP_OC_PANASONIC_9409 0x9409 /* 1 arg */
#define PTP_OC_PANASONIC_940A 0x940A /* 1 arg, e.g. 0x08000010 */
#define PTP_OC_PANASONIC_SetCaptureTarget 0x940B /* 1 arg, e.g. 0x08000010 */
#define PTP_OC_PANASONIC_MoveRecControl 0x940C /* 07000011 start, 07000012 stop, 0700013 still capture */
#define PTP_OC_PANASONIC_PowerControl 0x940D /* 1 arg: 0x0A000011 power off, 0x0a00012 device reset, 0x0a00013 device restart */
#define PTP_OC_PANASONIC_PlayControl 0x940E /* 2 arg? 0x05000011 current=0, next=1, prev=0xffffffff */
#define PTP_OC_PANASONIC_PlayControlPlay 0x940F /* 0x05000020 */
#define PTP_OC_PANASONIC_9410 0x9410 /* Rec Ctrl Other */
#define PTP_OC_PANASONIC_SetGPSDataInfo 0x9411
#define PTP_OC_PANASONIC_Liveview 0x9412 /* 0d000010 start, 0d000011 stop */
#define PTP_OC_PANASONIC_PollEvents 0x9414 /* ? 1 arg e.g 12000020 */
#define PTP_OC_PANASONIC_ManualFocusDrive 0x9416 /* Rec Ctrl Mf Assist, Rec Ctrl Backup Req ... 1 arg */
#define PTP_OC_PANASONIC_ChangeEvent 0x9603 /* 2 args ... e.g. 0x4002, new (change object added event) */
#define PTP_OC_PANASONIC_GetFromEventInfo 0x9605 /* 1 arg, e.g. 0x41000013 , 15c00021: setup exec menu save comp, 15c00022: setup exec pixel refresh comp */
#define PTP_OC_PANASONIC_SendDataInfo 0x9606 /* no args? used during firmware update */
#define PTP_OC_PANASONIC_StartSendData 0x9607 /* no args? used during firmware update */
#define PTP_OC_PANASONIC_9703 0x9703 /* Mnt_GetInfo_GetVersion ... 1 arg? */
#define PTP_OC_PANASONIC_9704 0x9704 /* Set USB Mode ... 80040001 */
#define PTP_OC_PANASONIC_9705 0x9705 /* Ctrl Liveview */
#define PTP_OC_PANASONIC_LiveviewImage 0x9706 /* Get Liveview Data */
#define PTP_OC_PANASONIC_9707 0x9707 /* 4k6k cutting get stream */
/* Proprietary vendor extension operations mask */
#define PTP_OC_EXTENSION_MASK 0xF000
#define PTP_OC_EXTENSION 0x9000
/* Response Codes */
/* PTP v1.0 response codes */
#define PTP_RC_Undefined 0x2000
#define PTP_RC_OK 0x2001
#define PTP_RC_GeneralError 0x2002
#define PTP_RC_SessionNotOpen 0x2003
#define PTP_RC_InvalidTransactionID 0x2004
#define PTP_RC_OperationNotSupported 0x2005
#define PTP_RC_ParameterNotSupported 0x2006
#define PTP_RC_IncompleteTransfer 0x2007
#define PTP_RC_InvalidStorageId 0x2008
#define PTP_RC_InvalidObjectHandle 0x2009
#define PTP_RC_DevicePropNotSupported 0x200A
#define PTP_RC_InvalidObjectFormatCode 0x200B
#define PTP_RC_StoreFull 0x200C
#define PTP_RC_ObjectWriteProtected 0x200D
#define PTP_RC_StoreReadOnly 0x200E
#define PTP_RC_AccessDenied 0x200F
#define PTP_RC_NoThumbnailPresent 0x2010
#define PTP_RC_SelfTestFailed 0x2011
#define PTP_RC_PartialDeletion 0x2012
#define PTP_RC_StoreNotAvailable 0x2013
#define PTP_RC_SpecificationByFormatUnsupported 0x2014
#define PTP_RC_NoValidObjectInfo 0x2015
#define PTP_RC_InvalidCodeFormat 0x2016
#define PTP_RC_UnknownVendorCode 0x2017
#define PTP_RC_CaptureAlreadyTerminated 0x2018
#define PTP_RC_DeviceBusy 0x2019
#define PTP_RC_InvalidParentObject 0x201A
#define PTP_RC_InvalidDevicePropFormat 0x201B
#define PTP_RC_InvalidDevicePropValue 0x201C
#define PTP_RC_InvalidParameter 0x201D
#define PTP_RC_SessionAlreadyOpened 0x201E
#define PTP_RC_TransactionCanceled 0x201F
#define PTP_RC_SpecificationOfDestinationUnsupported 0x2020
/* PTP v1.1 response codes */
#define PTP_RC_InvalidEnumHandle 0x2021
#define PTP_RC_NoStreamEnabled 0x2022
#define PTP_RC_InvalidDataSet 0x2023
/* Eastman Kodak extension Response Codes */
#define PTP_RC_EK_FilenameRequired 0xA001
#define PTP_RC_EK_FilenameConflicts 0xA002
#define PTP_RC_EK_FilenameInvalid 0xA003
/* Nikon specific response codes */
#define PTP_RC_NIKON_HardwareError 0xA001
#define PTP_RC_NIKON_OutOfFocus 0xA002
#define PTP_RC_NIKON_ChangeCameraModeFailed 0xA003
#define PTP_RC_NIKON_InvalidStatus 0xA004
#define PTP_RC_NIKON_SetPropertyNotSupported 0xA005
#define PTP_RC_NIKON_WbResetError 0xA006
#define PTP_RC_NIKON_DustReferenceError 0xA007
#define PTP_RC_NIKON_ShutterSpeedBulb 0xA008
#define PTP_RC_NIKON_MirrorUpSequence 0xA009
#define PTP_RC_NIKON_CameraModeNotAdjustFNumber 0xA00A
#define PTP_RC_NIKON_NotLiveView 0xA00B
#define PTP_RC_NIKON_MfDriveStepEnd 0xA00C
#define PTP_RC_NIKON_MfDriveStepInsufficiency 0xA00E
#define PTP_RC_NIKON_AdvancedTransferCancel 0xA022
/* Canon specific response codes */
#define PTP_RC_CANON_UNKNOWN_COMMAND 0xA001
#define PTP_RC_CANON_OPERATION_REFUSED 0xA005
#define PTP_RC_CANON_LENS_COVER 0xA006
#define PTP_RC_CANON_BATTERY_LOW 0xA101
#define PTP_RC_CANON_NOT_READY 0xA102
#define PTP_RC_CANON_A009 0xA009
#define PTP_RC_CANON_EOS_UnknownCommand 0xA001
#define PTP_RC_CANON_EOS_OperationRefused 0xA005
#define PTP_RC_CANON_EOS_LensCoverClosed 0xA006
#define PTP_RC_CANON_EOS_LowBattery 0xA101
#define PTP_RC_CANON_EOS_ObjectNotReady 0xA102
#define PTP_RC_CANON_EOS_CannotMakeObject 0xA104
#define PTP_RC_CANON_EOS_MemoryStatusNotReady 0xA106
/* Microsoft/MTP specific codes */
#define PTP_RC_MTP_Undefined 0xA800
#define PTP_RC_MTP_Invalid_ObjectPropCode 0xA801
#define PTP_RC_MTP_Invalid_ObjectProp_Format 0xA802
#define PTP_RC_MTP_Invalid_ObjectProp_Value 0xA803
#define PTP_RC_MTP_Invalid_ObjectReference 0xA804
#define PTP_RC_MTP_Invalid_Dataset 0xA806
#define PTP_RC_MTP_Specification_By_Group_Unsupported 0xA807
#define PTP_RC_MTP_Specification_By_Depth_Unsupported 0xA808
#define PTP_RC_MTP_Object_Too_Large 0xA809
#define PTP_RC_MTP_ObjectProp_Not_Supported 0xA80A
/* Microsoft Advanced Audio/Video Transfer response codes
(microsoft.com/AAVT 1.0) */
#define PTP_RC_MTP_Invalid_Media_Session_ID 0xA170
#define PTP_RC_MTP_Media_Session_Limit_Reached 0xA171
#define PTP_RC_MTP_No_More_Data 0xA172
/* WiFi Provisioning MTP Extension Error Codes (microsoft.com/WPDWCN: 1.0) */
#define PTP_RC_MTP_Invalid_WFC_Syntax 0xA121
#define PTP_RC_MTP_WFC_Version_Not_Supported 0xA122
/* libptp2 extended ERROR codes */
#define PTP_ERROR_NODEVICE 0x02F9
#define PTP_ERROR_TIMEOUT 0x02FA
#define PTP_ERROR_CANCEL 0x02FB
#define PTP_ERROR_BADPARAM 0x02FC
#define PTP_ERROR_RESP_EXPECTED 0x02FD
#define PTP_ERROR_DATA_EXPECTED 0x02FE
#define PTP_ERROR_IO 0x02FF
/* PTP Event Codes */
#define PTP_EC_Undefined 0x4000
#define PTP_EC_CancelTransaction 0x4001
#define PTP_EC_ObjectAdded 0x4002
#define PTP_EC_ObjectRemoved 0x4003
#define PTP_EC_StoreAdded 0x4004
#define PTP_EC_StoreRemoved 0x4005
#define PTP_EC_DevicePropChanged 0x4006
#define PTP_EC_ObjectInfoChanged 0x4007
#define PTP_EC_DeviceInfoChanged 0x4008
#define PTP_EC_RequestObjectTransfer 0x4009
#define PTP_EC_StoreFull 0x400A
#define PTP_EC_DeviceReset 0x400B
#define PTP_EC_StorageInfoChanged 0x400C
#define PTP_EC_CaptureComplete 0x400D
#define PTP_EC_UnreportedStatus 0x400E
/* Canon extension Event Codes */
#define PTP_EC_CANON_ExtendedErrorcode 0xC005 /* ? */
#define PTP_EC_CANON_ObjectInfoChanged 0xC008
#define PTP_EC_CANON_RequestObjectTransfer 0xC009
#define PTP_EC_CANON_ShutterButtonPressed0 0xC00B
#define PTP_EC_CANON_CameraModeChanged 0xC00C
#define PTP_EC_CANON_ShutterButtonPressed1 0xC00E
#define PTP_EC_CANON_StartDirectTransfer 0xC011
#define PTP_EC_CANON_StopDirectTransfer 0xC013
#define PTP_EC_CANON_TranscodeProgress 0xC01B /* EOS ? */
/* Canon EOS events */
#define PTP_EC_CANON_EOS_RequestGetEvent 0xc101
#define PTP_EC_CANON_EOS_RequestCancelTransferMA 0xc180
#define PTP_EC_CANON_EOS_ObjectAddedEx 0xc181
#define PTP_EC_CANON_EOS_ObjectRemoved 0xc182
#define PTP_EC_CANON_EOS_RequestGetObjectInfoEx 0xc183
#define PTP_EC_CANON_EOS_StorageStatusChanged 0xc184
#define PTP_EC_CANON_EOS_StorageInfoChanged 0xc185
#define PTP_EC_CANON_EOS_RequestObjectTransfer 0xc186
#define PTP_EC_CANON_EOS_ObjectInfoChangedEx 0xc187
#define PTP_EC_CANON_EOS_ObjectContentChanged 0xc188
#define PTP_EC_CANON_EOS_PropValueChanged 0xc189
#define PTP_EC_CANON_EOS_AvailListChanged 0xc18a
#define PTP_EC_CANON_EOS_CameraStatusChanged 0xc18b
#define PTP_EC_CANON_EOS_WillSoonShutdown 0xc18d
#define PTP_EC_CANON_EOS_ShutdownTimerUpdated 0xc18e
#define PTP_EC_CANON_EOS_RequestCancelTransfer 0xc18f