summaryrefslogtreecommitdiff
path: root/camlibs/toshiba
diff options
context:
space:
mode:
authorSean Bruno <sean.bruno@dsl-only.net>2004-07-17 20:31:25 +0000
committerSean Bruno <sean.bruno@dsl-only.net>2004-07-17 20:31:25 +0000
commit77a0002ba8b68de10433487bc884ca9953affd1c (patch)
tree6a0a1ec9df666aa993cec9c8d6b80e093926fe2b /camlibs/toshiba
parentdba3ded30dce0df007a7074f1f23137c3d25e1b2 (diff)
downloadlibgphoto2-77a0002ba8b68de10433487bc884ca9953affd1c.tar.gz
updated pdrm65_get_filenames to properly determine how many files the camera has.
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@7249 67ed7778-7388-44ab-90cf-0a291f65f57c
Diffstat (limited to 'camlibs/toshiba')
-rw-r--r--camlibs/toshiba/pdrm65/pdrm65.c24
1 files changed, 21 insertions, 3 deletions
diff --git a/camlibs/toshiba/pdrm65/pdrm65.c b/camlibs/toshiba/pdrm65/pdrm65.c
index c4473155b..ea09c1ea8 100644
--- a/camlibs/toshiba/pdrm65/pdrm65.c
+++ b/camlibs/toshiba/pdrm65/pdrm65.c
@@ -63,6 +63,24 @@ int pdrm65_get_filenames(GPPort *port, CameraList *list)
char out_buf[1024];
char in_buf[1024];
char ok = 0x06;
+
+ gp_port_set_timeout(port, 10000);
+ out_buf[0] = 0x1b;
+ out_buf[1] = 0x43;
+ out_buf[2] = 0x02;
+ out_buf[3] = 0x00;
+ out_buf[4] = 0x01;
+ out_buf[5] = 0x10;
+ out_buf[6] = 0x11;
+ out_buf[7] = 0x00;
+
+
+ gp_port_write(port, out_buf, 8);
+ gp_port_read (port, in_buf, 10);
+ /* trying to remain endian friendly */
+ gp_port_write(port, &ok, 1);
+
+
out_buf[0] = 0x1b;
out_buf[1] = 0x43;
out_buf[2] = 0x02;
@@ -72,13 +90,13 @@ int pdrm65_get_filenames(GPPort *port, CameraList *list)
out_buf[6] = 0x0b;
out_buf[7] = 0x00;
- gp_port_set_timeout(port, 10000);
+
gp_port_write(port, out_buf, 8);
- gp_port_read (port, in_buf, 9);
+ gp_port_read (port, in_buf, 10);
/* trying to remain endian friendly */
gp_port_write(port, &ok, 1);
- numPics = le16atoh(&in_buf[3]) + (le16atoh(&in_buf[4]) * 256);
+ numPics = in_buf[4] + (in_buf[5] * 256);
GP_DEBUG("found %d pictures", numPics);