diff options
author | Marcus Meissner <marcus@jet.franken.de> | 2022-12-06 13:25:04 +0100 |
---|---|---|
committer | Marcus Meissner <marcus@jet.franken.de> | 2022-12-06 13:25:04 +0100 |
commit | 7be692414f95b42d8b63566d379be65de3d0e6fb (patch) | |
tree | f02b5fa1bf012bae2d56a3095448f2b528011aaf /camlibs | |
parent | 949a6be31d459b8b16ee860c9dd3f840138f9cb5 (diff) | |
download | libgphoto2-7be692414f95b42d8b63566d379be65de3d0e6fb.tar.gz |
nikon z6 2 workaround, it reports a devicepropchanged 0x501c event, but the property is not avauilable
Diffstat (limited to 'camlibs')
-rw-r--r-- | camlibs/ptp2/library.c | 15 |
1 files 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) { |