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