Fujifilm X Series Remote Control for Android (Prototype)
Fujifilm Xシリーズカメラの遠隔操作アプリ for Android (プロトタイプ)
Revision | 2c15d1d7873da5737bf83e42648a1779eaee5074 (tree) |
---|---|
Zeit | 2019-05-23 00:36:24 |
Autor | MRSa <mrsa@myad...> |
Commiter | MRSa |
ちょっとだけ準備。
@@ -303,4 +303,34 @@ public class Connection implements IFujiStatusRequest | ||
303 | 303 | } |
304 | 304 | return (false); |
305 | 305 | } |
306 | + | |
307 | + public boolean updateProperty(int commandCode, int setValue) | |
308 | + { | |
309 | + ReceivedDataHolder rx_bytes; | |
310 | + try { | |
311 | + byte high = (byte) ((0x0000ff00 & commandCode) >> 8); | |
312 | + byte low = (byte) (0x000000ff & commandCode); | |
313 | + | |
314 | + byte data0 = (byte)((0xff000000 & setValue) >> 24); | |
315 | + byte data1 = (byte)((0x00ff0000 & setValue) >> 16); | |
316 | + byte data2 = (byte)((0x0000ff00 & setValue) >> 8); | |
317 | + byte data3 = (byte)((0x000000ff & setValue)); | |
318 | + | |
319 | + // two_part messageを発行 (その1) | |
320 | + comm.send_to_camera(sequence.update_property_1(high, low), true); | |
321 | + rx_bytes = comm.receive_from_camera(); | |
322 | + dump_bytes(15, rx_bytes); | |
323 | + Thread.sleep(50); | |
324 | + | |
325 | + // two_part messageを発行 (その2) | |
326 | + comm.send_to_camera(sequence.update_property_2(data0, data1, data2, data3), false); | |
327 | + rx_bytes = comm.receive_from_camera(); | |
328 | + dump_bytes(16, rx_bytes); | |
329 | + } | |
330 | + catch (Exception e) | |
331 | + { | |
332 | + e.printStackTrace(); | |
333 | + } | |
334 | + return (false); | |
335 | + } | |
306 | 336 | } |
@@ -393,13 +393,13 @@ class MessageSequence | ||
393 | 393 | // message_header.index : uint16 (0: terminate, 2: two_part_message, 1: other) |
394 | 394 | (byte)0x01, (byte)0x00, |
395 | 395 | |
396 | - // message_header.type : two_part (0x1016) : SetDevicePropValue | |
396 | + // message_header.type : two_part (0x1016) | |
397 | 397 | (byte)0x16, (byte)0x10, |
398 | 398 | |
399 | 399 | // message_id (0~1づつ繰り上がる) |
400 | 400 | (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, |
401 | 401 | |
402 | - // data ... | |
402 | + // command code | |
403 | 403 | low, high, |
404 | 404 | }); |
405 | 405 | } |
@@ -410,13 +410,13 @@ class MessageSequence | ||
410 | 410 | // message_header.index : uint16 (0: terminate, 2: two_part_message, 1: other) |
411 | 411 | (byte)0x02, (byte)0x00, |
412 | 412 | |
413 | - // message_header.type : two_part (0x1016) : SetDevicePropValue | |
413 | + // message_header.type : two_part (0x1016) | |
414 | 414 | (byte)0x16, (byte)0x10, |
415 | 415 | |
416 | 416 | // message_id (0~1づつ繰り上がる...けど two-part messageなので同じ) |
417 | 417 | (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, |
418 | 418 | |
419 | - // data ... | |
419 | + // data... | |
420 | 420 | data3, data2, data1, data0, |
421 | 421 | }); |
422 | 422 | } |