diff --git a/camlibs/ptp2/config.c b/camlibs/ptp2/config.c index 67284a646..4f734000c 100644 --- a/camlibs/ptp2/config.c +++ b/camlibs/ptp2/config.c @@ -2290,14 +2290,35 @@ _set_sony_value_u32 (PTPParams*params, uint16_t prop, uint32_t value) { GP_LOG_D("setting 0x%04x to 0x%08x", prop, value); - /* FIXME: if it is a enum, go in direction of the enum order (ISO) */ C_PTP_REP (ptp_generic_getdevicepropdesc (params, prop, &dpd)); do { origval = dpd.CurrentValue.u32; - if (value > origval) - propval.u8 = 0x01; - else - propval.u8 = 0xff; + /* if it is a ENUM, the camera will walk through the ENUM */ + if (dpd.FormFlag & PTP_DPFF_Enumeration) { + int i, posorig = -1, posnew = -1; + + for (i=0;i posorig) + propval.u8 = 0x01; + else + propval.u8 = 0xff; + } else { + if (value > origval) + propval.u8 = 0x01; + else + propval.u8 = 0xff; + } C_PTP_REP (ptp_sony_setdevicecontrolvalueb (params, prop, &propval, PTP_DTC_UINT8 )); GP_LOG_D ("value is (0x%x vs target 0x%x)", origval, value);