OSDN Git Service

295ba787bb45fe73a33ce813fd2c25ab7546f2fe
[gokigen/FujiCam.git] / app / src / main / java / net / osdn / gokigen / cameratest / fuji / MessageSequence.java
1 package net.osdn.gokigen.cameratest.fuji;
2
3 class MessageSequence
4 {
5     static final int HELLO = 0x0000;
6
7     static final int START = 0x1002;
8     static final int STOP = 0x1003;
9
10     static final int IMAGE_INFO = 0x1008;
11     static final int THUMBNAIL = 0x100a;
12
13     static final int SHUTTER = 0x100e;
14
15     static final int SINGLE_PART = 0x1015;
16     static final int DOUBLE_PART = 0x1016;
17
18     static final int FULL_IMAGE = 0x101b;
19     static final int CAMERA_REMOTE = 0x101c;
20
21     static final int CAMERA_LAST_IMAGE = 0x9022;
22
23     static final int FOCUS_POINT = 0x9026;
24     static final int FOCUS_UNLOCK = 0x9027;
25
26     static final int CAMERA_CAPABILITIES = 0x902b;
27
28     static final int SHUTTER_SPEED = 0x902c;
29     static final int APERTURE = 0x902d;
30     static final int EXPOSURE_CORRECTION = 0x902e;
31
32     byte[] registration_message()
33     {
34         return (new byte[] {
35                 // length byte :  (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00,
36                 // header
37                 (byte)0x01, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xf2, (byte)0xe4, (byte)0x53, (byte)0x8f,
38                 (byte)0xad, (byte)0xa5, (byte)0x48, (byte)0x5d, (byte)0x87, (byte)0xb2, (byte)0x7f, (byte)0x0b,
39                 (byte)0xd3, (byte)0xd5, (byte)0xde, (byte)0xd0, // (byte)0x02, (byte)0x78, (byte)0xa8, (byte)0xc0,
40                 (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00,
41
42 /**/
43                 // device_name 'GOKIGEN____012345'
44                 (byte)0x47, (byte)0x00, (byte)0x4f, (byte)0x00, (byte)0x4b, (byte)0x00, (byte)0x49, (byte)0x00,
45                 (byte)0x47, (byte)0x00, (byte)0x45, (byte)0x00, (byte)0x4e, (byte)0x00, (byte)0x5f, (byte)0x00,
46                 (byte)0x5f, (byte)0x00, (byte)0x5f, (byte)0x00, (byte)0x5f, (byte)0x00, (byte)0x30, (byte)0x00,
47                 (byte)0x31, (byte)0x00, (byte)0x32, (byte)0x00, (byte)0x33, (byte)0x00, (byte)0x34, (byte)0x00,
48                 (byte)0x35, (byte)0x00, (byte)0x36, (byte)0x00, (byte)0x37, (byte)0x00, (byte)0x00, (byte)0x00,
49                 (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00,
50                 (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00,
51 /**/
52         });
53     }
54
55     byte[] reset_message()
56     {
57         return (new byte[] { (byte)0xff, (byte)0xff, (byte)0xff, (byte)0xff, });
58     }
59
60
61     byte[] hello_message()
62     {
63         return (new byte[] {
64                 // HELLO (0x0000)
65                 0x00, 0x00,
66         });
67     }
68
69     byte[] start_message()
70     {
71         return (new byte[] {
72 /*
73                 //  現物...
74                 (byte) 0x01, (byte) 0x00, (byte) 0x02, (byte) 0x10, (byte) 0x01, (byte) 0x00, (byte) 0x00, (byte) 0x00,
75                 (byte) 0x01, (byte) 0x00, (byte) 0x00, (byte) 0x00,
76 */
77                 // message_header.index : uint16 (0: terminate, 2: two_part_message, 1: other)
78                 (byte)0x01, (byte)0x00,
79
80                 // message_header.type : START (0x1002)
81                 (byte)0x02, (byte)0x10,
82
83                 // message_id (0~1づつ繰り上がる)
84                 (byte)0x01, (byte)0x00, (byte)0x00, (byte)0x00,
85
86                 // data ...
87                 (byte)0x01, (byte)0x00, (byte)0x00, (byte)0x00,
88         });
89     }
90
91     byte[] start_message2()
92     {
93         return (new byte[] {
94 /*
95                 //  現物...
96                 (byte) 0x01, (byte) 0x00, (byte) 0x15, (byte) 0x10, (byte) 0x02, (byte) 0x00, (byte) 0x00, (byte) 0x00,
97                 (byte) 0x12, (byte) 0xd2, (byte) 0x00, (byte) 0x00,
98 */
99                 // message_header.index : uint16 (0: terminate, 2: two_part_message, 1: other)
100                 (byte)0x01, (byte)0x00,
101
102                 // message_header.type : single_part (0x1015)
103                 (byte)0x15, (byte)0x10,
104
105                 // message_id (0~1づつ繰り上がる)
106                 (byte)0x02, (byte)0x00, (byte)0x00, (byte)0x00,
107
108                 // data ...
109                 (byte)0x12, (byte)0xd2, (byte)0x00, (byte)0x00,
110
111         });
112     }
113
114     byte[] start_message3_1()
115     {
116         return (new byte[] {
117 /*
118                 //  現物...
119                 (byte) 0x01, (byte) 0x00, (byte) 0x16, (byte) 0x10, (byte) 0x03, (byte) 0x00, (byte) 0x00, (byte) 0x00,
120                 (byte) 0x01, (byte) 0xdf, (byte) 0x00, (byte) 0x00,
121 */
122                 // message_header.index : uint16 (0: terminate, 2: two_part_message, 1: other)
123                 (byte)0x01, (byte)0x00,
124
125                 // message_header.type : two_part (0x1016)
126                 (byte)0x16, (byte)0x10,
127
128                 // message_id (0~1づつ繰り上がる)
129                 (byte)0x03, (byte)0x00, (byte)0x00, (byte)0x00,
130
131                 // data ...
132                 (byte)0x01, (byte)0xdf, (byte)0x00, (byte)0x00,
133
134         });
135     }
136
137     byte[] start_message3_2()
138     {
139         return (new byte[] {
140 /*
141                 //  現物...
142                 (byte) 0x02, (byte) 0x00, (byte) 0x16, (byte) 0x10, (byte) 0x03, (byte) 0x00, (byte) 0x00, (byte) 0x00,
143                 (byte) 0x05, (byte) 0x00,
144 */
145                 // message_header.index : uint16 (0: terminate, 2: two_part_message, 1: other)
146                 (byte)0x02, (byte)0x00,
147
148                 // message_header.type : two_part (0x1016)
149                 (byte)0x16, (byte)0x10,
150
151                 // message_id (0~1づつ繰り上がる...けど two-part messageなので同じ)
152                 (byte)0x03, (byte)0x00, (byte)0x00, (byte)0x00,
153
154                 // data ...
155                 (byte)0x05, (byte)0x00,
156
157         });
158     }
159
160
161     byte[] start_message4()
162     {
163         return (new byte[] {
164 /*
165                 //  現物...
166                 (byte) 0x01, (byte) 0x00, (byte) 0x15, (byte) 0x10, (byte) 0x04, (byte) 0x00, (byte) 0x00, (byte) 0x00,
167                 (byte) 0x24, (byte) 0xdf, (byte) 0x00, (byte) 0x00,
168 */
169                 // message_header.index : uint16 (0: terminate, 2: two_part_message, 1: other)
170                 (byte)0x01, (byte)0x00,
171
172                 // message_header.type : single_part (0x1015)
173                 (byte)0x15, (byte)0x10,
174
175                 // message_id (0~1づつ繰り上がる)
176                 (byte)0x04, (byte)0x00, (byte)0x00, (byte)0x00,
177
178                 // data ...
179                 (byte)0x24, (byte)0xdf, (byte)0x00, (byte)0x00,
180
181         });
182     }
183
184     byte[] start_message5_1()
185     {
186         return (new byte[] {
187 /*
188                 //  現物...
189                 (byte) 0x01, (byte) 0x00, (byte) 0x16, (byte) 0x10, (byte) 0x05, (byte) 0x00, (byte) 0x00, (byte) 0x00,
190                 (byte) 0x24, (byte) 0xdf, (byte) 0x00, (byte) 0x00,
191 */
192                 // message_header.index : uint16 (0: terminate, 2: two_part_message, 1: other)
193                 (byte)0x01, (byte)0x00,
194
195                 // message_header.type : two_part (0x1016)
196                 (byte)0x16, (byte)0x10,
197
198                 // message_id (0~1づつ繰り上がる)
199                 (byte)0x05, (byte)0x00, (byte)0x00, (byte)0x00,
200
201                 // data ...
202                 (byte)0x24, (byte)0xdf, (byte)0x00, (byte)0x00,
203
204         });
205     }
206
207     byte[] start_message5_2()
208     {
209         return (new byte[] {
210 /*
211                 //  現物...
212                 (byte) 0x02, (byte) 0x00, (byte) 0x16, (byte) 0x10, (byte) 0x05, (byte) 0x00, (byte) 0x00, (byte) 0x00,
213                 (byte) 0x07, (byte) 0x00, (byte) 0x02, (byte) 0x00,
214 */
215                 // message_header.index : uint16 (0: terminate, 2: two_part_message, 1: other)
216                 (byte)0x02, (byte)0x00,
217
218                 // message_header.type : two_part (0x1016)
219                 (byte)0x16, (byte)0x10,
220
221                 // message_id (0~1づつ繰り上がる...けど two-part messageなので同じ)
222                 (byte)0x05, (byte)0x00, (byte)0x00, (byte)0x00,
223
224                 // data ...
225                 (byte)0x07, (byte)0x00, (byte)0x02, (byte)0x00,
226
227         });
228     }
229
230     byte[] start_message6()
231     {
232         return (new byte[] {
233 /*
234                 //  現物...
235                 (byte) 0x01, (byte) 0x00, (byte) 0x15, (byte) 0x10, (byte) 0x06, (byte) 0x00, (byte) 0x00, (byte) 0x00,
236                 (byte) 0x12, (byte) 0xd2, (byte) 0x00, (byte) 0x00,
237 */
238                 // message_header.index : uint16 (0: terminate, 2: two_part_message, 1: other)
239                 (byte)0x01, (byte)0x00,
240
241                 // message_header.type : single_part (0x1015)
242                 (byte)0x15, (byte)0x10,
243
244                 // message_id (0~1づつ繰り上がる...)
245                 (byte)0x06, (byte)0x00, (byte)0x00, (byte)0x00,
246
247                 // data ...
248                 (byte)0x12, (byte)0xd2, (byte)0x00, (byte)0x00,
249
250         });
251     }
252
253
254     byte[] start_message7()
255     {
256         return (new byte[] {
257 /*
258                 //  現物...
259                 (byte) 0x01, (byte) 0x00, (byte) 0x2b, (byte) 0x90, (byte) 0x07, (byte) 0x00, (byte) 0x00, (byte) 0x00,
260 */
261                 // message_header.index : uint16 (0: terminate, 2: two_part_message, 1: other)
262                 (byte)0x01, (byte)0x00,
263
264                 // message_header.type : camera_capabilities (0x902b)
265                 (byte)0x2b, (byte)0x90,
266
267                 // message_id (0~1づつ繰り上がる...)
268                 (byte)0x07, (byte)0x00, (byte)0x00, (byte)0x00,
269
270         });
271     }
272
273
274     byte[] start_message8()
275     {
276         return (new byte[] {
277 /*
278                 //  現物...
279                 (byte) 0x01, (byte) 0x00, (byte) 0x15, (byte) 0x10, (byte) 0x08, (byte) 0x00, (byte) 0x00, (byte) 0x00,
280                 (byte) 0x12, (byte) 0xd2, (byte) 0x00, (byte) 0x00
281 */
282                 // message_header.index : uint16 (0: terminate, 2: two_part_message, 1: other)
283                 (byte)0x01, (byte)0x00,
284
285                 // message_header.type : single_part (0x1015)
286                 (byte)0x15, (byte)0x10,
287
288                 // message_id (0~1づつ繰り上がる...)
289                 (byte)0x08, (byte)0x00, (byte)0x00, (byte)0x00,
290
291                 // data ...
292                 (byte)0x12, (byte)0xd2, (byte)0x00, (byte)0x00,
293
294         });
295     }
296
297
298
299     byte[] start_message9()
300     {
301         return (new byte[] {
302 /*
303                 //  現物...
304                 (byte) 0x01, (byte) 0x00, (byte) 0x1c, (byte) 0x10, (byte) 0x09, (byte) 0x00, (byte) 0x00, (byte) 0x00,
305                 (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00
306 */
307                 // message_header.index : uint16 (0: terminate, 2: two_part_message, 1: other)
308                 (byte)0x01, (byte)0x00,
309
310                 // message_header.type : camera_remote (0x101c)
311                 (byte)0x1c, (byte)0x10,
312
313                 // message_id (0~1づつ繰り上がる...)
314                 (byte)0x09, (byte)0x00, (byte)0x00, (byte)0x00,
315
316                 // data ...
317                 (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00,
318                 (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00,
319
320         });
321     }
322
323
324     byte[] status_request_message()
325     {
326         return (new byte[] {
327
328                 // message_header.index : uint16 (0: terminate, 2: two_part_message, 1: other)
329                 (byte)0x01, (byte)0x00,
330
331                 // message_header.type : single_part (0x1015)
332                 (byte)0x15, (byte)0x10,
333
334                 // message_id (0~1づつ繰り上がる...)
335                 (byte)0x0A, (byte)0x00, (byte)0x00, (byte)0x00,
336
337                 // data ...
338                 (byte)0x12, (byte)0xd2, (byte)0x00, (byte)0x00,
339         });
340     }
341
342
343     byte[] execute_shutter_message()
344     {
345         return (new byte[] {
346
347                 // message_header.index : uint16 (0: terminate, 2: two_part_message, 1: other)
348                 (byte)0x01, (byte)0x00,
349
350                 // message_header.type : shutter (0x100e)
351                 (byte)0x0e, (byte)0x10,
352
353                 // message_id (0~1づつ繰り上がる...
354                 (byte)0x0B, (byte)0x00, (byte)0x00, (byte)0x00,
355
356                 // data ...
357                 (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00,
358                 (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00,
359         });
360     }
361
362
363
364     byte[] execute_focus_lock(byte pointX, byte pointY)
365     {
366         return (new byte[] {
367
368                 // message_header.index : uint16 (0: terminate, 2: two_part_message, 1: other)
369                 (byte)0x01, (byte)0x00,
370
371                 // message_header.type : focus_point (0x9026)
372                 (byte)0x26, (byte)0x90,
373
374                 // message_id (0~1づつ繰り上がる...
375                 (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00,
376
377                 // data ...
378                 pointY, pointX, (byte)0x00, (byte)0x00,
379
380         });
381     }
382
383
384     byte[] execute_focus_unlock()
385     {
386         return (new byte[] {
387
388                 // message_header.index : uint16 (0: terminate, 2: two_part_message, 1: other)
389                 (byte)0x01, (byte)0x00,
390
391                 // message_header.type : focus_unlock (0x9027)
392                 (byte)0x27, (byte)0x90,
393
394                 // message_id (0~1づつ繰り上がる...
395                 (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00,
396         });
397     }
398
399 }