Index: src/ptp.h |
diff --git a/src/ptp.h b/src/ptp.h |
index 6ba388497020401743806c67233d84c178b6d2c1..c1733dd7d35a92c1c8748abd8b731b50733789b2 100644 |
--- a/src/ptp.h |
+++ b/src/ptp.h |
@@ -1,7 +1,7 @@ |
/* ptp.h |
* |
* Copyright (C) 2001 Mariusz Woloszyn <emsi@ipartners.pl> |
- * Copyright (C) 2003-2014 Marcus Meissner <marcus@jet.franken.de> |
+ * Copyright (C) 2003-2012 Marcus Meissner <marcus@jet.franken.de> |
* Copyright (C) 2006-2008 Linus Walleij <triad@df.lth.se> |
* |
* This library is free software; you can redistribute it and/or |
@@ -16,8 +16,8 @@ |
* |
* 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 |
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
+ * Boston, MA 02111-1307, USA. |
*/ |
#ifndef __PTP_H__ |
@@ -25,7 +25,7 @@ |
#include <stdarg.h> |
#include <time.h> |
-#if defined(HAVE_ICONV) && defined(HAVE_LANGINFO_H) |
+#ifdef HAVE_ICONV |
#include <iconv.h> |
#endif |
#include "gphoto2-endian.h" |
@@ -74,16 +74,12 @@ typedef struct _PTPContainer PTPContainer; |
* |
* 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_PAYLOAD_LEN_WRITE (PTP_USB_BULK_HS_MAX_PACKET_LEN_WRITE-PTP_USB_BULK_HDR_LEN) |
+#define PTP_USB_BULK_PAYLOAD_LEN_READ (PTP_USB_BULK_HS_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 { |
@@ -169,15 +165,9 @@ typedef struct _PTPIPHeader PTPIPHeader; |
#define PTP_VENDOR_FOTONATION 0x0000000C |
#define PTP_VENDOR_PENTAX 0x0000000D |
#define PTP_VENDOR_FUJI 0x0000000E |
-/* not from standards papers, but from traces: */ |
-#define PTP_VENDOR_SONY 0x00000011 /* observed in the A900 */ |
-#define PTP_VENDOR_SAMSUNG 0x0000001a /* observed in the Samsung NX1000 */ |
/* Vendor extension ID used for MTP (occasionaly, usualy 6 is used) */ |
#define PTP_VENDOR_MTP 0xffffffff |
-/* gphoto overrides */ |
-#define PTP_VENDOR_GP_OLYMPUS 0xfffffffe |
- |
/* Operation Codes */ |
/* PTP v1.0 operation codes */ |
@@ -278,7 +268,6 @@ typedef struct _PTPIPHeader PTPIPHeader; |
/* 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_SetPairingInfo 0x9030 |
#define PTP_OC_CANON_GetPairingInfo 0x9031 |
@@ -289,13 +278,6 @@ typedef struct _PTPIPHeader PTPIPHeader; |
#define PTP_OC_CANON_PairingComplete 0x9035 |
#define PTP_OC_CANON_GetWirelessMAXChannel 0x9036 |
-#define PTP_OC_CANON_GetWebServiceSpec 0x9068 |
-#define PTP_OC_CANON_GetWebServiceData 0x9069 |
-#define PTP_OC_CANON_SetWebServiceData 0x906B |
-#define PTP_OC_CANON_GetRootCertificateSpec 0x906C |
-#define PTP_OC_CANON_GetRootCertificateData 0x906D |
-#define PTP_OC_CANON_SetRootCertificateData 0x906F |
- |
/* 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) |
@@ -377,7 +359,7 @@ typedef struct _PTPIPHeader PTPIPHeader; |
#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 |
+#define PTP_OC_CANON_EOS_GetWftProfile 0x9122 |
#define PTP_OC_CANON_EOS_SetProfileToWft 0x9124 |
#define PTP_OC_CANON_EOS_BulbStart 0x9125 |
#define PTP_OC_CANON_EOS_BulbEnd 0x9126 |
@@ -388,54 +370,17 @@ typedef struct _PTPIPHeader PTPIPHeader; |
/* 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 |
-#define PTP_OC_CANON_EOS_PopupBuiltinFlash 0x9131 |
-#define PTP_OC_CANON_EOS_EndGetPartialObjectEx 0x9132 |
-#define PTP_OC_CANON_EOS_MovieSelectSWOn 0x9133 |
-#define PTP_OC_CANON_EOS_MovieSelectSWOff 0x9134 |
-#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_GetMusicInfo 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 |
-#define PTP_OC_CANON_EOS_GetCameraSupport 0x913F |
-#define PTP_OC_CANON_EOS_SetRating 0x9140 /* 2 args */ |
-#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_InitiateViewfinder 0x9151 |
#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 */ |
-#define PTP_OC_CANON_EOS_ZoomPosition 0x9159 /* 2 args: x,y */ |
-#define PTP_OC_CANON_EOS_SetLiveAfFrame 0x915A |
-#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_DepthOfFieldPreview 0x9156 |
+#define PTP_OC_CANON_EOS_ClickWB 0x9157 |
+#define PTP_OC_CANON_EOS_Zoom 0x9158 |
+#define PTP_OC_CANON_EOS_ZoomPosition 0x9159 |
+#define PTP_OC_CANON_EOS_SetLiveAfFrame 0x915a |
#define PTP_OC_CANON_EOS_AfCancel 0x9160 |
-#define PTP_OC_CANON_EOS_SetDefaultCameraSetting 0x91BE |
-#define PTP_OC_CANON_EOS_GetAEData 0x91BF |
-#define PTP_OC_CANON_EOS_NotifyNetworkError 0x91E8 |
-#define PTP_OC_CANON_EOS_AdapterTransferProgress 0x91E9 |
-#define PTP_OC_CANON_EOS_TransferComplete2 0x91F0 |
-#define PTP_OC_CANON_EOS_CancelTransfer2 0x91F1 |
#define PTP_OC_CANON_EOS_FAPIMessageTX 0x91FE |
#define PTP_OC_CANON_EOS_FAPIMessageRX 0x91FF |
@@ -448,8 +393,8 @@ typedef struct _PTPIPHeader PTPIPHeader; |
#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_SetControlMode 0x90C2 /* 1 param, no data */ |
+#define PTP_OC_NIKON_DelImageSDRAM 0x90C3 /* no params, 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 */ |
@@ -458,39 +403,22 @@ typedef struct _PTPIPHeader PTPIPHeader; |
#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 */ |
+#define PTP_OC_NIKON_GetPictCtrlData 0x90CC |
+#define PTP_OC_NIKON_SetPictCtrlData 0x90CD |
+#define PTP_OC_NIKON_DelCstPicCtrl 0x90CE |
+#define PTP_OC_NIKON_GetPicCtrlCapability 0x90CF |
/* 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_StartLiveView 0x9201 |
+#define PTP_OC_NIKON_EndLiveView 0x9202 |
+#define PTP_OC_NIKON_GetLiveViewImg 0x9203 |
+#define PTP_OC_NIKON_MfDrive 0x9204 |
+#define PTP_OC_NIKON_ChangeAfArea 0x9205 |
+#define PTP_OC_NIKON_AfDriveCancel 0x9206 |
#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 dataa */ |
- |
/* Casio EX-F1 (from http://code.google.com/p/exf1ctrl/ ) */ |
#define PTP_OC_CASIO_STILL_START 0x9001 |
#define PTP_OC_CASIO_STILL_STOP 0x9002 |
@@ -522,30 +450,6 @@ typedef struct _PTPIPHeader PTPIPHeader; |
#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 |
@@ -638,37 +542,12 @@ typedef struct _PTPIPHeader PTPIPHeader; |
#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_Init1 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 */ |
-#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 |
- |
/* Proprietary vendor extension operations mask */ |
#define PTP_OC_EXTENSION_MASK 0xF000 |
#define PTP_OC_EXTENSION 0x9000 |
@@ -680,7 +559,7 @@ typedef struct _PTPIPHeader PTPIPHeader; |
#define PTP_RC_OK 0x2001 |
#define PTP_RC_GeneralError 0x2002 |
#define PTP_RC_SessionNotOpen 0x2003 |
-#define PTP_RC_InvalidTransactionID 0x2004 |
+#define PTP_RC_InvalidTransactionID 0x2004 |
#define PTP_RC_OperationNotSupported 0x2005 |
#define PTP_RC_ParameterNotSupported 0x2006 |
#define PTP_RC_IncompleteTransfer 0x2007 |
@@ -767,12 +646,12 @@ typedef struct _PTPIPHeader PTPIPHeader; |
#define PTP_RC_MTP_WFC_Version_Not_Supported 0xA122 |
/* libptp2 extended ERROR codes */ |
-#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 |
+#define PTP_ERROR_DATA_EXPECTED 0x02FE |
+#define PTP_ERROR_RESP_EXPECTED 0x02FD |
+#define PTP_ERROR_BADPARAM 0x02FC |
+#define PTP_ERROR_CANCEL 0x02FB |
+#define PTP_ERROR_TIMEOUT 0x02FA |
/* PTP Event Codes */ |
@@ -796,40 +675,36 @@ typedef struct _PTPIPHeader PTPIPHeader; |
#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_ShutterButtonPressed 0xC00E |
#define PTP_EC_CANON_StartDirectTransfer 0xC011 |
#define PTP_EC_CANON_StopDirectTransfer 0xC013 |
/* Canon EOS events */ |
-#define PTP_EC_CANON_EOS_RequestGetEvent 0xc101 |
-#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 |
+#define PTP_EC_CANON_EOS_RequestGetEvent 0xc101 |
+#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 |
#define PTP_EC_CANON_EOS_RequestObjectTransferDT 0xc190 |
#define PTP_EC_CANON_EOS_RequestCancelTransferDT 0xc191 |
-#define PTP_EC_CANON_EOS_StoreAdded 0xc192 |
-#define PTP_EC_CANON_EOS_StoreRemoved 0xc193 |
-#define PTP_EC_CANON_EOS_BulbExposureTime 0xc194 |
-#define PTP_EC_CANON_EOS_RecordingTime 0xc195 |
-#define PTP_EC_CANON_EOS_RequestObjectTransferTS 0xC1a2 |
-#define PTP_EC_CANON_EOS_AfResult 0xc1a3 |
-#define PTP_EC_CANON_EOS_CTGInfoCheckComplete 0xc1a4 |
-#define PTP_EC_CANON_EOS_OLCInfoChanged 0xc1a5 |
-#define PTP_EC_CANON_EOS_RequestObjectTransferFTP 0xc1f1 |
+#define PTP_EC_CANON_EOS_StoreAdded 0xc192 |
+#define PTP_EC_CANON_EOS_StoreRemoved 0xc193 |
+#define PTP_EC_CANON_EOS_BulbExposureTime 0xc194 |
+#define PTP_EC_CANON_EOS_RecordingTime 0xc195 |
+#define PTP_EC_CANON_EOS_RequestObjectTransferTS 0xC1a2 |
+#define PTP_EC_CANON_EOS_AfResult 0xc1a3 |
/* Nikon extension Event Codes */ |
@@ -840,15 +715,6 @@ typedef struct _PTPIPHeader PTPIPHeader; |
#define PTP_EC_Nikon_AdvancedTransfer 0xC103 |
#define PTP_EC_Nikon_PreviewImageAdded 0xC104 |
-/* Olympus E series */ |
-#define PTP_EC_Olympus_PropertyChanged 0xC102 |
-#define PTP_EC_Olympus_CaptureComplete 0xC103 |
- |
-/* Sony */ |
-#define PTP_EC_Sony_ObjectAdded 0xC201 |
-#define PTP_EC_Sony_ObjectRemoved 0xC202 |
-#define PTP_EC_Sony_PropertyChanged 0xC203 |
- |
/* MTP Event codes */ |
#define PTP_EC_MTP_ObjectPropChanged 0xC801 |
#define PTP_EC_MTP_ObjectPropDescChanged 0xC802 |
@@ -994,11 +860,8 @@ typedef struct _PTPObjectInfo PTPObjectInfo; |
#define PTP_OFC_CANON_CRW 0xb101 |
#define PTP_OFC_CANON_CRW3 0xb103 |
#define PTP_OFC_CANON_MOV 0xb104 |
-#define PTP_OFC_CANON_MOV2 0xb105 |
/* CHDK specific raw mode */ |
#define PTP_OFC_CANON_CHDK_CRW 0xb1ff |
-/* Sony */ |
-#define PTP_OFC_SONY_RAW 0xb101 |
/* MTP extensions */ |
#define PTP_OFC_MTP_MediaCard 0xb211 |
#define PTP_OFC_MTP_MediaCardGroup 0xb212 |
@@ -1261,16 +1124,11 @@ struct _PTPNIKONWifiProfile { |
typedef struct _PTPNIKONWifiProfile PTPNIKONWifiProfile; |
-enum _PTPCanon_changes_types { |
- PTP_CANON_EOS_CHANGES_TYPE_UNKNOWN, |
- PTP_CANON_EOS_CHANGES_TYPE_OBJECTINFO, |
- PTP_CANON_EOS_CHANGES_TYPE_OBJECTTRANSFER, |
- PTP_CANON_EOS_CHANGES_TYPE_PROPERTY, |
- PTP_CANON_EOS_CHANGES_TYPE_CAMERASTATUS, |
- PTP_CANON_EOS_CHANGES_TYPE_FOCUSINFO, |
- PTP_CANON_EOS_CHANGES_TYPE_FOCUSMASK, |
- PTP_CANON_EOS_CHANGES_TYPE_OBJECTREMOVED |
-}; |
+#define PTP_CANON_EOS_CHANGES_TYPE_UNKNOWN 0 |
+#define PTP_CANON_EOS_CHANGES_TYPE_OBJECTINFO 1 |
+#define PTP_CANON_EOS_CHANGES_TYPE_OBJECTTRANSFER 2 |
+#define PTP_CANON_EOS_CHANGES_TYPE_PROPERTY 3 |
+#define PTP_CANON_EOS_CHANGES_TYPE_CAMERASTATUS 4 |
struct _PTPCanon_New_Object { |
uint32_t oid; |
@@ -1278,7 +1136,7 @@ struct _PTPCanon_New_Object { |
}; |
struct _PTPCanon_changes_entry { |
- enum _PTPCanon_changes_types type; |
+ int type; |
union { |
struct _PTPCanon_New_Object object; /* TYPE_OBJECTINFO */ |
char *info; |
@@ -1290,6 +1148,7 @@ typedef struct _PTPCanon_changes_entry PTPCanon_changes_entry; |
typedef struct _PTPCanon_Property { |
uint32_t size; |
+ uint32_t type; |
uint32_t proptype; |
unsigned char *data; |
@@ -1494,7 +1353,7 @@ typedef struct _PTPCanonEOSDeviceInfo { |
#define PTP_DPC_CANON_EOS_ExpCompensation 0xD104 |
#define PTP_DPC_CANON_EOS_AutoExposureMode 0xD105 |
#define PTP_DPC_CANON_EOS_DriveMode 0xD106 |
-#define PTP_DPC_CANON_EOS_MeteringMode 0xD107 |
+#define PTP_DPC_CANON_EOS_MeteringMode 0xD107 |
#define PTP_DPC_CANON_EOS_FocusMode 0xD108 |
#define PTP_DPC_CANON_EOS_WhiteBalance 0xD109 |
#define PTP_DPC_CANON_EOS_ColorTemperature 0xD10A |
@@ -1507,7 +1366,6 @@ typedef struct _PTPCanonEOSDeviceInfo { |
#define PTP_DPC_CANON_EOS_BatteryPower 0xD111 |
#define PTP_DPC_CANON_EOS_BatterySelect 0xD112 |
#define PTP_DPC_CANON_EOS_CameraTime 0xD113 |
-#define PTP_DPC_CANON_EOS_AutoPowerOff 0xD114 |
#define PTP_DPC_CANON_EOS_Owner 0xD115 |
#define PTP_DPC_CANON_EOS_ModelID 0xD116 |
#define PTP_DPC_CANON_EOS_PTPExtensionVersion 0xD119 |
@@ -1526,41 +1384,25 @@ typedef struct _PTPCanonEOSDeviceInfo { |
#define PTP_DPC_CANON_EOS_CompressionM1 0xD131 |
#define PTP_DPC_CANON_EOS_CompressionM2 0xD132 |
#define PTP_DPC_CANON_EOS_CompressionL 0xD133 |
-#define PTP_DPC_CANON_EOS_AEModeDial 0xD138 |
-#define PTP_DPC_CANON_EOS_AEModeCustom 0xD139 |
-#define PTP_DPC_CANON_EOS_MirrorUpSetting 0xD13A |
-#define PTP_DPC_CANON_EOS_HighlightTonePriority 0xD13B |
-#define PTP_DPC_CANON_EOS_AFSelectFocusArea 0xD13C |
-#define PTP_DPC_CANON_EOS_HDRSetting 0xD13D |
#define PTP_DPC_CANON_EOS_PCWhiteBalance1 0xD140 |
#define PTP_DPC_CANON_EOS_PCWhiteBalance2 0xD141 |
#define PTP_DPC_CANON_EOS_PCWhiteBalance3 0xD142 |
#define PTP_DPC_CANON_EOS_PCWhiteBalance4 0xD143 |
#define PTP_DPC_CANON_EOS_PCWhiteBalance5 0xD144 |
#define PTP_DPC_CANON_EOS_MWhiteBalance 0xD145 |
-#define PTP_DPC_CANON_EOS_MWhiteBalanceEx 0xD146 |
-#define PTP_DPC_CANON_EOS_UnknownPropD14D 0xD14D /*found in Canon EOS 5D M3*/ |
#define PTP_DPC_CANON_EOS_PictureStyleStandard 0xD150 |
#define PTP_DPC_CANON_EOS_PictureStylePortrait 0xD151 |
#define PTP_DPC_CANON_EOS_PictureStyleLandscape 0xD152 |
#define PTP_DPC_CANON_EOS_PictureStyleNeutral 0xD153 |
#define PTP_DPC_CANON_EOS_PictureStyleFaithful 0xD154 |
#define PTP_DPC_CANON_EOS_PictureStyleBlackWhite 0xD155 |
-#define PTP_DPC_CANON_EOS_PictureStyleAuto 0xD156 |
#define PTP_DPC_CANON_EOS_PictureStyleUserSet1 0xD160 |
#define PTP_DPC_CANON_EOS_PictureStyleUserSet2 0xD161 |
#define PTP_DPC_CANON_EOS_PictureStyleUserSet3 0xD162 |
#define PTP_DPC_CANON_EOS_PictureStyleParam1 0xD170 |
#define PTP_DPC_CANON_EOS_PictureStyleParam2 0xD171 |
#define PTP_DPC_CANON_EOS_PictureStyleParam3 0xD172 |
-#define PTP_DPC_CANON_EOS_HighISOSettingNoiseReduction 0xD178 |
-#define PTP_DPC_CANON_EOS_MovieServoAF 0xD179 |
-#define PTP_DPC_CANON_EOS_ContinuousAFValid 0xD17A |
-#define PTP_DPC_CANON_EOS_Attenuator 0xD17B |
-#define PTP_DPC_CANON_EOS_UTCTime 0xD17C |
-#define PTP_DPC_CANON_EOS_Timezone 0xD17D |
-#define PTP_DPC_CANON_EOS_Summertime 0xD17E |
-#define PTP_DPC_CANON_EOS_FlavorLUTParams 0xD17F |
+#define PTP_DPC_CANON_EOS_FlavorLUTParams 0xD17f |
#define PTP_DPC_CANON_EOS_CustomFunc1 0xD180 |
#define PTP_DPC_CANON_EOS_CustomFunc2 0xD181 |
#define PTP_DPC_CANON_EOS_CustomFunc3 0xD182 |
@@ -1581,16 +1423,6 @@ typedef struct _PTPCanonEOSDeviceInfo { |
#define PTP_DPC_CANON_EOS_CustomFunc18 0xD191 |
#define PTP_DPC_CANON_EOS_CustomFunc19 0xD192 |
#define PTP_DPC_CANON_EOS_CustomFunc19 0xD192 |
-#define PTP_DPC_CANON_EOS_InnerDevelop 0xD193 |
-#define PTP_DPC_CANON_EOS_MultiAspect 0xD194 |
-#define PTP_DPC_CANON_EOS_MovieSoundRecord 0xD195 |
-#define PTP_DPC_CANON_EOS_MovieRecordVolume 0xD196 |
-#define PTP_DPC_CANON_EOS_WindCut 0xD197 |
-#define PTP_DPC_CANON_EOS_ExtenderType 0xD198 |
-#define PTP_DPC_CANON_EOS_OLCInfoVersion 0xD199 |
-#define PTP_DPC_CANON_EOS_UnknownPropD19A 0xD19A /*found in Canon EOS 5D M3*/ |
-#define PTP_DPC_CANON_EOS_UnknownPropD19C 0xD19C /*found in Canon EOS 5D M3*/ |
-#define PTP_DPC_CANON_EOS_UnknownPropD19D 0xD19D /*found in Canon EOS 5D M3*/ |
#define PTP_DPC_CANON_EOS_CustomFuncEx 0xD1a0 |
#define PTP_DPC_CANON_EOS_MyMenu 0xD1a1 |
#define PTP_DPC_CANON_EOS_MyMenuList 0xD1a2 |
@@ -1619,23 +1451,6 @@ typedef struct _PTPCanonEOSDeviceInfo { |
#define PTP_DPC_CANON_EOS_LvAfSystem 0xD1ba |
#define PTP_DPC_CANON_EOS_MovSize 0xD1bb |
#define PTP_DPC_CANON_EOS_LvViewTypeSelect 0xD1bc |
-#define PTP_DPC_CANON_EOS_MirrorDownStatus 0xD1bd |
-#define PTP_DPC_CANON_EOS_MovieParam 0xD1be |
-#define PTP_DPC_CANON_EOS_MirrorLockupState 0xD1bf |
-#define PTP_DPC_CANON_EOS_FlashChargingState 0xD1C0 |
-#define PTP_DPC_CANON_EOS_AloMode 0xD1C1 |
-#define PTP_DPC_CANON_EOS_FixedMovie 0xD1C2 |
-#define PTP_DPC_CANON_EOS_OneShotRawOn 0xD1C3 |
-#define PTP_DPC_CANON_EOS_ErrorForDisplay 0xD1C4 |
-#define PTP_DPC_CANON_EOS_AEModeMovie 0xD1C5 |
-#define PTP_DPC_CANON_EOS_BuiltinStroboMode 0xD1C6 |
-#define PTP_DPC_CANON_EOS_StroboDispState 0xD1C7 |
-#define PTP_DPC_CANON_EOS_StroboETTL2Metering 0xD1C8 |
-#define PTP_DPC_CANON_EOS_ContinousAFMode 0xD1C9 |
-#define PTP_DPC_CANON_EOS_MovieParam2 0xD1CA |
-#define PTP_DPC_CANON_EOS_StroboSettingExpComposition 0xD1CB |
-#define PTP_DPC_CANON_EOS_MovieParam3 0xD1CC |
-#define PTP_DPC_CANON_EOS_LVMedicalRotate 0xD1CF |
#define PTP_DPC_CANON_EOS_Artist 0xD1d0 |
#define PTP_DPC_CANON_EOS_Copyright 0xD1d1 |
#define PTP_DPC_CANON_EOS_BracketValue 0xD1d2 |
@@ -1650,8 +1465,6 @@ typedef struct _PTPCanonEOSDeviceInfo { |
#define PTP_DPC_CANON_EOS_StroboWirelessSetting 0xD1db |
#define PTP_DPC_CANON_EOS_StroboFiring 0xD1dc |
#define PTP_DPC_CANON_EOS_LensID 0xD1dd |
-#define PTP_DPC_CANON_EOS_LCDBrightness 0xD1de |
-#define PTP_DPC_CANON_EOS_CADarkBright 0xD1df |
/* Nikon extension device property codes */ |
#define PTP_DPC_NIKON_ShootingBank 0xD010 |
@@ -1690,11 +1503,8 @@ typedef struct _PTPCanonEOSDeviceInfo { |
#define PTP_DPC_NIKON_JPEG_Compression_Policy 0xD031 |
#define PTP_DPC_NIKON_ColorSpace 0xD032 |
#define PTP_DPC_NIKON_AutoDXCrop 0xD033 |
-#define PTP_DPC_NIKON_FlickerReduction 0xD034 |
-#define PTP_DPC_NIKON_RemoteMode 0xD035 |
#define PTP_DPC_NIKON_VideoMode 0xD036 |
#define PTP_DPC_NIKON_EffectMode 0xD037 |
-#define PTP_DPC_NIKON_1_Mode 0xD038 |
#define PTP_DPC_NIKON_CSMMenuBankSelect 0xD040 |
#define PTP_DPC_NIKON_MenuBankNameA 0xD041 |
#define PTP_DPC_NIKON_MenuBankNameB 0xD042 |
@@ -1722,7 +1532,7 @@ typedef struct _PTPCanonEOSDeviceInfo { |
#define PTP_DPC_NIKON_ExposureBaseMatrix 0xD05A |
#define PTP_DPC_NIKON_ExposureBaseCenter 0xD05B |
#define PTP_DPC_NIKON_ExposureBaseSpot 0xD05C |
-#define PTP_DPC_NIKON_LiveViewAFArea 0xD05D /* FIXME: AfAtLiveview? */ |
+#define PTP_DPC_NIKON_LiveViewAFArea 0xD05D |
#define PTP_DPC_NIKON_AELockMode 0xD05E |
#define PTP_DPC_NIKON_AELAFLMode 0xD05F |
#define PTP_DPC_NIKON_LiveViewAFFocus 0xD061 |
@@ -1776,12 +1586,6 @@ typedef struct _PTPCanonEOSDeviceInfo { |
#define PTP_DPC_NIKON_MovScreenSize 0xD0A0 |
#define PTP_DPC_NIKON_MovVoice 0xD0A1 |
#define PTP_DPC_NIKON_MovMicrophone 0xD0A2 |
-#define PTP_DPC_NIKON_MovFileSlot 0xD0A3 |
-#define PTP_DPC_NIKON_MovRecProhibitCondition 0xD0A4 |
-#define PTP_DPC_NIKON_ManualMovieSetting 0xD0A6 |
-#define PTP_DPC_NIKON_MovQuality 0xD0A7 |
-#define PTP_DPC_NIKON_LiveViewScreenDisplaySetting 0xD0B2 |
-#define PTP_DPC_NIKON_MonitorOffDelay 0xD0B3 |
#define PTP_DPC_NIKON_Bracketing 0xD0C0 |
#define PTP_DPC_NIKON_AutoExposureBracketStep 0xD0C1 |
#define PTP_DPC_NIKON_AutoExposureBracketProgram 0xD0C2 |
@@ -1803,8 +1607,6 @@ typedef struct _PTPCanonEOSDeviceInfo { |
#define PTP_DPC_NIKON_VignetteCtrl 0xD0F7 |
#define PTP_DPC_NIKON_AutoDistortionControl 0xD0F8 |
#define PTP_DPC_NIKON_SceneMode 0xD0F9 |
-#define PTP_DPC_NIKON_SceneMode2 0xD0FD |
-#define PTP_DPC_NIKON_SelfTimerInterval 0xD0FE |
#define PTP_DPC_NIKON_ExposureTime 0xD100 /* Shutter Speed */ |
#define PTP_DPC_NIKON_ACPower 0xD101 |
#define PTP_DPC_NIKON_WarningStatus 0xD102 |
@@ -1845,7 +1647,7 @@ typedef struct _PTPCanonEOSDeviceInfo { |
#define PTP_DPC_NIKON_BW_Setting_Type 0xD146 |
#define PTP_DPC_NIKON_Slot2SaveMode 0xD148 |
#define PTP_DPC_NIKON_RawBitMode 0xD149 |
-#define PTP_DPC_NIKON_ActiveDLighting 0xD14E /* was PTP_DPC_NIKON_ISOAutoTime */ |
+#define PTP_DPC_NIKON_ISOAutoTime 0xD14E |
#define PTP_DPC_NIKON_FlourescentType 0xD14F |
#define PTP_DPC_NIKON_TuneColourTemperature 0xD150 |
#define PTP_DPC_NIKON_TunePreset0 0xD151 |
@@ -1868,11 +1670,6 @@ typedef struct _PTPCanonEOSDeviceInfo { |
#define PTP_DPC_NIKON_FlashModeManualPower 0xD16D |
#define PTP_DPC_NIKON_FlashModeCommanderPower 0xD16E |
#define PTP_DPC_NIKON_AutoFP 0xD16F |
-#define PTP_DPC_NIKON_DateImprintSetting 0xD170 |
-#define PTP_DPC_NIKON_DateCounterSelect 0xD171 |
-#define PTP_DPC_NIKON_DateCountData 0xD172 |
-#define PTP_DPC_NIKON_DateCountDisplaySetting 0xD173 |
-#define PTP_DPC_NIKON_RangeFinderSetting 0xD174 |
#define PTP_DPC_NIKON_CSMMenu 0xD180 |
#define PTP_DPC_NIKON_WarningDisplay 0xD181 |
#define PTP_DPC_NIKON_BatteryCellKind 0xD182 |
@@ -1891,10 +1688,6 @@ typedef struct _PTPCanonEOSDeviceInfo { |
#define PTP_DPC_NIKON_LiveViewStatus 0xD1A2 |
#define PTP_DPC_NIKON_LiveViewImageZoomRatio 0xD1A3 |
#define PTP_DPC_NIKON_LiveViewProhibitCondition 0xD1A4 |
-#define PTP_DPC_NIKON_MovieShutterSpeed 0xD1A8 |
-#define PTP_DPC_NIKON_MovieFNumber 0xD1A9 |
-#define PTP_DPC_NIKON_MovieISO 0xD1AA |
-#define PTP_DPC_NIKON_LiveViewMovieMode 0xD1AC /* ? */ |
#define PTP_DPC_NIKON_ExposureDisplayStatus 0xD1B0 |
#define PTP_DPC_NIKON_ExposureIndicateStatus 0xD1B1 |
#define PTP_DPC_NIKON_InfoDispErrStatus 0xD1B2 |
@@ -1914,36 +1707,8 @@ typedef struct _PTPCanonEOSDeviceInfo { |
#define PTP_DPC_NIKON_FlashCommandBMode 0xD1DA |
#define PTP_DPC_NIKON_FlashCommandBCompensation 0xD1DB |
#define PTP_DPC_NIKON_FlashCommandBValue 0xD1DC |
-#define PTP_DPC_NIKON_ApplicationMode 0xD1F0 |
-#define PTP_DPC_NIKON_ActiveSlot 0xD1F2 |
#define PTP_DPC_NIKON_ActivePicCtrlItem 0xD200 |
#define PTP_DPC_NIKON_ChangePicCtrlItem 0xD201 |
-#define PTP_DPC_NIKON_MovieNrHighISO 0xD236 |
- |
- |
-/* Nikon V1 (or WU adapter?) Trace */ |
-/* d241 - gets string "Nikon_WU2_0090B5123C61" */ |
-#define PTP_DPC_NIKON_D241 0xD241 |
-/* d244 - gets a single byte 0x00 */ |
-#define PTP_DPC_NIKON_D244 0xD244 |
-/* d247 - gets 3 bytes 0x01 0x00 0x00 */ |
-#define PTP_DPC_NIKON_D247 0xD247 |
-/* S9700 */ |
-#define PTP_DPC_NIKON_GUID 0xD24F |
-/* d250 - gets a string "0000123C61" */ |
-#define PTP_DPC_NIKON_D250 0xD250 |
-/* d251 - gets a 0x0100000d */ |
-#define PTP_DPC_NIKON_D251 0xD251 |
- |
-/* this is irregular, as it should be -0x5000 or 0xD000 based */ |
-#define PTP_DPC_NIKON_1_ISO 0xF002 |
-#define PTP_DPC_NIKON_1_ImageCompression 0xF009 |
-#define PTP_DPC_NIKON_1_ImageSize 0xF00A |
-#define PTP_DPC_NIKON_1_WhiteBalance 0xF00C |
-#define PTP_DPC_NIKON_1_LongExposureNoiseReduction 0xF00D |
-#define PTP_DPC_NIKON_1_HiISONoiseReduction 0xF00E |
-#define PTP_DPC_NIKON_1_ActiveDLighting 0xF00F |
-#define PTP_DPC_NIKON_1_MovQuality 0xF01C |
/* Fuji specific */ |
#define PTP_DPC_FUJI_ColorTemperature 0xD017 |
@@ -2058,25 +1823,6 @@ typedef struct _PTPCanonEOSDeviceInfo { |
#define PTP_DPC_OLYMPUS_ISOBracket 0xD15D |
#define PTP_DPC_OLYMPUS_MyModeStatus 0xD15E |
-/* Sony A900 */ |
-#define PTP_DPC_SONY_DPCCompensation 0xD200 |
-#define PTP_DPC_SONY_DRangeOptimize 0xD201 |
-#define PTP_DPC_SONY_ImageSize 0xD203 |
-#define PTP_DPC_SONY_ShutterSpeed 0xD20D |
-#define PTP_DPC_SONY_ColorTemp 0xD20F |
-#define PTP_DPC_SONY_CCFilter 0xD210 |
-#define PTP_DPC_SONY_AspectRatio 0xD211 |
-#define PTP_DPC_SONY_ExposeIndex 0xD216 |
-#define PTP_DPC_SONY_PictureEffect 0xD21B |
-#define PTP_DPC_SONY_ABFilter 0xD21C |
-#define PTP_DPC_SONY_ISO 0xD21E /* ? */ |
-/* also seen: D2C3 D2C4 */ |
-/* semi control opcodes */ |
-#define PTP_DPC_SONY_Movie 0xD2C8 /* ? */ |
-#define PTP_DPC_SONY_StillImage 0xD2C7 /* ? */ |
- |
- |
- |
/* Casio EX-F1 */ |
#define PTP_DPC_CASIO_MONITOR 0xD001 |
#define PTP_DPC_CASIO_STORAGE 0xD002 //Not reported by DeviceInfo? |
@@ -2106,8 +1852,6 @@ typedef struct _PTPCanonEOSDeviceInfo { |
#define PTP_DPC_CASIO_UNKNOWN_17 0xD030 |
#define PTP_DPC_CASIO_UNKNOWN_18 0xD080 |
-#define PTP_DPC_RICOH_ShutterSpeed 0xD00F |
- |
/* MTP specific Object Properties */ |
#define PTP_OPC_StorageID 0xDC01 |
#define PTP_OPC_ObjectFormat 0xDC02 |
@@ -2311,7 +2055,7 @@ typedef uint16_t (* PTPDataGetFunc) (PTPParams* params, void*priv, |
typedef uint16_t (* PTPDataPutFunc) (PTPParams* params, void*priv, |
unsigned long sendlen, |
- unsigned char *data); |
+ unsigned char *data, unsigned long *putlen); |
typedef struct _PTPDataHandler { |
PTPDataGetFunc getfunc; |
PTPDataPutFunc putfunc; |
@@ -2322,9 +2066,9 @@ typedef struct _PTPDataHandler { |
* This functions take PTP oriented arguments and send them over an |
* appropriate data layer doing byteorder conversion accordingly. |
*/ |
-typedef uint16_t (* PTPIOSendReq) (PTPParams* params, PTPContainer* req, int dataphase); |
+typedef uint16_t (* PTPIOSendReq) (PTPParams* params, PTPContainer* req); |
typedef uint16_t (* PTPIOSendData) (PTPParams* params, PTPContainer* ptp, |
- uint64_t size, PTPDataHandler*getter); |
+ unsigned long size, PTPDataHandler*getter); |
typedef uint16_t (* PTPIOGetResp) (PTPParams* params, PTPContainer* resp); |
typedef uint16_t (* PTPIOGetData) (PTPParams* params, PTPContainer* ptp, |
@@ -2356,24 +2100,10 @@ struct _PTPObject { |
PTPObjectInfo oi; |
uint32_t canon_flags; |
MTPProperties *mtpprops; |
- unsigned int nrofmtpprops; |
+ int nrofmtpprops; |
}; |
typedef struct _PTPObject PTPObject; |
-/* The Device Property Cache */ |
-struct _PTPDeviceProperty { |
- time_t timestamp; |
- PTPDevicePropDesc desc; |
- PTPPropertyValue value; |
-}; |
-typedef struct _PTPDeviceProperty PTPDeviceProperty; |
- |
-/* Transaction data phase description, internal flags to sendreq / transaction driver. */ |
-#define PTP_DP_NODATA 0x0000 /* no data phase */ |
-#define PTP_DP_SENDDATA 0x0001 /* sending data */ |
-#define PTP_DP_GETDATA 0x0002 /* receiving data */ |
-#define PTP_DP_DATA_MASK 0x00ff /* data phase mask */ |
- |
struct _PTPParams { |
/* device flags */ |
uint32_t device_flags; |
@@ -2403,16 +2133,13 @@ struct _PTPParams { |
/* ptp session ID */ |
uint32_t session_id; |
- /* used for open capture */ |
- uint32_t opencapture_transid; |
- |
/* PTP IO: if we have MTP style split header/data transfers */ |
int split_header_data; |
int ocs64; /* 64bit objectsize */ |
/* PTP: internal structures used by ptp driver */ |
PTPObject *objects; |
- unsigned int nrofobjects; |
+ int nrofobjects; |
PTPDeviceInfo deviceinfo; |
@@ -2420,30 +2147,19 @@ struct _PTPParams { |
PTPContainer *events; |
int nrofevents; |
- /* live view enabled */ |
- int inliveview; |
- |
- /* PTP: Device Property Caching */ |
- PTPDeviceProperty *deviceproperties; |
- unsigned int nrofdeviceproperties; |
- |
/* PTP: Canon specific flags list */ |
PTPCanon_Property *canon_props; |
- unsigned int nrofcanon_props; |
+ int nrofcanon_props; |
int canon_viewfinder_on; |
int canon_event_mode; |
/* PTP: Canon EOS event queue */ |
PTPCanon_changes_entry *backlogentries; |
- unsigned int nrofbacklogentries; |
+ int nrofbacklogentries; |
int eos_captureenabled; |
+ int eos_viewfinderenabled; |
int eos_camerastatus; |
- /* PTP: Nikon specifics */ |
- int controlmode; |
- int event90c7works; |
- int deletesdramfails; |
- |
/* PTP: Wifi profiles */ |
uint8_t wifi_profiles_version; |
uint8_t wifi_profiles_number; |
@@ -2459,9 +2175,8 @@ struct _PTPParams { |
PTPDeviceInfo outer_deviceinfo; |
char *olympus_cmd; |
char *olympus_reply; |
- struct _PTPParams *outer_params; |
-#if defined(HAVE_ICONV) && defined(HAVE_LANGINFO_H) |
+#ifdef HAVE_ICONV |
/* PTP: iconv converters */ |
iconv_t cd_locale_to_ucs2; |
iconv_t cd_ucs2_to_locale; |
@@ -2474,19 +2189,15 @@ struct _PTPParams { |
uint16_t response_packet_size; |
}; |
-/* Asynchronous event callback */ |
-typedef void(* PTPEventCbFn) (PTPParams *params, uint16_t code, PTPContainer *event, void *user_data); |
- |
/* last, but not least - ptp functions */ |
-uint16_t ptp_usb_sendreq (PTPParams* params, PTPContainer* req, int dataphase); |
+uint16_t ptp_usb_sendreq (PTPParams* params, PTPContainer* req); |
uint16_t ptp_usb_senddata (PTPParams* params, PTPContainer* ptp, |
- uint64_t size, PTPDataHandler *handler); |
+ unsigned long size, PTPDataHandler *handler); |
uint16_t ptp_usb_getresp (PTPParams* params, PTPContainer* resp); |
uint16_t ptp_usb_getdata (PTPParams* params, PTPContainer* ptp, |
PTPDataHandler *handler); |
uint16_t ptp_usb_event_check (PTPParams* params, PTPContainer* event); |
uint16_t ptp_usb_event_wait (PTPParams* params, PTPContainer* event); |
-uint16_t ptp_usb_event_async (PTPParams *params, PTPEventCbFn cb, void *user_data); |
uint16_t ptp_usb_control_get_extended_event_data (PTPParams *params, char *buffer, int *size); |
uint16_t ptp_usb_control_device_reset_request (PTPParams *params); |
@@ -2495,9 +2206,9 @@ uint16_t ptp_usb_control_cancel_request (PTPParams *params, uint32_t transid); |
int ptp_ptpip_connect (PTPParams* params, const char *port); |
-uint16_t ptp_ptpip_sendreq (PTPParams* params, PTPContainer* req, int dataphase); |
+uint16_t ptp_ptpip_sendreq (PTPParams* params, PTPContainer* req); |
uint16_t ptp_ptpip_senddata (PTPParams* params, PTPContainer* ptp, |
- uint64_t size, PTPDataHandler *handler); |
+ unsigned long size, PTPDataHandler *handler); |
uint16_t ptp_ptpip_getresp (PTPParams* params, PTPContainer* resp); |
uint16_t ptp_ptpip_getdata (PTPParams* params, PTPContainer* ptp, |
PTPDataHandler *handler); |
@@ -2510,15 +2221,6 @@ uint16_t ptp_generic_no_data (PTPParams* params, uint16_t opcode, unsigned int c |
uint16_t ptp_opensession (PTPParams *params, uint32_t session); |
-uint16_t ptp_transaction_new (PTPParams* params, PTPContainer* ptp, |
- uint16_t flags, uint64_t sendlen, |
- PTPDataHandler *handler |
-); |
-uint16_t ptp_transaction (PTPParams* params, PTPContainer* ptp, |
- uint16_t flags, uint64_t sendlen, |
- unsigned char **data, unsigned int *recvlen |
-); |
- |
/** |
* ptp_closesession: |
* params: PTPParams* |
@@ -2528,16 +2230,6 @@ uint16_t ptp_transaction (PTPParams* params, PTPContainer* ptp, |
* Return values: Some PTP_RC_* code. |
**/ |
#define ptp_closesession(params) ptp_generic_no_data(params,PTP_OC_CloseSession,0) |
- |
-/** |
- * ptp_powerdown: |
- * params: PTPParams* |
- * |
- * Powers down device. |
- * |
- * Return values: Some PTP_RC_* code. |
- **/ |
-#define ptp_powerdown(params) ptp_generic_no_data(params,PTP_OC_PowerDown,0) |
/** |
* ptp_resetdevice: |
* params: PTPParams* |
@@ -2584,9 +2276,6 @@ uint16_t ptp_getobject_to_handler (PTPParams* params, uint32_t handle, PTPDataHa |
uint16_t ptp_getpartialobject (PTPParams* params, uint32_t handle, uint32_t offset, |
uint32_t maxbytes, unsigned char** object, |
uint32_t *len); |
-uint16_t ptp_getpartialobject_to_handler (PTPParams* params, uint32_t handle, uint32_t offset, |
- uint32_t maxbytes, PTPDataHandler *handler); |
- |
uint16_t ptp_getthumb (PTPParams *params, uint32_t handle, |
unsigned char** object, unsigned int *len); |
@@ -2608,9 +2297,9 @@ uint16_t ptp_sendobjectinfo (PTPParams* params, uint32_t* store, |
*/ |
#define ptp_setobjectprotection(params,oid,newprot) ptp_generic_no_data(params,PTP_OC_SetObjectProtection,2,oid,newprot) |
uint16_t ptp_sendobject (PTPParams* params, unsigned char* object, |
- uint64_t size); |
-uint16_t ptp_sendobject_fromfd (PTPParams* params, int fd, uint64_t size); |
-uint16_t ptp_sendobject_from_handler (PTPParams* params, PTPDataHandler*, uint64_t size); |
+ uint32_t size); |
+uint16_t ptp_sendobject_fromfd (PTPParams* params, int fd, uint32_t size); |
+uint16_t ptp_sendobject_from_handler (PTPParams* params, PTPDataHandler*, uint32_t size); |
/** |
* ptp_initiatecapture: |
* params: PTPParams* |
@@ -2627,19 +2316,12 @@ uint16_t ptp_sendobject_from_handler (PTPParams* params, PTPDataHandler*, uint6 |
**/ |
#define ptp_initiatecapture(params,storageid,ofc) ptp_generic_no_data(params,PTP_OC_InitiateCapture,2,storageid,ofc) |
-#define ptp_initiateopencapture(params,storageid,ofc) ptp_generic_no_data(params,PTP_OC_InitiateOpenCapture,2,storageid,ofc) |
-#define ptp_terminateopencapture(params,transid) ptp_generic_no_data(params,PTP_OC_TerminateOpenCapture,1,transid) |
- |
uint16_t ptp_getdevicepropdesc (PTPParams* params, uint16_t propcode, |
PTPDevicePropDesc *devicepropertydesc); |
-uint16_t ptp_generic_getdevicepropdesc (PTPParams *params, uint16_t propcode, |
- PTPDevicePropDesc *dpd); |
uint16_t ptp_getdevicepropvalue (PTPParams* params, uint16_t propcode, |
PTPPropertyValue* value, uint16_t datatype); |
uint16_t ptp_setdevicepropvalue (PTPParams* params, uint16_t propcode, |
PTPPropertyValue* value, uint16_t datatype); |
-uint16_t ptp_generic_setdevicepropvalue (PTPParams* params, uint16_t propcode, |
- PTPPropertyValue* value, uint16_t datatype); |
uint16_t ptp_getfilesystemmanifest (PTPParams* params, uint32_t storage, |
uint32_t objectformatcode, uint32_t associationOH, |
unsigned char** data); |
@@ -2647,8 +2329,6 @@ uint16_t ptp_getfilesystemmanifest (PTPParams* params, uint32_t storage, |
uint16_t ptp_check_event (PTPParams *params); |
-uint16_t ptp_wait_event (PTPParams *params); |
-uint16_t ptp_add_event (PTPParams *params, PTPContainer *evt); |
int ptp_get_one_event (PTPParams *params, PTPContainer *evt); |
uint16_t ptp_check_eos_events (PTPParams *params); |
int ptp_get_one_eos_event (PTPParams *params, PTPCanon_changes_entry *entry); |
@@ -2846,12 +2526,6 @@ uint16_t ptp_canon_checkevent (PTPParams* params, |
* Return values: Some PTP_RC_* code. |
* |
**/ |
-#define CANON_EOS_OLC_BUTTON 0x0001 |
-#define CANON_EOS_OLC_SHUTTERSPEED 0x0002 |
-#define CANON_EOS_OLC_APERTURE 0x0004 |
-#define CANON_EOS_OLC_ISO 0x0008 |
- |
-#define ptp_canon_eos_setrequestolcinfogroup(params,igmask) ptp_generic_no_data(params,PTP_OC_CANON_EOS_SetRequestOLCInfoGroup,1,igmask) |
#define ptp_canon_eos_requestdevicepropvalue(params,prop) ptp_generic_no_data(params,PTP_OC_CANON_EOS_RequestDevicePropValue,1,prop) |
uint16_t ptp_canon_eos_capture (PTPParams* params, uint32_t *result); |
uint16_t ptp_canon_eos_getevent (PTPParams* params, PTPCanon_changes_entry **entries, int *nrofentries); |
@@ -2968,18 +2642,6 @@ uint16_t ptp_nikon_curve_download (PTPParams* params, |
uint16_t ptp_nikon_getptpipinfo (PTPParams* params, unsigned char **data, unsigned int *size); |
uint16_t ptp_nikon_getwifiprofilelist (PTPParams* params); |
uint16_t ptp_nikon_writewifiprofile (PTPParams* params, PTPNIKONWifiProfile* profile); |
- |
-uint16_t ptp_sony_sdioconnect (PTPParams* params, uint32_t p1, uint32_t p2, uint32_t p3); |
-uint16_t ptp_sony_get_vendorpropcodes (PTPParams* params, uint16_t **props, unsigned int *size); |
-uint16_t ptp_sony_getdevicepropdesc (PTPParams* params, uint16_t propcode, |
- PTPDevicePropDesc *devicepropertydesc); |
-uint16_t ptp_sony_getalldevicepropdesc (PTPParams* params); |
-uint16_t ptp_sony_setdevicecontrolvaluea (PTPParams* params, uint16_t propcode, |
- PTPPropertyValue* value, uint16_t datatype); |
-uint16_t ptp_sony_setdevicecontrolvalueb (PTPParams* params, uint16_t propcode, |
- PTPPropertyValue* value, uint16_t datatype); |
-uint16_t ptp_sony_9280 (PTPParams* params, uint32_t additional, uint32_t data1, uint32_t data2, uint32_t data3, uint32_t data4, uint8_t x, uint8_t y); |
-uint16_t ptp_sony_9281 (PTPParams* params, uint32_t param1); |
/** |
* ptp_nikon_deletewifiprofile: |
* |
@@ -3005,19 +2667,6 @@ uint16_t ptp_sony_9281 (PTPParams* params, uint32_t param1); |
**/ |
#define ptp_nikon_setcontrolmode(params,mode) ptp_generic_no_data(params,PTP_OC_NIKON_SetControlMode,1,mode) |
/** |
- * ptp_nikon_terminatecapture: |
- * |
- * This command appears to terminate a longer capture |
- * |
- * params: PTPParams* |
- * uint32_t a |
- * uint32_t b |
- * |
- * Return values: Some PTP_RC_* code. |
- * |
- **/ |
-#define ptp_nikon_terminatecapture(params,p1,p2) ptp_generic_no_data(params,PTP_OC_NIKON_TerminateCapture,2,p1,p2) |
-/** |
* ptp_nikon_afdrive: |
* |
* This command runs (drives) the lens autofocus. |
@@ -3029,41 +2678,6 @@ uint16_t ptp_sony_9281 (PTPParams* params, uint32_t param1); |
**/ |
#define ptp_nikon_afdrive(params) ptp_generic_no_data(params,PTP_OC_NIKON_AfDrive,0) |
/** |
- * ptp_nikon_changeafarea: |
- * |
- * This command starts movie capture (to card) |
- * |
- * params: PTPParams* |
- * x: x coordinate |
- * y: y coordinate |
- * |
- * Return values: Some PTP_RC_* code. |
- * |
- **/ |
-#define ptp_nikon_changeafarea(params,x,y) ptp_generic_no_data(params,PTP_OC_NIKON_ChangeAfArea,2,x,y) |
-/** |
- * ptp_nikon_startmovie: |
- * |
- * This command starts movie capture (to card) |
- * |
- * params: PTPParams* |
- * |
- * Return values: Some PTP_RC_* code. |
- * |
- **/ |
-#define ptp_nikon_startmovie(params) ptp_generic_no_data(params,PTP_OC_NIKON_StartMovieRecInCard,0) |
-/** |
- * ptp_nikon_stopmovie: |
- * |
- * This command stops movie capture (to card) |
- * |
- * params: PTPParams* |
- * |
- * Return values: Some PTP_RC_* code. |
- * |
- **/ |
-#define ptp_nikon_stopmovie(params) ptp_generic_no_data(params,PTP_OC_NIKON_EndMovieRec,0) |
-/** |
* ptp_canon_eos_afdrive: |
* |
* This command runs (drives) the lens autofocus. |
@@ -3075,17 +2689,6 @@ uint16_t ptp_sony_9281 (PTPParams* params, uint32_t param1); |
**/ |
#define ptp_canon_eos_afdrive(params) ptp_generic_no_data(params,PTP_OC_CANON_EOS_DoAf,0) |
/** |
- * ptp_canon_eos_afcancel: |
- * |
- * This command cancels the lens autofocus. |
- * |
- * params: PTPParams* |
- * |
- * Return values: Some PTP_RC_* code. |
- * |
- **/ |
-#define ptp_canon_eos_afcancel(params) ptp_generic_no_data(params,PTP_OC_CANON_EOS_AfCancel,0) |
-/** |
* ptp_canon_eos_zoom: |
* |
* This command runs (drives) the lens autofocus. |
@@ -3099,7 +2702,7 @@ uint16_t ptp_sony_9281 (PTPParams* params, uint32_t param1); |
#define ptp_canon_eos_zoom(params,x) ptp_generic_no_data(params,PTP_OC_CANON_EOS_Zoom,1,x) |
#define ptp_canon_eos_zoomposition(params,x,y) ptp_generic_no_data(params,PTP_OC_CANON_EOS_ZoomPosition,2,x,y) |
-#define ptp_canon_eos_remotereleaseon(params,x,y) ptp_generic_no_data(params,PTP_OC_CANON_EOS_RemoteReleaseOn,2,x,y) |
+#define ptp_canon_eos_remotereleaseon(params,x) ptp_generic_no_data(params,PTP_OC_CANON_EOS_RemoteReleaseOn,1,x) |
#define ptp_canon_eos_remotereleaseoff(params,x) ptp_generic_no_data(params,PTP_OC_CANON_EOS_RemoteReleaseOff,1,x) |
/** |
* ptp_nikon_mfdrive: |
@@ -3133,28 +2736,12 @@ uint16_t ptp_sony_9281 (PTPParams* params, uint32_t param1); |
* This command captures a picture on the Nikon. |
* |
* params: PTPParams* |
- * uint32_t x: unknown parameter. seen to be -1. |
+ * uint32_t x - unknown parameter. seen to be -1. |
* |
* Return values: Some PTP_RC_* code. |
* |
**/ |
#define ptp_nikon_capture(params,x) ptp_generic_no_data(params,PTP_OC_NIKON_Capture,1,x) |
- |
-/** |
- * ptp_nikon_capture2: |
- * |
- * This command captures a picture on the Nikon. |
- * |
- * params: PTPParams* |
- * af: autofocus before capture (1 yes , 0 no) |
- * target: sdram 1, card 0 |
- * |
- * Return values: Some PTP_RC_* code. |
- * 2 params: |
- * 0xffffffff == No AF before, 0xfffffffe == AF before capture |
- * sdram=1, card=0 |
- */ |
-#define ptp_nikon_capture2(params,af,target) ptp_generic_no_data(params,PTP_OC_NIKON_InitiateCaptureRecInMedia,2,af?0xfffffffe:0xffffffff,target) |
/** |
* ptp_nikon_capture_sdram: |
* |
@@ -3202,7 +2789,7 @@ uint16_t ptp_nikon_get_preview_image (PTPParams* params, unsigned char**, unsign |
* |
**/ |
#define ptp_nikon_end_liveview(params) ptp_generic_no_data(params,PTP_OC_NIKON_EndLiveView,0) |
-uint16_t ptp_nikon_check_event (PTPParams* params, PTPContainer **evt, unsigned int *evtcnt); |
+uint16_t ptp_nikon_check_event (PTPParams* params, PTPContainer **evt, int *evtcnt); |
uint16_t ptp_nikon_getfileinfoinblock (PTPParams* params, uint32_t p1, uint32_t p2, uint32_t p3, |
unsigned char **data, unsigned int *size); |
/** |
@@ -3219,23 +2806,6 @@ uint16_t ptp_nikon_getfileinfoinblock (PTPParams* params, uint32_t p1, uint32_t |
#define ptp_nikon_device_ready(params) ptp_generic_no_data (params, PTP_OC_NIKON_DeviceReady, 0) |
uint16_t ptp_mtp_getobjectpropssupported (PTPParams* params, uint16_t ofc, uint32_t *propnum, uint16_t **props); |
- |
-/* Android MTP Extensions */ |
-uint16_t ptp_android_getpartialobject64 (PTPParams* params, uint32_t handle, uint64_t offset, |
- uint32_t maxbytes, unsigned char** object, |
- uint32_t *len); |
-#define ptp_android_begineditobject(params,handle) ptp_generic_no_data (params, PTP_OC_ANDROID_BeginEditObject, 1, handle) |
-#define ptp_android_truncate(params,handle,offset) ptp_generic_no_data (params, PTP_OC_ANDROID_TruncateObject, 3, handle, (offset & 0xFFFFFFFF), (offset >> 32)) |
-uint16_t ptp_android_sendpartialobject (PTPParams *params, uint32_t handle, |
- uint64_t offset, unsigned char *object, uint32_t len); |
-#define ptp_android_endeditobject(params,handle) ptp_generic_no_data (params, PTP_OC_ANDROID_EndEditObject, 1, handle) |
- |
-uint16_t ptp_olympus_getdeviceinfo (PTPParams*, PTPDeviceInfo*); |
-#define ptp_olympus_setcameracontrolmode(params,p1) ptp_generic_no_data (params, PTP_OC_OLYMPUS_SetCameraControlMode, 1, p1) |
-uint16_t ptp_olympus_opensession (PTPParams*, unsigned char**, unsigned int *); |
-#define ptp_olympus_capture(params,p1) ptp_generic_no_data (params, PTP_OC_OLYMPUS_Capture, 1, p1) |
-uint16_t ptp_olympus_getcameraid (PTPParams*, unsigned char**, unsigned int *); |
- |
/* Non PTP protocol functions */ |
static inline int |
ptp_operation_issupported(PTPParams* params, uint16_t operation) |
@@ -3252,41 +2822,74 @@ ptp_operation_issupported(PTPParams* params, uint16_t operation) |
int ptp_event_issupported (PTPParams* params, uint16_t event); |
int ptp_property_issupported (PTPParams* params, uint16_t property); |
+void ptp_free_devicepropdesc (PTPDevicePropDesc* dpd); |
+void ptp_free_devicepropvalue (uint16_t dt, PTPPropertyValue* dpd); |
+void ptp_free_objectpropdesc (PTPObjectPropDesc* dpd); |
void ptp_free_params (PTPParams *params); |
-void ptp_free_objectpropdesc (PTPObjectPropDesc*); |
-void ptp_free_devicepropdesc (PTPDevicePropDesc*); |
-void ptp_free_devicepropvalue (uint16_t, PTPPropertyValue*); |
void ptp_free_objectinfo (PTPObjectInfo *oi); |
void ptp_free_object (PTPObject *oi); |
-const char *ptp_strerror (uint16_t ret, uint16_t vendor); |
+const char *ptp_strerror(uint16_t error); |
+void ptp_perror (PTPParams* params, uint16_t error); |
void ptp_debug (PTPParams *params, const char *format, ...); |
void ptp_error (PTPParams *params, const char *format, ...); |
-const char* ptp_get_property_description(PTPParams* params, uint16_t dpc); |
- |
-const char* ptp_get_opcode_name(PTPParams* params, uint16_t opcode); |
+const char* |
+ptp_get_property_description(PTPParams* params, uint16_t dpc); |
int |
ptp_render_property_value(PTPParams* params, uint16_t dpc, |
- PTPDevicePropDesc *dpd, unsigned int length, char *out); |
+ PTPDevicePropDesc *dpd, int length, char *out); |
int ptp_render_ofc(PTPParams* params, uint16_t ofc, int spaceleft, char *txt); |
+int ptp_render_opcode(PTPParams* params, uint16_t opcode, int spaceleft, char *txt); |
int ptp_render_mtp_propname(uint16_t propid, int spaceleft, char *txt); |
MTPProperties *ptp_get_new_object_prop_entry(MTPProperties **props, int *nrofprops); |
void ptp_destroy_object_prop(MTPProperties *prop); |
void ptp_destroy_object_prop_list(MTPProperties *props, int nrofprops); |
MTPProperties *ptp_find_object_prop_in_cache(PTPParams *params, uint32_t const handle, uint32_t const attribute_id); |
-uint16_t ptp_remove_object_from_cache(PTPParams *params, uint32_t handle); |
+void ptp_remove_object_from_cache(PTPParams *params, uint32_t handle); |
uint16_t ptp_add_object_to_cache(PTPParams *params, uint32_t handle); |
-uint16_t ptp_object_want (PTPParams *, uint32_t handle, unsigned int want, PTPObject**retob); |
+uint16_t ptp_object_want (PTPParams *, uint32_t handle, int want, PTPObject**retob); |
void ptp_objects_sort (PTPParams *); |
uint16_t ptp_object_find (PTPParams *params, uint32_t handle, PTPObject **retob); |
uint16_t ptp_object_find_or_insert (PTPParams *params, uint32_t handle, PTPObject **retob); |
/* ptpip.c */ |
void ptp_nikon_getptpipguid (unsigned char* guid); |
-/* CHDK specifics */ |
+enum PTP_CHDK_Command { |
+ PTP_CHDK_Shutdown = 0, /* param2 is 0 (hard), 1 (soft), 2 (reboot) or 3 (reboot fw update) |
+ if param2 == 3, then filename of fw update is send as data (empty for default) */ |
+ PTP_CHDK_GetMemory, /* param2 is base address (or 0 for live image buffer, 1 for bitmap buffer) |
+ param3 is size (in bytes) |
+ return data is memory block */ |
+ PTP_CHDK_SetMemoryLong, /* param2 is address |
+ param3 is value */ |
+ PTP_CHDK_CallFunction, /* data is array of function pointer and (long) arguments (max: 10 args) |
+ return param1 is return value */ |
+ PTP_CHDK_GetPropCase, /* param2 is base id |
+ param3 is number of properties |
+ return data is array of longs */ |
+ PTP_CHDK_GetParamData, /* param2 is base id |
+ param3 is number of parameters |
+ return data is sequence of strings prefixed by their length (as long) */ |
+ PTP_CHDK_TempData, /* data is data to be stored for later */ |
+ PTP_CHDK_UploadFile, /* data is 4-byte length of filename, followed by filename and contents */ |
+ PTP_CHDK_DownloadFile, /* preceded by PTP_CHDK_TempData with filename |
+ return data are file contents */ |
+ PTP_CHDK_SwitchMode, /* param2 is 0 (playback) or 1 (record) */ |
+ PTP_CHDK_ExecuteLUA, /* data is script to be executed */ |
+ PTP_CHDK_GetVideoSettings, |
+ PTP_CHDK_GetScriptOutput, /* return script output in ASCIIZ */ |
+ PTP_CHDK_OpenDir, /* open directory listing, data is directory name */ |
+ PTP_CHDK_ReadDir, /* return data is next file info */ |
+ PTP_CHDK_CloseDir, /* close directory listing */ |
+ PTP_CHDK_GetShootingModesList, /* not used */ |
+ PTP_CHDK_StartDownloadFile, |
+ PTP_CHDK_ResumeDownloadFile, |
+ PTP_CHDK_EndDownloadFile, |
+}; |
+ |
#define PTP_OC_CHDK 0x9999 |
typedef struct tagptp_chdk_videosettings { |
long live_image_buffer_width; |
@@ -3298,56 +2901,19 @@ typedef struct tagptp_chdk_videosettings { |
unsigned palette[16]; |
} ptp_chdk_videosettings; |
-/* Nafraf: Test this!!!*/ |
+#define ptp_chdk_shutdown_hard(params) ptp_generic_no_data(params,PTP_OC_CHDK,2,PTP_CHDK_Shutdown,0) |
+#define ptp_chdk_shutdown_soft(params) ptp_generic_no_data(params,PTP_OC_CHDK,2,PTP_CHDK_Shutdown,1) |
+#define ptp_chdk_reboot(params) ptp_generic_no_data(params,PTP_OC_CHDK,2,PTP_CHDK_Shutdown,2) |
+#define ptp_chdk_reboot_fw_update(params) ptp_generic_no_data(params,PTP_OC_CHDK,2,PTP_CHDK_Shutdown,3) |
+uint16_t ptp_chdk_get_memory(PTPParams* params, int start, int num, unsigned char**); |
+#define ptp_chdk_set_memory_long(params,addr,val) ptp_generic_no_data(params,PTP_OC_CHDK,3,PTP_CHDK_SetMemoryLong,addr,val) |
+uint16_t ptp_chdk_call(PTPParams* params, int *args, int size, int *ret); |
+uint16_t ptp_chdk_get_propcase(PTPParams* params, int start, int num, int* ints); |
+uint16_t ptp_chdk_get_paramdata(PTPParams* params, int start, int num, unsigned char** x); |
#define ptp_chdk_switch_mode(params,mode) ptp_generic_no_data(params,PTP_OC_CHDK,2,PTP_CHDK_SwitchMode,mode) |
- |
-/* include CHDK ptp protocol definitions from a CHDK source tree */ |
-#include "chdk_ptp.h" |
-#if (PTP_CHDK_VERSION_MAJOR < 2 || (PTP_CHDK_VERSION_MAJOR == 2 && PTP_CHDK_VERSION_MINOR < 5)) |
-#error your chdk headers are too old, unset CHDK_SRC_DIR in config.mk |
-#endif |
-#include "chdk_live_view.h" |
- |
-/* the following happens to match what is used in CHDK, but is not part of the protocol */ |
-typedef struct { |
- unsigned size; |
- unsigned script_id; /* id of script message is to/from */ |
- unsigned type; |
- unsigned subtype; |
- char data[]; |
-} ptp_chdk_script_msg; |
- |
-/* |
-chunk for remote capture |
-*/ |
-typedef struct { |
- uint32_t size; /* length of data */ |
- int last; /* is it the last chunk? */ |
- uint32_t offset; /* offset within file, or -1 */ |
- unsigned char *data; /* data, must be free'd by caller when done */ |
-} ptp_chdk_rc_chunk; |
- |
- |
-uint16_t ptp_chdk_get_memory(PTPParams* params, int start, int num, unsigned char **); |
-uint16_t ptp_chdk_set_memory_long(PTPParams* params, int addr, int val); |
-int ptp_chdk_upload(PTPParams* params, char *local_fn, char *remote_fn); |
-uint16_t ptp_chdk_download(PTPParams* params, char *remote_fn, PTPDataHandler *handler); |
- |
-/* remote capture */ |
-uint16_t ptp_chdk_rcisready(PTPParams* params, int *isready,int *imgnum); |
-uint16_t ptp_chdk_rcgetchunk(PTPParams* params,int fmt, ptp_chdk_rc_chunk *chunk); |
- |
-uint16_t ptp_chdk_exec_lua(PTPParams* params, char *script, int flags, int *script_id,int *status); |
-uint16_t ptp_chdk_get_version(PTPParams* params, int *major, int *minor); |
-uint16_t ptp_chdk_get_script_support(PTPParams* params, unsigned *status); |
-uint16_t ptp_chdk_get_script_status(PTPParams* params, unsigned *status); |
-uint16_t ptp_chdk_write_script_msg(PTPParams* params, char *data, unsigned size, int target_script_id, int *status); |
-uint16_t ptp_chdk_read_script_msg(PTPParams* params, ptp_chdk_script_msg **msg); |
-uint16_t ptp_chdk_get_live_data(PTPParams* params, unsigned flags, unsigned char **data, unsigned int *data_size); |
-uint16_t ptp_chdk_call_function(PTPParams* params, int *args, int size, int *ret); |
- |
-/*uint16_t ptp_chdk_get_script_output(PTPParams* params, char **output ); */ |
-/*uint16_t ptp_chdk_get_video_settings(PTPParams* params, ptp_chdk_videosettings* vsettings);*/ |
+uint16_t ptp_chdk_exec_lua(PTPParams *params, char *script, uint32_t* ret); |
+uint16_t ptp_chdk_get_script_output(PTPParams* params, char **output ); |
+uint16_t ptp_chdk_get_video_settings(PTPParams* params, ptp_chdk_videosettings* vsettings); |
#ifdef __cplusplus |
} |