From 1968c42e093371fc8b76f90d012a042ca0c4f31f Mon Sep 17 00:00:00 2001 From: "Stephen H. Westin" Date: Wed, 9 Mar 2005 21:35:01 +0000 Subject: [PATCH] Setting byte 0x46 in command packet is needed for (new) class 6, but causes other cameras to hang. I now do it only for class 6. git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@7637 67ed7778-7388-44ab-90cf-0a291f65f57c --- camlibs/canon/usb.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/camlibs/canon/usb.c b/camlibs/canon/usb.c index 2b388b605..4592fcee6 100644 --- a/camlibs/canon/usb.c +++ b/camlibs/canon/usb.c @@ -1102,11 +1102,13 @@ canon_usb_dialogue (Camera *camera, canonCommandIndex canon_funct, int *return_l packet[0x44] = cmd1; packet[0x47] = cmd2; htole32a (packet + 0x04, cmd3); - /* New style of protocol is picky about this byte. */ - if ( cmd3 == 0x202 ) - packet[0x46] = 0x20; - else - packet[0x46] = 0x10; + if ( camera->pl->md->model == CANON_CLASS_6 ) + /* New style of protocol is picky about this byte. */ + if ( cmd3 == 0x202 ) + packet[0x46] = 0x20; + else + packet[0x46] = 0x10; + htole32a (packet + 0x4c, serial_code++); /* serial number */ htole32a (packet + 0x48, 0x10 + payload_length); msgsize = 0x50 + payload_length; /* TOTAL msg size */