From 7be692414f95b42d8b63566d379be65de3d0e6fb Mon Sep 17 00:00:00 2001 From: Marcus Meissner Date: Tue, 6 Dec 2022 13:25:04 +0100 Subject: nikon z6 2 workaround, it reports a devicepropchanged 0x501c event, but the property is not avauilable --- camlibs/ptp2/library.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/camlibs/ptp2/library.c b/camlibs/ptp2/library.c index e41de38b1..8898cc59a 100644 --- a/camlibs/ptp2/library.c +++ b/camlibs/ptp2/library.c @@ -7283,8 +7283,19 @@ handleregular: PTPDevicePropDesc dpd; *eventtype = GP_EVENT_UNKNOWN; - /* cached devprop should hafve been flushed I think... */ - C_PTP_REP (ptp_generic_getdevicepropdesc (params, event.Param1&0xffff, &dpd)); + /* cached devprop should have been flushed I think... */ + ret = ptp_generic_getdevicepropdesc (params, event.Param1&0xffff, &dpd); + + /* Nikon Z6 II reports a prop changed event 501c, but getdevicepropdesc fails with devicepropnot supported + * (reported via email) + */ + if (ret == PTP_RC_DevicePropNotSupported) { + C_MEM (*eventdata = malloc(strlen("PTP Property 0123 changed")+1)); + sprintf (*eventdata, "PTP Property %04x changed", event.Param1 & 0xffff); + break; + } + if (ret != PTP_RC_OK) + C_PTP_REP (ret); ret = camera_lookup_by_property(camera, &dpd, &name, &content, context); if (ret == GP_OK) { -- cgit v1.2.1