package net.osdn.gokigen.pkremote.camera.vendor.fujix.cameraproperty;
import android.app.Activity;
+import android.util.Log;
import android.widget.TextView;
import androidx.annotation.NonNull;
class FujiXCameraCommandResponse implements IFujiXCommandCallback
{
+ private final String TAG = toString();
private final Activity activity;
private final TextView field;
}
}
+ @Override
+ public void onReceiveProgress(int currentBytes, int totalBytes)
+ {
+ Log.v(TAG, " " + currentBytes + "/" + totalBytes);
+ }
@Override
public void receivedMessage(int id, byte[] rx_body)
Log.v(TAG, "Response Received.");
frameDisplay.hideFocusFrame();
}
+
+ @Override
+ public void onReceiveProgress(int currentBytes, int totalBytes)
+ {
+ Log.v(TAG, " " + currentBytes + "/" + totalBytes);
+ }
}
indicator.onAfLockUpdate(false);
}
+ @Override
+ public void onReceiveProgress(int currentBytes, int totalBytes)
+ {
+ Log.v(TAG, " " + currentBytes + "/" + totalBytes);
+ }
@Override
public void receivedMessage(int id, byte[] rx_body)
--- /dev/null
+package net.osdn.gokigen.pkremote.camera.vendor.fujix.wrapper;
+
+import android.content.Context;
+import android.util.Log;
+
+import androidx.annotation.NonNull;
+
+import net.osdn.gokigen.pkremote.camera.interfaces.playback.IDownloadContentCallback;
+import net.osdn.gokigen.pkremote.camera.interfaces.playback.IProgressEvent;
+import net.osdn.gokigen.pkremote.camera.vendor.fujix.wrapper.command.IFujiXCommandCallback;
+
+import java.util.Arrays;
+
+public class FujiXFullImageReceiver implements IFujiXCommandCallback
+{
+ private final String TAG = toString();
+ private final Context context;
+ private final IDownloadContentCallback callback;
+
+ FujiXFullImageReceiver(Context context, @NonNull IDownloadContentCallback callback)
+ {
+ this.context = context;
+ this.callback = callback;
+ }
+
+ @Override
+ public void receivedMessage(int id, byte[] rx_body)
+ {
+ try
+ {
+ Log.v(TAG, " receivedMessage() " + id + " / " + rx_body.length + " bytes.");
+ int offset = 12;
+ if (rx_body.length > offset)
+ {
+ callback.onProgress(Arrays.copyOfRange(rx_body, offset, (rx_body.length - offset)), rx_body.length, new IProgressEvent() {
+ @Override
+ public float getProgress() {
+ return (1.0f);
+ }
+
+ @Override
+ public boolean isCancellable() {
+ return (false);
+ }
+
+ @Override
+ public void requestCancellation() { }
+ });
+ callback.onCompleted();
+ }
+ else
+ {
+ Log.v(TAG, "ERROR RESPONSE... : " + rx_body.length);
+ callback.onErrorOccurred(new NullPointerException());
+ }
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ {
+ callback.onErrorOccurred(e);
+ }
+ }
+ }
+
+ @Override
+ public void onReceiveProgress(final int currentBytes, final int totalBytes)
+ {
+ try
+ {
+ Log.v(TAG, " onReceiveProgress() " + currentBytes + "/" + totalBytes);
+
+ callback.onProgress(null, currentBytes, new IProgressEvent() {
+ @Override
+ public float getProgress() {
+ return( (float) currentBytes / (float) totalBytes);
+ }
+
+ @Override
+ public boolean isCancellable() {
+ return (false);
+ }
+
+ @Override
+ public void requestCancellation() { }
+ });
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ callback.onErrorOccurred(e);
+ }
+ }
+
+
+
+}
}
@Override
+ public void onReceiveProgress(int currentBytes, int totalBytes)
+ {
+ Log.v(TAG, " " + currentBytes + "/" + totalBytes);
+ }
+
+ @Override
public void receivedMessage(int id, byte[] rx_body)
{
Log.v(TAG, "RX : " + indexNumber + "(" + id + ") " + rx_body.length + " bytes.");
import net.osdn.gokigen.pkremote.camera.interfaces.status.ICameraStatus;
import net.osdn.gokigen.pkremote.camera.vendor.fujix.wrapper.command.IFujiXCommandCallback;
import net.osdn.gokigen.pkremote.camera.vendor.fujix.wrapper.command.IFujiXCommandPublisher;
+import net.osdn.gokigen.pkremote.camera.vendor.fujix.wrapper.command.messages.GetFullImage;
import net.osdn.gokigen.pkremote.camera.vendor.fujix.wrapper.command.messages.GetImageInfo;
import net.osdn.gokigen.pkremote.camera.vendor.fujix.wrapper.command.messages.GetThumbNail;
@Override
public void getContentInfo(String path, String name, IContentInfoCallback callback)
{
+ // showFileInformation
}
@Override
public void downloadContent(String path, boolean isSmallSize, IDownloadContentCallback callback)
{
-
+ try
+ {
+ int start = 0;
+ if (path.indexOf("/") == 0)
+ {
+ start = 1;
+ }
+ String indexStr = path.substring(start, path.indexOf("."));
+ Log.v(TAG, "FujiX::downloadContent() : " + path + " " + indexStr);
+ int index = Integer.parseInt(indexStr);
+ if ((index > 0)&&(index <= imageInfo.size()))
+ {
+ IFujiXCommandPublisher publisher = provider.getCommandPublisher();
+ publisher.enqueueCommand(new GetFullImage(index, new FujiXFullImageReceiver(activity, callback)));
+ }
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ }
}
@Override
}
@Override
+ public void onReceiveProgress(int currentBytes, int totalBytes)
+ {
+ Log.v(TAG, " " + currentBytes + "/" + totalBytes);
+ }
+
+ @Override
public void receivedMessage(int id, byte[] rx_body)
{
// イメージ数の一覧が取得できなかった場合にここで作る。
}
}
}
+
+ @Override
+ public void onReceiveProgress(int currentBytes, int totalBytes)
+ {
+ Log.v(TAG, " " + currentBytes + "/" + totalBytes);
+ }
}
if (receiveAgain)
{
int length = ((((int) byte_array[3]) & 0xff) << 24) + ((((int) byte_array[2]) & 0xff) << 16) + ((((int) byte_array[1]) & 0xff) << 8) + (((int) byte_array[0]) & 0xff);
- if ((length > read_bytes)||((length == read_bytes)&&((int) byte_array[4] == 0x02)))
+ while ((length > read_bytes)||((length == read_bytes)&&((int) byte_array[4] == 0x02)))
{
// データについて、もう一回受信が必要な場合...
if (isDumpReceiveLog)
{
read_bytes = read_bytes + read_bytes2;
}
+ else
+ {
+ // よみだし
+ break;
+ }
+ if (callback != null)
+ {
+ callback.onReceiveProgress(read_bytes, length);
+ }
}
}
receive_body = Arrays.copyOfRange(byte_array, 0, read_bytes);
public interface IFujiXCommandCallback
{
void receivedMessage(int id, byte[] rx_body);
+ void onReceiveProgress(int currentBytes, int totalBytes);
}
}
@Override
+ public void onReceiveProgress(int currentBytes, int totalBytes)
+ {
+ Log.v(TAG, " " + currentBytes + "/" + totalBytes);
+ }
+
+ @Override
public void receivedMessage(int id, byte[] rx_body)
{
//Log.v(TAG, "receivedMessage : " + id + "[" + rx_body.length + " bytes]");
}
@Override
+ public void onReceiveProgress(int currentBytes, int totalBytes)
+ {
+ Log.v(TAG, " " + currentBytes + "/" + totalBytes);
+ }
+
+ @Override
public void receivedMessage(int id, byte[] rx_body)
{
//Log.v(TAG, "receivedMessage : " + id + "[" + rx_body.length + " bytes]");
{
commandIssuer.enqueueCommand(new StartMessage(this));
}
+ else
+ {
+ onConnectError(context.getString(R.string.connect_error_message));
+ }
break;
case SEQ_START:
private boolean checkRegistrationMessage(byte[] receiveData)
{
+ // データがないときにはエラー
+ if ((receiveData == null)||(receiveData.length < 8))
+ {
+ return (false);
+ }
+
// 応答エラーかどうかをチェックする
if (receiveData.length == 8)
{
}
@Override
+ public void onReceiveProgress(int currentBytes, int totalBytes)
+ {
+ Log.v(TAG, " " + currentBytes + "/" + totalBytes);
+ }
+
+ @Override
public void receivedMessage(int id, byte[] rx_body)
{
//Log.v(TAG, "receivedMessage : " + id + "[" + rx_body.length + " bytes]");
}
@Override
+ public void onReceiveProgress(int currentBytes, int totalBytes)
+ {
+ Log.v(TAG, " " + currentBytes + "/" + totalBytes);
+ }
+
+ @Override
public void receivedMessage(int id, byte[] rx_body)
{
//Log.v(TAG, "receivedMessage : " + id + "[" + rx_body.length + " bytes]");
}
@Override
+ public void onReceiveProgress(int currentBytes, int totalBytes)
+ {
+ Log.v(TAG, " " + currentBytes + "/" + totalBytes);
+ }
+
+ @Override
public void receivedMessage(int id, byte[] rx_body)
{
//Log.v(TAG, "receivedMessage : " + id + "[" + rx_body.length + " bytes]");
}
@Override
+ public void onReceiveProgress(int currentBytes, int totalBytes)
+ {
+ Log.v(TAG, " " + currentBytes + "/" + totalBytes);
+ }
+
+ @Override
public void receivedMessage(int id, byte[] data)
{
try
<string name="connect_connecting">接続中…</string>
<string name="connect_receive_unknown_message">知らないメッセージを受信</string>
+ <string name="connect_error_message">接続失敗</string>
<string name="pref_special_thanks">Special Thanks to</string>
<string name="connect_connecting">connecting…</string>
<string name="connect_receive_unknown_message">RECEIVED UNKNOWN ID MESSAGE</string>
+ <string name="connect_error_message">CONNECTION ERROR</string>
<string name="pref_special_thanks">Special Thanks to</string>