summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilliam Wilhelm <will@wilhelm.id.au>2020-05-22 11:51:02 +1000
committerWilliam Wilhelm <will@wilhelm.id.au>2020-05-22 11:51:02 +1000
commit51b177c99259c5dcf07b14af59e04d8abdcf6c59 (patch)
treedc656d619d36a126880880225b75821806c0aead
parent31fe89e7ebfd08f41f301f8addff1f7e3b280bd4 (diff)
downloadlibgphoto2-51b177c99259c5dcf07b14af59e04d8abdcf6c59.tar.gz
lumix: check req_acc return value
-rw-r--r--camlibs/lumix/lumix.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/camlibs/lumix/lumix.c b/camlibs/lumix/lumix.c
index d465f333d..481e08c05 100644
--- a/camlibs/lumix/lumix.c
+++ b/camlibs/lumix/lumix.c
@@ -1869,6 +1869,8 @@ camera_init (Camera *camera, GPContext *context)
{
GPPortInfo info;
int ret;
+ int tries;
+ char *result;
camera->pl = calloc(sizeof(CameraPrivateLibrary),1);
@@ -1893,8 +1895,14 @@ camera_init (Camera *camera, GPContext *context)
}
gp_filesystem_set_funcs (camera->fs, &fsfuncs, camera);
- loadCmd(camera,"cam.cgi?mode=accctrl&type=req_acc&value=0&value2=libgphoto2/lumix");
- loadCmd(camera,"cam.cgi?mode=setsetting&type=device_name&value=libgphoto2/lumix");
+ tries = 3;
+ while (tries--) {
+ result = loadCmd(camera,"cam.cgi?mode=accctrl&type=req_acc&value=0&value2=libgphoto2/lumix");
+ if (strstr(result,"ok,")) {
+ loadCmd(camera,"cam.cgi?mode=setsetting&type=device_name&value=libgphoto2/lumix");
+ break;
+ }
+ }
if (switchToRecMode (camera) != NULL) {
int numpix;