Source code upload
[framework/connectivity/libgphoto2.git] / camlibs / kodak / dc210 / library.h
1
2 #ifndef _DC210_LIBRARY_H_
3 #define _DC210_LIBRARY_H_
4
5 #define DC210_CMD_OKAY         0
6 #define DC210_WRITE_ERROR     -1
7 #define DC210_READ_ERROR      -2
8 #define DC210_TIMEOUT_ERROR   -3
9 #define DC210_NAK_ERROR       -4
10 #define DC210_GARBAGE_ERROR   -5
11
12 #define THUMBHEIGHT 72
13 #define THUMBWIDTH 96
14 #define RED 0
15 #define GREEN 1
16 #define BLUE 2
17
18 static void cfa2ppm (CameraFile * file);
19 static void dc210_cmd_init (char *cmd, unsigned char command_byte);
20 static void dc210_cmd_packet_init (char * cmd_packet, const char * filename);
21 static int dc210_write_single_char (Camera *camera, unsigned char response);
22 static int dc210_write_command_packet(Camera * camera, char * data);
23 static int dc210_execute_command (Camera *camera, char *cmd);
24 static int dc210_read_single_char (Camera *camera, unsigned char * p);
25 static int dc210_wait_for_response (Camera *camera, int expect_busy, GPContext *context);
26 static int dc210_read_to_file (Camera *camera, CameraFile * f, int blocksize, long int expectsize, GPContext *context);
27 static int dc210_read_single_block (Camera *camera, unsigned char * b, int blocksize);
28 static int dc210_set_option (Camera * camera, char command, unsigned int value, int valuesize);
29 static int dc210_check_battery (Camera *camera);
30 static int dc210_get_card_status (Camera * camera, dc210_card_status * card_status);
31 static void dc210_picinfo_from_block (dc210_picture_info * picinfo, unsigned char * data);
32
33 #ifdef DEBUG
34 static int dc210_read_dummy_packet(Camera * camera);
35 static int dc210_test_command(Camera * camera, unsigned char cmdbyte, unsigned char *databytes);
36 #endif
37
38 #endif /* _DC210_LIBRARY_H_ */
39
40