Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
1702 | - | 1 | /* Copyright (C) 2010-2011 Circuits At Home, LTD. All rights reserved. |
2 | |||
3 | This software may be distributed and modified under the terms of the GNU |
||
4 | General Public License version 2 (GPL2) as published by the Free Software |
||
5 | Foundation and appearing in the file GPL2.TXT included in the packaging of |
||
6 | this file. Please note that GPL2 Section 2[b] requires that all works based |
||
7 | on this software must also be made publicly available under the terms of |
||
8 | the GPL2 ("Copyleft"). |
||
9 | |||
10 | Contact information |
||
11 | ------------------- |
||
12 | |||
13 | Circuits At Home, LTD |
||
14 | Web : http://www.circuitsathome.com |
||
15 | e-mail : support@circuitsathome.com |
||
16 | */ |
||
17 | #ifndef __PTPCONST_H__ |
||
18 | #define __PTPCONST_H__ |
||
19 | |||
20 | #include <inttypes.h> |
||
21 | |||
22 | /* PTP USB Bulk-Pipe container */ |
||
23 | /* USB bulk max max packet length for full speed endpoints */ |
||
24 | #define PTP_USB_BULK_FS_MAX_PACKET_LEN 64 |
||
25 | #define PTP_USB_BULK_HDR_LEN (2*sizeof(uint32_t)+2*sizeof(uint16_t)) |
||
26 | #define PTP_USB_BULK_PAYLOAD_LEN (PTP_USB_BULK_FS_MAX_PACKET_LEN-PTP_USB_BULK_HDR_LEN) |
||
27 | #define PTP_USB_BULK_REQ_LEN (PTP_USB_BULK_HDR_LEN+5*sizeof(uint32_t)) |
||
28 | |||
29 | #define PTP_CONTAINER_CONTYPE_OFF 4 |
||
30 | #define PTP_CONTAINER_OPCODE_OFF 6 |
||
31 | #define PTP_CONTAINER_TRANSID_OFF 8 |
||
32 | #define PTP_CONTAINER_PAYLOAD_OFF 12 |
||
33 | #define PTP_CONTAINER_PARAM1_OFF 12 |
||
34 | #define PTP_CONTAINER_PARAM2_OFF 16 |
||
35 | #define PTP_CONTAINER_PARAM3_OFF 20 |
||
36 | |||
37 | #define PTP_USB_INT_PACKET_LEN 8 |
||
38 | |||
39 | /* PTP USB Asynchronous Event Interrupt Data Format */ |
||
40 | struct PTPUSBEventContainer |
||
41 | { |
||
42 | uint32_t length; |
||
43 | uint16_t type; |
||
44 | uint16_t code; |
||
45 | uint32_t trans_id; |
||
46 | uint32_t param1; |
||
47 | uint32_t param2; |
||
48 | uint32_t param3; |
||
49 | }; |
||
50 | |||
51 | /* USB container types */ |
||
52 | #define PTP_USB_CONTAINER_UNDEFINED 0x0000 |
||
53 | #define PTP_USB_CONTAINER_COMMAND 0x0001 |
||
54 | #define PTP_USB_CONTAINER_DATA 0x0002 |
||
55 | #define PTP_USB_CONTAINER_RESPONSE 0x0003 |
||
56 | #define PTP_USB_CONTAINER_EVENT 0x0004 |
||
57 | |||
58 | /* Vendor IDs */ |
||
59 | #define PTP_VENDOR_EASTMAN_KODAK 0x00000001 |
||
60 | #define PTP_VENDOR_SEIKO_EPSON 0x00000002 |
||
61 | #define PTP_VENDOR_AGILENT 0x00000003 |
||
62 | #define PTP_VENDOR_POLAROID 0x00000004 |
||
63 | #define PTP_VENDOR_AGFA_GEVAERT 0x00000005 |
||
64 | #define PTP_VENDOR_MICROSOFT 0x00000006 |
||
65 | #define PTP_VENDOR_EQUINOX 0x00000007 |
||
66 | #define PTP_VENDOR_VIEWQUEST 0x00000008 |
||
67 | #define PTP_VENDOR_STMICROELECTRONICS 0x00000009 |
||
68 | #define PTP_VENDOR_NIKON 0x0000000A |
||
69 | #define PTP_VENDOR_CANON 0x0000000B |
||
70 | #define PTP_VENDOR_FOTONATION 0x0000000C |
||
71 | #define PTP_VENDOR_PENTAX 0x0000000D |
||
72 | #define PTP_VENDOR_FUJI 0x0000000E |
||
73 | |||
74 | /* Operation Codes */ |
||
75 | #define PTP_OC_Undefined 0x1000 |
||
76 | #define PTP_OC_GetDeviceInfo 0x1001 |
||
77 | #define PTP_OC_OpenSession 0x1002 |
||
78 | #define PTP_OC_CloseSession 0x1003 |
||
79 | #define PTP_OC_GetStorageIDs 0x1004 |
||
80 | #define PTP_OC_GetStorageInfo 0x1005 |
||
81 | #define PTP_OC_GetNumObjects 0x1006 |
||
82 | #define PTP_OC_GetObjectHandles 0x1007 |
||
83 | #define PTP_OC_GetObjectInfo 0x1008 |
||
84 | #define PTP_OC_GetObject 0x1009 |
||
85 | #define PTP_OC_GetThumb 0x100A |
||
86 | #define PTP_OC_DeleteObject 0x100B |
||
87 | #define PTP_OC_SendObjectInfo 0x100C |
||
88 | #define PTP_OC_SendObject 0x100D |
||
89 | #define PTP_OC_InitiateCapture 0x100E |
||
90 | #define PTP_OC_FormatStore 0x100F |
||
91 | #define PTP_OC_ResetDevice 0x1010 |
||
92 | #define PTP_OC_SelfTest 0x1011 |
||
93 | #define PTP_OC_SetObjectProtection 0x1012 |
||
94 | #define PTP_OC_PowerDown 0x1013 |
||
95 | #define PTP_OC_GetDevicePropDesc 0x1014 |
||
96 | #define PTP_OC_GetDevicePropValue 0x1015 |
||
97 | #define PTP_OC_SetDevicePropValue 0x1016 |
||
98 | #define PTP_OC_ResetDevicePropValue 0x1017 |
||
99 | #define PTP_OC_TerminateOpenCapture 0x1018 |
||
100 | #define PTP_OC_MoveObject 0x1019 |
||
101 | #define PTP_OC_CopyObject 0x101A |
||
102 | #define PTP_OC_GetPartialObject 0x101B |
||
103 | #define PTP_OC_InitiateOpenCapture 0x101C |
||
104 | |||
105 | /* Proprietary vendor extension operations mask */ |
||
106 | #define PTP_OC_EXTENSION_MASK 0xF000 |
||
107 | #define PTP_OC_EXTENSION 0x9000 |
||
108 | |||
109 | /* Response Codes */ |
||
110 | #define PTP_RC_Undefined 0x2000 |
||
111 | #define PTP_RC_OK 0x2001 |
||
112 | #define PTP_RC_GeneralError 0x2002 |
||
113 | #define PTP_RC_SessionNotOpen 0x2003 |
||
114 | #define PTP_RC_InvalidTransactionID 0x2004 |
||
115 | #define PTP_RC_OperationNotSupported 0x2005 |
||
116 | #define PTP_RC_ParameterNotSupported 0x2006 |
||
117 | #define PTP_RC_IncompleteTransfer 0x2007 |
||
118 | #define PTP_RC_InvalidStorageId 0x2008 |
||
119 | #define PTP_RC_InvalidObjectHandle 0x2009 |
||
120 | #define PTP_RC_DevicePropNotSupported 0x200A |
||
121 | #define PTP_RC_InvalidObjectFormatCode 0x200B |
||
122 | #define PTP_RC_StoreFull 0x200C |
||
123 | #define PTP_RC_ObjectWriteProtected 0x200D |
||
124 | #define PTP_RC_StoreReadOnly 0x200E |
||
125 | #define PTP_RC_AccessDenied 0x200F |
||
126 | #define PTP_RC_NoThumbnailPresent 0x2010 |
||
127 | #define PTP_RC_SelfTestFailed 0x2011 |
||
128 | #define PTP_RC_PartialDeletion 0x2012 |
||
129 | #define PTP_RC_StoreNotAvailable 0x2013 |
||
130 | #define PTP_RC_SpecificationByFormatUnsupported 0x2014 |
||
131 | #define PTP_RC_NoValidObjectInfo 0x2015 |
||
132 | #define PTP_RC_InvalidCodeFormat 0x2016 |
||
133 | #define PTP_RC_UnknownVendorCode 0x2017 |
||
134 | #define PTP_RC_CaptureAlreadyTerminated 0x2018 |
||
135 | #define PTP_RC_DeviceBusy 0x2019 |
||
136 | #define PTP_RC_InvalidParentObject 0x201A |
||
137 | #define PTP_RC_InvalidDevicePropFormat 0x201B |
||
138 | #define PTP_RC_InvalidDevicePropValue 0x201C |
||
139 | #define PTP_RC_InvalidParameter 0x201D |
||
140 | #define PTP_RC_SessionAlreadyOpened 0x201E |
||
141 | #define PTP_RC_TransactionCanceled 0x201F |
||
142 | #define PTP_RC_SpecificationOfDestinationUnsupported 0x2020 |
||
143 | |||
144 | /* Proprietary vendor extension response code mask */ |
||
145 | #define PTP_RC_EXTENSION_MASK 0xF000 |
||
146 | #define PTP_RC_EXTENSION 0xA000 |
||
147 | |||
148 | /* PTP Event Codes */ |
||
149 | #define PTP_EC_Undefined 0x4000 |
||
150 | #define PTP_EC_CancelTransaction 0x4001 |
||
151 | #define PTP_EC_ObjectAdded 0x4002 |
||
152 | #define PTP_EC_ObjectRemoved 0x4003 |
||
153 | #define PTP_EC_StoreAdded 0x4004 |
||
154 | #define PTP_EC_StoreRemoved 0x4005 |
||
155 | #define PTP_EC_DevicePropChanged 0x4006 |
||
156 | #define PTP_EC_ObjectInfoChanged 0x4007 |
||
157 | #define PTP_EC_DeviceInfoChanged 0x4008 |
||
158 | #define PTP_EC_RequestObjectTransfer 0x4009 |
||
159 | #define PTP_EC_StoreFull 0x400A |
||
160 | #define PTP_EC_DeviceReset 0x400B |
||
161 | #define PTP_EC_StorageInfoChanged 0x400C |
||
162 | #define PTP_EC_CaptureComplete 0x400D |
||
163 | #define PTP_EC_UnreportedStatus 0x400E |
||
164 | |||
165 | #define PTP_HANDLER_SPECIAL 0xffffffff |
||
166 | #define PTP_HANDLER_ROOT 0x00000000 |
||
167 | |||
168 | /* max ptp string length INCLUDING terminating null character */ |
||
169 | #define PTP_MAXSTRLEN 255 |
||
170 | |||
171 | /* PTP Object Format Codes */ |
||
172 | |||
173 | /* ancillary formats */ |
||
174 | #define PTP_OFC_Undefined 0x3000 |
||
175 | #define PTP_OFC_Association 0x3001 |
||
176 | #define PTP_OFC_Script 0x3002 |
||
177 | #define PTP_OFC_Executable 0x3003 |
||
178 | #define PTP_OFC_Text 0x3004 |
||
179 | #define PTP_OFC_HTML 0x3005 |
||
180 | #define PTP_OFC_DPOF 0x3006 |
||
181 | #define PTP_OFC_AIFF 0x3007 |
||
182 | #define PTP_OFC_WAV 0x3008 |
||
183 | #define PTP_OFC_MP3 0x3009 |
||
184 | #define PTP_OFC_AVI 0x300A |
||
185 | #define PTP_OFC_MPEG 0x300B |
||
186 | #define PTP_OFC_ASF 0x300C |
||
187 | #define PTP_OFC_QT 0x300D /* guessing */ |
||
188 | |||
189 | /* image formats */ |
||
190 | #define PTP_OFC_EXIF_JPEG 0x3801 |
||
191 | #define PTP_OFC_TIFF_EP 0x3802 |
||
192 | #define PTP_OFC_FlashPix 0x3803 |
||
193 | #define PTP_OFC_BMP 0x3804 |
||
194 | #define PTP_OFC_CIFF 0x3805 |
||
195 | #define PTP_OFC_Undefined_0x3806 0x3806 |
||
196 | #define PTP_OFC_GIF 0x3807 |
||
197 | #define PTP_OFC_JFIF 0x3808 |
||
198 | #define PTP_OFC_PCD 0x3809 |
||
199 | #define PTP_OFC_PICT 0x380A |
||
200 | #define PTP_OFC_PNG 0x380B |
||
201 | #define PTP_OFC_Undefined_0x380C 0x380C |
||
202 | #define PTP_OFC_TIFF 0x380D |
||
203 | #define PTP_OFC_TIFF_IT 0x380E |
||
204 | #define PTP_OFC_JP2 0x380F |
||
205 | #define PTP_OFC_JPX 0x3810 |
||
206 | |||
207 | /* PTP Association Types */ |
||
208 | #define PTP_AT_Undefined 0x0000 |
||
209 | #define PTP_AT_GenericFolder 0x0001 |
||
210 | #define PTP_AT_Album 0x0002 |
||
211 | #define PTP_AT_TimeSequence 0x0003 |
||
212 | #define PTP_AT_HorizontalPanoramic 0x0004 |
||
213 | #define PTP_AT_VerticalPanoramic 0x0005 |
||
214 | #define PTP_AT_2DPanoramic 0x0006 |
||
215 | #define PTP_AT_AncillaryData 0x0007 |
||
216 | |||
217 | /* PTP Protection Status */ |
||
218 | #define PTP_PS_NoProtection 0x0000 |
||
219 | #define PTP_PS_ReadOnly 0x0001 |
||
220 | |||
221 | /* PTP Storage Types */ |
||
222 | #define PTP_ST_Undefined 0x0000 |
||
223 | #define PTP_ST_FixedROM 0x0001 |
||
224 | #define PTP_ST_RemovableROM 0x0002 |
||
225 | #define PTP_ST_FixedRAM 0x0003 |
||
226 | #define PTP_ST_RemovableRAM 0x0004 |
||
227 | |||
228 | /* PTP FilesystemType Values */ |
||
229 | #define PTP_FST_Undefined 0x0000 |
||
230 | #define PTP_FST_GenericFlat 0x0001 |
||
231 | #define PTP_FST_GenericHierarchical 0x0002 |
||
232 | #define PTP_FST_DCF 0x0003 |
||
233 | |||
234 | /* PTP StorageInfo AccessCapability Values */ |
||
235 | #define PTP_AC_ReadWrite 0x0000 |
||
236 | #define PTP_AC_ReadOnly 0x0001 |
||
237 | #define PTP_AC_ReadOnly_with_Object_Deletion 0x0002 |
||
238 | |||
239 | /* DataType Codes */ |
||
240 | #define PTP_DTC_UNDEF 0x0000 |
||
241 | #define PTP_DTC_INT8 0x0001 |
||
242 | #define PTP_DTC_UINT8 0x0002 |
||
243 | #define PTP_DTC_INT16 0x0003 |
||
244 | #define PTP_DTC_UINT16 0x0004 |
||
245 | #define PTP_DTC_INT32 0x0005 |
||
246 | #define PTP_DTC_UINT32 0x0006 |
||
247 | #define PTP_DTC_INT64 0x0007 |
||
248 | #define PTP_DTC_UINT64 0x0008 |
||
249 | #define PTP_DTC_INT128 0x0009 |
||
250 | #define PTP_DTC_UINT128 0x000A |
||
251 | #define PTP_DTC_AINT8 0x4001 |
||
252 | #define PTP_DTC_AUINT8 0x4002 |
||
253 | #define PTP_DTC_AINT16 0x4003 |
||
254 | #define PTP_DTC_AUINT16 0x4004 |
||
255 | #define PTP_DTC_AINT32 0x4005 |
||
256 | #define PTP_DTC_AUINT32 0x4006 |
||
257 | #define PTP_DTC_AINT64 0x4007 |
||
258 | #define PTP_DTC_AUINT64 0x4008 |
||
259 | #define PTP_DTC_AINT128 0x4009 |
||
260 | #define PTP_DTC_AUINT128 0x400A |
||
261 | #define PTP_DTC_STR 0xFFFF |
||
262 | |||
263 | /* Device Properties Codes */ |
||
264 | #define PTP_DPC_Undefined 0x5000 |
||
265 | #define PTP_DPC_BatteryLevel 0x5001 |
||
266 | #define PTP_DPC_FunctionalMode 0x5002 |
||
267 | #define PTP_DPC_ImageSize 0x5003 |
||
268 | #define PTP_DPC_CompressionSetting 0x5004 |
||
269 | #define PTP_DPC_WhiteBalance 0x5005 |
||
270 | #define PTP_DPC_RGBGain 0x5006 |
||
271 | #define PTP_DPC_FNumber 0x5007 |
||
272 | #define PTP_DPC_FocalLength 0x5008 |
||
273 | #define PTP_DPC_FocusDistance 0x5009 |
||
274 | #define PTP_DPC_FocusMode 0x500A |
||
275 | #define PTP_DPC_ExposureMeteringMode 0x500B |
||
276 | #define PTP_DPC_FlashMode 0x500C |
||
277 | #define PTP_DPC_ExposureTime 0x500D |
||
278 | #define PTP_DPC_ExposureProgramMode 0x500E |
||
279 | #define PTP_DPC_ExposureIndex 0x500F |
||
280 | #define PTP_DPC_ExposureBiasCompensation 0x5010 |
||
281 | #define PTP_DPC_DateTime 0x5011 |
||
282 | #define PTP_DPC_CaptureDelay 0x5012 |
||
283 | #define PTP_DPC_StillCaptureMode 0x5013 |
||
284 | #define PTP_DPC_Contrast 0x5014 |
||
285 | #define PTP_DPC_Sharpness 0x5015 |
||
286 | #define PTP_DPC_DigitalZoom 0x5016 |
||
287 | #define PTP_DPC_EffectMode 0x5017 |
||
288 | #define PTP_DPC_BurstNumber 0x5018 |
||
289 | #define PTP_DPC_BurstInterval 0x5019 |
||
290 | #define PTP_DPC_TimelapseNumber 0x501A |
||
291 | #define PTP_DPC_TimelapseInterval 0x501B |
||
292 | #define PTP_DPC_FocusMeteringMode 0x501C |
||
293 | #define PTP_DPC_UploadURL 0x501D |
||
294 | #define PTP_DPC_Artist 0x501E |
||
295 | #define PTP_DPC_CopyrightInfo 0x501F |
||
296 | |||
297 | /* Proprietary vendor extension device property mask */ |
||
298 | #define PTP_DPC_EXTENSION_MASK 0xF000 |
||
299 | #define PTP_DPC_EXTENSION 0xD000 |
||
300 | |||
301 | /* Device Property Form Flag */ |
||
302 | #define PTP_DPFF_None 0x00 |
||
303 | #define PTP_DPFF_Range 0x01 |
||
304 | #define PTP_DPFF_Enumeration 0x02 |
||
305 | |||
306 | /* Device Property GetSet type */ |
||
307 | #define PTP_DPGS_Get 0x00 |
||
308 | #define PTP_DPGS_GetSet 0x01 |
||
309 | |||
310 | #endif //__PTPCONST_H__ |