OSDN Git Service

Kodak PIXPRO WPZ2 対応の準備。(LVがまだ)
authorMRSa <mrsa@myad.jp>
Tue, 4 Aug 2020 14:31:07 +0000 (23:31 +0900)
committerMRSa <mrsa@myad.jp>
Tue, 4 Aug 2020 14:31:07 +0000 (23:31 +0900)
56 files changed:
app/build.gradle
app/src/main/java/net/osdn/gokigen/a01d/A01dMain.java
app/src/main/java/net/osdn/gokigen/a01d/camera/CameraInterfaceProvider.java
app/src/main/java/net/osdn/gokigen/a01d/camera/ICameraConnection.java
app/src/main/java/net/osdn/gokigen/a01d/camera/IInterfaceProvider.java
app/src/main/java/net/osdn/gokigen/a01d/camera/kodak/IKodakInterfaceProvider.java [new file with mode: 0644]
app/src/main/java/net/osdn/gokigen/a01d/camera/kodak/operation/KodakCameraPowerOff.java [new file with mode: 0644]
app/src/main/java/net/osdn/gokigen/a01d/camera/kodak/operation/KodakCaptureControl.java [new file with mode: 0644]
app/src/main/java/net/osdn/gokigen/a01d/camera/kodak/operation/KodakFocusingControl.java [new file with mode: 0644]
app/src/main/java/net/osdn/gokigen/a01d/camera/kodak/operation/KodakZoomLensControl.java [new file with mode: 0644]
app/src/main/java/net/osdn/gokigen/a01d/camera/kodak/wrapper/KodakInterfaceProvider.java [new file with mode: 0644]
app/src/main/java/net/osdn/gokigen/a01d/camera/kodak/wrapper/command/IKodakCommand.java [new file with mode: 0644]
app/src/main/java/net/osdn/gokigen/a01d/camera/kodak/wrapper/command/IKodakCommandCallback.java [new file with mode: 0644]
app/src/main/java/net/osdn/gokigen/a01d/camera/kodak/wrapper/command/IKodakCommandPublisher.java [new file with mode: 0644]
app/src/main/java/net/osdn/gokigen/a01d/camera/kodak/wrapper/command/IKodakCommunication.java [new file with mode: 0644]
app/src/main/java/net/osdn/gokigen/a01d/camera/kodak/wrapper/command/KodakCommandCommunicator.java [new file with mode: 0644]
app/src/main/java/net/osdn/gokigen/a01d/camera/kodak/wrapper/command/messages/IKodakMessages.java [new file with mode: 0644]
app/src/main/java/net/osdn/gokigen/a01d/camera/kodak/wrapper/command/messages/KodakCommandBase.java [new file with mode: 0644]
app/src/main/java/net/osdn/gokigen/a01d/camera/kodak/wrapper/command/messages/KodakCommandReceiveOnly.java [new file with mode: 0644]
app/src/main/java/net/osdn/gokigen/a01d/camera/kodak/wrapper/command/messages/connection/KodakConnectSequence01.java [new file with mode: 0644]
app/src/main/java/net/osdn/gokigen/a01d/camera/kodak/wrapper/command/messages/connection/KodakConnectSequence02.java [new file with mode: 0644]
app/src/main/java/net/osdn/gokigen/a01d/camera/kodak/wrapper/command/messages/connection/KodakConnectSequence03.java [new file with mode: 0644]
app/src/main/java/net/osdn/gokigen/a01d/camera/kodak/wrapper/command/messages/connection/KodakConnectSequence04.java [new file with mode: 0644]
app/src/main/java/net/osdn/gokigen/a01d/camera/kodak/wrapper/command/messages/connection/KodakConnectSequence05.java [new file with mode: 0644]
app/src/main/java/net/osdn/gokigen/a01d/camera/kodak/wrapper/command/messages/connection/KodakConnectSequence06.java [new file with mode: 0644]
app/src/main/java/net/osdn/gokigen/a01d/camera/kodak/wrapper/command/messages/connection/KodakConnectSequence07.java [new file with mode: 0644]
app/src/main/java/net/osdn/gokigen/a01d/camera/kodak/wrapper/command/messages/connection/KodakConnectSequence08.java [new file with mode: 0644]
app/src/main/java/net/osdn/gokigen/a01d/camera/kodak/wrapper/command/messages/connection/KodakConnectSequence09.java [new file with mode: 0644]
app/src/main/java/net/osdn/gokigen/a01d/camera/kodak/wrapper/command/messages/connection/KodakConnectSequence10.java [new file with mode: 0644]
app/src/main/java/net/osdn/gokigen/a01d/camera/kodak/wrapper/command/messages/connection/KodakConnectSequence11.java [new file with mode: 0644]
app/src/main/java/net/osdn/gokigen/a01d/camera/kodak/wrapper/command/messages/connection/KodakConnectSequence12.java [new file with mode: 0644]
app/src/main/java/net/osdn/gokigen/a01d/camera/kodak/wrapper/command/messages/connection/KodakConnectSequence13.java [new file with mode: 0644]
app/src/main/java/net/osdn/gokigen/a01d/camera/kodak/wrapper/command/messages/specific/KodakExecuteShutter.java [new file with mode: 0644]
app/src/main/java/net/osdn/gokigen/a01d/camera/kodak/wrapper/command/messages/specific/KodakFlashAuto.java [new file with mode: 0644]
app/src/main/java/net/osdn/gokigen/a01d/camera/kodak/wrapper/command/messages/specific/KodakFlashOff.java [new file with mode: 0644]
app/src/main/java/net/osdn/gokigen/a01d/camera/kodak/wrapper/command/messages/specific/KodakFlashOn.java [new file with mode: 0644]
app/src/main/java/net/osdn/gokigen/a01d/camera/kodak/wrapper/connection/KodakCameraConnectSequence.java [new file with mode: 0644]
app/src/main/java/net/osdn/gokigen/a01d/camera/kodak/wrapper/connection/KodakCameraDisconnectSequence.java [new file with mode: 0644]
app/src/main/java/net/osdn/gokigen/a01d/camera/kodak/wrapper/connection/KodakConnection.java [new file with mode: 0644]
app/src/main/java/net/osdn/gokigen/a01d/camera/kodak/wrapper/hardware/KodakCameraInformation.java [new file with mode: 0644]
app/src/main/java/net/osdn/gokigen/a01d/camera/kodak/wrapper/liveview/KodakLiveViewControl.java [new file with mode: 0644]
app/src/main/java/net/osdn/gokigen/a01d/camera/kodak/wrapper/status/IKodakRunModeHolder.java [new file with mode: 0644]
app/src/main/java/net/osdn/gokigen/a01d/camera/kodak/wrapper/status/KodakRunMode.java [new file with mode: 0644]
app/src/main/java/net/osdn/gokigen/a01d/camera/kodak/wrapper/status/KodakStatusChecker.java [new file with mode: 0644]
app/src/main/java/net/osdn/gokigen/a01d/camera/kodak/wrapper/status/KodakStatusHolder.java [new file with mode: 0644]
app/src/main/java/net/osdn/gokigen/a01d/liveview/LiveViewClickTouchListener.java
app/src/main/java/net/osdn/gokigen/a01d/liveview/LiveViewFragment.java
app/src/main/java/net/osdn/gokigen/a01d/preference/IPreferencePropertyAccessor.java
app/src/main/java/net/osdn/gokigen/a01d/preference/kodak/KodakPreferenceFragment.java [new file with mode: 0644]
app/src/main/java/net/osdn/gokigen/a01d/preference/summary/PreferenceFragmentSummary.java
app/src/main/res/values-ja/arrays.xml
app/src/main/res/values-ja/strings.xml
app/src/main/res/values/arrays.xml
app/src/main/res/values/strings.xml
app/src/main/res/xml/preferences_kodak.xml [new file with mode: 0644]
app/src/main/res/xml/preferences_summary.xml

index 22a6965..cdbc339 100644 (file)
@@ -6,8 +6,8 @@ android {
         applicationId "net.osdn.gokigen.a01d"
         minSdkVersion 14
         targetSdkVersion 29
-        versionCode 10800
-        versionName "1.8.0"
+        versionCode 10900
+        versionName "1.9.0"
     }
     buildTypes {
         release {
index 6c33a31..f2159e7 100644 (file)
@@ -30,6 +30,7 @@ import net.osdn.gokigen.a01d.logcat.LogCatFragment;
 import net.osdn.gokigen.a01d.preference.IPreferencePropertyAccessor;
 import net.osdn.gokigen.a01d.preference.canon.CanonPreferenceFragment;
 import net.osdn.gokigen.a01d.preference.fujix.FujiXPreferenceFragment;
+import net.osdn.gokigen.a01d.preference.kodak.KodakPreferenceFragment;
 import net.osdn.gokigen.a01d.preference.nikon.NikonPreferenceFragment;
 import net.osdn.gokigen.a01d.preference.olympus.PreferenceFragment;
 import net.osdn.gokigen.a01d.preference.panasonic.PanasonicPreferenceFragment;
@@ -72,6 +73,7 @@ public class A01dMain extends AppCompatActivity implements ICameraStatusReceiver
     private PreferenceFragmentCompat preferenceFragmentPanasonic = null;
     private PreferenceFragmentCompat preferenceFragmentCanon = null;
     private PreferenceFragmentCompat preferenceFragmentNikon = null;
+    private PreferenceFragmentCompat preferenceFragmentKodak = null;
 
     private OlyCameraPropertyListFragment propertyListFragment = null;
     private SonyCameraApiListFragment sonyApiListFragmentSony = null;
@@ -477,6 +479,12 @@ public class A01dMain extends AppCompatActivity implements ICameraStatusReceiver
                     preferenceFragmentNikon = NikonPreferenceFragment.newInstance(this, this);
                 }
                 targetFragment = preferenceFragmentNikon;
+            } else if (connectionMethod == ICameraConnection.CameraConnectionMethod.KODAK) {
+                if (preferenceFragmentKodak == null)
+                {
+                    preferenceFragmentKodak = KodakPreferenceFragment.newInstance(this, this);
+                }
+                targetFragment = preferenceFragmentKodak;
             } else if (connectionMethod == ICameraConnection.CameraConnectionMethod.OPC) {
                 if (preferenceFragmentOPC == null)
                 {
@@ -775,6 +783,10 @@ public class A01dMain extends AppCompatActivity implements ICameraStatusReceiver
         {
             connection = interfaceProvider.getNikonInterface().getCameraConnection();
         }
+        else if  (connectionMethod == ICameraConnection.CameraConnectionMethod.KODAK)
+        {
+            connection = interfaceProvider.getKodakInterface().getCameraConnection();
+        }
         else // if (connectionMethod == ICameraConnection.CameraConnectionMethod.OPC)
         {
             connection = interfaceProvider.getOlympusInterface().getOlyCameraConnection();
index 8115697..f4dba01 100644 (file)
@@ -8,6 +8,8 @@ import net.osdn.gokigen.a01d.IInformationReceiver;
 import net.osdn.gokigen.a01d.camera.canon.wrapper.CanonInterfaceProvider;
 import net.osdn.gokigen.a01d.camera.fujix.IFujiXInterfaceProvider;
 import net.osdn.gokigen.a01d.camera.fujix.wrapper.FujiXInterfaceProvider;
+import net.osdn.gokigen.a01d.camera.kodak.IKodakInterfaceProvider;
+import net.osdn.gokigen.a01d.camera.kodak.wrapper.KodakInterfaceProvider;
 import net.osdn.gokigen.a01d.camera.nikon.wrapper.NikonInterfaceProvider;
 import net.osdn.gokigen.a01d.camera.olympus.wrapper.IOlympusLiveViewListener;
 import net.osdn.gokigen.a01d.camera.olympus.IOlympusInterfaceProvider;
@@ -41,6 +43,7 @@ public class CameraInterfaceProvider implements IInterfaceProvider
     private final ThetaInterfaceProvider theta;
     private final CanonInterfaceProvider canon;
     private final NikonInterfaceProvider nikon;
+    private final KodakInterfaceProvider kodak;
     private final CameraStatusListener statusListener;
 
     public CameraInterfaceProvider(@NonNull Activity context, @NonNull ICameraStatusReceiver provider, @NonNull IInformationReceiver informationReceiver, @NonNull ICardSlotSelector cardSlotSelector)
@@ -56,6 +59,7 @@ public class CameraInterfaceProvider implements IInterfaceProvider
         theta = new ThetaInterfaceProvider(context, provider, statusListener);
         canon = new CanonInterfaceProvider(context, provider, statusListener, informationReceiver);
         nikon = new NikonInterfaceProvider(context, provider, statusListener, informationReceiver);
+        kodak = new KodakInterfaceProvider(context, provider, statusListener, informationReceiver);
     }
 
     @Override
@@ -120,6 +124,12 @@ public class CameraInterfaceProvider implements IInterfaceProvider
     }
 
     @Override
+    public IKodakInterfaceProvider getKodakInterface()
+    {
+        return (kodak);
+    }
+
+    @Override
     public IOlympusPenInterfaceProvider getOlympusPenInterface()
     {
         return (olympusPen);
@@ -175,6 +185,10 @@ public class CameraInterfaceProvider implements IInterfaceProvider
             {
                 ret = ICameraConnection.CameraConnectionMethod.NIKON;
             }
+            else if (connectionMethod.contains("KODAK"))
+            {
+                ret = ICameraConnection.CameraConnectionMethod.KODAK;
+            }
         }
         catch (Exception e)
         {
index 9819a6f..095dff6 100644 (file)
@@ -19,6 +19,7 @@ public interface ICameraConnection
         THETA,
         CANON,
         NIKON,
+        KODAK,
     }
 
     enum CameraConnectionStatus
index cd45b3a..e0c237c 100644 (file)
@@ -1,6 +1,7 @@
 package net.osdn.gokigen.a01d.camera;
 
 import net.osdn.gokigen.a01d.camera.fujix.IFujiXInterfaceProvider;
+import net.osdn.gokigen.a01d.camera.kodak.IKodakInterfaceProvider;
 import net.osdn.gokigen.a01d.camera.olympus.wrapper.IOlympusLiveViewListener;
 import net.osdn.gokigen.a01d.camera.olympus.IOlympusInterfaceProvider;
 import net.osdn.gokigen.a01d.camera.olympuspen.IOlympusPenInterfaceProvider;
@@ -27,6 +28,7 @@ public interface IInterfaceProvider
     IPanasonicInterfaceProvider getPanasonicInterface();
     IPtpIpInterfaceProvider getCanonInterface();
     IPtpIpInterfaceProvider getNikonInterface();
+    IKodakInterfaceProvider getKodakInterface();
 
     IOlympusPenInterfaceProvider getOlympusPenInterface();
 
diff --git a/app/src/main/java/net/osdn/gokigen/a01d/camera/kodak/IKodakInterfaceProvider.java b/app/src/main/java/net/osdn/gokigen/a01d/camera/kodak/IKodakInterfaceProvider.java
new file mode 100644 (file)
index 0000000..563841b
--- /dev/null
@@ -0,0 +1,42 @@
+package net.osdn.gokigen.a01d.camera.kodak;
+
+import net.osdn.gokigen.a01d.IInformationReceiver;
+import net.osdn.gokigen.a01d.camera.ICameraConnection;
+import net.osdn.gokigen.a01d.camera.ICameraInformation;
+import net.osdn.gokigen.a01d.camera.ICameraStatus;
+import net.osdn.gokigen.a01d.camera.ICameraStatusWatcher;
+import net.osdn.gokigen.a01d.camera.ICaptureControl;
+import net.osdn.gokigen.a01d.camera.IDisplayInjector;
+import net.osdn.gokigen.a01d.camera.IFocusingControl;
+import net.osdn.gokigen.a01d.camera.ILiveViewControl;
+import net.osdn.gokigen.a01d.camera.IZoomLensControl;
+import net.osdn.gokigen.a01d.camera.kodak.wrapper.command.IKodakCommandCallback;
+import net.osdn.gokigen.a01d.camera.kodak.wrapper.command.IKodakCommandPublisher;
+import net.osdn.gokigen.a01d.camera.kodak.wrapper.command.IKodakCommunication;
+import net.osdn.gokigen.a01d.camera.kodak.wrapper.status.IKodakRunModeHolder;
+import net.osdn.gokigen.a01d.liveview.ICameraStatusUpdateNotify;
+import net.osdn.gokigen.a01d.liveview.liveviewlistener.ILiveViewListener;
+
+public interface IKodakInterfaceProvider
+{
+    ICameraConnection getCameraConnection();
+    ILiveViewControl getLiveViewControl();
+    ILiveViewListener getLiveViewListener();
+    IFocusingControl getFocusingControl();
+    ICameraInformation getCameraInformation();
+    IZoomLensControl getZoomLensControl();
+    ICaptureControl getCaptureControl();
+    IDisplayInjector getDisplayInjector();
+
+    IKodakRunModeHolder getRunModeHolder();
+    IKodakCommandCallback getStatusHolder();
+    IKodakCommandPublisher getCommandPublisher();
+    IKodakCommunication getCommandCommunication();
+    IInformationReceiver getInformationReceiver();
+
+    ICameraStatusWatcher getStatusWatcher();
+    ICameraStatusUpdateNotify getStatusListener();
+
+    ICameraStatusWatcher getCameraStatusWatcher();
+    ICameraStatus getCameraStatusListHolder();
+}
diff --git a/app/src/main/java/net/osdn/gokigen/a01d/camera/kodak/operation/KodakCameraPowerOff.java b/app/src/main/java/net/osdn/gokigen/a01d/camera/kodak/operation/KodakCameraPowerOff.java
new file mode 100644 (file)
index 0000000..25f29d4
--- /dev/null
@@ -0,0 +1,76 @@
+package net.osdn.gokigen.a01d.camera.kodak.operation;
+
+import android.content.Context;
+
+import androidx.preference.Preference;
+
+import net.osdn.gokigen.a01d.ConfirmationDialog;
+import net.osdn.gokigen.a01d.IChangeScene;
+import net.osdn.gokigen.a01d.R;
+import net.osdn.gokigen.a01d.preference.IPreferencePropertyAccessor;
+
+public class KodakCameraPowerOff implements Preference.OnPreferenceClickListener, ConfirmationDialog.Callback
+{
+    private final Context context;
+    private final IChangeScene changeScene;
+    private String preferenceKey = null;
+
+    /**
+     *   コンストラクタ
+     *
+     */
+    public KodakCameraPowerOff(Context context, IChangeScene changeScene)
+    {
+        this.context = context;
+        this.changeScene = changeScene;
+    }
+
+    /**
+     *   クラスの準備
+     *
+     */
+    public void prepare()
+    {
+        // 何もしない
+    }
+
+    /**
+     *
+     *
+     * @param preference クリックしたpreference
+     * @return false : ハンドルしない / true : ハンドルした
+     */
+    @Override
+    public boolean onPreferenceClick(Preference preference)
+    {
+        if (!preference.hasKey())
+        {
+            return (false);
+        }
+
+        preferenceKey = preference.getKey();
+        if (preferenceKey.contains(IPreferencePropertyAccessor.EXIT_APPLICATION))
+        {
+
+            // 確認ダイアログの生成と表示
+            ConfirmationDialog dialog = ConfirmationDialog.newInstance(context);
+            dialog.show(R.string.dialog_title_confirmation, R.string.dialog_message_exit_application, this);
+            return (true);
+        }
+        return (false);
+    }
+
+    /**
+     *
+     *
+     */
+    @Override
+    public void confirm()
+    {
+        if (preferenceKey.contains(IPreferencePropertyAccessor.EXIT_APPLICATION))
+        {
+            // カメラの電源をOFFにしたうえで、アプリケーションを終了する。
+            changeScene.exitApplication();
+        }
+    }
+}
diff --git a/app/src/main/java/net/osdn/gokigen/a01d/camera/kodak/operation/KodakCaptureControl.java b/app/src/main/java/net/osdn/gokigen/a01d/camera/kodak/operation/KodakCaptureControl.java
new file mode 100644 (file)
index 0000000..1c8fb43
--- /dev/null
@@ -0,0 +1,66 @@
+package net.osdn.gokigen.a01d.camera.kodak.operation;
+
+import android.util.Log;
+
+import androidx.annotation.NonNull;
+
+import net.osdn.gokigen.a01d.camera.ICaptureControl;
+import net.osdn.gokigen.a01d.camera.kodak.wrapper.command.IKodakCommandCallback;
+import net.osdn.gokigen.a01d.camera.kodak.wrapper.command.IKodakCommandPublisher;
+import net.osdn.gokigen.a01d.camera.kodak.wrapper.command.messages.specific.KodakExecuteShutter;
+
+import net.osdn.gokigen.a01d.liveview.IAutoFocusFrameDisplay;
+
+public class KodakCaptureControl implements ICaptureControl, IKodakCommandCallback
+{
+    private final String TAG = this.toString();
+    private final IKodakCommandPublisher commandPublisher;
+    //private final IAutoFocusFrameDisplay frameDisplayer;
+
+    public KodakCaptureControl(@NonNull IKodakCommandPublisher commandPublisher, IAutoFocusFrameDisplay frameDisplayer)
+    {
+        this.commandPublisher = commandPublisher;
+        //this.frameDisplayer = frameDisplayer;
+    }
+
+    @Override
+    public void doCapture(int kind)
+    {
+        try
+        {
+            // シャッター
+            Log.v(TAG, " doCapture() ");
+
+            // シャッターを切る
+            commandPublisher.enqueueCommand(new KodakExecuteShutter(this));
+        }
+        catch (Exception e)
+        {
+            e.printStackTrace();
+        }
+    }
+
+    @Override
+    public void receivedMessage(int id, byte[] rx_body)
+    {
+        Log.v(TAG, " KodakCaptureControl::receivedMessage() : ");
+/*
+        try
+        {
+            int responseCode = (rx_body[8] & 0xff) + ((rx_body[9] & 0xff) * 256);
+            if ((rx_body.length > 10) && (responseCode != 0x2001))
+            {
+                Log.v(TAG, String.format(" RECEIVED NG REPLY ID : %d, RESPONSE CODE : 0x%04x ", id, responseCode));
+            }
+            else
+            {
+                Log.v(TAG, String.format(" OK REPLY (ID : %d) ", id));
+            }
+        }
+        catch (Exception e)
+        {
+            e.printStackTrace();
+        }
+*/
+    }
+}
diff --git a/app/src/main/java/net/osdn/gokigen/a01d/camera/kodak/operation/KodakFocusingControl.java b/app/src/main/java/net/osdn/gokigen/a01d/camera/kodak/operation/KodakFocusingControl.java
new file mode 100644 (file)
index 0000000..4505261
--- /dev/null
@@ -0,0 +1,262 @@
+package net.osdn.gokigen.a01d.camera.kodak.operation;
+
+import android.app.Activity;
+import android.content.SharedPreferences;
+import android.graphics.PointF;
+import android.graphics.RectF;
+import android.util.Log;
+import android.view.MotionEvent;
+
+import androidx.annotation.NonNull;
+import androidx.preference.PreferenceManager;
+
+import net.osdn.gokigen.a01d.camera.IFocusingControl;
+import net.osdn.gokigen.a01d.camera.kodak.wrapper.command.IKodakCommandPublisher;
+import net.osdn.gokigen.a01d.camera.ptpip.wrapper.command.IPtpIpCommandCallback;
+
+import net.osdn.gokigen.a01d.liveview.IAutoFocusFrameDisplay;
+import net.osdn.gokigen.a01d.liveview.IIndicatorControl;
+import net.osdn.gokigen.a01d.preference.IPreferencePropertyAccessor;
+
+public class KodakFocusingControl implements IFocusingControl, IPtpIpCommandCallback
+{
+    private final String TAG = this.toString();
+    private static final int FOCUS_LOCK_PRE = 15;
+    private static final int FOCUS_LOCK = 16;
+    private static final int FOCUS_MOVE = 17;
+    private static final int FOCUS_UNLOCK = 18;
+
+    //private final Activity context;
+    private final IKodakCommandPublisher commandPublisher;
+    private final IAutoFocusFrameDisplay frameDisplayer;
+    private final IIndicatorControl indicator;
+
+    private float maxPointLimitWidth;
+    private float maxPointLimitHeight;
+    private RectF preFocusFrameRect = null;
+    private boolean not_support_focus_lock = false;
+    private boolean isDumpLog = false;
+
+    public KodakFocusingControl(@NonNull Activity context, @NonNull IKodakCommandPublisher commandPublisher, IAutoFocusFrameDisplay frameDisplayer, IIndicatorControl indicator)
+    {
+        //this.context = context;
+        this.commandPublisher = commandPublisher;
+        this.frameDisplayer = frameDisplayer;
+        this.indicator = indicator;
+        try
+        {
+            SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(context);
+            String focusPoint = preferences.getString(IPreferencePropertyAccessor.NIKON_FOCUS_XY, IPreferencePropertyAccessor.NIKON_FOCUS_XY_DEFAULT_VALUE);
+            String[] focus = focusPoint.split(",");
+            if (focus.length == 2)
+            {
+                maxPointLimitWidth = Integer.parseInt(focus[0]);
+                maxPointLimitHeight = Integer.parseInt(focus[1]);
+            }
+            else
+            {
+                maxPointLimitWidth = 6000.0f;
+                maxPointLimitHeight = 4000.0f;
+            }
+            not_support_focus_lock = preferences.getBoolean(IPreferencePropertyAccessor.NIKON_NOT_SUPPORT_FOCUS_LOCK, false);
+            Log.v(TAG, "FOCUS RESOLUTION : " + maxPointLimitWidth + "," + maxPointLimitHeight + " FOCUS LOCK : " + not_support_focus_lock);
+        }
+        catch (Exception e)
+        {
+            e.printStackTrace();
+            maxPointLimitWidth = 6000.0f;
+            maxPointLimitHeight = 4000.0f;
+        }
+    }
+
+    @Override
+    public boolean driveAutoFocus(final MotionEvent motionEvent)
+    {
+        if (motionEvent.getAction() != MotionEvent.ACTION_DOWN)
+        {
+            return (false);
+        }
+        Log.v(TAG, "driveAutoFocus()");
+        Thread thread = new Thread(new Runnable() {
+            @Override
+            public void run() {
+                try
+                {
+                    PointF point = frameDisplayer.getPointWithEvent(motionEvent);
+                    if (point != null)
+                    {
+                        preFocusFrameRect = getPreFocusFrameRect(point);
+                        showFocusFrame(preFocusFrameRect, IAutoFocusFrameDisplay.FocusFrameStatus.Running, 0.0);
+                        if (frameDisplayer.isContainsPoint(point))
+                        {
+                            lockAutoFocus(point);
+                        }
+                    }
+                }
+                catch (Exception e)
+                {
+                    e.printStackTrace();
+                }
+            }
+        });
+        try
+        {
+            thread.start();
+        }
+        catch (Exception e)
+        {
+            e.printStackTrace();
+        }
+        return (false);
+    }
+
+    @Override
+    public void unlockAutoFocus()
+    {
+        try
+        {
+            Log.v(TAG, " Unlock AF ");
+            //commandPublisher.enqueueCommand(new PtpIpCommandGeneric(this, FOCUS_UNLOCK, isDumpLog, 0, 0x9206));
+        }
+        catch (Exception e)
+        {
+            e.printStackTrace();
+        }
+    }
+
+    @Override
+    public void halfPressShutter(boolean isPressed)
+    {
+        //unlockAutoFocus();
+        //commandPublisher.enqueueCommand(new PtpIpCommandGeneric(this, FOCUS_MOVE, isDumpLog, 0, 0x90c1));
+        //lockAutoFocus(new PointF(0.5f, 0.5f));
+    }
+
+    private void lockAutoFocus(PointF point)
+    {
+        try
+        {
+            int x = (0x0000ffff & (Math.round(point.x * maxPointLimitWidth) + 1));
+            int y = (0x0000ffff & (Math.round(point.y * maxPointLimitHeight) + 1));
+            Log.v(TAG, "Lock AF: [" + x + ","+ y + "]");
+            if (!not_support_focus_lock) {
+                //commandPublisher.enqueueCommand(new PtpIpCommandGeneric(this, FOCUS_LOCK, isDumpLog, 0, 0x9205, 8, x, y));
+            } else {
+                //commandPublisher.enqueueCommand(new PtpIpCommandGeneric(this, FOCUS_MOVE, isDumpLog, 0, 0x90c1));
+            }
+        }
+        catch (Exception e)
+        {
+            e.printStackTrace();
+        }
+    }
+
+    /**
+     *
+     *
+     */
+    private RectF getPreFocusFrameRect(@NonNull PointF point)
+    {
+        float imageWidth =  frameDisplayer.getContentSizeWidth();
+        float imageHeight =  frameDisplayer.getContentSizeHeight();
+
+        // Display a provisional focus frame at the touched point.
+        float focusWidth = 0.125f;  // 0.125 is rough estimate.
+        float focusHeight = 0.125f;
+        if (imageWidth > imageHeight)
+        {
+            focusHeight *= (imageWidth / imageHeight);
+        }
+        else
+        {
+            focusHeight *= (imageHeight / imageWidth);
+        }
+        return (new RectF(point.x - focusWidth / 2.0f, point.y - focusHeight / 2.0f,
+                point.x + focusWidth / 2.0f, point.y + focusHeight / 2.0f));
+    }
+
+    /**
+     *
+     *
+     */
+    private void showFocusFrame(RectF rect, IAutoFocusFrameDisplay.FocusFrameStatus status, double duration)
+    {
+        frameDisplayer.showFocusFrame(rect, status, duration);
+        indicator.onAfLockUpdate(IAutoFocusFrameDisplay.FocusFrameStatus.Focused == status);
+    }
+
+    /**
+     *
+     *
+     */
+    private void hideFocusFrame()
+    {
+        frameDisplayer.hideFocusFrame();
+        indicator.onAfLockUpdate(false);
+    }
+
+
+    @Override
+    public void receivedMessage(int id, byte[] rx_body)
+    {
+        try
+        {
+            if (rx_body.length < 10)
+            {
+                Log.v(TAG, " --- BODY LENGTH IS SHORT : FOCUS OPERATION ---");
+                hideFocusFrame();
+                preFocusFrameRect = null;
+                return;
+            }
+            int responseCode = (rx_body[8] & 0xff) + ((rx_body[9] & 0xff) * 256);
+            if (responseCode != 0x2001)
+            {
+                Log.v(TAG, String.format(" --- RECEIVED NG REPLY. : FOCUS OPERATION (0x%x) ---", responseCode));
+                hideFocusFrame();
+                preFocusFrameRect = null;
+                return;
+            }
+
+            if ((id == FOCUS_LOCK)||(id == FOCUS_LOCK_PRE))
+            {
+                Log.v(TAG, "FOCUS LOCKED");
+                //commandPublisher.enqueueCommand(new PtpIpCommandGeneric(this, FOCUS_MOVE, isDumpLog, 0, 0x90c1));  // OKのときは駆動
+                if (preFocusFrameRect != null)
+                {
+                    // showFocusFrame(preFocusFrameRect, IAutoFocusFrameDisplay.FocusFrameStatus.Focused, 1.0);  // 1秒だけ表示
+                    showFocusFrame(preFocusFrameRect, IAutoFocusFrameDisplay.FocusFrameStatus.Focused, -1);
+                }
+            }
+            else if (id == FOCUS_MOVE)
+            {
+                Log.v(TAG, "FOCUS MOVED");
+                //if (preFocusFrameRect != null)
+                //{
+                //    hideFocusFrame();
+                //}
+            }
+            else // if (id == FOCUS_UNLOCK)
+            {
+                Log.v(TAG, "FOCUS UNLOCKED");
+                hideFocusFrame();
+            }
+            preFocusFrameRect = null;
+        }
+        catch (Exception e)
+        {
+            e.printStackTrace();
+        }
+    }
+
+    @Override
+    public void onReceiveProgress(int currentBytes, int totalBytes, byte[] rx_body)
+    {
+        Log.v(TAG, " " + currentBytes + "/" + totalBytes);
+    }
+
+    @Override
+    public boolean isReceiveMulti()
+    {
+        return (false);
+    }
+}
diff --git a/app/src/main/java/net/osdn/gokigen/a01d/camera/kodak/operation/KodakZoomLensControl.java b/app/src/main/java/net/osdn/gokigen/a01d/camera/kodak/operation/KodakZoomLensControl.java
new file mode 100644 (file)
index 0000000..5762ca2
--- /dev/null
@@ -0,0 +1,65 @@
+package net.osdn.gokigen.a01d.camera.kodak.operation;
+
+import net.osdn.gokigen.a01d.camera.IZoomLensControl;
+
+public class KodakZoomLensControl implements IZoomLensControl
+{
+    public KodakZoomLensControl()
+    {
+
+    }
+
+    @Override
+    public boolean canZoom()
+    {
+        return (false);
+    }
+
+    @Override
+    public void updateStatus()
+    {
+
+    }
+
+    @Override
+    public float getMaximumFocalLength()
+    {
+        return (0);
+    }
+
+    @Override
+    public float getMinimumFocalLength()
+    {
+        return (0);
+    }
+
+    @Override
+    public float getCurrentFocalLength()
+    {
+        return (0);
+    }
+
+    @Override
+    public void driveZoomLens(float targetLength)
+    {
+
+    }
+
+    @Override
+    public void driveZoomLens(boolean isZoomIn)
+    {
+
+    }
+
+    @Override
+    public void moveInitialZoomPosition()
+    {
+
+    }
+
+    @Override
+    public boolean isDrivingZoomLens()
+    {
+        return (false);
+    }
+}
diff --git a/app/src/main/java/net/osdn/gokigen/a01d/camera/kodak/wrapper/KodakInterfaceProvider.java b/app/src/main/java/net/osdn/gokigen/a01d/camera/kodak/wrapper/KodakInterfaceProvider.java
new file mode 100644 (file)
index 0000000..a14d020
--- /dev/null
@@ -0,0 +1,182 @@
+package net.osdn.gokigen.a01d.camera.kodak.wrapper;
+
+import android.app.Activity;
+import android.util.Log;
+
+import androidx.annotation.NonNull;
+
+import net.osdn.gokigen.a01d.IInformationReceiver;
+import net.osdn.gokigen.a01d.camera.ICameraConnection;
+import net.osdn.gokigen.a01d.camera.ICameraInformation;
+import net.osdn.gokigen.a01d.camera.ICameraStatus;
+import net.osdn.gokigen.a01d.camera.ICameraStatusReceiver;
+import net.osdn.gokigen.a01d.camera.ICameraStatusWatcher;
+import net.osdn.gokigen.a01d.camera.ICaptureControl;
+import net.osdn.gokigen.a01d.camera.IDisplayInjector;
+import net.osdn.gokigen.a01d.camera.IFocusingControl;
+import net.osdn.gokigen.a01d.camera.IFocusingModeNotify;
+import net.osdn.gokigen.a01d.camera.ILiveViewControl;
+import net.osdn.gokigen.a01d.camera.IZoomLensControl;
+import net.osdn.gokigen.a01d.camera.kodak.IKodakInterfaceProvider;
+import net.osdn.gokigen.a01d.camera.kodak.operation.KodakCaptureControl;
+import net.osdn.gokigen.a01d.camera.kodak.operation.KodakFocusingControl;
+import net.osdn.gokigen.a01d.camera.kodak.operation.KodakZoomLensControl;
+import net.osdn.gokigen.a01d.camera.kodak.wrapper.command.IKodakCommandCallback;
+import net.osdn.gokigen.a01d.camera.kodak.wrapper.command.IKodakCommandPublisher;
+import net.osdn.gokigen.a01d.camera.kodak.wrapper.command.IKodakCommunication;
+import net.osdn.gokigen.a01d.camera.kodak.wrapper.command.KodakCommandCommunicator;
+import net.osdn.gokigen.a01d.camera.kodak.wrapper.connection.KodakConnection;
+import net.osdn.gokigen.a01d.camera.kodak.wrapper.hardware.KodakCameraInformation;
+import net.osdn.gokigen.a01d.camera.kodak.wrapper.liveview.KodakLiveViewControl;
+import net.osdn.gokigen.a01d.camera.kodak.wrapper.status.IKodakRunModeHolder;
+import net.osdn.gokigen.a01d.camera.kodak.wrapper.status.KodakRunMode;
+import net.osdn.gokigen.a01d.camera.kodak.wrapper.status.KodakStatusChecker;
+import net.osdn.gokigen.a01d.liveview.IAutoFocusFrameDisplay;
+import net.osdn.gokigen.a01d.liveview.ICameraStatusUpdateNotify;
+import net.osdn.gokigen.a01d.liveview.IIndicatorControl;
+import net.osdn.gokigen.a01d.liveview.liveviewlistener.ILiveViewListener;
+
+public class KodakInterfaceProvider implements IKodakInterfaceProvider, IDisplayInjector
+{
+    private final String TAG = toString();
+
+    private static final int CONTROL_PORT = 9175;
+    private static final int LIVEVIEW_PORT = 9176;
+    private static final String CAMERA_IP = "172.16.0.254";
+
+    private final Activity activity;
+    private final KodakRunMode runmode;
+    private final KodakCameraInformation cameraInformation;
+    private KodakCaptureControl captureControl;
+    private KodakFocusingControl focusingControl;
+    private KodakConnection canonConnection;
+    private KodakCommandCommunicator commandPublisher;
+    private KodakLiveViewControl liveViewControl;
+    private KodakZoomLensControl zoomControl;
+    private KodakStatusChecker statusChecker;
+    private ICameraStatusUpdateNotify statusListener;
+    private IInformationReceiver informationReceiver;
+
+    public KodakInterfaceProvider(@NonNull Activity context, @NonNull ICameraStatusReceiver provider, @NonNull ICameraStatusUpdateNotify statusListener, @NonNull IInformationReceiver informationReceiver)
+    {
+        this.activity = context;
+        commandPublisher = new KodakCommandCommunicator(CAMERA_IP, CONTROL_PORT, true, false);
+        liveViewControl = new KodakLiveViewControl(context, CAMERA_IP, LIVEVIEW_PORT);
+        statusChecker = new KodakStatusChecker();
+        canonConnection = new KodakConnection(context, provider, this, statusChecker);
+        cameraInformation = new KodakCameraInformation();
+        zoomControl = new KodakZoomLensControl();
+        this.statusListener = statusListener;
+        this.runmode = new KodakRunMode();
+        this.informationReceiver = informationReceiver;
+    }
+
+    @Override
+    public void injectDisplay(IAutoFocusFrameDisplay frameDisplayer, IIndicatorControl indicator, IFocusingModeNotify focusingModeNotify)
+    {
+        Log.v(TAG, "injectDisplay()");
+        captureControl = new KodakCaptureControl(commandPublisher, frameDisplayer);
+        focusingControl = new KodakFocusingControl(activity, commandPublisher, frameDisplayer, indicator);
+    }
+
+    @Override
+    public ICameraConnection getCameraConnection()
+    {
+        return (canonConnection);
+    }
+
+    @Override
+    public ILiveViewControl getLiveViewControl()
+    {
+        return (liveViewControl);
+    }
+
+    @Override
+    public ILiveViewListener getLiveViewListener()
+    {
+        return (liveViewControl.getLiveViewListener());
+    }
+
+    @Override
+    public IFocusingControl getFocusingControl()
+    {
+        return (focusingControl);
+    }
+
+    @Override
+    public ICameraInformation getCameraInformation()
+    {
+        return (cameraInformation);
+    }
+
+    @Override
+    public IZoomLensControl getZoomLensControl()
+    {
+        return (zoomControl);
+    }
+
+    @Override
+    public ICaptureControl getCaptureControl()
+    {
+        return (captureControl);
+    }
+
+    @Override
+    public IDisplayInjector getDisplayInjector()
+    {
+        return (this);
+    }
+
+    @Override
+    public IKodakRunModeHolder getRunModeHolder()
+    {
+        return (runmode);
+    }
+
+    @Override
+    public IKodakCommandCallback getStatusHolder() {
+        return (statusChecker);
+    }
+
+    @Override
+    public IKodakCommandPublisher getCommandPublisher()
+    {
+        return (commandPublisher);
+    }
+
+    @Override
+    public IKodakCommunication getCommandCommunication() {
+        return (commandPublisher);
+    }
+
+    @Override
+    public ICameraStatusWatcher getCameraStatusWatcher()
+    {
+        return (statusChecker);
+    }
+
+    @Override
+    public ICameraStatusUpdateNotify getStatusListener()
+    {
+        return (statusListener);
+    }
+
+    @Override
+    public ICameraStatus getCameraStatusListHolder()
+    {
+        return (statusChecker);
+    }
+
+    @Override
+    public IInformationReceiver getInformationReceiver()
+    {
+        // ちょっとこの引き回しは気持ちがよくない...
+        return (informationReceiver);
+    }
+
+    @Override
+    public ICameraStatusWatcher getStatusWatcher()
+    {
+        return (statusChecker);
+    }
+}
diff --git a/app/src/main/java/net/osdn/gokigen/a01d/camera/kodak/wrapper/command/IKodakCommand.java b/app/src/main/java/net/osdn/gokigen/a01d/camera/kodak/wrapper/command/IKodakCommand.java
new file mode 100644 (file)
index 0000000..9cfdc92
--- /dev/null
@@ -0,0 +1,30 @@
+package net.osdn.gokigen.a01d.camera.kodak.wrapper.command;
+
+
+public interface IKodakCommand
+{
+    // メッセージの識別子
+    int getId();
+
+    // コマンドの受信待ち時間(単位:ms)
+    int receiveDelayMs();
+
+    // 送信するメッセージボディ
+    byte[] commandBody();
+
+    // 送信するメッセージボディ(連続送信する場合)
+    byte[] commandBody2();
+
+    // 受信待ち再試行回数
+    int maxRetryCount();
+
+    // コマンドの受信が失敗した場合、再送する(再送する場合は true)
+    boolean sendRetry();
+
+    // コマンド送信結果(応答)の通知先
+    IKodakCommandCallback responseCallback();
+
+    // デバッグ用: ログ(logcat)に通信結果を残すかどうか
+    boolean dumpLog();
+
+}
diff --git a/app/src/main/java/net/osdn/gokigen/a01d/camera/kodak/wrapper/command/IKodakCommandCallback.java b/app/src/main/java/net/osdn/gokigen/a01d/camera/kodak/wrapper/command/IKodakCommandCallback.java
new file mode 100644 (file)
index 0000000..cead934
--- /dev/null
@@ -0,0 +1,6 @@
+package net.osdn.gokigen.a01d.camera.kodak.wrapper.command;
+
+public interface IKodakCommandCallback
+{
+    void receivedMessage(int id, byte[] rx_body);
+}
diff --git a/app/src/main/java/net/osdn/gokigen/a01d/camera/kodak/wrapper/command/IKodakCommandPublisher.java b/app/src/main/java/net/osdn/gokigen/a01d/camera/kodak/wrapper/command/IKodakCommandPublisher.java
new file mode 100644 (file)
index 0000000..69fd132
--- /dev/null
@@ -0,0 +1,12 @@
+package net.osdn.gokigen.a01d.camera.kodak.wrapper.command;
+
+import androidx.annotation.NonNull;
+
+public interface IKodakCommandPublisher
+{
+    boolean isConnected();
+    boolean enqueueCommand(@NonNull IKodakCommand command);
+
+    void start();
+    void stop();
+}
diff --git a/app/src/main/java/net/osdn/gokigen/a01d/camera/kodak/wrapper/command/IKodakCommunication.java b/app/src/main/java/net/osdn/gokigen/a01d/camera/kodak/wrapper/command/IKodakCommunication.java
new file mode 100644 (file)
index 0000000..bdf1808
--- /dev/null
@@ -0,0 +1,7 @@
+package net.osdn.gokigen.a01d.camera.kodak.wrapper.command;
+
+public interface IKodakCommunication
+{
+    boolean connect();
+    void disconnect();
+}
diff --git a/app/src/main/java/net/osdn/gokigen/a01d/camera/kodak/wrapper/command/KodakCommandCommunicator.java b/app/src/main/java/net/osdn/gokigen/a01d/camera/kodak/wrapper/command/KodakCommandCommunicator.java
new file mode 100644 (file)
index 0000000..83c3373
--- /dev/null
@@ -0,0 +1,497 @@
+package net.osdn.gokigen.a01d.camera.kodak.wrapper.command;
+
+import android.util.Log;
+
+import androidx.annotation.NonNull;
+
+import net.osdn.gokigen.a01d.camera.kodak.wrapper.command.messages.KodakCommandReceiveOnly;
+
+import java.io.BufferedReader;
+import java.io.ByteArrayOutputStream;
+import java.io.DataOutputStream;
+import java.io.InputStream;
+import java.net.InetSocketAddress;
+import java.net.Socket;
+import java.util.ArrayDeque;
+import java.util.Queue;
+
+import static net.osdn.gokigen.a01d.camera.kodak.wrapper.command.messages.IKodakMessages.SEQ_RECEIVE_ONLY;
+import static net.osdn.gokigen.a01d.camera.utils.SimpleLogDumper.dump_bytes;
+
+public class KodakCommandCommunicator implements IKodakCommandPublisher, IKodakCommunication
+{
+    private static final String TAG = KodakCommandCommunicator.class.getSimpleName();
+
+    private static final int BUFFER_SIZE = 1024 * 1024 + 16;  // 受信バッファは 1MB
+    private static final int COMMAND_SEND_RECEIVE_DURATION_MS = 5;
+    private static final int COMMAND_SEND_RECEIVE_DURATION_MAX = 3000;
+    private static final int COMMAND_POLL_QUEUE_MS = 5;
+
+    private final String ipAddress;
+    private final int portNumber;
+
+    private boolean isStart = false;
+    private boolean tcpNoDelay;
+    private boolean waitForever;
+    private Socket socket = null;
+    private DataOutputStream dos = null;
+    private BufferedReader bufferedReader = null;
+    private Queue<IKodakCommand> commandQueue;
+
+    public KodakCommandCommunicator(@NonNull String ip, int portNumber, boolean tcpNoDelay, boolean waitForever)
+    {
+        this.ipAddress = ip;
+        this.portNumber = portNumber;
+        this.tcpNoDelay = tcpNoDelay;
+        this.waitForever = waitForever;
+        this.commandQueue = new ArrayDeque<>();
+        commandQueue.clear();
+    }
+
+    @Override
+    public boolean isConnected()
+    {
+        return (socket != null);
+    }
+
+    @Override
+    public boolean connect()
+    {
+        try
+        {
+            Log.v(TAG, " connect()");
+            socket = new Socket();
+            socket.setTcpNoDelay(tcpNoDelay);
+            if (tcpNoDelay)
+            {
+                socket.setKeepAlive(false);
+                socket.setPerformancePreferences(0, 2, 0);
+                socket.setOOBInline(true);
+                socket.setReuseAddress(false);
+                socket.setTrafficClass(0x80);
+            }
+            socket.connect(new InetSocketAddress(ipAddress, portNumber), 0);
+            return (true);
+        }
+        catch (Exception e)
+        {
+            e.printStackTrace();
+            socket = null;
+        }
+        return (false);
+    }
+
+    private void closeOutputStream()
+    {
+        try
+        {
+            if (dos != null)
+            {
+                dos.close();
+            }
+        }
+        catch (Exception e)
+        {
+            e.printStackTrace();
+        }
+        dos = null;
+    }
+
+    private void closeBufferedReader()
+    {
+        try
+        {
+            if (bufferedReader != null)
+            {
+                bufferedReader.close();
+            }
+        }
+        catch (Exception e)
+        {
+            e.printStackTrace();
+        }
+        bufferedReader = null;
+    }
+
+    private void closeSocket()
+    {
+        try
+        {
+            if (socket != null)
+            {
+                socket.close();
+            }
+        }
+        catch (Exception e)
+        {
+            e.printStackTrace();
+        }
+        socket = null;
+    }
+
+    @Override
+    public void disconnect()
+    {
+        // 通信関連のクローズ
+        closeOutputStream();
+        closeBufferedReader();
+        closeSocket();
+
+        isStart = false;
+        commandQueue.clear();
+        System.gc();
+    }
+
+    @Override
+    public void start()
+    {
+        if (isStart)
+        {
+            // すでにコマンドのスレッド動作中なので抜ける
+            return;
+        }
+        isStart = true;
+        Log.v(TAG, " start()");
+
+        Thread thread = new Thread(new Runnable()
+        {
+            @Override
+            public void run()
+            {
+                try
+                {
+                    InputStream is = socket.getInputStream();
+                    dos = new DataOutputStream(socket.getOutputStream());
+                    while (isStart)
+                    {
+                        try
+                        {
+                            IKodakCommand command = commandQueue.poll();
+                            if (command != null)
+                            {
+                                issueCommand(command);
+                            }
+                            Thread.sleep(COMMAND_POLL_QUEUE_MS);
+                            if ((is != null)&&(is.available() > 0))
+                            {
+                                receive_from_camera(new KodakCommandReceiveOnly(SEQ_RECEIVE_ONLY, null));
+                            }
+                        }
+                        catch (Exception e)
+                        {
+                            e.printStackTrace();
+                        }
+                    }
+                }
+                catch (Exception e)
+                {
+                    Log.v(TAG, "<<<<< IP : " + ipAddress + " port : " + portNumber + " >>>>>");
+                    e.printStackTrace();
+                }
+            }
+        });
+        try
+        {
+            thread.start();
+        }
+        catch (Exception e)
+        {
+            e.printStackTrace();
+        }
+    }
+
+    @Override
+    public void stop()
+    {
+        isStart = false;
+        commandQueue.clear();
+    }
+
+    @Override
+    public boolean enqueueCommand(@NonNull IKodakCommand command)
+    {
+        try
+        {
+            //Log.v(TAG, "Enqueue : "  + command.getId());
+            return (commandQueue.offer(command));
+        }
+        catch (Exception e)
+        {
+            e.printStackTrace();
+        }
+        return (false);
+    }
+
+    private void issueCommand(@NonNull IKodakCommand command)
+    {
+        try
+        {
+            boolean retry_over = true;
+            while (retry_over)
+            {
+                //Log.v(TAG, "issueCommand : " + command.getId());
+                byte[] commandBody = command.commandBody();
+                if (commandBody != null)
+                {
+                    // コマンドボディが入っていた場合には、コマンド送信(入っていない場合は受信待ち)
+                    send_to_camera(command.dumpLog(), commandBody);
+                    byte[] commandBody2 = command.commandBody2();
+                    if (commandBody2 != null)
+                    {
+                        // コマンドボディの2つめが入っていた場合には、コマンドを連続送信する
+                        send_to_camera(command.dumpLog(), commandBody2);
+                    }
+                }
+                retry_over = receive_from_camera(command);
+                if (retry_over)
+                {
+                    retry_over = command.sendRetry();
+                }
+            }
+        }
+        catch (Exception e)
+        {
+            e.printStackTrace();
+        }
+    }
+
+    /**
+     *    カメラにコマンドを送信する(メイン部分)
+     *
+     */
+    private void send_to_camera(boolean isDumpReceiveLog, @NonNull byte[] byte_array)
+    {
+        try
+        {
+            if (dos == null)
+            {
+                Log.v(TAG, " DataOutputStream is null.");
+                return;
+            }
+
+            if (byte_array.length <= 0)
+            {
+                // メッセージボディがない。終了する
+                Log.v(TAG, " SEND BODY IS NOTHING.");
+                return;
+            }
+
+            if (isDumpReceiveLog)
+            {
+                // ログに送信メッセージを出力する
+                dump_bytes("SEND[" + byte_array.length + "] ", byte_array);
+            }
+
+            // (データを)送信
+            dos.write(byte_array);
+            dos.flush();
+        }
+        catch (Exception e)
+        {
+            e.printStackTrace();
+        }
+    }
+
+    private void sleep(int delayMs)
+    {
+        try
+        {
+            Thread.sleep(delayMs);
+        }
+        catch (Exception e)
+        {
+            e.printStackTrace();
+        }
+    }
+
+    /**
+     *    カメラからにコマンドの結果を受信する(メイン部分)
+     *
+     */
+    private boolean receive_from_camera(@NonNull IKodakCommand command)
+    {
+        int delayMs = command.receiveDelayMs();
+        if ((delayMs < 0)||(delayMs > COMMAND_SEND_RECEIVE_DURATION_MAX))
+        {
+            delayMs = COMMAND_SEND_RECEIVE_DURATION_MS;
+        }
+
+        //  受信した後、すべてをまとめて「受信したよ」と応答するパターン
+        return (receive_single(command, delayMs));
+    }
+
+    private boolean receive_single(@NonNull IKodakCommand command, int delayMs)
+    {
+        boolean isDumpReceiveLog = command.dumpLog();
+        int id = command.getId();
+        IKodakCommandCallback callback = command.responseCallback();
+        try
+        {
+            int receive_message_buffer_size = BUFFER_SIZE;
+            byte[] byte_array = new byte[receive_message_buffer_size];
+            InputStream is = socket.getInputStream();
+            if (is == null)
+            {
+                Log.v(TAG, " InputStream is NULL... RECEIVE ABORTED.");
+                receivedAllMessage(isDumpReceiveLog, id, null, callback);
+                return (false);
+            }
+
+            // 初回データが受信バッファにデータが溜まるまで待つ...
+            int read_bytes = waitForReceive(is, delayMs, command.maxRetryCount());
+            if (read_bytes < 0)
+            {
+                // リトライオーバー検出
+                Log.v(TAG, " DETECT RETRY OVER...");
+                return (true);
+            }
+
+            // 受信したデータをバッファに突っ込む
+            ByteArrayOutputStream byteStream = new ByteArrayOutputStream();
+            while (read_bytes > 0)
+            {
+                read_bytes = is.read(byte_array, 0, receive_message_buffer_size);
+                if (read_bytes <= 0)
+                {
+                    Log.v(TAG, " RECEIVED MESSAGE FINISHED (" + read_bytes + ")");
+                    break;
+                }
+                byteStream.write(byte_array, 0, read_bytes);
+                sleep(delayMs);
+                read_bytes = is.available();
+            }
+            receivedAllMessage(isDumpReceiveLog, id, byteStream.toByteArray(), callback);
+            System.gc();
+        }
+        catch (Throwable e)
+        {
+            e.printStackTrace();
+            System.gc();
+        }
+        return (false);
+    }
+
+    private void receivedAllMessage(boolean isDumpReceiveLog, int id, byte[] body, IKodakCommandCallback callback)
+    {
+        Log.v(TAG, "receivedAllMessage() : " + ((body == null) ? 0 : body.length) + " bytes.");
+        if ((isDumpReceiveLog)&&(body != null))
+        {
+            // ログに受信メッセージを出力する
+            dump_bytes("RECV[" + body.length + "] ", body);
+        }
+        if (checkReceiveStatusMessage(body))
+        {
+            send_secondary_message(body);
+        }
+
+        if (callback != null)
+        {
+            callback.receivedMessage(id, body);
+        }
+    }
+
+    private void send_secondary_message(byte[] received_body)
+    {
+        Log.v(TAG, "send_secondary_message ");
+        try
+        {
+            byte[] message_to_send = null;
+            if ((received_body[8] == (byte) 0xd2)&&(received_body[9] == (byte) 0xd2))
+            {
+                message_to_send = new byte[] {
+                                (byte) 0x2e , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 ,
+                                (byte) 0xd2 , (byte) 0x07 , (byte) 0x00 , (byte) 0x00 , (byte) 0x01 , (byte) 0x10 , (byte) 0x00 , (byte) 0x80 ,
+                                (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x01 , (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 , (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 , (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) 0xff , (byte) 0xff , (byte) 0xff , (byte) 0xff , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 ,
+                };
+            }
+
+            if ((received_body[8] == (byte) 0xba)&&(received_body[9] == (byte) 0x0b))
+            {
+                message_to_send = new byte[]
+                        {
+                                (byte) 0x2e , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 ,
+                                (byte) 0xba , (byte) 0x0b , (byte) 0x00 , (byte) 0x00 , (byte) 0x01 , (byte) 0x10 , (byte) 0x00 , (byte) 0x80 ,
+                                (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x01 , (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 , (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 , (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) 0xff , (byte) 0xff , (byte) 0xff , (byte) 0xff , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 ,
+                        };
+            }
+            if ((dos != null)&&(message_to_send != null))
+            {
+                // (データを)送信
+                dos.write(message_to_send);
+                dos.flush();
+            }
+        }
+        catch (Exception e)
+        {
+            e.printStackTrace();
+        }
+    }
+
+    private boolean checkReceiveStatusMessage(byte[] receive_body)
+    {
+        boolean isReceivedStatusMessage = false;
+        try
+        {
+            if (receive_body.length < 16)
+            {
+                return (isReceivedStatusMessage);
+            }
+            if (((receive_body[8] == (byte) 0xd2)&&(receive_body[9] == (byte) 0xd2))||
+                    ((receive_body[8] == (byte) 0xba)&&(receive_body[9] == (byte) 0x0b)))
+            {
+                isReceivedStatusMessage = true;
+                Log.v(TAG, " RECEIVED HOST PRIMARY MESSAGE.");
+            }
+        }
+        catch (Exception e)
+        {
+            e.printStackTrace();
+        }
+        return (isReceivedStatusMessage);
+    }
+
+    private int waitForReceive(InputStream is, int delayMs, int retry_count)
+    {
+        boolean isLogOutput = true;
+        int read_bytes = 0;
+        try
+        {
+            while (read_bytes <= 0)
+            {
+                Log.v(TAG, "  --- waitForReceive : " + retry_count + " delay : " + delayMs + "ms");
+                sleep(delayMs);
+                read_bytes = is.available();
+                if (read_bytes <= 0)
+                {
+                    if (isLogOutput)
+                    {
+                        Log.v(TAG, "waitForReceive:: is.available() WAIT... : " + delayMs + "ms");
+                        isLogOutput = false;
+                    }
+                    retry_count--;
+                    if ((!waitForever)&&(retry_count < 0))
+                    {
+                        return (-1);
+                    }
+                }
+            }
+        }
+        catch (Exception e)
+        {
+            e.printStackTrace();
+        }
+        return (read_bytes);
+    }
+}
diff --git a/app/src/main/java/net/osdn/gokigen/a01d/camera/kodak/wrapper/command/messages/IKodakMessages.java b/app/src/main/java/net/osdn/gokigen/a01d/camera/kodak/wrapper/command/messages/IKodakMessages.java
new file mode 100644 (file)
index 0000000..aa823ea
--- /dev/null
@@ -0,0 +1,31 @@
+package net.osdn.gokigen.a01d.camera.kodak.wrapper.command.messages;
+
+public interface IKodakMessages
+{
+    int SEQ_DUMMY = 0;
+    int SEQ_RECEIVE_ONLY = 1;
+
+    int SEQ_SHUTTER = 10;
+
+    int SEQ_FLASH_OFF = 20;
+    int SEQ_FLASH_ON = 21;
+    int SEQ_FLASH_AUTO = 22;
+
+
+    int SEQ_CONNECT_01 = 101;
+    int SEQ_CONNECT_02 = 102;
+    int SEQ_CONNECT_03 = 103;
+    int SEQ_CONNECT_04 = 104;
+    int SEQ_CONNECT_05 = 105;
+    int SEQ_CONNECT_06 = 106;
+    int SEQ_CONNECT_07 = 107;
+    int SEQ_CONNECT_08 = 108;
+    int SEQ_CONNECT_09 = 109;
+    int SEQ_CONNECT_10 = 110;
+    int SEQ_CONNECT_11 = 111;
+    int SEQ_CONNECT_12 = 112;
+    int SEQ_CONNECT_13 = 113;
+    int SEQ_CONNECT_14 = 114;
+    int SEQ_CONNECT_15 = 115;
+
+}
diff --git a/app/src/main/java/net/osdn/gokigen/a01d/camera/kodak/wrapper/command/messages/KodakCommandBase.java b/app/src/main/java/net/osdn/gokigen/a01d/camera/kodak/wrapper/command/messages/KodakCommandBase.java
new file mode 100644 (file)
index 0000000..9f48a67
--- /dev/null
@@ -0,0 +1,57 @@
+package net.osdn.gokigen.a01d.camera.kodak.wrapper.command.messages;
+
+import net.osdn.gokigen.a01d.camera.kodak.wrapper.command.IKodakCommand;
+import net.osdn.gokigen.a01d.camera.kodak.wrapper.command.IKodakCommandCallback;
+
+import static net.osdn.gokigen.a01d.camera.kodak.wrapper.command.messages.IKodakMessages.SEQ_DUMMY;
+
+public class KodakCommandBase  implements IKodakCommand
+{
+    @Override
+    public int getId()
+    {
+        return SEQ_DUMMY;
+    }
+
+    @Override
+    public int receiveDelayMs()
+    {
+        return (20);
+    }
+
+    @Override
+    public byte[] commandBody()
+    {
+        return (new byte[0]);
+    }
+
+    @Override
+    public byte[] commandBody2()
+    {
+        return (null);
+    }
+
+    @Override
+    public int maxRetryCount()
+    {
+        return (50);
+    }
+
+    @Override
+    public boolean sendRetry()
+    {
+        return (false);
+    }
+
+    @Override
+    public IKodakCommandCallback responseCallback()
+    {
+        return (null);
+    }
+
+    @Override
+    public boolean dumpLog()
+    {
+        return (true);
+    }
+}
diff --git a/app/src/main/java/net/osdn/gokigen/a01d/camera/kodak/wrapper/command/messages/KodakCommandReceiveOnly.java b/app/src/main/java/net/osdn/gokigen/a01d/camera/kodak/wrapper/command/messages/KodakCommandReceiveOnly.java
new file mode 100644 (file)
index 0000000..00dff3e
--- /dev/null
@@ -0,0 +1,42 @@
+package net.osdn.gokigen.a01d.camera.kodak.wrapper.command.messages;
+
+import androidx.annotation.Nullable;
+
+import net.osdn.gokigen.a01d.camera.kodak.wrapper.command.IKodakCommandCallback;
+
+public class KodakCommandReceiveOnly extends KodakCommandBase
+{
+    private final IKodakCommandCallback callback;
+    private final int id;
+
+    public KodakCommandReceiveOnly(int id, @Nullable IKodakCommandCallback callback)
+    {
+        this.callback = callback;
+        this.id = id;
+    }
+
+    @Override
+    public IKodakCommandCallback responseCallback()
+    {
+        return (callback);
+    }
+
+    @Override
+    public int getId()
+    {
+        return (id);
+    }
+
+    @Override
+    public byte[] commandBody()
+    {
+        return (null);
+    }
+
+    @Override
+    public boolean dumpLog()
+    {
+        return (true);
+    }
+
+}
diff --git a/app/src/main/java/net/osdn/gokigen/a01d/camera/kodak/wrapper/command/messages/connection/KodakConnectSequence01.java b/app/src/main/java/net/osdn/gokigen/a01d/camera/kodak/wrapper/command/messages/connection/KodakConnectSequence01.java
new file mode 100644 (file)
index 0000000..e6c54ba
--- /dev/null
@@ -0,0 +1,48 @@
+package net.osdn.gokigen.a01d.camera.kodak.wrapper.command.messages.connection;
+
+import androidx.annotation.Nullable;
+
+import net.osdn.gokigen.a01d.camera.kodak.wrapper.command.IKodakCommandCallback;
+import net.osdn.gokigen.a01d.camera.kodak.wrapper.command.messages.KodakCommandBase;
+
+import static net.osdn.gokigen.a01d.camera.kodak.wrapper.command.messages.IKodakMessages.SEQ_CONNECT_01;
+
+public class KodakConnectSequence01 extends KodakCommandBase
+{
+    private final IKodakCommandCallback callback;
+
+    public KodakConnectSequence01(@Nullable IKodakCommandCallback callback)
+    {
+        this.callback = callback;
+    }
+
+    @Override
+    public int getId()
+    {
+        return SEQ_CONNECT_01;
+    }
+
+    @Override
+    public byte[] commandBody()
+    {
+        return (new byte[]
+                {
+                        (byte) 0x2e , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x30 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0xe9 , (byte) 0x03 , (byte) 0x00 , (byte) 0x00 , (byte) 0x01 , (byte) 0x00 , (byte) 0x00 , (byte) 0x80 ,
+                        (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x01 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x01 , (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 , (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 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 ,
+                        (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x30 , (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 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x02 , (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 , (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 , (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) 0x01 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0xff , (byte) 0xff , (byte) 0xff , (byte) 0xff , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00
+                });
+    }
+
+    @Override
+    public IKodakCommandCallback responseCallback()
+    {
+        return (this.callback);
+    }
+
+}
diff --git a/app/src/main/java/net/osdn/gokigen/a01d/camera/kodak/wrapper/command/messages/connection/KodakConnectSequence02.java b/app/src/main/java/net/osdn/gokigen/a01d/camera/kodak/wrapper/command/messages/connection/KodakConnectSequence02.java
new file mode 100644 (file)
index 0000000..28f45cd
--- /dev/null
@@ -0,0 +1,54 @@
+package net.osdn.gokigen.a01d.camera.kodak.wrapper.command.messages.connection;
+
+import androidx.annotation.Nullable;
+
+import net.osdn.gokigen.a01d.camera.kodak.wrapper.command.IKodakCommandCallback;
+import net.osdn.gokigen.a01d.camera.kodak.wrapper.command.messages.KodakCommandBase;
+
+import static net.osdn.gokigen.a01d.camera.kodak.wrapper.command.messages.IKodakMessages.SEQ_CONNECT_02;
+
+public class KodakConnectSequence02 extends KodakCommandBase
+{
+    private final IKodakCommandCallback callback;
+
+    public KodakConnectSequence02(@Nullable IKodakCommandCallback callback)
+    {
+        this.callback = callback;
+    }
+
+    @Override
+    public int getId()
+    {
+        return SEQ_CONNECT_02;
+    }
+
+    @Override
+    public byte[] commandBody()
+    {
+        return (new byte[]
+                {
+                        (byte) 0x2e , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x48 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0xd1 , (byte) 0x07 , (byte) 0x00 , (byte) 0x00 , (byte) 0x02 , (byte) 0x10 , (byte) 0x00 , (byte) 0x80 ,
+                        (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x01 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x01 , (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 , (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 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 ,
+                        (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x48 , (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 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x47 , (byte) 0x4F , (byte) 0x4B , (byte) 0x49 , (byte) 0x47 , (byte) 0x45 , (byte) 0x4E , (byte) 0x5F ,
+                        (byte) 0x61 , (byte) 0x30 , (byte) 0x31 , (byte) 0x53 , (byte) 0x65 , (byte) 0x72 , (byte) 0x69 , (byte) 0x65 , (byte) 0x73 , (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 , (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 , (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 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 ,
+                        (byte) 0xff , (byte) 0xff , (byte) 0xff , (byte) 0xff , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 ,
+                        (byte) 0x2e , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0xea , (byte) 0x03 , (byte) 0x00 , (byte) 0x00 , (byte) 0x01 , (byte) 0x00 , (byte) 0x00 , (byte) 0x80 ,
+                        (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x01 , (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 , (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 , (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) 0xff , (byte) 0xff , (byte) 0xff , (byte) 0xff , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00
+                });
+    }
+
+    @Override
+    public IKodakCommandCallback responseCallback()
+    {
+        return (this.callback);
+    }
+}
diff --git a/app/src/main/java/net/osdn/gokigen/a01d/camera/kodak/wrapper/command/messages/connection/KodakConnectSequence03.java b/app/src/main/java/net/osdn/gokigen/a01d/camera/kodak/wrapper/command/messages/connection/KodakConnectSequence03.java
new file mode 100644 (file)
index 0000000..f66a4b7
--- /dev/null
@@ -0,0 +1,43 @@
+package net.osdn.gokigen.a01d.camera.kodak.wrapper.command.messages.connection;
+
+import androidx.annotation.Nullable;
+
+import net.osdn.gokigen.a01d.camera.kodak.wrapper.command.IKodakCommandCallback;
+import net.osdn.gokigen.a01d.camera.kodak.wrapper.command.messages.KodakCommandBase;
+
+import static net.osdn.gokigen.a01d.camera.kodak.wrapper.command.messages.IKodakMessages.SEQ_CONNECT_03;
+
+public class KodakConnectSequence03 extends KodakCommandBase
+{
+    private final IKodakCommandCallback callback;
+
+    public KodakConnectSequence03(@Nullable IKodakCommandCallback callback)
+    {
+        this.callback = callback;
+    }
+
+    @Override
+    public int getId()
+    {
+        return SEQ_CONNECT_03;
+    }
+
+    @Override
+    public byte[] commandBody()
+    {
+        return (new byte[]
+                {
+                        (byte) 0x2e , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0xec , (byte) 0x03 , (byte) 0x00 , (byte) 0x00 , (byte) 0x01 , (byte) 0x00 , (byte) 0x00 , (byte) 0x80 ,
+                        (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x01 , (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 , (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 , (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) 0xff , (byte) 0xff , (byte) 0xff , (byte) 0xff , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00
+                });
+    }
+
+    @Override
+    public IKodakCommandCallback responseCallback()
+    {
+        return (this.callback);
+    }
+}
diff --git a/app/src/main/java/net/osdn/gokigen/a01d/camera/kodak/wrapper/command/messages/connection/KodakConnectSequence04.java b/app/src/main/java/net/osdn/gokigen/a01d/camera/kodak/wrapper/command/messages/connection/KodakConnectSequence04.java
new file mode 100644 (file)
index 0000000..ce7d1d2
--- /dev/null
@@ -0,0 +1,43 @@
+package net.osdn.gokigen.a01d.camera.kodak.wrapper.command.messages.connection;
+
+import androidx.annotation.Nullable;
+
+import net.osdn.gokigen.a01d.camera.kodak.wrapper.command.IKodakCommandCallback;
+import net.osdn.gokigen.a01d.camera.kodak.wrapper.command.messages.KodakCommandBase;
+
+import static net.osdn.gokigen.a01d.camera.kodak.wrapper.command.messages.IKodakMessages.SEQ_CONNECT_04;
+
+public class KodakConnectSequence04 extends KodakCommandBase
+{
+    private final IKodakCommandCallback callback;
+
+    public KodakConnectSequence04(@Nullable IKodakCommandCallback callback)
+    {
+        this.callback = callback;
+    }
+
+    @Override
+    public int getId()
+    {
+        return SEQ_CONNECT_04;
+    }
+
+    @Override
+    public byte[] commandBody()
+    {
+        return (new byte[]
+                {
+                        (byte) 0x2e , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0xfc , (byte) 0x03 , (byte) 0x00 , (byte) 0x00 , (byte) 0x01 , (byte) 0x00 , (byte) 0x00 , (byte) 0x80 ,
+                        (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x01 , (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 , (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 , (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) 0xff , (byte) 0xff , (byte) 0xff , (byte) 0xff , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00
+                });
+    }
+
+    @Override
+    public IKodakCommandCallback responseCallback()
+    {
+        return (this.callback);
+    }
+}
diff --git a/app/src/main/java/net/osdn/gokigen/a01d/camera/kodak/wrapper/command/messages/connection/KodakConnectSequence05.java b/app/src/main/java/net/osdn/gokigen/a01d/camera/kodak/wrapper/command/messages/connection/KodakConnectSequence05.java
new file mode 100644 (file)
index 0000000..3e4e2a9
--- /dev/null
@@ -0,0 +1,59 @@
+package net.osdn.gokigen.a01d.camera.kodak.wrapper.command.messages.connection;
+
+import androidx.annotation.Nullable;
+
+import net.osdn.gokigen.a01d.camera.kodak.wrapper.command.IKodakCommandCallback;
+import net.osdn.gokigen.a01d.camera.kodak.wrapper.command.messages.KodakCommandBase;
+
+import static net.osdn.gokigen.a01d.camera.kodak.wrapper.command.messages.IKodakMessages.SEQ_CONNECT_05;
+
+public class KodakConnectSequence05 extends KodakCommandBase
+{
+    private final IKodakCommandCallback callback;
+
+    public KodakConnectSequence05(@Nullable IKodakCommandCallback callback)
+    {
+        this.callback = callback;
+    }
+
+    @Override
+    public int getId()
+    {
+        return SEQ_CONNECT_05;
+    }
+
+    @Override
+    public byte[] commandBody()
+    {
+        return (new byte[]
+                {
+                        (byte) 0x2e , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0xe4 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0xfe , (byte) 0x03 , (byte) 0x00 , (byte) 0x00 , (byte) 0x01 , (byte) 0x00 , (byte) 0x00 , (byte) 0x80 ,
+                        (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x01 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x01 , (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 , (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 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 ,
+                        (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0xe4 , (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 , (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 , (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 , (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 , (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 ,
+                        (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 , (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 , (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 , (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 , (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 , (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 , (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 , (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 , (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 , (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 , (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 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 ,
+                        (byte) 0xff , (byte) 0xff , (byte) 0xff , (byte) 0xff , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00
+                });
+    }
+
+    @Override
+    public IKodakCommandCallback responseCallback()
+    {
+        return (this.callback);
+    }
+}
diff --git a/app/src/main/java/net/osdn/gokigen/a01d/camera/kodak/wrapper/command/messages/connection/KodakConnectSequence06.java b/app/src/main/java/net/osdn/gokigen/a01d/camera/kodak/wrapper/command/messages/connection/KodakConnectSequence06.java
new file mode 100644 (file)
index 0000000..a85364e
--- /dev/null
@@ -0,0 +1,43 @@
+package net.osdn.gokigen.a01d.camera.kodak.wrapper.command.messages.connection;
+
+import androidx.annotation.Nullable;
+
+import net.osdn.gokigen.a01d.camera.kodak.wrapper.command.IKodakCommandCallback;
+import net.osdn.gokigen.a01d.camera.kodak.wrapper.command.messages.KodakCommandBase;
+
+import static net.osdn.gokigen.a01d.camera.kodak.wrapper.command.messages.IKodakMessages.SEQ_CONNECT_06;
+
+public class KodakConnectSequence06 extends KodakCommandBase
+{
+    private final IKodakCommandCallback callback;
+
+    public KodakConnectSequence06(@Nullable IKodakCommandCallback callback)
+    {
+        this.callback = callback;
+    }
+
+    @Override
+    public int getId()
+    {
+        return SEQ_CONNECT_06;
+    }
+
+    @Override
+    public byte[] commandBody()
+    {
+        return (new byte[]
+                {
+                        (byte) 0x2e , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x05 , (byte) 0x04 , (byte) 0x00 , (byte) 0x00 , (byte) 0x01 , (byte) 0x00 , (byte) 0x00 , (byte) 0x80 ,
+                        (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x01 , (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 , (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 , (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) 0xff , (byte) 0xff , (byte) 0xff , (byte) 0xff , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00
+                });
+    }
+
+    @Override
+    public IKodakCommandCallback responseCallback()
+    {
+        return (this.callback);
+    }
+}
diff --git a/app/src/main/java/net/osdn/gokigen/a01d/camera/kodak/wrapper/command/messages/connection/KodakConnectSequence07.java b/app/src/main/java/net/osdn/gokigen/a01d/camera/kodak/wrapper/command/messages/connection/KodakConnectSequence07.java
new file mode 100644 (file)
index 0000000..ec5d2a7
--- /dev/null
@@ -0,0 +1,45 @@
+package net.osdn.gokigen.a01d.camera.kodak.wrapper.command.messages.connection;
+
+import androidx.annotation.Nullable;
+
+import net.osdn.gokigen.a01d.camera.kodak.wrapper.command.IKodakCommandCallback;
+import net.osdn.gokigen.a01d.camera.kodak.wrapper.command.messages.KodakCommandBase;
+
+import static net.osdn.gokigen.a01d.camera.kodak.wrapper.command.messages.IKodakMessages.SEQ_CONNECT_07;
+
+public class KodakConnectSequence07 extends KodakCommandBase
+{
+    private final IKodakCommandCallback callback;
+
+    public KodakConnectSequence07(@Nullable IKodakCommandCallback callback)
+    {
+        this.callback = callback;
+    }
+
+    @Override
+    public int getId()
+    {
+        return SEQ_CONNECT_07;
+    }
+
+    @Override
+    public byte[] commandBody()
+    {
+        return (new byte[]
+                {
+                        (byte) 0x2e , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x08 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0xeb , (byte) 0x03 , (byte) 0x00 , (byte) 0x00 , (byte) 0x01 , (byte) 0x00 , (byte) 0x00 , (byte) 0x80 ,
+                        (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x01 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x01 , (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 , (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 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 ,
+                        (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x08 , (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 , (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) 0xff , (byte) 0xff , (byte) 0xff , (byte) 0xff , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00
+                });
+    }
+
+    @Override
+    public IKodakCommandCallback responseCallback()
+    {
+        return (this.callback);
+    }
+}
diff --git a/app/src/main/java/net/osdn/gokigen/a01d/camera/kodak/wrapper/command/messages/connection/KodakConnectSequence08.java b/app/src/main/java/net/osdn/gokigen/a01d/camera/kodak/wrapper/command/messages/connection/KodakConnectSequence08.java
new file mode 100644 (file)
index 0000000..ad1f8f3
--- /dev/null
@@ -0,0 +1,47 @@
+package net.osdn.gokigen.a01d.camera.kodak.wrapper.command.messages.connection;
+
+import androidx.annotation.Nullable;
+
+import net.osdn.gokigen.a01d.camera.kodak.wrapper.command.IKodakCommandCallback;
+import net.osdn.gokigen.a01d.camera.kodak.wrapper.command.messages.KodakCommandBase;
+
+import static net.osdn.gokigen.a01d.camera.kodak.wrapper.command.messages.IKodakMessages.SEQ_CONNECT_08;
+
+public class KodakConnectSequence08 extends KodakCommandBase
+{
+    private final IKodakCommandCallback callback;
+
+    public KodakConnectSequence08(@Nullable IKodakCommandCallback callback)
+    {
+        this.callback = callback;
+    }
+
+    @Override
+    public int getId()
+    {
+        return SEQ_CONNECT_08;
+    }
+
+    @Override
+    public byte[] commandBody()
+    {
+        return (new byte[]
+                {
+                        (byte) 0x2e , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x30 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0xe9 , (byte) 0x03 , (byte) 0x00 , (byte) 0x00 , (byte) 0x01 , (byte) 0x00 , (byte) 0x00 , (byte) 0x80 ,
+                        (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x01 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x01 , (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 , (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 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 ,
+                        (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x30 , (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 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x08 , (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 , (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 , (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) 0x03 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0xff , (byte) 0xff , (byte) 0xff , (byte) 0xff , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00
+                });
+    }
+
+    @Override
+    public IKodakCommandCallback responseCallback()
+    {
+        return (this.callback);
+    }
+}
diff --git a/app/src/main/java/net/osdn/gokigen/a01d/camera/kodak/wrapper/command/messages/connection/KodakConnectSequence09.java b/app/src/main/java/net/osdn/gokigen/a01d/camera/kodak/wrapper/command/messages/connection/KodakConnectSequence09.java
new file mode 100644 (file)
index 0000000..0a6af37
--- /dev/null
@@ -0,0 +1,43 @@
+package net.osdn.gokigen.a01d.camera.kodak.wrapper.command.messages.connection;
+
+import androidx.annotation.Nullable;
+
+import net.osdn.gokigen.a01d.camera.kodak.wrapper.command.IKodakCommandCallback;
+import net.osdn.gokigen.a01d.camera.kodak.wrapper.command.messages.KodakCommandBase;
+
+import static net.osdn.gokigen.a01d.camera.kodak.wrapper.command.messages.IKodakMessages.SEQ_CONNECT_09;
+
+public class KodakConnectSequence09 extends KodakCommandBase
+{
+    private final IKodakCommandCallback callback;
+
+    public KodakConnectSequence09(@Nullable IKodakCommandCallback callback)
+    {
+        this.callback = callback;
+    }
+
+    @Override
+    public int getId()
+    {
+        return SEQ_CONNECT_09;
+    }
+
+    @Override
+    public byte[] commandBody()
+    {
+        return (new byte[]
+                {
+                        (byte) 0x2e , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0xf1 , (byte) 0x03 , (byte) 0x00 , (byte) 0x00 , (byte) 0x01 , (byte) 0x00 , (byte) 0x00 , (byte) 0x80 ,
+                        (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x01 , (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 , (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 , (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) 0xff , (byte) 0xff , (byte) 0xff , (byte) 0xff , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00
+                });
+    }
+
+    @Override
+    public IKodakCommandCallback responseCallback()
+    {
+        return (this.callback);
+    }
+}
diff --git a/app/src/main/java/net/osdn/gokigen/a01d/camera/kodak/wrapper/command/messages/connection/KodakConnectSequence10.java b/app/src/main/java/net/osdn/gokigen/a01d/camera/kodak/wrapper/command/messages/connection/KodakConnectSequence10.java
new file mode 100644 (file)
index 0000000..262a02c
--- /dev/null
@@ -0,0 +1,43 @@
+package net.osdn.gokigen.a01d.camera.kodak.wrapper.command.messages.connection;
+
+import androidx.annotation.Nullable;
+
+import net.osdn.gokigen.a01d.camera.kodak.wrapper.command.IKodakCommandCallback;
+import net.osdn.gokigen.a01d.camera.kodak.wrapper.command.messages.KodakCommandBase;
+
+import static net.osdn.gokigen.a01d.camera.kodak.wrapper.command.messages.IKodakMessages.SEQ_CONNECT_10;
+
+public class KodakConnectSequence10 extends KodakCommandBase
+{
+    private final IKodakCommandCallback callback;
+
+    public KodakConnectSequence10(@Nullable IKodakCommandCallback callback)
+    {
+        this.callback = callback;
+    }
+
+    @Override
+    public int getId()
+    {
+        return SEQ_CONNECT_10;
+    }
+
+    @Override
+    public byte[] commandBody()
+    {
+        return (new byte[]
+                {
+                        (byte) 0x2e , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0xba , (byte) 0x0b , (byte) 0x00 , (byte) 0x00 , (byte) 0x01 , (byte) 0x10 , (byte) 0x00 , (byte) 0x80 ,
+                        (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x01 , (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 , (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 , (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) 0xff , (byte) 0xff , (byte) 0xff , (byte) 0xff , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00
+                });
+    }
+
+    @Override
+    public IKodakCommandCallback responseCallback()
+    {
+        return (this.callback);
+    }
+}
diff --git a/app/src/main/java/net/osdn/gokigen/a01d/camera/kodak/wrapper/command/messages/connection/KodakConnectSequence11.java b/app/src/main/java/net/osdn/gokigen/a01d/camera/kodak/wrapper/command/messages/connection/KodakConnectSequence11.java
new file mode 100644 (file)
index 0000000..92ac0aa
--- /dev/null
@@ -0,0 +1,47 @@
+package net.osdn.gokigen.a01d.camera.kodak.wrapper.command.messages.connection;
+
+import androidx.annotation.Nullable;
+
+import net.osdn.gokigen.a01d.camera.kodak.wrapper.command.IKodakCommandCallback;
+import net.osdn.gokigen.a01d.camera.kodak.wrapper.command.messages.KodakCommandBase;
+
+import static net.osdn.gokigen.a01d.camera.kodak.wrapper.command.messages.IKodakMessages.SEQ_CONNECT_11;
+
+public class KodakConnectSequence11 extends KodakCommandBase
+{
+    private final IKodakCommandCallback callback;
+
+    public KodakConnectSequence11(@Nullable IKodakCommandCallback callback)
+    {
+        this.callback = callback;
+    }
+
+    @Override
+    public int getId()
+    {
+        return SEQ_CONNECT_11;
+    }
+
+    @Override
+    public byte[] commandBody()
+    {
+        return (new byte[]
+                {
+                        (byte) 0x2e , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x20 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0xed , (byte) 0x03 , (byte) 0x00 , (byte) 0x00 , (byte) 0x01 , (byte) 0x00 , (byte) 0x00 , (byte) 0x80 ,
+                        (byte) 0x12 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x01 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x01 , (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 , (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 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 ,
+                        (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x20 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x12 , (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 , (byte) 0x69 , (byte) 0x08 , (byte) 0x00 , (byte) 0x00 , (byte) 0x69 , (byte) 0x08 , (byte) 0x00 , (byte) 0x00 ,
+                        (byte) 0x01 , (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 ,
+                        (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 ,
+                        (byte) 0xff , (byte) 0xff , (byte) 0xff , (byte) 0xff , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00
+                });
+    }
+
+    @Override
+    public IKodakCommandCallback responseCallback()
+    {
+        return (this.callback);
+    }
+}
diff --git a/app/src/main/java/net/osdn/gokigen/a01d/camera/kodak/wrapper/command/messages/connection/KodakConnectSequence12.java b/app/src/main/java/net/osdn/gokigen/a01d/camera/kodak/wrapper/command/messages/connection/KodakConnectSequence12.java
new file mode 100644 (file)
index 0000000..43ef0c1
--- /dev/null
@@ -0,0 +1,43 @@
+package net.osdn.gokigen.a01d.camera.kodak.wrapper.command.messages.connection;
+
+import androidx.annotation.Nullable;
+
+import net.osdn.gokigen.a01d.camera.kodak.wrapper.command.IKodakCommandCallback;
+import net.osdn.gokigen.a01d.camera.kodak.wrapper.command.messages.KodakCommandBase;
+
+import static net.osdn.gokigen.a01d.camera.kodak.wrapper.command.messages.IKodakMessages.SEQ_CONNECT_12;
+
+public class KodakConnectSequence12 extends KodakCommandBase
+{
+    private final IKodakCommandCallback callback;
+
+    public KodakConnectSequence12(@Nullable IKodakCommandCallback callback)
+    {
+        this.callback = callback;
+    }
+
+    @Override
+    public int getId()
+    {
+        return SEQ_CONNECT_12;
+    }
+
+    @Override
+    public byte[] commandBody()
+    {
+        return (new byte[]
+                {
+                        (byte) 0x2e , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0xec , (byte) 0x03 , (byte) 0x00 , (byte) 0x00 , (byte) 0x01 , (byte) 0x00 , (byte) 0x00 , (byte) 0x80 ,
+                        (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x01 , (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 , (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 , (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) 0xff , (byte) 0xff , (byte) 0xff , (byte) 0xff , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00
+                });
+    }
+
+    @Override
+    public IKodakCommandCallback responseCallback()
+    {
+        return (this.callback);
+    }
+}
diff --git a/app/src/main/java/net/osdn/gokigen/a01d/camera/kodak/wrapper/command/messages/connection/KodakConnectSequence13.java b/app/src/main/java/net/osdn/gokigen/a01d/camera/kodak/wrapper/command/messages/connection/KodakConnectSequence13.java
new file mode 100644 (file)
index 0000000..3078cd3
--- /dev/null
@@ -0,0 +1,43 @@
+package net.osdn.gokigen.a01d.camera.kodak.wrapper.command.messages.connection;
+
+import androidx.annotation.Nullable;
+
+import net.osdn.gokigen.a01d.camera.kodak.wrapper.command.IKodakCommandCallback;
+import net.osdn.gokigen.a01d.camera.kodak.wrapper.command.messages.KodakCommandBase;
+
+import static net.osdn.gokigen.a01d.camera.kodak.wrapper.command.messages.IKodakMessages.SEQ_CONNECT_13;
+
+public class KodakConnectSequence13 extends KodakCommandBase
+{
+    private final IKodakCommandCallback callback;
+
+    public KodakConnectSequence13(@Nullable IKodakCommandCallback callback)
+    {
+        this.callback = callback;
+    }
+
+    @Override
+    public int getId()
+    {
+        return SEQ_CONNECT_13;
+    }
+
+    @Override
+    public byte[] commandBody()
+    {
+        return (new byte[]
+                {
+                        (byte) 0x2e , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0xba , (byte) 0x0b , (byte) 0x00 , (byte) 0x00 , (byte) 0x01 , (byte) 0x10 , (byte) 0x00 , (byte) 0x80 ,
+                        (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x01 , (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 , (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 , (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) 0xff , (byte) 0xff , (byte) 0xff , (byte) 0xff , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00
+                });
+    }
+
+    @Override
+    public IKodakCommandCallback responseCallback()
+    {
+        return (this.callback);
+    }
+}
diff --git a/app/src/main/java/net/osdn/gokigen/a01d/camera/kodak/wrapper/command/messages/specific/KodakExecuteShutter.java b/app/src/main/java/net/osdn/gokigen/a01d/camera/kodak/wrapper/command/messages/specific/KodakExecuteShutter.java
new file mode 100644 (file)
index 0000000..9d74353
--- /dev/null
@@ -0,0 +1,59 @@
+package net.osdn.gokigen.a01d.camera.kodak.wrapper.command.messages.specific;
+
+import androidx.annotation.Nullable;
+
+import net.osdn.gokigen.a01d.camera.kodak.wrapper.command.IKodakCommandCallback;
+import net.osdn.gokigen.a01d.camera.kodak.wrapper.command.messages.KodakCommandBase;
+
+import static net.osdn.gokigen.a01d.camera.kodak.wrapper.command.messages.IKodakMessages.SEQ_SHUTTER;
+
+public class KodakExecuteShutter extends KodakCommandBase
+{
+    private final IKodakCommandCallback callback;
+
+    public KodakExecuteShutter(@Nullable IKodakCommandCallback callback)
+    {
+        this.callback = callback;
+    }
+
+    @Override
+    public int getId()
+    {
+        return SEQ_SHUTTER;
+    }
+
+    @Override
+    public byte[] commandBody()
+    {
+        return (new byte[]
+                {
+                        //  (byte) 0xf9, (byte) 0x03
+                        (byte) 0x2e , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x30 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0xf9 , (byte) 0x03 , (byte) 0x00 , (byte) 0x00 , (byte) 0x03 , (byte) 0x00 , (byte) 0x00 , (byte) 0x80 ,
+                        (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x01 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x02 , (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 , (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 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 ,
+                        (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x08 , (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 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x08 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x28 , (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 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 ,
+                        (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x01 , (byte) 0x20 , (byte) 0x00 , (byte) 0x90 , (byte) 0x01 , (byte) 0xff , (byte) 0xff , (byte) 0xff , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 ,
+                        (byte) 0x01 , (byte) 0xff , (byte) 0xff , (byte) 0xff , (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 , (byte) 0x00 , (byte) 0xbf , (byte) 0x4d , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x01 , (byte) 0x88 , (byte) 0x65 , (byte) 0xb6 ,
+                        (byte) 0xff , (byte) 0xff , (byte) 0xff , (byte) 0xff , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 ,
+
+                        // (byte) 0xef, (byte) 0x03
+                        (byte) 0x2e , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x08 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0xef , (byte) 0x03 , (byte) 0x00 , (byte) 0x00 , (byte) 0x01 , (byte) 0x00 , (byte) 0x00 , (byte) 0x80 ,
+                        (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x01 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x01 , (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 , (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 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 ,
+                        (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x08 , (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 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x02 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 ,
+                        (byte) 0xff , (byte) 0xff , (byte) 0xff , (byte) 0xff , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00
+                });
+    }
+
+    @Override
+    public IKodakCommandCallback responseCallback()
+    {
+        return (this.callback);
+    }
+}
diff --git a/app/src/main/java/net/osdn/gokigen/a01d/camera/kodak/wrapper/command/messages/specific/KodakFlashAuto.java b/app/src/main/java/net/osdn/gokigen/a01d/camera/kodak/wrapper/command/messages/specific/KodakFlashAuto.java
new file mode 100644 (file)
index 0000000..3b0d194
--- /dev/null
@@ -0,0 +1,47 @@
+package net.osdn.gokigen.a01d.camera.kodak.wrapper.command.messages.specific;
+
+import androidx.annotation.Nullable;
+
+import net.osdn.gokigen.a01d.camera.kodak.wrapper.command.IKodakCommandCallback;
+import net.osdn.gokigen.a01d.camera.kodak.wrapper.command.messages.KodakCommandBase;
+
+import static net.osdn.gokigen.a01d.camera.kodak.wrapper.command.messages.IKodakMessages.SEQ_FLASH_AUTO;
+
+public class KodakFlashAuto extends KodakCommandBase
+{
+    private final IKodakCommandCallback callback;
+
+    public KodakFlashAuto(@Nullable IKodakCommandCallback callback)
+    {
+        this.callback = callback;
+    }
+
+    @Override
+    public int getId()
+    {
+        return SEQ_FLASH_AUTO;
+    }
+
+    @Override
+    public byte[] commandBody()
+    {
+        return (new byte[]
+                {
+                        (byte) 0x2e , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x20 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0xed , (byte) 0x03 , (byte) 0x00 , (byte) 0x00 , (byte) 0x01 , (byte) 0x00 , (byte) 0x00 , (byte) 0x80 ,
+                        (byte) 0x09 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x01 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x01 , (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 , (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 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 ,
+                        (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x20 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x09 , (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 , (byte) 0x07 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x07 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 ,
+                        (byte) 0x02 , (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 ,
+                        (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 ,
+                        (byte) 0xff , (byte) 0xff , (byte) 0xff , (byte) 0xff , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00
+                });
+    }
+
+    @Override
+    public IKodakCommandCallback responseCallback()
+    {
+        return (this.callback);
+    }
+}
diff --git a/app/src/main/java/net/osdn/gokigen/a01d/camera/kodak/wrapper/command/messages/specific/KodakFlashOff.java b/app/src/main/java/net/osdn/gokigen/a01d/camera/kodak/wrapper/command/messages/specific/KodakFlashOff.java
new file mode 100644 (file)
index 0000000..667984f
--- /dev/null
@@ -0,0 +1,47 @@
+package net.osdn.gokigen.a01d.camera.kodak.wrapper.command.messages.specific;
+
+import androidx.annotation.Nullable;
+
+import net.osdn.gokigen.a01d.camera.kodak.wrapper.command.IKodakCommandCallback;
+import net.osdn.gokigen.a01d.camera.kodak.wrapper.command.messages.KodakCommandBase;
+
+import static net.osdn.gokigen.a01d.camera.kodak.wrapper.command.messages.IKodakMessages.SEQ_FLASH_OFF;
+
+public class KodakFlashOff extends KodakCommandBase
+{
+    private final IKodakCommandCallback callback;
+
+    public KodakFlashOff(@Nullable IKodakCommandCallback callback)
+    {
+        this.callback = callback;
+    }
+
+    @Override
+    public int getId()
+    {
+        return SEQ_FLASH_OFF;
+    }
+
+    @Override
+    public byte[] commandBody()
+    {
+        return (new byte[]
+                {
+                        (byte) 0x2e , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x20 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0xed , (byte) 0x03 , (byte) 0x00 , (byte) 0x00 , (byte) 0x01 , (byte) 0x00 , (byte) 0x00 , (byte) 0x80 ,
+                        (byte) 0x09 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x01 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x01 , (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 , (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 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 ,
+                        (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x20 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x09 , (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 , (byte) 0x07 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x07 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 ,
+                        (byte) 0x01 , (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 ,
+                        (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 ,
+                        (byte) 0xff , (byte) 0xff , (byte) 0xff , (byte) 0xff , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00
+                });
+    }
+
+    @Override
+    public IKodakCommandCallback responseCallback()
+    {
+        return (this.callback);
+    }
+}
diff --git a/app/src/main/java/net/osdn/gokigen/a01d/camera/kodak/wrapper/command/messages/specific/KodakFlashOn.java b/app/src/main/java/net/osdn/gokigen/a01d/camera/kodak/wrapper/command/messages/specific/KodakFlashOn.java
new file mode 100644 (file)
index 0000000..92fe578
--- /dev/null
@@ -0,0 +1,47 @@
+package net.osdn.gokigen.a01d.camera.kodak.wrapper.command.messages.specific;
+
+import androidx.annotation.Nullable;
+
+import net.osdn.gokigen.a01d.camera.kodak.wrapper.command.IKodakCommandCallback;
+import net.osdn.gokigen.a01d.camera.kodak.wrapper.command.messages.KodakCommandBase;
+
+import static net.osdn.gokigen.a01d.camera.kodak.wrapper.command.messages.IKodakMessages.SEQ_FLASH_ON;
+
+public class KodakFlashOn extends KodakCommandBase
+{
+    private final IKodakCommandCallback callback;
+
+    public KodakFlashOn(@Nullable IKodakCommandCallback callback)
+    {
+        this.callback = callback;
+    }
+
+    @Override
+    public int getId()
+    {
+        return SEQ_FLASH_ON;
+    }
+
+    @Override
+    public byte[] commandBody()
+    {
+        return (new byte[]
+                {
+                        (byte) 0x2e , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x20 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0xed , (byte) 0x03 , (byte) 0x00 , (byte) 0x00 , (byte) 0x01 , (byte) 0x00 , (byte) 0x00 , (byte) 0x80 ,
+                        (byte) 0x09 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x01 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x01 , (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 , (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 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 ,
+                        (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x20 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x09 , (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 , (byte) 0x07 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x07 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 ,
+                        (byte) 0x04 , (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 ,
+                        (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 ,
+                        (byte) 0xff , (byte) 0xff , (byte) 0xff , (byte) 0xff , (byte) 0x00 , (byte) 0x00 , (byte) 0x00 , (byte) 0x00
+                });
+    }
+
+    @Override
+    public IKodakCommandCallback responseCallback()
+    {
+        return (this.callback);
+    }
+}
diff --git a/app/src/main/java/net/osdn/gokigen/a01d/camera/kodak/wrapper/connection/KodakCameraConnectSequence.java b/app/src/main/java/net/osdn/gokigen/a01d/camera/kodak/wrapper/connection/KodakCameraConnectSequence.java
new file mode 100644 (file)
index 0000000..19069a7
--- /dev/null
@@ -0,0 +1,222 @@
+package net.osdn.gokigen.a01d.camera.kodak.wrapper.connection;
+
+import android.app.Activity;
+import android.graphics.Color;
+import android.util.Log;
+
+import androidx.annotation.NonNull;
+
+import net.osdn.gokigen.a01d.R;
+import net.osdn.gokigen.a01d.camera.ICameraConnection;
+import net.osdn.gokigen.a01d.camera.ICameraStatusReceiver;
+import net.osdn.gokigen.a01d.camera.kodak.IKodakInterfaceProvider;
+import net.osdn.gokigen.a01d.camera.kodak.wrapper.command.IKodakCommandCallback;
+import net.osdn.gokigen.a01d.camera.kodak.wrapper.command.IKodakCommandPublisher;
+import net.osdn.gokigen.a01d.camera.kodak.wrapper.command.messages.IKodakMessages;
+import net.osdn.gokigen.a01d.camera.kodak.wrapper.command.messages.connection.KodakConnectSequence01;
+import net.osdn.gokigen.a01d.camera.kodak.wrapper.command.messages.connection.KodakConnectSequence02;
+import net.osdn.gokigen.a01d.camera.kodak.wrapper.command.messages.connection.KodakConnectSequence03;
+import net.osdn.gokigen.a01d.camera.kodak.wrapper.command.messages.connection.KodakConnectSequence04;
+import net.osdn.gokigen.a01d.camera.kodak.wrapper.command.messages.connection.KodakConnectSequence05;
+import net.osdn.gokigen.a01d.camera.kodak.wrapper.command.messages.connection.KodakConnectSequence06;
+import net.osdn.gokigen.a01d.camera.kodak.wrapper.command.messages.connection.KodakConnectSequence07;
+import net.osdn.gokigen.a01d.camera.kodak.wrapper.command.messages.connection.KodakConnectSequence08;
+import net.osdn.gokigen.a01d.camera.kodak.wrapper.command.messages.connection.KodakConnectSequence09;
+import net.osdn.gokigen.a01d.camera.kodak.wrapper.command.messages.connection.KodakConnectSequence10;
+import net.osdn.gokigen.a01d.camera.kodak.wrapper.command.messages.connection.KodakConnectSequence11;
+import net.osdn.gokigen.a01d.camera.kodak.wrapper.command.messages.connection.KodakConnectSequence12;
+import net.osdn.gokigen.a01d.camera.kodak.wrapper.command.messages.connection.KodakConnectSequence13;
+import net.osdn.gokigen.a01d.camera.kodak.wrapper.command.messages.specific.KodakFlashOff;
+import net.osdn.gokigen.a01d.camera.kodak.wrapper.status.KodakStatusChecker;
+
+public class KodakCameraConnectSequence implements Runnable, IKodakCommandCallback, IKodakMessages
+{
+    private final String TAG = this.toString();
+
+    private final Activity context;
+    private final ICameraConnection cameraConnection;
+    private final ICameraStatusReceiver cameraStatusReceiver;
+    private final IKodakInterfaceProvider interfaceProvider;
+    private final IKodakCommandPublisher commandIssuer;
+    private final KodakStatusChecker statusChecker;
+
+    KodakCameraConnectSequence(@NonNull Activity context, @NonNull ICameraStatusReceiver statusReceiver, @NonNull final ICameraConnection cameraConnection, @NonNull IKodakInterfaceProvider interfaceProvider, @NonNull KodakStatusChecker statusChecker)
+    {
+        Log.v(TAG, " KodakCameraConnectSequence");
+        this.context = context;
+        this.cameraConnection = cameraConnection;
+        this.cameraStatusReceiver = statusReceiver;
+        this.interfaceProvider = interfaceProvider;
+        this.commandIssuer = interfaceProvider.getCommandPublisher();
+        this.statusChecker = statusChecker;
+    }
+
+    @Override
+    public void run()
+    {
+        try
+        {
+            // カメラとTCP接続
+            IKodakCommandPublisher issuer = interfaceProvider.getCommandPublisher();
+            if (!issuer.isConnected())
+            {
+                if (!interfaceProvider.getCommandCommunication().connect())
+                {
+                    // 接続失敗...
+                    interfaceProvider.getInformationReceiver().updateMessage(context.getString(R.string.dialog_title_connect_failed_kodak), false, true, Color.RED);
+                    onConnectError(context.getString(R.string.dialog_title_connect_failed_kodak));
+                    return;
+                }
+            }
+            else
+            {
+                Log.v(TAG, "SOCKET IS ALREADY CONNECTED...");
+            }
+            // コマンドタスクの実行開始
+            issuer.start();
+
+            // 接続シーケンスの開始
+            startConnectSequence();
+
+        }
+        catch (Exception e)
+        {
+            e.printStackTrace();
+            interfaceProvider.getInformationReceiver().updateMessage(context.getString(R.string.dialog_title_connect_failed_kodak), false, true, Color.RED);
+            onConnectError(e.getLocalizedMessage());
+        }
+    }
+
+    private void onConnectError(String reason)
+    {
+        cameraConnection.alertConnectingFailed(reason);
+    }
+
+    @Override
+    public void receivedMessage(int id, byte[] rx_body)
+    {
+        switch (id)
+        {
+            case SEQ_CONNECT_01:
+                interfaceProvider.getInformationReceiver().updateMessage(context.getString(R.string.kodak_connect_connecting1), false, false, 0);
+                commandIssuer.enqueueCommand(new KodakConnectSequence02(this));
+                break;
+
+            case SEQ_CONNECT_02:
+                interfaceProvider.getInformationReceiver().updateMessage(context.getString(R.string.kodak_connect_connecting2), false, false, 0);
+                commandIssuer.enqueueCommand(new KodakConnectSequence03(this));
+                break;
+
+            case SEQ_CONNECT_03:
+                interfaceProvider.getInformationReceiver().updateMessage(context.getString(R.string.kodak_connect_connecting3), false, false, 0);
+                commandIssuer.enqueueCommand(new KodakConnectSequence04(this));
+                break;
+            case SEQ_CONNECT_04:
+                interfaceProvider.getInformationReceiver().updateMessage(context.getString(R.string.kodak_connect_connecting4), false, false, 0);
+                commandIssuer.enqueueCommand(new KodakConnectSequence05(this));
+                break;
+            case SEQ_CONNECT_05:
+                interfaceProvider.getInformationReceiver().updateMessage(context.getString(R.string.kodak_connect_connecting5), false, false, 0);
+                commandIssuer.enqueueCommand(new KodakConnectSequence06(this));
+                break;
+            case SEQ_CONNECT_06:
+                interfaceProvider.getInformationReceiver().updateMessage(context.getString(R.string.kodak_connect_connecting6), false, false, 0);
+                commandIssuer.enqueueCommand(new KodakConnectSequence07(this));
+                break;
+            case SEQ_CONNECT_07:
+                interfaceProvider.getInformationReceiver().updateMessage(context.getString(R.string.kodak_connect_connecting7), false, false, 0);
+                commandIssuer.enqueueCommand(new KodakConnectSequence08(this));
+                break;
+            case SEQ_CONNECT_08:
+                interfaceProvider.getInformationReceiver().updateMessage(context.getString(R.string.kodak_connect_connecting8), false, false, 0);
+                commandIssuer.enqueueCommand(new KodakConnectSequence09(this));
+                break;
+            case SEQ_CONNECT_09:
+                interfaceProvider.getInformationReceiver().updateMessage(context.getString(R.string.kodak_connect_connecting9), false, false, 0);
+                commandIssuer.enqueueCommand(new KodakConnectSequence10(this));
+                break;
+            case SEQ_CONNECT_10:
+                interfaceProvider.getInformationReceiver().updateMessage(context.getString(R.string.kodak_connect_connecting10), false, false, 0);
+                commandIssuer.enqueueCommand(new KodakConnectSequence11(this));
+                break;
+            case SEQ_CONNECT_11:
+                interfaceProvider.getInformationReceiver().updateMessage(context.getString(R.string.kodak_connect_connecting11), false, false, 0);
+                commandIssuer.enqueueCommand(new KodakConnectSequence12(this));
+                break;
+            //case SEQ_CONNECT_12:
+            //    interfaceProvider.getInformationReceiver().updateMessage(context.getString(R.string.kodak_connect_connecting12), false, false, 0);
+            //    commandIssuer.enqueueCommand(new KodakConnectSequence13(this));
+            //    break;
+            case SEQ_CONNECT_12:
+            case SEQ_CONNECT_13:
+                interfaceProvider.getInformationReceiver().updateMessage(context.getString(R.string.kodak_connect_flash), false, false, 0);
+                commandIssuer.enqueueCommand(new KodakFlashOff(this));
+                break;
+            case SEQ_FLASH_AUTO:
+            case SEQ_FLASH_OFF:
+            case SEQ_FLASH_ON:
+                interfaceProvider.getInformationReceiver().updateMessage(context.getString(R.string.connect_connect_finished), false, false, 0);
+                connectFinished();
+                Log.v(TAG, "  CONNECT TO CAMERA : DONE.");
+                break;
+            default:
+                Log.v(TAG, " RECEIVED UNKNOWN ID : " + id);
+                onConnectError(context.getString(R.string.connect_receive_unknown_message));
+                break;
+        }
+    }
+
+    private void startConnectSequence()
+    {
+        interfaceProvider.getInformationReceiver().updateMessage(context.getString(R.string.connect_start), false, false, 0);
+        cameraStatusReceiver.onStatusNotify(context.getString(R.string.connect_start));
+        commandIssuer.enqueueCommand(new KodakConnectSequence01(this));
+    }
+
+    private void connectFinished()
+    {
+        try
+        {
+            // 接続成功のメッセージを出す
+            interfaceProvider.getInformationReceiver().updateMessage(context.getString(R.string.connect_connected), false, false, 0);
+
+            // ちょっと待つ
+            Thread.sleep(1000);
+
+            //interfaceProvider.getAsyncEventCommunication().connect();
+            //interfaceProvider.getCameraStatusWatcher().startStatusWatch(interfaceProvider.getStatusListener());  ステータスの定期確認は実施しない
+
+            // 接続成功!のメッセージを出す
+            interfaceProvider.getInformationReceiver().updateMessage(context.getString(R.string.connect_connected), false, false, 0);
+
+            onConnectNotify();
+        }
+        catch (Exception e)
+        {
+            e.printStackTrace();
+        }
+    }
+
+    private void onConnectNotify()
+    {
+        try
+        {
+            final Thread thread = new Thread(new Runnable()
+            {
+                @Override
+                public void run()
+                {
+                    // カメラとの接続確立を通知する
+                    cameraStatusReceiver.onStatusNotify(context.getString(R.string.connect_connected));
+                    cameraStatusReceiver.onCameraConnected();
+                    Log.v(TAG, " onConnectNotify()");
+                }
+            });
+            thread.start();
+        }
+        catch (Exception e)
+        {
+            e.printStackTrace();
+        }
+    }
+}
diff --git a/app/src/main/java/net/osdn/gokigen/a01d/camera/kodak/wrapper/connection/KodakCameraDisconnectSequence.java b/app/src/main/java/net/osdn/gokigen/a01d/camera/kodak/wrapper/connection/KodakCameraDisconnectSequence.java
new file mode 100644 (file)
index 0000000..b4e88a3
--- /dev/null
@@ -0,0 +1,34 @@
+package net.osdn.gokigen.a01d.camera.kodak.wrapper.connection;
+
+import androidx.annotation.NonNull;
+
+import net.osdn.gokigen.a01d.camera.kodak.IKodakInterfaceProvider;
+import net.osdn.gokigen.a01d.camera.kodak.wrapper.command.IKodakCommunication;
+import net.osdn.gokigen.a01d.camera.kodak.wrapper.status.KodakStatusChecker;
+
+class KodakCameraDisconnectSequence implements Runnable
+{
+    private final String TAG = this.toString();
+    private final IKodakCommunication command;
+    private final KodakStatusChecker statusChecker;
+
+    KodakCameraDisconnectSequence(@NonNull IKodakInterfaceProvider interfaceProvider, @NonNull KodakStatusChecker statusChecker)
+    {
+        this.command = interfaceProvider.getCommandCommunication();
+        this.statusChecker = statusChecker;
+    }
+
+    @Override
+    public void run()
+    {
+        try
+        {
+            statusChecker.stopStatusWatch();
+            command.disconnect();
+        }
+        catch (Exception e)
+        {
+            e.printStackTrace();
+        }
+    }
+}
diff --git a/app/src/main/java/net/osdn/gokigen/a01d/camera/kodak/wrapper/connection/KodakConnection.java b/app/src/main/java/net/osdn/gokigen/a01d/camera/kodak/wrapper/connection/KodakConnection.java
new file mode 100644 (file)
index 0000000..af6e6bf
--- /dev/null
@@ -0,0 +1,257 @@
+package net.osdn.gokigen.a01d.camera.kodak.wrapper.connection;
+
+
+import android.app.Activity;
+import android.content.BroadcastReceiver;
+import android.content.Context;
+import android.content.DialogInterface;
+import android.content.Intent;
+import android.content.IntentFilter;
+import android.net.ConnectivityManager;
+import android.net.wifi.WifiInfo;
+import android.net.wifi.WifiManager;
+import android.provider.Settings;
+import android.util.Log;
+
+import androidx.annotation.NonNull;
+import androidx.appcompat.app.AlertDialog;
+
+import net.osdn.gokigen.a01d.R;
+import net.osdn.gokigen.a01d.camera.ICameraConnection;
+import net.osdn.gokigen.a01d.camera.ICameraStatusReceiver;
+import net.osdn.gokigen.a01d.camera.kodak.IKodakInterfaceProvider;
+import net.osdn.gokigen.a01d.camera.kodak.wrapper.status.KodakStatusChecker;
+
+import java.util.concurrent.Executor;
+import java.util.concurrent.Executors;
+
+
+public class KodakConnection implements ICameraConnection
+{
+    private final String TAG = toString();
+    private final Activity context;
+    private final ICameraStatusReceiver statusReceiver;
+    private final IKodakInterfaceProvider interfaceProvider;
+    private final BroadcastReceiver connectionReceiver;
+    private final Executor cameraExecutor = Executors.newFixedThreadPool(1);
+
+    private ICameraConnection.CameraConnectionStatus connectionStatus = CameraConnectionStatus.UNKNOWN;
+
+    private final KodakCameraConnectSequence connectSequence;
+    private final KodakCameraDisconnectSequence disconnectSequence;
+
+    /**
+     *
+     *
+     */
+    public KodakConnection(@NonNull final Activity context, @NonNull final ICameraStatusReceiver statusReceiver, @NonNull IKodakInterfaceProvider interfaceProvider, @NonNull KodakStatusChecker statusChecker)
+    {
+        Log.v(TAG, "KodakConnection()");
+        this.context = context;
+        this.statusReceiver = statusReceiver;
+        this.interfaceProvider = interfaceProvider;
+        connectionReceiver = new BroadcastReceiver()
+        {
+            @Override
+            public void onReceive(Context context, Intent intent)
+            {
+                onReceiveBroadcastOfConnection(context, intent);
+            }
+        };
+        connectSequence = new KodakCameraConnectSequence(context, statusReceiver, this, interfaceProvider, statusChecker);
+        disconnectSequence = new KodakCameraDisconnectSequence(interfaceProvider, statusChecker);
+    }
+
+    /**
+     *
+     *
+     */
+    private void onReceiveBroadcastOfConnection(Context context, Intent intent)
+    {
+        interfaceProvider.getInformationReceiver().updateMessage(context.getString(R.string.connect_check_wifi), false, false, 0);
+        statusReceiver.onStatusNotify(context.getString(R.string.connect_check_wifi));
+
+        Log.v(TAG, context.getString(R.string.connect_check_wifi));
+
+        String action = intent.getAction();
+        if (action == null)
+        {
+            Log.v(TAG, "intent.getAction() : null");
+            return;
+        }
+
+        try
+        {
+            if (action.equals(ConnectivityManager.CONNECTIVITY_ACTION))
+            {
+                Log.v(TAG, "onReceiveBroadcastOfConnection() : CONNECTIVITY_ACTION");
+
+                WifiManager wifiManager = (WifiManager) context.getApplicationContext().getSystemService(Context.WIFI_SERVICE);
+                if (wifiManager != null)
+                {
+                    WifiInfo info = wifiManager.getConnectionInfo();
+                    if (wifiManager.isWifiEnabled() && info != null)
+                    {
+                        if (info.getNetworkId() != -1)
+                        {
+                            Log.v(TAG, "Network ID is -1, there is no currently connected network.");
+                        }
+                        // 自動接続が指示されていた場合は、カメラとの接続処理を行う
+                        connectToCamera();
+                    } else {
+                        if (info == null) {
+                            Log.v(TAG, "NETWORK INFO IS NULL.");
+                        } else {
+                            Log.v(TAG, "isWifiEnabled : " + wifiManager.isWifiEnabled() + " NetworkId : " + info.getNetworkId());
+                        }
+                    }
+                }
+            }
+        }
+        catch (Exception e)
+        {
+            Log.w(TAG, "onReceiveBroadcastOfConnection() EXCEPTION" + e.getMessage());
+            e.printStackTrace();
+        }
+    }
+
+    @Override
+    public void startWatchWifiStatus(Context context)
+    {
+        Log.v(TAG, "startWatchWifiStatus()");
+        try
+        {
+            interfaceProvider.getInformationReceiver().updateMessage(context.getString(R.string.connect_prepare), false, false, 0);
+            statusReceiver.onStatusNotify("prepare");
+
+            IntentFilter filter = new IntentFilter();
+            filter.addAction(WifiManager.NETWORK_STATE_CHANGED_ACTION);
+            filter.addAction(ConnectivityManager.CONNECTIVITY_ACTION);
+            context.registerReceiver(connectionReceiver, filter);
+        }
+        catch (Exception e)
+        {
+            e.printStackTrace();
+        }
+    }
+
+    @Override
+    public void stopWatchWifiStatus(@NonNull Context context)
+    {
+        Log.v(TAG, "stopWatchWifiStatus()");
+        context.unregisterReceiver(connectionReceiver);
+        disconnect(false);
+    }
+
+    @Override
+    public void disconnect(boolean powerOff)
+    {
+        Log.v(TAG, "disconnect()");
+        disconnectFromCamera(powerOff);
+        connectionStatus = CameraConnectionStatus.DISCONNECTED;
+        statusReceiver.onCameraDisconnected();
+    }
+
+    @Override
+    public void connect()
+    {
+        Log.v(TAG, "connect()");
+        connectToCamera();
+    }
+
+    @Override
+    public void alertConnectingFailed(String message)
+    {
+        Log.v(TAG, "alertConnectingFailed() : " + message);
+        final AlertDialog.Builder builder = new AlertDialog.Builder(context)
+                .setTitle(context.getString(R.string.dialog_title_connect_failed_kodak))
+                .setMessage(message)
+                .setPositiveButton(context.getString(R.string.dialog_title_button_retry), new DialogInterface.OnClickListener() {
+                    @Override
+                    public void onClick(DialogInterface dialog, int which)
+                    {
+                        disconnect(false);
+                        connect();
+                    }
+                })
+                .setNeutralButton(R.string.dialog_title_button_network_settings, new DialogInterface.OnClickListener() {
+                    @Override
+                    public void onClick(DialogInterface dialog, int which)
+                    {
+                        try
+                        {
+                            // Wifi 設定画面を表示する
+                            context.startActivity(new Intent(Settings.ACTION_WIFI_SETTINGS));
+                        }
+                        catch (android.content.ActivityNotFoundException ex)
+                        {
+                            // Activity が存在しなかった...設定画面が起動できなかった
+                            Log.v(TAG, "android.content.ActivityNotFoundException...");
+
+                            // この場合は、再試行と等価な動きとする
+                            connect();
+                        }
+                        catch (Exception e)
+                        {
+                            e.printStackTrace();
+                        }
+                    }
+                });
+        context.runOnUiThread(new Runnable()
+        {
+            @Override
+            public void run()
+            {
+                builder.show();
+            }
+        });
+    }
+
+    @Override
+    public CameraConnectionStatus getConnectionStatus()
+    {
+        Log.v(TAG, " getConnectionStatus()");
+        return (connectionStatus);
+    }
+
+    @Override
+    public void forceUpdateConnectionStatus(CameraConnectionStatus status)
+    {
+        Log.v(TAG, " forceUpdateConnectionStatus()");
+        connectionStatus = status;
+    }
+
+    /**
+     * カメラとの切断処理
+     */
+    private void disconnectFromCamera(final boolean powerOff)
+    {
+        Log.v(TAG, " disconnectFromCamera() : " + powerOff);
+        try
+        {
+            cameraExecutor.execute(disconnectSequence);
+        }
+        catch (Exception e)
+        {
+            e.printStackTrace();
+        }
+    }
+
+    /**
+     * カメラとの接続処理
+     */
+    private void connectToCamera()
+    {
+        Log.v(TAG, " connectToCamera()");
+        connectionStatus = CameraConnectionStatus.CONNECTING;
+        try
+        {
+            cameraExecutor.execute(connectSequence);
+        }
+        catch (Exception e)
+        {
+            Log.v(TAG, " connectToCamera() EXCEPTION : " + e.getMessage());
+            e.printStackTrace();
+        }
+    }
+}
diff --git a/app/src/main/java/net/osdn/gokigen/a01d/camera/kodak/wrapper/hardware/KodakCameraInformation.java b/app/src/main/java/net/osdn/gokigen/a01d/camera/kodak/wrapper/hardware/KodakCameraInformation.java
new file mode 100644 (file)
index 0000000..58e3d6c
--- /dev/null
@@ -0,0 +1,25 @@
+package net.osdn.gokigen.a01d.camera.kodak.wrapper.hardware;
+
+import net.osdn.gokigen.a01d.camera.ICameraInformation;
+
+public class KodakCameraInformation implements ICameraInformation
+{
+
+    @Override
+    public boolean isManualFocus()
+    {
+        return false;
+    }
+
+    @Override
+    public boolean isElectricZoomLens()
+    {
+        return false;
+    }
+
+    @Override
+    public boolean isExposureLocked()
+    {
+        return false;
+    }
+}
diff --git a/app/src/main/java/net/osdn/gokigen/a01d/camera/kodak/wrapper/liveview/KodakLiveViewControl.java b/app/src/main/java/net/osdn/gokigen/a01d/camera/kodak/wrapper/liveview/KodakLiveViewControl.java
new file mode 100644 (file)
index 0000000..e1b7bcc
--- /dev/null
@@ -0,0 +1,223 @@
+package net.osdn.gokigen.a01d.camera.kodak.wrapper.liveview;
+
+
+import android.content.Context;
+import android.util.Log;
+
+import androidx.annotation.NonNull;
+
+import net.osdn.gokigen.a01d.camera.ILiveViewControl;
+import net.osdn.gokigen.a01d.camera.utils.SimpleLiveviewSlicer;
+import net.osdn.gokigen.a01d.liveview.liveviewlistener.CameraLiveViewListenerImpl;
+import net.osdn.gokigen.a01d.liveview.liveviewlistener.ILiveViewListener;
+
+public class KodakLiveViewControl  implements ILiveViewControl
+{
+    private final String TAG = this.toString();
+    private final Context context;
+    private final CameraLiveViewListenerImpl liveViewListener;
+    private final String liveViewUrl; // "http://172.16.0.254:9176";
+    private boolean whileFetching = false;
+    private float cropScale = 1.0f;
+    private static final int FETCH_ERROR_MAX = 30;
+
+    /**
+     *
+     *
+     */
+    public KodakLiveViewControl(final Context context, @NonNull String camera_ip, int liveview_port)
+    {
+        this.context = context;
+        this.liveViewUrl = "http://" + camera_ip + ":" + liveview_port + "/";
+        prepare();
+        liveViewListener = new CameraLiveViewListenerImpl();
+    }
+
+    /**
+     *
+     *
+     */
+    private void prepare()
+    {
+        try
+        {
+            //SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(context);
+            //mirrorMode = preferences.getBoolean(IPreferencePropertyAccessor.GR2_LIVE_VIEW, true);
+        }
+        catch (Exception e)
+        {
+            e.printStackTrace();
+        }
+    }
+
+    @Override
+    public void changeLiveViewSize(String size)
+    {
+        //
+
+    }
+
+    @Override
+    public void startLiveView()
+    {
+        Log.v(TAG, "startLiveView()");
+        //prepare();
+        try
+        {
+            Thread thread = new Thread(new Runnable()
+            {
+                @Override
+                public void run()
+                {
+                    try
+                    {
+                        start(liveViewUrl);
+                    }
+                    catch (Exception e)
+                    {
+                        e.printStackTrace();
+                    }
+                }
+            });
+            thread.start();
+        }
+        catch (Exception e)
+        {
+            e.printStackTrace();
+        }
+
+    }
+
+    @Override
+    public void stopLiveView()
+    {
+
+    }
+
+    private void start(@NonNull final String streamUrl)
+    {
+        if (whileFetching)
+        {
+            Log.v(TAG, "start() already starting.");
+        }
+        whileFetching = true;
+
+        // A thread for retrieving liveview data from server.
+        try
+        {
+            Thread thread = new Thread(new Runnable()
+            {
+                @Override
+                public void run()
+                {
+                    Log.d(TAG, "Starting retrieving streaming data from server.");
+                    SimpleLiveviewSlicer slicer = null;
+                    int continuousNullDataReceived = 0;
+                    try
+                    {
+                        // Create Slicer to open the stream and parse it.
+                        slicer = new SimpleLiveviewSlicer();
+                        slicer.open(streamUrl);
+
+                        while (whileFetching)
+                        {
+                            final SimpleLiveviewSlicer.Payload payload = slicer.nextPayloadForMotionJpeg();
+                            if (payload == null)
+                            {
+                                //Log.v(TAG, "Liveview Payload is null.");
+                                continuousNullDataReceived++;
+                                if (continuousNullDataReceived > FETCH_ERROR_MAX)
+                                {
+                                    Log.d(TAG, " FETCH ERROR MAX OVER ");
+                                    break;
+                                }
+                                continue;
+                            }
+                            //if (mJpegQueue.size() == 2)
+                            //{
+                            //    mJpegQueue.remove();
+                            //}
+                            //mJpegQueue.add(payload.getJpegData());
+                            liveViewListener.onUpdateLiveView(payload.getJpegData(), null);
+                            continuousNullDataReceived = 0;
+                        }
+                    }
+                    catch (Exception e)
+                    {
+                        e.printStackTrace();
+                    }
+                    finally
+                    {
+                        try
+                        {
+                            if (slicer != null)
+                            {
+                                slicer.close();
+                            }
+                        }
+                        catch (Exception e)
+                        {
+                            e.printStackTrace();
+                        }
+                        //mJpegQueue.clear();
+                        if ((!whileFetching)&&(continuousNullDataReceived > FETCH_ERROR_MAX))
+                        {
+                            // 再度ライブビューのスタートをやってみる。
+                            whileFetching = false;
+                            //continuousNullDataReceived = 0;
+                            start(streamUrl);
+                        }
+                    }
+                }
+            });
+            thread.start();
+        }
+        catch (Exception e)
+        {
+            e.printStackTrace();
+        }
+    }
+
+
+    @Override
+    public void updateDigitalZoom()
+    {
+        //
+    }
+
+    /**
+     *   デジタルズーム倍率の設定値を応答する
+     *
+     */
+    @Override
+    public float getDigitalZoomScale()
+    {
+        return (1.0f);
+    }
+
+    /**
+     *   クロップサイズを変更する
+     *
+     */
+    @Override
+    public void updateMagnifyingLiveViewScale(final boolean isChangeScale)
+    {
+        //
+    }
+
+    /**
+     *   ライブビュー拡大倍率の設定値を応答する
+     *
+     */
+    @Override
+    public float getMagnifyingLiveViewScale()
+    {
+        return (cropScale);
+    }
+
+    public ILiveViewListener getLiveViewListener()
+    {
+        return (liveViewListener);
+    }
+
+}
diff --git a/app/src/main/java/net/osdn/gokigen/a01d/camera/kodak/wrapper/status/IKodakRunModeHolder.java b/app/src/main/java/net/osdn/gokigen/a01d/camera/kodak/wrapper/status/IKodakRunModeHolder.java
new file mode 100644 (file)
index 0000000..c6991c1
--- /dev/null
@@ -0,0 +1,7 @@
+package net.osdn.gokigen.a01d.camera.kodak.wrapper.status;
+
+public interface IKodakRunModeHolder
+{
+    void transitToRecordingMode(boolean isFinished);
+    void transitToPlaybackMode(boolean isFinished);
+}
diff --git a/app/src/main/java/net/osdn/gokigen/a01d/camera/kodak/wrapper/status/KodakRunMode.java b/app/src/main/java/net/osdn/gokigen/a01d/camera/kodak/wrapper/status/KodakRunMode.java
new file mode 100644 (file)
index 0000000..3ec5190
--- /dev/null
@@ -0,0 +1,21 @@
+package net.osdn.gokigen.a01d.camera.kodak.wrapper.status;
+
+public class KodakRunMode implements IKodakRunModeHolder
+{
+    public KodakRunMode()
+    {
+
+    }
+
+    @Override
+    public void transitToRecordingMode(boolean isFinished)
+    {
+
+    }
+
+    @Override
+    public void transitToPlaybackMode(boolean isFinished)
+    {
+
+    }
+}
diff --git a/app/src/main/java/net/osdn/gokigen/a01d/camera/kodak/wrapper/status/KodakStatusChecker.java b/app/src/main/java/net/osdn/gokigen/a01d/camera/kodak/wrapper/status/KodakStatusChecker.java
new file mode 100644 (file)
index 0000000..a7cdacd
--- /dev/null
@@ -0,0 +1,102 @@
+package net.osdn.gokigen.a01d.camera.kodak.wrapper.status;
+
+import android.util.Log;
+
+import androidx.annotation.NonNull;
+
+import net.osdn.gokigen.a01d.camera.ICameraStatus;
+import net.osdn.gokigen.a01d.camera.ICameraStatusWatcher;
+import net.osdn.gokigen.a01d.camera.kodak.wrapper.command.IKodakCommandCallback;
+import net.osdn.gokigen.a01d.liveview.ICameraStatusUpdateNotify;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class KodakStatusChecker implements IKodakCommandCallback, ICameraStatusWatcher, ICameraStatus
+{
+    private final String TAG = toString();
+    private KodakStatusHolder statusHolder;
+    private boolean whileFetching = false;
+    private ICameraStatusUpdateNotify notifier = null;
+
+    public KodakStatusChecker()
+    {
+        this.statusHolder = new KodakStatusHolder();
+    }
+
+
+    @Override
+    public List<String> getStatusList(String key)
+    {
+        try
+        {
+            if (statusHolder == null)
+            {
+                return (new ArrayList<>());
+            }
+            return (statusHolder.getAvailableItemList(key));
+        }
+        catch (Exception e)
+        {
+            e.printStackTrace();
+        }
+        return (new ArrayList<>());
+    }
+
+    @Override
+    public String getStatus(String key)
+    {
+        try
+        {
+            if (statusHolder == null)
+            {
+                return ("");
+            }
+            return (statusHolder.getItemStatus(key));
+        }
+        catch (Exception e)
+        {
+            e.printStackTrace();
+        }
+        return ("");
+    }
+
+    @Override
+    public void setStatus(String key, String value)
+    {
+        Log.v(TAG, "setStatus(" + key + ", " + value + ")");
+    }
+
+    @Override
+    public void startStatusWatch(@NonNull ICameraStatusUpdateNotify notifier)
+    {
+        if (whileFetching)
+        {
+            Log.v(TAG, "startStatusWatch() already starting.");
+            return;
+        }
+        try
+        {
+            this.notifier = notifier;
+            whileFetching = true;
+        }
+        catch (Exception e)
+        {
+            e.printStackTrace();
+        }
+    }
+
+    @Override
+    public void stopStatusWatch()
+    {
+        Log.v(TAG, "stoptStatusWatch()");
+        whileFetching = false;
+        this.notifier = null;
+    }
+
+    @Override
+    public void receivedMessage(int id, byte[] rx_body)
+    {
+
+    }
+}
diff --git a/app/src/main/java/net/osdn/gokigen/a01d/camera/kodak/wrapper/status/KodakStatusHolder.java b/app/src/main/java/net/osdn/gokigen/a01d/camera/kodak/wrapper/status/KodakStatusHolder.java
new file mode 100644 (file)
index 0000000..b1cba8e
--- /dev/null
@@ -0,0 +1,206 @@
+package net.osdn.gokigen.a01d.camera.kodak.wrapper.status;
+
+import android.util.Log;
+import android.util.SparseIntArray;
+
+import androidx.annotation.NonNull;
+import androidx.collection.SparseArrayCompat;
+
+import net.osdn.gokigen.a01d.liveview.ICameraStatusUpdateNotify;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Locale;
+
+class KodakStatusHolder
+{
+    private final String TAG = toString();
+    private SparseIntArray statusHolder;
+    private SparseArrayCompat<String> statusNameArray;
+
+    KodakStatusHolder()
+    {
+        statusHolder = new SparseIntArray();
+        statusHolder.clear();
+
+        statusNameArray = new SparseArrayCompat<>();
+        prepareStatusNameArray();
+    }
+
+    private void prepareStatusNameArray()
+    {
+/*
+        statusNameArray.clear();
+        statusNameArray.append(BATTERY_LEVEL, BATTERY_LEVEL_STR);
+        statusNameArray.append(WHITE_BALANCE, WHITE_BALANCE_STR);
+        statusNameArray.append(APERTURE, APERTURE_STR);
+        statusNameArray.append(FOCUS_MODE, FOCUS_MODE_STR);
+        statusNameArray.append(SHOOTING_MODE, SHOOTING_MODE_STR);
+        statusNameArray.append(FLASH, FLASH_STR);
+        statusNameArray.append(EXPOSURE_COMPENSATION, EXPOSURE_COMPENSATION_STR);
+        statusNameArray.append(SELF_TIMER, SELF_TIMER_STR);
+        statusNameArray.append(FILM_SIMULATION, FILM_SIMULATION_STR);
+        statusNameArray.append(IMAGE_FORMAT, IMAGE_FORMAT_STR);
+        statusNameArray.append(RECMODE_ENABLE, RECMODE_ENABLE_STR);
+        statusNameArray.append(F_SS_CONTROL, F_SS_CONTROL_STR);
+        statusNameArray.append(ISO, ISO_STR);
+        statusNameArray.append(MOVIE_ISO, MOVIE_ISO_STR);
+        statusNameArray.append(FOCUS_POINT, FOCUS_POINT_STR);
+        statusNameArray.append(DEVICE_ERROR, DEVICE_ERROR_STR);
+        statusNameArray.append(IMAGE_FILE_COUNT, IMAGE_FILE_COUNT_STR);
+        statusNameArray.append(SDCARD_REMAIN_SIZE, SDCARD_REMAIN_SIZE_STR);
+        statusNameArray.append(FOCUS_LOCK, FOCUS_LOCK_STR);
+        statusNameArray.append(MOVIE_REMAINING_TIME, MOVIE_REMAINING_TIME_STR);
+        statusNameArray.append(SHUTTER_SPEED, SHUTTER_SPEED_STR);
+        statusNameArray.append(IMAGE_ASPECT,IMAGE_ASPECT_STR);
+        statusNameArray.append(BATTERY_LEVEL_2, BATTERY_LEVEL_2_STR);
+
+        statusNameArray.append(UNKNOWN_DF00, UNKNOWN_DF00_STR);
+        statusNameArray.append(PICTURE_JPEG_COUNT, PICTURE_JPEG_COUNT_STR);
+        statusNameArray.append(UNKNOWN_D400, UNKNOWN_D400_STR);
+        statusNameArray.append(UNKNOWN_D401, UNKNOWN_D401_STR);
+        statusNameArray.append(UNKNOWN_D52F, UNKNOWN_D52F_STR);
+*/
+    }
+
+
+    void updateValue(ICameraStatusUpdateNotify notifier, int id, byte data0, byte data1, byte data2, byte data3)
+    {
+        try
+        {
+            int value = ((((int) data3) & 0xff) << 24) + ((((int) data2) & 0xff) << 16) + ((((int) data1) & 0xff) << 8) + (((int) data0) & 0xff);
+            int currentValue = statusHolder.get(id, -1);
+            Log.v(TAG, "STATUS  ID: " + id + "  value : " + value + " (" + currentValue + ")");
+            statusHolder.put(id, value);
+            if (currentValue != value)
+            {
+                //Log.v(TAG, "STATUS  ID: " + id + " value : " + currentValue + " -> " + value);
+                if (notifier != null)
+                {
+                    updateDetected(notifier, id, currentValue, value);
+                }
+            }
+        }
+        catch (Exception e)
+        {
+            e.printStackTrace();
+        }
+    }
+
+    private void updateDetected(@NonNull ICameraStatusUpdateNotify notifier, int id, int previous, int current)
+    {
+        try
+        {
+            String idName = statusNameArray.get(id, "Unknown");
+            Log.v(TAG, String.format(Locale.US,"<< UPDATE STATUS >> id: 0x%04x[%s] 0x%08x(%d) -> 0x%08x(%d)", id, idName, previous, previous, current, current));
+            //Log.v(TAG, "updateDetected(ID: " + id + " [" + idName + "] " + previous + " -> " + current + " )");
+/*
+            if (id == FOCUS_LOCK)
+            {
+                if (current == 1)
+                {
+                    // focus Lock
+                    notifier.updateFocusedStatus(true, true);
+                }
+                else
+                {
+                    // focus unlock
+                    notifier.updateFocusedStatus(false, false);
+                }
+            }
+*/
+        }
+        catch (Exception e)
+        {
+            e.printStackTrace();
+        }
+    }
+
+    /**
+     *   認識したカメラのステータス名称のリストを応答する
+     *
+     */
+    private List<String> getAvailableStatusNameList()
+    {
+        ArrayList<String> selection = new ArrayList<>();
+        try
+        {
+            for (int index = 0; index < statusHolder.size(); index++)
+            {
+                int key = statusHolder.keyAt(index);
+                selection.add(statusNameArray.get(key, String.format(Locale.US, "0x%04x", key)));
+            }
+        }
+        catch (Exception e)
+        {
+            e.printStackTrace();
+        }
+        return (selection);
+
+    }
+
+    List<String> getAvailableItemList(String listKey)
+    {
+        if (listKey == null)
+        {
+            // アイテム名の一覧を応答する
+            return (getAvailableStatusNameList());
+        }
+
+        /////  選択可能なステータスの一覧を取得する : でも以下はアイテム名の一覧... /////
+        ArrayList<String> selection = new ArrayList<>();
+        try
+        {
+            for (int index = 0; index < statusHolder.size(); index++)
+            {
+                int key = statusHolder.keyAt(index);
+                selection.add(statusNameArray.get(key));
+            }
+        }
+        catch (Exception e)
+        {
+            e.printStackTrace();
+        }
+        return (selection);
+    }
+
+    String getItemStatus(String key)
+    {
+        try
+        {
+            int strIndex = key.indexOf("x");
+            Log.v(TAG, "getItemStatus() : " + key + " [" + strIndex + "]");
+            if (strIndex >= 1)
+            {
+                key = key.substring(strIndex + 1);
+                try
+                {
+                    int id = Integer.parseInt(key, 16);
+                    int value = statusHolder.get(id);
+                    Log.v(TAG, "getItemStatus() value : " + value);
+                    return (value + "");
+                }
+                catch (Exception e)
+                {
+                    e.printStackTrace();
+                }
+            }
+
+            for (int index = 0; index < statusNameArray.size(); index++)
+            {
+                int id = statusNameArray.keyAt(index);
+                String strKey = statusNameArray.valueAt(index);
+                if (key.contentEquals(strKey))
+                {
+                    int value = statusHolder.get(id);
+                    return (value + "");
+                }
+            }
+        }
+        catch (Exception e)
+        {
+            e.printStackTrace();
+        }
+        return ("? [" + key + "]");
+    }
+}
index 4fb5196..fb37502 100644 (file)
@@ -124,6 +124,15 @@ class LiveViewClickTouchListener implements View.OnClickListener, View.OnTouchLi
             this.cameraConnection = interfaceProvider.getNikonInterface().getCameraConnection();
             this.zoomLensControl = interfaceProvider.getNikonInterface().getZoomLensControl();
         }
+        else if (connectionMethod == ICameraConnection.CameraConnectionMethod.KODAK)
+        {
+            this.focusingControl = interfaceProvider.getKodakInterface().getFocusingControl();
+            this.captureControl = interfaceProvider.getKodakInterface().getCaptureControl();
+            this.propertyProvider = interfaceProvider.getOlympusInterface().getCameraPropertyProvider();  // 要変更
+            this.cameraInformation = interfaceProvider.getKodakInterface().getCameraInformation();
+            this.cameraConnection = interfaceProvider.getKodakInterface().getCameraConnection();
+            this.zoomLensControl = interfaceProvider.getKodakInterface().getZoomLensControl();
+        }
         else  // if (connectionMethod == ICameraConnection.CameraConnectionMethod.OPC)
         {
             this.focusingControl = interfaceProvider.getOlympusInterface().getFocusingControl();
index 4133409..9f0290d 100644 (file)
@@ -343,6 +343,23 @@ public class LiveViewFragment extends Fragment implements IStatusViewDrawer, IFo
                     if (propertyButton != null) {
                         propertyButton.setOnClickListener(onClickTouchListener);
                     }
+                } else if (connectionMethod == ICameraConnection.CameraConnectionMethod.KODAK) {
+                    if (favoriteButton != null) {
+                        favoriteButton.setVisibility(View.VISIBLE);
+                        favoriteButton.setOnClickListener(onClickTouchListener);
+                    }
+                    if (manualFocus != null) {
+                        manualFocus.setVisibility(View.INVISIBLE);
+                    }
+                    if (changeLiveViewScale != null) {
+                        changeLiveViewScale.setVisibility(View.INVISIBLE);
+                    }
+                    if (focusIndicator != null) {
+                        focusIndicator.setVisibility(View.VISIBLE);
+                    }
+                    if (propertyButton != null) {
+                        propertyButton.setOnClickListener(onClickTouchListener);
+                    }
                 }
             }
             if (manualFocus != null) {
@@ -439,6 +456,10 @@ public class LiveViewFragment extends Fragment implements IStatusViewDrawer, IFo
         {
             interfaceInjector = interfaceProvider.getNikonInterface().getDisplayInjector();
         }
+        else if (connectionMethod == ICameraConnection.CameraConnectionMethod.KODAK)
+        {
+            interfaceInjector = interfaceProvider.getKodakInterface().getDisplayInjector();
+        }
         else // if (connectionMethod == ICameraConnection.CameraConnectionMethod.OPC)
         {
             interfaceInjector = interfaceProvider.getOlympusInterface().getDisplayInjector();
@@ -495,6 +516,12 @@ public class LiveViewFragment extends Fragment implements IStatusViewDrawer, IFo
             this.zoomLensControl = interfaceProvider.getNikonInterface().getZoomLensControl();
             this.cameraInformation = interfaceProvider.getNikonInterface().getCameraInformation();
         }
+        else  if (connectionMethod == ICameraConnection.CameraConnectionMethod.KODAK)
+        {
+            this.liveViewControl = interfaceProvider.getKodakInterface().getLiveViewControl();
+            this.zoomLensControl = interfaceProvider.getKodakInterface().getZoomLensControl();
+            this.cameraInformation = interfaceProvider.getKodakInterface().getCameraInformation();
+        }
         else //  if (connectionMethod == ICameraConnection.CameraConnectionMethod.OPC)
         {
             this.liveViewControl = interfaceProvider.getOlympusInterface().getLiveViewControl();
@@ -809,6 +836,10 @@ public class LiveViewFragment extends Fragment implements IStatusViewDrawer, IFo
             {
                 lvListener = interfaceProvider.getNikonInterface().getLiveViewListener();
             }
+            else if (connectionMethod == ICameraConnection.CameraConnectionMethod.KODAK)
+            {
+                lvListener = interfaceProvider.getKodakInterface().getLiveViewListener();
+            }
             else  // if (connectionMethod == ICameraConnection.CameraConnectionMethod.OPC)
             {
                 interfaceProvider.getOlympusLiveViewListener().setOlympusLiveViewListener(liveViewListener);
index 800679e..49539cd 100644 (file)
@@ -94,6 +94,7 @@ public interface IPreferencePropertyAccessor
     String PREFERENCE_PANASONIC_SETTINGS = "panasonic_settings";
     String PREFERENCE_CANON_SETTINGS = "canon_settings";
     String PREFERENCE_NIKON_SETTINGS = "nikon_settings";
+    String PREFERENCE_KODAK_SETTINGS = "kodak_settings";
 
     String CACHE_LIVEVIEW_PICTURES = "cache_liveview_pictures";
     String NUMBER_OF_CACHE_PICTURES = "number_of_cache_pictures";
diff --git a/app/src/main/java/net/osdn/gokigen/a01d/preference/kodak/KodakPreferenceFragment.java b/app/src/main/java/net/osdn/gokigen/a01d/preference/kodak/KodakPreferenceFragment.java
new file mode 100644 (file)
index 0000000..ea995a4
--- /dev/null
@@ -0,0 +1,362 @@
+package net.osdn.gokigen.a01d.preference.kodak;
+
+import android.content.Context;
+import android.content.Intent;
+import android.content.SharedPreferences;
+import android.os.Bundle;
+import android.provider.Settings;
+import android.util.Log;
+
+import net.osdn.gokigen.a01d.IChangeScene;
+import net.osdn.gokigen.a01d.R;
+import net.osdn.gokigen.a01d.camera.ICameraConnection;
+import net.osdn.gokigen.a01d.camera.kodak.operation.KodakCameraPowerOff;
+import net.osdn.gokigen.a01d.preference.IPreferencePropertyAccessor;
+
+import java.util.Map;
+
+import androidx.annotation.NonNull;
+import androidx.appcompat.app.AppCompatActivity;
+import androidx.fragment.app.FragmentActivity;
+import androidx.preference.CheckBoxPreference;
+import androidx.preference.ListPreference;
+import androidx.preference.Preference;
+import androidx.preference.PreferenceFragmentCompat;
+import androidx.preference.PreferenceManager;
+
+import static net.osdn.gokigen.a01d.preference.IPreferencePropertyAccessor.SEND_MESSAGE_DIALOG;
+import static net.osdn.gokigen.a01d.preference.IPreferencePropertyAccessor.WIFI_SETTINGS;
+
+/**
+ *
+ *
+ */
+public class KodakPreferenceFragment extends PreferenceFragmentCompat implements SharedPreferences.OnSharedPreferenceChangeListener, Preference.OnPreferenceClickListener
+{
+    private final String TAG = toString();
+    private AppCompatActivity context = null;
+    private IChangeScene changeScene = null;
+    private SharedPreferences preferences = null;
+    private KodakCameraPowerOff powerOffController = null;
+
+    /**
+     *
+     *
+     */
+    public static KodakPreferenceFragment newInstance(@NonNull AppCompatActivity context, @NonNull IChangeScene changeScene)
+    {
+        KodakPreferenceFragment instance = new KodakPreferenceFragment();
+        instance.prepare(context, changeScene);
+
+        // パラメータはBundleにまとめておく
+        Bundle arguments = new Bundle();
+        //arguments.putString("title", title);
+        //arguments.putString("message", message);
+        instance.setArguments(arguments);
+
+        return (instance);
+    }
+
+    /**
+     *
+     *
+     */
+    private void prepare(@NonNull AppCompatActivity context, @NonNull IChangeScene changeScene)
+    {
+        try
+        {
+            powerOffController = new KodakCameraPowerOff(context, changeScene);
+            powerOffController.prepare();
+
+            this.context = context;
+            this.changeScene = changeScene;
+        }
+        catch (Exception e)
+        {
+            e.printStackTrace();
+        }
+    }
+
+    /**
+     *
+     *
+     */
+    @Override
+    public void onAttach(@NonNull Context activity)
+    {
+        super.onAttach(activity);
+        Log.v(TAG, "onAttach()");
+
+        try
+        {
+            // Preference をつかまえる
+            preferences = PreferenceManager.getDefaultSharedPreferences(activity);
+
+            // Preference を初期設定する
+            initializePreferences();
+
+            preferences.registerOnSharedPreferenceChangeListener(this);
+        }
+        catch (Exception e)
+        {
+            e.printStackTrace();
+        }
+    }
+
+    /**
+     * Preferenceの初期化...
+     *
+     */
+    private void initializePreferences()
+    {
+        try
+        {
+            Map<String, ?> items = preferences.getAll();
+            SharedPreferences.Editor editor = preferences.edit();
+
+            if (!items.containsKey(IPreferencePropertyAccessor.AUTO_CONNECT_TO_CAMERA)) {
+                editor.putBoolean(IPreferencePropertyAccessor.AUTO_CONNECT_TO_CAMERA, true);
+            }
+            if (!items.containsKey(IPreferencePropertyAccessor.CAPTURE_BOTH_CAMERA_AND_LIVE_VIEW)) {
+                editor.putBoolean(IPreferencePropertyAccessor.CAPTURE_BOTH_CAMERA_AND_LIVE_VIEW, true);
+            }
+            if (!items.containsKey(IPreferencePropertyAccessor.CONNECTION_METHOD)) {
+                editor.putString(IPreferencePropertyAccessor.CONNECTION_METHOD, IPreferencePropertyAccessor.CONNECTION_METHOD_DEFAULT_VALUE);
+            }
+            editor.apply();
+        }
+        catch (Exception e)
+        {
+            e.printStackTrace();
+        }
+    }
+
+    /**
+     *
+     *
+     */
+    @Override
+    public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key)
+    {
+        Log.v(TAG, "onSharedPreferenceChanged() : " + key);
+        boolean value;
+        if (key != null)
+        {
+            switch (key)
+            {
+                case IPreferencePropertyAccessor.AUTO_CONNECT_TO_CAMERA:
+                    value = preferences.getBoolean(key, true);
+                    Log.v(TAG, " " + key + " , " + value);
+                    break;
+
+                case IPreferencePropertyAccessor.CAPTURE_BOTH_CAMERA_AND_LIVE_VIEW:
+                    value = preferences.getBoolean(key, true);
+                    Log.v(TAG, "  " + key + " , " + value);
+                    break;
+
+                default:
+                    String strValue = preferences.getString(key, "");
+                    setListPreference(key, key, strValue);
+                    break;
+            }
+        }
+    }
+
+    /**
+     *
+     *
+     */
+    @Override
+    public void onCreatePreferences(Bundle savedInstanceState, String rootKey)
+    {
+        Log.v(TAG, "onCreatePreferences()");
+        try
+        {
+            //super.onCreate(savedInstanceState);
+            addPreferencesFromResource(R.xml.preferences_kodak);
+
+            ListPreference connectionMethod = findPreference(IPreferencePropertyAccessor.CONNECTION_METHOD);
+            if (connectionMethod != null)
+            {
+                connectionMethod.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
+                    @Override
+                    public boolean onPreferenceChange(Preference preference, Object newValue) {
+                        preference.setSummary(newValue + " ");
+                        return (true);
+                    }
+                });
+                connectionMethod.setSummary(connectionMethod.getValue() + " ");
+            }
+
+            Preference exitApplication = findPreference("exit_application");
+            if (exitApplication != null)
+            {
+                exitApplication.setOnPreferenceClickListener(powerOffController);
+            }
+
+            Preference httpDialog = findPreference(SEND_MESSAGE_DIALOG);
+            if (httpDialog != null)
+            {
+                httpDialog.setOnPreferenceClickListener(this);
+            }
+        }
+        catch (Exception e)
+        {
+            e.printStackTrace();
+        }
+    }
+
+    /**
+     *
+     *
+     */
+    @Override
+    public void onResume()
+    {
+        super.onResume();
+
+        Log.v(TAG, "onResume() Start");
+        try
+        {
+            synchronizedProperty();
+        }
+        catch (Exception e)
+        {
+            e.printStackTrace();
+        }
+        Log.v(TAG, "onResume() End");
+    }
+
+    /**
+     *
+     *
+     */
+    @Override
+    public void onPause()
+    {
+        super.onPause();
+        Log.v(TAG, "onPause() Start");
+
+        try
+        {
+            // Preference変更のリスナを解除
+            preferences.unregisterOnSharedPreferenceChangeListener(this);
+        }
+        catch (Exception e)
+        {
+            e.printStackTrace();
+        }
+
+        Log.v(TAG, "onPause() End");
+    }
+
+    /**
+     * ListPreference の表示データを設定
+     *
+     * @param pref_key     Preference(表示)のキー
+     * @param key          Preference(データ)のキー
+     * @param defaultValue Preferenceのデフォルト値
+     */
+    private void setListPreference(String pref_key, String key, String defaultValue)
+    {
+        try
+        {
+            String value = preferences.getString(key, defaultValue);
+            ListPreference pref = findPreference(pref_key);
+            if (pref != null)
+            {
+                pref.setValue(value);
+                pref.setSummary(value);
+            }
+        }
+        catch (Exception e)
+        {
+            e.printStackTrace();
+        }
+    }
+
+    /**
+     * BooleanPreference の表示データを設定
+     *
+     * @param pref_key     Preference(表示)のキー
+     * @param key          Preference(データ)のキー
+     * @param defaultValue Preferenceのデフォルト値
+     */
+    private void setBooleanPreference(String pref_key, String key, boolean defaultValue)
+    {
+        try
+        {
+            CheckBoxPreference pref = findPreference(pref_key);
+            if (pref != null)
+            {
+                boolean value = preferences.getBoolean(key, defaultValue);
+                pref.setChecked(value);
+            }
+        }
+        catch (Exception e)
+        {
+            e.printStackTrace();
+        }
+    }
+
+    /**
+     *
+     *
+     */
+    private void synchronizedProperty()
+    {
+        final FragmentActivity activity = getActivity();
+        final boolean defaultValue = true;
+        if (activity != null)
+        {
+            activity.runOnUiThread(new Runnable() {
+                @Override
+                public void run() {
+                    try
+                    {
+                        // Preferenceの画面に反映させる
+                        setBooleanPreference(IPreferencePropertyAccessor.AUTO_CONNECT_TO_CAMERA, IPreferencePropertyAccessor.AUTO_CONNECT_TO_CAMERA, defaultValue);
+                        setBooleanPreference(IPreferencePropertyAccessor.CAPTURE_BOTH_CAMERA_AND_LIVE_VIEW, IPreferencePropertyAccessor.CAPTURE_BOTH_CAMERA_AND_LIVE_VIEW, defaultValue);
+                    }
+                    catch (Exception e)
+                    {
+                        e.printStackTrace();
+                    }
+                }
+            });
+        }
+    }
+
+    @Override
+    public boolean onPreferenceClick(Preference preference)
+    {
+        try
+        {
+            String preferenceKey = preference.getKey();
+            if (preferenceKey.contains(WIFI_SETTINGS))
+            {
+                // Wifi 設定画面を表示する
+                Log.v(TAG, " onPreferenceClick : " + preferenceKey);
+                if (context != null)
+                {
+                    context.startActivity(new Intent(Settings.ACTION_WIFI_SETTINGS));
+                }
+            }
+            else if (preferenceKey.contains(SEND_MESSAGE_DIALOG))
+            {
+                // コマンド送信ダイアログを表示する
+                if (changeScene != null)
+                {
+                    changeScene.changeSceneToCameraPropertyList(ICameraConnection.CameraConnectionMethod.PANASONIC);
+                }
+            }
+            return (true);
+        }
+        catch (Exception e)
+        {
+            e.printStackTrace();
+        }
+        return (false);
+    }
+
+}
index 51101f2..fdf45ae 100644 (file)
@@ -36,6 +36,7 @@ import static net.osdn.gokigen.a01d.preference.IPreferencePropertyAccessor.PREFE
 import static net.osdn.gokigen.a01d.preference.IPreferencePropertyAccessor.PREFERENCE_RICOH_SETTINGS;
 import static net.osdn.gokigen.a01d.preference.IPreferencePropertyAccessor.PREFERENCE_SONY_SETTINGS;
 import static net.osdn.gokigen.a01d.preference.IPreferencePropertyAccessor.PREFERENCE_THETA_SETTINGS;
+import static net.osdn.gokigen.a01d.preference.IPreferencePropertyAccessor.PREFERENCE_KODAK_SETTINGS;
 import static net.osdn.gokigen.a01d.preference.IPreferencePropertyAccessor.WIFI_SETTINGS;
 
 
@@ -281,6 +282,11 @@ public class PreferenceFragmentSummary extends PreferenceFragmentCompat implemen
             {
                 nikon_settings.setOnPreferenceClickListener(this);
             }
+            Preference kodak_settings = findPreference(PREFERENCE_KODAK_SETTINGS);
+            if (kodak_settings != null)
+            {
+                kodak_settings.setOnPreferenceClickListener(this);
+            }
             Preference exitApplication = findPreference(EXIT_APPLICATION);
             if (exitApplication != null)
             {
@@ -470,6 +476,10 @@ public class PreferenceFragmentSummary extends PreferenceFragmentCompat implemen
             {
                 changeScene.changeSceneToConfiguration(ICameraConnection.CameraConnectionMethod.NIKON);
             }
+            else if (preferenceKey.contains(PREFERENCE_KODAK_SETTINGS))
+            {
+                changeScene.changeSceneToConfiguration(ICameraConnection.CameraConnectionMethod.KODAK);
+            }
             else if (preferenceKey.contains(EXIT_APPLICATION))
             {
                 // 確認ダイアログの生成と表示
index 8de054b..cc5d8a1 100644 (file)
         <item >Ricoh THETA Series</item>
         <item >Fuji X Series</item>
         <item >Panasonic</item>
+        <item >PIXPRO WPZ2</item>
         <item >Canon</item>
         <item >NIKON</item>
     </string-array>
         <item >THETA</item>
         <item >FUJI_X</item>
         <item >PANASONIC</item>
+        <item >KODAK</item>
         <item >CANON</item>
         <item >NIKON</item>
     </string-array>
index 5eb40a4..54962db 100644 (file)
     <string name="dialog_title_connect_failed_theta">接続失敗(THETA)</string>
     <string name="dialog_title_connect_failed_nikon">接続失敗(NIKON)</string>
     <string name="dialog_title_connect_failed_canon">接続失敗(CANON)</string>
+    <string name="dialog_title_connect_failed_kodak">接続失敗(PIXPRO)</string>
     <string name="fatal_cannot_use_camera">Olympus Camera Kitが動作しないモードのため、カメラのリセットが必要です。電源ボタンを8秒以上長押しして、カメラをリセットしてください。</string>
     <string name="network_connection_timeout">接続タイムアウト</string>
     <string name="restored_my_props">設定を展開しました。 : </string>
     <string name="nikon_connect_connecting2">接続中&#8230;(2/5)</string>
     <string name="nikon_connect_connecting3">接続中&#8230;(3/5)</string>
 
+    <string name="kodak_connect_connecting1">接続中&#8230;(1/12)</string>
+    <string name="kodak_connect_connecting2">接続中&#8230;(2/12)</string>
+    <string name="kodak_connect_connecting3">接続中&#8230;(3/12)</string>
+    <string name="kodak_connect_connecting4">接続中&#8230;(4/12)</string>
+    <string name="kodak_connect_connecting5">接続中&#8230;(5/12)</string>
+    <string name="kodak_connect_connecting6">接続中&#8230;(6/12)</string>
+    <string name="kodak_connect_connecting7">接続中&#8230;(7/12)</string>
+    <string name="kodak_connect_connecting8">接続中&#8230;(8/12)</string>
+    <string name="kodak_connect_connecting9">接続中&#8230;(9/12)</string>
+    <string name="kodak_connect_connecting10">接続中&#8230;(10/12)</string>
+    <string name="kodak_connect_connecting11">接続中&#8230;(11/12)</string>
+    <string name="kodak_connect_connecting12">接続中&#8230;(12/12)</string>
+    <string name="kodak_connect_flash">接続&#8230;</string>
+
     <string name="connect_error_message">接続失敗</string>
 
     <string name="connect_error_message_olympus">接続失敗 (OLYMPUS)</string>
     <string name="pref_panasonic_settings">Panasonic</string>
     <string name="pref_summary_panasonic_settings"> </string>
 
+    <string name="pref_kodak_settings">PIXPRO WPZ2</string>
+    <string name="pref_summary_kodak_settings">WPZ2用設定</string>
+
     <string name="pref_canon_settings">Canon</string>
     <string name="pref_summary_canon_settings"> </string>
 
index a86c5d8..f91b57b 100644 (file)
         <item >Ricoh THETA Series</item>
         <item >Fuji X Series</item>
         <item >Panasonic</item>
+        <item >PIXPRO WPZ2</item>
         <item >Canon</item>
         <item >NIKON</item>
     </string-array>
         <item >THETA</item>
         <item >FUJI_X</item>
         <item >PANASONIC</item>
+        <item >KODAK</item>
         <item >CANON</item>
         <item >NIKON</item>
     </string-array>
index 9cb45d1..1cb1381 100644 (file)
@@ -96,6 +96,7 @@
     <string name="dialog_title_connect_failed_theta">Connect failed (THETA)</string>
     <string name="dialog_title_connect_failed_nikon">Connect failed (NIKON)</string>
     <string name="dialog_title_connect_failed_canon">Connect failed (CANON)</string>
+    <string name="dialog_title_connect_failed_kodak">Connect failed (PIXPRO)</string>
     <string name="dialog_title_button_retry">Retry</string>
     <string name="dialog_title_button_network_settings">WiFi Settings</string>
 
     <string name="nikon_connect_connecting2">Connecting&#8230;(2/5)</string>
     <string name="nikon_connect_connecting3">Connecting&#8230;(3/5)</string>
 
+    <string name="kodak_connect_connecting1">Connecting&#8230;(1/12)</string>
+    <string name="kodak_connect_connecting2">Connecting&#8230;(2/12)</string>
+    <string name="kodak_connect_connecting3">Connecting&#8230;(3/12)</string>
+    <string name="kodak_connect_connecting4">Connecting&#8230;(4/12)</string>
+    <string name="kodak_connect_connecting5">Connecting&#8230;(5/12)</string>
+    <string name="kodak_connect_connecting6">Connecting&#8230;(6/12)</string>
+    <string name="kodak_connect_connecting7">Connecting&#8230;(7/12)</string>
+    <string name="kodak_connect_connecting8">Connecting&#8230;(8/12)</string>
+    <string name="kodak_connect_connecting9">Connecting&#8230;(9/12)</string>
+    <string name="kodak_connect_connecting10">Connecting&#8230;(10/12)</string>
+    <string name="kodak_connect_connecting11">Connecting&#8230;(11/12)</string>
+    <string name="kodak_connect_connecting12">Connecting&#8230;(12/12)</string>
+    <string name="kodak_connect_flash">Connecting&#8230;</string>
+
     <string name="connect_error_message">CONNECTION ERROR</string>
 
     <string name="connect_error_message_olympus">CONNECTION ERROR (OLYMPUS)</string>
     <string name="pref_nikon_settings">Nikon</string>
     <string name="pref_summary_nikon_settings">Special Settings for Nikon</string>
 
+    <string name="pref_kodak_settings">PIXPRO WPZ2</string>
+    <string name="pref_summary_kodak_settings">Special Settings for PIXPRO WPZ2</string>
+
     <string name="pref_exit_power_off_summary">Exit Application</string>
 
     <string name="pref_cache_liveview_pictures">Delay liveview picture</string>
diff --git a/app/src/main/res/xml/preferences_kodak.xml b/app/src/main/res/xml/preferences_kodak.xml
new file mode 100644 (file)
index 0000000..a5fdcb5
--- /dev/null
@@ -0,0 +1,79 @@
+<?xml version="1.0" encoding="utf-8"?>
+<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android" >
+    <PreferenceCategory
+        android:title="@string/pref_cat_application_control">
+
+        <PreferenceScreen
+            android:key="exit_application"
+            android:icon="@drawable/ic_power_settings_new_black_24dp"
+            android:title="@string/pref_exit_power_off_panasonic" />
+<!--
+        <ListPreference
+            android:title="@string/pref_connection_method"
+            android:entryValues="@array/connection_method_value"
+            android:entries="@array/connection_method"
+            android:key="connection_method"
+            android:defaultValue="OPC"/>
+
+        <PreferenceScreen
+            android:key="wifi_settings"
+            android:title="@string/pref_wifi_settings"
+            android:summary="@string/pref_summary_wifi_settings" />
+-->
+<!--
+        <PreferenceScreen
+            android:key="dialog_message_send"
+            android:icon="@drawable/ic_linked_camera_black_24dp"
+            android:title="@string/pref_open_send_command_dialog"
+            />
+-->
+    </PreferenceCategory>
+
+<!--
+    <PreferenceCategory
+        android:title="@string/pref_cat_camera">
+
+        <CheckBoxPreference
+            android:key="capture_both_camera_and_live_view"
+            android:title="@string/pref_capture_both_camera_and_live_view" />
+
+    </PreferenceCategory>
+
+    <PreferenceCategory
+        android:title="@string/pref_cat_initialize">
+
+        <CheckBoxPreference
+        android:key="auto_connect_to_camera"
+        android:title="@string/pref_auto_connect_camera"
+        android:summary="@string/pref_summary_auto_connect_camera" />
+    </PreferenceCategory>
+
+    <PreferenceCategory
+        android:title="@string/pref_cat_gokigen">
+
+        <Preference
+            android:key="instruction_link"
+            android:title="@string/pref_instruction_manual"
+            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/A01d" />
+        </Preference>
+
+        <Preference
+            android:key="privacy_policy"
+            android:title="@string/pref_privacy_policy"
+            android:summary="https://osdn.net/projects/gokigen/wiki/PrivacyPolicy"
+            android:selectable="true">
+            <intent android:action="android.intent.action.VIEW"
+                android:data="https://osdn.net/projects/gokigen/wiki/PrivacyPolicy" />
+        </Preference>
+
+        <PreferenceScreen
+            android:key="debug_info"
+            android:title="@string/pref_degug_info"
+            android:summary="@string/pref_summary_debug_info" />
+
+    </PreferenceCategory>
+-->
+</PreferenceScreen>
index 4fbbef5..82d6d2d 100644 (file)
             android:summary="@string/pref_summary_panasonic_settings" />
 
         <PreferenceScreen
+            android:key="kodak_settings"
+            android:title="@string/pref_kodak_settings" />
+            android:summary="@string/pref_summary_kodak_settings" />
+
+        <PreferenceScreen
             android:key="sony_settings"
             android:title="@string/pref_sony_settings"
             android:summary="@string/pref_summary_sony_settings" />