class Communication
{
private final String TAG = toString();
+ private static final int SEQUENCE_START_NUMBER = 1;
private static final int BUFFER_SIZE = 1024 * 1024 + 8;
private static final int CONTROL_PORT = 55740;
private Socket socket = null;
private DataOutputStream dos = null;
private BufferedReader bufferedReader = null;
- private int sequenceNumber = 0x0000000a;
+ private int sequenceNumber = SEQUENCE_START_NUMBER;
private boolean isDumpReceiveLog = true;
e.printStackTrace();
}
socket = null;
- sequenceNumber = 0x0000000a;
+ sequenceNumber = SEQUENCE_START_NUMBER;
System.gc();
}
dump_bytes(0, rx_bytes);
Thread.sleep(50);
- // 応答エラーの場合は この値が返ってくるはず = {0x05, 0x00, 0x00, 0x00, 0x19, 0x20, 0x00, 0x00};
+ // 応答エラーかどうかをチェックする
+ if (rx_bytes.getData().length == 8)
+ {
+ byte[] receiveData = rx_bytes.getData();
+ if ((receiveData[0] == 0x05)&&(receiveData[1] == 0x00)&&(receiveData[2] == 0x00)&&(receiveData[3] == 0x00)&&
+ (receiveData[4] == 0x19)&&(receiveData[5] == 0x20)&&(receiveData[6] == 0x00)&&(receiveData[7] == 0x00))
+ {
+ // 応答エラー...
+ return (false);
+ }
+ return (false);
+ }
// start_messageを送信
- comm.send_to_camera(sequence.start_message(), false);
+ comm.send_to_camera(sequence.start_message(), true);
rx_bytes = comm.receive_from_camera();
dump_bytes(1, rx_bytes);
Thread.sleep(50);
// なんだろう?? (送信が必要なようだが)
- comm.send_to_camera(sequence.start_message2(), false);
+ comm.send_to_camera(sequence.start_message2(), true);
rx_bytes = comm.receive_from_camera();
dump_bytes(2, rx_bytes);
Thread.sleep(50);
// two_part messageを発行 (その1)
- comm.send_to_camera(sequence.start_message3_1(), false);
+ comm.send_to_camera(sequence.start_message3_1(), true);
rx_bytes = comm.receive_from_camera();
dump_bytes(3, rx_bytes);
Thread.sleep(50);
Thread.sleep(50);
// remote mode
- comm.send_to_camera(sequence.start_message4(), false);
+ comm.send_to_camera(sequence.start_message4(), true);
rx_bytes = comm.receive_from_camera();
dump_bytes(5, rx_bytes);
Thread.sleep(50);
// two_part messageを発行 (その1)
- comm.send_to_camera(sequence.start_message5_1(), false);
+ comm.send_to_camera(sequence.start_message5_1(), true);
rx_bytes = comm.receive_from_camera();
dump_bytes(6, rx_bytes);
Thread.sleep(50);
Thread.sleep(50);
// ????
- comm.send_to_camera(sequence.start_message6(), false);
+ comm.send_to_camera(sequence.start_message6(), true);
rx_bytes = comm.receive_from_camera();
dump_bytes(8, rx_bytes);
Thread.sleep(50);
// ????
- comm.send_to_camera(sequence.start_message7(), false);
+ comm.send_to_camera(sequence.start_message7(), true);
rx_bytes = comm.receive_from_camera();
dump_bytes(9, rx_bytes);
Thread.sleep(50);
// ????
- comm.send_to_camera(sequence.start_message8(), false);
+ comm.send_to_camera(sequence.start_message8(), true);
rx_bytes = comm.receive_from_camera();
dump_bytes(10, rx_bytes);
Thread.sleep(50);
// ????
- comm.send_to_camera(sequence.start_message9(), false);
+ comm.send_to_camera(sequence.start_message9(), true);
// 応答OKの場合は、8バイト ({0x03, 0x00, 0x01, 0x20} + {0x10, 0x02, 0x00, 0x00} )が応答されるはず
rx_bytes = comm.receive_from_camera();
(byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00,
/**/
- // device_name 'GOKIGEN____012345'
+ // device_name 'GOKIGEN____012345678'
(byte)0x47, (byte)0x00, (byte)0x4f, (byte)0x00, (byte)0x4b, (byte)0x00, (byte)0x49, (byte)0x00,
(byte)0x47, (byte)0x00, (byte)0x45, (byte)0x00, (byte)0x4e, (byte)0x00, (byte)0x5f, (byte)0x00,
(byte)0x5f, (byte)0x00, (byte)0x5f, (byte)0x00, (byte)0x5f, (byte)0x00, (byte)0x30, (byte)0x00,
(byte)0x31, (byte)0x00, (byte)0x32, (byte)0x00, (byte)0x33, (byte)0x00, (byte)0x34, (byte)0x00,
- (byte)0x35, (byte)0x00, (byte)0x36, (byte)0x00, (byte)0x37, (byte)0x00, (byte)0x00, (byte)0x00,
+ (byte)0x35, (byte)0x00, (byte)0x36, (byte)0x00, (byte)0x37, (byte)0x00, (byte)0x38, (byte)0x00,
(byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00,
(byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00,
/**/
return (new byte[] { (byte)0xff, (byte)0xff, (byte)0xff, (byte)0xff, });
}
- byte[] hello_message()
- {
- return (new byte[] {
- // HELLO (0x0000)
- 0x00, 0x00,
- });
- }
-
byte[] start_message()
{
return (new byte[] {
});
}
-
byte[] start_message4()
{
return (new byte[] {
});
}
-
byte[] execute_focus_unlock()
{
return (new byte[] {
<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:tint="#e0e0e0"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
<item
android:id="@+id/action_refresh"
compat:showAsAction="always"
- android:icon="@drawable/ic_refresh_black_24dp"
+ android:icon="@drawable/ic_refresh_white_24dp"
android:title="@string/action_refresh"
android:visible="true" />
<string name="pref_degug_info">Debug Information</string>
<string name="pref_summary_debug_info">LogCat Information</string>
+ <string name="pref_special_thanks">Special Thanks to : fuji-cam-wifi-tool</string>
+
<string name="dialog_title_confirmation">Confirmation</string>
<string name="dialog_positive_execute">OK</string>
<PreferenceCategory
android:title="@string/pref_cat_others">
-
+ <Preference
+ android:key="special_thanks"
+ android:title="@string/pref_special_thanks"
+ android:summary="https://github.com/hkr/fuji-cam-wifi-tool"
+ android:selectable="true">
+ <intent android:action="android.intent.action.VIEW"
+ android:data="https://github.com/hkr/fuji-cam-wifi-tool" />
+ </Preference>
</PreferenceCategory>
<Preference
android:key="instruction_link"
android:title="@string/pref_instruction_manual"
- android:summary="https://osdn.net/projects/gokigen/wiki/GR2Control"
+ android:summary="https://osdn.net/projects/gokigen/wiki/A01d"
android:selectable="true">
<intent android:action="android.intent.action.VIEW"
- android:data="https://osdn.net/projects/gokigen/wiki/GR2Control" />
+ android:data="https://osdn.net/projects/gokigen/wiki/A01d" />
</Preference>
<Preference