| 1 |
/* dc120.h |
| 2 |
* |
| 3 |
* Copyright (C) Scott Fritzinger |
| 4 |
* |
| 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. |
| 9 |
* |
| 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. |
| 14 |
* |
| 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., 51 Franklin Street, Fifth Floor, |
| 18 |
* Boston, MA 02110-1301 USA |
| 19 |
*/ |
| 20 |
|
| 21 |
/* |
| 22 |
|
| 23 |
Packet Structure |
| 24 |
-------------------------------------------------------------- |
| 25 |
Command Packet: CMD 00 [4 byte field] 00 1A |
| 26 |
Camera Response: [variable width field] CHECKSUM |
| 27 |
|
| 28 |
Responses |
| 29 |
-------------------------------------------------------------- |
| 30 |
|
| 31 |
00 Command completed |
| 32 |
10 Command ready |
| 33 |
d1 Command received (ACK) |
| 34 |
d2 Correct packet |
| 35 |
e1 Command incorrect (NAK) |
| 36 |
e2 Command execution error |
| 37 |
e3 Illegal packet |
| 38 |
e4 Cancel |
| 39 |
|
| 40 |
|
| 41 |
Commands & Byte field descriptions |
| 42 |
-------------------------------------------------------------- |
| 43 |
These are ones relevant to gPhoto |
| 44 |
|
| 45 |
* Album #0 is the root folder (directory/album/etc...) |
| 46 |
|
| 47 |
List albums (folders) |
| 48 |
Packet: 44 00 00 00 00 00 00 1A |
| 49 |
|
| 50 |
Response: |
| 51 |
ALBUMNAME1\0\0\0\0\0ALBUMNAME2\0\0\0\0\0ALBUMNAME3\0\0\0\0\0 [...] CS |
| 52 |
|
| 53 |
(258 bytes, 15 byte fixed-with fields in multiple packets) |
| 54 |
CS (checksum) |
| 55 |
|
| 56 |
Picture count in album |
| 57 |
Packet: 45 LOC 00 00 AN 00 00 1A |
| 58 |
|
| 59 |
LOC (location): 00 (memory), 01 (card) |
| 60 |
AN (album #) |
| 61 |
|
| 62 |
Response: NP4 NP3 NP2 NP1 [11 reserved bytes] CS |
| 63 |
|
| 64 |
NP4 - NP1 (number of pictures): MSB to LSB number of pictures |
| 65 |
CS (checksum) |
| 66 |
|
| 67 |
Set Active album for next taken picture |
| 68 |
Packet: 49 00 AN 00 00 00 00 1A |
| 69 |
|
| 70 |
AN (album #) |
| 71 |
|
| 72 |
Set Image Quality |
| 73 |
Packet: 71 00 QQ 00 00 00 00 1A |
| 74 |
|
| 75 |
QQ (quality): 00 (no comp), 01 (best), 02 (better), 03 (good) |
| 76 |
|
| 77 |
Take picture |
| 78 |
Packet: CMD 00 00 00 00 00 00 1A |
| 79 |
|
| 80 |
CMD: |
| 81 |
77 Take a picture to FLASH |
| 82 |
7C Take a picture to card |
| 83 |
|
| 84 |
Picture Transfer/Deletion |
| 85 |
Packet: CMD AA PU PL AL 00 00 1A |
| 86 |
|
| 87 |
CMD: |
| 88 |
4A Send filename in album |
| 89 |
51 Send picture in memory |
| 90 |
52 Send TIFF info in memory |
| 91 |
54 Send TIFF in memory |
| 92 |
55 Send picture info in memory |
| 93 |
64 Send TIFF on card |
| 94 |
76 Copy image from memory to card |
| 95 |
7B Erase picture from card |
| 96 |
|
| 97 |
AA (access mode): 00 (sequential), 01 (album) |
| 98 |
PU (picture # upper) |
| 99 |
PL (picture # lower) |
| 100 |
AL (album #) |
| 101 |
|
| 102 |
*/ |
| 103 |
|
| 104 |
#ifndef CAMLIBS_KODAK_DC120_DC120_H |
| 105 |
#define CAMLIBS_KODAK_DC120_DC120_H |
| 106 |
|
| 107 |
#define COMM1 (unsigned char)0x00 |
| 108 |
#define READY (unsigned char)0x10 |
| 109 |
#define ACK (unsigned char)0xd1 |
| 110 |
#define PACK1 (unsigned char)0xd2 |
| 111 |
|
| 112 |
/* nice. errors all have upper nibble of 'e' */ |
| 113 |
#define NAK (unsigned char)0xe1 |
| 114 |
#define COMM0 (unsigned char)0xe2 |
| 115 |
#define PACK0 (unsigned char)0xe3 |
| 116 |
#define CANCL (unsigned char)0xe4 |
| 117 |
|
| 118 |
#define TIMEOUT 5000 |
| 119 |
#define SLEEP_TIMEOUT 50 |
| 120 |
#define RETRIES 5 |
| 121 |
|
| 122 |
#endif /* !defined(CAMLIBS_KODAK_DC120_DC120_H) */ |