root/tools/ptp_op_names.c

/* [<][>][^][v][top][bottom][index][help] */

DEFINITIONS

This source file includes following definitions.
  1. get_ptp_op_name

   1 #include <stddef.h>
   2 #include <stdint.h>
   3 #include "ptp_op_names.h"
   4 
   5 typedef struct {
   6     const char *name;
   7     uint32_t op;
   8 } ptp_op_name_t;
   9 
  10 // names from libgphoto2
  11 // https://github.com/gphoto/libgphoto2/blob/master/camlibs/ptp2/ptp.h as of May 18 2019
  12 // commented out items with just a number, since we auto-name those already
  13 ptp_op_name_t ptp_op_names[]={
  14 /* PTP v1.0 operation codes */
  15 {"PTP_OC_Undefined",                0x1000},
  16 {"PTP_OC_GetDeviceInfo",            0x1001},
  17 {"PTP_OC_OpenSession",              0x1002},
  18 {"PTP_OC_CloseSession",             0x1003},
  19 {"PTP_OC_GetStorageIDs",            0x1004},
  20 {"PTP_OC_GetStorageInfo",           0x1005},
  21 {"PTP_OC_GetNumObjects",            0x1006},
  22 {"PTP_OC_GetObjectHandles",         0x1007},
  23 {"PTP_OC_GetObjectInfo",            0x1008},
  24 {"PTP_OC_GetObject",                0x1009},
  25 {"PTP_OC_GetThumb",                 0x100A},
  26 {"PTP_OC_DeleteObject",             0x100B},
  27 {"PTP_OC_SendObjectInfo",           0x100C},
  28 {"PTP_OC_SendObject",               0x100D},
  29 {"PTP_OC_InitiateCapture",          0x100E},
  30 {"PTP_OC_FormatStore",              0x100F},
  31 {"PTP_OC_ResetDevice",              0x1010},
  32 {"PTP_OC_SelfTest",                 0x1011},
  33 {"PTP_OC_SetObjectProtection",      0x1012},
  34 {"PTP_OC_PowerDown",                0x1013},
  35 {"PTP_OC_GetDevicePropDesc",        0x1014},
  36 {"PTP_OC_GetDevicePropValue",       0x1015},
  37 {"PTP_OC_SetDevicePropValue",       0x1016},
  38 {"PTP_OC_ResetDevicePropValue",     0x1017},
  39 {"PTP_OC_TerminateOpenCapture",     0x1018},
  40 {"PTP_OC_MoveObject",               0x1019},
  41 {"PTP_OC_CopyObject",               0x101A},
  42 {"PTP_OC_GetPartialObject",         0x101B},
  43 {"PTP_OC_InitiateOpenCapture",      0x101C},
  44 /* PTP v1.1 operation codes */
  45 {"PTP_OC_StartEnumHandles",         0x101D},
  46 {"PTP_OC_EnumHandles",              0x101E},
  47 {"PTP_OC_StopEnumHandles",          0x101F},
  48 {"PTP_OC_GetVendorExtensionMaps",   0x1020},
  49 {"PTP_OC_GetVendorDeviceInfo",      0x1021},
  50 {"PTP_OC_GetResizedImageObject",    0x1022},
  51 {"PTP_OC_GetFilesystemManifest",    0x1023},
  52 {"PTP_OC_GetStreamInfo",            0x1024},
  53 {"PTP_OC_GetStream",                0x1025},
  54 
  55 /* Canon extension Operation Codes */
  56 {"PTP_OC_CANON_GetPartialObjectInfo",0x9001},
  57 {"PTP_OC_CANON_SetObjectArchive",   0x9002},
  58 {"PTP_OC_CANON_KeepDeviceOn",       0x9003},
  59 {"PTP_OC_CANON_LockDeviceUI",       0x9004},
  60 {"PTP_OC_CANON_UnlockDeviceUI",     0x9005},
  61 {"PTP_OC_CANON_GetObjectHandleByName",0x9006},
  62 {"PTP_OC_CANON_InitiateReleaseControl",0x9008},
  63 {"PTP_OC_CANON_TerminateReleaseControl",0x9009},
  64 {"PTP_OC_CANON_TerminatePlaybackMode",0x900A},
  65 {"PTP_OC_CANON_ViewfinderOn",       0x900B},
  66 {"PTP_OC_CANON_ViewfinderOff",      0x900C},
  67 {"PTP_OC_CANON_DoAeAfAwb",          0x900D},
  68 {"PTP_OC_CANON_GetCustomizeSpec",   0x900E},
  69 {"PTP_OC_CANON_GetCustomizeItemInfo",0x900F},
  70 {"PTP_OC_CANON_GetCustomizeData",   0x9010},
  71 {"PTP_OC_CANON_SetCustomizeData",   0x9011},
  72 {"PTP_OC_CANON_GetCaptureStatus",   0x9012},
  73 {"PTP_OC_CANON_CheckEvent",         0x9013},
  74 {"PTP_OC_CANON_FocusLock",          0x9014},
  75 {"PTP_OC_CANON_FocusUnlock",        0x9015},
  76 {"PTP_OC_CANON_GetLocalReleaseParam",0x9016},
  77 {"PTP_OC_CANON_SetLocalReleaseParam",0x9017},
  78 {"PTP_OC_CANON_AskAboutPcEvf",      0x9018},
  79 {"PTP_OC_CANON_SendPartialObject",  0x9019},
  80 {"PTP_OC_CANON_InitiateCaptureInMemory",0x901A},
  81 {"PTP_OC_CANON_GetPartialObjectEx", 0x901B},
  82 {"PTP_OC_CANON_SetObjectTime",      0x901C},
  83 {"PTP_OC_CANON_GetViewfinderImage", 0x901D},
  84 {"PTP_OC_CANON_GetObjectAttributes",0x901E},
  85 {"PTP_OC_CANON_ChangeUSBProtocol",  0x901F},
  86 {"PTP_OC_CANON_GetChanges",         0x9020},
  87 {"PTP_OC_CANON_GetObjectInfoEx",    0x9021},
  88 {"PTP_OC_CANON_InitiateDirectTransfer",0x9022},
  89 {"PTP_OC_CANON_TerminateDirectTransfer",0x9023},
  90 {"PTP_OC_CANON_SendObjectInfoByPath",0x9024},
  91 {"PTP_OC_CANON_SendObjectByPath",   0x9025},
  92 {"PTP_OC_CANON_InitiateDirectTansferEx",0x9026},
  93 {"PTP_OC_CANON_GetAncillaryObjectHandles",0x9027},
  94 {"PTP_OC_CANON_GetTreeInfo",        0x9028},
  95 {"PTP_OC_CANON_GetTreeSize",        0x9029},
  96 {"PTP_OC_CANON_NotifyProgress",     0x902A},
  97 {"PTP_OC_CANON_NotifyCancelAccepted",0x902B},
  98 //{"PTP_OC_CANON_902C",               0x902C},
  99 {"PTP_OC_CANON_GetDirectory",       0x902D},
 100 //{"PTP_OC_CANON_902E",               0x902E},
 101 //{"PTP_OC_CANON_902F",               0x902F},    /* used during camera init */
 102 {"PTP_OC_CANON_SetPairingInfo",     0x9030},
 103 {"PTP_OC_CANON_GetPairingInfo",     0x9031},
 104 {"PTP_OC_CANON_DeletePairingInfo",  0x9032},
 105 {"PTP_OC_CANON_GetMACAddress",      0x9033}, /* no args */
 106 {"PTP_OC_CANON_SetDisplayMonitor",  0x9034},
 107 {"PTP_OC_CANON_PairingComplete",    0x9035},
 108 {"PTP_OC_CANON_GetWirelessMAXChannel",0x9036},
 109 {"PTP_OC_CANON_GetWebServiceSpec",  0x9068}, /* no args */
 110 {"PTP_OC_CANON_GetWebServiceData",  0x9069}, /* no args */
 111 {"PTP_OC_CANON_SetWebServiceData",  0x906A},
 112 {"PTP_OC_CANON_DeleteWebServiceData",0x906B},
 113 {"PTP_OC_CANON_GetRootCertificateSpec",0x906C}, /* no args */
 114 {"PTP_OC_CANON_GetRootCertificateData",0x906D}, /* no args */
 115 {"PTP_OC_CANON_SetRootCertificateData",0x906F},
 116 {"PTP_OC_CANON_GetGpsMobilelinkObjectInfo",0x9075}, /* 2 args: utcstart, utcend */
 117 {"PTP_OC_CANON_SendGpsTagInfo",     0x9076}, /* 1 arg: oid */
 118 {"PTP_OC_CANON_GetTranscodeApproxSize",0x9077}, /* 1 arg: oid? */
 119 {"PTP_OC_CANON_RequestTranscodeStart",0x9078}, /* 1 arg: oid? */
 120 {"PTP_OC_CANON_RequestTranscodeCancel",0x9079}, /* 1 arg: oid? */
 121 {"PTP_OC_CANON_SetRemoteShootingMode",0x9086},
 122 {"PTP_OC_CANON_EOS_GetStorageIDs",  0x9101},
 123 {"PTP_OC_CANON_EOS_GetStorageInfo", 0x9102},
 124 {"PTP_OC_CANON_EOS_GetObjectInfo",  0x9103},
 125 {"PTP_OC_CANON_EOS_GetObject",      0x9104},
 126 {"PTP_OC_CANON_EOS_DeleteObject",   0x9105},
 127 {"PTP_OC_CANON_EOS_FormatStore",    0x9106},
 128 {"PTP_OC_CANON_EOS_GetPartialObject",0x9107},
 129 {"PTP_OC_CANON_EOS_GetDeviceInfoEx",0x9108},
 130 {"PTP_OC_CANON_EOS_GetObjectInfoEx",0x9109},
 131 {"PTP_OC_CANON_EOS_GetThumbEx",     0x910A},
 132 {"PTP_OC_CANON_EOS_SendPartialObject",0x910B},
 133 {"PTP_OC_CANON_EOS_SetObjectAttributes",0x910C},
 134 {"PTP_OC_CANON_EOS_GetObjectTime",  0x910D},
 135 {"PTP_OC_CANON_EOS_SetObjectTime",  0x910E},
 136 {"PTP_OC_CANON_EOS_RemoteRelease",  0x910F},
 137 {"PTP_OC_CANON_EOS_SetDevicePropValueEx",0x9110},
 138 {"PTP_OC_CANON_EOS_GetRemoteMode",  0x9113},
 139 {"PTP_OC_CANON_EOS_SetRemoteMode",  0x9114},
 140 {"PTP_OC_CANON_EOS_SetEventMode",   0x9115},
 141 {"PTP_OC_CANON_EOS_GetEvent",       0x9116},
 142 {"PTP_OC_CANON_EOS_TransferComplete",0x9117},
 143 {"PTP_OC_CANON_EOS_CancelTransfer", 0x9118},
 144 {"PTP_OC_CANON_EOS_ResetTransfer",  0x9119},
 145 {"PTP_OC_CANON_EOS_PCHDDCapacity",  0x911A},
 146 {"PTP_OC_CANON_EOS_SetUILock",      0x911B},
 147 {"PTP_OC_CANON_EOS_ResetUILock",    0x911C},
 148 {"PTP_OC_CANON_EOS_KeepDeviceOn",   0x911D}, /* no arg */
 149 {"PTP_OC_CANON_EOS_SetNullPacketMode",0x911E}, /* 1 param */
 150 {"PTP_OC_CANON_EOS_UpdateFirmware", 0x911F},
 151 {"PTP_OC_CANON_EOS_TransferCompleteDT",0x9120},
 152 {"PTP_OC_CANON_EOS_CancelTransferDT",0x9121},
 153 {"PTP_OC_CANON_EOS_SetWftProfile",  0x9122},
 154 {"PTP_OC_CANON_EOS_GetWftProfile",  0x9123}, /* 2 args: setnum, configid */
 155 {"PTP_OC_CANON_EOS_SetProfileToWft",0x9124},
 156 {"PTP_OC_CANON_EOS_BulbStart",      0x9125},
 157 {"PTP_OC_CANON_EOS_BulbEnd",        0x9126},
 158 {"PTP_OC_CANON_EOS_RequestDevicePropValue",    0x9127},
 159 {"PTP_OC_CANON_EOS_RemoteReleaseOn",    0x9128},
 160 {"PTP_OC_CANON_EOS_RemoteReleaseOff",    0x9129},
 161 {"PTP_OC_CANON_EOS_RegistBackgroundImage",    0x912A},
 162 {"PTP_OC_CANON_EOS_ChangePhotoStudioMode",    0x912B},
 163 {"PTP_OC_CANON_EOS_GetPartialObjectEx",    0x912C},
 164 {"PTP_OC_CANON_EOS_ResetMirrorLockupState",    0x9130}, /* no args */
 165 {"PTP_OC_CANON_EOS_PopupBuiltinFlash",    0x9131},
 166 {"PTP_OC_CANON_EOS_EndGetPartialObjectEx",    0x9132},
 167 {"PTP_OC_CANON_EOS_MovieSelectSWOn",    0x9133}, /* no args */
 168 {"PTP_OC_CANON_EOS_MovieSelectSWOff",    0x9134}, /* no args */
 169 {"PTP_OC_CANON_EOS_GetCTGInfo",        0x9135},
 170 {"PTP_OC_CANON_EOS_GetLensAdjust",        0x9136},
 171 {"PTP_OC_CANON_EOS_SetLensAdjust",        0x9137},
 172 {"PTP_OC_CANON_EOS_ReadyToSendMusic",    0x9138},
 173 {"PTP_OC_CANON_EOS_CreateHandle",        0x9139},
 174 {"PTP_OC_CANON_EOS_SendPartialObjectEx",    0x913A},
 175 {"PTP_OC_CANON_EOS_EndSendPartialObjectEx",    0x913B},
 176 {"PTP_OC_CANON_EOS_SetCTGInfo",        0x913C},
 177 {"PTP_OC_CANON_EOS_SetRequestOLCInfoGroup",    0x913D},
 178 {"PTP_OC_CANON_EOS_SetRequestRollingPitchingLevel",    0x913E}, /* 1 arg: onoff? */
 179 {"PTP_OC_CANON_EOS_GetCameraSupport",    0x913F},
 180 {"PTP_OC_CANON_EOS_SetRating",        0x9140}, /* 2 args, objectid, rating? */
 181 {"PTP_OC_CANON_EOS_RequestInnerDevelopStart",    0x9141}, /* 2 args: 1 type, 1 object? */
 182 {"PTP_OC_CANON_EOS_RequestInnerDevelopParamChange",    0x9142},
 183 {"PTP_OC_CANON_EOS_RequestInnerDevelopEnd",        0x9143},
 184 {"PTP_OC_CANON_EOS_GpsLoggingDataMode",        0x9144}, /* 1 arg */
 185 {"PTP_OC_CANON_EOS_GetGpsLogCurrentHandle",        0x9145},
 186 {"PTP_OC_CANON_EOS_SetImageRecoveryData",        0x9146}, /* sends data? */
 187 {"PTP_OC_CANON_EOS_GetImageRecoveryList",        0x9147},
 188 {"PTP_OC_CANON_EOS_FormatImageRecoveryData",    0x9148},
 189 {"PTP_OC_CANON_EOS_GetPresetLensAdjustParam",    0x9149}, /* no arg */
 190 {"PTP_OC_CANON_EOS_GetRawDispImage",        0x914A}, /* ? 2 args ? */
 191 {"PTP_OC_CANON_EOS_SaveImageRecoveryData",        0x914B},
 192 {"PTP_OC_CANON_EOS_RequestBLE",            0x914C}, /* 2? args? */
 193 {"PTP_OC_CANON_EOS_DrivePowerZoom",            0x914D}, /* 1 arg */
 194 {"PTP_OC_CANON_EOS_GetIptcData",        0x914F},
 195 {"PTP_OC_CANON_EOS_SetIptcData",        0x9150}, /* sends data? */
 196 {"PTP_OC_CANON_EOS_InitiateViewfinder",    0x9151},    /* no arg */
 197 {"PTP_OC_CANON_EOS_TerminateViewfinder",    0x9152},
 198 {"PTP_OC_CANON_EOS_GetViewFinderData",    0x9153},
 199 {"PTP_OC_CANON_EOS_DoAf",            0x9154},
 200 {"PTP_OC_CANON_EOS_DriveLens",        0x9155},
 201 {"PTP_OC_CANON_EOS_DepthOfFieldPreview",    0x9156}, /* 1 arg */
 202 {"PTP_OC_CANON_EOS_ClickWB",        0x9157}, /* 2 args: x,y */
 203 {"PTP_OC_CANON_EOS_Zoom",            0x9158}, /* 1 arg: zoom */
 204 {"PTP_OC_CANON_EOS_ZoomPosition",        0x9159}, /* 2 args: x,y */
 205 {"PTP_OC_CANON_EOS_SetLiveAfFrame",        0x915A}, /* sends data? */
 206 {"PTP_OC_CANON_EOS_TouchAfPosition",    0x915B}, /* 3 args: type,x,y */
 207 {"PTP_OC_CANON_EOS_SetLvPcFlavoreditMode",    0x915C}, /* 1 arg */
 208 {"PTP_OC_CANON_EOS_SetLvPcFlavoreditParam",    0x915D}, /* 1 arg */
 209 {"PTP_OC_CANON_EOS_AfCancel",        0x9160},
 210 {"PTP_OC_CANON_EOS_SetImageRecoveryDataEx",    0x916B},
 211 {"PTP_OC_CANON_EOS_GetImageRecoveryListEx",    0x916C},
 212 {"PTP_OC_CANON_EOS_NotifyAutoTransferStatus",    0x916E},
 213 {"PTP_OC_CANON_EOS_GetReducedObject",    0x916F},
 214 {"PTP_OC_CANON_EOS_GetObjectInfo64",    0x9170},    /* 1 arg: oid */
 215 {"PTP_OC_CANON_EOS_GetObject64",        0x9171},    /* 1 arg: oid */
 216 {"PTP_OC_CANON_EOS_GetPartialObject64",    0x9172},    /* args: oid, offset, maxbyte */
 217 {"PTP_OC_CANON_EOS_GetObjectInfoEx64",    0x9173},    /* 2 args: storageid, oid  ? */
 218 {"PTP_OC_CANON_EOS_GetPartialObjectEX64",    0x9174},    /* args: oid, offset 64bit, maxbyte */
 219 {"PTP_OC_CANON_EOS_CreateHandle64",        0x9175},
 220 {"PTP_OC_CANON_EOS_NotifySaveComplete",    0x9177},
 221 {"PTP_OC_CANON_EOS_NotifyEstimateNumberofImport",        0x9182}, /* 1 arg: importnumber */
 222 {"PTP_OC_CANON_EOS_NotifyNumberofImported",    0x9183}, /* 1 arg: importnumber */
 223 {"PTP_OC_CANON_EOS_NotifySizeOfPartialDataTransfer",    0x9184}, /* 4 args: filesizelow, filesizehigh, downloadsizelow, downloadsizehigh */
 224 {"PTP_OC_CANON_EOS_NotifyFinish",        0x9185}, /* 1 arg: reason */
 225 {"PTP_OC_CANON_EOS_GetObjectURL",        0x91AB},
 226 {"PTP_OC_CANON_EOS_SetFELock",        0x91B9},
 227 {"PTP_OC_CANON_EOS_SetDefaultCameraSetting",        0x91BE},
 228 {"PTP_OC_CANON_EOS_GetAEData",        0x91BF},
 229 {"PTP_OC_CANON_EOS_NotifyNetworkError",    0x91E8}, /* 1 arg: errorcode */
 230 {"PTP_OC_CANON_EOS_AdapterTransferProgress",        0x91E9},
 231 {"PTP_OC_CANON_EOS_TransferCompleteFTP",    0x91F0},
 232 {"PTP_OC_CANON_EOS_CancelTransferFTP",    0x91F1},
 233 {"PTP_OC_CANON_EOS_FAPIMessageTX",        0x91FE},
 234 {"PTP_OC_CANON_EOS_FAPIMessageRX",    0x91FF},
 235 };
 236 
 237 const char *get_ptp_op_name(uint32_t op) {
 238     int i;
 239     for(i=0;i<(sizeof(ptp_op_names)/sizeof(ptp_op_name_t)); i++) {
 240         if(op==ptp_op_names[i].op) {
 241             return ptp_op_names[i].name;
 242         }
 243     }
 244     return NULL;
 245 }
 246 

/* [<][>][^][v][top][bottom][index][help] */