OSDN Git Service

とりあえず、軽くシャッターを切るところまで。
[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                 // device_name 'ASUS_Z01BDA-2348'
43                 (byte)0x41, (byte)0x00, (byte)0x53, (byte)0x00, (byte)0x55, (byte)0x00, (byte)0x53, (byte)0x00,
44                 (byte)0x5f, (byte)0x00, (byte)0x5a, (byte)0x00, (byte)0x30, (byte)0x00, (byte)0x31, (byte)0x00,
45                 (byte)0x42, (byte)0x00, (byte)0x44, (byte)0x00, (byte)0x41, (byte)0x00, (byte)0x2d, (byte)0x00,
46                 (byte)0x32, (byte)0x00, (byte)0x33, (byte)0x00, (byte)0x34, (byte)0x00, (byte)0x38, (byte)0x00,
47                 (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00,
48                 (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00,
49                 (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00,
50 /**/
51 /*
52                 // device_name 'GOKIGEN____0123'
53                 (byte)0x47, (byte)0x00, (byte)0x4f, (byte)0x00, (byte)0x4b, (byte)0x00, (byte)0x49, (byte)0x00,
54                 (byte)0x47, (byte)0x00, (byte)0x45, (byte)0x00, (byte)0x4e, (byte)0x00, (byte)0x5f, (byte)0x00,
55                 (byte)0x5f, (byte)0x00, (byte)0x5f, (byte)0x00, (byte)0x5f, (byte)0x00, (byte)0x30, (byte)0x00,
56                 (byte)0x31, (byte)0x00, (byte)0x32, (byte)0x00, (byte)0x33, (byte)0x00, (byte)0x00, (byte)0x00,
57                 (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00,
58                 (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00,
59                 (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00,
60 */
61         });
62     }
63
64     byte[] hello_message()
65     {
66         return (new byte[] {
67                 // HELLO (0x0000)
68                 0x00, 0x00,
69         });
70     }
71
72     byte[] start_message()
73     {
74         return (new byte[] {
75 /*
76                 //  現物...
77                 (byte) 0x01, (byte) 0x00, (byte) 0x02, (byte) 0x10, (byte) 0x01, (byte) 0x00, (byte) 0x00, (byte) 0x00,
78                 (byte) 0x01, (byte) 0x00, (byte) 0x00, (byte) 0x00,
79 */
80                 // message_header.index : uint16 (0: terminate, 2: two_part_message, 1: other)
81                 (byte)0x01, (byte)0x00,
82
83                 // message_header.type : START (0x1002)
84                 (byte)0x02, (byte)0x10,
85
86                 // message_id (0~1づつ繰り上がる)
87                 (byte)0x01, (byte)0x00, (byte)0x00, (byte)0x00,
88
89                 // data ...
90                 (byte)0x01, (byte)0x00, (byte)0x00, (byte)0x00,
91         });
92     }
93
94     byte[] start_message2()
95     {
96         return (new byte[] {
97 /*
98                 //  現物...
99                 (byte) 0x01, (byte) 0x00, (byte) 0x15, (byte) 0x10, (byte) 0x02, (byte) 0x00, (byte) 0x00, (byte) 0x00,
100                 (byte) 0x12, (byte) 0xd2, (byte) 0x00, (byte) 0x00,
101 */
102                 // message_header.index : uint16 (0: terminate, 2: two_part_message, 1: other)
103                 (byte)0x01, (byte)0x00,
104
105                 // message_header.type : single_part (0x1015)
106                 (byte)0x15, (byte)0x10,
107
108                 // message_id (0~1づつ繰り上がる)
109                 (byte)0x02, (byte)0x00, (byte)0x00, (byte)0x00,
110
111                 // data ...
112                 (byte)0x12, (byte)0xd2, (byte)0x00, (byte)0x00,
113
114         });
115     }
116
117     byte[] start_message3_1()
118     {
119         return (new byte[] {
120 /*
121                 //  現物...
122                 (byte) 0x01, (byte) 0x00, (byte) 0x16, (byte) 0x10, (byte) 0x03, (byte) 0x00, (byte) 0x00, (byte) 0x00,
123                 (byte) 0x01, (byte) 0xdf, (byte) 0x00, (byte) 0x00,
124 */
125                 // message_header.index : uint16 (0: terminate, 2: two_part_message, 1: other)
126                 (byte)0x01, (byte)0x00,
127
128                 // message_header.type : two_part (0x1016)
129                 (byte)0x16, (byte)0x10,
130
131                 // message_id (0~1づつ繰り上がる)
132                 (byte)0x03, (byte)0x00, (byte)0x00, (byte)0x00,
133
134                 // data ...
135                 (byte)0x01, (byte)0xdf, (byte)0x00, (byte)0x00,
136
137         });
138     }
139
140     byte[] start_message3_2()
141     {
142         return (new byte[] {
143 /*
144                 //  現物...
145                 (byte) 0x02, (byte) 0x00, (byte) 0x16, (byte) 0x10, (byte) 0x03, (byte) 0x00, (byte) 0x00, (byte) 0x00,
146                 (byte) 0x05, (byte) 0x00,
147 */
148                 // message_header.index : uint16 (0: terminate, 2: two_part_message, 1: other)
149                 (byte)0x02, (byte)0x00,
150
151                 // message_header.type : two_part (0x1016)
152                 (byte)0x16, (byte)0x10,
153
154                 // message_id (0~1づつ繰り上がる...けど two-part messageなので同じ)
155                 (byte)0x03, (byte)0x00, (byte)0x00, (byte)0x00,
156
157                 // data ...
158                 (byte)0x05, (byte)0x00,
159
160         });
161     }
162
163
164     byte[] start_message4()
165     {
166         return (new byte[] {
167 /*
168                 //  現物...
169                 (byte) 0x01, (byte) 0x00, (byte) 0x15, (byte) 0x10, (byte) 0x04, (byte) 0x00, (byte) 0x00, (byte) 0x00,
170                 (byte) 0x24, (byte) 0xdf, (byte) 0x00, (byte) 0x00,
171 */
172                 // message_header.index : uint16 (0: terminate, 2: two_part_message, 1: other)
173                 (byte)0x01, (byte)0x00,
174
175                 // message_header.type : single_part (0x1015)
176                 (byte)0x15, (byte)0x10,
177
178                 // message_id (0~1づつ繰り上がる)
179                 (byte)0x04, (byte)0x00, (byte)0x00, (byte)0x00,
180
181                 // data ...
182                 (byte)0x24, (byte)0xdf, (byte)0x00, (byte)0x00,
183
184         });
185     }
186
187     byte[] start_message5_1()
188     {
189         return (new byte[] {
190 /*
191                 //  現物...
192                 (byte) 0x01, (byte) 0x00, (byte) 0x16, (byte) 0x10, (byte) 0x05, (byte) 0x00, (byte) 0x00, (byte) 0x00,
193                 (byte) 0x24, (byte) 0xdf, (byte) 0x00, (byte) 0x00,
194 */
195                 // message_header.index : uint16 (0: terminate, 2: two_part_message, 1: other)
196                 (byte)0x01, (byte)0x00,
197
198                 // message_header.type : two_part (0x1016)
199                 (byte)0x16, (byte)0x10,
200
201                 // message_id (0~1づつ繰り上がる)
202                 (byte)0x05, (byte)0x00, (byte)0x00, (byte)0x00,
203
204                 // data ...
205                 (byte)0x24, (byte)0xdf, (byte)0x00, (byte)0x00,
206
207         });
208     }
209
210     byte[] start_message5_2()
211     {
212         return (new byte[] {
213 /*
214                 //  現物...
215                 (byte) 0x02, (byte) 0x00, (byte) 0x16, (byte) 0x10, (byte) 0x05, (byte) 0x00, (byte) 0x00, (byte) 0x00,
216                 (byte) 0x07, (byte) 0x00, (byte) 0x02, (byte) 0x00,
217 */
218                 // message_header.index : uint16 (0: terminate, 2: two_part_message, 1: other)
219                 (byte)0x02, (byte)0x00,
220
221                 // message_header.type : two_part (0x1016)
222                 (byte)0x16, (byte)0x10,
223
224                 // message_id (0~1づつ繰り上がる...けど two-part messageなので同じ)
225                 (byte)0x05, (byte)0x00, (byte)0x00, (byte)0x00,
226
227                 // data ...
228                 (byte)0x07, (byte)0x00, (byte)0x02, (byte)0x00,
229
230         });
231     }
232
233     byte[] start_message6()
234     {
235         return (new byte[] {
236 /*
237                 //  現物...
238                 (byte) 0x01, (byte) 0x00, (byte) 0x15, (byte) 0x10, (byte) 0x06, (byte) 0x00, (byte) 0x00, (byte) 0x00,
239                 (byte) 0x12, (byte) 0xd2, (byte) 0x00, (byte) 0x00,
240 */
241                 // message_header.index : uint16 (0: terminate, 2: two_part_message, 1: other)
242                 (byte)0x01, (byte)0x00,
243
244                 // message_header.type : single_part (0x1015)
245                 (byte)0x15, (byte)0x10,
246
247                 // message_id (0~1づつ繰り上がる...)
248                 (byte)0x06, (byte)0x00, (byte)0x00, (byte)0x00,
249
250                 // data ...
251                 (byte)0x12, (byte)0xd2, (byte)0x00, (byte)0x00,
252
253         });
254     }
255
256
257     byte[] start_message7()
258     {
259         return (new byte[] {
260 /*
261                 //  現物...
262                 (byte) 0x01, (byte) 0x00, (byte) 0x2b, (byte) 0x90, (byte) 0x07, (byte) 0x00, (byte) 0x00, (byte) 0x00,
263 */
264                 // message_header.index : uint16 (0: terminate, 2: two_part_message, 1: other)
265                 (byte)0x01, (byte)0x00,
266
267                 // message_header.type : camera_capabilities (0x902b)
268                 (byte)0x2b, (byte)0x90,
269
270                 // message_id (0~1づつ繰り上がる...)
271                 (byte)0x07, (byte)0x00, (byte)0x00, (byte)0x00,
272
273         });
274     }
275
276
277     byte[] start_message8()
278     {
279         return (new byte[] {
280 /*
281                 //  現物...
282                 (byte) 0x01, (byte) 0x00, (byte) 0x15, (byte) 0x10, (byte) 0x08, (byte) 0x00, (byte) 0x00, (byte) 0x00,
283                 (byte) 0x12, (byte) 0xd2, (byte) 0x00, (byte) 0x00
284 */
285                 // message_header.index : uint16 (0: terminate, 2: two_part_message, 1: other)
286                 (byte)0x01, (byte)0x00,
287
288                 // message_header.type : single_part (0x1015)
289                 (byte)0x15, (byte)0x10,
290
291                 // message_id (0~1づつ繰り上がる...)
292                 (byte)0x08, (byte)0x00, (byte)0x00, (byte)0x00,
293
294                 // data ...
295                 (byte)0x12, (byte)0xd2, (byte)0x00, (byte)0x00,
296
297         });
298     }
299
300
301
302     byte[] start_message9()
303     {
304         return (new byte[] {
305 /*
306                 //  現物...
307                 (byte) 0x01, (byte) 0x00, (byte) 0x1c, (byte) 0x10, (byte) 0x09, (byte) 0x00, (byte) 0x00, (byte) 0x00,
308                 (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00
309 */
310                 // message_header.index : uint16 (0: terminate, 2: two_part_message, 1: other)
311                 (byte)0x01, (byte)0x00,
312
313                 // message_header.type : camera_remote (0x101c)
314                 (byte)0x1c, (byte)0x10,
315
316                 // message_id (0~1づつ繰り上がる...)
317                 (byte)0x09, (byte)0x00, (byte)0x00, (byte)0x00,
318
319                 // data ...
320                 (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00,
321                 (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00,
322
323         });
324     }
325
326
327     byte[] status_request_message()
328     {
329         return (new byte[] {
330
331                 // message_header.index : uint16 (0: terminate, 2: two_part_message, 1: other)
332                 (byte)0x01, (byte)0x00,
333
334                 // message_header.type : single_part (0x1015)
335                 (byte)0x15, (byte)0x10,
336
337                 // message_id (0~1づつ繰り上がる...)
338                 (byte)0x0A, (byte)0x00, (byte)0x00, (byte)0x00,
339
340                 // data ...
341                 (byte)0x12, (byte)0xd2, (byte)0x00, (byte)0x00,
342         });
343     }
344
345
346     byte[] execute_shutter_message()
347     {
348         return (new byte[] {
349
350                 // message_header.index : uint16 (0: terminate, 2: two_part_message, 1: other)
351                 (byte)0x01, (byte)0x00,
352
353                 // message_header.type : shutter (0x100e)
354                 (byte)0x0e, (byte)0x10,
355
356                 // message_id (0~1づつ繰り上がる...
357                 (byte)0x0B, (byte)0x00, (byte)0x00, (byte)0x00,
358
359                 // data ...
360                 (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00,
361                 (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00,
362         });
363     }
364
365
366     byte[] two_part_message_One()
367     {
368         return (new byte[] {
369                 // TWO PART (0x1016)
370                 (byte)0x10, (byte)0x16,
371                 // index
372                 (byte)0x00, (byte)0x01,
373                 // data
374                 (byte)0x01, (byte)0xdf, (byte)0x00, (byte)0x00,
375         });
376     }
377
378     byte[] two_part_message_Two()
379     {
380         return (new byte[] {
381                 // TWO PART (0x1016)
382                 (byte)0x10, (byte)0x16,
383                 // index
384                 (byte)0x00, (byte)0x02,
385                 // data
386                 (byte)0x05, (byte)0x00, (byte)0x00, (byte)0x00,
387         });
388     }
389
390
391
392
393 }