Thanks for the patch. Setting the parameter works now, although not for all values.
I wanted to be sure I have not done anything wrong when modifying the config.c file, so I also tried dowloading the latest version of libgphoto2 from the SVN trunk. Setting the parameter fails for the following values: 2, 6, 10, 14, 18, 22. The debug output says:
0.594405 ptp2/usb_getresp(2): request code 0x1016 getting resp error 0x200f
0.594439 context(0): The property 'ISO Auto High Limit' / 0xd183 was not set, PTP errorcode 0x200f.
*** Error ***
The property 'ISO Auto High Limit' / 0xd183 was not set, PTP errorcode 0x200f.
0.595598 gp-camera(2): Freeing camera...
0.595680 gphoto2-camera(2): Exiting camera ('Nikon DSC D3s (PTP mode)')...
Here's the complete output of 'gphoto2 --set-config /main/other/d183=10 --debug' (svn version):
debug_svn.logPerhaps there's a logical explanation why every fourth value fails. Anyway, I can already start working with what I have now.
Thanks and regards,
K.
Marcus Meissner-4 wrote:
Apply this patch:
(Tested with my Nikon D90 and 0xd183 ;)
Ciao, Marcus
Index: config.c
===================================================================
--- camlibs/ptp2/config.c (Revision 13358)
+++ camlibs/ptp2/config.c (Arbeitskopie)
@@ -5007,7 +5007,7 @@
uint16_t propid = params->deviceinfo.DevicePropertiesSupported[i];
CameraWidget *widget;
CameraWidgetType type;
- char buf[20], *label;
+ char buf[20], *label, *xval;
PTPDevicePropDesc dpd;
label = (char*)ptp_get_property_description(params, propid);
@@ -5042,8 +5042,8 @@
propval.val = f; \
} else { \
long x; \
- gp_widget_get_value (widget, buf); \
- sscanf (buf, "%ld", &x); \
+ ret = gp_widget_get_value (widget, &xval); \
+ sscanf (xval, "%ld", &x); \
propval.val = x; \
}\
break;