From 1fbf500c0fc6d7f3c916e3726e87d5b3ed9975df Mon Sep 17 00:00:00 2001 From: ne0fhyk Date: Mon, 23 Nov 2015 15:35:23 -0800 Subject: [PATCH] override `toString()` method for key tlv packets. --- ClientLib/build.gradle | 2 +- .../tlv/ControllerMessageInputReport.java | 10 +++++ .../solo/tlv/SoloGoproSetExtendedRequest.java | 8 ++++ .../solo/tlv/SoloGoproSetRequest.java | 8 ++++ .../companion/solo/tlv/SoloGoproState.java | 37 +++++++++++++++++++ .../companion/solo/tlv/SoloGoproStateV2.java | 37 +++++++++++++++++++ .../solo/tlv/SoloMessageShotManagerError.java | 7 ++++ .../drone/companion/solo/tlv/TLVPacket.java | 8 ++++ 8 files changed, 116 insertions(+), 1 deletion(-) diff --git a/ClientLib/build.gradle b/ClientLib/build.gradle index 9b3b68aad7..1ea930a169 100644 --- a/ClientLib/build.gradle +++ b/ClientLib/build.gradle @@ -4,7 +4,7 @@ ext { VERSION_MAJOR = 2 VERSION_MINOR = 7 VERSION_PATCH = 0 - VERSION_SUFFIX = "beta3" + VERSION_SUFFIX = "beta4" PUBLISH_ARTIFACT_ID = 'dronekit-android' PUBLISH_VERSION = generateVersionName("", VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH, VERSION_SUFFIX) diff --git a/ClientLib/src/main/java/com/o3dr/services/android/lib/drone/companion/solo/tlv/ControllerMessageInputReport.java b/ClientLib/src/main/java/com/o3dr/services/android/lib/drone/companion/solo/tlv/ControllerMessageInputReport.java index 3ab72f4d7a..d26e7e1005 100644 --- a/ClientLib/src/main/java/com/o3dr/services/android/lib/drone/companion/solo/tlv/ControllerMessageInputReport.java +++ b/ClientLib/src/main/java/com/o3dr/services/android/lib/drone/companion/solo/tlv/ControllerMessageInputReport.java @@ -72,4 +72,14 @@ public ControllerMessageInputReport[] newArray(int size) { return new ControllerMessageInputReport[size]; } }; + + @Override + public String toString() { + return "ControllerMessageInputReport{" + + "battery=" + battery + + ", timestamp=" + timestamp + + ", gimbalY=" + gimbalY + + ", gimbalRate=" + gimbalRate + + '}'; + } } diff --git a/ClientLib/src/main/java/com/o3dr/services/android/lib/drone/companion/solo/tlv/SoloGoproSetExtendedRequest.java b/ClientLib/src/main/java/com/o3dr/services/android/lib/drone/companion/solo/tlv/SoloGoproSetExtendedRequest.java index 599402f94c..cc383cc758 100644 --- a/ClientLib/src/main/java/com/o3dr/services/android/lib/drone/companion/solo/tlv/SoloGoproSetExtendedRequest.java +++ b/ClientLib/src/main/java/com/o3dr/services/android/lib/drone/companion/solo/tlv/SoloGoproSetExtendedRequest.java @@ -3,6 +3,7 @@ import android.os.Parcel; import java.nio.ByteBuffer; +import java.util.Arrays; /** * Created by chavi on 11/16/15. @@ -53,4 +54,11 @@ public SoloGoproSetExtendedRequest[] newArray(int size) { } }; + @Override + public String toString() { + return "SoloGoproSetExtendedRequest{" + + "command=" + command + + ", values=" + Arrays.toString(values) + + '}'; + } } diff --git a/ClientLib/src/main/java/com/o3dr/services/android/lib/drone/companion/solo/tlv/SoloGoproSetRequest.java b/ClientLib/src/main/java/com/o3dr/services/android/lib/drone/companion/solo/tlv/SoloGoproSetRequest.java index 0be0a39abb..700cc224fd 100644 --- a/ClientLib/src/main/java/com/o3dr/services/android/lib/drone/companion/solo/tlv/SoloGoproSetRequest.java +++ b/ClientLib/src/main/java/com/o3dr/services/android/lib/drone/companion/solo/tlv/SoloGoproSetRequest.java @@ -66,4 +66,12 @@ public SoloGoproSetRequest[] newArray(int size) { return new SoloGoproSetRequest[size]; } }; + + @Override + public String toString() { + return "SoloGoproSetRequest{" + + "command=" + command + + ", value=" + value + + '}'; + } } diff --git a/ClientLib/src/main/java/com/o3dr/services/android/lib/drone/companion/solo/tlv/SoloGoproState.java b/ClientLib/src/main/java/com/o3dr/services/android/lib/drone/companion/solo/tlv/SoloGoproState.java index 9e924a26bd..2a01affcbb 100644 --- a/ClientLib/src/main/java/com/o3dr/services/android/lib/drone/companion/solo/tlv/SoloGoproState.java +++ b/ClientLib/src/main/java/com/o3dr/services/android/lib/drone/companion/solo/tlv/SoloGoproState.java @@ -410,6 +410,43 @@ protected SoloGoproState(Parcel in) { this.extra5 = (short) in.readInt(); } + @Override + public String toString() { + return "SoloGoproState{" + + "batteryRemaining=" + batteryRemaining + + ", version=" + version + + ", model=" + model + + ", status=" + status + + ", recording=" + recording + + ", captureMode=" + captureMode + + ", fov=" + fov + + ", videoResolution=" + videoResolution + + ", fps=" + fps + + ", whiteBalance=" + whiteBalance + + ", proTune=" + proTune + + ", videoExposure=" + videoExposure + + ", photoResolution=" + photoResolution + + ", photoExposure=" + photoExposure + + ", ntsc_pal=" + ntsc_pal + + ", lowLight=" + lowLight + + ", spotMeter=" + spotMeter + + ", photoRemaining=" + photoRemaining + + ", photoTaken=" + photoTaken + + ", videoRemaining=" + videoRemaining + + ", videoTaken=" + videoTaken + + ", color=" + color + + ", sharpness=" + sharpness + + ", burstShutterRate=" + burstShutterRate + + ", continuousShutterSpeed=" + continuousShutterSpeed + + ", timeLapseInterval=" + timeLapseInterval + + ", extra1=" + extra1 + + ", extra2=" + extra2 + + ", extra3=" + extra3 + + ", extra4=" + extra4 + + ", extra5=" + extra5 + + '}'; + } + public static final Creator CREATOR = new Creator() { public SoloGoproState createFromParcel(Parcel source) { return new SoloGoproState(source); diff --git a/ClientLib/src/main/java/com/o3dr/services/android/lib/drone/companion/solo/tlv/SoloGoproStateV2.java b/ClientLib/src/main/java/com/o3dr/services/android/lib/drone/companion/solo/tlv/SoloGoproStateV2.java index 8c89da5ec7..98fb9b3ce9 100644 --- a/ClientLib/src/main/java/com/o3dr/services/android/lib/drone/companion/solo/tlv/SoloGoproStateV2.java +++ b/ClientLib/src/main/java/com/o3dr/services/android/lib/drone/companion/solo/tlv/SoloGoproStateV2.java @@ -263,6 +263,43 @@ public SoloGoproStateV2[] newArray(int size) { } }; + @Override + public String toString() { + return "SoloGoproStateV2{" + + "captureMode=" + captureMode + + ", version=" + version + + ", model=" + model + + ", status=" + status + + ", recording=" + recording + + ", ntsc_pal=" + ntsc_pal + + ", fov=" + fov + + ", videoResolution=" + videoResolution + + ", fps=" + fps + + ", lowLight=" + lowLight + + ", photoResolution=" + photoResolution + + ", photoBurstRate=" + photoBurstRate + + ", videoProtune=" + videoProtune + + ", videoWhiteBalance=" + videoWhiteBalance + + ", videoColor=" + videoColor + + ", videoGain=" + videoGain + + ", videoSharpness=" + videoSharpness + + ", videoExposure=" + videoExposure + + ", gimbalEnabled=" + gimbalEnabled + + ", extra1=" + extra1 + + ", extra2=" + extra2 + + ", extra3=" + extra3 + + ", extra4=" + extra4 + + ", extra5=" + extra5 + + ", extra6=" + extra6 + + ", extra7=" + extra7 + + ", extra8=" + extra8 + + ", extra9=" + extra9 + + ", extra10=" + extra10 + + ", extra11=" + extra11 + + ", extra12=" + extra12 + + '}'; + } + public byte getFov() { return fov; } diff --git a/ClientLib/src/main/java/com/o3dr/services/android/lib/drone/companion/solo/tlv/SoloMessageShotManagerError.java b/ClientLib/src/main/java/com/o3dr/services/android/lib/drone/companion/solo/tlv/SoloMessageShotManagerError.java index 56d82dfbd6..d8715de398 100644 --- a/ClientLib/src/main/java/com/o3dr/services/android/lib/drone/companion/solo/tlv/SoloMessageShotManagerError.java +++ b/ClientLib/src/main/java/com/o3dr/services/android/lib/drone/companion/solo/tlv/SoloMessageShotManagerError.java @@ -45,4 +45,11 @@ public SoloMessageShotManagerError[] newArray(int size) { return new SoloMessageShotManagerError[size]; } }; + + @Override + public String toString() { + return "SoloMessageShotManagerError{" + + "exceptionInfo='" + exceptionInfo + '\'' + + '}'; + } } diff --git a/ClientLib/src/main/java/com/o3dr/services/android/lib/drone/companion/solo/tlv/TLVPacket.java b/ClientLib/src/main/java/com/o3dr/services/android/lib/drone/companion/solo/tlv/TLVPacket.java index e429756859..6c9b7ef0a5 100644 --- a/ClientLib/src/main/java/com/o3dr/services/android/lib/drone/companion/solo/tlv/TLVPacket.java +++ b/ClientLib/src/main/java/com/o3dr/services/android/lib/drone/companion/solo/tlv/TLVPacket.java @@ -50,6 +50,14 @@ public final byte[] toBytes(){ return bytes; } + @Override + public String toString() { + return "TLVPacket{" + + "messageLength=" + messageLength + + ", messageType=" + messageType + + '}'; + } + @Override public boolean equals(Object o) { if (this == o) return true;