• R/O
  • HTTP
  • SSH
  • HTTPS

FujiCam: Commit

Fujifilm X Series Remote Control for Android (Prototype)

Fujifilm Xシリーズカメラの遠隔操作アプリ for Android (プロトタイプ)


Commit MetaInfo

Revisão2c15d1d7873da5737bf83e42648a1779eaee5074 (tree)
Hora2019-05-23 00:36:24
AutorMRSa <mrsa@myad...>
CommiterMRSa

Mensagem de Log

ちょっとだけ準備。

Mudança Sumário

Diff

--- a/app/src/main/java/net/osdn/gokigen/cameratest/fuji/Connection.java
+++ b/app/src/main/java/net/osdn/gokigen/cameratest/fuji/Connection.java
@@ -303,4 +303,34 @@ public class Connection implements IFujiStatusRequest
303303 }
304304 return (false);
305305 }
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+ }
306336 }
--- a/app/src/main/java/net/osdn/gokigen/cameratest/fuji/MessageSequence.java
+++ b/app/src/main/java/net/osdn/gokigen/cameratest/fuji/MessageSequence.java
@@ -393,13 +393,13 @@ class MessageSequence
393393 // message_header.index : uint16 (0: terminate, 2: two_part_message, 1: other)
394394 (byte)0x01, (byte)0x00,
395395
396- // message_header.type : two_part (0x1016) : SetDevicePropValue
396+ // message_header.type : two_part (0x1016)
397397 (byte)0x16, (byte)0x10,
398398
399399 // message_id (0~1づつ繰り上がる)
400400 (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00,
401401
402- // data ...
402+ // command code
403403 low, high,
404404 });
405405 }
@@ -410,13 +410,13 @@ class MessageSequence
410410 // message_header.index : uint16 (0: terminate, 2: two_part_message, 1: other)
411411 (byte)0x02, (byte)0x00,
412412
413- // message_header.type : two_part (0x1016) : SetDevicePropValue
413+ // message_header.type : two_part (0x1016)
414414 (byte)0x16, (byte)0x10,
415415
416416 // message_id (0~1づつ繰り上がる...けど two-part messageなので同じ)
417417 (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00,
418418
419- // data ...
419+ // data...
420420 data3, data2, data1, data0,
421421 });
422422 }
Show on old repository browser