1 //+----------------------------------------------------------------------------
9 // Copyright (C) 1999 Microsoft Corporation. All rights reserved.
15 //+----------------------------------------------------------------------------
27 #define DC210_COMMAND_COMPLETE 0x00
28 #define DC210_COMMAND_ACK 0xD1
29 #define DC210_CORRECT_PACKET 0xD2
30 #define DC210_COMMAND_NAK 0xE1
31 #define DC210_ILLEGAL_PACKET 0xE3
32 #define DC210_BUSY 0xF0
33 #define DC210_ABORT 0xE4
38 #define DC210_NORMAL_PACKET 0x01
39 #define DC210_FINAL_PACKET 0x80
40 #define DC210_ABORT_PACKET 0xFF
41 #define DC210_NORMAL_RECEIVE_PACKET 0x01
46 #define DC210_SET_RESOLUTION 0x36
47 #define DC210_SET_FORMAT 0x37
48 #define DC210_SET_SPEED 0x41
49 #define DC210_PICTURE_DOWNLOAD 0x64
50 #define DC210_PICTURE_INFO 0x65
51 #define DC210_PICTURE_THUMBNAIL 0x66
52 #define DC210_SET_FLASH 0x72
53 #define DC210_SET_COMPRESSION 0x71
54 #define DC210_SET_SHUTTER_DELAY 0x74
55 #define DC210_SET_ZOOM 0x78
56 #define DC210_TAKE_PICTURE 0x7C
57 #define DC210_ERASE 0x7B
58 #define DC210_INITIALIZE 0x7E
59 #define DC210_STATUS 0x7F
60 #define DC210_RESET 0x8A
61 #define DC210_FORMAT_MEMORY_CARD 0x95
70 } DC210_BATTERY_STATE;
92 } DC210_COMPRESSION_STATE;
114 #define DC210_MEMORY_CARD_INSERTED 0x40
115 #define DC210_MEMORY_CARD_WRITE_PROTECTED 0x20
116 #define DC210_MEMORY_CARD_ILLEGAL 0x10
117 #define DC210_MEMORY_CARD_FORMATTED 0x08
118 #define DC210_MEMORY_CARD_OPENED 0x04
120 class CKodakDC210 : public CCamera
122 friend class CKodakDC210Photo;
125 CKodakDC210(char *szDevice, int iSpeed);
128 bool Initialize(void);
129 bool SetSpeed(int iBps);
130 bool TakePicture(void);
132 bool GetRawStatusData(BYTE *pData);
133 bool GetFirmwareVersion(int *piMajor, int *piMinor);
134 bool GetRomVersion(int *piMajor, int *piMinor);
135 bool GetBatteryStatus(DC210_BATTERY_STATE *pState);
136 bool IsAdapterAttached(bool *pfAttached);
137 bool GetClock(int *piCameraClock);
138 bool GetZoomState(DC210_ZOOM_STATE *pZoom);
139 bool SetZoomState(DC210_ZOOM_STATE eZoom);
140 bool GetResolution(int *piWidth, int *piHeight);
141 bool IsFlashCharged(bool *pfCharged);
142 bool GetFlashState(DC210_FLASH_STATE *pState);
143 bool SetFlashState(bool fState);
144 bool SetFlashState(DC210_FLASH_STATE eState);
145 bool GetCompressionState(DC210_COMPRESSION_STATE *pState);
146 bool SetCompressionState(DC210_COMPRESSION_STATE eCompression);
147 bool IsUsingJpeg(bool *pfJPEG);
148 bool IsUsingFlashPix(bool *pfFlashPix);
149 bool GetPictureFormat(DC210_FILE_FORMAT *eFormat);
150 bool SetPictureFormat(DC210_FILE_FORMAT eFormat);
151 bool GetLifetimePictureCount(int *piPictures);
152 bool GetLifetimeFlashCount(int *piFlashes);
153 bool IsTimerOn(bool *pfTimer);
154 bool IsMemoryCardInserted(bool *pfInserted);
155 bool IsMemoryCardWriteProtected(bool *pfInserted);
156 bool IsMemoryCardIllegal(bool *pfInserted);
157 bool IsMemoryCardFormatted(bool *pfInserted);
158 bool IsMemoryCardOpened(bool *pfInserted);
159 bool GetMemoryCardBitvector(BYTE *pbBitv);
160 bool IsUsingNTSC(bool *pfNTSC);
161 bool IsUsingPAL(bool *pfPAL);
162 bool GetNumberPictures(int *piNum);
163 bool GetRemainingPicturesLowCompression(int *piNum);
164 bool GetRemainingPicturesMedCompression(int *piNum);
165 bool GetRemainingPicturesHighCompression(int *piNum);
166 bool GetMemoryCardVolumeLabel(char *szLabel);
167 bool GetIdString(char *szId);
168 bool GetTimeValue(int *piClock);
169 bool GetTimeString(char *pszTime);
170 bool GetTimeMinutes(int *piMin);
171 bool GetTimeHours(int *piHrs);
172 bool GetTimeSeconds(int *piSec);
173 bool GetTimeMonth(int *piMon);
174 bool GetTimeDay(int *piDay);
175 bool GetTimeYear(int *piYear);
176 bool EraseAllPictures(void);
177 bool SetResolution(int iWidth, int iHeight);
179 bool ToggleShutterDelay(BOOL fEnable);
180 bool SetExposureCompensationValue(float floatValue);
181 bool FormatMemoryCard(void);
182 bool SetIdString(char *szId);
185 bool CommandComplete(void);
187 bool SendCommand(int bCommand, BYTE arg1, BYTE arg2, BYTE arg3, BYTE arg4);
188 bool ReadPacket(BYTE *buf, int iPacketSize);
189 bool SendPacket(BYTE bControl, BYTE *buf, int iLength);
190 bool ComputeChecksum(BYTE *pbChecksum, BYTE *buf, int iSize);
192 bool RefreshProperties(void);
194 CSerialPort *_pSerialPort;
197 BYTE _bRawStatusData[256];