From f18df92f8b34f2986d5eb9d8583dea7fe28ad4b2 Mon Sep 17 00:00:00 2001 From: Marcus Meissner Date: Wed, 28 Aug 2019 08:44:58 +0200 Subject: [PATCH] the nikon keymission 170 hides opcodes I think, so add the 360 opcodes and see if that helps. --- camlibs/ptp2/library.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/camlibs/ptp2/library.c b/camlibs/ptp2/library.c index d7873f2a3..8e9b1a2af 100644 --- a/camlibs/ptp2/library.c +++ b/camlibs/ptp2/library.c @@ -443,6 +443,24 @@ fixup_cached_deviceinfo (Camera *camera, PTPDeviceInfo *di) { di->OperationsSupported_len += 10; } } + if (params->deviceinfo.Model && (strstr(params->deviceinfo.Model,"KeyMission 170"))) + { + GP_LOG_D("The KeyMission 170 hides commands from us ... adding all KeyMission 360 ones"); + /* the keymission 170 seems to hide stuff from us. Mirror what the 360 exposes */ + C_MEM (di->OperationsSupported = realloc(di->OperationsSupported,sizeof(di->OperationsSupported[0])*(di->OperationsSupported_len + 12))); + di->OperationsSupported[di->OperationsSupported_len+0] = PTP_OC_NIKON_AfDrive; + di->OperationsSupported[di->OperationsSupported_len+1] = PTP_OC_NIKON_SetControlMode; + di->OperationsSupported[di->OperationsSupported_len+2] = PTP_OC_NIKON_GetLargeThumb; + di->OperationsSupported[di->OperationsSupported_len+3] = PTP_OC_NIKON_DeviceReady; + di->OperationsSupported[di->OperationsSupported_len+4] = PTP_OC_NIKON_StartLiveView; + di->OperationsSupported[di->OperationsSupported_len+5] = PTP_OC_NIKON_EndLiveView; + di->OperationsSupported[di->OperationsSupported_len+6] = PTP_OC_NIKON_GetLiveViewImg; + di->OperationsSupported[di->OperationsSupported_len+7] = PTP_OC_NIKON_ChangeAfArea; + di->OperationsSupported[di->OperationsSupported_len+8] = PTP_OC_NIKON_InitiateCaptureRecInMedia; + di->OperationsSupported[di->OperationsSupported_len+9] = PTP_OC_NIKON_EndMovieRec; + di->OperationsSupported[di->OperationsSupported_len+10] = PTP_OC_NIKON_StartMovieRecInCard; + di->OperationsSupported[di->OperationsSupported_len+11] = PTP_OC_InitiateCapture; + } if (params->deviceinfo.Model && (sscanf(params->deviceinfo.Model,"D%d", &nikond))) { if ((nikond >= 3000) && (nikond < 3199)) { @@ -1353,6 +1371,9 @@ static struct { /* https://sourceforge.net/p/libmtp/bugs/1743/ */ {"Nikon:Coolpix L340", 0x04b0, 0x0361, PTP_CAP}, + /* Krystal Puga */ + {"Nikon:KeyMission 170", 0x04b0, 0x0364, PTP_CAP}, + /* Nikon D100 has a PTP mode: westin 2002.10.16 */ {"Nikon:DSC D100 (PTP mode)", 0x04b0, 0x0402, 0}, /* D2H SLR in PTP mode from Steve Drew */