3 * Copyright © 2002 Dominik Kuhlen <dkuhlen@fhm.edu>
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the
17 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 * Boston, MA 02111-1307, USA.
21 * GPhoto library for sx330z camera ....
22 * first try 6/2002 by Dominik Kuhlen <dkuhlen@fhm.edu>
26 #include <gphoto2/gphoto2-camera.h>
27 #include <gphoto2/gphoto2-context.h>
30 /* USB spec violating ! */
31 #define USB_REQ_RESERVED 0x04
33 /* is this correct ? */
34 #define USB_VENDOR_TRAVELER 0x0d96
36 /* this one should work */
37 #define USB_PRODUCT_SX330Z 0x3300
39 /* very experimental !!!
40 * Please report if this works
42 #define USB_PRODUCT_SX410Z 0x4100
44 #define USB_PRODUCT_MD9700 0x4102
46 /* different requests (are there more ?) */
47 #define SX330Z_REQUEST_INIT 0x0001 /* not sure */
48 #define SX330Z_REQUEST_TOC_SIZE 0x0002
49 #define SX330Z_REQUEST_TOC 0x0003
50 #define SX330Z_REQUEST_IMAGE 0x0004
51 #define SX330Z_REQUEST_DELETE 0x0010
53 #define SX_THUMBNAIL 1
57 /* 0x14 Bytes TOC entry */
58 struct traveler_toc_entry
60 char name[12]; /* SIMGxxxx.jpg (not 0 terminated) */
62 int32_t size; /* in bytes (%4096 is 0)*/
65 /* 0x200 Bytes TOC Page */
66 struct traveler_toc_page
68 int32_t data0; /* don't know ? (0) */
69 int32_t data1; /* don't know ? (0) */
70 int16_t always1; /* 1 ? */
71 int16_t numEntries; /* number of entries in TOC page (0 .. 25)*/
72 struct traveler_toc_entry entries[25]; /* entries */
75 struct _CameraPrivateLibrary
77 int usb_product; /* different Thumbnail size */
81 /* 0x20 Bytes Request */
84 int16_t always1; /* 0x01 */
85 int16_t requesttype; /* 0x0003 : TOC , 0x0004 Data */
86 int32_t data; /* dontknow */
87 int32_t timestamp; /* counter? only 24 bit */
88 int32_t offset; /* fileoffset */
89 int32_t size; /* transfer bolcksize */
90 char filename[12]; /* SIMG????jpg for Real image */ /* TIMG????jpg for Thumbnail */
93 /* 0x10 Bytes Acknowledge */
96 int32_t always3; /* 3 */
97 int32_t timestamp; /* not sure */
98 int32_t size; /* for TOC and other transfers */
99 int32_t dontknow; /* always 0 */
104 * There's not a real initialization,
107 int sx330z_init(Camera *camera,GPContext *context);
111 * Get number of TOC pages
113 int sx330z_get_toc_num_pages(Camera *camera,GPContext *context, int32_t *pages);
119 int sx330z_get_toc_page(Camera *camera,GPContext *context,struct traveler_toc_page *toc,int page);
122 * Load image data (thumbnail(exif) / image)
124 int sx330z_get_data(Camera *camera,GPContext *context, const char* filename,
125 char **,unsigned long int *size,int thumbnail);
132 int sx330z_delete_file(Camera *camera,GPContext *context,const char *filename);
137 int camera_exit(Camera *camera, GPContext *context);