Documented GVF_SAVE_VAR alongside other flags, and removed a query/doubt
[AROS.git] / rom / usb / classes / ptp / numtostr.c
blobb51295f03af81dcc40e33a757f43bba4477c008c
2 #include "numtostr.h"
4 #include <proto/poseidon.h>
6 #define PsdBase nch->nch_Base
8 /* /// "Operation Codes" */
9 const struct PTPIDMap opcodemap[] =
11 { 0x1000, "Undefined" },
12 { 0x1001, "GetDeviceInfo" },
13 { 0x1002, "OpenSession" },
14 { 0x1003, "CloseSession" },
15 { 0x1004, "GetStorageIDs" },
16 { 0x1005, "GetStorageInfo" },
17 { 0x1006, "GetNumObjects" },
18 { 0x1007, "GetObjectHandles" },
19 { 0x1008, "GetObjectInfo" },
20 { 0x1009, "GetObject" },
21 { 0x100A, "GetThumb" },
22 { 0x100B, "DeleteObject" },
23 { 0x100C, "SendObjectInfo" },
24 { 0x100D, "SendObject" },
25 { 0x100E, "InitiateCapture" },
26 { 0x100F, "FormatStore" },
27 { 0x1010, "ResetDevice" },
28 { 0x1011, "SelfTest" },
29 { 0x1012, "SetObjectProtection" },
30 { 0x1013, "PowerDown" },
31 { 0x1014, "GetDevicePropDesc" },
32 { 0x1015, "GetDevicePropValue" },
33 { 0x1016, "SetDevicePropValue" },
34 { 0x1017, "ResetDevicePropValue" },
35 { 0x1018, "TerminateOpenCapture" },
36 { 0x1019, "MoveObject" },
37 { 0x101A, "CopyObject" },
38 { 0x101B, "GetPartialObject" },
39 { 0x101C, "InitiateOpenCapture" },
40 { 0x0000, NULL }
42 /* \\\ */
44 /* /// "Response Codes" */
45 const struct PTPIDMap rescodemap[] =
47 { 0x2000, "Undefined" },
48 { 0x2001, "OK" },
49 { 0x2002, "General Error" },
50 { 0x2003, "Session Not Open" },
51 { 0x2004, "Invalid TransactionID" },
52 { 0x2005, "Operation Not Supported" },
53 { 0x2006, "Parameter Not Supported" },
54 { 0x2007, "Incomplete Transfer" },
55 { 0x2008, "Invalid StorageID" },
56 { 0x2009, "Invalid ObjectHandle" },
57 { 0x200A, "DeviceProp Not Supported" },
58 { 0x200B, "Invalid ObjectFormatCode" },
59 { 0x200C, "Store Full" },
60 { 0x200D, "Object WriteProtected" },
61 { 0x200E, "Store Read-Only" },
62 { 0x200F, "Access Denied" },
63 { 0x2010, "No Thumbnail Present" },
64 { 0x2011, "SelfTest Failed" },
65 { 0x2012, "Partial Deletion" },
66 { 0x2013, "Store Not Available" },
67 { 0x2014, "Specification By Format Unsupported" },
68 { 0x2015, "No Valid ObjectInfo" },
69 { 0x2016, "Invalid Code Format" },
70 { 0x2017, "Unknown Vendor Code" },
71 { 0x2018, "Capture Already Terminated" },
72 { 0x2019, "Device Busy" },
73 { 0x201A, "Invalid ParentObject" },
74 { 0x201B, "Invalid DeviceProp Format" },
75 { 0x201C, "Invalid DeviceProp Value" },
76 { 0x201D, "Invalid Parameter" },
77 { 0x201E, "Session Already Open" },
78 { 0x201F, "Transaction Cancelled" },
79 { 0x2020, "Specification of Destination Unsupported" },
80 { 0x0000, NULL }
82 /* \\\ */
84 #if 0
85 /* /// "Object Format Codes" */
86 const struct PTPIDMap objectfmtcodemap[] =
88 { 0x3000, "Undefined" },
89 { 0x3001, "Association" },
90 { 0x3002, "Script" },
91 { 0x3003, "Executable" },
92 { 0x3004, "Text" },
93 { 0x3005, "HTML" },
94 { 0x3006, "DPOF" },
95 { 0x3007, "AIFF" },
96 { 0x3008, "WAV" },
97 { 0x3009, "MP3" },
98 { 0x300A, "AVI" },
99 { 0x300B, "MPEG" },
100 { 0x300C, "ASF" },
101 { 0x3800, "Undefined2" },
102 { 0x3801, "EXIF/JPEG" },
103 { 0x3802, "TIFF/EP" },
104 { 0x3803, "FlashPix" },
105 { 0x3804, "BMP" },
106 { 0x3805, "CIFF" },
107 { 0x3806, "Undefined3" },
108 { 0x3807, "GIF" },
109 { 0x3808, "JFIF" },
110 { 0x3809, "PCD" },
111 { 0x380A, "PICT" },
112 { 0x380B, "PNG" },
113 { 0x380C, "Undefined4" },
114 { 0x380D, "TIFF" },
115 { 0x380E, "TIFF/IT" },
116 { 0x380F, "JP2" },
117 { 0x3810, "JPX" },
118 { 0x0000, NULL }
120 /* \\\ */
122 /* /// "Event Codes" */
123 const struct PTPIDMap eventcodemap[] =
125 { 0x4000, "Undefined" },
126 { 0x4001, "CancelTransaction" },
127 { 0x4002, "ObjectAdded" },
128 { 0x4003, "ObjectRemoved" },
129 { 0x4004, "StoreAdded" },
130 { 0x4005, "StoreRemoved" },
131 { 0x4006, "DevicePropChanged" },
132 { 0x4007, "ObjectInfoChanged" },
133 { 0x4008, "DeviceInfoChanged" },
134 { 0x4009, "RequestObjectTransfer" },
135 { 0x400A, "StoreFull" },
136 { 0x400B, "DeviceReset" },
137 { 0x400C, "StorageInfoChanged" },
138 { 0x400D, "CaptureComplete" },
139 { 0x400E, "UnreportedStatus" },
140 { 0x0000, NULL }
142 /* \\\ */
144 /* /// "Device Property Codes" */
145 const struct PTPIDMap devicepropcodemap[] =
147 { 0x5000, "Undefined" },
148 { 0x5001, "BatteryLevel" },
149 { 0x5002, "FunctionalMode" },
150 { 0x5003, "ImageSize" },
151 { 0x5004, "CompressionSetting" },
152 { 0x5005, "WhiteBalance" },
153 { 0x5006, "RGB Gain" },
154 { 0x5007, "F-Number" },
155 { 0x5008, "FocalLength" },
156 { 0x5009, "FocusDistance" },
157 { 0x500A, "FocusMode" },
158 { 0x500B, "ExposureMeteringMode" },
159 { 0x500C, "FlashMode" },
160 { 0x500D, "ExposureTime" },
161 { 0x500E, "ExposureProgramMode" },
162 { 0x500F, "ExposureIndex" },
163 { 0x5010, "ExposureBiasCompensation" },
164 { 0x5011, "DateTime" },
165 { 0x5012, "CaptureDelay" },
166 { 0x5013, "StillCaptureMode" },
167 { 0x5014, "Contrast" },
168 { 0x5015, "Sharpness" },
169 { 0x5016, "DigitalZoom" },
170 { 0x5017, "EffectMode" },
171 { 0x5018, "BurstNumber" },
172 { 0x5019, "BurstInterval" },
173 { 0x501A, "TimelapseNumber" },
174 { 0x501B, "TimelapseInterval" },
175 { 0x501C, "FocusMeteringMode" },
176 { 0x501D, "UploadURL" },
177 { 0x501E, "Artist" },
178 { 0x501F, "CopyrightInfo" },
179 { 0x0000, NULL }
181 /* \\\ */
182 #endif
184 /* /// "nNumToStr()" */
185 STRPTR nNumToStr(struct NepClassPTP *nch, UWORD type, ULONG id, STRPTR defstr)
187 const struct PTPIDMap *pim = NULL;
189 switch(type)
191 case NTS_OPCODE:
192 pim = opcodemap;
193 break;
195 case NTS_RESPCODE:
196 pim = rescodemap;
197 break;
199 //case NTS_OBJECTFMTCODE:
200 // pim = objectfmtcodemap;
201 // break;
203 //case NTS_EVENTCODE:
204 // pim = eventcodemap;
205 // break;
207 //case NTS_DEVICEPROPCODE:
208 // pim = devicepropcodemap;
209 // break;
211 if(pim)
213 while(pim->pim_String)
215 if(pim->pim_ID == id)
217 return(pim->pim_String);
219 pim++;
222 return(defstr);
224 /* \\\ */