From d9b0b7617864600f690a8202d06b2fb2a64306db Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Tue, 19 Dec 2017 18:52:45 +0200 Subject: Started working on 'Synchronization' - Machine Studio module. --- .../java/com/twine/tango/unittesting/DAL_TST.java | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 Software/Android_Studio/Tango.UnitTesting/src/androidTest/java/com/twine/tango/unittesting/DAL_TST.java (limited to 'Software/Android_Studio/Tango.UnitTesting/src/androidTest') diff --git a/Software/Android_Studio/Tango.UnitTesting/src/androidTest/java/com/twine/tango/unittesting/DAL_TST.java b/Software/Android_Studio/Tango.UnitTesting/src/androidTest/java/com/twine/tango/unittesting/DAL_TST.java new file mode 100644 index 000000000..f04070d6a --- /dev/null +++ b/Software/Android_Studio/Tango.UnitTesting/src/androidTest/java/com/twine/tango/unittesting/DAL_TST.java @@ -0,0 +1,21 @@ +package com.twine.tango.unittesting; + +import android.content.Context; +import android.support.test.InstrumentationRegistry; +import android.support.test.runner.AndroidJUnit4; + +import org.junit.runner.RunWith; + +/** + * Created by Roy on 12/19/2017. + */ + +@RunWith(AndroidJUnit4.class) +public class DAL_TST +{ + public void perform_basic_dal_test() + { + // Context of the app under test. + Context appContext = InstrumentationRegistry.getTargetContext(); + } +} -- cgit v1.3.1 From 9989238711695810324960c82b1bd85fc67c570e Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Thu, 21 Dec 2017 17:32:57 +0200 Subject: Implemented native ColorLib + Android NDK JNI Integration !!! --- Software/Android_Studio/Tango.DAL/build.gradle | 2 +- .../twine/tango/dal/enumerations/Permissions.java | 3 + .../Android_Studio/Tango.NativeBridge/.gitignore | 1 + .../Tango.NativeBridge/CMakeLists.txt | 21 + .../Android_Studio/Tango.NativeBridge/build.gradle | 69 ++ .../libs/armeabi-v7a/tangoColorLib.so | Bin 0 -> 34212 bytes .../libs/armeabi-v7a/tangoColorLib.so.recipe | 11 + .../libs/x86_64/tangoColorLib.so | Bin 0 -> 59352 bytes .../libs/x86_64/tangoColorLib.so.recipe | 11 + .../Tango.NativeBridge/proguard-rules.pro | 25 + .../src/main/AndroidManifest.xml | 2 + .../Tango.NativeBridge/src/main/cpp/Android.mk | 0 .../src/main/cpp/ColorLibAdapter.cpp | 26 + .../twine/tango/nativebridge/ColorLibAdapter.java | 40 + .../src/main/res/values/strings.xml | 3 + .../tango/pmr/common/MessageTypeOuterClass.java | 231 +++--- .../stubs/StubCartridgeReadResponseOuterClass.java | 18 +- .../pmr/stubs/StubDispenserRequestOuterClass.java | 18 +- .../stubs/StubGPIOInputSetupRequestOuterClass.java | 865 +++++++++++++++++++++ .../StubGPIOInputSetupResponseOuterClass.java | 782 +++++++++++++++++++ .../stubs/StubGPIOReadBitRequestOuterClass.java | 335 +++++++- .../stubs/StubGPIOReadBitResponseOuterClass.java | 205 +++-- .../stubs/StubGPIOReadByteRequestOuterClass.java | 160 +++- .../stubs/StubGPIOReadByteResponseOuterClass.java | 205 +++-- .../stubs/StubGPIOWriteBitRequestOuterClass.java | 160 +++- .../stubs/StubGPIOWriteBitResponseOuterClass.java | 205 +++-- .../stubs/StubGPIOWriteByteRequestOuterClass.java | 160 +++- .../stubs/StubGPIOWriteByteResponseOuterClass.java | 203 +++-- .../stubs/StubSteperMotorRequestOuterClass.java | 18 +- .../pmr/stubs/StubValveRequestOuterClass.java | 139 +++- .../Android_Studio/Tango.UnitTesting/build.gradle | 3 +- .../java/com/twine/tango/unittesting/DAL_TST.java | 2 + .../twine/tango/unittesting/NativeBridge_TST.java | 27 + Software/Android_Studio/settings.gradle | 2 +- Software/DB/Tango.mdf | Bin 8388608 -> 8388608 bytes Software/DB/Tango_log.ldf | Bin 8388608 -> 8388608 bytes .../Tango.MachineStudio.UI.csproj | 47 +- .../Native/Tango.ColorLib/ColorLib.cpp | 54 -- .../Visual_Studio/Native/Tango.ColorLib/ColorLib.h | 14 - .../Native/Tango.ColorLib/Exports.cpp | 16 + .../Visual_Studio/Native/Tango.ColorLib/ReadMe.txt | 48 ++ .../Native/Tango.ColorLib/Tango.ColorLib.vcxproj | 229 +++--- .../Tango.ColorLib/Tango.ColorLib.vcxproj.filters | 94 ++- .../Visual_Studio/Native/Tango.ColorLib/Tester.cpp | 25 + .../Visual_Studio/Native/Tango.ColorLib/Tester.h | 19 + Software/Visual_Studio/Native/Tango.ColorLib/pch.h | 8 - .../Native/Tango.ColorLib/targetver.h | 8 + .../Tango.UnitTesting/Protobuf_TST.cs | 21 +- Software/Visual_Studio/Tango.sln | 37 +- 49 files changed, 3762 insertions(+), 810 deletions(-) create mode 100644 Software/Android_Studio/Tango.NativeBridge/.gitignore create mode 100644 Software/Android_Studio/Tango.NativeBridge/CMakeLists.txt create mode 100644 Software/Android_Studio/Tango.NativeBridge/build.gradle create mode 100644 Software/Android_Studio/Tango.NativeBridge/libs/armeabi-v7a/tangoColorLib.so create mode 100644 Software/Android_Studio/Tango.NativeBridge/libs/armeabi-v7a/tangoColorLib.so.recipe create mode 100644 Software/Android_Studio/Tango.NativeBridge/libs/x86_64/tangoColorLib.so create mode 100644 Software/Android_Studio/Tango.NativeBridge/libs/x86_64/tangoColorLib.so.recipe create mode 100644 Software/Android_Studio/Tango.NativeBridge/proguard-rules.pro create mode 100644 Software/Android_Studio/Tango.NativeBridge/src/main/AndroidManifest.xml create mode 100644 Software/Android_Studio/Tango.NativeBridge/src/main/cpp/Android.mk create mode 100644 Software/Android_Studio/Tango.NativeBridge/src/main/cpp/ColorLibAdapter.cpp create mode 100644 Software/Android_Studio/Tango.NativeBridge/src/main/java/com/twine/tango/nativebridge/ColorLibAdapter.java create mode 100644 Software/Android_Studio/Tango.NativeBridge/src/main/res/values/strings.xml create mode 100644 Software/Android_Studio/Tango.PMR/src/main/java/com/twine/tango/pmr/stubs/StubGPIOInputSetupRequestOuterClass.java create mode 100644 Software/Android_Studio/Tango.PMR/src/main/java/com/twine/tango/pmr/stubs/StubGPIOInputSetupResponseOuterClass.java create mode 100644 Software/Android_Studio/Tango.UnitTesting/src/androidTest/java/com/twine/tango/unittesting/NativeBridge_TST.java delete mode 100644 Software/Visual_Studio/Native/Tango.ColorLib/ColorLib.cpp delete mode 100644 Software/Visual_Studio/Native/Tango.ColorLib/ColorLib.h create mode 100644 Software/Visual_Studio/Native/Tango.ColorLib/Exports.cpp create mode 100644 Software/Visual_Studio/Native/Tango.ColorLib/ReadMe.txt create mode 100644 Software/Visual_Studio/Native/Tango.ColorLib/Tester.cpp create mode 100644 Software/Visual_Studio/Native/Tango.ColorLib/Tester.h delete mode 100644 Software/Visual_Studio/Native/Tango.ColorLib/pch.h create mode 100644 Software/Visual_Studio/Native/Tango.ColorLib/targetver.h (limited to 'Software/Android_Studio/Tango.UnitTesting/src/androidTest') diff --git a/Software/Android_Studio/Tango.DAL/build.gradle b/Software/Android_Studio/Tango.DAL/build.gradle index 86c71c619..cf010e8ba 100644 --- a/Software/Android_Studio/Tango.DAL/build.gradle +++ b/Software/Android_Studio/Tango.DAL/build.gradle @@ -73,4 +73,4 @@ task generateEntities(type: Exec, description: 'Generate DAL Entities') { preBuild.dependsOn(copyFiles) -preBuild.dependsOn(generateEntities) \ No newline at end of file +//preBuild.dependsOn(generateEntities) \ No newline at end of file diff --git a/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/enumerations/Permissions.java b/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/enumerations/Permissions.java index cb3cc1c56..b280489a4 100644 --- a/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/enumerations/Permissions.java +++ b/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/enumerations/Permissions.java @@ -14,6 +14,9 @@ public enum Permissions @DescriptionAnnotation(description = "Allows loading the database module in Machine Studio") RunDataBaseModule(2), + @DescriptionAnnotation(description = "Allows loading the synchronization module in machine studio") + RunSynchronizationModule(3), + ; private int value; diff --git a/Software/Android_Studio/Tango.NativeBridge/.gitignore b/Software/Android_Studio/Tango.NativeBridge/.gitignore new file mode 100644 index 000000000..796b96d1c --- /dev/null +++ b/Software/Android_Studio/Tango.NativeBridge/.gitignore @@ -0,0 +1 @@ +/build diff --git a/Software/Android_Studio/Tango.NativeBridge/CMakeLists.txt b/Software/Android_Studio/Tango.NativeBridge/CMakeLists.txt new file mode 100644 index 000000000..aa766bc15 --- /dev/null +++ b/Software/Android_Studio/Tango.NativeBridge/CMakeLists.txt @@ -0,0 +1,21 @@ +cmake_minimum_required(VERSION 3.4.1) + +add_library(colorLibAdapter + SHARED + src/main/cpp/ColorLibAdapter.cpp + ../../Visual_Studio/Native/Tango.ColorLib/Tester.cpp + ../../Visual_Studio/Native/Tango.ColorLib/protobuf-c/protobuf-c.c + ../../Visual_Studio/Native/Tango.ColorLib/PMR/Common/ErrorCode.pb-c.c + ../../Visual_Studio/Native/Tango.ColorLib/PMR/Common/MessageContainer.pb-c.c + ../../Visual_Studio/Native/Tango.ColorLib/PMR/Common/MessageType.pb-c.c + ../../Visual_Studio/Native/Tango.ColorLib/PMR/Stubs/CalculateRequest.pb-c.c + ../../Visual_Studio/Native/Tango.ColorLib/PMR/Stubs/CalculateResponse.pb-c.c) + +find_library(log-lib + log) + +target_include_directories(colorLibAdapter PRIVATE + ../../Visual_Studio/Native/Tango.ColorLib) + +target_link_libraries(colorLibAdapter + ${log-lib} ) \ No newline at end of file diff --git a/Software/Android_Studio/Tango.NativeBridge/build.gradle b/Software/Android_Studio/Tango.NativeBridge/build.gradle new file mode 100644 index 000000000..1454dd7ec --- /dev/null +++ b/Software/Android_Studio/Tango.NativeBridge/build.gradle @@ -0,0 +1,69 @@ +apply plugin: 'com.android.library' + +android { + compileSdkVersion 26 + buildToolsVersion "26.0.1" + + + defaultConfig { + minSdkVersion 22 + targetSdkVersion 22 + versionCode 1 + versionName "1.0" + + testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" + externalNativeBuild { + cmake { + cppFlags "-std=c++11 -frtti -fexceptions" + abiFilters "x86", "armeabi-v7a", "x86_64" + } + } + } + + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' + } + } + + sourceSets { + main { + jniLibs.srcDirs = ['libs'] + } + } + + externalNativeBuild { + cmake { + path "CMakeLists.txt" + } + } +} + +dependencies { + implementation fileTree(include: ['*.jar'], dir: 'libs') + implementation 'com.android.support:appcompat-v7:26.1.0' + testImplementation 'junit:junit:4.12' + androidTestImplementation 'com.android.support.test:runner:1.0.1' + androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1' + compile globalDependencies.protobuf + implementation project(':Tango.PMR') +} + +//Copy native libs (*.so) built by visual studio c++. +//task copyNativeLibsToLibs(type: Copy) { +// from "$projectDir\\..\\..\\Visual_Studio\\Build\\Debug\\NativeNDK" +// into "$projectDir/libs" +//} +//task copyNativeLibsToDist(type: Copy) { +// from "$projectDir\\..\\..\\Visual_Studio\\Build\\Debug\\NativeNDK" +// into "$projectDir/native_distribution" +//} +//task copyColorLibHeader(type: Copy) { +// from "$projectDir\\..\\..\\Visual_Studio\\Native\\Tango.ColorLib\\ColorLib.h" +// into "$projectDir/native_distribution/includes" +//} +// +//preBuild.dependsOn(copyNativeLibsToDist) +//preBuild.dependsOn(copyNativeLibsToLibs) +//preBuild.dependsOn(copyColorLibHeader) \ No newline at end of file diff --git a/Software/Android_Studio/Tango.NativeBridge/libs/armeabi-v7a/tangoColorLib.so b/Software/Android_Studio/Tango.NativeBridge/libs/armeabi-v7a/tangoColorLib.so new file mode 100644 index 000000000..a0d0b4f83 Binary files /dev/null and b/Software/Android_Studio/Tango.NativeBridge/libs/armeabi-v7a/tangoColorLib.so differ diff --git a/Software/Android_Studio/Tango.NativeBridge/libs/armeabi-v7a/tangoColorLib.so.recipe b/Software/Android_Studio/Tango.NativeBridge/libs/armeabi-v7a/tangoColorLib.so.recipe new file mode 100644 index 000000000..adae6e576 --- /dev/null +++ b/Software/Android_Studio/Tango.NativeBridge/libs/armeabi-v7a/tangoColorLib.so.recipe @@ -0,0 +1,11 @@ + + + D:\Development\Tango\Software\Visual_Studio\Native\Tango.ColorLib\..\..\Build\Debug\NativeNDK\armeabi-v7a\tangoColorLib.so;C:\ProgramData\Microsoft\AndroidNDK64\android-ndk-r13b\prebuilt\android-arm\gdbserver\gdbserver;C:\ProgramData\Microsoft\AndroidNDK64\android-ndk-r13b\sources\cxx-stl\gnu-libstdc++\4.9\libs\armeabi-v7a\libgnustl_static.a + + D:\Development\Tango\Software\Visual_Studio\Native\Tango.ColorLib\Intermmediate\ARM\Debug + Debug + ARM + armeabi-v7a + + + \ No newline at end of file diff --git a/Software/Android_Studio/Tango.NativeBridge/libs/x86_64/tangoColorLib.so b/Software/Android_Studio/Tango.NativeBridge/libs/x86_64/tangoColorLib.so new file mode 100644 index 000000000..1abe6e4cc Binary files /dev/null and b/Software/Android_Studio/Tango.NativeBridge/libs/x86_64/tangoColorLib.so differ diff --git a/Software/Android_Studio/Tango.NativeBridge/libs/x86_64/tangoColorLib.so.recipe b/Software/Android_Studio/Tango.NativeBridge/libs/x86_64/tangoColorLib.so.recipe new file mode 100644 index 000000000..42edb070a --- /dev/null +++ b/Software/Android_Studio/Tango.NativeBridge/libs/x86_64/tangoColorLib.so.recipe @@ -0,0 +1,11 @@ + + + D:\Development\Tango\Software\Visual_Studio\Native\Tango.ColorLib\..\..\Build\Debug\NativeNDK\x86_64\tangoColorLib.so;C:\ProgramData\Microsoft\AndroidNDK64\android-ndk-r13b\prebuilt\android-x86_64\gdbserver\gdbserver;C:\ProgramData\Microsoft\AndroidNDK64\android-ndk-r13b\sources\cxx-stl\gnu-libstdc++\4.9\libs\x86_64\libgnustl_static.a + + D:\Development\Tango\Software\Visual_Studio\Native\Tango.ColorLib\Intermmediate\x64\Debug + Debug + x64 + x86_64 + + + \ No newline at end of file diff --git a/Software/Android_Studio/Tango.NativeBridge/proguard-rules.pro b/Software/Android_Studio/Tango.NativeBridge/proguard-rules.pro new file mode 100644 index 000000000..a0eef131a --- /dev/null +++ b/Software/Android_Studio/Tango.NativeBridge/proguard-rules.pro @@ -0,0 +1,25 @@ +# Add project specific ProGuard rules here. +# By default, the flags in this file are appended to flags specified +# in C:\Users\Roy\AppData\Local\Android\Sdk/tools/proguard/proguard-android.txt +# You can edit the include path and order by changing the proguardFiles +# directive in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# Add any project specific keep options here: + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile diff --git a/Software/Android_Studio/Tango.NativeBridge/src/main/AndroidManifest.xml b/Software/Android_Studio/Tango.NativeBridge/src/main/AndroidManifest.xml new file mode 100644 index 000000000..b1fd473cc --- /dev/null +++ b/Software/Android_Studio/Tango.NativeBridge/src/main/AndroidManifest.xml @@ -0,0 +1,2 @@ + diff --git a/Software/Android_Studio/Tango.NativeBridge/src/main/cpp/Android.mk b/Software/Android_Studio/Tango.NativeBridge/src/main/cpp/Android.mk new file mode 100644 index 000000000..e69de29bb diff --git a/Software/Android_Studio/Tango.NativeBridge/src/main/cpp/ColorLibAdapter.cpp b/Software/Android_Studio/Tango.NativeBridge/src/main/cpp/ColorLibAdapter.cpp new file mode 100644 index 000000000..b0b641591 --- /dev/null +++ b/Software/Android_Studio/Tango.NativeBridge/src/main/cpp/ColorLibAdapter.cpp @@ -0,0 +1,26 @@ +#include +#include +#include "Tester.h" + +using Tango::ColoLib::Tester; + +extern "C" JNIEXPORT jbyteArray JNICALL +Java_com_twine_tango_nativebridge_ColorLibAdapter_calculate(JNIEnv *env, jobject callingObject, + jbyteArray request_buffer, + jint request_buffer_size) { + + Tester lib; + + uint8_t *responsePtr = NULL; + + uint8_t *dataPtr = (uint8_t *) env->GetByteArrayElements(request_buffer, JNI_FALSE); + + jint size = lib.Calculate(dataPtr, (size_t) request_buffer_size, responsePtr); + + jbyteArray response_array = env->NewByteArray(size); + + env->SetByteArrayRegion(response_array, 0, size, (jbyte *) responsePtr); + env->ReleaseByteArrayElements(request_buffer, (jbyte*)dataPtr, JNI_ABORT); + + return response_array; +} diff --git a/Software/Android_Studio/Tango.NativeBridge/src/main/java/com/twine/tango/nativebridge/ColorLibAdapter.java b/Software/Android_Studio/Tango.NativeBridge/src/main/java/com/twine/tango/nativebridge/ColorLibAdapter.java new file mode 100644 index 000000000..7d0f4539d --- /dev/null +++ b/Software/Android_Studio/Tango.NativeBridge/src/main/java/com/twine/tango/nativebridge/ColorLibAdapter.java @@ -0,0 +1,40 @@ +package com.twine.tango.nativebridge; + +import com.google.protobuf.InvalidProtocolBufferException; +import com.twine.tango.pmr.stubs.CalculateRequestOuterClass.CalculateRequest; +import com.twine.tango.pmr.stubs.CalculateResponseOuterClass.CalculateResponse; + +/** + * Created by Roy on 12/21/2017. + */ + +public class ColorLibAdapter +{ + public native byte[] calculate(byte[] request_buffer, int request_buffer_size); + + static + { + System.loadLibrary("colorLibAdapter"); + } + + public double calculateProto(double a, double b) + { + double sum = 0; + + CalculateRequest request = CalculateRequest.newBuilder().setA(a).setB(b).build(); + byte[] request_buffer = request.toByteArray(); + + byte[] response_buffer = calculate(request_buffer, request_buffer.length); + + try + { + CalculateResponse response = CalculateResponse.parseFrom(response_buffer); + sum = response.getSum(); + } catch (InvalidProtocolBufferException e) + { + e.printStackTrace(); + } + + return sum; + } +} diff --git a/Software/Android_Studio/Tango.NativeBridge/src/main/res/values/strings.xml b/Software/Android_Studio/Tango.NativeBridge/src/main/res/values/strings.xml new file mode 100644 index 000000000..3310e131d --- /dev/null +++ b/Software/Android_Studio/Tango.NativeBridge/src/main/res/values/strings.xml @@ -0,0 +1,3 @@ + + Tango.NativeBridge + diff --git a/Software/Android_Studio/Tango.PMR/src/main/java/com/twine/tango/pmr/common/MessageTypeOuterClass.java b/Software/Android_Studio/Tango.PMR/src/main/java/com/twine/tango/pmr/common/MessageTypeOuterClass.java index a58b36456..eeced1c83 100644 --- a/Software/Android_Studio/Tango.PMR/src/main/java/com/twine/tango/pmr/common/MessageTypeOuterClass.java +++ b/Software/Android_Studio/Tango.PMR/src/main/java/com/twine/tango/pmr/common/MessageTypeOuterClass.java @@ -72,77 +72,85 @@ public final class MessageTypeOuterClass { */ StubDispenserResponse(12), /** - * StubGPIOReadBitRequest = 13; + * StubGPIOInputSetupRequest = 13; */ - StubGPIOReadBitRequest(13), + StubGPIOInputSetupRequest(13), /** - * StubGPIOReadBitResponse = 14; + * StubGPIOInputSetupResponse = 14; */ - StubGPIOReadBitResponse(14), + StubGPIOInputSetupResponse(14), /** - * StubGPIOReadByteRequest = 15; + * StubGPIOReadBitRequest = 15; */ - StubGPIOReadByteRequest(15), + StubGPIOReadBitRequest(15), /** - * StubGPIOReadByteResponse = 16; + * StubGPIOReadBitResponse = 16; */ - StubGPIOReadByteResponse(16), + StubGPIOReadBitResponse(16), /** - * StubGPIOWriteBitRequest = 17; + * StubGPIOReadByteRequest = 17; */ - StubGPIOWriteBitRequest(17), + StubGPIOReadByteRequest(17), /** - * StubGPIOWriteBitResponse = 18; + * StubGPIOReadByteResponse = 18; */ - StubGPIOWriteBitResponse(18), + StubGPIOReadByteResponse(18), /** - * StubGPIOWriteByteRequest = 19; + * StubGPIOWriteBitRequest = 19; */ - StubGPIOWriteByteRequest(19), + StubGPIOWriteBitRequest(19), /** - * StubGPIOWriteByteResponse = 20; + * StubGPIOWriteBitResponse = 20; */ - StubGPIOWriteByteResponse(20), + StubGPIOWriteBitResponse(20), /** - * StubHeaterRequest = 21; + * StubGPIOWriteByteRequest = 21; */ - StubHeaterRequest(21), + StubGPIOWriteByteRequest(21), /** - * StubHeaterResponse = 22; + * StubGPIOWriteByteResponse = 22; */ - StubHeaterResponse(22), + StubGPIOWriteByteResponse(22), /** - * StubMotorEncoderRequest = 23; + * StubHeaterRequest = 23; */ - StubMotorEncoderRequest(23), + StubHeaterRequest(23), /** - * StubMotorEncoderResponse = 24; + * StubHeaterResponse = 24; */ - StubMotorEncoderResponse(24), + StubHeaterResponse(24), /** - * StubOptLimitSwitchRequest = 25; + * StubMotorEncoderRequest = 25; */ - StubOptLimitSwitchRequest(25), + StubMotorEncoderRequest(25), /** - * StubOptLimitSwitchResponse = 26; + * StubMotorEncoderResponse = 26; */ - StubOptLimitSwitchResponse(26), + StubMotorEncoderResponse(26), /** - * StubSteperMotorRequest = 27; + * StubOptLimitSwitchRequest = 27; */ - StubSteperMotorRequest(27), + StubOptLimitSwitchRequest(27), /** - * StubSteperMotorResponse = 28; + * StubOptLimitSwitchResponse = 28; */ - StubSteperMotorResponse(28), + StubOptLimitSwitchResponse(28), /** - * StubValveRequest = 29; + * StubSteperMotorRequest = 29; */ - StubValveRequest(29), + StubSteperMotorRequest(29), /** - * StubValveResponse = 30; + * StubSteperMotorResponse = 30; */ - StubValveResponse(30), + StubSteperMotorResponse(30), + /** + * StubValveRequest = 31; + */ + StubValveRequest(31), + /** + * StubValveResponse = 32; + */ + StubValveResponse(32), UNRECOGNIZED(-1), ; @@ -199,77 +207,85 @@ public final class MessageTypeOuterClass { */ public static final int StubDispenserResponse_VALUE = 12; /** - * StubGPIOReadBitRequest = 13; + * StubGPIOInputSetupRequest = 13; + */ + public static final int StubGPIOInputSetupRequest_VALUE = 13; + /** + * StubGPIOInputSetupResponse = 14; + */ + public static final int StubGPIOInputSetupResponse_VALUE = 14; + /** + * StubGPIOReadBitRequest = 15; */ - public static final int StubGPIOReadBitRequest_VALUE = 13; + public static final int StubGPIOReadBitRequest_VALUE = 15; /** - * StubGPIOReadBitResponse = 14; + * StubGPIOReadBitResponse = 16; */ - public static final int StubGPIOReadBitResponse_VALUE = 14; + public static final int StubGPIOReadBitResponse_VALUE = 16; /** - * StubGPIOReadByteRequest = 15; + * StubGPIOReadByteRequest = 17; */ - public static final int StubGPIOReadByteRequest_VALUE = 15; + public static final int StubGPIOReadByteRequest_VALUE = 17; /** - * StubGPIOReadByteResponse = 16; + * StubGPIOReadByteResponse = 18; */ - public static final int StubGPIOReadByteResponse_VALUE = 16; + public static final int StubGPIOReadByteResponse_VALUE = 18; /** - * StubGPIOWriteBitRequest = 17; + * StubGPIOWriteBitRequest = 19; */ - public static final int StubGPIOWriteBitRequest_VALUE = 17; + public static final int StubGPIOWriteBitRequest_VALUE = 19; /** - * StubGPIOWriteBitResponse = 18; + * StubGPIOWriteBitResponse = 20; */ - public static final int StubGPIOWriteBitResponse_VALUE = 18; + public static final int StubGPIOWriteBitResponse_VALUE = 20; /** - * StubGPIOWriteByteRequest = 19; + * StubGPIOWriteByteRequest = 21; */ - public static final int StubGPIOWriteByteRequest_VALUE = 19; + public static final int StubGPIOWriteByteRequest_VALUE = 21; /** - * StubGPIOWriteByteResponse = 20; + * StubGPIOWriteByteResponse = 22; */ - public static final int StubGPIOWriteByteResponse_VALUE = 20; + public static final int StubGPIOWriteByteResponse_VALUE = 22; /** - * StubHeaterRequest = 21; + * StubHeaterRequest = 23; */ - public static final int StubHeaterRequest_VALUE = 21; + public static final int StubHeaterRequest_VALUE = 23; /** - * StubHeaterResponse = 22; + * StubHeaterResponse = 24; */ - public static final int StubHeaterResponse_VALUE = 22; + public static final int StubHeaterResponse_VALUE = 24; /** - * StubMotorEncoderRequest = 23; + * StubMotorEncoderRequest = 25; */ - public static final int StubMotorEncoderRequest_VALUE = 23; + public static final int StubMotorEncoderRequest_VALUE = 25; /** - * StubMotorEncoderResponse = 24; + * StubMotorEncoderResponse = 26; */ - public static final int StubMotorEncoderResponse_VALUE = 24; + public static final int StubMotorEncoderResponse_VALUE = 26; /** - * StubOptLimitSwitchRequest = 25; + * StubOptLimitSwitchRequest = 27; */ - public static final int StubOptLimitSwitchRequest_VALUE = 25; + public static final int StubOptLimitSwitchRequest_VALUE = 27; /** - * StubOptLimitSwitchResponse = 26; + * StubOptLimitSwitchResponse = 28; */ - public static final int StubOptLimitSwitchResponse_VALUE = 26; + public static final int StubOptLimitSwitchResponse_VALUE = 28; /** - * StubSteperMotorRequest = 27; + * StubSteperMotorRequest = 29; */ - public static final int StubSteperMotorRequest_VALUE = 27; + public static final int StubSteperMotorRequest_VALUE = 29; /** - * StubSteperMotorResponse = 28; + * StubSteperMotorResponse = 30; */ - public static final int StubSteperMotorResponse_VALUE = 28; + public static final int StubSteperMotorResponse_VALUE = 30; /** - * StubValveRequest = 29; + * StubValveRequest = 31; */ - public static final int StubValveRequest_VALUE = 29; + public static final int StubValveRequest_VALUE = 31; /** - * StubValveResponse = 30; + * StubValveResponse = 32; */ - public static final int StubValveResponse_VALUE = 30; + public static final int StubValveResponse_VALUE = 32; public final int getNumber() { @@ -303,24 +319,26 @@ public final class MessageTypeOuterClass { case 10: return StubCartridgeWriteResponse; case 11: return StubDispenserRequest; case 12: return StubDispenserResponse; - case 13: return StubGPIOReadBitRequest; - case 14: return StubGPIOReadBitResponse; - case 15: return StubGPIOReadByteRequest; - case 16: return StubGPIOReadByteResponse; - case 17: return StubGPIOWriteBitRequest; - case 18: return StubGPIOWriteBitResponse; - case 19: return StubGPIOWriteByteRequest; - case 20: return StubGPIOWriteByteResponse; - case 21: return StubHeaterRequest; - case 22: return StubHeaterResponse; - case 23: return StubMotorEncoderRequest; - case 24: return StubMotorEncoderResponse; - case 25: return StubOptLimitSwitchRequest; - case 26: return StubOptLimitSwitchResponse; - case 27: return StubSteperMotorRequest; - case 28: return StubSteperMotorResponse; - case 29: return StubValveRequest; - case 30: return StubValveResponse; + case 13: return StubGPIOInputSetupRequest; + case 14: return StubGPIOInputSetupResponse; + case 15: return StubGPIOReadBitRequest; + case 16: return StubGPIOReadBitResponse; + case 17: return StubGPIOReadByteRequest; + case 18: return StubGPIOReadByteResponse; + case 19: return StubGPIOWriteBitRequest; + case 20: return StubGPIOWriteBitResponse; + case 21: return StubGPIOWriteByteRequest; + case 22: return StubGPIOWriteByteResponse; + case 23: return StubHeaterRequest; + case 24: return StubHeaterResponse; + case 25: return StubMotorEncoderRequest; + case 26: return StubMotorEncoderResponse; + case 27: return StubOptLimitSwitchRequest; + case 28: return StubOptLimitSwitchResponse; + case 29: return StubSteperMotorRequest; + case 30: return StubSteperMotorResponse; + case 31: return StubValveRequest; + case 32: return StubValveResponse; default: return null; } } @@ -382,7 +400,7 @@ public final class MessageTypeOuterClass { descriptor; static { java.lang.String[] descriptorData = { - "\n\021MessageType.proto\022\020Tango.PMR.Common*\260\006" + + "\n\021MessageType.proto\022\020Tango.PMR.Common*\357\006" + "\n\013MessageType\022\007\n\003RGB\020\000\022\007\n\003Job\020\001\022\013\n\007Segme" + "nt\020\002\022\024\n\020CalculateRequest\020\003\022\025\n\021CalculateR" + "esponse\020\004\022\023\n\017ProgressRequest\020\005\022\024\n\020Progre" + @@ -390,21 +408,22 @@ public final class MessageTypeOuterClass { "\020\007\022\035\n\031StubCartridgeReadResponse\020\010\022\035\n\031Stu" + "bCartridgeWriteRequest\020\t\022\036\n\032StubCartridg" + "eWriteResponse\020\n\022\030\n\024StubDispenserRequest" + - "\020\013\022\031\n\025StubDispenserResponse\020\014\022\032\n\026StubGPI" + - "OReadBitRequest\020\r\022\033\n\027StubGPIOReadBitResp", - "onse\020\016\022\033\n\027StubGPIOReadByteRequest\020\017\022\034\n\030S" + - "tubGPIOReadByteResponse\020\020\022\033\n\027StubGPIOWri" + - "teBitRequest\020\021\022\034\n\030StubGPIOWriteBitRespon" + - "se\020\022\022\034\n\030StubGPIOWriteByteRequest\020\023\022\035\n\031St" + - "ubGPIOWriteByteResponse\020\024\022\025\n\021StubHeaterR" + - "equest\020\025\022\026\n\022StubHeaterResponse\020\026\022\033\n\027Stub" + - "MotorEncoderRequest\020\027\022\034\n\030StubMotorEncode" + - "rResponse\020\030\022\035\n\031StubOptLimitSwitchRequest" + - "\020\031\022\036\n\032StubOptLimitSwitchResponse\020\032\022\032\n\026St" + - "ubSteperMotorRequest\020\033\022\033\n\027StubSteperMoto", - "rResponse\020\034\022\024\n\020StubValveRequest\020\035\022\025\n\021Stu" + - "bValveResponse\020\036B\034\n\032com.twine.tango.pmr." + - "commonb\006proto3" + "\020\013\022\031\n\025StubDispenserResponse\020\014\022\035\n\031StubGPI" + + "OInputSetupRequest\020\r\022\036\n\032StubGPIOInputSet", + "upResponse\020\016\022\032\n\026StubGPIOReadBitRequest\020\017" + + "\022\033\n\027StubGPIOReadBitResponse\020\020\022\033\n\027StubGPI" + + "OReadByteRequest\020\021\022\034\n\030StubGPIOReadByteRe" + + "sponse\020\022\022\033\n\027StubGPIOWriteBitRequest\020\023\022\034\n" + + "\030StubGPIOWriteBitResponse\020\024\022\034\n\030StubGPIOW" + + "riteByteRequest\020\025\022\035\n\031StubGPIOWriteByteRe" + + "sponse\020\026\022\025\n\021StubHeaterRequest\020\027\022\026\n\022StubH" + + "eaterResponse\020\030\022\033\n\027StubMotorEncoderReque" + + "st\020\031\022\034\n\030StubMotorEncoderResponse\020\032\022\035\n\031St" + + "ubOptLimitSwitchRequest\020\033\022\036\n\032StubOptLimi", + "tSwitchResponse\020\034\022\032\n\026StubSteperMotorRequ" + + "est\020\035\022\033\n\027StubSteperMotorResponse\020\036\022\024\n\020St" + + "ubValveRequest\020\037\022\025\n\021StubValveResponse\020 B" + + "\034\n\032com.twine.tango.pmr.commonb\006proto3" }; com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { diff --git a/Software/Android_Studio/Tango.PMR/src/main/java/com/twine/tango/pmr/stubs/StubCartridgeReadResponseOuterClass.java b/Software/Android_Studio/Tango.PMR/src/main/java/com/twine/tango/pmr/stubs/StubCartridgeReadResponseOuterClass.java index eb7fd4cb6..d25c1abcc 100644 --- a/Software/Android_Studio/Tango.PMR/src/main/java/com/twine/tango/pmr/stubs/StubCartridgeReadResponseOuterClass.java +++ b/Software/Android_Studio/Tango.PMR/src/main/java/com/twine/tango/pmr/stubs/StubCartridgeReadResponseOuterClass.java @@ -34,7 +34,7 @@ public final class StubCartridgeReadResponseOuterClass { int getCartridgeVersion(); /** - * uint32 CartridgeData = 5; + * int32 CartridgeData = 5; */ int getCartridgeData(); @@ -114,7 +114,7 @@ public final class StubCartridgeReadResponseOuterClass { } case 40: { - cartridgeData_ = input.readUInt32(); + cartridgeData_ = input.readInt32(); break; } case 48: { @@ -181,7 +181,7 @@ public final class StubCartridgeReadResponseOuterClass { public static final int CARTRIDGEDATA_FIELD_NUMBER = 5; private int cartridgeData_; /** - * uint32 CartridgeData = 5; + * int32 CartridgeData = 5; */ public int getCartridgeData() { return cartridgeData_; @@ -227,7 +227,7 @@ public final class StubCartridgeReadResponseOuterClass { output.writeUInt32(4, cartridgeVersion_); } if (cartridgeData_ != 0) { - output.writeUInt32(5, cartridgeData_); + output.writeInt32(5, cartridgeData_); } if (cartridgeUsed_ != false) { output.writeBool(6, cartridgeUsed_); @@ -257,7 +257,7 @@ public final class StubCartridgeReadResponseOuterClass { } if (cartridgeData_ != 0) { size += com.google.protobuf.CodedOutputStream - .computeUInt32Size(5, cartridgeData_); + .computeInt32Size(5, cartridgeData_); } if (cartridgeUsed_ != false) { size += com.google.protobuf.CodedOutputStream @@ -654,13 +654,13 @@ public final class StubCartridgeReadResponseOuterClass { private int cartridgeData_ ; /** - * uint32 CartridgeData = 5; + * int32 CartridgeData = 5; */ public int getCartridgeData() { return cartridgeData_; } /** - * uint32 CartridgeData = 5; + * int32 CartridgeData = 5; */ public Builder setCartridgeData(int value) { @@ -669,7 +669,7 @@ public final class StubCartridgeReadResponseOuterClass { return this; } /** - * uint32 CartridgeData = 5; + * int32 CartridgeData = 5; */ public Builder clearCartridgeData() { @@ -796,7 +796,7 @@ public final class StubCartridgeReadResponseOuterClass { ".PMR.Stubs\"\240\001\n\031StubCartridgeReadResponse" + "\022\023\n\013CartridgeId\030\001 \001(\r\022\026\n\016CartridgeColor\030" + "\003 \001(\r\022\030\n\020CartridgeVersion\030\004 \001(\r\022\025\n\rCartr" + - "idgeData\030\005 \001(\r\022\025\n\rCartridgeUsed\030\006 \001(\010\022\016\n" + + "idgeData\030\005 \001(\005\022\025\n\rCartridgeUsed\030\006 \001(\010\022\016\n" + "\006Status\030\010 \001(\rB\033\n\031com.twine.tango.pmr.stu" + "bsb\006proto3" }; diff --git a/Software/Android_Studio/Tango.PMR/src/main/java/com/twine/tango/pmr/stubs/StubDispenserRequestOuterClass.java b/Software/Android_Studio/Tango.PMR/src/main/java/com/twine/tango/pmr/stubs/StubDispenserRequestOuterClass.java index e169dfd16..b110673b5 100644 --- a/Software/Android_Studio/Tango.PMR/src/main/java/com/twine/tango/pmr/stubs/StubDispenserRequestOuterClass.java +++ b/Software/Android_Studio/Tango.PMR/src/main/java/com/twine/tango/pmr/stubs/StubDispenserRequestOuterClass.java @@ -50,7 +50,7 @@ public final class StubDispenserRequestOuterClass { * No. of steps for 360 deg. * * - * int32 SetMicrostepDivision = 4; + * uint32 SetMicrostepDivision = 4; */ int getSetMicrostepDivision(); @@ -124,7 +124,7 @@ public final class StubDispenserRequestOuterClass { } case 32: { - setMicrostepDivision_ = input.readInt32(); + setMicrostepDivision_ = input.readUInt32(); break; } case 40: { @@ -202,7 +202,7 @@ public final class StubDispenserRequestOuterClass { * No. of steps for 360 deg. * * - * int32 SetMicrostepDivision = 4; + * uint32 SetMicrostepDivision = 4; */ public int getSetMicrostepDivision() { return setMicrostepDivision_; @@ -239,7 +239,7 @@ public final class StubDispenserRequestOuterClass { output.writeBool(3, setDirection_); } if (setMicrostepDivision_ != 0) { - output.writeInt32(4, setMicrostepDivision_); + output.writeUInt32(4, setMicrostepDivision_); } if (setSpeed_ != 0) { output.writeInt32(5, setSpeed_); @@ -266,7 +266,7 @@ public final class StubDispenserRequestOuterClass { } if (setMicrostepDivision_ != 0) { size += com.google.protobuf.CodedOutputStream - .computeInt32Size(4, setMicrostepDivision_); + .computeUInt32Size(4, setMicrostepDivision_); } if (setSpeed_ != 0) { size += com.google.protobuf.CodedOutputStream @@ -690,7 +690,7 @@ public final class StubDispenserRequestOuterClass { * No. of steps for 360 deg. * * - * int32 SetMicrostepDivision = 4; + * uint32 SetMicrostepDivision = 4; */ public int getSetMicrostepDivision() { return setMicrostepDivision_; @@ -700,7 +700,7 @@ public final class StubDispenserRequestOuterClass { * No. of steps for 360 deg. * * - * int32 SetMicrostepDivision = 4; + * uint32 SetMicrostepDivision = 4; */ public Builder setSetMicrostepDivision(int value) { @@ -713,7 +713,7 @@ public final class StubDispenserRequestOuterClass { * No. of steps for 360 deg. * * - * int32 SetMicrostepDivision = 4; + * uint32 SetMicrostepDivision = 4; */ public Builder clearSetMicrostepDivision() { @@ -813,7 +813,7 @@ public final class StubDispenserRequestOuterClass { "\n\032StubDispenserRequest.proto\022\017Tango.PMR." + "Stubs\"\200\001\n\024StubDispenserRequest\022\023\n\013Dispen" + "serId\030\001 \001(\r\022\r\n\005Start\030\002 \001(\010\022\024\n\014SetDirecti" + - "on\030\003 \001(\010\022\034\n\024SetMicrostepDivision\030\004 \001(\005\022\020" + + "on\030\003 \001(\010\022\034\n\024SetMicrostepDivision\030\004 \001(\r\022\020" + "\n\010SetSpeed\030\005 \001(\005B\033\n\031com.twine.tango.pmr." + "stubsb\006proto3" }; diff --git a/Software/Android_Studio/Tango.PMR/src/main/java/com/twine/tango/pmr/stubs/StubGPIOInputSetupRequestOuterClass.java b/Software/Android_Studio/Tango.PMR/src/main/java/com/twine/tango/pmr/stubs/StubGPIOInputSetupRequestOuterClass.java new file mode 100644 index 000000000..98af7034c --- /dev/null +++ b/Software/Android_Studio/Tango.PMR/src/main/java/com/twine/tango/pmr/stubs/StubGPIOInputSetupRequestOuterClass.java @@ -0,0 +1,865 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: StubGPIOInputSetupRequest.proto + +package com.twine.tango.pmr.stubs; + +public final class StubGPIOInputSetupRequestOuterClass { + private StubGPIOInputSetupRequestOuterClass() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface StubGPIOInputSetupRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:Tango.PMR.Stubs.StubGPIOInputSetupRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+     * A..
+     * 
+ * + * string PortId = 1; + */ + java.lang.String getPortId(); + /** + *
+     * A..
+     * 
+ * + * string PortId = 1; + */ + com.google.protobuf.ByteString + getPortIdBytes(); + + /** + *
+     * 0..7
+     * 
+ * + * uint32 PinId = 2; + */ + int getPinId(); + + /** + *
+     * 0 - Set OUTPUT, 1 - Set INPUT,
+     * 
+ * + * uint32 SetInput = 3; + */ + int getSetInput(); + + /** + *
+     *0 - Down, 1 - Up
+     * 
+ * + * uint32 SetPullUP = 4; + */ + int getSetPullUP(); + } + /** + * Protobuf type {@code Tango.PMR.Stubs.StubGPIOInputSetupRequest} + */ + public static final class StubGPIOInputSetupRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:Tango.PMR.Stubs.StubGPIOInputSetupRequest) + StubGPIOInputSetupRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use StubGPIOInputSetupRequest.newBuilder() to construct. + private StubGPIOInputSetupRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private StubGPIOInputSetupRequest() { + portId_ = ""; + pinId_ = 0; + setInput_ = 0; + setPullUP_ = 0; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private StubGPIOInputSetupRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + portId_ = s; + break; + } + case 16: { + + pinId_ = input.readUInt32(); + break; + } + case 24: { + + setInput_ = input.readUInt32(); + break; + } + case 32: { + + setPullUP_ = input.readUInt32(); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.twine.tango.pmr.stubs.StubGPIOInputSetupRequestOuterClass.internal_static_Tango_PMR_Stubs_StubGPIOInputSetupRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.twine.tango.pmr.stubs.StubGPIOInputSetupRequestOuterClass.internal_static_Tango_PMR_Stubs_StubGPIOInputSetupRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.twine.tango.pmr.stubs.StubGPIOInputSetupRequestOuterClass.StubGPIOInputSetupRequest.class, com.twine.tango.pmr.stubs.StubGPIOInputSetupRequestOuterClass.StubGPIOInputSetupRequest.Builder.class); + } + + public static final int PORTID_FIELD_NUMBER = 1; + private volatile java.lang.Object portId_; + /** + *
+     * A..
+     * 
+ * + * string PortId = 1; + */ + public java.lang.String getPortId() { + java.lang.Object ref = portId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + portId_ = s; + return s; + } + } + /** + *
+     * A..
+     * 
+ * + * string PortId = 1; + */ + public com.google.protobuf.ByteString + getPortIdBytes() { + java.lang.Object ref = portId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + portId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PINID_FIELD_NUMBER = 2; + private int pinId_; + /** + *
+     * 0..7
+     * 
+ * + * uint32 PinId = 2; + */ + public int getPinId() { + return pinId_; + } + + public static final int SETINPUT_FIELD_NUMBER = 3; + private int setInput_; + /** + *
+     * 0 - Set OUTPUT, 1 - Set INPUT,
+     * 
+ * + * uint32 SetInput = 3; + */ + public int getSetInput() { + return setInput_; + } + + public static final int SETPULLUP_FIELD_NUMBER = 4; + private int setPullUP_; + /** + *
+     *0 - Down, 1 - Up
+     * 
+ * + * uint32 SetPullUP = 4; + */ + public int getSetPullUP() { + return setPullUP_; + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getPortIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, portId_); + } + if (pinId_ != 0) { + output.writeUInt32(2, pinId_); + } + if (setInput_ != 0) { + output.writeUInt32(3, setInput_); + } + if (setPullUP_ != 0) { + output.writeUInt32(4, setPullUP_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getPortIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, portId_); + } + if (pinId_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(2, pinId_); + } + if (setInput_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(3, setInput_); + } + if (setPullUP_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(4, setPullUP_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.twine.tango.pmr.stubs.StubGPIOInputSetupRequestOuterClass.StubGPIOInputSetupRequest)) { + return super.equals(obj); + } + com.twine.tango.pmr.stubs.StubGPIOInputSetupRequestOuterClass.StubGPIOInputSetupRequest other = (com.twine.tango.pmr.stubs.StubGPIOInputSetupRequestOuterClass.StubGPIOInputSetupRequest) obj; + + boolean result = true; + result = result && getPortId() + .equals(other.getPortId()); + result = result && (getPinId() + == other.getPinId()); + result = result && (getSetInput() + == other.getSetInput()); + result = result && (getSetPullUP() + == other.getSetPullUP()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PORTID_FIELD_NUMBER; + hash = (53 * hash) + getPortId().hashCode(); + hash = (37 * hash) + PINID_FIELD_NUMBER; + hash = (53 * hash) + getPinId(); + hash = (37 * hash) + SETINPUT_FIELD_NUMBER; + hash = (53 * hash) + getSetInput(); + hash = (37 * hash) + SETPULLUP_FIELD_NUMBER; + hash = (53 * hash) + getSetPullUP(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.twine.tango.pmr.stubs.StubGPIOInputSetupRequestOuterClass.StubGPIOInputSetupRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.twine.tango.pmr.stubs.StubGPIOInputSetupRequestOuterClass.StubGPIOInputSetupRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.twine.tango.pmr.stubs.StubGPIOInputSetupRequestOuterClass.StubGPIOInputSetupRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.twine.tango.pmr.stubs.StubGPIOInputSetupRequestOuterClass.StubGPIOInputSetupRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.twine.tango.pmr.stubs.StubGPIOInputSetupRequestOuterClass.StubGPIOInputSetupRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.twine.tango.pmr.stubs.StubGPIOInputSetupRequestOuterClass.StubGPIOInputSetupRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.twine.tango.pmr.stubs.StubGPIOInputSetupRequestOuterClass.StubGPIOInputSetupRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.twine.tango.pmr.stubs.StubGPIOInputSetupRequestOuterClass.StubGPIOInputSetupRequest parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.twine.tango.pmr.stubs.StubGPIOInputSetupRequestOuterClass.StubGPIOInputSetupRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.twine.tango.pmr.stubs.StubGPIOInputSetupRequestOuterClass.StubGPIOInputSetupRequest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.twine.tango.pmr.stubs.StubGPIOInputSetupRequestOuterClass.StubGPIOInputSetupRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.twine.tango.pmr.stubs.StubGPIOInputSetupRequestOuterClass.StubGPIOInputSetupRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.twine.tango.pmr.stubs.StubGPIOInputSetupRequestOuterClass.StubGPIOInputSetupRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code Tango.PMR.Stubs.StubGPIOInputSetupRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:Tango.PMR.Stubs.StubGPIOInputSetupRequest) + com.twine.tango.pmr.stubs.StubGPIOInputSetupRequestOuterClass.StubGPIOInputSetupRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.twine.tango.pmr.stubs.StubGPIOInputSetupRequestOuterClass.internal_static_Tango_PMR_Stubs_StubGPIOInputSetupRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.twine.tango.pmr.stubs.StubGPIOInputSetupRequestOuterClass.internal_static_Tango_PMR_Stubs_StubGPIOInputSetupRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.twine.tango.pmr.stubs.StubGPIOInputSetupRequestOuterClass.StubGPIOInputSetupRequest.class, com.twine.tango.pmr.stubs.StubGPIOInputSetupRequestOuterClass.StubGPIOInputSetupRequest.Builder.class); + } + + // Construct using com.twine.tango.pmr.stubs.StubGPIOInputSetupRequestOuterClass.StubGPIOInputSetupRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + portId_ = ""; + + pinId_ = 0; + + setInput_ = 0; + + setPullUP_ = 0; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.twine.tango.pmr.stubs.StubGPIOInputSetupRequestOuterClass.internal_static_Tango_PMR_Stubs_StubGPIOInputSetupRequest_descriptor; + } + + public com.twine.tango.pmr.stubs.StubGPIOInputSetupRequestOuterClass.StubGPIOInputSetupRequest getDefaultInstanceForType() { + return com.twine.tango.pmr.stubs.StubGPIOInputSetupRequestOuterClass.StubGPIOInputSetupRequest.getDefaultInstance(); + } + + public com.twine.tango.pmr.stubs.StubGPIOInputSetupRequestOuterClass.StubGPIOInputSetupRequest build() { + com.twine.tango.pmr.stubs.StubGPIOInputSetupRequestOuterClass.StubGPIOInputSetupRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.twine.tango.pmr.stubs.StubGPIOInputSetupRequestOuterClass.StubGPIOInputSetupRequest buildPartial() { + com.twine.tango.pmr.stubs.StubGPIOInputSetupRequestOuterClass.StubGPIOInputSetupRequest result = new com.twine.tango.pmr.stubs.StubGPIOInputSetupRequestOuterClass.StubGPIOInputSetupRequest(this); + result.portId_ = portId_; + result.pinId_ = pinId_; + result.setInput_ = setInput_; + result.setPullUP_ = setPullUP_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.twine.tango.pmr.stubs.StubGPIOInputSetupRequestOuterClass.StubGPIOInputSetupRequest) { + return mergeFrom((com.twine.tango.pmr.stubs.StubGPIOInputSetupRequestOuterClass.StubGPIOInputSetupRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.twine.tango.pmr.stubs.StubGPIOInputSetupRequestOuterClass.StubGPIOInputSetupRequest other) { + if (other == com.twine.tango.pmr.stubs.StubGPIOInputSetupRequestOuterClass.StubGPIOInputSetupRequest.getDefaultInstance()) return this; + if (!other.getPortId().isEmpty()) { + portId_ = other.portId_; + onChanged(); + } + if (other.getPinId() != 0) { + setPinId(other.getPinId()); + } + if (other.getSetInput() != 0) { + setSetInput(other.getSetInput()); + } + if (other.getSetPullUP() != 0) { + setSetPullUP(other.getSetPullUP()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.twine.tango.pmr.stubs.StubGPIOInputSetupRequestOuterClass.StubGPIOInputSetupRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.twine.tango.pmr.stubs.StubGPIOInputSetupRequestOuterClass.StubGPIOInputSetupRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object portId_ = ""; + /** + *
+       * A..
+       * 
+ * + * string PortId = 1; + */ + public java.lang.String getPortId() { + java.lang.Object ref = portId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + portId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+       * A..
+       * 
+ * + * string PortId = 1; + */ + public com.google.protobuf.ByteString + getPortIdBytes() { + java.lang.Object ref = portId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + portId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       * A..
+       * 
+ * + * string PortId = 1; + */ + public Builder setPortId( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + portId_ = value; + onChanged(); + return this; + } + /** + *
+       * A..
+       * 
+ * + * string PortId = 1; + */ + public Builder clearPortId() { + + portId_ = getDefaultInstance().getPortId(); + onChanged(); + return this; + } + /** + *
+       * A..
+       * 
+ * + * string PortId = 1; + */ + public Builder setPortIdBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + portId_ = value; + onChanged(); + return this; + } + + private int pinId_ ; + /** + *
+       * 0..7
+       * 
+ * + * uint32 PinId = 2; + */ + public int getPinId() { + return pinId_; + } + /** + *
+       * 0..7
+       * 
+ * + * uint32 PinId = 2; + */ + public Builder setPinId(int value) { + + pinId_ = value; + onChanged(); + return this; + } + /** + *
+       * 0..7
+       * 
+ * + * uint32 PinId = 2; + */ + public Builder clearPinId() { + + pinId_ = 0; + onChanged(); + return this; + } + + private int setInput_ ; + /** + *
+       * 0 - Set OUTPUT, 1 - Set INPUT,
+       * 
+ * + * uint32 SetInput = 3; + */ + public int getSetInput() { + return setInput_; + } + /** + *
+       * 0 - Set OUTPUT, 1 - Set INPUT,
+       * 
+ * + * uint32 SetInput = 3; + */ + public Builder setSetInput(int value) { + + setInput_ = value; + onChanged(); + return this; + } + /** + *
+       * 0 - Set OUTPUT, 1 - Set INPUT,
+       * 
+ * + * uint32 SetInput = 3; + */ + public Builder clearSetInput() { + + setInput_ = 0; + onChanged(); + return this; + } + + private int setPullUP_ ; + /** + *
+       *0 - Down, 1 - Up
+       * 
+ * + * uint32 SetPullUP = 4; + */ + public int getSetPullUP() { + return setPullUP_; + } + /** + *
+       *0 - Down, 1 - Up
+       * 
+ * + * uint32 SetPullUP = 4; + */ + public Builder setSetPullUP(int value) { + + setPullUP_ = value; + onChanged(); + return this; + } + /** + *
+       *0 - Down, 1 - Up
+       * 
+ * + * uint32 SetPullUP = 4; + */ + public Builder clearSetPullUP() { + + setPullUP_ = 0; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:Tango.PMR.Stubs.StubGPIOInputSetupRequest) + } + + // @@protoc_insertion_point(class_scope:Tango.PMR.Stubs.StubGPIOInputSetupRequest) + private static final com.twine.tango.pmr.stubs.StubGPIOInputSetupRequestOuterClass.StubGPIOInputSetupRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.twine.tango.pmr.stubs.StubGPIOInputSetupRequestOuterClass.StubGPIOInputSetupRequest(); + } + + public static com.twine.tango.pmr.stubs.StubGPIOInputSetupRequestOuterClass.StubGPIOInputSetupRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public StubGPIOInputSetupRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new StubGPIOInputSetupRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.twine.tango.pmr.stubs.StubGPIOInputSetupRequestOuterClass.StubGPIOInputSetupRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_Tango_PMR_Stubs_StubGPIOInputSetupRequest_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_Tango_PMR_Stubs_StubGPIOInputSetupRequest_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\037StubGPIOInputSetupRequest.proto\022\017Tango" + + ".PMR.Stubs\"_\n\031StubGPIOInputSetupRequest\022" + + "\016\n\006PortId\030\001 \001(\t\022\r\n\005PinId\030\002 \001(\r\022\020\n\010SetInp" + + "ut\030\003 \001(\r\022\021\n\tSetPullUP\030\004 \001(\rB\033\n\031com.twine" + + ".tango.pmr.stubsb\006proto3" + }; + com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = + new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { + public com.google.protobuf.ExtensionRegistry assignDescriptors( + com.google.protobuf.Descriptors.FileDescriptor root) { + descriptor = root; + return null; + } + }; + com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }, assigner); + internal_static_Tango_PMR_Stubs_StubGPIOInputSetupRequest_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_Tango_PMR_Stubs_StubGPIOInputSetupRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_Tango_PMR_Stubs_StubGPIOInputSetupRequest_descriptor, + new java.lang.String[] { "PortId", "PinId", "SetInput", "SetPullUP", }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/Software/Android_Studio/Tango.PMR/src/main/java/com/twine/tango/pmr/stubs/StubGPIOInputSetupResponseOuterClass.java b/Software/Android_Studio/Tango.PMR/src/main/java/com/twine/tango/pmr/stubs/StubGPIOInputSetupResponseOuterClass.java new file mode 100644 index 000000000..41089165c --- /dev/null +++ b/Software/Android_Studio/Tango.PMR/src/main/java/com/twine/tango/pmr/stubs/StubGPIOInputSetupResponseOuterClass.java @@ -0,0 +1,782 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: StubGPIOInputSetupResponse.proto + +package com.twine.tango.pmr.stubs; + +public final class StubGPIOInputSetupResponseOuterClass { + private StubGPIOInputSetupResponseOuterClass() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface StubGPIOInputSetupResponseOrBuilder extends + // @@protoc_insertion_point(interface_extends:Tango.PMR.Stubs.StubGPIOInputSetupResponse) + com.google.protobuf.MessageOrBuilder { + + /** + *
+     * A..
+     * 
+ * + * string PortId = 1; + */ + java.lang.String getPortId(); + /** + *
+     * A..
+     * 
+ * + * string PortId = 1; + */ + com.google.protobuf.ByteString + getPortIdBytes(); + + /** + *
+     * 0..7
+     * 
+ * + * uint32 PinId = 2; + */ + int getPinId(); + + /** + *
+     * 0-OK 1-Failed
+     * 
+ * + * uint32 Status = 3; + */ + int getStatus(); + } + /** + * Protobuf type {@code Tango.PMR.Stubs.StubGPIOInputSetupResponse} + */ + public static final class StubGPIOInputSetupResponse extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:Tango.PMR.Stubs.StubGPIOInputSetupResponse) + StubGPIOInputSetupResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use StubGPIOInputSetupResponse.newBuilder() to construct. + private StubGPIOInputSetupResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private StubGPIOInputSetupResponse() { + portId_ = ""; + pinId_ = 0; + status_ = 0; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private StubGPIOInputSetupResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + portId_ = s; + break; + } + case 16: { + + pinId_ = input.readUInt32(); + break; + } + case 24: { + + status_ = input.readUInt32(); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.twine.tango.pmr.stubs.StubGPIOInputSetupResponseOuterClass.internal_static_Tango_PMR_Stubs_StubGPIOInputSetupResponse_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.twine.tango.pmr.stubs.StubGPIOInputSetupResponseOuterClass.internal_static_Tango_PMR_Stubs_StubGPIOInputSetupResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.twine.tango.pmr.stubs.StubGPIOInputSetupResponseOuterClass.StubGPIOInputSetupResponse.class, com.twine.tango.pmr.stubs.StubGPIOInputSetupResponseOuterClass.StubGPIOInputSetupResponse.Builder.class); + } + + public static final int PORTID_FIELD_NUMBER = 1; + private volatile java.lang.Object portId_; + /** + *
+     * A..
+     * 
+ * + * string PortId = 1; + */ + public java.lang.String getPortId() { + java.lang.Object ref = portId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + portId_ = s; + return s; + } + } + /** + *
+     * A..
+     * 
+ * + * string PortId = 1; + */ + public com.google.protobuf.ByteString + getPortIdBytes() { + java.lang.Object ref = portId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + portId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PINID_FIELD_NUMBER = 2; + private int pinId_; + /** + *
+     * 0..7
+     * 
+ * + * uint32 PinId = 2; + */ + public int getPinId() { + return pinId_; + } + + public static final int STATUS_FIELD_NUMBER = 3; + private int status_; + /** + *
+     * 0-OK 1-Failed
+     * 
+ * + * uint32 Status = 3; + */ + public int getStatus() { + return status_; + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getPortIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, portId_); + } + if (pinId_ != 0) { + output.writeUInt32(2, pinId_); + } + if (status_ != 0) { + output.writeUInt32(3, status_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getPortIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, portId_); + } + if (pinId_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(2, pinId_); + } + if (status_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(3, status_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.twine.tango.pmr.stubs.StubGPIOInputSetupResponseOuterClass.StubGPIOInputSetupResponse)) { + return super.equals(obj); + } + com.twine.tango.pmr.stubs.StubGPIOInputSetupResponseOuterClass.StubGPIOInputSetupResponse other = (com.twine.tango.pmr.stubs.StubGPIOInputSetupResponseOuterClass.StubGPIOInputSetupResponse) obj; + + boolean result = true; + result = result && getPortId() + .equals(other.getPortId()); + result = result && (getPinId() + == other.getPinId()); + result = result && (getStatus() + == other.getStatus()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PORTID_FIELD_NUMBER; + hash = (53 * hash) + getPortId().hashCode(); + hash = (37 * hash) + PINID_FIELD_NUMBER; + hash = (53 * hash) + getPinId(); + hash = (37 * hash) + STATUS_FIELD_NUMBER; + hash = (53 * hash) + getStatus(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.twine.tango.pmr.stubs.StubGPIOInputSetupResponseOuterClass.StubGPIOInputSetupResponse parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.twine.tango.pmr.stubs.StubGPIOInputSetupResponseOuterClass.StubGPIOInputSetupResponse parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.twine.tango.pmr.stubs.StubGPIOInputSetupResponseOuterClass.StubGPIOInputSetupResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.twine.tango.pmr.stubs.StubGPIOInputSetupResponseOuterClass.StubGPIOInputSetupResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.twine.tango.pmr.stubs.StubGPIOInputSetupResponseOuterClass.StubGPIOInputSetupResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.twine.tango.pmr.stubs.StubGPIOInputSetupResponseOuterClass.StubGPIOInputSetupResponse parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.twine.tango.pmr.stubs.StubGPIOInputSetupResponseOuterClass.StubGPIOInputSetupResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.twine.tango.pmr.stubs.StubGPIOInputSetupResponseOuterClass.StubGPIOInputSetupResponse parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.twine.tango.pmr.stubs.StubGPIOInputSetupResponseOuterClass.StubGPIOInputSetupResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.twine.tango.pmr.stubs.StubGPIOInputSetupResponseOuterClass.StubGPIOInputSetupResponse parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.twine.tango.pmr.stubs.StubGPIOInputSetupResponseOuterClass.StubGPIOInputSetupResponse parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.twine.tango.pmr.stubs.StubGPIOInputSetupResponseOuterClass.StubGPIOInputSetupResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.twine.tango.pmr.stubs.StubGPIOInputSetupResponseOuterClass.StubGPIOInputSetupResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code Tango.PMR.Stubs.StubGPIOInputSetupResponse} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:Tango.PMR.Stubs.StubGPIOInputSetupResponse) + com.twine.tango.pmr.stubs.StubGPIOInputSetupResponseOuterClass.StubGPIOInputSetupResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.twine.tango.pmr.stubs.StubGPIOInputSetupResponseOuterClass.internal_static_Tango_PMR_Stubs_StubGPIOInputSetupResponse_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.twine.tango.pmr.stubs.StubGPIOInputSetupResponseOuterClass.internal_static_Tango_PMR_Stubs_StubGPIOInputSetupResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.twine.tango.pmr.stubs.StubGPIOInputSetupResponseOuterClass.StubGPIOInputSetupResponse.class, com.twine.tango.pmr.stubs.StubGPIOInputSetupResponseOuterClass.StubGPIOInputSetupResponse.Builder.class); + } + + // Construct using com.twine.tango.pmr.stubs.StubGPIOInputSetupResponseOuterClass.StubGPIOInputSetupResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + portId_ = ""; + + pinId_ = 0; + + status_ = 0; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.twine.tango.pmr.stubs.StubGPIOInputSetupResponseOuterClass.internal_static_Tango_PMR_Stubs_StubGPIOInputSetupResponse_descriptor; + } + + public com.twine.tango.pmr.stubs.StubGPIOInputSetupResponseOuterClass.StubGPIOInputSetupResponse getDefaultInstanceForType() { + return com.twine.tango.pmr.stubs.StubGPIOInputSetupResponseOuterClass.StubGPIOInputSetupResponse.getDefaultInstance(); + } + + public com.twine.tango.pmr.stubs.StubGPIOInputSetupResponseOuterClass.StubGPIOInputSetupResponse build() { + com.twine.tango.pmr.stubs.StubGPIOInputSetupResponseOuterClass.StubGPIOInputSetupResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.twine.tango.pmr.stubs.StubGPIOInputSetupResponseOuterClass.StubGPIOInputSetupResponse buildPartial() { + com.twine.tango.pmr.stubs.StubGPIOInputSetupResponseOuterClass.StubGPIOInputSetupResponse result = new com.twine.tango.pmr.stubs.StubGPIOInputSetupResponseOuterClass.StubGPIOInputSetupResponse(this); + result.portId_ = portId_; + result.pinId_ = pinId_; + result.status_ = status_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.twine.tango.pmr.stubs.StubGPIOInputSetupResponseOuterClass.StubGPIOInputSetupResponse) { + return mergeFrom((com.twine.tango.pmr.stubs.StubGPIOInputSetupResponseOuterClass.StubGPIOInputSetupResponse)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.twine.tango.pmr.stubs.StubGPIOInputSetupResponseOuterClass.StubGPIOInputSetupResponse other) { + if (other == com.twine.tango.pmr.stubs.StubGPIOInputSetupResponseOuterClass.StubGPIOInputSetupResponse.getDefaultInstance()) return this; + if (!other.getPortId().isEmpty()) { + portId_ = other.portId_; + onChanged(); + } + if (other.getPinId() != 0) { + setPinId(other.getPinId()); + } + if (other.getStatus() != 0) { + setStatus(other.getStatus()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.twine.tango.pmr.stubs.StubGPIOInputSetupResponseOuterClass.StubGPIOInputSetupResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.twine.tango.pmr.stubs.StubGPIOInputSetupResponseOuterClass.StubGPIOInputSetupResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object portId_ = ""; + /** + *
+       * A..
+       * 
+ * + * string PortId = 1; + */ + public java.lang.String getPortId() { + java.lang.Object ref = portId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + portId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+       * A..
+       * 
+ * + * string PortId = 1; + */ + public com.google.protobuf.ByteString + getPortIdBytes() { + java.lang.Object ref = portId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + portId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       * A..
+       * 
+ * + * string PortId = 1; + */ + public Builder setPortId( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + portId_ = value; + onChanged(); + return this; + } + /** + *
+       * A..
+       * 
+ * + * string PortId = 1; + */ + public Builder clearPortId() { + + portId_ = getDefaultInstance().getPortId(); + onChanged(); + return this; + } + /** + *
+       * A..
+       * 
+ * + * string PortId = 1; + */ + public Builder setPortIdBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + portId_ = value; + onChanged(); + return this; + } + + private int pinId_ ; + /** + *
+       * 0..7
+       * 
+ * + * uint32 PinId = 2; + */ + public int getPinId() { + return pinId_; + } + /** + *
+       * 0..7
+       * 
+ * + * uint32 PinId = 2; + */ + public Builder setPinId(int value) { + + pinId_ = value; + onChanged(); + return this; + } + /** + *
+       * 0..7
+       * 
+ * + * uint32 PinId = 2; + */ + public Builder clearPinId() { + + pinId_ = 0; + onChanged(); + return this; + } + + private int status_ ; + /** + *
+       * 0-OK 1-Failed
+       * 
+ * + * uint32 Status = 3; + */ + public int getStatus() { + return status_; + } + /** + *
+       * 0-OK 1-Failed
+       * 
+ * + * uint32 Status = 3; + */ + public Builder setStatus(int value) { + + status_ = value; + onChanged(); + return this; + } + /** + *
+       * 0-OK 1-Failed
+       * 
+ * + * uint32 Status = 3; + */ + public Builder clearStatus() { + + status_ = 0; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:Tango.PMR.Stubs.StubGPIOInputSetupResponse) + } + + // @@protoc_insertion_point(class_scope:Tango.PMR.Stubs.StubGPIOInputSetupResponse) + private static final com.twine.tango.pmr.stubs.StubGPIOInputSetupResponseOuterClass.StubGPIOInputSetupResponse DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.twine.tango.pmr.stubs.StubGPIOInputSetupResponseOuterClass.StubGPIOInputSetupResponse(); + } + + public static com.twine.tango.pmr.stubs.StubGPIOInputSetupResponseOuterClass.StubGPIOInputSetupResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public StubGPIOInputSetupResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new StubGPIOInputSetupResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.twine.tango.pmr.stubs.StubGPIOInputSetupResponseOuterClass.StubGPIOInputSetupResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_Tango_PMR_Stubs_StubGPIOInputSetupResponse_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_Tango_PMR_Stubs_StubGPIOInputSetupResponse_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n StubGPIOInputSetupResponse.proto\022\017Tang" + + "o.PMR.Stubs\"K\n\032StubGPIOInputSetupRespons" + + "e\022\016\n\006PortId\030\001 \001(\t\022\r\n\005PinId\030\002 \001(\r\022\016\n\006Stat" + + "us\030\003 \001(\rB\033\n\031com.twine.tango.pmr.stubsb\006p" + + "roto3" + }; + com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = + new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { + public com.google.protobuf.ExtensionRegistry assignDescriptors( + com.google.protobuf.Descriptors.FileDescriptor root) { + descriptor = root; + return null; + } + }; + com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }, assigner); + internal_static_Tango_PMR_Stubs_StubGPIOInputSetupResponse_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_Tango_PMR_Stubs_StubGPIOInputSetupResponse_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_Tango_PMR_Stubs_StubGPIOInputSetupResponse_descriptor, + new java.lang.String[] { "PortId", "PinId", "Status", }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/Software/Android_Studio/Tango.PMR/src/main/java/com/twine/tango/pmr/stubs/StubGPIOReadBitRequestOuterClass.java b/Software/Android_Studio/Tango.PMR/src/main/java/com/twine/tango/pmr/stubs/StubGPIOReadBitRequestOuterClass.java index 504cfbacb..8d683244b 100644 --- a/Software/Android_Studio/Tango.PMR/src/main/java/com/twine/tango/pmr/stubs/StubGPIOReadBitRequestOuterClass.java +++ b/Software/Android_Studio/Tango.PMR/src/main/java/com/twine/tango/pmr/stubs/StubGPIOReadBitRequestOuterClass.java @@ -20,12 +20,21 @@ public final class StubGPIOReadBitRequestOuterClass { /** *
-     * 0..119
+     * A..
      * 
* - * uint32 PortId = 1; + * string PortId = 1; */ - int getPortId(); + java.lang.String getPortId(); + /** + *
+     * A..
+     * 
+ * + * string PortId = 1; + */ + com.google.protobuf.ByteString + getPortIdBytes(); /** *
@@ -35,6 +44,24 @@ public final class StubGPIOReadBitRequestOuterClass {
      * uint32 PinId = 2;
      */
     int getPinId();
+
+    /**
+     * 
+     * 1 - Polling
+     * 
+ * + * bool Polling = 3; + */ + boolean getPolling(); + + /** + *
+     * 0/1
+     * 
+ * + * bool PollExpValue = 4; + */ + boolean getPollExpValue(); } /** * Protobuf type {@code Tango.PMR.Stubs.StubGPIOReadBitRequest} @@ -49,8 +76,10 @@ public final class StubGPIOReadBitRequestOuterClass { super(builder); } private StubGPIOReadBitRequest() { - portId_ = 0; + portId_ = ""; pinId_ = 0; + polling_ = false; + pollExpValue_ = false; } @java.lang.Override @@ -81,9 +110,10 @@ public final class StubGPIOReadBitRequestOuterClass { } break; } - case 8: { + case 10: { + java.lang.String s = input.readStringRequireUtf8(); - portId_ = input.readUInt32(); + portId_ = s; break; } case 16: { @@ -91,6 +121,16 @@ public final class StubGPIOReadBitRequestOuterClass { pinId_ = input.readUInt32(); break; } + case 24: { + + polling_ = input.readBool(); + break; + } + case 32: { + + pollExpValue_ = input.readBool(); + break; + } } } } catch (com.google.protobuf.InvalidProtocolBufferException e) { @@ -116,16 +156,45 @@ public final class StubGPIOReadBitRequestOuterClass { } public static final int PORTID_FIELD_NUMBER = 1; - private int portId_; + private volatile java.lang.Object portId_; + /** + *
+     * A..
+     * 
+ * + * string PortId = 1; + */ + public java.lang.String getPortId() { + java.lang.Object ref = portId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + portId_ = s; + return s; + } + } /** *
-     * 0..119
+     * A..
      * 
* - * uint32 PortId = 1; + * string PortId = 1; */ - public int getPortId() { - return portId_; + public com.google.protobuf.ByteString + getPortIdBytes() { + java.lang.Object ref = portId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + portId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } } public static final int PINID_FIELD_NUMBER = 2; @@ -141,6 +210,32 @@ public final class StubGPIOReadBitRequestOuterClass { return pinId_; } + public static final int POLLING_FIELD_NUMBER = 3; + private boolean polling_; + /** + *
+     * 1 - Polling
+     * 
+ * + * bool Polling = 3; + */ + public boolean getPolling() { + return polling_; + } + + public static final int POLLEXPVALUE_FIELD_NUMBER = 4; + private boolean pollExpValue_; + /** + *
+     * 0/1
+     * 
+ * + * bool PollExpValue = 4; + */ + public boolean getPollExpValue() { + return pollExpValue_; + } + private byte memoizedIsInitialized = -1; public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; @@ -153,12 +248,18 @@ public final class StubGPIOReadBitRequestOuterClass { public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (portId_ != 0) { - output.writeUInt32(1, portId_); + if (!getPortIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, portId_); } if (pinId_ != 0) { output.writeUInt32(2, pinId_); } + if (polling_ != false) { + output.writeBool(3, polling_); + } + if (pollExpValue_ != false) { + output.writeBool(4, pollExpValue_); + } unknownFields.writeTo(output); } @@ -167,14 +268,21 @@ public final class StubGPIOReadBitRequestOuterClass { if (size != -1) return size; size = 0; - if (portId_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeUInt32Size(1, portId_); + if (!getPortIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, portId_); } if (pinId_ != 0) { size += com.google.protobuf.CodedOutputStream .computeUInt32Size(2, pinId_); } + if (polling_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(3, polling_); + } + if (pollExpValue_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(4, pollExpValue_); + } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; @@ -191,10 +299,14 @@ public final class StubGPIOReadBitRequestOuterClass { com.twine.tango.pmr.stubs.StubGPIOReadBitRequestOuterClass.StubGPIOReadBitRequest other = (com.twine.tango.pmr.stubs.StubGPIOReadBitRequestOuterClass.StubGPIOReadBitRequest) obj; boolean result = true; - result = result && (getPortId() - == other.getPortId()); + result = result && getPortId() + .equals(other.getPortId()); result = result && (getPinId() == other.getPinId()); + result = result && (getPolling() + == other.getPolling()); + result = result && (getPollExpValue() + == other.getPollExpValue()); result = result && unknownFields.equals(other.unknownFields); return result; } @@ -207,9 +319,15 @@ public final class StubGPIOReadBitRequestOuterClass { int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + PORTID_FIELD_NUMBER; - hash = (53 * hash) + getPortId(); + hash = (53 * hash) + getPortId().hashCode(); hash = (37 * hash) + PINID_FIELD_NUMBER; hash = (53 * hash) + getPinId(); + hash = (37 * hash) + POLLING_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getPolling()); + hash = (37 * hash) + POLLEXPVALUE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getPollExpValue()); hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; @@ -339,10 +457,14 @@ public final class StubGPIOReadBitRequestOuterClass { } public Builder clear() { super.clear(); - portId_ = 0; + portId_ = ""; pinId_ = 0; + polling_ = false; + + pollExpValue_ = false; + return this; } @@ -367,6 +489,8 @@ public final class StubGPIOReadBitRequestOuterClass { com.twine.tango.pmr.stubs.StubGPIOReadBitRequestOuterClass.StubGPIOReadBitRequest result = new com.twine.tango.pmr.stubs.StubGPIOReadBitRequestOuterClass.StubGPIOReadBitRequest(this); result.portId_ = portId_; result.pinId_ = pinId_; + result.polling_ = polling_; + result.pollExpValue_ = pollExpValue_; onBuilt(); return result; } @@ -408,12 +532,19 @@ public final class StubGPIOReadBitRequestOuterClass { public Builder mergeFrom(com.twine.tango.pmr.stubs.StubGPIOReadBitRequestOuterClass.StubGPIOReadBitRequest other) { if (other == com.twine.tango.pmr.stubs.StubGPIOReadBitRequestOuterClass.StubGPIOReadBitRequest.getDefaultInstance()) return this; - if (other.getPortId() != 0) { - setPortId(other.getPortId()); + if (!other.getPortId().isEmpty()) { + portId_ = other.portId_; + onChanged(); } if (other.getPinId() != 0) { setPinId(other.getPinId()); } + if (other.getPolling() != false) { + setPolling(other.getPolling()); + } + if (other.getPollExpValue() != false) { + setPollExpValue(other.getPollExpValue()); + } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; @@ -441,40 +572,91 @@ public final class StubGPIOReadBitRequestOuterClass { return this; } - private int portId_ ; + private java.lang.Object portId_ = ""; /** *
-       * 0..119
+       * A..
        * 
* - * uint32 PortId = 1; + * string PortId = 1; */ - public int getPortId() { - return portId_; + public java.lang.String getPortId() { + java.lang.Object ref = portId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + portId_ = s; + return s; + } else { + return (java.lang.String) ref; + } } /** *
-       * 0..119
+       * A..
        * 
* - * uint32 PortId = 1; + * string PortId = 1; */ - public Builder setPortId(int value) { - + public com.google.protobuf.ByteString + getPortIdBytes() { + java.lang.Object ref = portId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + portId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       * A..
+       * 
+ * + * string PortId = 1; + */ + public Builder setPortId( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + portId_ = value; onChanged(); return this; } /** *
-       * 0..119
+       * A..
        * 
* - * uint32 PortId = 1; + * string PortId = 1; */ public Builder clearPortId() { - portId_ = 0; + portId_ = getDefaultInstance().getPortId(); + onChanged(); + return this; + } + /** + *
+       * A..
+       * 
+ * + * string PortId = 1; + */ + public Builder setPortIdBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + portId_ = value; onChanged(); return this; } @@ -516,6 +698,82 @@ public final class StubGPIOReadBitRequestOuterClass { onChanged(); return this; } + + private boolean polling_ ; + /** + *
+       * 1 - Polling
+       * 
+ * + * bool Polling = 3; + */ + public boolean getPolling() { + return polling_; + } + /** + *
+       * 1 - Polling
+       * 
+ * + * bool Polling = 3; + */ + public Builder setPolling(boolean value) { + + polling_ = value; + onChanged(); + return this; + } + /** + *
+       * 1 - Polling
+       * 
+ * + * bool Polling = 3; + */ + public Builder clearPolling() { + + polling_ = false; + onChanged(); + return this; + } + + private boolean pollExpValue_ ; + /** + *
+       * 0/1
+       * 
+ * + * bool PollExpValue = 4; + */ + public boolean getPollExpValue() { + return pollExpValue_; + } + /** + *
+       * 0/1
+       * 
+ * + * bool PollExpValue = 4; + */ + public Builder setPollExpValue(boolean value) { + + pollExpValue_ = value; + onChanged(); + return this; + } + /** + *
+       * 0/1
+       * 
+ * + * bool PollExpValue = 4; + */ + public Builder clearPollExpValue() { + + pollExpValue_ = false; + onChanged(); + return this; + } public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFieldsProto3(unknownFields); @@ -580,9 +838,10 @@ public final class StubGPIOReadBitRequestOuterClass { static { java.lang.String[] descriptorData = { "\n\034StubGPIOReadBitRequest.proto\022\017Tango.PM" + - "R.Stubs\"7\n\026StubGPIOReadBitRequest\022\016\n\006Por" + - "tId\030\001 \001(\r\022\r\n\005PinId\030\002 \001(\rB\033\n\031com.twine.ta" + - "ngo.pmr.stubsb\006proto3" + "R.Stubs\"^\n\026StubGPIOReadBitRequest\022\016\n\006Por" + + "tId\030\001 \001(\t\022\r\n\005PinId\030\002 \001(\r\022\017\n\007Polling\030\003 \001(" + + "\010\022\024\n\014PollExpValue\030\004 \001(\010B\033\n\031com.twine.tan" + + "go.pmr.stubsb\006proto3" }; com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { @@ -601,7 +860,7 @@ public final class StubGPIOReadBitRequestOuterClass { internal_static_Tango_PMR_Stubs_StubGPIOReadBitRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_Tango_PMR_Stubs_StubGPIOReadBitRequest_descriptor, - new java.lang.String[] { "PortId", "PinId", }); + new java.lang.String[] { "PortId", "PinId", "Polling", "PollExpValue", }); } // @@protoc_insertion_point(outer_class_scope) diff --git a/Software/Android_Studio/Tango.PMR/src/main/java/com/twine/tango/pmr/stubs/StubGPIOReadBitResponseOuterClass.java b/Software/Android_Studio/Tango.PMR/src/main/java/com/twine/tango/pmr/stubs/StubGPIOReadBitResponseOuterClass.java index a1749ecc8..a7aa3fccb 100644 --- a/Software/Android_Studio/Tango.PMR/src/main/java/com/twine/tango/pmr/stubs/StubGPIOReadBitResponseOuterClass.java +++ b/Software/Android_Studio/Tango.PMR/src/main/java/com/twine/tango/pmr/stubs/StubGPIOReadBitResponseOuterClass.java @@ -20,12 +20,21 @@ public final class StubGPIOReadBitResponseOuterClass { /** *
-     * 0..119
+     * A..
      * 
* - * uint32 PortId = 1; + * string PortId = 1; */ - int getPortId(); + java.lang.String getPortId(); + /** + *
+     * A..
+     * 
+ * + * string PortId = 1; + */ + com.google.protobuf.ByteString + getPortIdBytes(); /** *
@@ -46,9 +55,9 @@ public final class StubGPIOReadBitResponseOuterClass {
      * 0-OK 1-Failed
      * 
* - * bool Status = 4; + * uint32 Status = 4; */ - boolean getStatus(); + int getStatus(); } /** * Protobuf type {@code Tango.PMR.Stubs.StubGPIOReadBitResponse} @@ -63,10 +72,10 @@ public final class StubGPIOReadBitResponseOuterClass { super(builder); } private StubGPIOReadBitResponse() { - portId_ = 0; + portId_ = ""; pinId_ = 0; bitValue_ = false; - status_ = false; + status_ = 0; } @java.lang.Override @@ -97,9 +106,10 @@ public final class StubGPIOReadBitResponseOuterClass { } break; } - case 8: { + case 10: { + java.lang.String s = input.readStringRequireUtf8(); - portId_ = input.readUInt32(); + portId_ = s; break; } case 16: { @@ -114,7 +124,7 @@ public final class StubGPIOReadBitResponseOuterClass { } case 32: { - status_ = input.readBool(); + status_ = input.readUInt32(); break; } } @@ -142,16 +152,45 @@ public final class StubGPIOReadBitResponseOuterClass { } public static final int PORTID_FIELD_NUMBER = 1; - private int portId_; + private volatile java.lang.Object portId_; /** *
-     * 0..119
+     * A..
      * 
* - * uint32 PortId = 1; + * string PortId = 1; */ - public int getPortId() { - return portId_; + public java.lang.String getPortId() { + java.lang.Object ref = portId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + portId_ = s; + return s; + } + } + /** + *
+     * A..
+     * 
+ * + * string PortId = 1; + */ + public com.google.protobuf.ByteString + getPortIdBytes() { + java.lang.Object ref = portId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + portId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } } public static final int PINID_FIELD_NUMBER = 2; @@ -177,15 +216,15 @@ public final class StubGPIOReadBitResponseOuterClass { } public static final int STATUS_FIELD_NUMBER = 4; - private boolean status_; + private int status_; /** *
      * 0-OK 1-Failed
      * 
* - * bool Status = 4; + * uint32 Status = 4; */ - public boolean getStatus() { + public int getStatus() { return status_; } @@ -201,8 +240,8 @@ public final class StubGPIOReadBitResponseOuterClass { public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (portId_ != 0) { - output.writeUInt32(1, portId_); + if (!getPortIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, portId_); } if (pinId_ != 0) { output.writeUInt32(2, pinId_); @@ -210,8 +249,8 @@ public final class StubGPIOReadBitResponseOuterClass { if (bitValue_ != false) { output.writeBool(3, bitValue_); } - if (status_ != false) { - output.writeBool(4, status_); + if (status_ != 0) { + output.writeUInt32(4, status_); } unknownFields.writeTo(output); } @@ -221,9 +260,8 @@ public final class StubGPIOReadBitResponseOuterClass { if (size != -1) return size; size = 0; - if (portId_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeUInt32Size(1, portId_); + if (!getPortIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, portId_); } if (pinId_ != 0) { size += com.google.protobuf.CodedOutputStream @@ -233,9 +271,9 @@ public final class StubGPIOReadBitResponseOuterClass { size += com.google.protobuf.CodedOutputStream .computeBoolSize(3, bitValue_); } - if (status_ != false) { + if (status_ != 0) { size += com.google.protobuf.CodedOutputStream - .computeBoolSize(4, status_); + .computeUInt32Size(4, status_); } size += unknownFields.getSerializedSize(); memoizedSize = size; @@ -253,8 +291,8 @@ public final class StubGPIOReadBitResponseOuterClass { com.twine.tango.pmr.stubs.StubGPIOReadBitResponseOuterClass.StubGPIOReadBitResponse other = (com.twine.tango.pmr.stubs.StubGPIOReadBitResponseOuterClass.StubGPIOReadBitResponse) obj; boolean result = true; - result = result && (getPortId() - == other.getPortId()); + result = result && getPortId() + .equals(other.getPortId()); result = result && (getPinId() == other.getPinId()); result = result && (getBitValue() @@ -273,15 +311,14 @@ public final class StubGPIOReadBitResponseOuterClass { int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + PORTID_FIELD_NUMBER; - hash = (53 * hash) + getPortId(); + hash = (53 * hash) + getPortId().hashCode(); hash = (37 * hash) + PINID_FIELD_NUMBER; hash = (53 * hash) + getPinId(); hash = (37 * hash) + BITVALUE_FIELD_NUMBER; hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( getBitValue()); hash = (37 * hash) + STATUS_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getStatus()); + hash = (53 * hash) + getStatus(); hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; @@ -411,13 +448,13 @@ public final class StubGPIOReadBitResponseOuterClass { } public Builder clear() { super.clear(); - portId_ = 0; + portId_ = ""; pinId_ = 0; bitValue_ = false; - status_ = false; + status_ = 0; return this; } @@ -486,8 +523,9 @@ public final class StubGPIOReadBitResponseOuterClass { public Builder mergeFrom(com.twine.tango.pmr.stubs.StubGPIOReadBitResponseOuterClass.StubGPIOReadBitResponse other) { if (other == com.twine.tango.pmr.stubs.StubGPIOReadBitResponseOuterClass.StubGPIOReadBitResponse.getDefaultInstance()) return this; - if (other.getPortId() != 0) { - setPortId(other.getPortId()); + if (!other.getPortId().isEmpty()) { + portId_ = other.portId_; + onChanged(); } if (other.getPinId() != 0) { setPinId(other.getPinId()); @@ -495,7 +533,7 @@ public final class StubGPIOReadBitResponseOuterClass { if (other.getBitValue() != false) { setBitValue(other.getBitValue()); } - if (other.getStatus() != false) { + if (other.getStatus() != 0) { setStatus(other.getStatus()); } this.mergeUnknownFields(other.unknownFields); @@ -525,40 +563,91 @@ public final class StubGPIOReadBitResponseOuterClass { return this; } - private int portId_ ; + private java.lang.Object portId_ = ""; /** *
-       * 0..119
+       * A..
        * 
* - * uint32 PortId = 1; + * string PortId = 1; */ - public int getPortId() { - return portId_; + public java.lang.String getPortId() { + java.lang.Object ref = portId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + portId_ = s; + return s; + } else { + return (java.lang.String) ref; + } } /** *
-       * 0..119
+       * A..
        * 
* - * uint32 PortId = 1; + * string PortId = 1; */ - public Builder setPortId(int value) { - + public com.google.protobuf.ByteString + getPortIdBytes() { + java.lang.Object ref = portId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + portId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       * A..
+       * 
+ * + * string PortId = 1; + */ + public Builder setPortId( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + portId_ = value; onChanged(); return this; } /** *
-       * 0..119
+       * A..
        * 
* - * uint32 PortId = 1; + * string PortId = 1; */ public Builder clearPortId() { - portId_ = 0; + portId_ = getDefaultInstance().getPortId(); + onChanged(); + return this; + } + /** + *
+       * A..
+       * 
+ * + * string PortId = 1; + */ + public Builder setPortIdBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + portId_ = value; onChanged(); return this; } @@ -627,15 +716,15 @@ public final class StubGPIOReadBitResponseOuterClass { return this; } - private boolean status_ ; + private int status_ ; /** *
        * 0-OK 1-Failed
        * 
* - * bool Status = 4; + * uint32 Status = 4; */ - public boolean getStatus() { + public int getStatus() { return status_; } /** @@ -643,9 +732,9 @@ public final class StubGPIOReadBitResponseOuterClass { * 0-OK 1-Failed *
* - * bool Status = 4; + * uint32 Status = 4; */ - public Builder setStatus(boolean value) { + public Builder setStatus(int value) { status_ = value; onChanged(); @@ -656,11 +745,11 @@ public final class StubGPIOReadBitResponseOuterClass { * 0-OK 1-Failed * * - * bool Status = 4; + * uint32 Status = 4; */ public Builder clearStatus() { - status_ = false; + status_ = 0; onChanged(); return this; } @@ -729,8 +818,8 @@ public final class StubGPIOReadBitResponseOuterClass { java.lang.String[] descriptorData = { "\n\035StubGPIOReadBitResponse.proto\022\017Tango.P" + "MR.Stubs\"Z\n\027StubGPIOReadBitResponse\022\016\n\006P" + - "ortId\030\001 \001(\r\022\r\n\005PinId\030\002 \001(\r\022\020\n\010BitValue\030\003" + - " \001(\010\022\016\n\006Status\030\004 \001(\010B\033\n\031com.twine.tango." + + "ortId\030\001 \001(\t\022\r\n\005PinId\030\002 \001(\r\022\020\n\010BitValue\030\003" + + " \001(\010\022\016\n\006Status\030\004 \001(\rB\033\n\031com.twine.tango." + "pmr.stubsb\006proto3" }; com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = diff --git a/Software/Android_Studio/Tango.PMR/src/main/java/com/twine/tango/pmr/stubs/StubGPIOReadByteRequestOuterClass.java b/Software/Android_Studio/Tango.PMR/src/main/java/com/twine/tango/pmr/stubs/StubGPIOReadByteRequestOuterClass.java index 1ff44f3a9..c928a15a8 100644 --- a/Software/Android_Studio/Tango.PMR/src/main/java/com/twine/tango/pmr/stubs/StubGPIOReadByteRequestOuterClass.java +++ b/Software/Android_Studio/Tango.PMR/src/main/java/com/twine/tango/pmr/stubs/StubGPIOReadByteRequestOuterClass.java @@ -20,12 +20,21 @@ public final class StubGPIOReadByteRequestOuterClass { /** *
-     * 0..119
+     * A..
      * 
* - * uint32 PortId = 1; + * string PortId = 1; */ - int getPortId(); + java.lang.String getPortId(); + /** + *
+     * A..
+     * 
+ * + * string PortId = 1; + */ + com.google.protobuf.ByteString + getPortIdBytes(); } /** * Protobuf type {@code Tango.PMR.Stubs.StubGPIOReadByteRequest} @@ -40,7 +49,7 @@ public final class StubGPIOReadByteRequestOuterClass { super(builder); } private StubGPIOReadByteRequest() { - portId_ = 0; + portId_ = ""; } @java.lang.Override @@ -71,9 +80,10 @@ public final class StubGPIOReadByteRequestOuterClass { } break; } - case 8: { + case 10: { + java.lang.String s = input.readStringRequireUtf8(); - portId_ = input.readUInt32(); + portId_ = s; break; } } @@ -101,16 +111,45 @@ public final class StubGPIOReadByteRequestOuterClass { } public static final int PORTID_FIELD_NUMBER = 1; - private int portId_; + private volatile java.lang.Object portId_; + /** + *
+     * A..
+     * 
+ * + * string PortId = 1; + */ + public java.lang.String getPortId() { + java.lang.Object ref = portId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + portId_ = s; + return s; + } + } /** *
-     * 0..119
+     * A..
      * 
* - * uint32 PortId = 1; + * string PortId = 1; */ - public int getPortId() { - return portId_; + public com.google.protobuf.ByteString + getPortIdBytes() { + java.lang.Object ref = portId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + portId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } } private byte memoizedIsInitialized = -1; @@ -125,8 +164,8 @@ public final class StubGPIOReadByteRequestOuterClass { public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (portId_ != 0) { - output.writeUInt32(1, portId_); + if (!getPortIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, portId_); } unknownFields.writeTo(output); } @@ -136,9 +175,8 @@ public final class StubGPIOReadByteRequestOuterClass { if (size != -1) return size; size = 0; - if (portId_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeUInt32Size(1, portId_); + if (!getPortIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, portId_); } size += unknownFields.getSerializedSize(); memoizedSize = size; @@ -156,8 +194,8 @@ public final class StubGPIOReadByteRequestOuterClass { com.twine.tango.pmr.stubs.StubGPIOReadByteRequestOuterClass.StubGPIOReadByteRequest other = (com.twine.tango.pmr.stubs.StubGPIOReadByteRequestOuterClass.StubGPIOReadByteRequest) obj; boolean result = true; - result = result && (getPortId() - == other.getPortId()); + result = result && getPortId() + .equals(other.getPortId()); result = result && unknownFields.equals(other.unknownFields); return result; } @@ -170,7 +208,7 @@ public final class StubGPIOReadByteRequestOuterClass { int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + PORTID_FIELD_NUMBER; - hash = (53 * hash) + getPortId(); + hash = (53 * hash) + getPortId().hashCode(); hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; @@ -300,7 +338,7 @@ public final class StubGPIOReadByteRequestOuterClass { } public Builder clear() { super.clear(); - portId_ = 0; + portId_ = ""; return this; } @@ -366,8 +404,9 @@ public final class StubGPIOReadByteRequestOuterClass { public Builder mergeFrom(com.twine.tango.pmr.stubs.StubGPIOReadByteRequestOuterClass.StubGPIOReadByteRequest other) { if (other == com.twine.tango.pmr.stubs.StubGPIOReadByteRequestOuterClass.StubGPIOReadByteRequest.getDefaultInstance()) return this; - if (other.getPortId() != 0) { - setPortId(other.getPortId()); + if (!other.getPortId().isEmpty()) { + portId_ = other.portId_; + onChanged(); } this.mergeUnknownFields(other.unknownFields); onChanged(); @@ -396,40 +435,91 @@ public final class StubGPIOReadByteRequestOuterClass { return this; } - private int portId_ ; + private java.lang.Object portId_ = ""; /** *
-       * 0..119
+       * A..
        * 
* - * uint32 PortId = 1; + * string PortId = 1; */ - public int getPortId() { - return portId_; + public java.lang.String getPortId() { + java.lang.Object ref = portId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + portId_ = s; + return s; + } else { + return (java.lang.String) ref; + } } /** *
-       * 0..119
+       * A..
        * 
* - * uint32 PortId = 1; + * string PortId = 1; */ - public Builder setPortId(int value) { - + public com.google.protobuf.ByteString + getPortIdBytes() { + java.lang.Object ref = portId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + portId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       * A..
+       * 
+ * + * string PortId = 1; + */ + public Builder setPortId( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + portId_ = value; onChanged(); return this; } /** *
-       * 0..119
+       * A..
        * 
* - * uint32 PortId = 1; + * string PortId = 1; */ public Builder clearPortId() { - portId_ = 0; + portId_ = getDefaultInstance().getPortId(); + onChanged(); + return this; + } + /** + *
+       * A..
+       * 
+ * + * string PortId = 1; + */ + public Builder setPortIdBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + portId_ = value; onChanged(); return this; } @@ -498,7 +588,7 @@ public final class StubGPIOReadByteRequestOuterClass { java.lang.String[] descriptorData = { "\n\035StubGPIOReadByteRequest.proto\022\017Tango.P" + "MR.Stubs\")\n\027StubGPIOReadByteRequest\022\016\n\006P" + - "ortId\030\001 \001(\rB\033\n\031com.twine.tango.pmr.stubs" + + "ortId\030\001 \001(\tB\033\n\031com.twine.tango.pmr.stubs" + "b\006proto3" }; com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = diff --git a/Software/Android_Studio/Tango.PMR/src/main/java/com/twine/tango/pmr/stubs/StubGPIOReadByteResponseOuterClass.java b/Software/Android_Studio/Tango.PMR/src/main/java/com/twine/tango/pmr/stubs/StubGPIOReadByteResponseOuterClass.java index 757afbb4a..d581bae2a 100644 --- a/Software/Android_Studio/Tango.PMR/src/main/java/com/twine/tango/pmr/stubs/StubGPIOReadByteResponseOuterClass.java +++ b/Software/Android_Studio/Tango.PMR/src/main/java/com/twine/tango/pmr/stubs/StubGPIOReadByteResponseOuterClass.java @@ -20,12 +20,21 @@ public final class StubGPIOReadByteResponseOuterClass { /** *
-     * 0..119
+     * A..
      * 
* - * uint32 PortId = 1; + * string PortId = 1; */ - int getPortId(); + java.lang.String getPortId(); + /** + *
+     * A..
+     * 
+ * + * string PortId = 1; + */ + com.google.protobuf.ByteString + getPortIdBytes(); /** * uint32 ByteValue = 2; @@ -37,9 +46,9 @@ public final class StubGPIOReadByteResponseOuterClass { * 0-OK 1-Failed * * - * bool status = 3; + * uint32 status = 3; */ - boolean getStatus(); + int getStatus(); } /** * Protobuf type {@code Tango.PMR.Stubs.StubGPIOReadByteResponse} @@ -54,9 +63,9 @@ public final class StubGPIOReadByteResponseOuterClass { super(builder); } private StubGPIOReadByteResponse() { - portId_ = 0; + portId_ = ""; byteValue_ = 0; - status_ = false; + status_ = 0; } @java.lang.Override @@ -87,9 +96,10 @@ public final class StubGPIOReadByteResponseOuterClass { } break; } - case 8: { + case 10: { + java.lang.String s = input.readStringRequireUtf8(); - portId_ = input.readUInt32(); + portId_ = s; break; } case 16: { @@ -99,7 +109,7 @@ public final class StubGPIOReadByteResponseOuterClass { } case 24: { - status_ = input.readBool(); + status_ = input.readUInt32(); break; } } @@ -127,16 +137,45 @@ public final class StubGPIOReadByteResponseOuterClass { } public static final int PORTID_FIELD_NUMBER = 1; - private int portId_; + private volatile java.lang.Object portId_; /** *
-     * 0..119
+     * A..
      * 
* - * uint32 PortId = 1; + * string PortId = 1; */ - public int getPortId() { - return portId_; + public java.lang.String getPortId() { + java.lang.Object ref = portId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + portId_ = s; + return s; + } + } + /** + *
+     * A..
+     * 
+ * + * string PortId = 1; + */ + public com.google.protobuf.ByteString + getPortIdBytes() { + java.lang.Object ref = portId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + portId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } } public static final int BYTEVALUE_FIELD_NUMBER = 2; @@ -149,15 +188,15 @@ public final class StubGPIOReadByteResponseOuterClass { } public static final int STATUS_FIELD_NUMBER = 3; - private boolean status_; + private int status_; /** *
      * 0-OK 1-Failed
      * 
* - * bool status = 3; + * uint32 status = 3; */ - public boolean getStatus() { + public int getStatus() { return status_; } @@ -173,14 +212,14 @@ public final class StubGPIOReadByteResponseOuterClass { public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (portId_ != 0) { - output.writeUInt32(1, portId_); + if (!getPortIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, portId_); } if (byteValue_ != 0) { output.writeUInt32(2, byteValue_); } - if (status_ != false) { - output.writeBool(3, status_); + if (status_ != 0) { + output.writeUInt32(3, status_); } unknownFields.writeTo(output); } @@ -190,17 +229,16 @@ public final class StubGPIOReadByteResponseOuterClass { if (size != -1) return size; size = 0; - if (portId_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeUInt32Size(1, portId_); + if (!getPortIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, portId_); } if (byteValue_ != 0) { size += com.google.protobuf.CodedOutputStream .computeUInt32Size(2, byteValue_); } - if (status_ != false) { + if (status_ != 0) { size += com.google.protobuf.CodedOutputStream - .computeBoolSize(3, status_); + .computeUInt32Size(3, status_); } size += unknownFields.getSerializedSize(); memoizedSize = size; @@ -218,8 +256,8 @@ public final class StubGPIOReadByteResponseOuterClass { com.twine.tango.pmr.stubs.StubGPIOReadByteResponseOuterClass.StubGPIOReadByteResponse other = (com.twine.tango.pmr.stubs.StubGPIOReadByteResponseOuterClass.StubGPIOReadByteResponse) obj; boolean result = true; - result = result && (getPortId() - == other.getPortId()); + result = result && getPortId() + .equals(other.getPortId()); result = result && (getByteValue() == other.getByteValue()); result = result && (getStatus() @@ -236,12 +274,11 @@ public final class StubGPIOReadByteResponseOuterClass { int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + PORTID_FIELD_NUMBER; - hash = (53 * hash) + getPortId(); + hash = (53 * hash) + getPortId().hashCode(); hash = (37 * hash) + BYTEVALUE_FIELD_NUMBER; hash = (53 * hash) + getByteValue(); hash = (37 * hash) + STATUS_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getStatus()); + hash = (53 * hash) + getStatus(); hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; @@ -371,11 +408,11 @@ public final class StubGPIOReadByteResponseOuterClass { } public Builder clear() { super.clear(); - portId_ = 0; + portId_ = ""; byteValue_ = 0; - status_ = false; + status_ = 0; return this; } @@ -443,13 +480,14 @@ public final class StubGPIOReadByteResponseOuterClass { public Builder mergeFrom(com.twine.tango.pmr.stubs.StubGPIOReadByteResponseOuterClass.StubGPIOReadByteResponse other) { if (other == com.twine.tango.pmr.stubs.StubGPIOReadByteResponseOuterClass.StubGPIOReadByteResponse.getDefaultInstance()) return this; - if (other.getPortId() != 0) { - setPortId(other.getPortId()); + if (!other.getPortId().isEmpty()) { + portId_ = other.portId_; + onChanged(); } if (other.getByteValue() != 0) { setByteValue(other.getByteValue()); } - if (other.getStatus() != false) { + if (other.getStatus() != 0) { setStatus(other.getStatus()); } this.mergeUnknownFields(other.unknownFields); @@ -479,40 +517,91 @@ public final class StubGPIOReadByteResponseOuterClass { return this; } - private int portId_ ; + private java.lang.Object portId_ = ""; /** *
-       * 0..119
+       * A..
        * 
* - * uint32 PortId = 1; + * string PortId = 1; */ - public int getPortId() { - return portId_; + public java.lang.String getPortId() { + java.lang.Object ref = portId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + portId_ = s; + return s; + } else { + return (java.lang.String) ref; + } } /** *
-       * 0..119
+       * A..
        * 
* - * uint32 PortId = 1; + * string PortId = 1; */ - public Builder setPortId(int value) { - + public com.google.protobuf.ByteString + getPortIdBytes() { + java.lang.Object ref = portId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + portId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       * A..
+       * 
+ * + * string PortId = 1; + */ + public Builder setPortId( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + portId_ = value; onChanged(); return this; } /** *
-       * 0..119
+       * A..
        * 
* - * uint32 PortId = 1; + * string PortId = 1; */ public Builder clearPortId() { - portId_ = 0; + portId_ = getDefaultInstance().getPortId(); + onChanged(); + return this; + } + /** + *
+       * A..
+       * 
+ * + * string PortId = 1; + */ + public Builder setPortIdBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + portId_ = value; onChanged(); return this; } @@ -543,15 +632,15 @@ public final class StubGPIOReadByteResponseOuterClass { return this; } - private boolean status_ ; + private int status_ ; /** *
        * 0-OK 1-Failed
        * 
* - * bool status = 3; + * uint32 status = 3; */ - public boolean getStatus() { + public int getStatus() { return status_; } /** @@ -559,9 +648,9 @@ public final class StubGPIOReadByteResponseOuterClass { * 0-OK 1-Failed * * - * bool status = 3; + * uint32 status = 3; */ - public Builder setStatus(boolean value) { + public Builder setStatus(int value) { status_ = value; onChanged(); @@ -572,11 +661,11 @@ public final class StubGPIOReadByteResponseOuterClass { * 0-OK 1-Failed * * - * bool status = 3; + * uint32 status = 3; */ public Builder clearStatus() { - status_ = false; + status_ = 0; onChanged(); return this; } @@ -645,8 +734,8 @@ public final class StubGPIOReadByteResponseOuterClass { java.lang.String[] descriptorData = { "\n\036StubGPIOReadByteResponse.proto\022\017Tango." + "PMR.Stubs\"M\n\030StubGPIOReadByteResponse\022\016\n" + - "\006PortId\030\001 \001(\r\022\021\n\tByteValue\030\002 \001(\r\022\016\n\006stat" + - "us\030\003 \001(\010B\033\n\031com.twine.tango.pmr.stubsb\006p" + + "\006PortId\030\001 \001(\t\022\021\n\tByteValue\030\002 \001(\r\022\016\n\006stat" + + "us\030\003 \001(\rB\033\n\031com.twine.tango.pmr.stubsb\006p" + "roto3" }; com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = diff --git a/Software/Android_Studio/Tango.PMR/src/main/java/com/twine/tango/pmr/stubs/StubGPIOWriteBitRequestOuterClass.java b/Software/Android_Studio/Tango.PMR/src/main/java/com/twine/tango/pmr/stubs/StubGPIOWriteBitRequestOuterClass.java index 7672c3cbb..9271b1e44 100644 --- a/Software/Android_Studio/Tango.PMR/src/main/java/com/twine/tango/pmr/stubs/StubGPIOWriteBitRequestOuterClass.java +++ b/Software/Android_Studio/Tango.PMR/src/main/java/com/twine/tango/pmr/stubs/StubGPIOWriteBitRequestOuterClass.java @@ -20,12 +20,21 @@ public final class StubGPIOWriteBitRequestOuterClass { /** *
-     * 0..119
+     * A..
      * 
* - * uint32 PortId = 1; + * string PortId = 1; */ - int getPortId(); + java.lang.String getPortId(); + /** + *
+     * A..
+     * 
+ * + * string PortId = 1; + */ + com.google.protobuf.ByteString + getPortIdBytes(); /** *
@@ -54,7 +63,7 @@ public final class StubGPIOWriteBitRequestOuterClass {
       super(builder);
     }
     private StubGPIOWriteBitRequest() {
-      portId_ = 0;
+      portId_ = "";
       pinId_ = 0;
       bitToWrite_ = false;
     }
@@ -87,9 +96,10 @@ public final class StubGPIOWriteBitRequestOuterClass {
               }
               break;
             }
-            case 8: {
+            case 10: {
+              java.lang.String s = input.readStringRequireUtf8();
 
-              portId_ = input.readUInt32();
+              portId_ = s;
               break;
             }
             case 16: {
@@ -127,16 +137,45 @@ public final class StubGPIOWriteBitRequestOuterClass {
     }
 
     public static final int PORTID_FIELD_NUMBER = 1;
-    private int portId_;
+    private volatile java.lang.Object portId_;
     /**
      * 
-     * 0..119
+     * A..
      * 
* - * uint32 PortId = 1; + * string PortId = 1; */ - public int getPortId() { - return portId_; + public java.lang.String getPortId() { + java.lang.Object ref = portId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + portId_ = s; + return s; + } + } + /** + *
+     * A..
+     * 
+ * + * string PortId = 1; + */ + public com.google.protobuf.ByteString + getPortIdBytes() { + java.lang.Object ref = portId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + portId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } } public static final int PINID_FIELD_NUMBER = 2; @@ -173,8 +212,8 @@ public final class StubGPIOWriteBitRequestOuterClass { public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (portId_ != 0) { - output.writeUInt32(1, portId_); + if (!getPortIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, portId_); } if (pinId_ != 0) { output.writeUInt32(2, pinId_); @@ -190,9 +229,8 @@ public final class StubGPIOWriteBitRequestOuterClass { if (size != -1) return size; size = 0; - if (portId_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeUInt32Size(1, portId_); + if (!getPortIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, portId_); } if (pinId_ != 0) { size += com.google.protobuf.CodedOutputStream @@ -218,8 +256,8 @@ public final class StubGPIOWriteBitRequestOuterClass { com.twine.tango.pmr.stubs.StubGPIOWriteBitRequestOuterClass.StubGPIOWriteBitRequest other = (com.twine.tango.pmr.stubs.StubGPIOWriteBitRequestOuterClass.StubGPIOWriteBitRequest) obj; boolean result = true; - result = result && (getPortId() - == other.getPortId()); + result = result && getPortId() + .equals(other.getPortId()); result = result && (getPinId() == other.getPinId()); result = result && (getBitToWrite() @@ -236,7 +274,7 @@ public final class StubGPIOWriteBitRequestOuterClass { int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + PORTID_FIELD_NUMBER; - hash = (53 * hash) + getPortId(); + hash = (53 * hash) + getPortId().hashCode(); hash = (37 * hash) + PINID_FIELD_NUMBER; hash = (53 * hash) + getPinId(); hash = (37 * hash) + BITTOWRITE_FIELD_NUMBER; @@ -371,7 +409,7 @@ public final class StubGPIOWriteBitRequestOuterClass { } public Builder clear() { super.clear(); - portId_ = 0; + portId_ = ""; pinId_ = 0; @@ -443,8 +481,9 @@ public final class StubGPIOWriteBitRequestOuterClass { public Builder mergeFrom(com.twine.tango.pmr.stubs.StubGPIOWriteBitRequestOuterClass.StubGPIOWriteBitRequest other) { if (other == com.twine.tango.pmr.stubs.StubGPIOWriteBitRequestOuterClass.StubGPIOWriteBitRequest.getDefaultInstance()) return this; - if (other.getPortId() != 0) { - setPortId(other.getPortId()); + if (!other.getPortId().isEmpty()) { + portId_ = other.portId_; + onChanged(); } if (other.getPinId() != 0) { setPinId(other.getPinId()); @@ -479,40 +518,91 @@ public final class StubGPIOWriteBitRequestOuterClass { return this; } - private int portId_ ; + private java.lang.Object portId_ = ""; /** *
-       * 0..119
+       * A..
        * 
* - * uint32 PortId = 1; + * string PortId = 1; */ - public int getPortId() { - return portId_; + public java.lang.String getPortId() { + java.lang.Object ref = portId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + portId_ = s; + return s; + } else { + return (java.lang.String) ref; + } } /** *
-       * 0..119
+       * A..
        * 
* - * uint32 PortId = 1; + * string PortId = 1; */ - public Builder setPortId(int value) { - + public com.google.protobuf.ByteString + getPortIdBytes() { + java.lang.Object ref = portId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + portId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       * A..
+       * 
+ * + * string PortId = 1; + */ + public Builder setPortId( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + portId_ = value; onChanged(); return this; } /** *
-       * 0..119
+       * A..
        * 
* - * uint32 PortId = 1; + * string PortId = 1; */ public Builder clearPortId() { - portId_ = 0; + portId_ = getDefaultInstance().getPortId(); + onChanged(); + return this; + } + /** + *
+       * A..
+       * 
+ * + * string PortId = 1; + */ + public Builder setPortIdBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + portId_ = value; onChanged(); return this; } @@ -645,7 +735,7 @@ public final class StubGPIOWriteBitRequestOuterClass { java.lang.String[] descriptorData = { "\n\035StubGPIOWriteBitRequest.proto\022\017Tango.P" + "MR.Stubs\"L\n\027StubGPIOWriteBitRequest\022\016\n\006P" + - "ortId\030\001 \001(\r\022\r\n\005PinId\030\002 \001(\r\022\022\n\nBitToWrite" + + "ortId\030\001 \001(\t\022\r\n\005PinId\030\002 \001(\r\022\022\n\nBitToWrite" + "\030\003 \001(\010B\033\n\031com.twine.tango.pmr.stubsb\006pro" + "to3" }; diff --git a/Software/Android_Studio/Tango.PMR/src/main/java/com/twine/tango/pmr/stubs/StubGPIOWriteBitResponseOuterClass.java b/Software/Android_Studio/Tango.PMR/src/main/java/com/twine/tango/pmr/stubs/StubGPIOWriteBitResponseOuterClass.java index cfc6f784c..dc9544e4b 100644 --- a/Software/Android_Studio/Tango.PMR/src/main/java/com/twine/tango/pmr/stubs/StubGPIOWriteBitResponseOuterClass.java +++ b/Software/Android_Studio/Tango.PMR/src/main/java/com/twine/tango/pmr/stubs/StubGPIOWriteBitResponseOuterClass.java @@ -20,12 +20,21 @@ public final class StubGPIOWriteBitResponseOuterClass { /** *
-     * 0..119
+     * A..
      * 
* - * uint32 PortId = 1; + * string PortId = 1; */ - int getPortId(); + java.lang.String getPortId(); + /** + *
+     * A..
+     * 
+ * + * string PortId = 1; + */ + com.google.protobuf.ByteString + getPortIdBytes(); /** *
@@ -41,9 +50,9 @@ public final class StubGPIOWriteBitResponseOuterClass {
      * 0-OK 1-Failed
      * 
* - * bool Status = 3; + * uint32 Status = 3; */ - boolean getStatus(); + int getStatus(); } /** * Protobuf type {@code Tango.PMR.Stubs.StubGPIOWriteBitResponse} @@ -58,9 +67,9 @@ public final class StubGPIOWriteBitResponseOuterClass { super(builder); } private StubGPIOWriteBitResponse() { - portId_ = 0; + portId_ = ""; pinId_ = 0; - status_ = false; + status_ = 0; } @java.lang.Override @@ -91,9 +100,10 @@ public final class StubGPIOWriteBitResponseOuterClass { } break; } - case 8: { + case 10: { + java.lang.String s = input.readStringRequireUtf8(); - portId_ = input.readUInt32(); + portId_ = s; break; } case 16: { @@ -103,7 +113,7 @@ public final class StubGPIOWriteBitResponseOuterClass { } case 24: { - status_ = input.readBool(); + status_ = input.readUInt32(); break; } } @@ -131,16 +141,45 @@ public final class StubGPIOWriteBitResponseOuterClass { } public static final int PORTID_FIELD_NUMBER = 1; - private int portId_; + private volatile java.lang.Object portId_; /** *
-     * 0..119
+     * A..
      * 
* - * uint32 PortId = 1; + * string PortId = 1; */ - public int getPortId() { - return portId_; + public java.lang.String getPortId() { + java.lang.Object ref = portId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + portId_ = s; + return s; + } + } + /** + *
+     * A..
+     * 
+ * + * string PortId = 1; + */ + public com.google.protobuf.ByteString + getPortIdBytes() { + java.lang.Object ref = portId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + portId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } } public static final int PINID_FIELD_NUMBER = 2; @@ -157,15 +196,15 @@ public final class StubGPIOWriteBitResponseOuterClass { } public static final int STATUS_FIELD_NUMBER = 3; - private boolean status_; + private int status_; /** *
      * 0-OK 1-Failed
      * 
* - * bool Status = 3; + * uint32 Status = 3; */ - public boolean getStatus() { + public int getStatus() { return status_; } @@ -181,14 +220,14 @@ public final class StubGPIOWriteBitResponseOuterClass { public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (portId_ != 0) { - output.writeUInt32(1, portId_); + if (!getPortIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, portId_); } if (pinId_ != 0) { output.writeUInt32(2, pinId_); } - if (status_ != false) { - output.writeBool(3, status_); + if (status_ != 0) { + output.writeUInt32(3, status_); } unknownFields.writeTo(output); } @@ -198,17 +237,16 @@ public final class StubGPIOWriteBitResponseOuterClass { if (size != -1) return size; size = 0; - if (portId_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeUInt32Size(1, portId_); + if (!getPortIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, portId_); } if (pinId_ != 0) { size += com.google.protobuf.CodedOutputStream .computeUInt32Size(2, pinId_); } - if (status_ != false) { + if (status_ != 0) { size += com.google.protobuf.CodedOutputStream - .computeBoolSize(3, status_); + .computeUInt32Size(3, status_); } size += unknownFields.getSerializedSize(); memoizedSize = size; @@ -226,8 +264,8 @@ public final class StubGPIOWriteBitResponseOuterClass { com.twine.tango.pmr.stubs.StubGPIOWriteBitResponseOuterClass.StubGPIOWriteBitResponse other = (com.twine.tango.pmr.stubs.StubGPIOWriteBitResponseOuterClass.StubGPIOWriteBitResponse) obj; boolean result = true; - result = result && (getPortId() - == other.getPortId()); + result = result && getPortId() + .equals(other.getPortId()); result = result && (getPinId() == other.getPinId()); result = result && (getStatus() @@ -244,12 +282,11 @@ public final class StubGPIOWriteBitResponseOuterClass { int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + PORTID_FIELD_NUMBER; - hash = (53 * hash) + getPortId(); + hash = (53 * hash) + getPortId().hashCode(); hash = (37 * hash) + PINID_FIELD_NUMBER; hash = (53 * hash) + getPinId(); hash = (37 * hash) + STATUS_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getStatus()); + hash = (53 * hash) + getStatus(); hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; @@ -379,11 +416,11 @@ public final class StubGPIOWriteBitResponseOuterClass { } public Builder clear() { super.clear(); - portId_ = 0; + portId_ = ""; pinId_ = 0; - status_ = false; + status_ = 0; return this; } @@ -451,13 +488,14 @@ public final class StubGPIOWriteBitResponseOuterClass { public Builder mergeFrom(com.twine.tango.pmr.stubs.StubGPIOWriteBitResponseOuterClass.StubGPIOWriteBitResponse other) { if (other == com.twine.tango.pmr.stubs.StubGPIOWriteBitResponseOuterClass.StubGPIOWriteBitResponse.getDefaultInstance()) return this; - if (other.getPortId() != 0) { - setPortId(other.getPortId()); + if (!other.getPortId().isEmpty()) { + portId_ = other.portId_; + onChanged(); } if (other.getPinId() != 0) { setPinId(other.getPinId()); } - if (other.getStatus() != false) { + if (other.getStatus() != 0) { setStatus(other.getStatus()); } this.mergeUnknownFields(other.unknownFields); @@ -487,40 +525,91 @@ public final class StubGPIOWriteBitResponseOuterClass { return this; } - private int portId_ ; + private java.lang.Object portId_ = ""; /** *
-       * 0..119
+       * A..
        * 
* - * uint32 PortId = 1; + * string PortId = 1; */ - public int getPortId() { - return portId_; + public java.lang.String getPortId() { + java.lang.Object ref = portId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + portId_ = s; + return s; + } else { + return (java.lang.String) ref; + } } /** *
-       * 0..119
+       * A..
        * 
* - * uint32 PortId = 1; + * string PortId = 1; */ - public Builder setPortId(int value) { - + public com.google.protobuf.ByteString + getPortIdBytes() { + java.lang.Object ref = portId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + portId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       * A..
+       * 
+ * + * string PortId = 1; + */ + public Builder setPortId( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + portId_ = value; onChanged(); return this; } /** *
-       * 0..119
+       * A..
        * 
* - * uint32 PortId = 1; + * string PortId = 1; */ public Builder clearPortId() { - portId_ = 0; + portId_ = getDefaultInstance().getPortId(); + onChanged(); + return this; + } + /** + *
+       * A..
+       * 
+ * + * string PortId = 1; + */ + public Builder setPortIdBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + portId_ = value; onChanged(); return this; } @@ -563,15 +652,15 @@ public final class StubGPIOWriteBitResponseOuterClass { return this; } - private boolean status_ ; + private int status_ ; /** *
        * 0-OK 1-Failed
        * 
* - * bool Status = 3; + * uint32 Status = 3; */ - public boolean getStatus() { + public int getStatus() { return status_; } /** @@ -579,9 +668,9 @@ public final class StubGPIOWriteBitResponseOuterClass { * 0-OK 1-Failed *
* - * bool Status = 3; + * uint32 Status = 3; */ - public Builder setStatus(boolean value) { + public Builder setStatus(int value) { status_ = value; onChanged(); @@ -592,11 +681,11 @@ public final class StubGPIOWriteBitResponseOuterClass { * 0-OK 1-Failed * * - * bool Status = 3; + * uint32 Status = 3; */ public Builder clearStatus() { - status_ = false; + status_ = 0; onChanged(); return this; } @@ -665,8 +754,8 @@ public final class StubGPIOWriteBitResponseOuterClass { java.lang.String[] descriptorData = { "\n\036StubGPIOWriteBitResponse.proto\022\017Tango." + "PMR.Stubs\"I\n\030StubGPIOWriteBitResponse\022\016\n" + - "\006PortId\030\001 \001(\r\022\r\n\005PinId\030\002 \001(\r\022\016\n\006Status\030\003" + - " \001(\010B\033\n\031com.twine.tango.pmr.stubsb\006proto" + + "\006PortId\030\001 \001(\t\022\r\n\005PinId\030\002 \001(\r\022\016\n\006Status\030\003" + + " \001(\rB\033\n\031com.twine.tango.pmr.stubsb\006proto" + "3" }; com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = diff --git a/Software/Android_Studio/Tango.PMR/src/main/java/com/twine/tango/pmr/stubs/StubGPIOWriteByteRequestOuterClass.java b/Software/Android_Studio/Tango.PMR/src/main/java/com/twine/tango/pmr/stubs/StubGPIOWriteByteRequestOuterClass.java index ee9e8d42e..b35dab59b 100644 --- a/Software/Android_Studio/Tango.PMR/src/main/java/com/twine/tango/pmr/stubs/StubGPIOWriteByteRequestOuterClass.java +++ b/Software/Android_Studio/Tango.PMR/src/main/java/com/twine/tango/pmr/stubs/StubGPIOWriteByteRequestOuterClass.java @@ -20,12 +20,21 @@ public final class StubGPIOWriteByteRequestOuterClass { /** *
-     * 0..119
+     * A..
      * 
* - * uint32 PortId = 1; + * string PortId = 1; */ - int getPortId(); + java.lang.String getPortId(); + /** + *
+     * A..
+     * 
+ * + * string PortId = 1; + */ + com.google.protobuf.ByteString + getPortIdBytes(); /** * uint32 DataToWrite = 3; @@ -45,7 +54,7 @@ public final class StubGPIOWriteByteRequestOuterClass { super(builder); } private StubGPIOWriteByteRequest() { - portId_ = 0; + portId_ = ""; dataToWrite_ = 0; } @@ -77,9 +86,10 @@ public final class StubGPIOWriteByteRequestOuterClass { } break; } - case 8: { + case 10: { + java.lang.String s = input.readStringRequireUtf8(); - portId_ = input.readUInt32(); + portId_ = s; break; } case 24: { @@ -112,16 +122,45 @@ public final class StubGPIOWriteByteRequestOuterClass { } public static final int PORTID_FIELD_NUMBER = 1; - private int portId_; + private volatile java.lang.Object portId_; /** *
-     * 0..119
+     * A..
      * 
* - * uint32 PortId = 1; + * string PortId = 1; */ - public int getPortId() { - return portId_; + public java.lang.String getPortId() { + java.lang.Object ref = portId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + portId_ = s; + return s; + } + } + /** + *
+     * A..
+     * 
+ * + * string PortId = 1; + */ + public com.google.protobuf.ByteString + getPortIdBytes() { + java.lang.Object ref = portId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + portId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } } public static final int DATATOWRITE_FIELD_NUMBER = 3; @@ -145,8 +184,8 @@ public final class StubGPIOWriteByteRequestOuterClass { public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (portId_ != 0) { - output.writeUInt32(1, portId_); + if (!getPortIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, portId_); } if (dataToWrite_ != 0) { output.writeUInt32(3, dataToWrite_); @@ -159,9 +198,8 @@ public final class StubGPIOWriteByteRequestOuterClass { if (size != -1) return size; size = 0; - if (portId_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeUInt32Size(1, portId_); + if (!getPortIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, portId_); } if (dataToWrite_ != 0) { size += com.google.protobuf.CodedOutputStream @@ -183,8 +221,8 @@ public final class StubGPIOWriteByteRequestOuterClass { com.twine.tango.pmr.stubs.StubGPIOWriteByteRequestOuterClass.StubGPIOWriteByteRequest other = (com.twine.tango.pmr.stubs.StubGPIOWriteByteRequestOuterClass.StubGPIOWriteByteRequest) obj; boolean result = true; - result = result && (getPortId() - == other.getPortId()); + result = result && getPortId() + .equals(other.getPortId()); result = result && (getDataToWrite() == other.getDataToWrite()); result = result && unknownFields.equals(other.unknownFields); @@ -199,7 +237,7 @@ public final class StubGPIOWriteByteRequestOuterClass { int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + PORTID_FIELD_NUMBER; - hash = (53 * hash) + getPortId(); + hash = (53 * hash) + getPortId().hashCode(); hash = (37 * hash) + DATATOWRITE_FIELD_NUMBER; hash = (53 * hash) + getDataToWrite(); hash = (29 * hash) + unknownFields.hashCode(); @@ -331,7 +369,7 @@ public final class StubGPIOWriteByteRequestOuterClass { } public Builder clear() { super.clear(); - portId_ = 0; + portId_ = ""; dataToWrite_ = 0; @@ -400,8 +438,9 @@ public final class StubGPIOWriteByteRequestOuterClass { public Builder mergeFrom(com.twine.tango.pmr.stubs.StubGPIOWriteByteRequestOuterClass.StubGPIOWriteByteRequest other) { if (other == com.twine.tango.pmr.stubs.StubGPIOWriteByteRequestOuterClass.StubGPIOWriteByteRequest.getDefaultInstance()) return this; - if (other.getPortId() != 0) { - setPortId(other.getPortId()); + if (!other.getPortId().isEmpty()) { + portId_ = other.portId_; + onChanged(); } if (other.getDataToWrite() != 0) { setDataToWrite(other.getDataToWrite()); @@ -433,40 +472,91 @@ public final class StubGPIOWriteByteRequestOuterClass { return this; } - private int portId_ ; + private java.lang.Object portId_ = ""; /** *
-       * 0..119
+       * A..
        * 
* - * uint32 PortId = 1; + * string PortId = 1; */ - public int getPortId() { - return portId_; + public java.lang.String getPortId() { + java.lang.Object ref = portId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + portId_ = s; + return s; + } else { + return (java.lang.String) ref; + } } /** *
-       * 0..119
+       * A..
        * 
* - * uint32 PortId = 1; + * string PortId = 1; */ - public Builder setPortId(int value) { - + public com.google.protobuf.ByteString + getPortIdBytes() { + java.lang.Object ref = portId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + portId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       * A..
+       * 
+ * + * string PortId = 1; + */ + public Builder setPortId( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + portId_ = value; onChanged(); return this; } /** *
-       * 0..119
+       * A..
        * 
* - * uint32 PortId = 1; + * string PortId = 1; */ public Builder clearPortId() { - portId_ = 0; + portId_ = getDefaultInstance().getPortId(); + onChanged(); + return this; + } + /** + *
+       * A..
+       * 
+ * + * string PortId = 1; + */ + public Builder setPortIdBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + portId_ = value; onChanged(); return this; } @@ -561,7 +651,7 @@ public final class StubGPIOWriteByteRequestOuterClass { java.lang.String[] descriptorData = { "\n\036StubGPIOWriteByteRequest.proto\022\017Tango." + "PMR.Stubs\"?\n\030StubGPIOWriteByteRequest\022\016\n" + - "\006PortId\030\001 \001(\r\022\023\n\013DataToWrite\030\003 \001(\rB\033\n\031co" + + "\006PortId\030\001 \001(\t\022\023\n\013DataToWrite\030\003 \001(\rB\033\n\031co" + "m.twine.tango.pmr.stubsb\006proto3" }; com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = diff --git a/Software/Android_Studio/Tango.PMR/src/main/java/com/twine/tango/pmr/stubs/StubGPIOWriteByteResponseOuterClass.java b/Software/Android_Studio/Tango.PMR/src/main/java/com/twine/tango/pmr/stubs/StubGPIOWriteByteResponseOuterClass.java index d1ce9ca45..9c7a5d626 100644 --- a/Software/Android_Studio/Tango.PMR/src/main/java/com/twine/tango/pmr/stubs/StubGPIOWriteByteResponseOuterClass.java +++ b/Software/Android_Studio/Tango.PMR/src/main/java/com/twine/tango/pmr/stubs/StubGPIOWriteByteResponseOuterClass.java @@ -20,21 +20,30 @@ public final class StubGPIOWriteByteResponseOuterClass { /** *
-     * 0..119
+     * A..
      * 
* - * uint32 PortId = 1; + * string PortId = 1; */ - int getPortId(); + java.lang.String getPortId(); + /** + *
+     * A..
+     * 
+ * + * string PortId = 1; + */ + com.google.protobuf.ByteString + getPortIdBytes(); /** *
      * 0-OK 1-Failed
      * 
* - * bool status = 3; + * uint32 status = 3; */ - boolean getStatus(); + int getStatus(); } /** * Protobuf type {@code Tango.PMR.Stubs.StubGPIOWriteByteResponse} @@ -49,8 +58,8 @@ public final class StubGPIOWriteByteResponseOuterClass { super(builder); } private StubGPIOWriteByteResponse() { - portId_ = 0; - status_ = false; + portId_ = ""; + status_ = 0; } @java.lang.Override @@ -81,14 +90,15 @@ public final class StubGPIOWriteByteResponseOuterClass { } break; } - case 8: { + case 10: { + java.lang.String s = input.readStringRequireUtf8(); - portId_ = input.readUInt32(); + portId_ = s; break; } case 24: { - status_ = input.readBool(); + status_ = input.readUInt32(); break; } } @@ -116,28 +126,57 @@ public final class StubGPIOWriteByteResponseOuterClass { } public static final int PORTID_FIELD_NUMBER = 1; - private int portId_; + private volatile java.lang.Object portId_; /** *
-     * 0..119
+     * A..
      * 
* - * uint32 PortId = 1; + * string PortId = 1; */ - public int getPortId() { - return portId_; + public java.lang.String getPortId() { + java.lang.Object ref = portId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + portId_ = s; + return s; + } + } + /** + *
+     * A..
+     * 
+ * + * string PortId = 1; + */ + public com.google.protobuf.ByteString + getPortIdBytes() { + java.lang.Object ref = portId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + portId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } } public static final int STATUS_FIELD_NUMBER = 3; - private boolean status_; + private int status_; /** *
      * 0-OK 1-Failed
      * 
* - * bool status = 3; + * uint32 status = 3; */ - public boolean getStatus() { + public int getStatus() { return status_; } @@ -153,11 +192,11 @@ public final class StubGPIOWriteByteResponseOuterClass { public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (portId_ != 0) { - output.writeUInt32(1, portId_); + if (!getPortIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, portId_); } - if (status_ != false) { - output.writeBool(3, status_); + if (status_ != 0) { + output.writeUInt32(3, status_); } unknownFields.writeTo(output); } @@ -167,13 +206,12 @@ public final class StubGPIOWriteByteResponseOuterClass { if (size != -1) return size; size = 0; - if (portId_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeUInt32Size(1, portId_); + if (!getPortIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, portId_); } - if (status_ != false) { + if (status_ != 0) { size += com.google.protobuf.CodedOutputStream - .computeBoolSize(3, status_); + .computeUInt32Size(3, status_); } size += unknownFields.getSerializedSize(); memoizedSize = size; @@ -191,8 +229,8 @@ public final class StubGPIOWriteByteResponseOuterClass { com.twine.tango.pmr.stubs.StubGPIOWriteByteResponseOuterClass.StubGPIOWriteByteResponse other = (com.twine.tango.pmr.stubs.StubGPIOWriteByteResponseOuterClass.StubGPIOWriteByteResponse) obj; boolean result = true; - result = result && (getPortId() - == other.getPortId()); + result = result && getPortId() + .equals(other.getPortId()); result = result && (getStatus() == other.getStatus()); result = result && unknownFields.equals(other.unknownFields); @@ -207,10 +245,9 @@ public final class StubGPIOWriteByteResponseOuterClass { int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + PORTID_FIELD_NUMBER; - hash = (53 * hash) + getPortId(); + hash = (53 * hash) + getPortId().hashCode(); hash = (37 * hash) + STATUS_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getStatus()); + hash = (53 * hash) + getStatus(); hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; @@ -340,9 +377,9 @@ public final class StubGPIOWriteByteResponseOuterClass { } public Builder clear() { super.clear(); - portId_ = 0; + portId_ = ""; - status_ = false; + status_ = 0; return this; } @@ -409,10 +446,11 @@ public final class StubGPIOWriteByteResponseOuterClass { public Builder mergeFrom(com.twine.tango.pmr.stubs.StubGPIOWriteByteResponseOuterClass.StubGPIOWriteByteResponse other) { if (other == com.twine.tango.pmr.stubs.StubGPIOWriteByteResponseOuterClass.StubGPIOWriteByteResponse.getDefaultInstance()) return this; - if (other.getPortId() != 0) { - setPortId(other.getPortId()); + if (!other.getPortId().isEmpty()) { + portId_ = other.portId_; + onChanged(); } - if (other.getStatus() != false) { + if (other.getStatus() != 0) { setStatus(other.getStatus()); } this.mergeUnknownFields(other.unknownFields); @@ -442,53 +480,104 @@ public final class StubGPIOWriteByteResponseOuterClass { return this; } - private int portId_ ; + private java.lang.Object portId_ = ""; /** *
-       * 0..119
+       * A..
        * 
* - * uint32 PortId = 1; + * string PortId = 1; */ - public int getPortId() { - return portId_; + public java.lang.String getPortId() { + java.lang.Object ref = portId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + portId_ = s; + return s; + } else { + return (java.lang.String) ref; + } } /** *
-       * 0..119
+       * A..
        * 
* - * uint32 PortId = 1; + * string PortId = 1; */ - public Builder setPortId(int value) { - + public com.google.protobuf.ByteString + getPortIdBytes() { + java.lang.Object ref = portId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + portId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       * A..
+       * 
+ * + * string PortId = 1; + */ + public Builder setPortId( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + portId_ = value; onChanged(); return this; } /** *
-       * 0..119
+       * A..
        * 
* - * uint32 PortId = 1; + * string PortId = 1; */ public Builder clearPortId() { - portId_ = 0; + portId_ = getDefaultInstance().getPortId(); + onChanged(); + return this; + } + /** + *
+       * A..
+       * 
+ * + * string PortId = 1; + */ + public Builder setPortIdBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + portId_ = value; onChanged(); return this; } - private boolean status_ ; + private int status_ ; /** *
        * 0-OK 1-Failed
        * 
* - * bool status = 3; + * uint32 status = 3; */ - public boolean getStatus() { + public int getStatus() { return status_; } /** @@ -496,9 +585,9 @@ public final class StubGPIOWriteByteResponseOuterClass { * 0-OK 1-Failed * * - * bool status = 3; + * uint32 status = 3; */ - public Builder setStatus(boolean value) { + public Builder setStatus(int value) { status_ = value; onChanged(); @@ -509,11 +598,11 @@ public final class StubGPIOWriteByteResponseOuterClass { * 0-OK 1-Failed * * - * bool status = 3; + * uint32 status = 3; */ public Builder clearStatus() { - status_ = false; + status_ = 0; onChanged(); return this; } @@ -582,7 +671,7 @@ public final class StubGPIOWriteByteResponseOuterClass { java.lang.String[] descriptorData = { "\n\037StubGPIOWriteByteResponse.proto\022\017Tango" + ".PMR.Stubs\";\n\031StubGPIOWriteByteResponse\022" + - "\016\n\006PortId\030\001 \001(\r\022\016\n\006status\030\003 \001(\010B\033\n\031com.t" + + "\016\n\006PortId\030\001 \001(\t\022\016\n\006status\030\003 \001(\rB\033\n\031com.t" + "wine.tango.pmr.stubsb\006proto3" }; com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = diff --git a/Software/Android_Studio/Tango.PMR/src/main/java/com/twine/tango/pmr/stubs/StubSteperMotorRequestOuterClass.java b/Software/Android_Studio/Tango.PMR/src/main/java/com/twine/tango/pmr/stubs/StubSteperMotorRequestOuterClass.java index 8d41f4c3f..1dcfa1412 100644 --- a/Software/Android_Studio/Tango.PMR/src/main/java/com/twine/tango/pmr/stubs/StubSteperMotorRequestOuterClass.java +++ b/Software/Android_Studio/Tango.PMR/src/main/java/com/twine/tango/pmr/stubs/StubSteperMotorRequestOuterClass.java @@ -50,7 +50,7 @@ public final class StubSteperMotorRequestOuterClass { * No. of steps for 360 deg. * * - * int32 SetMicrostepDivision = 4; + * uint32 SetMicrostepDivision = 4; */ int getSetMicrostepDivision(); @@ -128,7 +128,7 @@ public final class StubSteperMotorRequestOuterClass { } case 32: { - setMicrostepDivision_ = input.readInt32(); + setMicrostepDivision_ = input.readUInt32(); break; } case 40: { @@ -206,7 +206,7 @@ public final class StubSteperMotorRequestOuterClass { * No. of steps for 360 deg. * * - * int32 SetMicrostepDivision = 4; + * uint32 SetMicrostepDivision = 4; */ public int getSetMicrostepDivision() { return setMicrostepDivision_; @@ -247,7 +247,7 @@ public final class StubSteperMotorRequestOuterClass { output.writeBool(3, setDirection_); } if (setMicrostepDivision_ != 0) { - output.writeInt32(4, setMicrostepDivision_); + output.writeUInt32(4, setMicrostepDivision_); } if (setSpeed_ != 0) { output.writeInt32(5, setSpeed_); @@ -274,7 +274,7 @@ public final class StubSteperMotorRequestOuterClass { } if (setMicrostepDivision_ != 0) { size += com.google.protobuf.CodedOutputStream - .computeInt32Size(4, setMicrostepDivision_); + .computeUInt32Size(4, setMicrostepDivision_); } if (setSpeed_ != 0) { size += com.google.protobuf.CodedOutputStream @@ -698,7 +698,7 @@ public final class StubSteperMotorRequestOuterClass { * No. of steps for 360 deg. * * - * int32 SetMicrostepDivision = 4; + * uint32 SetMicrostepDivision = 4; */ public int getSetMicrostepDivision() { return setMicrostepDivision_; @@ -708,7 +708,7 @@ public final class StubSteperMotorRequestOuterClass { * No. of steps for 360 deg. * * - * int32 SetMicrostepDivision = 4; + * uint32 SetMicrostepDivision = 4; */ public Builder setSetMicrostepDivision(int value) { @@ -721,7 +721,7 @@ public final class StubSteperMotorRequestOuterClass { * No. of steps for 360 deg. * * - * int32 SetMicrostepDivision = 4; + * uint32 SetMicrostepDivision = 4; */ public Builder clearSetMicrostepDivision() { @@ -833,7 +833,7 @@ public final class StubSteperMotorRequestOuterClass { "\n\034StubSteperMotorRequest.proto\022\017Tango.PM" + "R.Stubs\"~\n\026StubSteperMotorRequest\022\017\n\007Mot" + "orId\030\001 \001(\r\022\r\n\005Start\030\002 \001(\010\022\024\n\014SetDirectio" + - "n\030\003 \001(\010\022\034\n\024SetMicrostepDivision\030\004 \001(\005\022\020\n" + + "n\030\003 \001(\010\022\034\n\024SetMicrostepDivision\030\004 \001(\r\022\020\n" + "\010SetSpeed\030\005 \001(\005B\033\n\031com.twine.tango.pmr.s" + "tubsb\006proto3" }; diff --git a/Software/Android_Studio/Tango.PMR/src/main/java/com/twine/tango/pmr/stubs/StubValveRequestOuterClass.java b/Software/Android_Studio/Tango.PMR/src/main/java/com/twine/tango/pmr/stubs/StubValveRequestOuterClass.java index 70556b17a..4d1c6a179 100644 --- a/Software/Android_Studio/Tango.PMR/src/main/java/com/twine/tango/pmr/stubs/StubValveRequestOuterClass.java +++ b/Software/Android_Studio/Tango.PMR/src/main/java/com/twine/tango/pmr/stubs/StubValveRequestOuterClass.java @@ -19,19 +19,31 @@ public final class StubValveRequestOuterClass { com.google.protobuf.MessageOrBuilder { /** - * int32 ValveId = 1; + *
+     * 0..19
+     * 
+ * + * uint32 ValveId = 1; */ int getValveId(); /** - * int32 Inkflow = 2; + *
+     *0 - Min
+     * 
+ * + * uint32 Inkflow = 2; */ int getInkflow(); /** - * int32 ValveOn = 3; + *
+     *0-Off 1-On
+     * 
+ * + * bool ValveOn = 3; */ - int getValveOn(); + boolean getValveOn(); } /** * Protobuf type {@code Tango.PMR.Stubs.StubValveRequest} @@ -48,7 +60,7 @@ public final class StubValveRequestOuterClass { private StubValveRequest() { valveId_ = 0; inkflow_ = 0; - valveOn_ = 0; + valveOn_ = false; } @java.lang.Override @@ -81,17 +93,17 @@ public final class StubValveRequestOuterClass { } case 8: { - valveId_ = input.readInt32(); + valveId_ = input.readUInt32(); break; } case 16: { - inkflow_ = input.readInt32(); + inkflow_ = input.readUInt32(); break; } case 24: { - valveOn_ = input.readInt32(); + valveOn_ = input.readBool(); break; } } @@ -121,7 +133,11 @@ public final class StubValveRequestOuterClass { public static final int VALVEID_FIELD_NUMBER = 1; private int valveId_; /** - * int32 ValveId = 1; + *
+     * 0..19
+     * 
+ * + * uint32 ValveId = 1; */ public int getValveId() { return valveId_; @@ -130,18 +146,26 @@ public final class StubValveRequestOuterClass { public static final int INKFLOW_FIELD_NUMBER = 2; private int inkflow_; /** - * int32 Inkflow = 2; + *
+     *0 - Min
+     * 
+ * + * uint32 Inkflow = 2; */ public int getInkflow() { return inkflow_; } public static final int VALVEON_FIELD_NUMBER = 3; - private int valveOn_; + private boolean valveOn_; /** - * int32 ValveOn = 3; + *
+     *0-Off 1-On
+     * 
+ * + * bool ValveOn = 3; */ - public int getValveOn() { + public boolean getValveOn() { return valveOn_; } @@ -158,13 +182,13 @@ public final class StubValveRequestOuterClass { public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { if (valveId_ != 0) { - output.writeInt32(1, valveId_); + output.writeUInt32(1, valveId_); } if (inkflow_ != 0) { - output.writeInt32(2, inkflow_); + output.writeUInt32(2, inkflow_); } - if (valveOn_ != 0) { - output.writeInt32(3, valveOn_); + if (valveOn_ != false) { + output.writeBool(3, valveOn_); } unknownFields.writeTo(output); } @@ -176,15 +200,15 @@ public final class StubValveRequestOuterClass { size = 0; if (valveId_ != 0) { size += com.google.protobuf.CodedOutputStream - .computeInt32Size(1, valveId_); + .computeUInt32Size(1, valveId_); } if (inkflow_ != 0) { size += com.google.protobuf.CodedOutputStream - .computeInt32Size(2, inkflow_); + .computeUInt32Size(2, inkflow_); } - if (valveOn_ != 0) { + if (valveOn_ != false) { size += com.google.protobuf.CodedOutputStream - .computeInt32Size(3, valveOn_); + .computeBoolSize(3, valveOn_); } size += unknownFields.getSerializedSize(); memoizedSize = size; @@ -224,7 +248,8 @@ public final class StubValveRequestOuterClass { hash = (37 * hash) + INKFLOW_FIELD_NUMBER; hash = (53 * hash) + getInkflow(); hash = (37 * hash) + VALVEON_FIELD_NUMBER; - hash = (53 * hash) + getValveOn(); + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getValveOn()); hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; @@ -358,7 +383,7 @@ public final class StubValveRequestOuterClass { inkflow_ = 0; - valveOn_ = 0; + valveOn_ = false; return this; } @@ -432,7 +457,7 @@ public final class StubValveRequestOuterClass { if (other.getInkflow() != 0) { setInkflow(other.getInkflow()); } - if (other.getValveOn() != 0) { + if (other.getValveOn() != false) { setValveOn(other.getValveOn()); } this.mergeUnknownFields(other.unknownFields); @@ -464,13 +489,21 @@ public final class StubValveRequestOuterClass { private int valveId_ ; /** - * int32 ValveId = 1; + *
+       * 0..19
+       * 
+ * + * uint32 ValveId = 1; */ public int getValveId() { return valveId_; } /** - * int32 ValveId = 1; + *
+       * 0..19
+       * 
+ * + * uint32 ValveId = 1; */ public Builder setValveId(int value) { @@ -479,7 +512,11 @@ public final class StubValveRequestOuterClass { return this; } /** - * int32 ValveId = 1; + *
+       * 0..19
+       * 
+ * + * uint32 ValveId = 1; */ public Builder clearValveId() { @@ -490,13 +527,21 @@ public final class StubValveRequestOuterClass { private int inkflow_ ; /** - * int32 Inkflow = 2; + *
+       *0 - Min
+       * 
+ * + * uint32 Inkflow = 2; */ public int getInkflow() { return inkflow_; } /** - * int32 Inkflow = 2; + *
+       *0 - Min
+       * 
+ * + * uint32 Inkflow = 2; */ public Builder setInkflow(int value) { @@ -505,7 +550,11 @@ public final class StubValveRequestOuterClass { return this; } /** - * int32 Inkflow = 2; + *
+       *0 - Min
+       * 
+ * + * uint32 Inkflow = 2; */ public Builder clearInkflow() { @@ -514,28 +563,40 @@ public final class StubValveRequestOuterClass { return this; } - private int valveOn_ ; + private boolean valveOn_ ; /** - * int32 ValveOn = 3; + *
+       *0-Off 1-On
+       * 
+ * + * bool ValveOn = 3; */ - public int getValveOn() { + public boolean getValveOn() { return valveOn_; } /** - * int32 ValveOn = 3; + *
+       *0-Off 1-On
+       * 
+ * + * bool ValveOn = 3; */ - public Builder setValveOn(int value) { + public Builder setValveOn(boolean value) { valveOn_ = value; onChanged(); return this; } /** - * int32 ValveOn = 3; + *
+       *0-Off 1-On
+       * 
+ * + * bool ValveOn = 3; */ public Builder clearValveOn() { - valveOn_ = 0; + valveOn_ = false; onChanged(); return this; } @@ -603,8 +664,8 @@ public final class StubValveRequestOuterClass { static { java.lang.String[] descriptorData = { "\n\026StubValveRequest.proto\022\017Tango.PMR.Stub" + - "s\"E\n\020StubValveRequest\022\017\n\007ValveId\030\001 \001(\005\022\017" + - "\n\007Inkflow\030\002 \001(\005\022\017\n\007ValveOn\030\003 \001(\005B\033\n\031com." + + "s\"E\n\020StubValveRequest\022\017\n\007ValveId\030\001 \001(\r\022\017" + + "\n\007Inkflow\030\002 \001(\r\022\017\n\007ValveOn\030\003 \001(\010B\033\n\031com." + "twine.tango.pmr.stubsb\006proto3" }; com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = diff --git a/Software/Android_Studio/Tango.UnitTesting/build.gradle b/Software/Android_Studio/Tango.UnitTesting/build.gradle index f1b2b0ab3..3b9a730c8 100644 --- a/Software/Android_Studio/Tango.UnitTesting/build.gradle +++ b/Software/Android_Studio/Tango.UnitTesting/build.gradle @@ -8,7 +8,7 @@ android { defaultConfig { applicationId "com.twine.tango.unittesting" minSdkVersion 22 - targetSdkVersion 26 + targetSdkVersion 22 versionCode 1 versionName "1.0" @@ -45,4 +45,5 @@ dependencies { implementation project(':Tango.Synchronization') implementation project(':Tango.Transport') implementation project(':Tango.Web') + implementation project(':Tango.NativeBridge') } diff --git a/Software/Android_Studio/Tango.UnitTesting/src/androidTest/java/com/twine/tango/unittesting/DAL_TST.java b/Software/Android_Studio/Tango.UnitTesting/src/androidTest/java/com/twine/tango/unittesting/DAL_TST.java index f04070d6a..3e020b363 100644 --- a/Software/Android_Studio/Tango.UnitTesting/src/androidTest/java/com/twine/tango/unittesting/DAL_TST.java +++ b/Software/Android_Studio/Tango.UnitTesting/src/androidTest/java/com/twine/tango/unittesting/DAL_TST.java @@ -4,6 +4,7 @@ import android.content.Context; import android.support.test.InstrumentationRegistry; import android.support.test.runner.AndroidJUnit4; +import org.junit.Test; import org.junit.runner.RunWith; /** @@ -13,6 +14,7 @@ import org.junit.runner.RunWith; @RunWith(AndroidJUnit4.class) public class DAL_TST { + @Test public void perform_basic_dal_test() { // Context of the app under test. diff --git a/Software/Android_Studio/Tango.UnitTesting/src/androidTest/java/com/twine/tango/unittesting/NativeBridge_TST.java b/Software/Android_Studio/Tango.UnitTesting/src/androidTest/java/com/twine/tango/unittesting/NativeBridge_TST.java new file mode 100644 index 000000000..fc1758781 --- /dev/null +++ b/Software/Android_Studio/Tango.UnitTesting/src/androidTest/java/com/twine/tango/unittesting/NativeBridge_TST.java @@ -0,0 +1,27 @@ +package com.twine.tango.unittesting; + +import android.content.Context; +import android.support.test.InstrumentationRegistry; +import android.support.test.runner.AndroidJUnit4; + +import com.twine.tango.nativebridge.ColorLibAdapter; + +import org.junit.Assert; +import org.junit.Test; +import org.junit.runner.RunWith; + +/** + * Created by Roy on 12/21/2017. + */ + +@RunWith(AndroidJUnit4.class) +public class NativeBridge_TST +{ + @Test + public void calculate_using_protobuf() + { + ColorLibAdapter adapter = new ColorLibAdapter(); + double a = adapter.calculateProto(10,5); + Assert.assertEquals(a,15,0); + } +} diff --git a/Software/Android_Studio/settings.gradle b/Software/Android_Studio/settings.gradle index cb2899bce..7a7daf836 100644 --- a/Software/Android_Studio/settings.gradle +++ b/Software/Android_Studio/settings.gradle @@ -1 +1 @@ -include ':Tango.BL', ':Tango.Stubs.UI', ':Tango.SharedUI', ':Tango.Models', ':Tango.Stubs', ':Tango.Integration', ':Tango.Transport', ':Tango.Core', ':Tango.PMR', ':Tango.DAL', ':Tango.Web', ':Tango.Synchronization', ':Tango.UnitTesting' +include ':Tango.BL', ':Tango.Stubs.UI', ':Tango.SharedUI', ':Tango.Models', ':Tango.Stubs', ':Tango.Integration', ':Tango.Transport', ':Tango.Core', ':Tango.PMR', ':Tango.DAL', ':Tango.Web', ':Tango.Synchronization', ':Tango.UnitTesting', ':Tango.NativeBridge' diff --git a/Software/DB/Tango.mdf b/Software/DB/Tango.mdf index 565843b18..fb25f3c28 100644 Binary files a/Software/DB/Tango.mdf and b/Software/DB/Tango.mdf differ diff --git a/Software/DB/Tango_log.ldf b/Software/DB/Tango_log.ldf index 2b0d991bc..6deb366c2 100644 Binary files a/Software/DB/Tango_log.ldf and b/Software/DB/Tango_log.ldf differ diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Tango.MachineStudio.UI.csproj b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Tango.MachineStudio.UI.csproj index 4aa14b56a..fa04a1068 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Tango.MachineStudio.UI.csproj +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Tango.MachineStudio.UI.csproj @@ -255,6 +255,51 @@ - $(TargetDir)linkgen.exe -s "$(TargetPath)" -d "$(TargetDir)Utilities\Machine Studio.lnk" + $(TargetDir)linkgen.exe -s "$(TargetPath)" -d "$(TargetDir)Utilities\Machine Studio.lnk" + +RD /S /Q "$(TargetDir)cs\" +RD /S /Q "$(TargetDir)da\" +RD /S /Q "$(TargetDir)de\" +RD /S /Q "$(TargetDir)es\" +RD /S /Q "$(TargetDir)fa\" +RD /S /Q "$(TargetDir)fi\" +RD /S /Q "$(TargetDir)fr\" +RD /S /Q "$(TargetDir)it\" +RD /S /Q "$(TargetDir)ko\" +RD /S /Q "$(TargetDir)mk\" +RD /S /Q "$(TargetDir)nl\" +RD /S /Q "$(TargetDir)pl\" +RD /S /Q "$(TargetDir)pt\" +RD /S /Q "$(TargetDir)ru\" +RD /S /Q "$(TargetDir)sv\" +RD /S /Q "$(TargetDir)tr\" +RD /S /Q "$(TargetDir)zh-CN\" +RD /S /Q "$(TargetDir)af\" +RD /S /Q "$(TargetDir)ar\" +RD /S /Q "$(TargetDir)dn-BD\" +RD /S /Q "$(TargetDir)el\" +RD /S /Q "$(TargetDir)fi-FI\" +RD /S /Q "$(TargetDir)fr-BE\" +RD /S /Q "$(TargetDir)he\" +RD /S /Q "$(TargetDir)hr\" +RD /S /Q "$(TargetDir)hu\" +RD /S /Q "$(TargetDir)id\" +RD /S /Q "$(TargetDir)ja\" +RD /S /Q "$(TargetDir)lv\" +RD /S /Q "$(TargetDir)nb\" +RD /S /Q "$(TargetDir)ro\" +RD /S /Q "$(TargetDir)sk\" +RD /S /Q "$(TargetDir)sl\" +RD /S /Q "$(TargetDir)sr\" +RD /S /Q "$(TargetDir)sr-Latn\" +RD /S /Q "$(TargetDir)uk\" +RD /S /Q "$(TargetDir)uz-Cyrl-UZ\" +RD /S /Q "$(TargetDir)uz-Latn-UZ\" +RD /S /Q "$(TargetDir)vi\" +RD /S /Q "$(TargetDir)zh-Hans\" +RD /S /Q "$(TargetDir)zh-Hant\" +RD /S /Q "$(TargetDir)bg\" +RD /S /Q "$(TargetDir)bn-BD\" +RD /S /Q "$(TargetDir)nb-NO\" \ No newline at end of file diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/ColorLib.cpp b/Software/Visual_Studio/Native/Tango.ColorLib/ColorLib.cpp deleted file mode 100644 index 6a0ee917e..000000000 --- a/Software/Visual_Studio/Native/Tango.ColorLib/ColorLib.cpp +++ /dev/null @@ -1,54 +0,0 @@ -#include "ColorLib.h" -#include "stdlib.h" - -#define LOGI(...) ((void)__android_log_print(ANDROID_LOG_INFO, "ColorLib", __VA_ARGS__)) -#define LOGW(...) ((void)__android_log_print(ANDROID_LOG_WARN, "ColorLib", __VA_ARGS__)) - -extern "C" { - /* This trivial function returns the platform ABI for which this dynamic native library is compiled.*/ - const char * ColorLib::getPlatformABI() - { -#if defined(__arm__) -#if defined(__ARM_ARCH_7A__) -#if defined(__ARM_NEON__) -#define ABI "armeabi-v7a/NEON" -#else -#define ABI "armeabi-v7a" -#endif -#else -#define ABI "armeabi" -#endif -#elif defined(__i386__) -#define ABI "x86" -#else -#define ABI "unknown" -#endif - //LOGI("This dynamic shared library is compiled with ABI: %s", ABI); - return "This native library is compiled with ABI: %s" ABI "."; - } - - void ColorLib() - { - } - - ColorLib::ColorLib() - { - } - - ColorLib::~ColorLib() - { - } - - size_t ColorLib::Calculate(uint8_t * request_buffer, size_t request_buffer_size, uint8_t * response_buffer) - { - CalculateRequest* request = calculate_request__unpack(NULL, request_buffer_size, request_buffer); - - - CalculateResponse response = CALCULATE_RESPONSE__INIT; - response.sum = request->a + request->b; - - - response_buffer = (uint8_t*)malloc(calculate_response__get_packed_size(&response)); - return calculate_response__pack(&response, response_buffer); - } -} diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/ColorLib.h b/Software/Visual_Studio/Native/Tango.ColorLib/ColorLib.h deleted file mode 100644 index c0ca905b5..000000000 --- a/Software/Visual_Studio/Native/Tango.ColorLib/ColorLib.h +++ /dev/null @@ -1,14 +0,0 @@ -#include "PMR/Stubs/CalculateRequest.pb-c.h" -#include "PMR/Stubs/CalculateResponse.pb-c.h" - -#pragma once - -class ColorLib -{ -public: - const char * getPlatformABI(); - ColorLib(); - ~ColorLib(); - size_t Calculate(uint8_t * request_buffer, size_t request_buffer_size, uint8_t * response_buffer); -}; - diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/Exports.cpp b/Software/Visual_Studio/Native/Tango.ColorLib/Exports.cpp new file mode 100644 index 000000000..a19f31708 --- /dev/null +++ b/Software/Visual_Studio/Native/Tango.ColorLib/Exports.cpp @@ -0,0 +1,16 @@ +#include +#include "Tester.h" + +#pragma once + +#define EXPORT_API __declspec(dllexport) + +using namespace std; +using namespace Tango::ColoLib; + +extern "C" EXPORT_API size_t __cdecl Calculate(uint8_t* request_buffer, size_t request_buffer_size, uint8_t*& response_buffer) +{ + Tester tester; + return tester.Calculate(request_buffer, request_buffer_size, response_buffer); +} + diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/ReadMe.txt b/Software/Visual_Studio/Native/Tango.ColorLib/ReadMe.txt new file mode 100644 index 000000000..d9b08497d --- /dev/null +++ b/Software/Visual_Studio/Native/Tango.ColorLib/ReadMe.txt @@ -0,0 +1,48 @@ +======================================================================== + DYNAMIC LINK LIBRARY : Tango.ColorLib Project Overview +======================================================================== + +AppWizard has created this Tango.ColorLib DLL for you. + +This file contains a summary of what you will find in each of the files that +make up your Tango.ColorLib application. + + +Tango.ColorLib.vcxproj + This is the main project file for VC++ projects generated using an Application Wizard. + It contains information about the version of Visual C++ that generated the file, and + information about the platforms, configurations, and project features selected with the + Application Wizard. + +Tango.ColorLib.vcxproj.filters + This is the filters file for VC++ projects generated using an Application Wizard. + It contains information about the association between the files in your project + and the filters. This association is used in the IDE to show grouping of files with + similar extensions under a specific node (for e.g. ".cpp" files are associated with the + "Source Files" filter). + +Tango.ColorLib.cpp + This is the main DLL source file. + + When created, this DLL does not export any symbols. As a result, it + will not produce a .lib file when it is built. If you wish this project + to be a project dependency of some other project, you will either need to + add code to export some symbols from the DLL so that an export library + will be produced, or you can set the Ignore Input Library property to Yes + on the General propert page of the Linker folder in the project's Property + Pages dialog box. + +///////////////////////////////////////////////////////////////////////////// +Other standard files: + +StdAfx.h, StdAfx.cpp + These files are used to build a precompiled header (PCH) file + named Tango.ColorLib.pch and a precompiled types file named StdAfx.obj. + +///////////////////////////////////////////////////////////////////////////// +Other notes: + +AppWizard uses "TODO:" comments to indicate parts of the source code you +should add to or customize. + +///////////////////////////////////////////////////////////////////////////// diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/Tango.ColorLib.vcxproj b/Software/Visual_Studio/Native/Tango.ColorLib/Tango.ColorLib.vcxproj index 91ef89e5f..8026e3054 100644 --- a/Software/Visual_Studio/Native/Tango.ColorLib/Tango.ColorLib.vcxproj +++ b/Software/Visual_Studio/Native/Tango.ColorLib/Tango.ColorLib.vcxproj @@ -1,21 +1,13 @@  - + Debug - ARM + Win32 - + Release - ARM - - - Debug - ARM64 - - - Release - ARM64 + Win32 Debug @@ -25,162 +17,157 @@ Release x64 - - Debug - x86 - - - Release - x86 - - {92d97576-e154-444b-a084-d2269a5e8a15} - Android - ColorLib - 14.0 - Android - 3.0 - Tango.ColorLib + 15.0 + {625B2A26-97A9-45C9-8BCF-6BD30F593E17} + Win32Proj + TangoColorLib + 10.0.15063.0 - + DynamicLibrary true - Clang_3_8 + v141 + MultiByte - + DynamicLibrary false - Clang_3_8 - - - DynamicLibrary - true - Clang_3_8 - android-22 - - - DynamicLibrary - false - Clang_3_8 + v141 + true + Unicode DynamicLibrary true - Clang_3_8 + v141 + Unicode DynamicLibrary false - Clang_3_8 - - - DynamicLibrary - true - Clang_3_8 - android-22 - - - DynamicLibrary - false - Clang_3_8 + v141 + true + Unicode - - - + + + + + + + + + + + + + + + + - - - - - - Tango.ColorLib - ..\..\Build\Debug\Native\x86\ + + true + $(SolutionDir)Build\Debug $(ProjectDir);$(IncludePath) - Intermmediate\$(Platform)\$(Configuration)\ - - - + + true - + + false - - ..\..\Build\Debug\Native\arm\ - Intermediate\$(Platform)\$(Configuration)\ - $(ProjectDir);$(IncludePath) - - + + false - - - Use - pch.h - - - - - Use - pch.h - - - + NotUsing - pch.h + Level3 + Disabled + WIN32;_DEBUG;_WINDOWS;_USRDLL;TANGOCOLORLIB_EXPORTS;%(PreprocessorDefinitions) + Default + MultiThreaded + + Windows + + + "$(TargetDir)proto-tc.exe" -i "$(SolutionDir)..\PMR\Messages" -o "$(SolutionDir)Native\Tango.ColorLib\PMR" -l C + - - - Use - pch.h - - - - - Use - pch.h - - - + - Use - pch.h + + + Level3 + Disabled + _DEBUG;_WINDOWS;_USRDLL;TANGOCOLORLIB_EXPORTS;%(PreprocessorDefinitions) + + Windows + - + - NotUsing - pch.h + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_WINDOWS;_USRDLL;TANGOCOLORLIB_EXPORTS;%(PreprocessorDefinitions) + + Windows + true + true + - + - Use - pch.h + Level3 + + + MaxSpeed + true + true + NDEBUG;_WINDOWS;_USRDLL;TANGOCOLORLIB_EXPORTS;%(PreprocessorDefinitions) + + Windows + true + true + - - - - - - - + - - + + + + + + + + + + + + - + + \ No newline at end of file diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/Tango.ColorLib.vcxproj.filters b/Software/Visual_Studio/Native/Tango.ColorLib/Tango.ColorLib.vcxproj.filters index 87b2a7025..792d60478 100644 --- a/Software/Visual_Studio/Native/Tango.ColorLib/Tango.ColorLib.vcxproj.filters +++ b/Software/Visual_Studio/Native/Tango.ColorLib/Tango.ColorLib.vcxproj.filters @@ -1,60 +1,72 @@  - - - PMR\Common - - - PMR\Common - - - PMR\Common - - - PMR\Stubs - - - PMR\Stubs - - - Protobuf - + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + - - + + Header Files + + + Header Files + - PMR\Common + Header Files - PMR\Common + Header Files - - PMR\Common + + Header Files - PMR\Stubs + Header Files - PMR\Stubs + Header Files - - Protobuf + + Header Files - - {ad90425b-51a7-48e0-b46f-1371f5122b12} - - - {a3997c7c-f44f-40ac-bad7-fad37af037fb} - - - {8e3ba831-c4fa-4ab5-a199-91b056c411bc} - - - {fa5909e4-87e8-4aff-a965-5ca64768c3d0} - + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + \ No newline at end of file diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/Tester.cpp b/Software/Visual_Studio/Native/Tango.ColorLib/Tester.cpp new file mode 100644 index 000000000..d253f8cd6 --- /dev/null +++ b/Software/Visual_Studio/Native/Tango.ColorLib/Tester.cpp @@ -0,0 +1,25 @@ +#include "PMR/Stubs/CalculateRequest.pb-c.h" +#include "PMR/Stubs/CalculateResponse.pb-c.h" +#include "Tester.h" + +Tango::ColoLib::Tester::Tester() +{ +} + +Tango::ColoLib::Tester::~Tester() +{ +} + +size_t Tango::ColoLib::Tester::Calculate(uint8_t * request_buffer, size_t request_buffer_size, uint8_t*& response_buffer) +{ + CalculateRequest* request = calculate_request__unpack(NULL, request_buffer_size, request_buffer); + + + CalculateResponse response = CALCULATE_RESPONSE__INIT; + response.sum = request->a + request->b; + response.has_sum = true; + + response_buffer = (uint8_t*)malloc(calculate_response__get_packed_size(&response)); + return calculate_response__pack(&response, response_buffer); +} + diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/Tester.h b/Software/Visual_Studio/Native/Tango.ColorLib/Tester.h new file mode 100644 index 000000000..d5b710778 --- /dev/null +++ b/Software/Visual_Studio/Native/Tango.ColorLib/Tester.h @@ -0,0 +1,19 @@ +#include +#include + +#pragma once + +namespace Tango +{ + namespace ColoLib + { + class Tester + { + public: + Tester(); + ~Tester(); + size_t Calculate(uint8_t * request_buffer, size_t request_buffer_size, uint8_t *& response_buffer); + }; + } +} + diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/pch.h b/Software/Visual_Studio/Native/Tango.ColorLib/pch.h deleted file mode 100644 index bd99043ab..000000000 --- a/Software/Visual_Studio/Native/Tango.ColorLib/pch.h +++ /dev/null @@ -1,8 +0,0 @@ -#include -#include - -#include -#include -#include - -#include diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/targetver.h b/Software/Visual_Studio/Native/Tango.ColorLib/targetver.h new file mode 100644 index 000000000..87c0086de --- /dev/null +++ b/Software/Visual_Studio/Native/Tango.ColorLib/targetver.h @@ -0,0 +1,8 @@ +#pragma once + +// Including SDKDDKVer.h defines the highest available Windows platform. + +// If you wish to build your application for a previous Windows platform, include WinSDKVer.h and +// set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. + +#include diff --git a/Software/Visual_Studio/Tango.UnitTesting/Protobuf_TST.cs b/Software/Visual_Studio/Tango.UnitTesting/Protobuf_TST.cs index b6304d451..aa3c048c5 100644 --- a/Software/Visual_Studio/Tango.UnitTesting/Protobuf_TST.cs +++ b/Software/Visual_Studio/Tango.UnitTesting/Protobuf_TST.cs @@ -22,9 +22,12 @@ namespace Tango.UnitTesting [TestCategory("Protobuf")] public class Protobuf_TST { - [DllImport("Tango.ProtoTest.dll", CallingConvention = CallingConvention.Cdecl)] + [DllImport("Tango.ProtoTest.dll", CallingConvention = CallingConvention.Cdecl, EntryPoint = "Calculate")] public static extern int Calculate(IntPtr data, int size, ref IntPtr output); + [DllImport("Tango.ColorLib.dll", CallingConvention = CallingConvention.Cdecl, EntryPoint = "Calculate")] + public static extern int CalculateColorLib(IntPtr data, int size, ref IntPtr output); + /// /// Compiles all the whole PMR using all available compilers. /// @@ -111,5 +114,21 @@ namespace Tango.UnitTesting Assert.AreEqual(response.Sum, request.A + request.B); } + + /// + /// Calls a C++ native library using protobuf and gets a result. + /// + [TestMethod] + public void Call_ColorLib_And_Get_Result() + { + CalculateRequest request = new CalculateRequest(); + request.A = 10; + request.B = 5; + + NativePMR nativePMR = new NativePMR(CalculateColorLib); + CalculateResponse response = nativePMR.Invoke(request); + + Assert.AreEqual(response.Sum, request.A + request.B); + } } } diff --git a/Software/Visual_Studio/Tango.sln b/Software/Visual_Studio/Tango.sln index 28c4d7b0d..99f26f42d 100644 --- a/Software/Visual_Studio/Tango.sln +++ b/Software/Visual_Studio/Tango.sln @@ -97,7 +97,7 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tango.ColorPicker", "Tango. EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tango.MachineStudio.Synchronization", "MachineStudio\Modules\Tango.MachineStudio.Synchronization\Tango.MachineStudio.Synchronization.csproj", "{12D0C43C-391F-4C74-92AB-82E9A9BEEB9B}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Tango.ColorLib", "Native\Tango.ColorLib\Tango.ColorLib.vcxproj", "{92D97576-E154-444B-A084-D2269A5E8A15}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Tango.ColorLib", "Native\Tango.ColorLib\Tango.ColorLib.vcxproj", "{625B2A26-97A9-45C9-8BCF-6BD30F593E17}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -675,7 +675,6 @@ Global {0ECD6DA8-7AA6-48D9-8B65-279D176AD9AF}.Debug|x64.ActiveCfg = Debug|Any CPU {0ECD6DA8-7AA6-48D9-8B65-279D176AD9AF}.Debug|x64.Build.0 = Debug|Any CPU {0ECD6DA8-7AA6-48D9-8B65-279D176AD9AF}.Debug|x86.ActiveCfg = Debug|Any CPU - {0ECD6DA8-7AA6-48D9-8B65-279D176AD9AF}.Debug|x86.Build.0 = Debug|Any CPU {0ECD6DA8-7AA6-48D9-8B65-279D176AD9AF}.Release|Any CPU.ActiveCfg = Release|Any CPU {0ECD6DA8-7AA6-48D9-8B65-279D176AD9AF}.Release|Any CPU.Build.0 = Release|Any CPU {0ECD6DA8-7AA6-48D9-8B65-279D176AD9AF}.Release|ARM.ActiveCfg = Release|Any CPU @@ -826,24 +825,20 @@ Global {12D0C43C-391F-4C74-92AB-82E9A9BEEB9B}.Release|x64.Build.0 = Release|Any CPU {12D0C43C-391F-4C74-92AB-82E9A9BEEB9B}.Release|x86.ActiveCfg = Release|Any CPU {12D0C43C-391F-4C74-92AB-82E9A9BEEB9B}.Release|x86.Build.0 = Release|Any CPU - {92D97576-E154-444B-A084-D2269A5E8A15}.Debug|Any CPU.ActiveCfg = Debug|x86 - {92D97576-E154-444B-A084-D2269A5E8A15}.Debug|ARM.ActiveCfg = Debug|ARM - {92D97576-E154-444B-A084-D2269A5E8A15}.Debug|ARM.Build.0 = Debug|ARM - {92D97576-E154-444B-A084-D2269A5E8A15}.Debug|ARM64.ActiveCfg = Debug|ARM64 - {92D97576-E154-444B-A084-D2269A5E8A15}.Debug|ARM64.Build.0 = Debug|ARM64 - {92D97576-E154-444B-A084-D2269A5E8A15}.Debug|x64.ActiveCfg = Debug|x64 - {92D97576-E154-444B-A084-D2269A5E8A15}.Debug|x64.Build.0 = Debug|x64 - {92D97576-E154-444B-A084-D2269A5E8A15}.Debug|x86.ActiveCfg = Debug|x86 - {92D97576-E154-444B-A084-D2269A5E8A15}.Debug|x86.Build.0 = Debug|x86 - {92D97576-E154-444B-A084-D2269A5E8A15}.Release|Any CPU.ActiveCfg = Release|x86 - {92D97576-E154-444B-A084-D2269A5E8A15}.Release|ARM.ActiveCfg = Release|ARM - {92D97576-E154-444B-A084-D2269A5E8A15}.Release|ARM.Build.0 = Release|ARM - {92D97576-E154-444B-A084-D2269A5E8A15}.Release|ARM64.ActiveCfg = Release|ARM64 - {92D97576-E154-444B-A084-D2269A5E8A15}.Release|ARM64.Build.0 = Release|ARM64 - {92D97576-E154-444B-A084-D2269A5E8A15}.Release|x64.ActiveCfg = Release|x64 - {92D97576-E154-444B-A084-D2269A5E8A15}.Release|x64.Build.0 = Release|x64 - {92D97576-E154-444B-A084-D2269A5E8A15}.Release|x86.ActiveCfg = Release|x86 - {92D97576-E154-444B-A084-D2269A5E8A15}.Release|x86.Build.0 = Release|x86 + {625B2A26-97A9-45C9-8BCF-6BD30F593E17}.Debug|Any CPU.ActiveCfg = Debug|Win32 + {625B2A26-97A9-45C9-8BCF-6BD30F593E17}.Debug|ARM.ActiveCfg = Debug|Win32 + {625B2A26-97A9-45C9-8BCF-6BD30F593E17}.Debug|ARM64.ActiveCfg = Debug|Win32 + {625B2A26-97A9-45C9-8BCF-6BD30F593E17}.Debug|x64.ActiveCfg = Debug|x64 + {625B2A26-97A9-45C9-8BCF-6BD30F593E17}.Debug|x64.Build.0 = Debug|x64 + {625B2A26-97A9-45C9-8BCF-6BD30F593E17}.Debug|x86.ActiveCfg = Debug|Win32 + {625B2A26-97A9-45C9-8BCF-6BD30F593E17}.Debug|x86.Build.0 = Debug|Win32 + {625B2A26-97A9-45C9-8BCF-6BD30F593E17}.Release|Any CPU.ActiveCfg = Release|Win32 + {625B2A26-97A9-45C9-8BCF-6BD30F593E17}.Release|ARM.ActiveCfg = Release|Win32 + {625B2A26-97A9-45C9-8BCF-6BD30F593E17}.Release|ARM64.ActiveCfg = Release|Win32 + {625B2A26-97A9-45C9-8BCF-6BD30F593E17}.Release|x64.ActiveCfg = Release|x64 + {625B2A26-97A9-45C9-8BCF-6BD30F593E17}.Release|x64.Build.0 = Release|x64 + {625B2A26-97A9-45C9-8BCF-6BD30F593E17}.Release|x86.ActiveCfg = Release|Win32 + {625B2A26-97A9-45C9-8BCF-6BD30F593E17}.Release|x86.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -868,6 +863,6 @@ Global {CB0B0AA2-BB24-4BCA-A720-45E397684E12} = {57DF2A95-5DDD-4830-A4AF-B484B59C7C2B} {CE4A0D11-08A2-4CD6-9908-D6C62E80D805} = {B2AF4F3F-2828-47C3-8F3E-A0EA0BD66FF8} {12D0C43C-391F-4C74-92AB-82E9A9BEEB9B} = {B2AF4F3F-2828-47C3-8F3E-A0EA0BD66FF8} - {92D97576-E154-444B-A084-D2269A5E8A15} = {4443B71C-216E-4D4C-8D19-868F50803813} + {625B2A26-97A9-45C9-8BCF-6BD30F593E17} = {4443B71C-216E-4D4C-8D19-868F50803813} EndGlobalSection EndGlobal -- cgit v1.3.1 From 53db041e636bb3802dbe3cb911de6ef6ef41446c Mon Sep 17 00:00:00 2001 From: Roy Date: Sun, 24 Dec 2017 02:27:16 +0200 Subject: Continue for last commit. --- .../Tango.DAL/src/main/res/raw/tangodb | Bin 557056 -> 557056 bytes .../Android_Studio/Tango.Integration/build.gradle | 4 + .../Tango.Integration/src/main/AndroidManifest.xml | 1 + .../integration/operators/IMachineOperator.java | 5 +- .../integration/operators/MachineOperator.java | 13 +- .../providers/IMachineIdentityProvider.java | 2 +- .../providers/MachineIdentityProvider.java | 2 +- .../services/ExternalBridgeService.java | 173 +++++- .../services/IExternalBridgeService.java | 2 +- .../services/SynchronizationService.java | 3 +- .../Android_Studio/Tango.NativeBridge/build.gradle | 7 - .../java/com/twine/tango/pmr/MessageFactory.java | 45 +- .../tango/pmr/common/MessageTypeOuterClass.java | 36 +- ...ExternalBridgeUdpDiscoveryPacketOuterClass.java | 580 +++++++++++++++++++ .../ExternalClientLoginRequestOuterClass.java | 579 ++++++++++++++++++ .../ExternalClientLoginResponseOuterClass.java | 644 +++++++++++++++++++++ .../Tango.PMR/src/main/res/raw/packages.txt | 1 + .../Android_Studio/Tango.SharedUI/build.gradle | 4 + .../Android_Studio/Tango.Stubs.UI/build.gradle | 2 +- .../main/java/com/twine/tango/stubs/ui/App.java | 4 - .../stubs/ui/dagger/ApplicationComponent.java | 2 +- .../tango/stubs/ui/dagger/ApplicationModule.java | 30 + .../tango/stubs/ui/dagger/EventBusModule.java | 24 + .../tango/stubs/ui/dagger/IntegrationModule.java | 50 ++ .../tango/stubs/ui/dagger/NavigationModule.java | 20 + .../tango/stubs/ui/dagger/NotificationModule.java | 27 + .../tango/stubs/ui/dagger/ViewModelsModule.java | 11 +- .../tango/stubs/ui/views/main/MainActivityVM.java | 36 +- .../tango/stubs/ui/views/stub/StubFragmentVM.java | 9 +- .../com/twine/tango/stubs/stubs/Calculate.java | 2 +- .../java/com/twine/tango/stubs/stubs/Progress.java | 2 +- .../Tango.Synchronization/build.gradle | 2 +- .../twine/tango/transport/ITransportAdapter.java | 26 +- .../com/twine/tango/transport/ITransporter.java | 8 +- .../tango/transport/TransportAdapterBase.java | 84 ++- .../com/twine/tango/transport/TransporterBase.java | 52 +- .../Android_Studio/Tango.UnitTesting/build.gradle | 1 - .../tango/unittesting/Synchronization_TST.java | 10 +- Software/Android_Studio/settings.gradle | 2 +- Software/DB/Tango.mdf | Bin 8388608 -> 8388608 bytes Software/DB/Tango_log.ldf | Bin 8388608 -> 8388608 bytes Software/PMR/Messages/Common/MessageType.proto | 3 + .../ExternalBridgeUdpDiscoveryPacket.proto | 9 + .../Integration/ExternalClientLoginRequest.proto | 9 + .../Integration/ExternalClientLoginResponse.proto | 10 + .../INotificationProviderExtensions.cs | 30 - .../Tango.MachineStudio.DB.csproj | 1 - .../ViewModels/DbTableViewModel.cs | 1 - .../Images/machine-trans.png | Bin 0 -> 45618 bytes .../Navigation/NavigationView.cs | 1 + .../Tango.MachineStudio.Synchronization.csproj | 15 + .../ViewModelLocator.cs | 9 + .../ViewModels/DirectSynchronizationViewVM.cs | 20 + .../ViewModels/MenuViewVM.cs | 3 + .../Views/DirectSynchronizationView.xaml | 33 ++ .../Views/DirectSynchronizationView.xaml.cs | 28 + .../Views/MainView.xaml | 3 + .../Views/MenuView.xaml | 56 +- .../Notifications/DialogViewVM.cs | 47 ++ .../Notifications/INotificationProvider.cs | 6 +- .../StudioApplication/IStudioApplicationManager.cs | 3 + .../Tango.MachineStudio.Common.csproj | 5 + .../Tango.MachineStudio.UI/App.config | 8 + .../Tango.MachineStudio.UI/MainWindow.xaml.cs | 2 + .../Notifications/DefaultNotificationProvider.cs | 118 +++- .../Notifications/DialogWindow.xaml | 32 +- .../Notifications/DialogWindow.xaml.cs | 42 +- .../DefaultStudioApplicationManager.cs | 29 +- .../Tango.MachineStudio.UI.csproj | 23 + .../Tango.MachineStudio.UI/ViewModelLocator.cs | 15 + .../ViewModels/MachineConnectionViewVM.cs | 55 ++ .../ViewModels/MainViewVM.cs | 73 ++- .../Views/MachineConnectionView.xaml | 85 +++ .../Views/MachineConnectionView.xaml.cs | 34 ++ .../Tango.MachineStudio.UI/Views/MainView.xaml | 58 +- .../Tango.MachineStudio.UI/Views/MainView.xaml.cs | 6 +- .../Tango.MachineStudio.UI/packages.config | 1 + .../Tango.Core/Helpers/ThreadsHelper.cs | 12 +- .../Tango.Integration/Properties/AssemblyInfo.cs | 6 + .../Services/ExternalBridgeClient.cs | 68 +++ .../Services/ExternalBridgeScanner.cs | 112 ++++ .../Services/IExternalBridgeClient.cs | 22 + .../Tango.Integration/Tango.Integration.csproj | 85 +++ .../Visual_Studio/Tango.Integration/app.config | 11 + .../Tango.Integration/packages.config | 4 + .../Visual_Studio/Tango.PMR/Common/MessageType.cs | 11 +- .../ExternalBridgeUdpDiscoveryPacket.cs | 160 +++++ .../Integration/ExternalClientLoginRequest.cs | 160 +++++ .../Integration/ExternalClientLoginResponse.cs | 188 ++++++ Software/Visual_Studio/Tango.PMR/Tango.PMR.csproj | 3 + .../Visual_Studio/Tango.Settings/Integration.cs | 18 + .../Tango.Settings/SettingsCollection.cs | 3 + .../Tango.Settings/Tango.Settings.csproj | 1 + .../Tango.Transport/TransporterBase.cs | 6 +- Software/Visual_Studio/Tango.sln | 22 + 95 files changed, 3990 insertions(+), 280 deletions(-) create mode 100644 Software/Android_Studio/Tango.PMR/src/main/java/com/twine/tango/pmr/integration/ExternalBridgeUdpDiscoveryPacketOuterClass.java create mode 100644 Software/Android_Studio/Tango.PMR/src/main/java/com/twine/tango/pmr/integration/ExternalClientLoginRequestOuterClass.java create mode 100644 Software/Android_Studio/Tango.PMR/src/main/java/com/twine/tango/pmr/integration/ExternalClientLoginResponseOuterClass.java create mode 100644 Software/Android_Studio/Tango.Stubs.UI/src/main/java/com/twine/tango/stubs/ui/dagger/ApplicationModule.java create mode 100644 Software/Android_Studio/Tango.Stubs.UI/src/main/java/com/twine/tango/stubs/ui/dagger/EventBusModule.java create mode 100644 Software/Android_Studio/Tango.Stubs.UI/src/main/java/com/twine/tango/stubs/ui/dagger/IntegrationModule.java create mode 100644 Software/Android_Studio/Tango.Stubs.UI/src/main/java/com/twine/tango/stubs/ui/dagger/NavigationModule.java create mode 100644 Software/Android_Studio/Tango.Stubs.UI/src/main/java/com/twine/tango/stubs/ui/dagger/NotificationModule.java create mode 100644 Software/PMR/Messages/Integration/ExternalBridgeUdpDiscoveryPacket.proto create mode 100644 Software/PMR/Messages/Integration/ExternalClientLoginRequest.proto create mode 100644 Software/PMR/Messages/Integration/ExternalClientLoginResponse.proto delete mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ExtensionMethods/INotificationProviderExtensions.cs create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/Images/machine-trans.png create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/ViewModels/DirectSynchronizationViewVM.cs create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/Views/DirectSynchronizationView.xaml create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/Views/DirectSynchronizationView.xaml.cs create mode 100644 Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Notifications/DialogViewVM.cs create mode 100644 Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MachineConnectionViewVM.cs create mode 100644 Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MachineConnectionView.xaml create mode 100644 Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MachineConnectionView.xaml.cs create mode 100644 Software/Visual_Studio/Tango.Integration/Properties/AssemblyInfo.cs create mode 100644 Software/Visual_Studio/Tango.Integration/Services/ExternalBridgeClient.cs create mode 100644 Software/Visual_Studio/Tango.Integration/Services/ExternalBridgeScanner.cs create mode 100644 Software/Visual_Studio/Tango.Integration/Services/IExternalBridgeClient.cs create mode 100644 Software/Visual_Studio/Tango.Integration/Tango.Integration.csproj create mode 100644 Software/Visual_Studio/Tango.Integration/app.config create mode 100644 Software/Visual_Studio/Tango.Integration/packages.config create mode 100644 Software/Visual_Studio/Tango.PMR/Integration/ExternalBridgeUdpDiscoveryPacket.cs create mode 100644 Software/Visual_Studio/Tango.PMR/Integration/ExternalClientLoginRequest.cs create mode 100644 Software/Visual_Studio/Tango.PMR/Integration/ExternalClientLoginResponse.cs create mode 100644 Software/Visual_Studio/Tango.Settings/Integration.cs (limited to 'Software/Android_Studio/Tango.UnitTesting/src/androidTest') diff --git a/Software/Android_Studio/Tango.DAL/src/main/res/raw/tangodb b/Software/Android_Studio/Tango.DAL/src/main/res/raw/tangodb index 00c79da9c..0419b065c 100644 Binary files a/Software/Android_Studio/Tango.DAL/src/main/res/raw/tangodb and b/Software/Android_Studio/Tango.DAL/src/main/res/raw/tangodb differ diff --git a/Software/Android_Studio/Tango.Integration/build.gradle b/Software/Android_Studio/Tango.Integration/build.gradle index dc482d641..255fce0f6 100644 --- a/Software/Android_Studio/Tango.Integration/build.gradle +++ b/Software/Android_Studio/Tango.Integration/build.gradle @@ -43,4 +43,8 @@ dependencies { compile globalDependencies.dagger compile globalDependencies.daggerAndroid implementation project(':Tango.PMR') + implementation project(':Tango.Transport') + implementation project(':Tango.Core') + implementation project(':Tango.DAL') + implementation project(':Tango.Web') } diff --git a/Software/Android_Studio/Tango.Integration/src/main/AndroidManifest.xml b/Software/Android_Studio/Tango.Integration/src/main/AndroidManifest.xml index b57dcb665..81958ad3d 100644 --- a/Software/Android_Studio/Tango.Integration/src/main/AndroidManifest.xml +++ b/Software/Android_Studio/Tango.Integration/src/main/AndroidManifest.xml @@ -2,5 +2,6 @@ package="com.twine.tango.integration"> +
diff --git a/Software/Android_Studio/Tango.Integration/src/main/java/com/twine/tango/integration/operators/IMachineOperator.java b/Software/Android_Studio/Tango.Integration/src/main/java/com/twine/tango/integration/operators/IMachineOperator.java index 7d69ce8ad..9963f295b 100644 --- a/Software/Android_Studio/Tango.Integration/src/main/java/com/twine/tango/integration/operators/IMachineOperator.java +++ b/Software/Android_Studio/Tango.Integration/src/main/java/com/twine/tango/integration/operators/IMachineOperator.java @@ -1,9 +1,12 @@ package com.twine.tango.integration.operators; +import com.twine.tango.transport.ITransporter; + /** * Created by Roy on 12/23/2017. */ -public interface IMachineOperator +public interface IMachineOperator extends ITransporter { + } diff --git a/Software/Android_Studio/Tango.Integration/src/main/java/com/twine/tango/integration/operators/MachineOperator.java b/Software/Android_Studio/Tango.Integration/src/main/java/com/twine/tango/integration/operators/MachineOperator.java index 0eb73cab3..f23c8c705 100644 --- a/Software/Android_Studio/Tango.Integration/src/main/java/com/twine/tango/integration/operators/MachineOperator.java +++ b/Software/Android_Studio/Tango.Integration/src/main/java/com/twine/tango/integration/operators/MachineOperator.java @@ -1,9 +1,20 @@ package com.twine.tango.integration.operators; +import com.twine.tango.transport.ITransportAdapter; +import com.twine.tango.transport.transporters.ProtoTransporter; + /** * Created by Roy on 12/23/2017. */ -public class MachineOperator +public class MachineOperator extends ProtoTransporter implements IMachineOperator { + public MachineOperator() + { + } + + public MachineOperator(ITransportAdapter adapter) + { + super(adapter); + } } diff --git a/Software/Android_Studio/Tango.Integration/src/main/java/com/twine/tango/integration/providers/IMachineIdentityProvider.java b/Software/Android_Studio/Tango.Integration/src/main/java/com/twine/tango/integration/providers/IMachineIdentityProvider.java index 3e35be9d0..547a17e50 100644 --- a/Software/Android_Studio/Tango.Integration/src/main/java/com/twine/tango/integration/providers/IMachineIdentityProvider.java +++ b/Software/Android_Studio/Tango.Integration/src/main/java/com/twine/tango/integration/providers/IMachineIdentityProvider.java @@ -1,4 +1,4 @@ -package com.twine.tango.integration; +package com.twine.tango.integration.providers; /** diff --git a/Software/Android_Studio/Tango.Integration/src/main/java/com/twine/tango/integration/providers/MachineIdentityProvider.java b/Software/Android_Studio/Tango.Integration/src/main/java/com/twine/tango/integration/providers/MachineIdentityProvider.java index 29cb0c30c..b4f2d3c4d 100644 --- a/Software/Android_Studio/Tango.Integration/src/main/java/com/twine/tango/integration/providers/MachineIdentityProvider.java +++ b/Software/Android_Studio/Tango.Integration/src/main/java/com/twine/tango/integration/providers/MachineIdentityProvider.java @@ -1,4 +1,4 @@ -package com.twine.tango.integration; +package com.twine.tango.integration.providers; /** diff --git a/Software/Android_Studio/Tango.Integration/src/main/java/com/twine/tango/integration/services/ExternalBridgeService.java b/Software/Android_Studio/Tango.Integration/src/main/java/com/twine/tango/integration/services/ExternalBridgeService.java index f1702ee9e..709d5a271 100644 --- a/Software/Android_Studio/Tango.Integration/src/main/java/com/twine/tango/integration/services/ExternalBridgeService.java +++ b/Software/Android_Studio/Tango.Integration/src/main/java/com/twine/tango/integration/services/ExternalBridgeService.java @@ -1,35 +1,60 @@ package com.twine.tango.integration.services; +import android.content.Context; +import android.net.DhcpInfo; +import android.net.wifi.WifiManager; +import android.os.StrictMode; import android.os.SystemClock; +import android.provider.SyncStateContract.Constants; +import android.util.Log; import com.elvishew.xlog.XLog; +import com.google.protobuf.GeneratedMessageV3; +import com.twine.tango.core.ContextHelper; import com.twine.tango.core.IEventHandler; +import com.twine.tango.integration.operators.IMachineOperator; +import com.twine.tango.integration.providers.IMachineIdentityProvider; import com.twine.tango.pmr.MessageFactory; +import com.twine.tango.pmr.TangoMessage; import com.twine.tango.pmr.common.MessageContainerOuterClass.MessageContainer; import com.twine.tango.pmr.common.MessageTypeOuterClass.MessageType; +import com.twine.tango.pmr.integration.ExternalBridgeUdpDiscoveryPacketOuterClass.ExternalBridgeUdpDiscoveryPacket; +import com.twine.tango.pmr.integration.ExternalClientLoginRequestOuterClass.ExternalClientLoginRequest; +import com.twine.tango.pmr.integration.ExternalClientLoginResponseOuterClass.ExternalClientLoginResponse; +import com.twine.tango.transport.ITransportAdapter; import com.twine.tango.transport.adapters.TcpTransportAdapter; import com.twine.tango.transport.transporters.ProtoTransporter; import java.io.IOException; +import java.net.DatagramPacket; +import java.net.DatagramSocket; +import java.net.InetAddress; import java.net.ServerSocket; import java.net.Socket; import java.util.ArrayList; import java.util.List; +import javax.inject.Inject; + import static br.com.zbra.androidlinq.Linq.stream; /** * Created by Roy on 12/22/2017. */ -public class TangoBridgeService extends ProtoTransporter implements ITangoBridgeService +public class ExternalBridgeService extends ProtoTransporter implements IExternalBridgeService { private ServerSocket listener; private boolean isStarted; private List handlers; + private IMachineIdentityProvider identityProvider; + private IMachineOperator machineOperator; - public TangoBridgeService() + @Inject + public ExternalBridgeService(IMachineIdentityProvider identityProvider, IMachineOperator machineOperator) { + this.identityProvider = identityProvider; + this.machineOperator = machineOperator; handlers = new ArrayList<>(); } @@ -43,8 +68,63 @@ public class TangoBridgeService extends ProtoTransporter implements ITangoBridge public void start() throws IOException { listener = new ServerSocket(1984); + isStarted = true; Thread listenerThread = new Thread(this::listenerThreadMethod); + Thread discoveryThread = new Thread(this::discoveryThreadMethod); listenerThread.start(); + discoveryThread.start(); + } + + private void discoveryThreadMethod() + { + // Hack Prevent crash (sending should be done using an async task) + StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build(); + StrictMode.setThreadPolicy(policy); + + byte[] packet = ExternalBridgeUdpDiscoveryPacket.newBuilder().setSerialNumber(identityProvider.getSerialNumber()).build().toByteArray(); + + while (isStarted) + { + try + { + DatagramSocket socket = new DatagramSocket(); + socket.setBroadcast(true); + + //First try to send to emulator host... + DatagramPacket sendPacket = new DatagramPacket(packet, packet.length, InetAddress.getByName("10.0.2.2"), 8888); + socket.send(sendPacket); + + //This will not work on the emulator as far as I know. + //TODO: This needs to be tested on a real device! + sendPacket = new DatagramPacket(packet, packet.length, InetAddress.getByName("255.255.255.255"), 8888); + socket.send(sendPacket); + + } catch (IOException e) + { + XLog.e(e); + } + + SystemClock.sleep(5000); + } + } + + private InetAddress getBroadcastAddress() throws IOException + { + WifiManager wifi = (WifiManager) ContextHelper.getApplicationContext().getSystemService(Context.WIFI_SERVICE); + assert wifi != null; + DhcpInfo dhcp = wifi.getDhcpInfo(); + + if (dhcp != null) + { + int broadcast = (dhcp.ipAddress & dhcp.netmask) | ~dhcp.netmask; + byte[] quads = new byte[4]; + for (int k = 0; k < 4; k++) + quads[k] = (byte) ((broadcast >> k * 8) & 0xFF); + return InetAddress.getByAddress(quads); + } else + { + return null; + } } @Override @@ -86,37 +166,98 @@ public class TangoBridgeService extends ProtoTransporter implements ITangoBridge if (newSocket != null) { + for (ITransportAdapter adapter : getAdapters()) + { + adapter.disconnect().blockingAwait(); + } getAdapters().clear(); - getAdapters().add(new TcpTransportAdapter(newSocket)); - connect(); + TcpTransportAdapter adapter = new TcpTransportAdapter(newSocket); + adapter.setAuthenticated(false); + getAdapters().add(adapter); + connect().blockingAwait(); } } catch (IOException e) { - + XLog.e(e); } SystemClock.sleep(100); } + + disconnect().blockingAwait(); } @Override - protected void onRequestReceived(MessageContainer request) + protected void onRequestReceived(MessageContainer container) { - super.onRequestReceived(request); - + super.onRequestReceived(container); + try { - Object message = MessageFactory.parseMessageFromContainerAgnostic(request); - - List receivers = stream(handlers).where((x) -> x.messageType == request.getType()).toList(); - - for (HandlerAndType receiver : receivers) + if (container.getType() == MessageType.ExternalClientLoginRequest) { - //noinspection unchecked - receiver.handler.invoke(this, message); + ExternalClientLoginRequest request = MessageFactory.parseMessageFromContainer(container); + if (request.getKey().equals("1234")) + { + getAdapters().get(0).setAuthenticated(true); + sendResponse(MessageFactory.createTangoMessage( + ExternalClientLoginResponse.class, + ExternalClientLoginResponse.newBuilder().setAuthenticated(true).build(), + container.getToken())); + } else + { + getAdapters().get(0).setAuthenticated(false); + sendResponse(MessageFactory.createTangoMessage( + ExternalClientLoginResponse.class, + ExternalClientLoginResponse.newBuilder().setAuthenticated(false).build(), + container.getToken())); + } + + return; } - + + if (getAdapters().get(0).isAuthenticated()) + { + GeneratedMessageV3 message = MessageFactory.parseMessageFromContainerAgnostic(container); + + List receivers = stream(handlers).where((x) -> x.messageType == container.getType()).toList(); + + if (receivers.size() > 0) + { + for (HandlerAndType receiver : receivers) + { + //noinspection unchecked + receiver.handler.invoke(this, new MessageReceivedArgs(container, message)); + } + } else + { + //Route to machine... + if (container.getContinuous()) + { + machineOperator.sendContinuousRequest(MessageFactory.createTangoMessage(container, message)).subscribe((response) -> + { + sendResponse((TangoMessage) response); + }, (ex) -> + { + + }); + } else + { + machineOperator.sendRequest(MessageFactory.createTangoMessage(container, message)).subscribe((response) -> + { + sendResponse((TangoMessage) response); + }, (ex) -> + { + + }); + } + } + } else + { + XLog.w("Message received from an unauthorized adapter!"); + } + } catch (Exception e) { XLog.e(e); diff --git a/Software/Android_Studio/Tango.Integration/src/main/java/com/twine/tango/integration/services/IExternalBridgeService.java b/Software/Android_Studio/Tango.Integration/src/main/java/com/twine/tango/integration/services/IExternalBridgeService.java index 32abe3365..5a2aed9aa 100644 --- a/Software/Android_Studio/Tango.Integration/src/main/java/com/twine/tango/integration/services/IExternalBridgeService.java +++ b/Software/Android_Studio/Tango.Integration/src/main/java/com/twine/tango/integration/services/IExternalBridgeService.java @@ -11,7 +11,7 @@ import java.io.IOException; * Created by Roy on 12/22/2017. */ -public interface ITangoBridgeService extends ITransporter +public interface IExternalBridgeService extends ITransporter { boolean isStarted(); void start() throws IOException; diff --git a/Software/Android_Studio/Tango.Integration/src/main/java/com/twine/tango/integration/services/SynchronizationService.java b/Software/Android_Studio/Tango.Integration/src/main/java/com/twine/tango/integration/services/SynchronizationService.java index ed15c9b7b..0f3d98982 100644 --- a/Software/Android_Studio/Tango.Integration/src/main/java/com/twine/tango/integration/services/SynchronizationService.java +++ b/Software/Android_Studio/Tango.Integration/src/main/java/com/twine/tango/integration/services/SynchronizationService.java @@ -29,7 +29,6 @@ public class SynchronizationService implements ISynchronizationService private IMachineIdentityProvider machineIdentityProvider; private IExternalBridgeService bridgeService; - /** * Instantiates a new Tango synchronizer. * @@ -40,7 +39,7 @@ public class SynchronizationService implements ISynchronizationService { this.machineIdentityProvider = machineIdentityProvider; this.bridgeService = bridgeService; - this.bridgeService.registerMessageHandler(this::handleCalculateRequest, MessageType.CalculateRequest); + //this.bridgeService.registerMessageHandler(this::handleCalculateRequest, MessageType.CalculateRequest); } private void handleCalculateRequest(Object o, MessageReceivedArgs e) diff --git a/Software/Android_Studio/Tango.NativeBridge/build.gradle b/Software/Android_Studio/Tango.NativeBridge/build.gradle index 1454dd7ec..eaa5f5c3f 100644 --- a/Software/Android_Studio/Tango.NativeBridge/build.gradle +++ b/Software/Android_Studio/Tango.NativeBridge/build.gradle @@ -15,7 +15,6 @@ android { externalNativeBuild { cmake { cppFlags "-std=c++11 -frtti -fexceptions" - abiFilters "x86", "armeabi-v7a", "x86_64" } } } @@ -27,12 +26,6 @@ android { } } - sourceSets { - main { - jniLibs.srcDirs = ['libs'] - } - } - externalNativeBuild { cmake { path "CMakeLists.txt" diff --git a/Software/Android_Studio/Tango.PMR/src/main/java/com/twine/tango/pmr/MessageFactory.java b/Software/Android_Studio/Tango.PMR/src/main/java/com/twine/tango/pmr/MessageFactory.java index 55a0de4dd..413824e8d 100644 --- a/Software/Android_Studio/Tango.PMR/src/main/java/com/twine/tango/pmr/MessageFactory.java +++ b/Software/Android_Studio/Tango.PMR/src/main/java/com/twine/tango/pmr/MessageFactory.java @@ -1,6 +1,7 @@ package com.twine.tango.pmr; import com.elvishew.xlog.XLog; +import com.google.protobuf.GeneratedMessageV3; import com.google.protobuf.InvalidProtocolBufferException; import com.google.protobuf.Parser; import com.twine.tango.core.ReflectionsHelper; @@ -79,7 +80,7 @@ public class MessageFactory * @param typeName The inner message class. * @return New instance of {@link TangoMessage}. */ - public static TangoMessage createTangoMessage(Class typeName) + public static TangoMessage createTangoMessage(Class typeName) { try { @@ -108,7 +109,7 @@ public class MessageFactory * @param message the message * @return the tango message */ - public static TangoMessage createTangoMessage(Class typeName, T message) + public static TangoMessage createTangoMessage(Class typeName, T message) { TangoMessage tangoMessage = createTangoMessage(typeName); tangoMessage.setMessage(message); @@ -123,7 +124,39 @@ public class MessageFactory * @param token the token * @return the tango message */ - public static TangoMessage createTangoMessage(Class typeName, String token) + public static TangoMessage createTangoMessage(Class typeName, T message, String token) + { + TangoMessage tangoMessage = createTangoMessage(typeName); + tangoMessage.setMessage(message); + tangoMessage.getContainer().setToken(token); + return tangoMessage; + } + + /** + * Creates a new tango message with the specified message token. + * + * @param the type parameter + * @param typeName the type name + * @param token the token + * @return the tango message + */ + public static TangoMessage createTangoMessage(MessageContainer container, GeneratedMessageV3 message) + { + TangoMessage tangoMessage = new TangoMessage(message,container.getType()); + tangoMessage.setMessage(message); + tangoMessage.getContainer().setToken(container.getToken()); + return tangoMessage; + } + + /** + * Creates a new tango message with the specified message token. + * + * @param the type parameter + * @param typeName the type name + * @param token the token + * @return the tango message + */ + public static TangoMessage createTangoMessage(Class typeName, String token) { TangoMessage tangoMessage = createTangoMessage(typeName); tangoMessage.getContainer().setToken(token); @@ -138,7 +171,7 @@ public class MessageFactory * @return New instance of {@link TangoMessage}. */ @SuppressWarnings("unchecked") - public static TangoMessage parseTangoMessage(byte[] data) + public static TangoMessage parseTangoMessage(byte[] data) { try { @@ -167,7 +200,7 @@ public class MessageFactory * @throws IllegalAccessException the illegal access exception * @throws InvalidProtocolBufferException the invalid protocol buffer exception */ - public static T parseMessageFromContainer(MessageContainer container) throws ClassNotFoundException, NoSuchMethodException, InvocationTargetException, IllegalAccessException, InvalidProtocolBufferException + public static T parseMessageFromContainer(MessageContainer container) throws ClassNotFoundException, NoSuchMethodException, InvocationTargetException, IllegalAccessException, InvalidProtocolBufferException { Class type = getClassForName(container.getType().toString()); @@ -185,7 +218,7 @@ public class MessageFactory * @throws IllegalAccessException the illegal access exception * @throws InvalidProtocolBufferException the invalid protocol buffer exception */ - public static com.google.protobuf.GeneratedMessageV3 parseMessageFromContainerAgnostic(MessageContainer container) throws NoSuchMethodException, InvocationTargetException, IllegalAccessException, InvalidProtocolBufferException + public static GeneratedMessageV3 parseMessageFromContainerAgnostic(MessageContainer container) throws NoSuchMethodException, InvocationTargetException, IllegalAccessException, InvalidProtocolBufferException { Class type = getClassForName(container.getType().toString()); Parser parser = (Parser) type.getMethod("parser").invoke(null); diff --git a/Software/Android_Studio/Tango.PMR/src/main/java/com/twine/tango/pmr/common/MessageTypeOuterClass.java b/Software/Android_Studio/Tango.PMR/src/main/java/com/twine/tango/pmr/common/MessageTypeOuterClass.java index eeced1c83..27d581c93 100644 --- a/Software/Android_Studio/Tango.PMR/src/main/java/com/twine/tango/pmr/common/MessageTypeOuterClass.java +++ b/Software/Android_Studio/Tango.PMR/src/main/java/com/twine/tango/pmr/common/MessageTypeOuterClass.java @@ -151,6 +151,18 @@ public final class MessageTypeOuterClass { * StubValveResponse = 32; */ StubValveResponse(32), + /** + * ExternalBridgeUdpDiscoveryPacket = 33; + */ + ExternalBridgeUdpDiscoveryPacket(33), + /** + * ExternalClientLoginRequest = 34; + */ + ExternalClientLoginRequest(34), + /** + * ExternalClientLoginResponse = 35; + */ + ExternalClientLoginResponse(35), UNRECOGNIZED(-1), ; @@ -286,6 +298,18 @@ public final class MessageTypeOuterClass { * StubValveResponse = 32; */ public static final int StubValveResponse_VALUE = 32; + /** + * ExternalBridgeUdpDiscoveryPacket = 33; + */ + public static final int ExternalBridgeUdpDiscoveryPacket_VALUE = 33; + /** + * ExternalClientLoginRequest = 34; + */ + public static final int ExternalClientLoginRequest_VALUE = 34; + /** + * ExternalClientLoginResponse = 35; + */ + public static final int ExternalClientLoginResponse_VALUE = 35; public final int getNumber() { @@ -339,6 +363,9 @@ public final class MessageTypeOuterClass { case 30: return StubSteperMotorResponse; case 31: return StubValveRequest; case 32: return StubValveResponse; + case 33: return ExternalBridgeUdpDiscoveryPacket; + case 34: return ExternalClientLoginRequest; + case 35: return ExternalClientLoginResponse; default: return null; } } @@ -400,7 +427,7 @@ public final class MessageTypeOuterClass { descriptor; static { java.lang.String[] descriptorData = { - "\n\021MessageType.proto\022\020Tango.PMR.Common*\357\006" + + "\n\021MessageType.proto\022\020Tango.PMR.Common*\326\007" + "\n\013MessageType\022\007\n\003RGB\020\000\022\007\n\003Job\020\001\022\013\n\007Segme" + "nt\020\002\022\024\n\020CalculateRequest\020\003\022\025\n\021CalculateR" + "esponse\020\004\022\023\n\017ProgressRequest\020\005\022\024\n\020Progre" + @@ -422,8 +449,11 @@ public final class MessageTypeOuterClass { "ubOptLimitSwitchRequest\020\033\022\036\n\032StubOptLimi", "tSwitchResponse\020\034\022\032\n\026StubSteperMotorRequ" + "est\020\035\022\033\n\027StubSteperMotorResponse\020\036\022\024\n\020St" + - "ubValveRequest\020\037\022\025\n\021StubValveResponse\020 B" + - "\034\n\032com.twine.tango.pmr.commonb\006proto3" + "ubValveRequest\020\037\022\025\n\021StubValveResponse\020 \022" + + "$\n ExternalBridgeUdpDiscoveryPacket\020!\022\036\n" + + "\032ExternalClientLoginRequest\020\"\022\037\n\033Externa" + + "lClientLoginResponse\020#B\034\n\032com.twine.tang" + + "o.pmr.commonb\006proto3" }; com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { diff --git a/Software/Android_Studio/Tango.PMR/src/main/java/com/twine/tango/pmr/integration/ExternalBridgeUdpDiscoveryPacketOuterClass.java b/Software/Android_Studio/Tango.PMR/src/main/java/com/twine/tango/pmr/integration/ExternalBridgeUdpDiscoveryPacketOuterClass.java new file mode 100644 index 000000000..5b83561c0 --- /dev/null +++ b/Software/Android_Studio/Tango.PMR/src/main/java/com/twine/tango/pmr/integration/ExternalBridgeUdpDiscoveryPacketOuterClass.java @@ -0,0 +1,580 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: ExternalBridgeUdpDiscoveryPacket.proto + +package com.twine.tango.pmr.integration; + +public final class ExternalBridgeUdpDiscoveryPacketOuterClass { + private ExternalBridgeUdpDiscoveryPacketOuterClass() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface ExternalBridgeUdpDiscoveryPacketOrBuilder extends + // @@protoc_insertion_point(interface_extends:Tango.PMR.Integration.ExternalBridgeUdpDiscoveryPacket) + com.google.protobuf.MessageOrBuilder { + + /** + * string SerialNumber = 2; + */ + java.lang.String getSerialNumber(); + /** + * string SerialNumber = 2; + */ + com.google.protobuf.ByteString + getSerialNumberBytes(); + } + /** + * Protobuf type {@code Tango.PMR.Integration.ExternalBridgeUdpDiscoveryPacket} + */ + public static final class ExternalBridgeUdpDiscoveryPacket extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:Tango.PMR.Integration.ExternalBridgeUdpDiscoveryPacket) + ExternalBridgeUdpDiscoveryPacketOrBuilder { + private static final long serialVersionUID = 0L; + // Use ExternalBridgeUdpDiscoveryPacket.newBuilder() to construct. + private ExternalBridgeUdpDiscoveryPacket(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ExternalBridgeUdpDiscoveryPacket() { + serialNumber_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ExternalBridgeUdpDiscoveryPacket( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + serialNumber_ = s; + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.twine.tango.pmr.integration.ExternalBridgeUdpDiscoveryPacketOuterClass.internal_static_Tango_PMR_Integration_ExternalBridgeUdpDiscoveryPacket_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.twine.tango.pmr.integration.ExternalBridgeUdpDiscoveryPacketOuterClass.internal_static_Tango_PMR_Integration_ExternalBridgeUdpDiscoveryPacket_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.twine.tango.pmr.integration.ExternalBridgeUdpDiscoveryPacketOuterClass.ExternalBridgeUdpDiscoveryPacket.class, com.twine.tango.pmr.integration.ExternalBridgeUdpDiscoveryPacketOuterClass.ExternalBridgeUdpDiscoveryPacket.Builder.class); + } + + public static final int SERIALNUMBER_FIELD_NUMBER = 2; + private volatile java.lang.Object serialNumber_; + /** + * string SerialNumber = 2; + */ + public java.lang.String getSerialNumber() { + java.lang.Object ref = serialNumber_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + serialNumber_ = s; + return s; + } + } + /** + * string SerialNumber = 2; + */ + public com.google.protobuf.ByteString + getSerialNumberBytes() { + java.lang.Object ref = serialNumber_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + serialNumber_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getSerialNumberBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, serialNumber_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getSerialNumberBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, serialNumber_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.twine.tango.pmr.integration.ExternalBridgeUdpDiscoveryPacketOuterClass.ExternalBridgeUdpDiscoveryPacket)) { + return super.equals(obj); + } + com.twine.tango.pmr.integration.ExternalBridgeUdpDiscoveryPacketOuterClass.ExternalBridgeUdpDiscoveryPacket other = (com.twine.tango.pmr.integration.ExternalBridgeUdpDiscoveryPacketOuterClass.ExternalBridgeUdpDiscoveryPacket) obj; + + boolean result = true; + result = result && getSerialNumber() + .equals(other.getSerialNumber()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + SERIALNUMBER_FIELD_NUMBER; + hash = (53 * hash) + getSerialNumber().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.twine.tango.pmr.integration.ExternalBridgeUdpDiscoveryPacketOuterClass.ExternalBridgeUdpDiscoveryPacket parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.twine.tango.pmr.integration.ExternalBridgeUdpDiscoveryPacketOuterClass.ExternalBridgeUdpDiscoveryPacket parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.twine.tango.pmr.integration.ExternalBridgeUdpDiscoveryPacketOuterClass.ExternalBridgeUdpDiscoveryPacket parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.twine.tango.pmr.integration.ExternalBridgeUdpDiscoveryPacketOuterClass.ExternalBridgeUdpDiscoveryPacket parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.twine.tango.pmr.integration.ExternalBridgeUdpDiscoveryPacketOuterClass.ExternalBridgeUdpDiscoveryPacket parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.twine.tango.pmr.integration.ExternalBridgeUdpDiscoveryPacketOuterClass.ExternalBridgeUdpDiscoveryPacket parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.twine.tango.pmr.integration.ExternalBridgeUdpDiscoveryPacketOuterClass.ExternalBridgeUdpDiscoveryPacket parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.twine.tango.pmr.integration.ExternalBridgeUdpDiscoveryPacketOuterClass.ExternalBridgeUdpDiscoveryPacket parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.twine.tango.pmr.integration.ExternalBridgeUdpDiscoveryPacketOuterClass.ExternalBridgeUdpDiscoveryPacket parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.twine.tango.pmr.integration.ExternalBridgeUdpDiscoveryPacketOuterClass.ExternalBridgeUdpDiscoveryPacket parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.twine.tango.pmr.integration.ExternalBridgeUdpDiscoveryPacketOuterClass.ExternalBridgeUdpDiscoveryPacket parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.twine.tango.pmr.integration.ExternalBridgeUdpDiscoveryPacketOuterClass.ExternalBridgeUdpDiscoveryPacket parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.twine.tango.pmr.integration.ExternalBridgeUdpDiscoveryPacketOuterClass.ExternalBridgeUdpDiscoveryPacket prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code Tango.PMR.Integration.ExternalBridgeUdpDiscoveryPacket} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:Tango.PMR.Integration.ExternalBridgeUdpDiscoveryPacket) + com.twine.tango.pmr.integration.ExternalBridgeUdpDiscoveryPacketOuterClass.ExternalBridgeUdpDiscoveryPacketOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.twine.tango.pmr.integration.ExternalBridgeUdpDiscoveryPacketOuterClass.internal_static_Tango_PMR_Integration_ExternalBridgeUdpDiscoveryPacket_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.twine.tango.pmr.integration.ExternalBridgeUdpDiscoveryPacketOuterClass.internal_static_Tango_PMR_Integration_ExternalBridgeUdpDiscoveryPacket_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.twine.tango.pmr.integration.ExternalBridgeUdpDiscoveryPacketOuterClass.ExternalBridgeUdpDiscoveryPacket.class, com.twine.tango.pmr.integration.ExternalBridgeUdpDiscoveryPacketOuterClass.ExternalBridgeUdpDiscoveryPacket.Builder.class); + } + + // Construct using com.twine.tango.pmr.integration.ExternalBridgeUdpDiscoveryPacketOuterClass.ExternalBridgeUdpDiscoveryPacket.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + serialNumber_ = ""; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.twine.tango.pmr.integration.ExternalBridgeUdpDiscoveryPacketOuterClass.internal_static_Tango_PMR_Integration_ExternalBridgeUdpDiscoveryPacket_descriptor; + } + + public com.twine.tango.pmr.integration.ExternalBridgeUdpDiscoveryPacketOuterClass.ExternalBridgeUdpDiscoveryPacket getDefaultInstanceForType() { + return com.twine.tango.pmr.integration.ExternalBridgeUdpDiscoveryPacketOuterClass.ExternalBridgeUdpDiscoveryPacket.getDefaultInstance(); + } + + public com.twine.tango.pmr.integration.ExternalBridgeUdpDiscoveryPacketOuterClass.ExternalBridgeUdpDiscoveryPacket build() { + com.twine.tango.pmr.integration.ExternalBridgeUdpDiscoveryPacketOuterClass.ExternalBridgeUdpDiscoveryPacket result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.twine.tango.pmr.integration.ExternalBridgeUdpDiscoveryPacketOuterClass.ExternalBridgeUdpDiscoveryPacket buildPartial() { + com.twine.tango.pmr.integration.ExternalBridgeUdpDiscoveryPacketOuterClass.ExternalBridgeUdpDiscoveryPacket result = new com.twine.tango.pmr.integration.ExternalBridgeUdpDiscoveryPacketOuterClass.ExternalBridgeUdpDiscoveryPacket(this); + result.serialNumber_ = serialNumber_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.twine.tango.pmr.integration.ExternalBridgeUdpDiscoveryPacketOuterClass.ExternalBridgeUdpDiscoveryPacket) { + return mergeFrom((com.twine.tango.pmr.integration.ExternalBridgeUdpDiscoveryPacketOuterClass.ExternalBridgeUdpDiscoveryPacket)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.twine.tango.pmr.integration.ExternalBridgeUdpDiscoveryPacketOuterClass.ExternalBridgeUdpDiscoveryPacket other) { + if (other == com.twine.tango.pmr.integration.ExternalBridgeUdpDiscoveryPacketOuterClass.ExternalBridgeUdpDiscoveryPacket.getDefaultInstance()) return this; + if (!other.getSerialNumber().isEmpty()) { + serialNumber_ = other.serialNumber_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.twine.tango.pmr.integration.ExternalBridgeUdpDiscoveryPacketOuterClass.ExternalBridgeUdpDiscoveryPacket parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.twine.tango.pmr.integration.ExternalBridgeUdpDiscoveryPacketOuterClass.ExternalBridgeUdpDiscoveryPacket) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object serialNumber_ = ""; + /** + * string SerialNumber = 2; + */ + public java.lang.String getSerialNumber() { + java.lang.Object ref = serialNumber_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + serialNumber_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string SerialNumber = 2; + */ + public com.google.protobuf.ByteString + getSerialNumberBytes() { + java.lang.Object ref = serialNumber_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + serialNumber_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string SerialNumber = 2; + */ + public Builder setSerialNumber( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + serialNumber_ = value; + onChanged(); + return this; + } + /** + * string SerialNumber = 2; + */ + public Builder clearSerialNumber() { + + serialNumber_ = getDefaultInstance().getSerialNumber(); + onChanged(); + return this; + } + /** + * string SerialNumber = 2; + */ + public Builder setSerialNumberBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + serialNumber_ = value; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:Tango.PMR.Integration.ExternalBridgeUdpDiscoveryPacket) + } + + // @@protoc_insertion_point(class_scope:Tango.PMR.Integration.ExternalBridgeUdpDiscoveryPacket) + private static final com.twine.tango.pmr.integration.ExternalBridgeUdpDiscoveryPacketOuterClass.ExternalBridgeUdpDiscoveryPacket DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.twine.tango.pmr.integration.ExternalBridgeUdpDiscoveryPacketOuterClass.ExternalBridgeUdpDiscoveryPacket(); + } + + public static com.twine.tango.pmr.integration.ExternalBridgeUdpDiscoveryPacketOuterClass.ExternalBridgeUdpDiscoveryPacket getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public ExternalBridgeUdpDiscoveryPacket parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ExternalBridgeUdpDiscoveryPacket(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.twine.tango.pmr.integration.ExternalBridgeUdpDiscoveryPacketOuterClass.ExternalBridgeUdpDiscoveryPacket getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_Tango_PMR_Integration_ExternalBridgeUdpDiscoveryPacket_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_Tango_PMR_Integration_ExternalBridgeUdpDiscoveryPacket_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n&ExternalBridgeUdpDiscoveryPacket.proto" + + "\022\025Tango.PMR.Integration\"8\n ExternalBridg" + + "eUdpDiscoveryPacket\022\024\n\014SerialNumber\030\002 \001(" + + "\tB!\n\037com.twine.tango.pmr.integrationb\006pr" + + "oto3" + }; + com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = + new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { + public com.google.protobuf.ExtensionRegistry assignDescriptors( + com.google.protobuf.Descriptors.FileDescriptor root) { + descriptor = root; + return null; + } + }; + com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }, assigner); + internal_static_Tango_PMR_Integration_ExternalBridgeUdpDiscoveryPacket_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_Tango_PMR_Integration_ExternalBridgeUdpDiscoveryPacket_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_Tango_PMR_Integration_ExternalBridgeUdpDiscoveryPacket_descriptor, + new java.lang.String[] { "SerialNumber", }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/Software/Android_Studio/Tango.PMR/src/main/java/com/twine/tango/pmr/integration/ExternalClientLoginRequestOuterClass.java b/Software/Android_Studio/Tango.PMR/src/main/java/com/twine/tango/pmr/integration/ExternalClientLoginRequestOuterClass.java new file mode 100644 index 000000000..9717c3d11 --- /dev/null +++ b/Software/Android_Studio/Tango.PMR/src/main/java/com/twine/tango/pmr/integration/ExternalClientLoginRequestOuterClass.java @@ -0,0 +1,579 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: ExternalClientLoginRequest.proto + +package com.twine.tango.pmr.integration; + +public final class ExternalClientLoginRequestOuterClass { + private ExternalClientLoginRequestOuterClass() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface ExternalClientLoginRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:Tango.PMR.Integration.ExternalClientLoginRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * string key = 1; + */ + java.lang.String getKey(); + /** + * string key = 1; + */ + com.google.protobuf.ByteString + getKeyBytes(); + } + /** + * Protobuf type {@code Tango.PMR.Integration.ExternalClientLoginRequest} + */ + public static final class ExternalClientLoginRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:Tango.PMR.Integration.ExternalClientLoginRequest) + ExternalClientLoginRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ExternalClientLoginRequest.newBuilder() to construct. + private ExternalClientLoginRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ExternalClientLoginRequest() { + key_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ExternalClientLoginRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + key_ = s; + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.twine.tango.pmr.integration.ExternalClientLoginRequestOuterClass.internal_static_Tango_PMR_Integration_ExternalClientLoginRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.twine.tango.pmr.integration.ExternalClientLoginRequestOuterClass.internal_static_Tango_PMR_Integration_ExternalClientLoginRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.twine.tango.pmr.integration.ExternalClientLoginRequestOuterClass.ExternalClientLoginRequest.class, com.twine.tango.pmr.integration.ExternalClientLoginRequestOuterClass.ExternalClientLoginRequest.Builder.class); + } + + public static final int KEY_FIELD_NUMBER = 1; + private volatile java.lang.Object key_; + /** + * string key = 1; + */ + public java.lang.String getKey() { + java.lang.Object ref = key_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + key_ = s; + return s; + } + } + /** + * string key = 1; + */ + public com.google.protobuf.ByteString + getKeyBytes() { + java.lang.Object ref = key_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + key_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getKeyBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, key_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getKeyBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, key_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.twine.tango.pmr.integration.ExternalClientLoginRequestOuterClass.ExternalClientLoginRequest)) { + return super.equals(obj); + } + com.twine.tango.pmr.integration.ExternalClientLoginRequestOuterClass.ExternalClientLoginRequest other = (com.twine.tango.pmr.integration.ExternalClientLoginRequestOuterClass.ExternalClientLoginRequest) obj; + + boolean result = true; + result = result && getKey() + .equals(other.getKey()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + KEY_FIELD_NUMBER; + hash = (53 * hash) + getKey().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.twine.tango.pmr.integration.ExternalClientLoginRequestOuterClass.ExternalClientLoginRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.twine.tango.pmr.integration.ExternalClientLoginRequestOuterClass.ExternalClientLoginRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.twine.tango.pmr.integration.ExternalClientLoginRequestOuterClass.ExternalClientLoginRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.twine.tango.pmr.integration.ExternalClientLoginRequestOuterClass.ExternalClientLoginRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.twine.tango.pmr.integration.ExternalClientLoginRequestOuterClass.ExternalClientLoginRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.twine.tango.pmr.integration.ExternalClientLoginRequestOuterClass.ExternalClientLoginRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.twine.tango.pmr.integration.ExternalClientLoginRequestOuterClass.ExternalClientLoginRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.twine.tango.pmr.integration.ExternalClientLoginRequestOuterClass.ExternalClientLoginRequest parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.twine.tango.pmr.integration.ExternalClientLoginRequestOuterClass.ExternalClientLoginRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.twine.tango.pmr.integration.ExternalClientLoginRequestOuterClass.ExternalClientLoginRequest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.twine.tango.pmr.integration.ExternalClientLoginRequestOuterClass.ExternalClientLoginRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.twine.tango.pmr.integration.ExternalClientLoginRequestOuterClass.ExternalClientLoginRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.twine.tango.pmr.integration.ExternalClientLoginRequestOuterClass.ExternalClientLoginRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code Tango.PMR.Integration.ExternalClientLoginRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:Tango.PMR.Integration.ExternalClientLoginRequest) + com.twine.tango.pmr.integration.ExternalClientLoginRequestOuterClass.ExternalClientLoginRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.twine.tango.pmr.integration.ExternalClientLoginRequestOuterClass.internal_static_Tango_PMR_Integration_ExternalClientLoginRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.twine.tango.pmr.integration.ExternalClientLoginRequestOuterClass.internal_static_Tango_PMR_Integration_ExternalClientLoginRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.twine.tango.pmr.integration.ExternalClientLoginRequestOuterClass.ExternalClientLoginRequest.class, com.twine.tango.pmr.integration.ExternalClientLoginRequestOuterClass.ExternalClientLoginRequest.Builder.class); + } + + // Construct using com.twine.tango.pmr.integration.ExternalClientLoginRequestOuterClass.ExternalClientLoginRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + key_ = ""; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.twine.tango.pmr.integration.ExternalClientLoginRequestOuterClass.internal_static_Tango_PMR_Integration_ExternalClientLoginRequest_descriptor; + } + + public com.twine.tango.pmr.integration.ExternalClientLoginRequestOuterClass.ExternalClientLoginRequest getDefaultInstanceForType() { + return com.twine.tango.pmr.integration.ExternalClientLoginRequestOuterClass.ExternalClientLoginRequest.getDefaultInstance(); + } + + public com.twine.tango.pmr.integration.ExternalClientLoginRequestOuterClass.ExternalClientLoginRequest build() { + com.twine.tango.pmr.integration.ExternalClientLoginRequestOuterClass.ExternalClientLoginRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.twine.tango.pmr.integration.ExternalClientLoginRequestOuterClass.ExternalClientLoginRequest buildPartial() { + com.twine.tango.pmr.integration.ExternalClientLoginRequestOuterClass.ExternalClientLoginRequest result = new com.twine.tango.pmr.integration.ExternalClientLoginRequestOuterClass.ExternalClientLoginRequest(this); + result.key_ = key_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.twine.tango.pmr.integration.ExternalClientLoginRequestOuterClass.ExternalClientLoginRequest) { + return mergeFrom((com.twine.tango.pmr.integration.ExternalClientLoginRequestOuterClass.ExternalClientLoginRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.twine.tango.pmr.integration.ExternalClientLoginRequestOuterClass.ExternalClientLoginRequest other) { + if (other == com.twine.tango.pmr.integration.ExternalClientLoginRequestOuterClass.ExternalClientLoginRequest.getDefaultInstance()) return this; + if (!other.getKey().isEmpty()) { + key_ = other.key_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.twine.tango.pmr.integration.ExternalClientLoginRequestOuterClass.ExternalClientLoginRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.twine.tango.pmr.integration.ExternalClientLoginRequestOuterClass.ExternalClientLoginRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object key_ = ""; + /** + * string key = 1; + */ + public java.lang.String getKey() { + java.lang.Object ref = key_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + key_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string key = 1; + */ + public com.google.protobuf.ByteString + getKeyBytes() { + java.lang.Object ref = key_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + key_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string key = 1; + */ + public Builder setKey( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + key_ = value; + onChanged(); + return this; + } + /** + * string key = 1; + */ + public Builder clearKey() { + + key_ = getDefaultInstance().getKey(); + onChanged(); + return this; + } + /** + * string key = 1; + */ + public Builder setKeyBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + key_ = value; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:Tango.PMR.Integration.ExternalClientLoginRequest) + } + + // @@protoc_insertion_point(class_scope:Tango.PMR.Integration.ExternalClientLoginRequest) + private static final com.twine.tango.pmr.integration.ExternalClientLoginRequestOuterClass.ExternalClientLoginRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.twine.tango.pmr.integration.ExternalClientLoginRequestOuterClass.ExternalClientLoginRequest(); + } + + public static com.twine.tango.pmr.integration.ExternalClientLoginRequestOuterClass.ExternalClientLoginRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public ExternalClientLoginRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ExternalClientLoginRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.twine.tango.pmr.integration.ExternalClientLoginRequestOuterClass.ExternalClientLoginRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_Tango_PMR_Integration_ExternalClientLoginRequest_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_Tango_PMR_Integration_ExternalClientLoginRequest_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n ExternalClientLoginRequest.proto\022\025Tang" + + "o.PMR.Integration\")\n\032ExternalClientLogin" + + "Request\022\013\n\003key\030\001 \001(\tB!\n\037com.twine.tango." + + "pmr.integrationb\006proto3" + }; + com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = + new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { + public com.google.protobuf.ExtensionRegistry assignDescriptors( + com.google.protobuf.Descriptors.FileDescriptor root) { + descriptor = root; + return null; + } + }; + com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }, assigner); + internal_static_Tango_PMR_Integration_ExternalClientLoginRequest_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_Tango_PMR_Integration_ExternalClientLoginRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_Tango_PMR_Integration_ExternalClientLoginRequest_descriptor, + new java.lang.String[] { "Key", }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/Software/Android_Studio/Tango.PMR/src/main/java/com/twine/tango/pmr/integration/ExternalClientLoginResponseOuterClass.java b/Software/Android_Studio/Tango.PMR/src/main/java/com/twine/tango/pmr/integration/ExternalClientLoginResponseOuterClass.java new file mode 100644 index 000000000..57600bbc2 --- /dev/null +++ b/Software/Android_Studio/Tango.PMR/src/main/java/com/twine/tango/pmr/integration/ExternalClientLoginResponseOuterClass.java @@ -0,0 +1,644 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: ExternalClientLoginResponse.proto + +package com.twine.tango.pmr.integration; + +public final class ExternalClientLoginResponseOuterClass { + private ExternalClientLoginResponseOuterClass() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface ExternalClientLoginResponseOrBuilder extends + // @@protoc_insertion_point(interface_extends:Tango.PMR.Integration.ExternalClientLoginResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * bool Authenticated = 1; + */ + boolean getAuthenticated(); + + /** + * string SerialNumber = 2; + */ + java.lang.String getSerialNumber(); + /** + * string SerialNumber = 2; + */ + com.google.protobuf.ByteString + getSerialNumberBytes(); + } + /** + * Protobuf type {@code Tango.PMR.Integration.ExternalClientLoginResponse} + */ + public static final class ExternalClientLoginResponse extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:Tango.PMR.Integration.ExternalClientLoginResponse) + ExternalClientLoginResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ExternalClientLoginResponse.newBuilder() to construct. + private ExternalClientLoginResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ExternalClientLoginResponse() { + authenticated_ = false; + serialNumber_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ExternalClientLoginResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 8: { + + authenticated_ = input.readBool(); + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + serialNumber_ = s; + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.twine.tango.pmr.integration.ExternalClientLoginResponseOuterClass.internal_static_Tango_PMR_Integration_ExternalClientLoginResponse_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.twine.tango.pmr.integration.ExternalClientLoginResponseOuterClass.internal_static_Tango_PMR_Integration_ExternalClientLoginResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.twine.tango.pmr.integration.ExternalClientLoginResponseOuterClass.ExternalClientLoginResponse.class, com.twine.tango.pmr.integration.ExternalClientLoginResponseOuterClass.ExternalClientLoginResponse.Builder.class); + } + + public static final int AUTHENTICATED_FIELD_NUMBER = 1; + private boolean authenticated_; + /** + * bool Authenticated = 1; + */ + public boolean getAuthenticated() { + return authenticated_; + } + + public static final int SERIALNUMBER_FIELD_NUMBER = 2; + private volatile java.lang.Object serialNumber_; + /** + * string SerialNumber = 2; + */ + public java.lang.String getSerialNumber() { + java.lang.Object ref = serialNumber_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + serialNumber_ = s; + return s; + } + } + /** + * string SerialNumber = 2; + */ + public com.google.protobuf.ByteString + getSerialNumberBytes() { + java.lang.Object ref = serialNumber_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + serialNumber_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (authenticated_ != false) { + output.writeBool(1, authenticated_); + } + if (!getSerialNumberBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, serialNumber_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (authenticated_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(1, authenticated_); + } + if (!getSerialNumberBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, serialNumber_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.twine.tango.pmr.integration.ExternalClientLoginResponseOuterClass.ExternalClientLoginResponse)) { + return super.equals(obj); + } + com.twine.tango.pmr.integration.ExternalClientLoginResponseOuterClass.ExternalClientLoginResponse other = (com.twine.tango.pmr.integration.ExternalClientLoginResponseOuterClass.ExternalClientLoginResponse) obj; + + boolean result = true; + result = result && (getAuthenticated() + == other.getAuthenticated()); + result = result && getSerialNumber() + .equals(other.getSerialNumber()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + AUTHENTICATED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getAuthenticated()); + hash = (37 * hash) + SERIALNUMBER_FIELD_NUMBER; + hash = (53 * hash) + getSerialNumber().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.twine.tango.pmr.integration.ExternalClientLoginResponseOuterClass.ExternalClientLoginResponse parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.twine.tango.pmr.integration.ExternalClientLoginResponseOuterClass.ExternalClientLoginResponse parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.twine.tango.pmr.integration.ExternalClientLoginResponseOuterClass.ExternalClientLoginResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.twine.tango.pmr.integration.ExternalClientLoginResponseOuterClass.ExternalClientLoginResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.twine.tango.pmr.integration.ExternalClientLoginResponseOuterClass.ExternalClientLoginResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.twine.tango.pmr.integration.ExternalClientLoginResponseOuterClass.ExternalClientLoginResponse parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.twine.tango.pmr.integration.ExternalClientLoginResponseOuterClass.ExternalClientLoginResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.twine.tango.pmr.integration.ExternalClientLoginResponseOuterClass.ExternalClientLoginResponse parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.twine.tango.pmr.integration.ExternalClientLoginResponseOuterClass.ExternalClientLoginResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.twine.tango.pmr.integration.ExternalClientLoginResponseOuterClass.ExternalClientLoginResponse parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.twine.tango.pmr.integration.ExternalClientLoginResponseOuterClass.ExternalClientLoginResponse parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.twine.tango.pmr.integration.ExternalClientLoginResponseOuterClass.ExternalClientLoginResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.twine.tango.pmr.integration.ExternalClientLoginResponseOuterClass.ExternalClientLoginResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code Tango.PMR.Integration.ExternalClientLoginResponse} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:Tango.PMR.Integration.ExternalClientLoginResponse) + com.twine.tango.pmr.integration.ExternalClientLoginResponseOuterClass.ExternalClientLoginResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.twine.tango.pmr.integration.ExternalClientLoginResponseOuterClass.internal_static_Tango_PMR_Integration_ExternalClientLoginResponse_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.twine.tango.pmr.integration.ExternalClientLoginResponseOuterClass.internal_static_Tango_PMR_Integration_ExternalClientLoginResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.twine.tango.pmr.integration.ExternalClientLoginResponseOuterClass.ExternalClientLoginResponse.class, com.twine.tango.pmr.integration.ExternalClientLoginResponseOuterClass.ExternalClientLoginResponse.Builder.class); + } + + // Construct using com.twine.tango.pmr.integration.ExternalClientLoginResponseOuterClass.ExternalClientLoginResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + authenticated_ = false; + + serialNumber_ = ""; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.twine.tango.pmr.integration.ExternalClientLoginResponseOuterClass.internal_static_Tango_PMR_Integration_ExternalClientLoginResponse_descriptor; + } + + public com.twine.tango.pmr.integration.ExternalClientLoginResponseOuterClass.ExternalClientLoginResponse getDefaultInstanceForType() { + return com.twine.tango.pmr.integration.ExternalClientLoginResponseOuterClass.ExternalClientLoginResponse.getDefaultInstance(); + } + + public com.twine.tango.pmr.integration.ExternalClientLoginResponseOuterClass.ExternalClientLoginResponse build() { + com.twine.tango.pmr.integration.ExternalClientLoginResponseOuterClass.ExternalClientLoginResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.twine.tango.pmr.integration.ExternalClientLoginResponseOuterClass.ExternalClientLoginResponse buildPartial() { + com.twine.tango.pmr.integration.ExternalClientLoginResponseOuterClass.ExternalClientLoginResponse result = new com.twine.tango.pmr.integration.ExternalClientLoginResponseOuterClass.ExternalClientLoginResponse(this); + result.authenticated_ = authenticated_; + result.serialNumber_ = serialNumber_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.twine.tango.pmr.integration.ExternalClientLoginResponseOuterClass.ExternalClientLoginResponse) { + return mergeFrom((com.twine.tango.pmr.integration.ExternalClientLoginResponseOuterClass.ExternalClientLoginResponse)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.twine.tango.pmr.integration.ExternalClientLoginResponseOuterClass.ExternalClientLoginResponse other) { + if (other == com.twine.tango.pmr.integration.ExternalClientLoginResponseOuterClass.ExternalClientLoginResponse.getDefaultInstance()) return this; + if (other.getAuthenticated() != false) { + setAuthenticated(other.getAuthenticated()); + } + if (!other.getSerialNumber().isEmpty()) { + serialNumber_ = other.serialNumber_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.twine.tango.pmr.integration.ExternalClientLoginResponseOuterClass.ExternalClientLoginResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.twine.tango.pmr.integration.ExternalClientLoginResponseOuterClass.ExternalClientLoginResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private boolean authenticated_ ; + /** + * bool Authenticated = 1; + */ + public boolean getAuthenticated() { + return authenticated_; + } + /** + * bool Authenticated = 1; + */ + public Builder setAuthenticated(boolean value) { + + authenticated_ = value; + onChanged(); + return this; + } + /** + * bool Authenticated = 1; + */ + public Builder clearAuthenticated() { + + authenticated_ = false; + onChanged(); + return this; + } + + private java.lang.Object serialNumber_ = ""; + /** + * string SerialNumber = 2; + */ + public java.lang.String getSerialNumber() { + java.lang.Object ref = serialNumber_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + serialNumber_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string SerialNumber = 2; + */ + public com.google.protobuf.ByteString + getSerialNumberBytes() { + java.lang.Object ref = serialNumber_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + serialNumber_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string SerialNumber = 2; + */ + public Builder setSerialNumber( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + serialNumber_ = value; + onChanged(); + return this; + } + /** + * string SerialNumber = 2; + */ + public Builder clearSerialNumber() { + + serialNumber_ = getDefaultInstance().getSerialNumber(); + onChanged(); + return this; + } + /** + * string SerialNumber = 2; + */ + public Builder setSerialNumberBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + serialNumber_ = value; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:Tango.PMR.Integration.ExternalClientLoginResponse) + } + + // @@protoc_insertion_point(class_scope:Tango.PMR.Integration.ExternalClientLoginResponse) + private static final com.twine.tango.pmr.integration.ExternalClientLoginResponseOuterClass.ExternalClientLoginResponse DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.twine.tango.pmr.integration.ExternalClientLoginResponseOuterClass.ExternalClientLoginResponse(); + } + + public static com.twine.tango.pmr.integration.ExternalClientLoginResponseOuterClass.ExternalClientLoginResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public ExternalClientLoginResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ExternalClientLoginResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.twine.tango.pmr.integration.ExternalClientLoginResponseOuterClass.ExternalClientLoginResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_Tango_PMR_Integration_ExternalClientLoginResponse_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_Tango_PMR_Integration_ExternalClientLoginResponse_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n!ExternalClientLoginResponse.proto\022\025Tan" + + "go.PMR.Integration\"J\n\033ExternalClientLogi" + + "nResponse\022\025\n\rAuthenticated\030\001 \001(\010\022\024\n\014Seri" + + "alNumber\030\002 \001(\tB!\n\037com.twine.tango.pmr.in" + + "tegrationb\006proto3" + }; + com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = + new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { + public com.google.protobuf.ExtensionRegistry assignDescriptors( + com.google.protobuf.Descriptors.FileDescriptor root) { + descriptor = root; + return null; + } + }; + com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }, assigner); + internal_static_Tango_PMR_Integration_ExternalClientLoginResponse_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_Tango_PMR_Integration_ExternalClientLoginResponse_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_Tango_PMR_Integration_ExternalClientLoginResponse_descriptor, + new java.lang.String[] { "Authenticated", "SerialNumber", }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/Software/Android_Studio/Tango.PMR/src/main/res/raw/packages.txt b/Software/Android_Studio/Tango.PMR/src/main/res/raw/packages.txt index 803095d92..7dcb7e0f1 100644 --- a/Software/Android_Studio/Tango.PMR/src/main/res/raw/packages.txt +++ b/Software/Android_Studio/Tango.PMR/src/main/res/raw/packages.txt @@ -1,4 +1,5 @@ common +integration jobs stubs synchronization diff --git a/Software/Android_Studio/Tango.SharedUI/build.gradle b/Software/Android_Studio/Tango.SharedUI/build.gradle index 00bf0b351..832a8eb22 100644 --- a/Software/Android_Studio/Tango.SharedUI/build.gradle +++ b/Software/Android_Studio/Tango.SharedUI/build.gradle @@ -59,4 +59,8 @@ dependencies { compile globalDependencies.protobuf implementation project(':Tango.PMR') implementation project(':Tango.Web') + compile 'com.google.dagger:dagger:2.11' + implementation project(':Tango.Transport') + implementation project(':Tango.Integration') + compile 'com.squareup:otto:1.3.8' } diff --git a/Software/Android_Studio/Tango.Stubs.UI/build.gradle b/Software/Android_Studio/Tango.Stubs.UI/build.gradle index 42109f2a8..41853210a 100644 --- a/Software/Android_Studio/Tango.Stubs.UI/build.gradle +++ b/Software/Android_Studio/Tango.Stubs.UI/build.gradle @@ -12,7 +12,7 @@ android { versionCode 1 versionName "1.0" vectorDrawables.useSupportLibrary = true - + multiDexEnabled true testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" } diff --git a/Software/Android_Studio/Tango.Stubs.UI/src/main/java/com/twine/tango/stubs/ui/App.java b/Software/Android_Studio/Tango.Stubs.UI/src/main/java/com/twine/tango/stubs/ui/App.java index d0437aaa1..96b5b490d 100644 --- a/Software/Android_Studio/Tango.Stubs.UI/src/main/java/com/twine/tango/stubs/ui/App.java +++ b/Software/Android_Studio/Tango.Stubs.UI/src/main/java/com/twine/tango/stubs/ui/App.java @@ -1,9 +1,5 @@ package com.twine.tango.stubs.ui; -import android.app.Application; -import android.content.Context; - -import com.elvishew.xlog.XLog; import com.twine.tango.sharedui.TangoApplication; import com.twine.tango.stubs.ui.dagger.ApplicationComponent; import com.twine.tango.stubs.ui.dagger.ApplicationModule; diff --git a/Software/Android_Studio/Tango.Stubs.UI/src/main/java/com/twine/tango/stubs/ui/dagger/ApplicationComponent.java b/Software/Android_Studio/Tango.Stubs.UI/src/main/java/com/twine/tango/stubs/ui/dagger/ApplicationComponent.java index ab0b84c25..cbd61f9ee 100644 --- a/Software/Android_Studio/Tango.Stubs.UI/src/main/java/com/twine/tango/stubs/ui/dagger/ApplicationComponent.java +++ b/Software/Android_Studio/Tango.Stubs.UI/src/main/java/com/twine/tango/stubs/ui/dagger/ApplicationComponent.java @@ -16,7 +16,7 @@ import dagger.Component; */ @Singleton -@Component(modules = {ApplicationModule.class, ViewModelsModule.class, EventBusModule.class, NotificationModule.class, TransportModule.class, NavigationModule.class}) +@Component(modules = {ApplicationModule.class, ViewModelsModule.class, EventBusModule.class, NotificationModule.class, NavigationModule.class, IntegrationModule.class}) public interface ApplicationComponent { diff --git a/Software/Android_Studio/Tango.Stubs.UI/src/main/java/com/twine/tango/stubs/ui/dagger/ApplicationModule.java b/Software/Android_Studio/Tango.Stubs.UI/src/main/java/com/twine/tango/stubs/ui/dagger/ApplicationModule.java new file mode 100644 index 000000000..ce664f835 --- /dev/null +++ b/Software/Android_Studio/Tango.Stubs.UI/src/main/java/com/twine/tango/stubs/ui/dagger/ApplicationModule.java @@ -0,0 +1,30 @@ +package com.twine.tango.stubs.ui.dagger; + +import android.app.Application; +import android.content.Context; + +import javax.inject.Singleton; + +import dagger.Module; +import dagger.Provides; + +/** + * Created by Roy on 11/6/2017. + */ + +@Module +public class ApplicationModule { + + private Application application; + + public ApplicationModule(Application application) { + this.application = application; + } + + @Provides + @Singleton + public Context provideContext() + { + return application; + } +} diff --git a/Software/Android_Studio/Tango.Stubs.UI/src/main/java/com/twine/tango/stubs/ui/dagger/EventBusModule.java b/Software/Android_Studio/Tango.Stubs.UI/src/main/java/com/twine/tango/stubs/ui/dagger/EventBusModule.java new file mode 100644 index 000000000..3aeb461f7 --- /dev/null +++ b/Software/Android_Studio/Tango.Stubs.UI/src/main/java/com/twine/tango/stubs/ui/dagger/EventBusModule.java @@ -0,0 +1,24 @@ +package com.twine.tango.stubs.ui.dagger; + +import com.squareup.otto.Bus; +import com.squareup.otto.ThreadEnforcer; + +import javax.inject.Singleton; + +import dagger.Module; +import dagger.Provides; + +/** + * Created by Roy on 11/6/2017. + */ + +@Module +public class EventBusModule { + + @Provides + @Singleton + public Bus provideEventBus() + { + return new Bus(ThreadEnforcer.MAIN); + } +} diff --git a/Software/Android_Studio/Tango.Stubs.UI/src/main/java/com/twine/tango/stubs/ui/dagger/IntegrationModule.java b/Software/Android_Studio/Tango.Stubs.UI/src/main/java/com/twine/tango/stubs/ui/dagger/IntegrationModule.java new file mode 100644 index 000000000..b06d9aa67 --- /dev/null +++ b/Software/Android_Studio/Tango.Stubs.UI/src/main/java/com/twine/tango/stubs/ui/dagger/IntegrationModule.java @@ -0,0 +1,50 @@ +package com.twine.tango.stubs.ui.dagger; + +import com.twine.tango.integration.operators.IMachineOperator; +import com.twine.tango.integration.operators.MachineOperator; +import com.twine.tango.integration.providers.IMachineIdentityProvider; +import com.twine.tango.integration.providers.MachineIdentityProvider; +import com.twine.tango.integration.services.IExternalBridgeService; +import com.twine.tango.integration.services.ISynchronizationService; +import com.twine.tango.integration.services.ExternalBridgeService; +import com.twine.tango.integration.services.SynchronizationService; +import com.twine.tango.transport.adapters.TcpTransportAdapter; + +import javax.inject.Singleton; +import dagger.Module; +import dagger.Provides; + +/** + * Created by Roy on 11/6/2017. + */ +@Module +public class IntegrationModule +{ + @Provides + @Singleton + public IExternalBridgeService provideBridgeService(IMachineIdentityProvider machineIdentityProvider,IMachineOperator machineOperator) + { + return new ExternalBridgeService(machineIdentityProvider,machineOperator); + } + + @Provides + @Singleton + public ISynchronizationService provideSynchronizationService(IMachineIdentityProvider machineIdentityProvider, IExternalBridgeService bridgeService) + { + return new SynchronizationService(machineIdentityProvider, bridgeService); + } + + @Provides + @Singleton + public IMachineIdentityProvider provideMachineIdentityProvider() + { + return new MachineIdentityProvider(); + } + + @Provides + @Singleton + public IMachineOperator providerMachineOperator() + { + return new MachineOperator(new TcpTransportAdapter("10.0.2.2", 9999)); + } +} diff --git a/Software/Android_Studio/Tango.Stubs.UI/src/main/java/com/twine/tango/stubs/ui/dagger/NavigationModule.java b/Software/Android_Studio/Tango.Stubs.UI/src/main/java/com/twine/tango/stubs/ui/dagger/NavigationModule.java new file mode 100644 index 000000000..674157858 --- /dev/null +++ b/Software/Android_Studio/Tango.Stubs.UI/src/main/java/com/twine/tango/stubs/ui/dagger/NavigationModule.java @@ -0,0 +1,20 @@ +package com.twine.tango.stubs.ui.dagger; + +import android.content.Context; +import com.twine.tango.sharedui.navigation.AndroidNavigationProvider; +import com.twine.tango.sharedui.navigation.INavigationProvider; +import javax.inject.Singleton; + +import dagger.Module; +import dagger.Provides; + +@Module +public class NavigationModule +{ + @Provides + @Singleton + public INavigationProvider provideNavigation() + { + return new AndroidNavigationProvider(); + } +} diff --git a/Software/Android_Studio/Tango.Stubs.UI/src/main/java/com/twine/tango/stubs/ui/dagger/NotificationModule.java b/Software/Android_Studio/Tango.Stubs.UI/src/main/java/com/twine/tango/stubs/ui/dagger/NotificationModule.java new file mode 100644 index 000000000..69d6d8f62 --- /dev/null +++ b/Software/Android_Studio/Tango.Stubs.UI/src/main/java/com/twine/tango/stubs/ui/dagger/NotificationModule.java @@ -0,0 +1,27 @@ +package com.twine.tango.stubs.ui.dagger; + +import android.content.Context; + +import com.twine.tango.sharedui.notifications.AndroidNotificationProvider; +import com.twine.tango.sharedui.notifications.INotificationProvider; + +import javax.inject.Singleton; + +import dagger.Module; +import dagger.Provides; + +/** + * Created by Roy on 11/6/2017. + */ + +@Module +public class NotificationModule { + + @Provides + @Singleton + public INotificationProvider provideNotificationProvider(Context context) + { + return new AndroidNotificationProvider(context); + } + +} diff --git a/Software/Android_Studio/Tango.Stubs.UI/src/main/java/com/twine/tango/stubs/ui/dagger/ViewModelsModule.java b/Software/Android_Studio/Tango.Stubs.UI/src/main/java/com/twine/tango/stubs/ui/dagger/ViewModelsModule.java index 927511efc..b7e494ecf 100644 --- a/Software/Android_Studio/Tango.Stubs.UI/src/main/java/com/twine/tango/stubs/ui/dagger/ViewModelsModule.java +++ b/Software/Android_Studio/Tango.Stubs.UI/src/main/java/com/twine/tango/stubs/ui/dagger/ViewModelsModule.java @@ -1,6 +1,9 @@ package com.twine.tango.stubs.ui.dagger; import com.squareup.otto.Bus; +import com.twine.tango.integration.operators.IMachineOperator; +import com.twine.tango.integration.services.IExternalBridgeService; +import com.twine.tango.integration.services.ISynchronizationService; import com.twine.tango.sharedui.navigation.INavigationProvider; import com.twine.tango.sharedui.notifications.INotificationProvider; import com.twine.tango.stubs.ui.views.login.LoginFragmentVM; @@ -26,9 +29,9 @@ public class ViewModelsModule @Provides @Singleton - public MainActivityVM provideMainActivityVM(Bus eventBus, INotificationProvider notificationProvider, INavigationProvider navigationProvider, ITransporter transporter) + public MainActivityVM provideMainActivityVM(Bus eventBus, INotificationProvider notificationProvider, INavigationProvider navigationProvider, IMachineOperator machineOperator, ISynchronizationService synchronizationService, IExternalBridgeService externalBridgeService) { - return new MainActivityVM(eventBus, notificationProvider, navigationProvider, transporter); + return new MainActivityVM(eventBus, notificationProvider, navigationProvider, machineOperator, externalBridgeService, synchronizationService); } @Provides @@ -54,8 +57,8 @@ public class ViewModelsModule @Provides @Singleton - public StubFragmentVM provideStubFragmentVM(Bus eventBus, INotificationProvider notificationProvider, ITransporter transporter) + public StubFragmentVM provideStubFragmentVM(Bus eventBus, INotificationProvider notificationProvider, IMachineOperator machineOperator) { - return new StubFragmentVM(eventBus, notificationProvider, transporter); + return new StubFragmentVM(eventBus, notificationProvider, machineOperator); } } diff --git a/Software/Android_Studio/Tango.Stubs.UI/src/main/java/com/twine/tango/stubs/ui/views/main/MainActivityVM.java b/Software/Android_Studio/Tango.Stubs.UI/src/main/java/com/twine/tango/stubs/ui/views/main/MainActivityVM.java index e77cc0810..64d69b0e6 100644 --- a/Software/Android_Studio/Tango.Stubs.UI/src/main/java/com/twine/tango/stubs/ui/views/main/MainActivityVM.java +++ b/Software/Android_Studio/Tango.Stubs.UI/src/main/java/com/twine/tango/stubs/ui/views/main/MainActivityVM.java @@ -2,6 +2,9 @@ package com.twine.tango.stubs.ui.views.main; import com.squareup.otto.Bus; import com.squareup.otto.Subscribe; +import com.twine.tango.integration.operators.IMachineOperator; +import com.twine.tango.integration.services.IExternalBridgeService; +import com.twine.tango.integration.services.ISynchronizationService; import com.twine.tango.models.User; import com.twine.tango.sharedui.mvvm.DependencyProperty; import com.twine.tango.sharedui.mvvm.RelayCommand; @@ -10,9 +13,10 @@ import com.twine.tango.sharedui.navigation.INavigationProvider; import com.twine.tango.sharedui.notifications.INotificationProvider; import com.twine.tango.stubs.ui.Events.LoginEvent; import com.twine.tango.stubs.ui.views.main.IMainActivity.Navigation; -import com.twine.tango.transport.ITransporter; import com.twine.tango.transport.TransportComponentState; +import java.io.IOException; + import javax.inject.Inject; import io.reactivex.android.schedulers.AndroidSchedulers; @@ -24,7 +28,9 @@ public class MainActivityVM extends ViewModelBase private User currentUser; private INotificationProvider notificationProvider; private INavigationProvider navigationProvider; - private ITransporter transporter; + private IMachineOperator machineOperator; + private ISynchronizationService synchronizationService; + private IExternalBridgeService externalBridgeService; public DependencyProperty isConnected; @@ -34,33 +40,43 @@ public class MainActivityVM extends ViewModelBase @Inject - public MainActivityVM(Bus eventBus, INotificationProvider notificationProvider, INavigationProvider navigationProvider,ITransporter transporter) + public MainActivityVM(Bus eventBus, INotificationProvider notificationProvider, INavigationProvider navigationProvider, IMachineOperator machineOperator, IExternalBridgeService externalBridgeService, ISynchronizationService synchronizationService) { this.eventBus = eventBus; this.notificationProvider = notificationProvider; this.navigationProvider = navigationProvider; - this.transporter = transporter; + this.machineOperator = machineOperator; + this.synchronizationService = synchronizationService; + this.externalBridgeService = externalBridgeService; this.eventBus.register(this); isConnected = new DependencyProperty<>(false); - connectCommand = new RelayCommand(this::connect,() -> this.transporter.getState() != TransportComponentState.Connected); - disconnectCommand = new RelayCommand(this::disconnect,() -> this.transporter.getState() == TransportComponentState.Connected); + connectCommand = new RelayCommand(this::connect,() -> this.machineOperator.getState() != TransportComponentState.Connected); + disconnectCommand = new RelayCommand(this::disconnect,() -> this.machineOperator.getState() == TransportComponentState.Connected); - this.transporter.addStateChangedListener((sender,e) -> - isConnected.set(this.transporter.getState() == TransportComponentState.Connected)); + this.machineOperator.addStateChangedListener((sender, e) -> + isConnected.set(this.machineOperator.getState() == TransportComponentState.Connected)); + + try + { + externalBridgeService.start(); + } catch (IOException e) + { + e.printStackTrace(); + } } private void connect() { - transporter.connect().observeOn(AndroidSchedulers.mainThread()).subscribe(() -> + machineOperator.connect().observeOn(AndroidSchedulers.mainThread()).subscribe(() -> invalidateCommands(),(ex) -> notificationProvider.showMessage(view,"Could not connect the Transporter.")); } private void disconnect() { - transporter.disconnect().observeOn(AndroidSchedulers.mainThread()).subscribe(() -> + machineOperator.disconnect().observeOn(AndroidSchedulers.mainThread()).subscribe(() -> invalidateCommands(),(ex) -> notificationProvider.showMessage(view,"Could not disconnect the Transporter.")); } diff --git a/Software/Android_Studio/Tango.Stubs.UI/src/main/java/com/twine/tango/stubs/ui/views/stub/StubFragmentVM.java b/Software/Android_Studio/Tango.Stubs.UI/src/main/java/com/twine/tango/stubs/ui/views/stub/StubFragmentVM.java index 8a052b38c..fe237bcd8 100644 --- a/Software/Android_Studio/Tango.Stubs.UI/src/main/java/com/twine/tango/stubs/ui/views/stub/StubFragmentVM.java +++ b/Software/Android_Studio/Tango.Stubs.UI/src/main/java/com/twine/tango/stubs/ui/views/stub/StubFragmentVM.java @@ -3,6 +3,7 @@ package com.twine.tango.stubs.ui.views.stub; import com.elvishew.xlog.XLog; import com.squareup.otto.Bus; import com.squareup.otto.Subscribe; +import com.twine.tango.integration.operators.IMachineOperator; import com.twine.tango.sharedui.mvvm.RelayCommand; import com.twine.tango.sharedui.notifications.INotificationProvider; import com.twine.tango.stubs.AvailableStub; @@ -24,21 +25,21 @@ public class StubFragmentVM extends ViewModelBase { private Bus eventBus; private INotificationProvider notificationProvider; - private ITransporter transporter; + private IMachineOperator machineOperator; public DependencyProperty availableStub; public DependencyProperty stub; public DependencyProperty response; public RelayCommand runCommand; @Inject - public StubFragmentVM(Bus eventBus, INotificationProvider notificationProvider, ITransporter transporter) + public StubFragmentVM(Bus eventBus, INotificationProvider notificationProvider, IMachineOperator machineOperator) { availableStub = new DependencyProperty<>(); stub = new DependencyProperty<>(); response = new DependencyProperty<>(""); this.eventBus = eventBus; - this.transporter = transporter; + this.machineOperator = machineOperator; this.notificationProvider = notificationProvider; this.eventBus.register(this); @@ -49,7 +50,7 @@ public class StubFragmentVM extends ViewModelBase public void handleStubSelectedEvent(StubSelectedEvent e) { availableStub.set(e.getStub()); - stub.set(availableStub.get().createInstance(transporter)); + stub.set(availableStub.get().createInstance(machineOperator)); } private void runSelectedStub() diff --git a/Software/Android_Studio/Tango.Stubs/src/main/java/com/twine/tango/stubs/stubs/Calculate.java b/Software/Android_Studio/Tango.Stubs/src/main/java/com/twine/tango/stubs/stubs/Calculate.java index 68c697b67..1e0d6f199 100644 --- a/Software/Android_Studio/Tango.Stubs/src/main/java/com/twine/tango/stubs/stubs/Calculate.java +++ b/Software/Android_Studio/Tango.Stubs/src/main/java/com/twine/tango/stubs/stubs/Calculate.java @@ -56,7 +56,7 @@ public class Calculate extends StubBase MessageFactory.createTangoMessage( CalculateRequest.class, CalculateRequest.newBuilder().setA(num1).setB(num2).build())).subscribe((response) -> - subject.onNext(String.valueOf(response.getSum())), subject::onError); + subject.onNext(String.valueOf(response.getMessage().getSum())), subject::onError); return subject; } diff --git a/Software/Android_Studio/Tango.Stubs/src/main/java/com/twine/tango/stubs/stubs/Progress.java b/Software/Android_Studio/Tango.Stubs/src/main/java/com/twine/tango/stubs/stubs/Progress.java index 0b4d656f9..e1838a34f 100644 --- a/Software/Android_Studio/Tango.Stubs/src/main/java/com/twine/tango/stubs/stubs/Progress.java +++ b/Software/Android_Studio/Tango.Stubs/src/main/java/com/twine/tango/stubs/stubs/Progress.java @@ -51,7 +51,7 @@ public class Progress extends StubBase MessageFactory.createTangoMessage( ProgressRequest.class, ProgressRequest.newBuilder().setAmount(amount.get().intValue()).setDelay(delay.get().intValue()).build())).subscribe((response) -> - subject.onNext(String.valueOf(response.getProgress()))); + subject.onNext(String.valueOf(response.getMessage().getProgress()))); return subject; } diff --git a/Software/Android_Studio/Tango.Synchronization/build.gradle b/Software/Android_Studio/Tango.Synchronization/build.gradle index 7134933aa..a8a33e319 100644 --- a/Software/Android_Studio/Tango.Synchronization/build.gradle +++ b/Software/Android_Studio/Tango.Synchronization/build.gradle @@ -43,7 +43,7 @@ dependencies { compile globalDependencies.daggerAndroid implementation project(':Tango.DAL') implementation project(':Tango.Integration') - compile globalDependencies.rxJava compile globalDependencies.rxJavaAndroid + implementation project(':Tango.Transport') } diff --git a/Software/Android_Studio/Tango.Transport/src/main/java/com/twine/tango/transport/ITransportAdapter.java b/Software/Android_Studio/Tango.Transport/src/main/java/com/twine/tango/transport/ITransportAdapter.java index 083ab60fd..abd12e0f0 100644 --- a/Software/Android_Studio/Tango.Transport/src/main/java/com/twine/tango/transport/ITransportAdapter.java +++ b/Software/Android_Studio/Tango.Transport/src/main/java/com/twine/tango/transport/ITransportAdapter.java @@ -9,33 +9,49 @@ import java.io.IOException; * Represents a transport adapter capable of connecting, writing and receiving data from a serial stream. */ public interface ITransportAdapter extends ITransportComponent { - + /** * Writes the specified data to the stream. * * @param data the data + * @throws ObjectDisposedException the object disposed exception + * @throws IOException the io exception */ void write(byte[] data) throws ObjectDisposedException, IOException; - + /** * Add data available listener. * * @param handler event handler */ void setDataAvailableListener(IEventHandler handler); - + /** * Gets the adapter address. * * @return the address */ String getAddress(); - + /** * Sets the adapter address. * * @param address the address */ void setAddress(String address); - + + + /** + * Gets whether this adapter is authenticated. + * + * @return the authenticated + */ + boolean isAuthenticated(); + + /** + * Sets whether this adapter is authenticated. + * + * @param authenticated the authenticated + */ + void setAuthenticated(boolean authenticated); } diff --git a/Software/Android_Studio/Tango.Transport/src/main/java/com/twine/tango/transport/ITransporter.java b/Software/Android_Studio/Tango.Transport/src/main/java/com/twine/tango/transport/ITransporter.java index ae5f6b5dc..9d2bce329 100644 --- a/Software/Android_Studio/Tango.Transport/src/main/java/com/twine/tango/transport/ITransporter.java +++ b/Software/Android_Studio/Tango.Transport/src/main/java/com/twine/tango/transport/ITransporter.java @@ -32,7 +32,7 @@ public interface ITransporter extends ITransportComponent { * @param request the request * @return the single */ - Single sendRequest(TangoMessage request); + Single> sendRequest(TangoMessage request); /** * Sends a request on the specified adapter. @@ -43,7 +43,7 @@ public interface ITransporter extends ITransportComponent { * @param adapter the adapter * @return the single */ - Single sendRequest(TangoMessage request,ITransportAdapter adapter); + Single> sendRequest(TangoMessage request,ITransportAdapter adapter); /** * Sends a continuous request on all adapters. @@ -53,7 +53,7 @@ public interface ITransporter extends ITransportComponent { * @param request the request * @return the observable */ - Observable sendContinuousRequest(TangoMessage request); + Observable> sendContinuousRequest(TangoMessage request); /** * Sends a continuous request on the specified adapter. @@ -64,7 +64,7 @@ public interface ITransporter extends ITransportComponent { * @param adapter the adapter * @return the observable */ - Observable sendContinuousRequest(TangoMessage request, ITransportAdapter adapter); + Observable> sendContinuousRequest(TangoMessage request, ITransportAdapter adapter); /** * Sends a response. diff --git a/Software/Android_Studio/Tango.Transport/src/main/java/com/twine/tango/transport/TransportAdapterBase.java b/Software/Android_Studio/Tango.Transport/src/main/java/com/twine/tango/transport/TransportAdapterBase.java index d5301296b..b9221ea27 100644 --- a/Software/Android_Studio/Tango.Transport/src/main/java/com/twine/tango/transport/TransportAdapterBase.java +++ b/Software/Android_Studio/Tango.Transport/src/main/java/com/twine/tango/transport/TransportAdapterBase.java @@ -13,8 +13,10 @@ import io.reactivex.Completable; /** * Represents an {@link ITransportAdapter} base class. */ -public abstract class TransportAdapterBase implements ITransportAdapter { - +public abstract class TransportAdapterBase implements ITransportAdapter +{ + + private boolean isAuthenticated; private String address; private Event stateChangedEvent; private IEventHandler dataAvailableListener; @@ -26,31 +28,48 @@ public abstract class TransportAdapterBase implements ITransportAdapter { public TransportAdapterBase() { stateChangedEvent = new Event<>(); + setAuthenticated(true); } public abstract void write(byte[] data) throws ObjectDisposedException, IOException; - + public abstract Completable connect(); - + public abstract Completable disconnect(); - + @Override - public void setDataAvailableListener(IEventHandler handler) { + public void setDataAvailableListener(IEventHandler handler) + { dataAvailableListener = handler; } - + @Override - public String getAddress() { + public String getAddress() + { return this.address; } - + @Override - public void setAddress(String address) { + public void setAddress(String address) + { this.address = address; } - + @Override - public void addStateChangedListener(IEventHandler listener) { + public boolean isAuthenticated() + { + return isAuthenticated; + } + + @Override + public void setAuthenticated(boolean authenticated) + { + isAuthenticated = authenticated; + } + + @Override + public void addStateChangedListener(IEventHandler listener) + { stateChangedEvent.addListener(listener); } @@ -61,7 +80,8 @@ public abstract class TransportAdapterBase implements ITransportAdapter { } @Override - public TransportComponentState getState() { + public TransportComponentState getState() + { return state; } @@ -70,19 +90,24 @@ public abstract class TransportAdapterBase implements ITransportAdapter { * * @param state the state */ - protected void setState(TransportComponentState state) { + protected void setState(TransportComponentState state) + { this.state = state; - if (stateChangedEvent != null) { - try { + if (stateChangedEvent != null) + { + try + { stateChangedEvent.invoke(this, this.state); - } catch (Exception e) { + } catch (Exception e) + { e.printStackTrace(); } } } - + @Override - public void dispose() { + public void dispose() + { disconnect().blockingAwait(); setState(TransportComponentState.Disposed); } @@ -92,8 +117,10 @@ public abstract class TransportAdapterBase implements ITransportAdapter { * * @throws ObjectDisposedException the object disposed exception */ - protected void throwIfDisposed() throws ObjectDisposedException { - if (state == TransportComponentState.Disposed) { + protected void throwIfDisposed() throws ObjectDisposedException + { + if (state == TransportComponentState.Disposed) + { throw new ObjectDisposedException("The adapter is in a " + state + " state."); } } @@ -103,11 +130,15 @@ public abstract class TransportAdapterBase implements ITransportAdapter { * * @param data the data */ - protected void onDataAvailable(byte[] data) { - if (dataAvailableListener != null) { - try { + protected void onDataAvailable(byte[] data) + { + if (dataAvailableListener != null) + { + try + { dataAvailableListener.invoke(this, data); - } catch (Exception e) { + } catch (Exception e) + { e.printStackTrace(); } } @@ -118,7 +149,8 @@ public abstract class TransportAdapterBase implements ITransportAdapter { * * @param ex the ex */ - protected void onFailed(Exception ex) { + protected void onFailed(Exception ex) + { disconnect().blockingAwait(); setState(TransportComponentState.Failed); XLog.e(ex); diff --git a/Software/Android_Studio/Tango.Transport/src/main/java/com/twine/tango/transport/TransporterBase.java b/Software/Android_Studio/Tango.Transport/src/main/java/com/twine/tango/transport/TransporterBase.java index ca7f6ed92..51c4eedf8 100644 --- a/Software/Android_Studio/Tango.Transport/src/main/java/com/twine/tango/transport/TransporterBase.java +++ b/Software/Android_Studio/Tango.Transport/src/main/java/com/twine/tango/transport/TransporterBase.java @@ -240,6 +240,13 @@ public abstract class TransporterBase implements ITransporter return MessageFactory.parseMessageFromContainerAgnostic(container); } + protected TangoMessage onParseTangoMessage(byte[] data) throws InvalidProtocolBufferException, NoSuchMethodException, IllegalAccessException, InvocationTargetException + { + MessageContainer container = onParseContainer(data); + GeneratedMessageV3 message = onParseMessage(container); + return MessageFactory.createTangoMessage(container,message); + } + //endregion //region Constructors @@ -336,9 +343,9 @@ public abstract class TransporterBase implements ITransporter { adapter.disconnect().blockingAwait(); } - + setState(TransportComponentState.Disconnected); - + XLog.i("Transporter disconnected..."); x.onComplete(); @@ -351,19 +358,19 @@ public abstract class TransporterBase implements ITransporter } @Override - public Single sendRequest(TangoMessage request) + public Single> sendRequest(TangoMessage request) { return sendRequest(request, null); } @Override - public Single sendRequest(TangoMessage request, ITransportAdapter adapter) + public Single> sendRequest(TangoMessage request, ITransportAdapter adapter) { XLog.i("Queuing request message: " + request.getClass().getSimpleName() + " Token: " + request.getContainer().getToken() + " on adapter: " + (adapter != null ? adapter.getAddress() : "ALL")); XLog.i("Expected response: " + Response.Builder.class.getSimpleName()); - PublishSubject subject = PublishSubject.create(); - TransportMessage message = new TransportMessage<>(adapter, request.getContainer().getToken(), request, TransportMessageDirection.Request, onSerializingMessage(request), subject); + PublishSubject> subject = PublishSubject.create(); + TransportMessage> message = new TransportMessage<>(adapter, request.getContainer().getToken(), request, TransportMessageDirection.Request, onSerializingMessage(request), subject); sendingQueue.add(message); Completable.timer(getRequestTimeout().getSeconds(), TimeUnit.SECONDS) @@ -382,13 +389,13 @@ public abstract class TransporterBase implements ITransporter } @Override - public Observable sendContinuousRequest(TangoMessage request) + public Observable> sendContinuousRequest(TangoMessage request) { return sendContinuousRequest(request, null); } @Override - public Observable sendContinuousRequest(TangoMessage request, ITransportAdapter adapter) + public Observable> sendContinuousRequest(TangoMessage request, ITransportAdapter adapter) { XLog.i("Queuing continuous response request message: " + request.getClass().getSimpleName() + " Token: " + request.getContainer().getToken() + " on adapter: " + (adapter != null ? adapter.getAddress() : "ALL")); XLog.i("Expected response: " + Response.Builder.class.getSimpleName()); @@ -396,8 +403,8 @@ public abstract class TransporterBase implements ITransporter request.getContainer().setContinuous(true); request.getContainer().setCompleted(false); - PublishSubject subject = PublishSubject.create(); - TransportMessage message = new TransportMessage<>(adapter, request.getContainer().getToken(), request, TransportMessageDirection.Request, onSerializingMessage(request), subject); + PublishSubject> subject = PublishSubject.create(); + TransportMessage> message = new TransportMessage<>(adapter, request.getContainer().getToken(), request, TransportMessageDirection.Request, onSerializingMessage(request), subject); message.setContinuous(true); sendingQueue.add(message); @@ -473,8 +480,10 @@ public abstract class TransporterBase implements ITransporter * * @throws ObjectDisposedException the object disposed exception */ - protected void throwIfDisposed() throws ObjectDisposedException { - if (state == TransportComponentState.Disposed) { + protected void throwIfDisposed() throws ObjectDisposedException + { + if (state == TransportComponentState.Disposed) + { throw new ObjectDisposedException("The transporter is in a " + state + " state."); } } @@ -568,13 +577,24 @@ public abstract class TransporterBase implements ITransporter { XLog.i("Message received on adapter: " + data.first.getAddress()); XLog.i("Parsing message container..."); - MessageContainer container = onParseContainer(data.second); + + MessageContainer container; + + try + { + container = onParseContainer(data.second); + } catch (Exception e) + { + XLog.e("Invalid message container received!", e); + continue; + } + XLog.i("Searching for pending request token: " + container.getToken()); TransportMessageBase request = stream(pendingRequests).singleOrDefault(x -> x.getToken().equals(container.getToken()), null); if (request != null) { - XLog.i("Found pending request: " + request.getMessage().getClass().getSimpleName()); + XLog.i("Found pending request: " + ((TangoMessage)request.getMessage()).getContainer().getType()); if (!request.isContinuous()) { @@ -585,7 +605,7 @@ public abstract class TransporterBase implements ITransporter try { XLog.i("Parsing inner response message and setting pending request task result..."); - request.setResult(onParseMessage(container), true); + request.setResult(onParseTangoMessage(data.second), true); } catch (Exception ex) { XLog.e("Error parsing inner message", ex); @@ -602,7 +622,7 @@ public abstract class TransporterBase implements ITransporter { XLog.i("Continuous sequence completed."); } - request.setResult(onParseMessage(container), container.getCompleted()); + request.setResult(onParseTangoMessage(data.second), container.getCompleted()); } catch (Exception ex) { XLog.e("Error parsing inner message", ex); diff --git a/Software/Android_Studio/Tango.UnitTesting/build.gradle b/Software/Android_Studio/Tango.UnitTesting/build.gradle index 3b9a730c8..3f58e3803 100644 --- a/Software/Android_Studio/Tango.UnitTesting/build.gradle +++ b/Software/Android_Studio/Tango.UnitTesting/build.gradle @@ -42,7 +42,6 @@ dependencies { implementation project(':Tango.Integration') implementation project(':Tango.SharedUI') implementation project(':Tango.Stubs') - implementation project(':Tango.Synchronization') implementation project(':Tango.Transport') implementation project(':Tango.Web') implementation project(':Tango.NativeBridge') diff --git a/Software/Android_Studio/Tango.UnitTesting/src/androidTest/java/com/twine/tango/unittesting/Synchronization_TST.java b/Software/Android_Studio/Tango.UnitTesting/src/androidTest/java/com/twine/tango/unittesting/Synchronization_TST.java index b162c2215..4713fb6cc 100644 --- a/Software/Android_Studio/Tango.UnitTesting/src/androidTest/java/com/twine/tango/unittesting/Synchronization_TST.java +++ b/Software/Android_Studio/Tango.UnitTesting/src/androidTest/java/com/twine/tango/unittesting/Synchronization_TST.java @@ -5,13 +5,11 @@ import android.support.test.InstrumentationRegistry; import android.support.test.runner.AndroidJUnit4; import com.elvishew.xlog.XLog; -import com.twine.tango.dal.TangoDB; import com.twine.tango.dal.dao.TangoDAO; import com.twine.tango.dal.entities.Organization; -import com.twine.tango.integration.MachineIdentityProvider; -import com.twine.tango.synchronization.ITangoSynchronizer; -import com.twine.tango.synchronization.TangoSynchronizer; -import com.twine.tango.web.WebApiFactory; +import com.twine.tango.integration.providers.MachineIdentityProvider; +import com.twine.tango.integration.services.ISynchronizationService; +import com.twine.tango.integration.services.SynchronizationService; import org.junit.Test; import org.junit.runner.RunWith; @@ -38,7 +36,7 @@ public class Synchronization_TST XLog.i(org.getName()); } - ITangoSynchronizer synchronizer = new TangoSynchronizer(new MachineIdentityProvider()); + ISynchronizationService synchronizer = new SynchronizationService(new MachineIdentityProvider()); synchronizer.synchronizeDB().subscribe(() -> { diff --git a/Software/Android_Studio/settings.gradle b/Software/Android_Studio/settings.gradle index 7a7daf836..15bb94e3b 100644 --- a/Software/Android_Studio/settings.gradle +++ b/Software/Android_Studio/settings.gradle @@ -1 +1 @@ -include ':Tango.BL', ':Tango.Stubs.UI', ':Tango.SharedUI', ':Tango.Models', ':Tango.Stubs', ':Tango.Integration', ':Tango.Transport', ':Tango.Core', ':Tango.PMR', ':Tango.DAL', ':Tango.Web', ':Tango.Synchronization', ':Tango.UnitTesting', ':Tango.NativeBridge' +include ':Tango.Stubs.UI', ':Tango.SharedUI', ':Tango.Models', ':Tango.Stubs', ':Tango.Integration', ':Tango.Transport', ':Tango.Core', ':Tango.PMR', ':Tango.DAL', ':Tango.Web', ':Tango.UnitTesting', ':Tango.NativeBridge' diff --git a/Software/DB/Tango.mdf b/Software/DB/Tango.mdf index 2123553a2..e1171e9f0 100644 Binary files a/Software/DB/Tango.mdf and b/Software/DB/Tango.mdf differ diff --git a/Software/DB/Tango_log.ldf b/Software/DB/Tango_log.ldf index 74ecadd2d..61c3049d0 100644 Binary files a/Software/DB/Tango_log.ldf and b/Software/DB/Tango_log.ldf differ diff --git a/Software/PMR/Messages/Common/MessageType.proto b/Software/PMR/Messages/Common/MessageType.proto index 8a593b394..e77095809 100644 --- a/Software/PMR/Messages/Common/MessageType.proto +++ b/Software/PMR/Messages/Common/MessageType.proto @@ -38,4 +38,7 @@ enum MessageType StubSteperMotorResponse = 30; StubValveRequest = 31; StubValveResponse = 32; + ExternalBridgeUdpDiscoveryPacket = 33; + ExternalClientLoginRequest = 34; + ExternalClientLoginResponse = 35; } diff --git a/Software/PMR/Messages/Integration/ExternalBridgeUdpDiscoveryPacket.proto b/Software/PMR/Messages/Integration/ExternalBridgeUdpDiscoveryPacket.proto new file mode 100644 index 000000000..33c565bae --- /dev/null +++ b/Software/PMR/Messages/Integration/ExternalBridgeUdpDiscoveryPacket.proto @@ -0,0 +1,9 @@ +syntax = "proto3"; + +package Tango.PMR.Integration; +option java_package = "com.twine.tango.pmr.integration"; + +message ExternalBridgeUdpDiscoveryPacket +{ + string SerialNumber = 2; +} \ No newline at end of file diff --git a/Software/PMR/Messages/Integration/ExternalClientLoginRequest.proto b/Software/PMR/Messages/Integration/ExternalClientLoginRequest.proto new file mode 100644 index 000000000..3c7d701b5 --- /dev/null +++ b/Software/PMR/Messages/Integration/ExternalClientLoginRequest.proto @@ -0,0 +1,9 @@ +syntax = "proto3"; + +package Tango.PMR.Integration; +option java_package = "com.twine.tango.pmr.integration"; + +message ExternalClientLoginRequest +{ + string key = 1; +} \ No newline at end of file diff --git a/Software/PMR/Messages/Integration/ExternalClientLoginResponse.proto b/Software/PMR/Messages/Integration/ExternalClientLoginResponse.proto new file mode 100644 index 000000000..7d0ef89b5 --- /dev/null +++ b/Software/PMR/Messages/Integration/ExternalClientLoginResponse.proto @@ -0,0 +1,10 @@ +syntax = "proto3"; + +package Tango.PMR.Integration; +option java_package = "com.twine.tango.pmr.integration"; + +message ExternalClientLoginResponse +{ + bool Authenticated = 1; + string SerialNumber = 2; +} \ No newline at end of file diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ExtensionMethods/INotificationProviderExtensions.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ExtensionMethods/INotificationProviderExtensions.cs deleted file mode 100644 index 8d95bb38e..000000000 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ExtensionMethods/INotificationProviderExtensions.cs +++ /dev/null @@ -1,30 +0,0 @@ -using MaterialDesignThemes.Wpf; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows; -using Tango.DAL.Observables; -using Tango.MachineStudio.Common.Notifications; -using Tango.MachineStudio.DB.ViewModels; -using Tango.MachineStudio.DB.Views.DBViews; -using Tango.MachineStudio.DB.Windows; - -namespace Tango.MachineStudio.DB.ExtensionMethods -{ - public static class INotificationProviderExtensions - { - public static bool ShowDialog(this INotificationProvider provider, DialogOpenMode mode, DbTableViewModel context) where T : class, IObservableEntity - { - Type viewType = typeof(INotificationProviderExtensions).Assembly.GetType(typeof(OrganizationView).Namespace + "." + typeof(T).Name + "View"); - - DBDialogWindow window = new DBDialogWindow(Activator.CreateInstance(viewType) as FrameworkElement); - window.IconKind = (mode == DialogOpenMode.Editing ? PackIconKind.TableEdit : PackIconKind.Plus); - window.InnerTitle = (mode == DialogOpenMode.Editing ? "Edit " : "Add New ") + typeof(T).Name; - window.DataContext = context; - - return provider.ShowModalWindow(window).Value; - } - } -} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Tango.MachineStudio.DB.csproj b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Tango.MachineStudio.DB.csproj index b77d0daf9..bd6166b4f 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Tango.MachineStudio.DB.csproj +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Tango.MachineStudio.DB.csproj @@ -90,7 +90,6 @@ - diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/DbTableViewModel.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/DbTableViewModel.cs index 89759309b..e472e312a 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/DbTableViewModel.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/DbTableViewModel.cs @@ -8,7 +8,6 @@ using Tango.DAL.Observables; using Tango.MachineStudio.Common.Notifications; using Tango.MachineStudio.DB.Managers; using Tango.SharedUI; -using Tango.MachineStudio.DB.ExtensionMethods; using System.Data.Entity.Infrastructure; using GalaSoft.MvvmLight.Messaging; using Tango.MachineStudio.DB.Messages; diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/Images/machine-trans.png b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/Images/machine-trans.png new file mode 100644 index 000000000..a7cf65852 Binary files /dev/null and b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/Images/machine-trans.png differ diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/Navigation/NavigationView.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/Navigation/NavigationView.cs index 8d38acb7c..d4212475c 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/Navigation/NavigationView.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/Navigation/NavigationView.cs @@ -11,5 +11,6 @@ namespace Tango.MachineStudio.Synchronization.Navigation MenuView, LocalSynchronizationView, RemoteSynchronizationView, + DirectSynchronizationView, } } diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/Tango.MachineStudio.Synchronization.csproj b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/Tango.MachineStudio.Synchronization.csproj index 12323ff91..19eecc2e1 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/Tango.MachineStudio.Synchronization.csproj +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/Tango.MachineStudio.Synchronization.csproj @@ -87,10 +87,14 @@ + + + DirectSynchronizationView.xaml + RemoteSynchronizationView.xaml @@ -107,6 +111,10 @@ GlobalVersionInfo.cs + + Designer + MSBuild:Compile + MSBuild:Compile Designer @@ -170,6 +178,10 @@ {38197109-8610-4d3f-92b9-16d48df94d7c} Tango.DAL.Remote + + {4206ac58-3b57-4699-8835-90bf6db01a61} + Tango.Integration + {bc932dbd-7cdb-488c-99e4-f02cf441f55e} Tango.Logging @@ -205,5 +217,8 @@ + + + \ No newline at end of file diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/ViewModelLocator.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/ViewModelLocator.cs index a58ffe64b..090a323a2 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/ViewModelLocator.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/ViewModelLocator.cs @@ -22,6 +22,7 @@ namespace Tango.MachineStudio.Synchronization SimpleIoc.Default.Register(); SimpleIoc.Default.Register(); SimpleIoc.Default.Register(); + SimpleIoc.Default.Register(); SimpleIoc.Default.Unregister(); @@ -59,5 +60,13 @@ namespace Tango.MachineStudio.Synchronization return ServiceLocator.Current.GetInstance(); } } + + public static DirectSynchronizationViewVM DirectSynchronizationViewVM + { + get + { + return ServiceLocator.Current.GetInstance(); + } + } } } \ No newline at end of file diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/ViewModels/DirectSynchronizationViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/ViewModels/DirectSynchronizationViewVM.cs new file mode 100644 index 000000000..ba3521009 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/ViewModels/DirectSynchronizationViewVM.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.Integration.Services; +using Tango.SharedUI; + +namespace Tango.MachineStudio.Synchronization.ViewModels +{ + public class DirectSynchronizationViewVM : ViewModel + { + public ExternalBridgeScanner Scanner { get; set; } + + public DirectSynchronizationViewVM(ExternalBridgeScanner scanner) + { + Scanner = scanner; + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/ViewModels/MenuViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/ViewModels/MenuViewVM.cs index 8eb68a383..0fe510f36 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/ViewModels/MenuViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/ViewModels/MenuViewVM.cs @@ -19,10 +19,13 @@ namespace Tango.MachineStudio.Synchronization.ViewModels StartLocalSyncCommand = new RelayCommand(() => { _navigation.NavigateTo(NavigationView.LocalSynchronizationView); }); StartRemoteSyncCommand = new RelayCommand(() => { _navigation.NavigateTo(NavigationView.RemoteSynchronizationView); }); + StartDirectRemoteSyncCommand = new RelayCommand(() => { _navigation.NavigateTo(NavigationView.DirectSynchronizationView); }); } public RelayCommand StartLocalSyncCommand { get; set; } public RelayCommand StartRemoteSyncCommand { get; set; } + + public RelayCommand StartDirectRemoteSyncCommand { get; set; } } } diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/Views/DirectSynchronizationView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/Views/DirectSynchronizationView.xaml new file mode 100644 index 000000000..7dc0cdacc --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/Views/DirectSynchronizationView.xaml @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/Views/DirectSynchronizationView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/Views/DirectSynchronizationView.xaml.cs new file mode 100644 index 000000000..5a7c12646 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/Views/DirectSynchronizationView.xaml.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; + +namespace Tango.MachineStudio.Synchronization.Views +{ + /// + /// Interaction logic for DirectSynchronizationView.xaml + /// + public partial class DirectSynchronizationView : UserControl + { + public DirectSynchronizationView() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/Views/MainView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/Views/MainView.xaml index bac530777..664dac229 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/Views/MainView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/Views/MainView.xaml @@ -28,6 +28,9 @@ + + + diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/Views/MenuView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/Views/MenuView.xaml index 6210ca94c..67501743b 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/Views/MenuView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/Views/MenuView.xaml @@ -10,17 +10,34 @@ d:DesignHeight="720" d:DesignWidth="1280" DataContext="{x:Static global:ViewModelLocator.MenuViewVM}"> - - - - - + + + + + Local Synchronization + Synchronize two SQLite local database files. + + + + + + + + + + + + + + + + - Remote Synchronization - Synchronize local SQLite database file with the remote Twine database. + Direct Remote Synchronization + Connect and synchronized a Tango machine over the network. @@ -28,42 +45,39 @@ - + - + - + - Local Synchronization - Synchronize two SQLite local database files. + Semi Remote Synchronization + Synchronize local SQLite database file with the remote Twine database. - - - - - - - + + + - + - + + diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Notifications/DialogViewVM.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Notifications/DialogViewVM.cs new file mode 100644 index 000000000..e5e4cac78 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Notifications/DialogViewVM.cs @@ -0,0 +1,47 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.Core.Commands; +using Tango.SharedUI; + +namespace Tango.MachineStudio.Common.Notifications +{ + public abstract class DialogViewVM : ViewModel + { + public event Action Accepted; + public event Action Canceled; + + public DialogViewVM() + { + CanClose = true; + CloseCommand = new RelayCommand(Cancel, (x) => CanClose); + } + + private bool _canClose; + + public bool CanClose + { + get { return _canClose; } + set { _canClose = value; RaisePropertyChangedAuto(); InvalidateRelayCommands(); } + } + + public RelayCommand CloseCommand { get; set; } + + public virtual void OnShow() + { + + } + + protected virtual void Accept() + { + Accepted?.Invoke(); + } + + protected virtual void Cancel() + { + Canceled?.Invoke(); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Notifications/INotificationProvider.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Notifications/INotificationProvider.cs index a45f9a847..937a39ec2 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Notifications/INotificationProvider.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Notifications/INotificationProvider.cs @@ -24,11 +24,11 @@ namespace Tango.MachineStudio.Common.Notifications void PopTaskItem(TaskItem taskItem); - bool? ShowModalWindow(Window window); + void ShowModalDialog(Action onAccept, Action onCancel) where View : FrameworkElement where VM : DialogViewVM; - bool ShowModalWindow(PackIconKind icon, String title, object context) where T : FrameworkElement; + void ShowModalDialog(Action onAccept, Action onCancel) where VM : DialogViewVM; - bool ShowModalWindow(PackIconKind icon, String title, FrameworkElement content, object context); + void ShowModalDialog(Action onAccept) where VM : DialogViewVM; bool? ShowDialog(PackIconKind icon, Brush iconColor, String message, bool hasCancel); diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/StudioApplication/IStudioApplicationManager.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/StudioApplication/IStudioApplicationManager.cs index 740c257b9..3297f9374 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/StudioApplication/IStudioApplicationManager.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/StudioApplication/IStudioApplicationManager.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; +using Tango.Integration.Services; namespace Tango.MachineStudio.Common.StudioApplication { @@ -10,5 +11,7 @@ namespace Tango.MachineStudio.Common.StudioApplication { bool IsShuttingDown { get;} void ShutDown(); + IExternalBridgeClient ConnectedMachine { get; set; } + bool IsMachineConnected { get; } } } diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Tango.MachineStudio.Common.csproj b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Tango.MachineStudio.Common.csproj index 32466e45a..5cf171090 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Tango.MachineStudio.Common.csproj +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Tango.MachineStudio.Common.csproj @@ -71,6 +71,7 @@ + @@ -142,6 +143,10 @@ {38197109-8610-4d3f-92b9-16d48df94d7c} Tango.DAL.Remote + + {4206ac58-3b57-4699-8835-90bf6db01a61} + Tango.Integration + {8491d07b-c1f6-4b62-a412-41b9fd2d6538} Tango.SharedUI diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/App.config b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/App.config index b31d56717..692b77528 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/App.config +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/App.config @@ -21,4 +21,12 @@ + + + + + + + + \ No newline at end of file diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/MainWindow.xaml.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/MainWindow.xaml.cs index 9193cfd3e..dfbc0eb77 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/MainWindow.xaml.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/MainWindow.xaml.cs @@ -14,6 +14,7 @@ using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Navigation; using System.Windows.Shapes; +using Tango.Core.Helpers; using Tango.MachineStudio.Common.StudioApplication; namespace Tango.MachineStudio.UI @@ -29,6 +30,7 @@ namespace Tango.MachineStudio.UI { InitializeComponent(); Instance = this; + ThreadsHelper.SetDisptacher(Dispatcher); this.Closing += MainWindow_Closing; } diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Notifications/DefaultNotificationProvider.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Notifications/DefaultNotificationProvider.cs index b1ba03109..3c245510b 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Notifications/DefaultNotificationProvider.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Notifications/DefaultNotificationProvider.cs @@ -35,32 +35,6 @@ namespace Tango.MachineStudio.UI.Notifications TaskItems = new ObservableCollection(); } - public bool ShowModalWindow(PackIconKind icon, string title, object context) where T : FrameworkElement - { - return ShowModalWindow(icon, title, Activator.CreateInstance(), context); - } - - public bool? ShowModalWindow(Window window) - { - window.Owner = Application.Current.MainWindow; - MainWindow.Instance.shadowGrid.Visibility = Visibility.Visible; - bool result = window.ShowDialog().Value; - MainWindow.Instance.shadowGrid.Visibility = Visibility.Hidden; - return result; - } - - public bool ShowModalWindow(PackIconKind icon, string title, FrameworkElement content, object context) - { - DialogWindow dialog = new DialogWindow(content); - dialog.DataContext = context; - dialog.InnerTitle = title; - dialog.Owner = Application.Current.MainWindow; - MainWindow.Instance.shadowGrid.Visibility = Visibility.Visible; - bool result = dialog.ShowDialog().Value; - MainWindow.Instance.shadowGrid.Visibility = Visibility.Hidden; - return result; - } - public bool? ShowDialog(PackIconKind icon, Brush iconColor, string message, bool hasCancel) { MainWindow.Instance.shadowGrid.Visibility = Visibility.Visible; @@ -79,6 +53,98 @@ namespace Tango.MachineStudio.UI.Notifications return result; } + public void ShowModalDialog(Action onAccept, Action onCancel) where View : FrameworkElement where VM : DialogViewVM + { + var view = Activator.CreateInstance(); + DialogWindow dialog = new DialogWindow(); + dialog.Owner = Application.Current.MainWindow; + dialog.InnerContent = view; + MainWindow.Instance.shadowGrid.Visibility = Visibility.Visible; + view.Loaded += (x, y) => + { + VM context = view.DataContext as VM; + dialog.DataContext = context; + + Action onAcceptAction = null; + onAcceptAction = new Action(() => + { + dialog.Close(); + onAccept(context); + context.Accepted -= onAcceptAction; + }); + + Action onCancelAction = null; + onCancelAction = new Action(() => + { + dialog.Close(); + + if (onCancel != null) + { + onCancel(); + } + + context.Canceled -= onCancelAction; + }); + + context.Accepted += onAcceptAction; + context.Canceled += onCancelAction; + + context.OnShow(); + }; + dialog.ShowDialog(); + MainWindow.Instance.shadowGrid.Visibility = Visibility.Hidden; + } + + public void ShowModalDialog(Action onAccept, Action onCancel) where VM : DialogViewVM + { + String viewName = typeof(VM).Name.Replace("VM", ""); + + var view = Activator.CreateInstance(AppDomain.CurrentDomain.GetAssemblies().SelectMany(x => x.GetTypes()).Single(x => x.Name == viewName)) as FrameworkElement; + DialogWindow dialog = new DialogWindow(); + dialog.Owner = Application.Current.MainWindow; + dialog.InnerContent = view; + MainWindow.Instance.shadowGrid.Visibility = Visibility.Visible; + view.Loaded += (x, y) => + { + VM context = view.DataContext as VM; + dialog.DataContext = context; + + Action onAcceptAction = null; + onAcceptAction = new Action(() => + { + dialog.Close(); + onAccept(context); + context.Accepted -= onAcceptAction; + }); + + Action onCancelAction = null; + onCancelAction = new Action(() => + { + dialog.Close(); + + if (onCancel != null) + { + onCancel(); + } + + context.Canceled -= onCancelAction; + }); + + context.Accepted += onAcceptAction; + context.Canceled += onCancelAction; + + context.OnShow(); + }; + + dialog.ShowDialog(); + MainWindow.Instance.shadowGrid.Visibility = Visibility.Hidden; + } + + public void ShowModalDialog(Action onAccept) where VM : DialogViewVM + { + ShowModalDialog(onAccept, null); + } + public void ShowError(string message) { ShowDialog(PackIconKind.Exclamation, Brushes.Red, message, false); diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Notifications/DialogWindow.xaml b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Notifications/DialogWindow.xaml index 2a8dd9f28..c11e2e11b 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Notifications/DialogWindow.xaml +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Notifications/DialogWindow.xaml @@ -1,4 +1,4 @@ - + Title="Machine Studio" MinHeight="220" SizeToContent="WidthAndHeight" MinWidth="600" AllowsTransparency="True" WindowStyle="None" WindowStartupLocation="CenterOwner" Background="Transparent"> - - - - - - - - - - - + + + + + + + + + + + + + - + diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Notifications/DialogWindow.xaml.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Notifications/DialogWindow.xaml.cs index 31dd3d644..d1bc0564b 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Notifications/DialogWindow.xaml.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Notifications/DialogWindow.xaml.cs @@ -20,51 +20,23 @@ namespace Tango.MachineStudio.UI.Windows /// /// Interaction logic for DialogWindow.xaml /// - public partial class DialogWindow : MetroWindow + public partial class DialogWindow : Window { public DialogWindow() { InitializeComponent(); } - - - public String InnerTitle - { - get { return (String)GetValue(InnerTitleProperty); } - set { SetValue(InnerTitleProperty, value); } - } - public static readonly DependencyProperty InnerTitleProperty = - DependencyProperty.Register("InnerTitle", typeof(String), typeof(DialogWindow), new PropertyMetadata(null)); - - - - public PackIconKind IconKind + public FrameworkElement InnerContent { - get { return (PackIconKind)GetValue(IconKindProperty); } - set { SetValue(IconKindProperty, value); } + get { return (FrameworkElement)GetValue(InnerContentProperty); } + set { SetValue(InnerContentProperty, value); } } - public static readonly DependencyProperty IconKindProperty = - DependencyProperty.Register("IconKind", typeof(PackIconKind), typeof(DialogWindow), new PropertyMetadata(PackIconKind.Information)); - + // Using a DependencyProperty as the backing store for InnerContent. This enables animation, styling, binding, etc... + public static readonly DependencyProperty InnerContentProperty = + DependencyProperty.Register("InnerContent", typeof(FrameworkElement), typeof(DialogWindow), new PropertyMetadata(null)); - public DialogWindow(FrameworkElement content) : this() - { - presenter.Content = content; - } - - private void OnOKClicked(object sender, RoutedEventArgs e) - { - DialogResult = true; - Close(); - } - - private void OnCancelClicked(object sender, RoutedEventArgs e) - { - DialogResult = false; - Close(); - } } } diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/StudioApplication/DefaultStudioApplicationManager.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/StudioApplication/DefaultStudioApplicationManager.cs index ea4234fd8..b0315e633 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/StudioApplication/DefaultStudioApplicationManager.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/StudioApplication/DefaultStudioApplicationManager.cs @@ -11,10 +11,13 @@ using Tango.MachineStudio.Common.Navigation; using GalaSoft.MvvmLight.Ioc; using System.Reflection; using System.Collections; +using Tango.Integration.Services; +using Tango.Core; +using Tango.Logging; namespace Tango.MachineStudio.UI.StudioApplication { - public class DefaultStudioApplicationManager : IStudioApplicationManager + public class DefaultStudioApplicationManager : ExtendedObject, IStudioApplicationManager { private INavigationManager _navigationManager; @@ -25,6 +28,19 @@ namespace Tango.MachineStudio.UI.StudioApplication public bool IsShuttingDown { get; private set; } + private IExternalBridgeClient _connectedMachine; + + public IExternalBridgeClient ConnectedMachine + { + get { return _connectedMachine; } + set { _connectedMachine = value; RaisePropertyChangedAuto(); RaisePropertyChanged(nameof(IsMachineConnected)); } + } + + public bool IsMachineConnected + { + get { return ConnectedMachine != null; } + } + public async void ShutDown() { if (IsShuttingDown) return; @@ -33,6 +49,17 @@ namespace Tango.MachineStudio.UI.StudioApplication await Task.Factory.StartNew(async () => { + try + { + if (ConnectedMachine != null) + { + ConnectedMachine.Disconnect().Wait(); + } + } + catch (Exception ex) + { + LogManager.Log(ex, "Error disconnecting from machine."); + } //Do Shutdown Procedures... foreach (var vm in ServiceLocator.Current.GetAllInstancesByBase()) diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Tango.MachineStudio.UI.csproj b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Tango.MachineStudio.UI.csproj index fa04a1068..3becf0252 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Tango.MachineStudio.UI.csproj +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Tango.MachineStudio.UI.csproj @@ -58,6 +58,9 @@ ..\..\packages\MvvmLightLibs.5.3.0.0\lib\net45\GalaSoft.MvvmLight.Platform.dll + + ..\..\packages\Google.Protobuf.3.4.1\lib\net45\Google.Protobuf.dll + ..\..\packages\MahApps.Metro.1.5.0\lib\net45\MahApps.Metro.dll @@ -110,6 +113,7 @@ + @@ -119,6 +123,9 @@ LoginView.xaml + + MachineConnectionView.xaml + MainView.xaml @@ -159,6 +166,10 @@ Designer MSBuild:Compile + + Designer + MSBuild:Compile + Designer MSBuild:Compile @@ -216,10 +227,18 @@ {38197109-8610-4d3f-92b9-16d48df94d7c} Tango.DAL.Remote + + {4206ac58-3b57-4699-8835-90bf6db01a61} + Tango.Integration + {bc932dbd-7cdb-488c-99e4-f02cf441f55e} Tango.Logging + + {e4927038-348d-4295-aaf4-861c58cb3943} + Tango.PMR + {d8f1ad85-526a-4f50-b6dc-d437af63d8d8} Tango.Settings @@ -228,6 +247,10 @@ {8491d07b-c1f6-4b62-a412-41b9fd2d6538} Tango.SharedUI + + {74e700b0-1156-4126-be40-ee450d3c3026} + Tango.Transport + {94f7acf8-55e1-4a02-b9bc-a818413fdbbf} Tango.MachineStudio.DB diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModelLocator.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModelLocator.cs index f4a7a7502..e40f589af 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModelLocator.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModelLocator.cs @@ -2,6 +2,7 @@ using GalaSoft.MvvmLight; using GalaSoft.MvvmLight.Ioc; using Microsoft.Practices.ServiceLocation; using System; +using Tango.Integration.Services; using Tango.Logging; using Tango.MachineStudio.Common.Authentication; using Tango.MachineStudio.Common.Modules; @@ -48,17 +49,23 @@ namespace Tango.MachineStudio.UI SimpleIoc.Default.Unregister(); SimpleIoc.Default.Unregister(); SimpleIoc.Default.Unregister(); + SimpleIoc.Default.Unregister(); SimpleIoc.Default.Register(); SimpleIoc.Default.Register(); SimpleIoc.Default.Register(); SimpleIoc.Default.Register(); SimpleIoc.Default.Register(); + SimpleIoc.Default.Register(); SimpleIoc.Default.Register(); SimpleIoc.Default.Register(); SimpleIoc.Default.Register(); SimpleIoc.Default.Register(); + SimpleIoc.Default.Register(); + + LogManager.RegisterLogger(new VSOutputLogger()); + LogManager.RegisterLogger(new FileLogger()); //Register View (Supervising Controller Pattern). if (!ViewModelBase.IsInDesignModeStatic) @@ -99,5 +106,13 @@ namespace Tango.MachineStudio.UI return ServiceLocator.Current.GetInstance(); } } + + public MachineConnectionViewVM MachineConnectionViewVM + { + get + { + return ServiceLocator.Current.GetInstance(); + } + } } } \ No newline at end of file diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MachineConnectionViewVM.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MachineConnectionViewVM.cs new file mode 100644 index 000000000..b8b888e86 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MachineConnectionViewVM.cs @@ -0,0 +1,55 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.Core.Commands; +using Tango.Integration.Services; +using Tango.MachineStudio.Common.Notifications; +using Tango.SharedUI; + +namespace Tango.MachineStudio.UI.ViewModels +{ + public class MachineConnectionViewVM : DialogViewVM + { + private ExternalBridgeScanner _scanner; + + public ExternalBridgeScanner Scanner + { + get { return _scanner; } + set { _scanner = value; RaisePropertyChangedAuto(); } + } + + private IExternalBridgeClient _selectedMachine; + + public IExternalBridgeClient SelectedMachine + { + get { return _selectedMachine; } + set { _selectedMachine = value; RaisePropertyChangedAuto(); InvalidateRelayCommands(); } + } + + public RelayCommand ConnectCommand { get; set; } + + public MachineConnectionViewVM(ExternalBridgeScanner scanner) + { + Scanner = scanner; + ConnectCommand = new RelayCommand(Connect,(x) => SelectedMachine != null); + Scanner.Start(); + } + + private void Connect() + { + if (SelectedMachine != null) + { + Accept(); + } + } + + public override void OnShow() + { + base.OnShow(); + + Scanner.AvailableMachines.Clear(); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MainViewVM.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MainViewVM.cs index a12156d60..6c44c8480 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MainViewVM.cs @@ -7,18 +7,24 @@ using System.Reflection; using System.Text; using System.Threading.Tasks; using Tango.Core.Commands; +using Tango.Logging; using Tango.MachineStudio.Common; using Tango.MachineStudio.Common.Authentication; using Tango.MachineStudio.Common.Modules; using Tango.MachineStudio.Common.Notifications; +using Tango.MachineStudio.Common.StudioApplication; using Tango.MachineStudio.UI.SupervisingController; +using Tango.MachineStudio.UI.Views; +using Tango.PMR.Stubs; using Tango.SharedUI; +using Tango.Transport.Adapters; namespace Tango.MachineStudio.UI.ViewModels { public class MainViewVM : ViewModel { private IStudioModule _currentModule; + private bool _isDisconnecting; public IStudioModule CurrentModule { @@ -47,6 +53,10 @@ namespace Tango.MachineStudio.UI.ViewModels public RelayCommand HomeCommand { get; set; } + public RelayCommand ConnectCommand { get; set; } + + public RelayCommand DisconnectCommand { get; set; } + private IAuthenticationProvider _authenticationProvider; public IAuthenticationProvider AuthenticationProvider { @@ -70,20 +80,81 @@ namespace Tango.MachineStudio.UI.ViewModels set { _notificationProvider = value; RaisePropertyChangedAuto(); } } + private IStudioApplicationManager _applicationManager; + + public IStudioApplicationManager ApplicationManager + { + get { return _applicationManager; } + set { _applicationManager = value; RaisePropertyChangedAuto(); } + } + + public MainViewVM( IMainView view, IAuthenticationProvider authenticationProvider, IStudioModuleLoader studioModuleLoader, - INotificationProvider notificationProvider) : base(view) + INotificationProvider notificationProvider, + IStudioApplicationManager applicationManager) : base(view) { AuthenticationProvider = authenticationProvider; StudioModuleLoader = studioModuleLoader; NotificationProvider = notificationProvider; + ApplicationManager = applicationManager; StartModuleCommand = new RelayCommand(StartModule); HomeCommand = new RelayCommand(Home); + ConnectCommand = new RelayCommand(ConnectToMachine); + DisconnectCommand = new RelayCommand(DisconnectFromMachine,(x) => ApplicationManager.IsMachineConnected && !_isDisconnecting); + } + + private async void DisconnectFromMachine() + { + using (_notificationProvider.PushTaskItem("Disconnecting from machine...")) + { + _isDisconnecting = true; + InvalidateRelayCommands(); + await ApplicationManager.ConnectedMachine.Disconnect(); + ApplicationManager.ConnectedMachine = null; + _isDisconnecting = false; + InvalidateRelayCommands(); + } + } + + private void ConnectToMachine() + { + _notificationProvider.ShowModalDialog(async (x) => + { + if (x.SelectedMachine != null) + { + using (NotificationProvider.PushTaskItem("Connecting to machine " + x.SelectedMachine.SerialNumber + "...")) + { + try + { + await x.SelectedMachine.Connect(); + var authenticated = await x.SelectedMachine.Authenticate(); + if (!authenticated) + { + _notificationProvider.ShowError("It seems like you are not authorized to access the selected machine."); + } + else + { + ApplicationManager.ConnectedMachine = x.SelectedMachine; + var response = await x.SelectedMachine.SendRequest(new CalculateRequest() { A = 10, B = 5 }); + _notificationProvider.ShowInfo(response.ToString()); + } + } + catch (Exception ex) + { + LogManager.Log(ex); + _notificationProvider.ShowError(ex.Message); + } + } + } + + InvalidateRelayCommands(); + }); } private void Home() diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MachineConnectionView.xaml b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MachineConnectionView.xaml new file mode 100644 index 000000000..2d172837a --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MachineConnectionView.xaml @@ -0,0 +1,85 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + S/N: + + + IP Address: + + + Organization: + + + + + + + + + + + + + + + + + + diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MachineConnectionView.xaml.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MachineConnectionView.xaml.cs new file mode 100644 index 000000000..58cec1987 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MachineConnectionView.xaml.cs @@ -0,0 +1,34 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; + +namespace Tango.MachineStudio.UI.Views +{ + /// + /// Interaction logic for MachineConnectionView.xaml + /// + public partial class MachineConnectionView : UserControl + { + public MachineConnectionView() + { + InitializeComponent(); + } + + private void OnConnectClicked(object sender, RoutedEventArgs e) + { + Window.GetWindow(this).DialogResult = true; + Window.GetWindow(this).Close(); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MainView.xaml b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MainView.xaml index aad1189b8..fc9db8adc 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MainView.xaml +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MainView.xaml @@ -26,7 +26,7 @@ - + @@ -84,17 +84,49 @@ x:Name="MenuToggleButton"/> - + + + @@ -189,7 +221,7 @@ - + @@ -204,16 +236,16 @@ - + - + - + - + diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MainView.xaml.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MainView.xaml.cs index 520b69741..f52393e1c 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MainView.xaml.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MainView.xaml.cs @@ -1,4 +1,5 @@ -using System; +using Microsoft.Practices.ServiceLocation; +using System; using System.Collections.Generic; using System.Linq; using System.Text; @@ -9,9 +10,12 @@ using System.Windows.Data; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media; +using System.Windows.Media.Animation; using System.Windows.Media.Imaging; using System.Windows.Navigation; using System.Windows.Shapes; +using Tango.MachineStudio.Common.Notifications; +using Tango.MachineStudio.UI.Notifications; using Tango.MachineStudio.UI.SupervisingController; using Tango.SharedUI; using Tango.SharedUI.Controls; diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/packages.config b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/packages.config index 3a7265a72..25ad810bd 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/packages.config +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/packages.config @@ -4,6 +4,7 @@ + diff --git a/Software/Visual_Studio/Tango.Core/Helpers/ThreadsHelper.cs b/Software/Visual_Studio/Tango.Core/Helpers/ThreadsHelper.cs index 5f140d344..bd934747d 100644 --- a/Software/Visual_Studio/Tango.Core/Helpers/ThreadsHelper.cs +++ b/Software/Visual_Studio/Tango.Core/Helpers/ThreadsHelper.cs @@ -3,20 +3,28 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; +using System.Windows; using System.Windows.Threading; namespace Tango.Core.Helpers { public static class ThreadsHelper { + private static Dispatcher _dispatcher; + + public static void SetDisptacher(Dispatcher dispatcher) + { + _dispatcher = dispatcher; + } + public static void InvokeUI(Action action) { - Dispatcher.CurrentDispatcher.BeginInvoke(action); + _dispatcher.BeginInvoke(action); } public static void InvokeUINow(Action action) { - Dispatcher.CurrentDispatcher.Invoke(action); + _dispatcher.Invoke(action); } } } diff --git a/Software/Visual_Studio/Tango.Integration/Properties/AssemblyInfo.cs b/Software/Visual_Studio/Tango.Integration/Properties/AssemblyInfo.cs new file mode 100644 index 000000000..161c5a04e --- /dev/null +++ b/Software/Visual_Studio/Tango.Integration/Properties/AssemblyInfo.cs @@ -0,0 +1,6 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +[assembly: AssemblyTitle("Tango - Logging Library")] +[assembly: ComVisible(false)] \ No newline at end of file diff --git a/Software/Visual_Studio/Tango.Integration/Services/ExternalBridgeClient.cs b/Software/Visual_Studio/Tango.Integration/Services/ExternalBridgeClient.cs new file mode 100644 index 000000000..1cbb6982a --- /dev/null +++ b/Software/Visual_Studio/Tango.Integration/Services/ExternalBridgeClient.cs @@ -0,0 +1,68 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.DAL.Observables; +using Tango.PMR.Integration; +using Tango.Settings; +using Tango.Transport; +using Tango.Transport.Adapters; +using Tango.Transport.Transporters; + +namespace Tango.Integration.Services +{ + public class ExternalBridgeClient : ProtoTransporter, IExternalBridgeClient + { + private String _serialNumber; + + public String SerialNumber + { + get { return _serialNumber; } + internal set + { + _serialNumber = value; + RaisePropertyChangedAuto(); + + var org = ObservablesEntitiesAdapter.Instance.Organizations.SingleOrDefault(x => x.Machines.ToList().Exists(y => y.SerialNumber == SerialNumber)); + Organization = org != null ? org.Name : "Unknown"; + } + } + + private String _ipAddress; + + public String IPAddress + { + get { return _ipAddress; } + set { _ipAddress = value; RaisePropertyChangedAuto(); } + } + + private String _organization; + + public String Organization + { + get { return _organization; } + private set { _organization = value; RaisePropertyChangedAuto(); } + } + + public override async Task Connect() + { + await Disconnect(); + Adapters.Clear(); + Adapters.Add(new TcpTransportAdapter(IPAddress, SettingsManager.Default.Integration.ExternalBridgeServicePort)); + await base.Connect(); + } + + public async Task Authenticate() + { + var response = await SendRequest(new ExternalClientLoginRequest() { Key = "1234" }); + return response.Authenticated; + } + + public ExternalBridgeClient(String serialNumber,String ipAddress) + { + SerialNumber = serialNumber; + IPAddress = ipAddress; + } + } +} diff --git a/Software/Visual_Studio/Tango.Integration/Services/ExternalBridgeScanner.cs b/Software/Visual_Studio/Tango.Integration/Services/ExternalBridgeScanner.cs new file mode 100644 index 000000000..fe7260a02 --- /dev/null +++ b/Software/Visual_Studio/Tango.Integration/Services/ExternalBridgeScanner.cs @@ -0,0 +1,112 @@ +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Net; +using System.Net.NetworkInformation; +using System.Net.Sockets; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +using Tango.Core; +using Tango.Core.Helpers; +using Tango.Logging; +using Tango.PMR; +using Tango.PMR.Common; +using Tango.PMR.Integration; +using Tango.Settings; +using Tango.Transport.Adapters; + +namespace Tango.Integration.Services +{ + public class ExternalBridgeScanner : ExtendedObject + { + private Thread _discoveryThread; + + private ObservableCollection _availableMachines; + /// + /// Gets or sets the available services. + /// + public ObservableCollection AvailableMachines + { + get { return _availableMachines; } + private set { _availableMachines = value; RaisePropertyChangedAuto(); } + } + + private bool _isStarted; + /// + /// Gets or sets a value indicating whether this instance is started. + /// + public bool IsStarted + { + get { return _isStarted; } + private set { _isStarted = value; RaisePropertyChangedAuto(); } + } + + /// + /// Initializes a new instance of the class. + /// + public ExternalBridgeScanner() + { + AvailableMachines = new ObservableCollection(); + } + + /// + /// Starts this instance. + /// + public void Start() + { + if (!IsStarted) + { + _discoveryThread = new Thread(DiscoveryThreadMethod); + _discoveryThread.IsBackground = true; + _discoveryThread.Start(); + } + } + + private void DiscoveryThreadMethod() + { + var Server = new UdpClient(8888); + + while (!IsStarted) + { + var ClientEp = new IPEndPoint(IPAddress.Any, 0); + var ClientRequestData = Server.Receive(ref ClientEp); + + ExternalBridgeUdpDiscoveryPacket packet = ExternalBridgeUdpDiscoveryPacket.Parser.ParseFrom(ClientRequestData); + + ExternalBridgeClient newMachine = new ExternalBridgeClient(packet.SerialNumber, ClientEp.Address.ToString()); + if (!AvailableMachines.ToList().Exists(x => x.SerialNumber == packet.SerialNumber)) + { + ThreadsHelper.InvokeUINow(() => + { + AvailableMachines.Add(newMachine); + }); + } + + Thread.Sleep(1000); + } + + Server.Close(); + } + + /// + /// Stops this instance. + /// + public void Stop() + { + if (IsStarted) + { + IsStarted = false; + } + } + + private void Client_StateChanged(object sender, Transport.TransportComponentState e) + { + if (e == Transport.TransportComponentState.Failed || e == Transport.TransportComponentState.Disposed) + { + AvailableMachines.Remove(sender as IExternalBridgeClient); + } + } + } +} diff --git a/Software/Visual_Studio/Tango.Integration/Services/IExternalBridgeClient.cs b/Software/Visual_Studio/Tango.Integration/Services/IExternalBridgeClient.cs new file mode 100644 index 000000000..6eb0ac5f9 --- /dev/null +++ b/Software/Visual_Studio/Tango.Integration/Services/IExternalBridgeClient.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Net.Sockets; +using System.Text; +using System.Threading.Tasks; +using Tango.Transport; +using Tango.Transport.Transporters; + +namespace Tango.Integration.Services +{ + public interface IExternalBridgeClient : ITransporter + { + String SerialNumber { get; } + + String Organization { get; } + + String IPAddress { get; set; } + + Task Authenticate(); + } +} diff --git a/Software/Visual_Studio/Tango.Integration/Tango.Integration.csproj b/Software/Visual_Studio/Tango.Integration/Tango.Integration.csproj new file mode 100644 index 000000000..e07c5a90d --- /dev/null +++ b/Software/Visual_Studio/Tango.Integration/Tango.Integration.csproj @@ -0,0 +1,85 @@ + + + + + Debug + AnyCPU + {4206AC58-3B57-4699-8835-90BF6DB01A61} + Library + Properties + Tango.Integration + Tango.Integration + v4.6 + 512 + + + true + full + false + ..\Build\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + ..\packages\Google.Protobuf.3.4.1\lib\net45\Google.Protobuf.dll + + + + + + + + + + + + + GlobalVersionInfo.cs + + + + + + + + + {a34ee0f0-649d-41c8-8489-b6f1cc6924ee} + Tango.Core + + + {0ecd6da8-7aa6-48d9-8b65-279d176ad9af} + Tango.DAL.Observables + + + {bc932dbd-7cdb-488c-99e4-f02cf441f55e} + Tango.Logging + + + {E4927038-348D-4295-AAF4-861C58CB3943} + Tango.PMR + + + {d8f1ad85-526a-4f50-b6dc-d437af63d8d8} + Tango.Settings + + + {74e700b0-1156-4126-be40-ee450d3c3026} + Tango.Transport + + + + + + + + \ No newline at end of file diff --git a/Software/Visual_Studio/Tango.Integration/app.config b/Software/Visual_Studio/Tango.Integration/app.config new file mode 100644 index 000000000..cacd4cd77 --- /dev/null +++ b/Software/Visual_Studio/Tango.Integration/app.config @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/Software/Visual_Studio/Tango.Integration/packages.config b/Software/Visual_Studio/Tango.Integration/packages.config new file mode 100644 index 000000000..6d9929c06 --- /dev/null +++ b/Software/Visual_Studio/Tango.Integration/packages.config @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/Software/Visual_Studio/Tango.PMR/Common/MessageType.cs b/Software/Visual_Studio/Tango.PMR/Common/MessageType.cs index 51f9e0f52..07079271b 100644 --- a/Software/Visual_Studio/Tango.PMR/Common/MessageType.cs +++ b/Software/Visual_Studio/Tango.PMR/Common/MessageType.cs @@ -22,7 +22,7 @@ namespace Tango.PMR.Common { static MessageTypeReflection() { byte[] descriptorData = global::System.Convert.FromBase64String( string.Concat( - "ChFNZXNzYWdlVHlwZS5wcm90bxIQVGFuZ28uUE1SLkNvbW1vbirvBgoLTWVz", + "ChFNZXNzYWdlVHlwZS5wcm90bxIQVGFuZ28uUE1SLkNvbW1vbirWBwoLTWVz", "c2FnZVR5cGUSBwoDUkdCEAASBwoDSm9iEAESCwoHU2VnbWVudBACEhQKEENh", "bGN1bGF0ZVJlcXVlc3QQAxIVChFDYWxjdWxhdGVSZXNwb25zZRAEEhMKD1By", "b2dyZXNzUmVxdWVzdBAFEhQKEFByb2dyZXNzUmVzcG9uc2UQBhIcChhTdHVi", @@ -42,8 +42,10 @@ namespace Tango.PMR.Common { "TGltaXRTd2l0Y2hSZXF1ZXN0EBsSHgoaU3R1Yk9wdExpbWl0U3dpdGNoUmVz", "cG9uc2UQHBIaChZTdHViU3RlcGVyTW90b3JSZXF1ZXN0EB0SGwoXU3R1YlN0", "ZXBlck1vdG9yUmVzcG9uc2UQHhIUChBTdHViVmFsdmVSZXF1ZXN0EB8SFQoR", - "U3R1YlZhbHZlUmVzcG9uc2UQIEIcChpjb20udHdpbmUudGFuZ28ucG1yLmNv", - "bW1vbmIGcHJvdG8z")); + "U3R1YlZhbHZlUmVzcG9uc2UQIBIkCiBFeHRlcm5hbEJyaWRnZVVkcERpc2Nv", + "dmVyeVBhY2tldBAhEh4KGkV4dGVybmFsQ2xpZW50TG9naW5SZXF1ZXN0ECIS", + "HwobRXh0ZXJuYWxDbGllbnRMb2dpblJlc3BvbnNlECNCHAoaY29tLnR3aW5l", + "LnRhbmdvLnBtci5jb21tb25iBnByb3RvMw==")); descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, new pbr::FileDescriptor[] { }, new pbr::GeneratedClrTypeInfo(new[] {typeof(global::Tango.PMR.Common.MessageType), }, null)); @@ -86,6 +88,9 @@ namespace Tango.PMR.Common { [pbr::OriginalName("StubSteperMotorResponse")] StubSteperMotorResponse = 30, [pbr::OriginalName("StubValveRequest")] StubValveRequest = 31, [pbr::OriginalName("StubValveResponse")] StubValveResponse = 32, + [pbr::OriginalName("ExternalBridgeUdpDiscoveryPacket")] ExternalBridgeUdpDiscoveryPacket = 33, + [pbr::OriginalName("ExternalClientLoginRequest")] ExternalClientLoginRequest = 34, + [pbr::OriginalName("ExternalClientLoginResponse")] ExternalClientLoginResponse = 35, } #endregion diff --git a/Software/Visual_Studio/Tango.PMR/Integration/ExternalBridgeUdpDiscoveryPacket.cs b/Software/Visual_Studio/Tango.PMR/Integration/ExternalBridgeUdpDiscoveryPacket.cs new file mode 100644 index 000000000..163a753b7 --- /dev/null +++ b/Software/Visual_Studio/Tango.PMR/Integration/ExternalBridgeUdpDiscoveryPacket.cs @@ -0,0 +1,160 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: ExternalBridgeUdpDiscoveryPacket.proto +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Tango.PMR.Integration { + + /// Holder for reflection information generated from ExternalBridgeUdpDiscoveryPacket.proto + public static partial class ExternalBridgeUdpDiscoveryPacketReflection { + + #region Descriptor + /// File descriptor for ExternalBridgeUdpDiscoveryPacket.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static ExternalBridgeUdpDiscoveryPacketReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "CiZFeHRlcm5hbEJyaWRnZVVkcERpc2NvdmVyeVBhY2tldC5wcm90bxIVVGFu", + "Z28uUE1SLkludGVncmF0aW9uIjgKIEV4dGVybmFsQnJpZGdlVWRwRGlzY292", + "ZXJ5UGFja2V0EhQKDFNlcmlhbE51bWJlchgCIAEoCUIhCh9jb20udHdpbmUu", + "dGFuZ28ucG1yLmludGVncmF0aW9uYgZwcm90bzM=")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { }, + new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Tango.PMR.Integration.ExternalBridgeUdpDiscoveryPacket), global::Tango.PMR.Integration.ExternalBridgeUdpDiscoveryPacket.Parser, new[]{ "SerialNumber" }, null, null, null) + })); + } + #endregion + + } + #region Messages + public sealed partial class ExternalBridgeUdpDiscoveryPacket : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ExternalBridgeUdpDiscoveryPacket()); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Tango.PMR.Integration.ExternalBridgeUdpDiscoveryPacketReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ExternalBridgeUdpDiscoveryPacket() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ExternalBridgeUdpDiscoveryPacket(ExternalBridgeUdpDiscoveryPacket other) : this() { + serialNumber_ = other.serialNumber_; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ExternalBridgeUdpDiscoveryPacket Clone() { + return new ExternalBridgeUdpDiscoveryPacket(this); + } + + /// Field number for the "SerialNumber" field. + public const int SerialNumberFieldNumber = 2; + private string serialNumber_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string SerialNumber { + get { return serialNumber_; } + set { + serialNumber_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as ExternalBridgeUdpDiscoveryPacket); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(ExternalBridgeUdpDiscoveryPacket other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (SerialNumber != other.SerialNumber) return false; + return true; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (SerialNumber.Length != 0) hash ^= SerialNumber.GetHashCode(); + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (SerialNumber.Length != 0) { + output.WriteRawTag(18); + output.WriteString(SerialNumber); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (SerialNumber.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(SerialNumber); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(ExternalBridgeUdpDiscoveryPacket other) { + if (other == null) { + return; + } + if (other.SerialNumber.Length != 0) { + SerialNumber = other.SerialNumber; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + input.SkipLastField(); + break; + case 18: { + SerialNumber = input.ReadString(); + break; + } + } + } + } + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Software/Visual_Studio/Tango.PMR/Integration/ExternalClientLoginRequest.cs b/Software/Visual_Studio/Tango.PMR/Integration/ExternalClientLoginRequest.cs new file mode 100644 index 000000000..2b614b2ed --- /dev/null +++ b/Software/Visual_Studio/Tango.PMR/Integration/ExternalClientLoginRequest.cs @@ -0,0 +1,160 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: ExternalClientLoginRequest.proto +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Tango.PMR.Integration { + + /// Holder for reflection information generated from ExternalClientLoginRequest.proto + public static partial class ExternalClientLoginRequestReflection { + + #region Descriptor + /// File descriptor for ExternalClientLoginRequest.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static ExternalClientLoginRequestReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "CiBFeHRlcm5hbENsaWVudExvZ2luUmVxdWVzdC5wcm90bxIVVGFuZ28uUE1S", + "LkludGVncmF0aW9uIikKGkV4dGVybmFsQ2xpZW50TG9naW5SZXF1ZXN0EgsK", + "A2tleRgBIAEoCUIhCh9jb20udHdpbmUudGFuZ28ucG1yLmludGVncmF0aW9u", + "YgZwcm90bzM=")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { }, + new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Tango.PMR.Integration.ExternalClientLoginRequest), global::Tango.PMR.Integration.ExternalClientLoginRequest.Parser, new[]{ "Key" }, null, null, null) + })); + } + #endregion + + } + #region Messages + public sealed partial class ExternalClientLoginRequest : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ExternalClientLoginRequest()); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Tango.PMR.Integration.ExternalClientLoginRequestReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ExternalClientLoginRequest() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ExternalClientLoginRequest(ExternalClientLoginRequest other) : this() { + key_ = other.key_; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ExternalClientLoginRequest Clone() { + return new ExternalClientLoginRequest(this); + } + + /// Field number for the "key" field. + public const int KeyFieldNumber = 1; + private string key_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string Key { + get { return key_; } + set { + key_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as ExternalClientLoginRequest); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(ExternalClientLoginRequest other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Key != other.Key) return false; + return true; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (Key.Length != 0) hash ^= Key.GetHashCode(); + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (Key.Length != 0) { + output.WriteRawTag(10); + output.WriteString(Key); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (Key.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Key); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(ExternalClientLoginRequest other) { + if (other == null) { + return; + } + if (other.Key.Length != 0) { + Key = other.Key; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + input.SkipLastField(); + break; + case 10: { + Key = input.ReadString(); + break; + } + } + } + } + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Software/Visual_Studio/Tango.PMR/Integration/ExternalClientLoginResponse.cs b/Software/Visual_Studio/Tango.PMR/Integration/ExternalClientLoginResponse.cs new file mode 100644 index 000000000..3d374024c --- /dev/null +++ b/Software/Visual_Studio/Tango.PMR/Integration/ExternalClientLoginResponse.cs @@ -0,0 +1,188 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: ExternalClientLoginResponse.proto +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Tango.PMR.Integration { + + /// Holder for reflection information generated from ExternalClientLoginResponse.proto + public static partial class ExternalClientLoginResponseReflection { + + #region Descriptor + /// File descriptor for ExternalClientLoginResponse.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static ExternalClientLoginResponseReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "CiFFeHRlcm5hbENsaWVudExvZ2luUmVzcG9uc2UucHJvdG8SFVRhbmdvLlBN", + "Ui5JbnRlZ3JhdGlvbiJKChtFeHRlcm5hbENsaWVudExvZ2luUmVzcG9uc2US", + "FQoNQXV0aGVudGljYXRlZBgBIAEoCBIUCgxTZXJpYWxOdW1iZXIYAiABKAlC", + "IQofY29tLnR3aW5lLnRhbmdvLnBtci5pbnRlZ3JhdGlvbmIGcHJvdG8z")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { }, + new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Tango.PMR.Integration.ExternalClientLoginResponse), global::Tango.PMR.Integration.ExternalClientLoginResponse.Parser, new[]{ "Authenticated", "SerialNumber" }, null, null, null) + })); + } + #endregion + + } + #region Messages + public sealed partial class ExternalClientLoginResponse : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ExternalClientLoginResponse()); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Tango.PMR.Integration.ExternalClientLoginResponseReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ExternalClientLoginResponse() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ExternalClientLoginResponse(ExternalClientLoginResponse other) : this() { + authenticated_ = other.authenticated_; + serialNumber_ = other.serialNumber_; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ExternalClientLoginResponse Clone() { + return new ExternalClientLoginResponse(this); + } + + /// Field number for the "Authenticated" field. + public const int AuthenticatedFieldNumber = 1; + private bool authenticated_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Authenticated { + get { return authenticated_; } + set { + authenticated_ = value; + } + } + + /// Field number for the "SerialNumber" field. + public const int SerialNumberFieldNumber = 2; + private string serialNumber_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string SerialNumber { + get { return serialNumber_; } + set { + serialNumber_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as ExternalClientLoginResponse); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(ExternalClientLoginResponse other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Authenticated != other.Authenticated) return false; + if (SerialNumber != other.SerialNumber) return false; + return true; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (Authenticated != false) hash ^= Authenticated.GetHashCode(); + if (SerialNumber.Length != 0) hash ^= SerialNumber.GetHashCode(); + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (Authenticated != false) { + output.WriteRawTag(8); + output.WriteBool(Authenticated); + } + if (SerialNumber.Length != 0) { + output.WriteRawTag(18); + output.WriteString(SerialNumber); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (Authenticated != false) { + size += 1 + 1; + } + if (SerialNumber.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(SerialNumber); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(ExternalClientLoginResponse other) { + if (other == null) { + return; + } + if (other.Authenticated != false) { + Authenticated = other.Authenticated; + } + if (other.SerialNumber.Length != 0) { + SerialNumber = other.SerialNumber; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + input.SkipLastField(); + break; + case 8: { + Authenticated = input.ReadBool(); + break; + } + case 18: { + SerialNumber = input.ReadString(); + break; + } + } + } + } + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Software/Visual_Studio/Tango.PMR/Tango.PMR.csproj b/Software/Visual_Studio/Tango.PMR/Tango.PMR.csproj index 08a809060..a720373ae 100644 --- a/Software/Visual_Studio/Tango.PMR/Tango.PMR.csproj +++ b/Software/Visual_Studio/Tango.PMR/Tango.PMR.csproj @@ -48,6 +48,9 @@ GlobalVersionInfo.cs + + + diff --git a/Software/Visual_Studio/Tango.Settings/Integration.cs b/Software/Visual_Studio/Tango.Settings/Integration.cs new file mode 100644 index 000000000..8ca80176b --- /dev/null +++ b/Software/Visual_Studio/Tango.Settings/Integration.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.Settings +{ + public class Integration + { + public int ExternalBridgeServicePort { get; set; } + + public Integration() + { + ExternalBridgeServicePort = 1984; + } + } +} diff --git a/Software/Visual_Studio/Tango.Settings/SettingsCollection.cs b/Software/Visual_Studio/Tango.Settings/SettingsCollection.cs index aae228b49..1deeac638 100644 --- a/Software/Visual_Studio/Tango.Settings/SettingsCollection.cs +++ b/Software/Visual_Studio/Tango.Settings/SettingsCollection.cs @@ -18,6 +18,8 @@ namespace Tango.Settings public StubsUI StubsUI { get; set; } + public Integration Integration { get; set; } + /// /// Initializes a new instance of the class. /// @@ -26,6 +28,7 @@ namespace Tango.Settings DataBase = new DataBase(); MachineStudio = new MachineStudio(); StubsUI = new StubsUI(); + Integration = new Integration(); } } } diff --git a/Software/Visual_Studio/Tango.Settings/Tango.Settings.csproj b/Software/Visual_Studio/Tango.Settings/Tango.Settings.csproj index e85a5f1bd..edd0b1c25 100644 --- a/Software/Visual_Studio/Tango.Settings/Tango.Settings.csproj +++ b/Software/Visual_Studio/Tango.Settings/Tango.Settings.csproj @@ -44,6 +44,7 @@ GlobalVersionInfo.cs + diff --git a/Software/Visual_Studio/Tango.Transport/TransporterBase.cs b/Software/Visual_Studio/Tango.Transport/TransporterBase.cs index bb3a95cbc..aeda918fa 100644 --- a/Software/Visual_Studio/Tango.Transport/TransporterBase.cs +++ b/Software/Visual_Studio/Tango.Transport/TransporterBase.cs @@ -18,7 +18,7 @@ namespace Tango.Transport /// Represents an base class. /// /// - public abstract class TransporterBase : ITransporter + public abstract class TransporterBase : ExtendedObject, ITransporter { private ConcurrentQueue _sendingQueue; private List _pendingRequests; @@ -237,7 +237,7 @@ namespace Tango.Transport /// Connects the transport component. /// /// - public async Task Connect() + public virtual async Task Connect() { State = TransportComponentState.Connected; StartThreads(); @@ -249,7 +249,7 @@ namespace Tango.Transport /// Disconnects the transport component. /// /// - public async Task Disconnect() + public virtual async Task Disconnect() { State = TransportComponentState.Disconnected; await Task.WhenAll(Adapters.Select(x => x.Disconnect())); diff --git a/Software/Visual_Studio/Tango.sln b/Software/Visual_Studio/Tango.sln index 52f716bf8..f64a4cf59 100644 --- a/Software/Visual_Studio/Tango.sln +++ b/Software/Visual_Studio/Tango.sln @@ -101,6 +101,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Tango.ColorLib", "Native\Ta EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tango.AutoComplete", "SideChains\Tango.AutoComplete\Tango.AutoComplete.csproj", "{BB2ABB74-BA58-4812-83AA-EC8171F42DF4}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tango.Integration", "Tango.Integration\Tango.Integration.csproj", "{4206AC58-3B57-4699-8835-90BF6DB01A61}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -861,6 +863,26 @@ Global {BB2ABB74-BA58-4812-83AA-EC8171F42DF4}.Release|x64.Build.0 = Release|Any CPU {BB2ABB74-BA58-4812-83AA-EC8171F42DF4}.Release|x86.ActiveCfg = Release|Any CPU {BB2ABB74-BA58-4812-83AA-EC8171F42DF4}.Release|x86.Build.0 = Release|Any CPU + {4206AC58-3B57-4699-8835-90BF6DB01A61}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4206AC58-3B57-4699-8835-90BF6DB01A61}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4206AC58-3B57-4699-8835-90BF6DB01A61}.Debug|ARM.ActiveCfg = Debug|Any CPU + {4206AC58-3B57-4699-8835-90BF6DB01A61}.Debug|ARM.Build.0 = Debug|Any CPU + {4206AC58-3B57-4699-8835-90BF6DB01A61}.Debug|ARM64.ActiveCfg = Debug|Any CPU + {4206AC58-3B57-4699-8835-90BF6DB01A61}.Debug|ARM64.Build.0 = Debug|Any CPU + {4206AC58-3B57-4699-8835-90BF6DB01A61}.Debug|x64.ActiveCfg = Debug|Any CPU + {4206AC58-3B57-4699-8835-90BF6DB01A61}.Debug|x64.Build.0 = Debug|Any CPU + {4206AC58-3B57-4699-8835-90BF6DB01A61}.Debug|x86.ActiveCfg = Debug|Any CPU + {4206AC58-3B57-4699-8835-90BF6DB01A61}.Debug|x86.Build.0 = Debug|Any CPU + {4206AC58-3B57-4699-8835-90BF6DB01A61}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4206AC58-3B57-4699-8835-90BF6DB01A61}.Release|Any CPU.Build.0 = Release|Any CPU + {4206AC58-3B57-4699-8835-90BF6DB01A61}.Release|ARM.ActiveCfg = Release|Any CPU + {4206AC58-3B57-4699-8835-90BF6DB01A61}.Release|ARM.Build.0 = Release|Any CPU + {4206AC58-3B57-4699-8835-90BF6DB01A61}.Release|ARM64.ActiveCfg = Release|Any CPU + {4206AC58-3B57-4699-8835-90BF6DB01A61}.Release|ARM64.Build.0 = Release|Any CPU + {4206AC58-3B57-4699-8835-90BF6DB01A61}.Release|x64.ActiveCfg = Release|Any CPU + {4206AC58-3B57-4699-8835-90BF6DB01A61}.Release|x64.Build.0 = Release|Any CPU + {4206AC58-3B57-4699-8835-90BF6DB01A61}.Release|x86.ActiveCfg = Release|Any CPU + {4206AC58-3B57-4699-8835-90BF6DB01A61}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE -- cgit v1.3.1 From 8ef54228747d6d7e534953c265cfa95a5489ac0f Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Sun, 24 Dec 2017 14:26:36 +0200 Subject: Modified .NET Transport layer to return TangoMessage for a request !!! --- Software/Android_Studio/Tango.BL/.gitignore | 1 - Software/Android_Studio/Tango.BL/CMakeLists.txt | 45 -- Software/Android_Studio/Tango.BL/build.gradle | 42 -- .../Android_Studio/Tango.BL/proguard-rules.pro | 25 - .../Tango.BL/src/main/AndroidManifest.xml | 2 - .../Tango.BL/src/main/cpp/Android.mk | 0 .../Tango.BL/src/main/cpp/OtherClass.cpp | 9 - .../Tango.BL/src/main/cpp/OtherClass.h | 19 - .../Tango.BL/src/main/cpp/native-lib.cpp | 18 - .../src/main/java/com/twine/tango/bl/Example.java | 21 - .../Tango.BL/src/main/res/values/strings.xml | 3 - .../Tango.Synchronization/.gitignore | 1 - .../Tango.Synchronization/build.gradle | 49 -- .../Tango.Synchronization/proguard-rules.pro | 25 - .../src/main/AndroidManifest.xml | 2 - .../src/main/res/values/strings.xml | 3 - .../tango/unittesting/Synchronization_TST.java | 24 +- .../Tango.ColorLib/PMR/Common/MessageType.pb-c.c | 16 +- .../Tango.ColorLib/PMR/Common/MessageType.pb-c.h | 5 +- .../ExternalBridgeUdpDiscoveryPacket.pb-c.c | 92 ++++ .../ExternalBridgeUdpDiscoveryPacket.pb-c.h | 71 +++ .../Integration/ExternalClientLoginRequest.pb-c.c | 92 ++++ .../Integration/ExternalClientLoginRequest.pb-c.h | 71 +++ .../Integration/ExternalClientLoginResponse.pb-c.c | 105 +++++ .../Integration/ExternalClientLoginResponse.pb-c.h | 73 +++ .../PMR/ExternalBridgeUdpDiscoveryPacket.pb.cc | 450 ++++++++++++++++++ .../PMR/ExternalBridgeUdpDiscoveryPacket.pb.h | 246 ++++++++++ .../PMR/ExternalClientLoginRequest.pb.cc | 449 ++++++++++++++++++ .../PMR/ExternalClientLoginRequest.pb.h | 246 ++++++++++ .../PMR/ExternalClientLoginResponse.pb.cc | 502 +++++++++++++++++++++ .../PMR/ExternalClientLoginResponse.pb.h | 267 +++++++++++ .../Native/Tango.ProtoTest/PMR/MessageType.pb.cc | 14 +- .../Native/Tango.ProtoTest/PMR/MessageType.pb.h | 5 +- .../Services/ExternalBridgeClient.cs | 2 +- Software/Visual_Studio/Tango.PMR/MessageFactory.cs | 8 + .../Visual_Studio/Tango.Stubs/Stubs/Calculate.cs | 2 +- .../Visual_Studio/Tango.Stubs/Stubs/Progress.cs | 2 +- .../Visual_Studio/Tango.Transport/ITransporter.cs | 8 +- .../Tango.Transport/TransporterBase.cs | 28 +- Software/Visual_Studio/Tango.sln | 4 +- .../Utilities/Tango.MobileEM.UI/App.xaml.cs | 2 +- .../Web/Tango.MachineService/App_Data/Tango.db | Bin 557056 -> 557056 bytes 42 files changed, 2741 insertions(+), 308 deletions(-) delete mode 100644 Software/Android_Studio/Tango.BL/.gitignore delete mode 100644 Software/Android_Studio/Tango.BL/CMakeLists.txt delete mode 100644 Software/Android_Studio/Tango.BL/build.gradle delete mode 100644 Software/Android_Studio/Tango.BL/proguard-rules.pro delete mode 100644 Software/Android_Studio/Tango.BL/src/main/AndroidManifest.xml delete mode 100644 Software/Android_Studio/Tango.BL/src/main/cpp/Android.mk delete mode 100644 Software/Android_Studio/Tango.BL/src/main/cpp/OtherClass.cpp delete mode 100644 Software/Android_Studio/Tango.BL/src/main/cpp/OtherClass.h delete mode 100644 Software/Android_Studio/Tango.BL/src/main/cpp/native-lib.cpp delete mode 100644 Software/Android_Studio/Tango.BL/src/main/java/com/twine/tango/bl/Example.java delete mode 100644 Software/Android_Studio/Tango.BL/src/main/res/values/strings.xml delete mode 100644 Software/Android_Studio/Tango.Synchronization/.gitignore delete mode 100644 Software/Android_Studio/Tango.Synchronization/build.gradle delete mode 100644 Software/Android_Studio/Tango.Synchronization/proguard-rules.pro delete mode 100644 Software/Android_Studio/Tango.Synchronization/src/main/AndroidManifest.xml delete mode 100644 Software/Android_Studio/Tango.Synchronization/src/main/res/values/strings.xml create mode 100644 Software/Visual_Studio/Native/Tango.ColorLib/PMR/Integration/ExternalBridgeUdpDiscoveryPacket.pb-c.c create mode 100644 Software/Visual_Studio/Native/Tango.ColorLib/PMR/Integration/ExternalBridgeUdpDiscoveryPacket.pb-c.h create mode 100644 Software/Visual_Studio/Native/Tango.ColorLib/PMR/Integration/ExternalClientLoginRequest.pb-c.c create mode 100644 Software/Visual_Studio/Native/Tango.ColorLib/PMR/Integration/ExternalClientLoginRequest.pb-c.h create mode 100644 Software/Visual_Studio/Native/Tango.ColorLib/PMR/Integration/ExternalClientLoginResponse.pb-c.c create mode 100644 Software/Visual_Studio/Native/Tango.ColorLib/PMR/Integration/ExternalClientLoginResponse.pb-c.h create mode 100644 Software/Visual_Studio/Native/Tango.ProtoTest/PMR/ExternalBridgeUdpDiscoveryPacket.pb.cc create mode 100644 Software/Visual_Studio/Native/Tango.ProtoTest/PMR/ExternalBridgeUdpDiscoveryPacket.pb.h create mode 100644 Software/Visual_Studio/Native/Tango.ProtoTest/PMR/ExternalClientLoginRequest.pb.cc create mode 100644 Software/Visual_Studio/Native/Tango.ProtoTest/PMR/ExternalClientLoginRequest.pb.h create mode 100644 Software/Visual_Studio/Native/Tango.ProtoTest/PMR/ExternalClientLoginResponse.pb.cc create mode 100644 Software/Visual_Studio/Native/Tango.ProtoTest/PMR/ExternalClientLoginResponse.pb.h (limited to 'Software/Android_Studio/Tango.UnitTesting/src/androidTest') diff --git a/Software/Android_Studio/Tango.BL/.gitignore b/Software/Android_Studio/Tango.BL/.gitignore deleted file mode 100644 index 796b96d1c..000000000 --- a/Software/Android_Studio/Tango.BL/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/build diff --git a/Software/Android_Studio/Tango.BL/CMakeLists.txt b/Software/Android_Studio/Tango.BL/CMakeLists.txt deleted file mode 100644 index 201e7c537..000000000 --- a/Software/Android_Studio/Tango.BL/CMakeLists.txt +++ /dev/null @@ -1,45 +0,0 @@ -# For more information about using CMake with Android Studio, read the -# documentation: https://d.android.com/studio/projects/add-native-code.html - -# Sets the minimum version of CMake required to build the native library. - -cmake_minimum_required(VERSION 3.4.1) - -# Creates and names a library, sets it as either STATIC -# or SHARED, and provides the relative paths to its source code. -# You can define multiple libraries, and CMake builds them for you. -# Gradle automatically packages shared libraries with your APK. - -add_library( # Sets the name of the library. - native-lib - - # Sets the library as a shared library. - SHARED - - # Provides a relative path to your source file(s). - src/main/cpp/native-lib.cpp - src/main/cpp/OtherClass.cpp ) - -# Searches for a specified prebuilt library and stores the path as a -# variable. Because CMake includes system libraries in the search path by -# default, you only need to specify the name of the public NDK library -# you want to add. CMake verifies that the library exists before -# completing its build. - -find_library( # Sets the name of the path variable. - log-lib - - # Specifies the name of the NDK library that - # you want CMake to locate. - log ) - -# Specifies libraries CMake should link to your target library. You -# can link multiple libraries, such as libraries you define in this -# build script, prebuilt third-party libraries, or system libraries. - -target_link_libraries( # Specifies the target library. - native-lib - - # Links the target library to the log library - # included in the NDK. - ${log-lib} ) \ No newline at end of file diff --git a/Software/Android_Studio/Tango.BL/build.gradle b/Software/Android_Studio/Tango.BL/build.gradle deleted file mode 100644 index f93ac6d3d..000000000 --- a/Software/Android_Studio/Tango.BL/build.gradle +++ /dev/null @@ -1,42 +0,0 @@ -apply plugin: 'com.android.library' - -android { - compileSdkVersion 26 - buildToolsVersion "26.0.1" - - - defaultConfig { - minSdkVersion 22 - targetSdkVersion 26 - versionCode 1 - versionName "1.0" - - testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" - externalNativeBuild { - cmake { - cppFlags "-std=c++11 -frtti -fexceptions" - } - } - - } - buildTypes { - release { - minifyEnabled false - proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' - } - } - externalNativeBuild { - cmake { - path "CMakeLists.txt" - } - } -} - -dependencies { - implementation fileTree(dir: 'libs', include: ['*.jar']) - - implementation 'com.android.support:appcompat-v7:26.1.0' - testImplementation 'junit:junit:4.12' - androidTestImplementation 'com.android.support.test:runner:1.0.1' - androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1' -} diff --git a/Software/Android_Studio/Tango.BL/proguard-rules.pro b/Software/Android_Studio/Tango.BL/proguard-rules.pro deleted file mode 100644 index a0eef131a..000000000 --- a/Software/Android_Studio/Tango.BL/proguard-rules.pro +++ /dev/null @@ -1,25 +0,0 @@ -# Add project specific ProGuard rules here. -# By default, the flags in this file are appended to flags specified -# in C:\Users\Roy\AppData\Local\Android\Sdk/tools/proguard/proguard-android.txt -# You can edit the include path and order by changing the proguardFiles -# directive in build.gradle. -# -# For more details, see -# http://developer.android.com/guide/developing/tools/proguard.html - -# Add any project specific keep options here: - -# If your project uses WebView with JS, uncomment the following -# and specify the fully qualified class name to the JavaScript interface -# class: -#-keepclassmembers class fqcn.of.javascript.interface.for.webview { -# public *; -#} - -# Uncomment this to preserve the line number information for -# debugging stack traces. -#-keepattributes SourceFile,LineNumberTable - -# If you keep the line number information, uncomment this to -# hide the original source file name. -#-renamesourcefileattribute SourceFile diff --git a/Software/Android_Studio/Tango.BL/src/main/AndroidManifest.xml b/Software/Android_Studio/Tango.BL/src/main/AndroidManifest.xml deleted file mode 100644 index 29e67ea39..000000000 --- a/Software/Android_Studio/Tango.BL/src/main/AndroidManifest.xml +++ /dev/null @@ -1,2 +0,0 @@ - diff --git a/Software/Android_Studio/Tango.BL/src/main/cpp/Android.mk b/Software/Android_Studio/Tango.BL/src/main/cpp/Android.mk deleted file mode 100644 index e69de29bb..000000000 diff --git a/Software/Android_Studio/Tango.BL/src/main/cpp/OtherClass.cpp b/Software/Android_Studio/Tango.BL/src/main/cpp/OtherClass.cpp deleted file mode 100644 index 50d6304dd..000000000 --- a/Software/Android_Studio/Tango.BL/src/main/cpp/OtherClass.cpp +++ /dev/null @@ -1,9 +0,0 @@ -// -// Created by Roy on 11/5/2017. -// - -#include "OtherClass.h" - -string OtherClass::getString(string str) { - return str; -} diff --git a/Software/Android_Studio/Tango.BL/src/main/cpp/OtherClass.h b/Software/Android_Studio/Tango.BL/src/main/cpp/OtherClass.h deleted file mode 100644 index 0efe65b71..000000000 --- a/Software/Android_Studio/Tango.BL/src/main/cpp/OtherClass.h +++ /dev/null @@ -1,19 +0,0 @@ -// -// Created by Roy on 11/5/2017. -// -#include - -using namespace std; - -#ifndef ANDROID_STUDIO_OTHERCLASS_H -#define ANDROID_STUDIO_OTHERCLASS_H - - -class OtherClass { - -public: - string getString(string str); -}; - - -#endif //ANDROID_STUDIO_OTHERCLASS_H diff --git a/Software/Android_Studio/Tango.BL/src/main/cpp/native-lib.cpp b/Software/Android_Studio/Tango.BL/src/main/cpp/native-lib.cpp deleted file mode 100644 index c7317d615..000000000 --- a/Software/Android_Studio/Tango.BL/src/main/cpp/native-lib.cpp +++ /dev/null @@ -1,18 +0,0 @@ -#include -#include -#include "OtherClass.h" - -extern "C" -JNIEXPORT jstring - -JNICALL -Java_com_twine_tango_bl_Example_getString( - JNIEnv *env, - jobject /* this */) -{ - - OtherClass c; - - std::string hello = "Hello from C++" + c.getString(" Some String"); - return env->NewStringUTF(hello.c_str()); -} diff --git a/Software/Android_Studio/Tango.BL/src/main/java/com/twine/tango/bl/Example.java b/Software/Android_Studio/Tango.BL/src/main/java/com/twine/tango/bl/Example.java deleted file mode 100644 index 992ddf16f..000000000 --- a/Software/Android_Studio/Tango.BL/src/main/java/com/twine/tango/bl/Example.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.twine.tango.bl; - -import android.util.Log; - -/** - * Created by Roy on 11/2/2017. - */ - -public class Example { - public native String getString(); - - static { - System.loadLibrary("native-lib"); - } - - public void Do() - { - String a = getString(); - Log.i("NATIVE NATIVE",a); - } -} diff --git a/Software/Android_Studio/Tango.BL/src/main/res/values/strings.xml b/Software/Android_Studio/Tango.BL/src/main/res/values/strings.xml deleted file mode 100644 index 5c465ac04..000000000 --- a/Software/Android_Studio/Tango.BL/src/main/res/values/strings.xml +++ /dev/null @@ -1,3 +0,0 @@ - - Tango.BL - diff --git a/Software/Android_Studio/Tango.Synchronization/.gitignore b/Software/Android_Studio/Tango.Synchronization/.gitignore deleted file mode 100644 index 796b96d1c..000000000 --- a/Software/Android_Studio/Tango.Synchronization/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/build diff --git a/Software/Android_Studio/Tango.Synchronization/build.gradle b/Software/Android_Studio/Tango.Synchronization/build.gradle deleted file mode 100644 index a8a33e319..000000000 --- a/Software/Android_Studio/Tango.Synchronization/build.gradle +++ /dev/null @@ -1,49 +0,0 @@ -apply plugin: 'com.android.library' - -android { - compileSdkVersion 26 - buildToolsVersion "26.0.1" - - - defaultConfig { - minSdkVersion 22 - targetSdkVersion 26 - versionCode 1 - versionName "1.0" - - testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" - - multiDexEnabled true - - } - buildTypes { - release { - minifyEnabled false - proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' - } - } - - compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 - } -} - -dependencies { - implementation fileTree(include: ['*.jar'], dir: 'libs') - implementation 'com.android.support:appcompat-v7:26.1.0' - testImplementation 'junit:junit:4.12' - androidTestImplementation 'com.android.support.test:runner:1.0.1' - androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1' - implementation project(':Tango.PMR') - implementation project(':Tango.Web') - compile globalDependencies.logging - compile globalDependencies.storage - compile globalDependencies.dagger - compile globalDependencies.daggerAndroid - implementation project(':Tango.DAL') - implementation project(':Tango.Integration') - compile globalDependencies.rxJava - compile globalDependencies.rxJavaAndroid - implementation project(':Tango.Transport') -} diff --git a/Software/Android_Studio/Tango.Synchronization/proguard-rules.pro b/Software/Android_Studio/Tango.Synchronization/proguard-rules.pro deleted file mode 100644 index a0eef131a..000000000 --- a/Software/Android_Studio/Tango.Synchronization/proguard-rules.pro +++ /dev/null @@ -1,25 +0,0 @@ -# Add project specific ProGuard rules here. -# By default, the flags in this file are appended to flags specified -# in C:\Users\Roy\AppData\Local\Android\Sdk/tools/proguard/proguard-android.txt -# You can edit the include path and order by changing the proguardFiles -# directive in build.gradle. -# -# For more details, see -# http://developer.android.com/guide/developing/tools/proguard.html - -# Add any project specific keep options here: - -# If your project uses WebView with JS, uncomment the following -# and specify the fully qualified class name to the JavaScript interface -# class: -#-keepclassmembers class fqcn.of.javascript.interface.for.webview { -# public *; -#} - -# Uncomment this to preserve the line number information for -# debugging stack traces. -#-keepattributes SourceFile,LineNumberTable - -# If you keep the line number information, uncomment this to -# hide the original source file name. -#-renamesourcefileattribute SourceFile diff --git a/Software/Android_Studio/Tango.Synchronization/src/main/AndroidManifest.xml b/Software/Android_Studio/Tango.Synchronization/src/main/AndroidManifest.xml deleted file mode 100644 index 0f9821a96..000000000 --- a/Software/Android_Studio/Tango.Synchronization/src/main/AndroidManifest.xml +++ /dev/null @@ -1,2 +0,0 @@ - diff --git a/Software/Android_Studio/Tango.Synchronization/src/main/res/values/strings.xml b/Software/Android_Studio/Tango.Synchronization/src/main/res/values/strings.xml deleted file mode 100644 index f4a346f34..000000000 --- a/Software/Android_Studio/Tango.Synchronization/src/main/res/values/strings.xml +++ /dev/null @@ -1,3 +0,0 @@ - - Tango.Synchronization - diff --git a/Software/Android_Studio/Tango.UnitTesting/src/androidTest/java/com/twine/tango/unittesting/Synchronization_TST.java b/Software/Android_Studio/Tango.UnitTesting/src/androidTest/java/com/twine/tango/unittesting/Synchronization_TST.java index 4713fb6cc..4635bec7a 100644 --- a/Software/Android_Studio/Tango.UnitTesting/src/androidTest/java/com/twine/tango/unittesting/Synchronization_TST.java +++ b/Software/Android_Studio/Tango.UnitTesting/src/androidTest/java/com/twine/tango/unittesting/Synchronization_TST.java @@ -36,18 +36,18 @@ public class Synchronization_TST XLog.i(org.getName()); } - ISynchronizationService synchronizer = new SynchronizationService(new MachineIdentityProvider()); + //ISynchronizationService synchronizer = new SynchronizationService(new MachineIdentityProvider()); - synchronizer.synchronizeDB().subscribe(() -> - { - for (Organization org : TangoDAO.getAllOrganizations()) - { - XLog.i(org.getName()); - } - - }, (ex) -> - { - ex.printStackTrace(); - }); +// synchronizer.synchronizeDB().subscribe(() -> +// { +// for (Organization org : TangoDAO.getAllOrganizations()) +// { +// XLog.i(org.getName()); +// } +// +// }, (ex) -> +// { +// ex.printStackTrace(); +// }); } } diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Common/MessageType.pb-c.c b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Common/MessageType.pb-c.c index 6416e1fcd..e922ccf91 100644 --- a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Common/MessageType.pb-c.c +++ b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Common/MessageType.pb-c.c @@ -7,7 +7,7 @@ #endif #include "MessageType.pb-c.h" -static const ProtobufCEnumValue message_type__enum_values_by_number[33] = +static const ProtobufCEnumValue message_type__enum_values_by_number[36] = { { "RGB", "MESSAGE_TYPE__RGB", 0 }, { "Job", "MESSAGE_TYPE__Job", 1 }, @@ -42,14 +42,20 @@ static const ProtobufCEnumValue message_type__enum_values_by_number[33] = { "StubSteperMotorResponse", "MESSAGE_TYPE__StubSteperMotorResponse", 30 }, { "StubValveRequest", "MESSAGE_TYPE__StubValveRequest", 31 }, { "StubValveResponse", "MESSAGE_TYPE__StubValveResponse", 32 }, + { "ExternalBridgeUdpDiscoveryPacket", "MESSAGE_TYPE__ExternalBridgeUdpDiscoveryPacket", 33 }, + { "ExternalClientLoginRequest", "MESSAGE_TYPE__ExternalClientLoginRequest", 34 }, + { "ExternalClientLoginResponse", "MESSAGE_TYPE__ExternalClientLoginResponse", 35 }, }; static const ProtobufCIntRange message_type__value_ranges[] = { -{0, 0},{0, 33} +{0, 0},{0, 36} }; -static const ProtobufCEnumValueIndex message_type__enum_values_by_name[33] = +static const ProtobufCEnumValueIndex message_type__enum_values_by_name[36] = { { "CalculateRequest", 3 }, { "CalculateResponse", 4 }, + { "ExternalBridgeUdpDiscoveryPacket", 33 }, + { "ExternalClientLoginRequest", 34 }, + { "ExternalClientLoginResponse", 35 }, { "Job", 1 }, { "ProgressRequest", 5 }, { "ProgressResponse", 6 }, @@ -89,9 +95,9 @@ const ProtobufCEnumDescriptor message_type__descriptor = "MessageType", "MessageType", "", - 33, + 36, message_type__enum_values_by_number, - 33, + 36, message_type__enum_values_by_name, 1, message_type__value_ranges, diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Common/MessageType.pb-c.h b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Common/MessageType.pb-c.h index 56f9af6ca..fae795b73 100644 --- a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Common/MessageType.pb-c.h +++ b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Common/MessageType.pb-c.h @@ -52,7 +52,10 @@ typedef enum _MessageType { MESSAGE_TYPE__StubSteperMotorRequest = 29, MESSAGE_TYPE__StubSteperMotorResponse = 30, MESSAGE_TYPE__StubValveRequest = 31, - MESSAGE_TYPE__StubValveResponse = 32 + MESSAGE_TYPE__StubValveResponse = 32, + MESSAGE_TYPE__ExternalBridgeUdpDiscoveryPacket = 33, + MESSAGE_TYPE__ExternalClientLoginRequest = 34, + MESSAGE_TYPE__ExternalClientLoginResponse = 35 PROTOBUF_C__FORCE_ENUM_TO_BE_INT_SIZE(MESSAGE_TYPE) } MessageType; diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Integration/ExternalBridgeUdpDiscoveryPacket.pb-c.c b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Integration/ExternalBridgeUdpDiscoveryPacket.pb-c.c new file mode 100644 index 000000000..b8a8d9c6e --- /dev/null +++ b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Integration/ExternalBridgeUdpDiscoveryPacket.pb-c.c @@ -0,0 +1,92 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: ExternalBridgeUdpDiscoveryPacket.proto */ + +/* Do not generate deprecated warnings for self */ +#ifndef PROTOBUF_C__NO_DEPRECATED +#define PROTOBUF_C__NO_DEPRECATED +#endif + +#include "ExternalBridgeUdpDiscoveryPacket.pb-c.h" +void external_bridge_udp_discovery_packet__init + (ExternalBridgeUdpDiscoveryPacket *message) +{ + static const ExternalBridgeUdpDiscoveryPacket init_value = EXTERNAL_BRIDGE_UDP_DISCOVERY_PACKET__INIT; + *message = init_value; +} +size_t external_bridge_udp_discovery_packet__get_packed_size + (const ExternalBridgeUdpDiscoveryPacket *message) +{ + assert(message->base.descriptor == &external_bridge_udp_discovery_packet__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t external_bridge_udp_discovery_packet__pack + (const ExternalBridgeUdpDiscoveryPacket *message, + uint8_t *out) +{ + assert(message->base.descriptor == &external_bridge_udp_discovery_packet__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t external_bridge_udp_discovery_packet__pack_to_buffer + (const ExternalBridgeUdpDiscoveryPacket *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &external_bridge_udp_discovery_packet__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +ExternalBridgeUdpDiscoveryPacket * + external_bridge_udp_discovery_packet__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (ExternalBridgeUdpDiscoveryPacket *) + protobuf_c_message_unpack (&external_bridge_udp_discovery_packet__descriptor, + allocator, len, data); +} +void external_bridge_udp_discovery_packet__free_unpacked + (ExternalBridgeUdpDiscoveryPacket *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &external_bridge_udp_discovery_packet__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +static const ProtobufCFieldDescriptor external_bridge_udp_discovery_packet__field_descriptors[1] = +{ + { + "SerialNumber", + 2, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_STRING, + 0, /* quantifier_offset */ + offsetof(ExternalBridgeUdpDiscoveryPacket, serialnumber), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned external_bridge_udp_discovery_packet__field_indices_by_name[] = { + 0, /* field[0] = SerialNumber */ +}; +static const ProtobufCIntRange external_bridge_udp_discovery_packet__number_ranges[1 + 1] = +{ + { 2, 0 }, + { 0, 1 } +}; +const ProtobufCMessageDescriptor external_bridge_udp_discovery_packet__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "ExternalBridgeUdpDiscoveryPacket", + "ExternalBridgeUdpDiscoveryPacket", + "ExternalBridgeUdpDiscoveryPacket", + "", + sizeof(ExternalBridgeUdpDiscoveryPacket), + 1, + external_bridge_udp_discovery_packet__field_descriptors, + external_bridge_udp_discovery_packet__field_indices_by_name, + 1, external_bridge_udp_discovery_packet__number_ranges, + (ProtobufCMessageInit) external_bridge_udp_discovery_packet__init, + NULL,NULL,NULL /* reserved[123] */ +}; diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Integration/ExternalBridgeUdpDiscoveryPacket.pb-c.h b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Integration/ExternalBridgeUdpDiscoveryPacket.pb-c.h new file mode 100644 index 000000000..f40ade127 --- /dev/null +++ b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Integration/ExternalBridgeUdpDiscoveryPacket.pb-c.h @@ -0,0 +1,71 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: ExternalBridgeUdpDiscoveryPacket.proto */ + +#ifndef PROTOBUF_C_ExternalBridgeUdpDiscoveryPacket_2eproto__INCLUDED +#define PROTOBUF_C_ExternalBridgeUdpDiscoveryPacket_2eproto__INCLUDED + +#include + +PROTOBUF_C__BEGIN_DECLS + +#if PROTOBUF_C_VERSION_NUMBER < 1003000 +# error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers. +#elif 1003000 < PROTOBUF_C_MIN_COMPILER_VERSION +# error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c. +#endif + + +typedef struct _ExternalBridgeUdpDiscoveryPacket ExternalBridgeUdpDiscoveryPacket; + + +/* --- enums --- */ + + +/* --- messages --- */ + +struct _ExternalBridgeUdpDiscoveryPacket +{ + ProtobufCMessage base; + char *serialnumber; +}; +#define EXTERNAL_BRIDGE_UDP_DISCOVERY_PACKET__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&external_bridge_udp_discovery_packet__descriptor) \ + , NULL } + + +/* ExternalBridgeUdpDiscoveryPacket methods */ +void external_bridge_udp_discovery_packet__init + (ExternalBridgeUdpDiscoveryPacket *message); +size_t external_bridge_udp_discovery_packet__get_packed_size + (const ExternalBridgeUdpDiscoveryPacket *message); +size_t external_bridge_udp_discovery_packet__pack + (const ExternalBridgeUdpDiscoveryPacket *message, + uint8_t *out); +size_t external_bridge_udp_discovery_packet__pack_to_buffer + (const ExternalBridgeUdpDiscoveryPacket *message, + ProtobufCBuffer *buffer); +ExternalBridgeUdpDiscoveryPacket * + external_bridge_udp_discovery_packet__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void external_bridge_udp_discovery_packet__free_unpacked + (ExternalBridgeUdpDiscoveryPacket *message, + ProtobufCAllocator *allocator); +/* --- per-message closures --- */ + +typedef void (*ExternalBridgeUdpDiscoveryPacket_Closure) + (const ExternalBridgeUdpDiscoveryPacket *message, + void *closure_data); + +/* --- services --- */ + + +/* --- descriptors --- */ + +extern const ProtobufCMessageDescriptor external_bridge_udp_discovery_packet__descriptor; + +PROTOBUF_C__END_DECLS + + +#endif /* PROTOBUF_C_ExternalBridgeUdpDiscoveryPacket_2eproto__INCLUDED */ diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Integration/ExternalClientLoginRequest.pb-c.c b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Integration/ExternalClientLoginRequest.pb-c.c new file mode 100644 index 000000000..a19339ec5 --- /dev/null +++ b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Integration/ExternalClientLoginRequest.pb-c.c @@ -0,0 +1,92 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: ExternalClientLoginRequest.proto */ + +/* Do not generate deprecated warnings for self */ +#ifndef PROTOBUF_C__NO_DEPRECATED +#define PROTOBUF_C__NO_DEPRECATED +#endif + +#include "ExternalClientLoginRequest.pb-c.h" +void external_client_login_request__init + (ExternalClientLoginRequest *message) +{ + static const ExternalClientLoginRequest init_value = EXTERNAL_CLIENT_LOGIN_REQUEST__INIT; + *message = init_value; +} +size_t external_client_login_request__get_packed_size + (const ExternalClientLoginRequest *message) +{ + assert(message->base.descriptor == &external_client_login_request__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t external_client_login_request__pack + (const ExternalClientLoginRequest *message, + uint8_t *out) +{ + assert(message->base.descriptor == &external_client_login_request__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t external_client_login_request__pack_to_buffer + (const ExternalClientLoginRequest *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &external_client_login_request__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +ExternalClientLoginRequest * + external_client_login_request__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (ExternalClientLoginRequest *) + protobuf_c_message_unpack (&external_client_login_request__descriptor, + allocator, len, data); +} +void external_client_login_request__free_unpacked + (ExternalClientLoginRequest *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &external_client_login_request__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +static const ProtobufCFieldDescriptor external_client_login_request__field_descriptors[1] = +{ + { + "key", + 1, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_STRING, + 0, /* quantifier_offset */ + offsetof(ExternalClientLoginRequest, key), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned external_client_login_request__field_indices_by_name[] = { + 0, /* field[0] = key */ +}; +static const ProtobufCIntRange external_client_login_request__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 1 } +}; +const ProtobufCMessageDescriptor external_client_login_request__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "ExternalClientLoginRequest", + "ExternalClientLoginRequest", + "ExternalClientLoginRequest", + "", + sizeof(ExternalClientLoginRequest), + 1, + external_client_login_request__field_descriptors, + external_client_login_request__field_indices_by_name, + 1, external_client_login_request__number_ranges, + (ProtobufCMessageInit) external_client_login_request__init, + NULL,NULL,NULL /* reserved[123] */ +}; diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Integration/ExternalClientLoginRequest.pb-c.h b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Integration/ExternalClientLoginRequest.pb-c.h new file mode 100644 index 000000000..b2ff576b0 --- /dev/null +++ b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Integration/ExternalClientLoginRequest.pb-c.h @@ -0,0 +1,71 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: ExternalClientLoginRequest.proto */ + +#ifndef PROTOBUF_C_ExternalClientLoginRequest_2eproto__INCLUDED +#define PROTOBUF_C_ExternalClientLoginRequest_2eproto__INCLUDED + +#include + +PROTOBUF_C__BEGIN_DECLS + +#if PROTOBUF_C_VERSION_NUMBER < 1003000 +# error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers. +#elif 1003000 < PROTOBUF_C_MIN_COMPILER_VERSION +# error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c. +#endif + + +typedef struct _ExternalClientLoginRequest ExternalClientLoginRequest; + + +/* --- enums --- */ + + +/* --- messages --- */ + +struct _ExternalClientLoginRequest +{ + ProtobufCMessage base; + char *key; +}; +#define EXTERNAL_CLIENT_LOGIN_REQUEST__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&external_client_login_request__descriptor) \ + , NULL } + + +/* ExternalClientLoginRequest methods */ +void external_client_login_request__init + (ExternalClientLoginRequest *message); +size_t external_client_login_request__get_packed_size + (const ExternalClientLoginRequest *message); +size_t external_client_login_request__pack + (const ExternalClientLoginRequest *message, + uint8_t *out); +size_t external_client_login_request__pack_to_buffer + (const ExternalClientLoginRequest *message, + ProtobufCBuffer *buffer); +ExternalClientLoginRequest * + external_client_login_request__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void external_client_login_request__free_unpacked + (ExternalClientLoginRequest *message, + ProtobufCAllocator *allocator); +/* --- per-message closures --- */ + +typedef void (*ExternalClientLoginRequest_Closure) + (const ExternalClientLoginRequest *message, + void *closure_data); + +/* --- services --- */ + + +/* --- descriptors --- */ + +extern const ProtobufCMessageDescriptor external_client_login_request__descriptor; + +PROTOBUF_C__END_DECLS + + +#endif /* PROTOBUF_C_ExternalClientLoginRequest_2eproto__INCLUDED */ diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Integration/ExternalClientLoginResponse.pb-c.c b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Integration/ExternalClientLoginResponse.pb-c.c new file mode 100644 index 000000000..6d8646415 --- /dev/null +++ b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Integration/ExternalClientLoginResponse.pb-c.c @@ -0,0 +1,105 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: ExternalClientLoginResponse.proto */ + +/* Do not generate deprecated warnings for self */ +#ifndef PROTOBUF_C__NO_DEPRECATED +#define PROTOBUF_C__NO_DEPRECATED +#endif + +#include "ExternalClientLoginResponse.pb-c.h" +void external_client_login_response__init + (ExternalClientLoginResponse *message) +{ + static const ExternalClientLoginResponse init_value = EXTERNAL_CLIENT_LOGIN_RESPONSE__INIT; + *message = init_value; +} +size_t external_client_login_response__get_packed_size + (const ExternalClientLoginResponse *message) +{ + assert(message->base.descriptor == &external_client_login_response__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t external_client_login_response__pack + (const ExternalClientLoginResponse *message, + uint8_t *out) +{ + assert(message->base.descriptor == &external_client_login_response__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t external_client_login_response__pack_to_buffer + (const ExternalClientLoginResponse *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &external_client_login_response__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +ExternalClientLoginResponse * + external_client_login_response__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (ExternalClientLoginResponse *) + protobuf_c_message_unpack (&external_client_login_response__descriptor, + allocator, len, data); +} +void external_client_login_response__free_unpacked + (ExternalClientLoginResponse *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &external_client_login_response__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +static const ProtobufCFieldDescriptor external_client_login_response__field_descriptors[2] = +{ + { + "Authenticated", + 1, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_BOOL, + offsetof(ExternalClientLoginResponse, has_authenticated), + offsetof(ExternalClientLoginResponse, authenticated), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "SerialNumber", + 2, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_STRING, + 0, /* quantifier_offset */ + offsetof(ExternalClientLoginResponse, serialnumber), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned external_client_login_response__field_indices_by_name[] = { + 0, /* field[0] = Authenticated */ + 1, /* field[1] = SerialNumber */ +}; +static const ProtobufCIntRange external_client_login_response__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 2 } +}; +const ProtobufCMessageDescriptor external_client_login_response__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "ExternalClientLoginResponse", + "ExternalClientLoginResponse", + "ExternalClientLoginResponse", + "", + sizeof(ExternalClientLoginResponse), + 2, + external_client_login_response__field_descriptors, + external_client_login_response__field_indices_by_name, + 1, external_client_login_response__number_ranges, + (ProtobufCMessageInit) external_client_login_response__init, + NULL,NULL,NULL /* reserved[123] */ +}; diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Integration/ExternalClientLoginResponse.pb-c.h b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Integration/ExternalClientLoginResponse.pb-c.h new file mode 100644 index 000000000..46bdf15df --- /dev/null +++ b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Integration/ExternalClientLoginResponse.pb-c.h @@ -0,0 +1,73 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: ExternalClientLoginResponse.proto */ + +#ifndef PROTOBUF_C_ExternalClientLoginResponse_2eproto__INCLUDED +#define PROTOBUF_C_ExternalClientLoginResponse_2eproto__INCLUDED + +#include + +PROTOBUF_C__BEGIN_DECLS + +#if PROTOBUF_C_VERSION_NUMBER < 1003000 +# error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers. +#elif 1003000 < PROTOBUF_C_MIN_COMPILER_VERSION +# error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c. +#endif + + +typedef struct _ExternalClientLoginResponse ExternalClientLoginResponse; + + +/* --- enums --- */ + + +/* --- messages --- */ + +struct _ExternalClientLoginResponse +{ + ProtobufCMessage base; + protobuf_c_boolean has_authenticated; + protobuf_c_boolean authenticated; + char *serialnumber; +}; +#define EXTERNAL_CLIENT_LOGIN_RESPONSE__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&external_client_login_response__descriptor) \ + , 0, 0, NULL } + + +/* ExternalClientLoginResponse methods */ +void external_client_login_response__init + (ExternalClientLoginResponse *message); +size_t external_client_login_response__get_packed_size + (const ExternalClientLoginResponse *message); +size_t external_client_login_response__pack + (const ExternalClientLoginResponse *message, + uint8_t *out); +size_t external_client_login_response__pack_to_buffer + (const ExternalClientLoginResponse *message, + ProtobufCBuffer *buffer); +ExternalClientLoginResponse * + external_client_login_response__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void external_client_login_response__free_unpacked + (ExternalClientLoginResponse *message, + ProtobufCAllocator *allocator); +/* --- per-message closures --- */ + +typedef void (*ExternalClientLoginResponse_Closure) + (const ExternalClientLoginResponse *message, + void *closure_data); + +/* --- services --- */ + + +/* --- descriptors --- */ + +extern const ProtobufCMessageDescriptor external_client_login_response__descriptor; + +PROTOBUF_C__END_DECLS + + +#endif /* PROTOBUF_C_ExternalClientLoginResponse_2eproto__INCLUDED */ diff --git a/Software/Visual_Studio/Native/Tango.ProtoTest/PMR/ExternalBridgeUdpDiscoveryPacket.pb.cc b/Software/Visual_Studio/Native/Tango.ProtoTest/PMR/ExternalBridgeUdpDiscoveryPacket.pb.cc new file mode 100644 index 000000000..450a9ed33 --- /dev/null +++ b/Software/Visual_Studio/Native/Tango.ProtoTest/PMR/ExternalBridgeUdpDiscoveryPacket.pb.cc @@ -0,0 +1,450 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: ExternalBridgeUdpDiscoveryPacket.proto + +#define INTERNAL_SUPPRESS_PROTOBUF_FIELD_DEPRECATION +#include "ExternalBridgeUdpDiscoveryPacket.pb.h" + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +// @@protoc_insertion_point(includes) + +namespace Tango { +namespace PMR { +namespace Integration { +class ExternalBridgeUdpDiscoveryPacketDefaultTypeInternal { +public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _ExternalBridgeUdpDiscoveryPacket_default_instance_; + +namespace protobuf_ExternalBridgeUdpDiscoveryPacket_2eproto { + + +namespace { + +::google::protobuf::Metadata file_level_metadata[1]; + +} // namespace + +PROTOBUF_CONSTEXPR_VAR ::google::protobuf::internal::ParseTableField + const TableStruct::entries[] GOOGLE_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + {0, 0, 0, ::google::protobuf::internal::kInvalidMask, 0, 0}, +}; + +PROTOBUF_CONSTEXPR_VAR ::google::protobuf::internal::AuxillaryParseTableField + const TableStruct::aux[] GOOGLE_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + ::google::protobuf::internal::AuxillaryParseTableField(), +}; +PROTOBUF_CONSTEXPR_VAR ::google::protobuf::internal::ParseTable const + TableStruct::schema[] GOOGLE_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + { NULL, NULL, 0, -1, -1, -1, -1, NULL, false }, +}; + +const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ExternalBridgeUdpDiscoveryPacket, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ExternalBridgeUdpDiscoveryPacket, serialnumber_), +}; +static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + { 0, -1, sizeof(ExternalBridgeUdpDiscoveryPacket)}, +}; + +static ::google::protobuf::Message const * const file_default_instances[] = { + reinterpret_cast(&_ExternalBridgeUdpDiscoveryPacket_default_instance_), +}; + +namespace { + +void protobuf_AssignDescriptors() { + AddDescriptors(); + ::google::protobuf::MessageFactory* factory = NULL; + AssignDescriptors( + "ExternalBridgeUdpDiscoveryPacket.proto", schemas, file_default_instances, TableStruct::offsets, factory, + file_level_metadata, NULL, NULL); +} + +void protobuf_AssignDescriptorsOnce() { + static GOOGLE_PROTOBUF_DECLARE_ONCE(once); + ::google::protobuf::GoogleOnceInit(&once, &protobuf_AssignDescriptors); +} + +void protobuf_RegisterTypes(const ::std::string&) GOOGLE_ATTRIBUTE_COLD; +void protobuf_RegisterTypes(const ::std::string&) { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 1); +} + +} // namespace +void TableStruct::InitDefaultsImpl() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + ::google::protobuf::internal::InitProtobufDefaults(); + _ExternalBridgeUdpDiscoveryPacket_default_instance_._instance.DefaultConstruct(); + ::google::protobuf::internal::OnShutdownDestroyMessage( + &_ExternalBridgeUdpDiscoveryPacket_default_instance_);} + +void InitDefaults() { + static GOOGLE_PROTOBUF_DECLARE_ONCE(once); + ::google::protobuf::GoogleOnceInit(&once, &TableStruct::InitDefaultsImpl); +} +namespace { +void AddDescriptorsImpl() { + InitDefaults(); + static const char descriptor[] GOOGLE_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + "\n&ExternalBridgeUdpDiscoveryPacket.proto" + "\022\025Tango.PMR.Integration\"8\n ExternalBridg" + "eUdpDiscoveryPacket\022\024\n\014SerialNumber\030\002 \001(" + "\tB!\n\037com.twine.tango.pmr.integrationb\006pr" + "oto3" + }; + ::google::protobuf::DescriptorPool::InternalAddGeneratedFile( + descriptor, 164); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile( + "ExternalBridgeUdpDiscoveryPacket.proto", &protobuf_RegisterTypes); +} +} // anonymous namespace + +void AddDescriptors() { + static GOOGLE_PROTOBUF_DECLARE_ONCE(once); + ::google::protobuf::GoogleOnceInit(&once, &AddDescriptorsImpl); +} +// Force AddDescriptors() to be called at dynamic initialization time. +struct StaticDescriptorInitializer { + StaticDescriptorInitializer() { + AddDescriptors(); + } +} static_descriptor_initializer; + +} // namespace protobuf_ExternalBridgeUdpDiscoveryPacket_2eproto + + +// =================================================================== + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int ExternalBridgeUdpDiscoveryPacket::kSerialNumberFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +ExternalBridgeUdpDiscoveryPacket::ExternalBridgeUdpDiscoveryPacket() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) { + protobuf_ExternalBridgeUdpDiscoveryPacket_2eproto::InitDefaults(); + } + SharedCtor(); + // @@protoc_insertion_point(constructor:Tango.PMR.Integration.ExternalBridgeUdpDiscoveryPacket) +} +ExternalBridgeUdpDiscoveryPacket::ExternalBridgeUdpDiscoveryPacket(const ExternalBridgeUdpDiscoveryPacket& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + _cached_size_(0) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + serialnumber_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.serialnumber().size() > 0) { + serialnumber_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.serialnumber_); + } + // @@protoc_insertion_point(copy_constructor:Tango.PMR.Integration.ExternalBridgeUdpDiscoveryPacket) +} + +void ExternalBridgeUdpDiscoveryPacket::SharedCtor() { + serialnumber_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + _cached_size_ = 0; +} + +ExternalBridgeUdpDiscoveryPacket::~ExternalBridgeUdpDiscoveryPacket() { + // @@protoc_insertion_point(destructor:Tango.PMR.Integration.ExternalBridgeUdpDiscoveryPacket) + SharedDtor(); +} + +void ExternalBridgeUdpDiscoveryPacket::SharedDtor() { + serialnumber_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +void ExternalBridgeUdpDiscoveryPacket::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* ExternalBridgeUdpDiscoveryPacket::descriptor() { + protobuf_ExternalBridgeUdpDiscoveryPacket_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_ExternalBridgeUdpDiscoveryPacket_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const ExternalBridgeUdpDiscoveryPacket& ExternalBridgeUdpDiscoveryPacket::default_instance() { + protobuf_ExternalBridgeUdpDiscoveryPacket_2eproto::InitDefaults(); + return *internal_default_instance(); +} + +ExternalBridgeUdpDiscoveryPacket* ExternalBridgeUdpDiscoveryPacket::New(::google::protobuf::Arena* arena) const { + ExternalBridgeUdpDiscoveryPacket* n = new ExternalBridgeUdpDiscoveryPacket; + if (arena != NULL) { + arena->Own(n); + } + return n; +} + +void ExternalBridgeUdpDiscoveryPacket::Clear() { +// @@protoc_insertion_point(message_clear_start:Tango.PMR.Integration.ExternalBridgeUdpDiscoveryPacket) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + serialnumber_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + _internal_metadata_.Clear(); +} + +bool ExternalBridgeUdpDiscoveryPacket::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:Tango.PMR.Integration.ExternalBridgeUdpDiscoveryPacket) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // string SerialNumber = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_serialnumber())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->serialnumber().data(), static_cast(this->serialnumber().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "Tango.PMR.Integration.ExternalBridgeUdpDiscoveryPacket.SerialNumber")); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:Tango.PMR.Integration.ExternalBridgeUdpDiscoveryPacket) + return true; +failure: + // @@protoc_insertion_point(parse_failure:Tango.PMR.Integration.ExternalBridgeUdpDiscoveryPacket) + return false; +#undef DO_ +} + +void ExternalBridgeUdpDiscoveryPacket::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:Tango.PMR.Integration.ExternalBridgeUdpDiscoveryPacket) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string SerialNumber = 2; + if (this->serialnumber().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->serialnumber().data(), static_cast(this->serialnumber().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "Tango.PMR.Integration.ExternalBridgeUdpDiscoveryPacket.SerialNumber"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 2, this->serialnumber(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:Tango.PMR.Integration.ExternalBridgeUdpDiscoveryPacket) +} + +::google::protobuf::uint8* ExternalBridgeUdpDiscoveryPacket::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:Tango.PMR.Integration.ExternalBridgeUdpDiscoveryPacket) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string SerialNumber = 2; + if (this->serialnumber().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->serialnumber().data(), static_cast(this->serialnumber().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "Tango.PMR.Integration.ExternalBridgeUdpDiscoveryPacket.SerialNumber"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 2, this->serialnumber(), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:Tango.PMR.Integration.ExternalBridgeUdpDiscoveryPacket) + return target; +} + +size_t ExternalBridgeUdpDiscoveryPacket::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:Tango.PMR.Integration.ExternalBridgeUdpDiscoveryPacket) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // string SerialNumber = 2; + if (this->serialnumber().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->serialnumber()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void ExternalBridgeUdpDiscoveryPacket::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:Tango.PMR.Integration.ExternalBridgeUdpDiscoveryPacket) + GOOGLE_DCHECK_NE(&from, this); + const ExternalBridgeUdpDiscoveryPacket* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:Tango.PMR.Integration.ExternalBridgeUdpDiscoveryPacket) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:Tango.PMR.Integration.ExternalBridgeUdpDiscoveryPacket) + MergeFrom(*source); + } +} + +void ExternalBridgeUdpDiscoveryPacket::MergeFrom(const ExternalBridgeUdpDiscoveryPacket& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:Tango.PMR.Integration.ExternalBridgeUdpDiscoveryPacket) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.serialnumber().size() > 0) { + + serialnumber_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.serialnumber_); + } +} + +void ExternalBridgeUdpDiscoveryPacket::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:Tango.PMR.Integration.ExternalBridgeUdpDiscoveryPacket) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void ExternalBridgeUdpDiscoveryPacket::CopyFrom(const ExternalBridgeUdpDiscoveryPacket& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:Tango.PMR.Integration.ExternalBridgeUdpDiscoveryPacket) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ExternalBridgeUdpDiscoveryPacket::IsInitialized() const { + return true; +} + +void ExternalBridgeUdpDiscoveryPacket::Swap(ExternalBridgeUdpDiscoveryPacket* other) { + if (other == this) return; + InternalSwap(other); +} +void ExternalBridgeUdpDiscoveryPacket::InternalSwap(ExternalBridgeUdpDiscoveryPacket* other) { + using std::swap; + serialnumber_.Swap(&other->serialnumber_); + _internal_metadata_.Swap(&other->_internal_metadata_); + swap(_cached_size_, other->_cached_size_); +} + +::google::protobuf::Metadata ExternalBridgeUdpDiscoveryPacket::GetMetadata() const { + protobuf_ExternalBridgeUdpDiscoveryPacket_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_ExternalBridgeUdpDiscoveryPacket_2eproto::file_level_metadata[kIndexInFileMessages]; +} + +#if PROTOBUF_INLINE_NOT_IN_HEADERS +// ExternalBridgeUdpDiscoveryPacket + +// string SerialNumber = 2; +void ExternalBridgeUdpDiscoveryPacket::clear_serialnumber() { + serialnumber_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +const ::std::string& ExternalBridgeUdpDiscoveryPacket::serialnumber() const { + // @@protoc_insertion_point(field_get:Tango.PMR.Integration.ExternalBridgeUdpDiscoveryPacket.SerialNumber) + return serialnumber_.GetNoArena(); +} +void ExternalBridgeUdpDiscoveryPacket::set_serialnumber(const ::std::string& value) { + + serialnumber_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:Tango.PMR.Integration.ExternalBridgeUdpDiscoveryPacket.SerialNumber) +} +#if LANG_CXX11 +void ExternalBridgeUdpDiscoveryPacket::set_serialnumber(::std::string&& value) { + + serialnumber_.SetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); + // @@protoc_insertion_point(field_set_rvalue:Tango.PMR.Integration.ExternalBridgeUdpDiscoveryPacket.SerialNumber) +} +#endif +void ExternalBridgeUdpDiscoveryPacket::set_serialnumber(const char* value) { + GOOGLE_DCHECK(value != NULL); + + serialnumber_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:Tango.PMR.Integration.ExternalBridgeUdpDiscoveryPacket.SerialNumber) +} +void ExternalBridgeUdpDiscoveryPacket::set_serialnumber(const char* value, size_t size) { + + serialnumber_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:Tango.PMR.Integration.ExternalBridgeUdpDiscoveryPacket.SerialNumber) +} +::std::string* ExternalBridgeUdpDiscoveryPacket::mutable_serialnumber() { + + // @@protoc_insertion_point(field_mutable:Tango.PMR.Integration.ExternalBridgeUdpDiscoveryPacket.SerialNumber) + return serialnumber_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +::std::string* ExternalBridgeUdpDiscoveryPacket::release_serialnumber() { + // @@protoc_insertion_point(field_release:Tango.PMR.Integration.ExternalBridgeUdpDiscoveryPacket.SerialNumber) + + return serialnumber_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +void ExternalBridgeUdpDiscoveryPacket::set_allocated_serialnumber(::std::string* serialnumber) { + if (serialnumber != NULL) { + + } else { + + } + serialnumber_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), serialnumber); + // @@protoc_insertion_point(field_set_allocated:Tango.PMR.Integration.ExternalBridgeUdpDiscoveryPacket.SerialNumber) +} + +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// @@protoc_insertion_point(namespace_scope) + +} // namespace Integration +} // namespace PMR +} // namespace Tango + +// @@protoc_insertion_point(global_scope) diff --git a/Software/Visual_Studio/Native/Tango.ProtoTest/PMR/ExternalBridgeUdpDiscoveryPacket.pb.h b/Software/Visual_Studio/Native/Tango.ProtoTest/PMR/ExternalBridgeUdpDiscoveryPacket.pb.h new file mode 100644 index 000000000..cfff09f49 --- /dev/null +++ b/Software/Visual_Studio/Native/Tango.ProtoTest/PMR/ExternalBridgeUdpDiscoveryPacket.pb.h @@ -0,0 +1,246 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: ExternalBridgeUdpDiscoveryPacket.proto + +#ifndef PROTOBUF_ExternalBridgeUdpDiscoveryPacket_2eproto__INCLUDED +#define PROTOBUF_ExternalBridgeUdpDiscoveryPacket_2eproto__INCLUDED + +#include + +#include + +#if GOOGLE_PROTOBUF_VERSION < 3004000 +#error This file was generated by a newer version of protoc which is +#error incompatible with your Protocol Buffer headers. Please update +#error your headers. +#endif +#if 3004000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION +#error This file was generated by an older version of protoc which is +#error incompatible with your Protocol Buffer headers. Please +#error regenerate this file with a newer version of protoc. +#endif + +#include +#include +#include +#include +#include +#include +#include +#include // IWYU pragma: export +#include // IWYU pragma: export +#include +// @@protoc_insertion_point(includes) +namespace Tango { +namespace PMR { +namespace Integration { +class ExternalBridgeUdpDiscoveryPacket; +class ExternalBridgeUdpDiscoveryPacketDefaultTypeInternal; +extern ExternalBridgeUdpDiscoveryPacketDefaultTypeInternal _ExternalBridgeUdpDiscoveryPacket_default_instance_; +} // namespace Integration +} // namespace PMR +} // namespace Tango + +namespace Tango { +namespace PMR { +namespace Integration { + +namespace protobuf_ExternalBridgeUdpDiscoveryPacket_2eproto { +// Internal implementation detail -- do not call these. +struct TableStruct { + static const ::google::protobuf::internal::ParseTableField entries[]; + static const ::google::protobuf::internal::AuxillaryParseTableField aux[]; + static const ::google::protobuf::internal::ParseTable schema[]; + static const ::google::protobuf::uint32 offsets[]; + static const ::google::protobuf::internal::FieldMetadata field_metadata[]; + static const ::google::protobuf::internal::SerializationTable serialization_table[]; + static void InitDefaultsImpl(); +}; +void AddDescriptors(); +void InitDefaults(); +} // namespace protobuf_ExternalBridgeUdpDiscoveryPacket_2eproto + +// =================================================================== + +class ExternalBridgeUdpDiscoveryPacket : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:Tango.PMR.Integration.ExternalBridgeUdpDiscoveryPacket) */ { + public: + ExternalBridgeUdpDiscoveryPacket(); + virtual ~ExternalBridgeUdpDiscoveryPacket(); + + ExternalBridgeUdpDiscoveryPacket(const ExternalBridgeUdpDiscoveryPacket& from); + + inline ExternalBridgeUdpDiscoveryPacket& operator=(const ExternalBridgeUdpDiscoveryPacket& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + ExternalBridgeUdpDiscoveryPacket(ExternalBridgeUdpDiscoveryPacket&& from) noexcept + : ExternalBridgeUdpDiscoveryPacket() { + *this = ::std::move(from); + } + + inline ExternalBridgeUdpDiscoveryPacket& operator=(ExternalBridgeUdpDiscoveryPacket&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + static const ::google::protobuf::Descriptor* descriptor(); + static const ExternalBridgeUdpDiscoveryPacket& default_instance(); + + static inline const ExternalBridgeUdpDiscoveryPacket* internal_default_instance() { + return reinterpret_cast( + &_ExternalBridgeUdpDiscoveryPacket_default_instance_); + } + static PROTOBUF_CONSTEXPR int const kIndexInFileMessages = + 0; + + void Swap(ExternalBridgeUdpDiscoveryPacket* other); + friend void swap(ExternalBridgeUdpDiscoveryPacket& a, ExternalBridgeUdpDiscoveryPacket& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline ExternalBridgeUdpDiscoveryPacket* New() const PROTOBUF_FINAL { return New(NULL); } + + ExternalBridgeUdpDiscoveryPacket* New(::google::protobuf::Arena* arena) const PROTOBUF_FINAL; + void CopyFrom(const ::google::protobuf::Message& from) PROTOBUF_FINAL; + void MergeFrom(const ::google::protobuf::Message& from) PROTOBUF_FINAL; + void CopyFrom(const ExternalBridgeUdpDiscoveryPacket& from); + void MergeFrom(const ExternalBridgeUdpDiscoveryPacket& from); + void Clear() PROTOBUF_FINAL; + bool IsInitialized() const PROTOBUF_FINAL; + + size_t ByteSizeLong() const PROTOBUF_FINAL; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) PROTOBUF_FINAL; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const PROTOBUF_FINAL; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const PROTOBUF_FINAL; + int GetCachedSize() const PROTOBUF_FINAL { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const PROTOBUF_FINAL; + void InternalSwap(ExternalBridgeUdpDiscoveryPacket* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return NULL; + } + inline void* MaybeArenaPtr() const { + return NULL; + } + public: + + ::google::protobuf::Metadata GetMetadata() const PROTOBUF_FINAL; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // string SerialNumber = 2; + void clear_serialnumber(); + static const int kSerialNumberFieldNumber = 2; + const ::std::string& serialnumber() const; + void set_serialnumber(const ::std::string& value); + #if LANG_CXX11 + void set_serialnumber(::std::string&& value); + #endif + void set_serialnumber(const char* value); + void set_serialnumber(const char* value, size_t size); + ::std::string* mutable_serialnumber(); + ::std::string* release_serialnumber(); + void set_allocated_serialnumber(::std::string* serialnumber); + + // @@protoc_insertion_point(class_scope:Tango.PMR.Integration.ExternalBridgeUdpDiscoveryPacket) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::internal::ArenaStringPtr serialnumber_; + mutable int _cached_size_; + friend struct protobuf_ExternalBridgeUdpDiscoveryPacket_2eproto::TableStruct; +}; +// =================================================================== + + +// =================================================================== + +#if !PROTOBUF_INLINE_NOT_IN_HEADERS +#ifdef __GNUC__ + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wstrict-aliasing" +#endif // __GNUC__ +// ExternalBridgeUdpDiscoveryPacket + +// string SerialNumber = 2; +inline void ExternalBridgeUdpDiscoveryPacket::clear_serialnumber() { + serialnumber_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline const ::std::string& ExternalBridgeUdpDiscoveryPacket::serialnumber() const { + // @@protoc_insertion_point(field_get:Tango.PMR.Integration.ExternalBridgeUdpDiscoveryPacket.SerialNumber) + return serialnumber_.GetNoArena(); +} +inline void ExternalBridgeUdpDiscoveryPacket::set_serialnumber(const ::std::string& value) { + + serialnumber_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:Tango.PMR.Integration.ExternalBridgeUdpDiscoveryPacket.SerialNumber) +} +#if LANG_CXX11 +inline void ExternalBridgeUdpDiscoveryPacket::set_serialnumber(::std::string&& value) { + + serialnumber_.SetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); + // @@protoc_insertion_point(field_set_rvalue:Tango.PMR.Integration.ExternalBridgeUdpDiscoveryPacket.SerialNumber) +} +#endif +inline void ExternalBridgeUdpDiscoveryPacket::set_serialnumber(const char* value) { + GOOGLE_DCHECK(value != NULL); + + serialnumber_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:Tango.PMR.Integration.ExternalBridgeUdpDiscoveryPacket.SerialNumber) +} +inline void ExternalBridgeUdpDiscoveryPacket::set_serialnumber(const char* value, size_t size) { + + serialnumber_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:Tango.PMR.Integration.ExternalBridgeUdpDiscoveryPacket.SerialNumber) +} +inline ::std::string* ExternalBridgeUdpDiscoveryPacket::mutable_serialnumber() { + + // @@protoc_insertion_point(field_mutable:Tango.PMR.Integration.ExternalBridgeUdpDiscoveryPacket.SerialNumber) + return serialnumber_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* ExternalBridgeUdpDiscoveryPacket::release_serialnumber() { + // @@protoc_insertion_point(field_release:Tango.PMR.Integration.ExternalBridgeUdpDiscoveryPacket.SerialNumber) + + return serialnumber_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void ExternalBridgeUdpDiscoveryPacket::set_allocated_serialnumber(::std::string* serialnumber) { + if (serialnumber != NULL) { + + } else { + + } + serialnumber_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), serialnumber); + // @@protoc_insertion_point(field_set_allocated:Tango.PMR.Integration.ExternalBridgeUdpDiscoveryPacket.SerialNumber) +} + +#ifdef __GNUC__ + #pragma GCC diagnostic pop +#endif // __GNUC__ +#endif // !PROTOBUF_INLINE_NOT_IN_HEADERS + +// @@protoc_insertion_point(namespace_scope) + + +} // namespace Integration +} // namespace PMR +} // namespace Tango + +// @@protoc_insertion_point(global_scope) + +#endif // PROTOBUF_ExternalBridgeUdpDiscoveryPacket_2eproto__INCLUDED diff --git a/Software/Visual_Studio/Native/Tango.ProtoTest/PMR/ExternalClientLoginRequest.pb.cc b/Software/Visual_Studio/Native/Tango.ProtoTest/PMR/ExternalClientLoginRequest.pb.cc new file mode 100644 index 000000000..be8799e3c --- /dev/null +++ b/Software/Visual_Studio/Native/Tango.ProtoTest/PMR/ExternalClientLoginRequest.pb.cc @@ -0,0 +1,449 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: ExternalClientLoginRequest.proto + +#define INTERNAL_SUPPRESS_PROTOBUF_FIELD_DEPRECATION +#include "ExternalClientLoginRequest.pb.h" + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +// @@protoc_insertion_point(includes) + +namespace Tango { +namespace PMR { +namespace Integration { +class ExternalClientLoginRequestDefaultTypeInternal { +public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _ExternalClientLoginRequest_default_instance_; + +namespace protobuf_ExternalClientLoginRequest_2eproto { + + +namespace { + +::google::protobuf::Metadata file_level_metadata[1]; + +} // namespace + +PROTOBUF_CONSTEXPR_VAR ::google::protobuf::internal::ParseTableField + const TableStruct::entries[] GOOGLE_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + {0, 0, 0, ::google::protobuf::internal::kInvalidMask, 0, 0}, +}; + +PROTOBUF_CONSTEXPR_VAR ::google::protobuf::internal::AuxillaryParseTableField + const TableStruct::aux[] GOOGLE_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + ::google::protobuf::internal::AuxillaryParseTableField(), +}; +PROTOBUF_CONSTEXPR_VAR ::google::protobuf::internal::ParseTable const + TableStruct::schema[] GOOGLE_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + { NULL, NULL, 0, -1, -1, -1, -1, NULL, false }, +}; + +const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ExternalClientLoginRequest, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ExternalClientLoginRequest, key_), +}; +static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + { 0, -1, sizeof(ExternalClientLoginRequest)}, +}; + +static ::google::protobuf::Message const * const file_default_instances[] = { + reinterpret_cast(&_ExternalClientLoginRequest_default_instance_), +}; + +namespace { + +void protobuf_AssignDescriptors() { + AddDescriptors(); + ::google::protobuf::MessageFactory* factory = NULL; + AssignDescriptors( + "ExternalClientLoginRequest.proto", schemas, file_default_instances, TableStruct::offsets, factory, + file_level_metadata, NULL, NULL); +} + +void protobuf_AssignDescriptorsOnce() { + static GOOGLE_PROTOBUF_DECLARE_ONCE(once); + ::google::protobuf::GoogleOnceInit(&once, &protobuf_AssignDescriptors); +} + +void protobuf_RegisterTypes(const ::std::string&) GOOGLE_ATTRIBUTE_COLD; +void protobuf_RegisterTypes(const ::std::string&) { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 1); +} + +} // namespace +void TableStruct::InitDefaultsImpl() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + ::google::protobuf::internal::InitProtobufDefaults(); + _ExternalClientLoginRequest_default_instance_._instance.DefaultConstruct(); + ::google::protobuf::internal::OnShutdownDestroyMessage( + &_ExternalClientLoginRequest_default_instance_);} + +void InitDefaults() { + static GOOGLE_PROTOBUF_DECLARE_ONCE(once); + ::google::protobuf::GoogleOnceInit(&once, &TableStruct::InitDefaultsImpl); +} +namespace { +void AddDescriptorsImpl() { + InitDefaults(); + static const char descriptor[] GOOGLE_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + "\n ExternalClientLoginRequest.proto\022\025Tang" + "o.PMR.Integration\")\n\032ExternalClientLogin" + "Request\022\013\n\003key\030\001 \001(\tB!\n\037com.twine.tango." + "pmr.integrationb\006proto3" + }; + ::google::protobuf::DescriptorPool::InternalAddGeneratedFile( + descriptor, 143); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile( + "ExternalClientLoginRequest.proto", &protobuf_RegisterTypes); +} +} // anonymous namespace + +void AddDescriptors() { + static GOOGLE_PROTOBUF_DECLARE_ONCE(once); + ::google::protobuf::GoogleOnceInit(&once, &AddDescriptorsImpl); +} +// Force AddDescriptors() to be called at dynamic initialization time. +struct StaticDescriptorInitializer { + StaticDescriptorInitializer() { + AddDescriptors(); + } +} static_descriptor_initializer; + +} // namespace protobuf_ExternalClientLoginRequest_2eproto + + +// =================================================================== + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int ExternalClientLoginRequest::kKeyFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +ExternalClientLoginRequest::ExternalClientLoginRequest() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) { + protobuf_ExternalClientLoginRequest_2eproto::InitDefaults(); + } + SharedCtor(); + // @@protoc_insertion_point(constructor:Tango.PMR.Integration.ExternalClientLoginRequest) +} +ExternalClientLoginRequest::ExternalClientLoginRequest(const ExternalClientLoginRequest& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + _cached_size_(0) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + key_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.key().size() > 0) { + key_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.key_); + } + // @@protoc_insertion_point(copy_constructor:Tango.PMR.Integration.ExternalClientLoginRequest) +} + +void ExternalClientLoginRequest::SharedCtor() { + key_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + _cached_size_ = 0; +} + +ExternalClientLoginRequest::~ExternalClientLoginRequest() { + // @@protoc_insertion_point(destructor:Tango.PMR.Integration.ExternalClientLoginRequest) + SharedDtor(); +} + +void ExternalClientLoginRequest::SharedDtor() { + key_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +void ExternalClientLoginRequest::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* ExternalClientLoginRequest::descriptor() { + protobuf_ExternalClientLoginRequest_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_ExternalClientLoginRequest_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const ExternalClientLoginRequest& ExternalClientLoginRequest::default_instance() { + protobuf_ExternalClientLoginRequest_2eproto::InitDefaults(); + return *internal_default_instance(); +} + +ExternalClientLoginRequest* ExternalClientLoginRequest::New(::google::protobuf::Arena* arena) const { + ExternalClientLoginRequest* n = new ExternalClientLoginRequest; + if (arena != NULL) { + arena->Own(n); + } + return n; +} + +void ExternalClientLoginRequest::Clear() { +// @@protoc_insertion_point(message_clear_start:Tango.PMR.Integration.ExternalClientLoginRequest) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + key_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + _internal_metadata_.Clear(); +} + +bool ExternalClientLoginRequest::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:Tango.PMR.Integration.ExternalClientLoginRequest) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // string key = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_key())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->key().data(), static_cast(this->key().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "Tango.PMR.Integration.ExternalClientLoginRequest.key")); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:Tango.PMR.Integration.ExternalClientLoginRequest) + return true; +failure: + // @@protoc_insertion_point(parse_failure:Tango.PMR.Integration.ExternalClientLoginRequest) + return false; +#undef DO_ +} + +void ExternalClientLoginRequest::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:Tango.PMR.Integration.ExternalClientLoginRequest) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string key = 1; + if (this->key().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->key().data(), static_cast(this->key().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "Tango.PMR.Integration.ExternalClientLoginRequest.key"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->key(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:Tango.PMR.Integration.ExternalClientLoginRequest) +} + +::google::protobuf::uint8* ExternalClientLoginRequest::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:Tango.PMR.Integration.ExternalClientLoginRequest) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string key = 1; + if (this->key().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->key().data(), static_cast(this->key().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "Tango.PMR.Integration.ExternalClientLoginRequest.key"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 1, this->key(), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:Tango.PMR.Integration.ExternalClientLoginRequest) + return target; +} + +size_t ExternalClientLoginRequest::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:Tango.PMR.Integration.ExternalClientLoginRequest) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // string key = 1; + if (this->key().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->key()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void ExternalClientLoginRequest::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:Tango.PMR.Integration.ExternalClientLoginRequest) + GOOGLE_DCHECK_NE(&from, this); + const ExternalClientLoginRequest* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:Tango.PMR.Integration.ExternalClientLoginRequest) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:Tango.PMR.Integration.ExternalClientLoginRequest) + MergeFrom(*source); + } +} + +void ExternalClientLoginRequest::MergeFrom(const ExternalClientLoginRequest& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:Tango.PMR.Integration.ExternalClientLoginRequest) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.key().size() > 0) { + + key_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.key_); + } +} + +void ExternalClientLoginRequest::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:Tango.PMR.Integration.ExternalClientLoginRequest) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void ExternalClientLoginRequest::CopyFrom(const ExternalClientLoginRequest& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:Tango.PMR.Integration.ExternalClientLoginRequest) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ExternalClientLoginRequest::IsInitialized() const { + return true; +} + +void ExternalClientLoginRequest::Swap(ExternalClientLoginRequest* other) { + if (other == this) return; + InternalSwap(other); +} +void ExternalClientLoginRequest::InternalSwap(ExternalClientLoginRequest* other) { + using std::swap; + key_.Swap(&other->key_); + _internal_metadata_.Swap(&other->_internal_metadata_); + swap(_cached_size_, other->_cached_size_); +} + +::google::protobuf::Metadata ExternalClientLoginRequest::GetMetadata() const { + protobuf_ExternalClientLoginRequest_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_ExternalClientLoginRequest_2eproto::file_level_metadata[kIndexInFileMessages]; +} + +#if PROTOBUF_INLINE_NOT_IN_HEADERS +// ExternalClientLoginRequest + +// string key = 1; +void ExternalClientLoginRequest::clear_key() { + key_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +const ::std::string& ExternalClientLoginRequest::key() const { + // @@protoc_insertion_point(field_get:Tango.PMR.Integration.ExternalClientLoginRequest.key) + return key_.GetNoArena(); +} +void ExternalClientLoginRequest::set_key(const ::std::string& value) { + + key_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:Tango.PMR.Integration.ExternalClientLoginRequest.key) +} +#if LANG_CXX11 +void ExternalClientLoginRequest::set_key(::std::string&& value) { + + key_.SetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); + // @@protoc_insertion_point(field_set_rvalue:Tango.PMR.Integration.ExternalClientLoginRequest.key) +} +#endif +void ExternalClientLoginRequest::set_key(const char* value) { + GOOGLE_DCHECK(value != NULL); + + key_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:Tango.PMR.Integration.ExternalClientLoginRequest.key) +} +void ExternalClientLoginRequest::set_key(const char* value, size_t size) { + + key_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:Tango.PMR.Integration.ExternalClientLoginRequest.key) +} +::std::string* ExternalClientLoginRequest::mutable_key() { + + // @@protoc_insertion_point(field_mutable:Tango.PMR.Integration.ExternalClientLoginRequest.key) + return key_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +::std::string* ExternalClientLoginRequest::release_key() { + // @@protoc_insertion_point(field_release:Tango.PMR.Integration.ExternalClientLoginRequest.key) + + return key_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +void ExternalClientLoginRequest::set_allocated_key(::std::string* key) { + if (key != NULL) { + + } else { + + } + key_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), key); + // @@protoc_insertion_point(field_set_allocated:Tango.PMR.Integration.ExternalClientLoginRequest.key) +} + +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// @@protoc_insertion_point(namespace_scope) + +} // namespace Integration +} // namespace PMR +} // namespace Tango + +// @@protoc_insertion_point(global_scope) diff --git a/Software/Visual_Studio/Native/Tango.ProtoTest/PMR/ExternalClientLoginRequest.pb.h b/Software/Visual_Studio/Native/Tango.ProtoTest/PMR/ExternalClientLoginRequest.pb.h new file mode 100644 index 000000000..05bcbd561 --- /dev/null +++ b/Software/Visual_Studio/Native/Tango.ProtoTest/PMR/ExternalClientLoginRequest.pb.h @@ -0,0 +1,246 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: ExternalClientLoginRequest.proto + +#ifndef PROTOBUF_ExternalClientLoginRequest_2eproto__INCLUDED +#define PROTOBUF_ExternalClientLoginRequest_2eproto__INCLUDED + +#include + +#include + +#if GOOGLE_PROTOBUF_VERSION < 3004000 +#error This file was generated by a newer version of protoc which is +#error incompatible with your Protocol Buffer headers. Please update +#error your headers. +#endif +#if 3004000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION +#error This file was generated by an older version of protoc which is +#error incompatible with your Protocol Buffer headers. Please +#error regenerate this file with a newer version of protoc. +#endif + +#include +#include +#include +#include +#include +#include +#include +#include // IWYU pragma: export +#include // IWYU pragma: export +#include +// @@protoc_insertion_point(includes) +namespace Tango { +namespace PMR { +namespace Integration { +class ExternalClientLoginRequest; +class ExternalClientLoginRequestDefaultTypeInternal; +extern ExternalClientLoginRequestDefaultTypeInternal _ExternalClientLoginRequest_default_instance_; +} // namespace Integration +} // namespace PMR +} // namespace Tango + +namespace Tango { +namespace PMR { +namespace Integration { + +namespace protobuf_ExternalClientLoginRequest_2eproto { +// Internal implementation detail -- do not call these. +struct TableStruct { + static const ::google::protobuf::internal::ParseTableField entries[]; + static const ::google::protobuf::internal::AuxillaryParseTableField aux[]; + static const ::google::protobuf::internal::ParseTable schema[]; + static const ::google::protobuf::uint32 offsets[]; + static const ::google::protobuf::internal::FieldMetadata field_metadata[]; + static const ::google::protobuf::internal::SerializationTable serialization_table[]; + static void InitDefaultsImpl(); +}; +void AddDescriptors(); +void InitDefaults(); +} // namespace protobuf_ExternalClientLoginRequest_2eproto + +// =================================================================== + +class ExternalClientLoginRequest : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:Tango.PMR.Integration.ExternalClientLoginRequest) */ { + public: + ExternalClientLoginRequest(); + virtual ~ExternalClientLoginRequest(); + + ExternalClientLoginRequest(const ExternalClientLoginRequest& from); + + inline ExternalClientLoginRequest& operator=(const ExternalClientLoginRequest& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + ExternalClientLoginRequest(ExternalClientLoginRequest&& from) noexcept + : ExternalClientLoginRequest() { + *this = ::std::move(from); + } + + inline ExternalClientLoginRequest& operator=(ExternalClientLoginRequest&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + static const ::google::protobuf::Descriptor* descriptor(); + static const ExternalClientLoginRequest& default_instance(); + + static inline const ExternalClientLoginRequest* internal_default_instance() { + return reinterpret_cast( + &_ExternalClientLoginRequest_default_instance_); + } + static PROTOBUF_CONSTEXPR int const kIndexInFileMessages = + 0; + + void Swap(ExternalClientLoginRequest* other); + friend void swap(ExternalClientLoginRequest& a, ExternalClientLoginRequest& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline ExternalClientLoginRequest* New() const PROTOBUF_FINAL { return New(NULL); } + + ExternalClientLoginRequest* New(::google::protobuf::Arena* arena) const PROTOBUF_FINAL; + void CopyFrom(const ::google::protobuf::Message& from) PROTOBUF_FINAL; + void MergeFrom(const ::google::protobuf::Message& from) PROTOBUF_FINAL; + void CopyFrom(const ExternalClientLoginRequest& from); + void MergeFrom(const ExternalClientLoginRequest& from); + void Clear() PROTOBUF_FINAL; + bool IsInitialized() const PROTOBUF_FINAL; + + size_t ByteSizeLong() const PROTOBUF_FINAL; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) PROTOBUF_FINAL; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const PROTOBUF_FINAL; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const PROTOBUF_FINAL; + int GetCachedSize() const PROTOBUF_FINAL { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const PROTOBUF_FINAL; + void InternalSwap(ExternalClientLoginRequest* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return NULL; + } + inline void* MaybeArenaPtr() const { + return NULL; + } + public: + + ::google::protobuf::Metadata GetMetadata() const PROTOBUF_FINAL; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // string key = 1; + void clear_key(); + static const int kKeyFieldNumber = 1; + const ::std::string& key() const; + void set_key(const ::std::string& value); + #if LANG_CXX11 + void set_key(::std::string&& value); + #endif + void set_key(const char* value); + void set_key(const char* value, size_t size); + ::std::string* mutable_key(); + ::std::string* release_key(); + void set_allocated_key(::std::string* key); + + // @@protoc_insertion_point(class_scope:Tango.PMR.Integration.ExternalClientLoginRequest) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::internal::ArenaStringPtr key_; + mutable int _cached_size_; + friend struct protobuf_ExternalClientLoginRequest_2eproto::TableStruct; +}; +// =================================================================== + + +// =================================================================== + +#if !PROTOBUF_INLINE_NOT_IN_HEADERS +#ifdef __GNUC__ + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wstrict-aliasing" +#endif // __GNUC__ +// ExternalClientLoginRequest + +// string key = 1; +inline void ExternalClientLoginRequest::clear_key() { + key_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline const ::std::string& ExternalClientLoginRequest::key() const { + // @@protoc_insertion_point(field_get:Tango.PMR.Integration.ExternalClientLoginRequest.key) + return key_.GetNoArena(); +} +inline void ExternalClientLoginRequest::set_key(const ::std::string& value) { + + key_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:Tango.PMR.Integration.ExternalClientLoginRequest.key) +} +#if LANG_CXX11 +inline void ExternalClientLoginRequest::set_key(::std::string&& value) { + + key_.SetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); + // @@protoc_insertion_point(field_set_rvalue:Tango.PMR.Integration.ExternalClientLoginRequest.key) +} +#endif +inline void ExternalClientLoginRequest::set_key(const char* value) { + GOOGLE_DCHECK(value != NULL); + + key_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:Tango.PMR.Integration.ExternalClientLoginRequest.key) +} +inline void ExternalClientLoginRequest::set_key(const char* value, size_t size) { + + key_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:Tango.PMR.Integration.ExternalClientLoginRequest.key) +} +inline ::std::string* ExternalClientLoginRequest::mutable_key() { + + // @@protoc_insertion_point(field_mutable:Tango.PMR.Integration.ExternalClientLoginRequest.key) + return key_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* ExternalClientLoginRequest::release_key() { + // @@protoc_insertion_point(field_release:Tango.PMR.Integration.ExternalClientLoginRequest.key) + + return key_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void ExternalClientLoginRequest::set_allocated_key(::std::string* key) { + if (key != NULL) { + + } else { + + } + key_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), key); + // @@protoc_insertion_point(field_set_allocated:Tango.PMR.Integration.ExternalClientLoginRequest.key) +} + +#ifdef __GNUC__ + #pragma GCC diagnostic pop +#endif // __GNUC__ +#endif // !PROTOBUF_INLINE_NOT_IN_HEADERS + +// @@protoc_insertion_point(namespace_scope) + + +} // namespace Integration +} // namespace PMR +} // namespace Tango + +// @@protoc_insertion_point(global_scope) + +#endif // PROTOBUF_ExternalClientLoginRequest_2eproto__INCLUDED diff --git a/Software/Visual_Studio/Native/Tango.ProtoTest/PMR/ExternalClientLoginResponse.pb.cc b/Software/Visual_Studio/Native/Tango.ProtoTest/PMR/ExternalClientLoginResponse.pb.cc new file mode 100644 index 000000000..2d75ea534 --- /dev/null +++ b/Software/Visual_Studio/Native/Tango.ProtoTest/PMR/ExternalClientLoginResponse.pb.cc @@ -0,0 +1,502 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: ExternalClientLoginResponse.proto + +#define INTERNAL_SUPPRESS_PROTOBUF_FIELD_DEPRECATION +#include "ExternalClientLoginResponse.pb.h" + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +// @@protoc_insertion_point(includes) + +namespace Tango { +namespace PMR { +namespace Integration { +class ExternalClientLoginResponseDefaultTypeInternal { +public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _ExternalClientLoginResponse_default_instance_; + +namespace protobuf_ExternalClientLoginResponse_2eproto { + + +namespace { + +::google::protobuf::Metadata file_level_metadata[1]; + +} // namespace + +PROTOBUF_CONSTEXPR_VAR ::google::protobuf::internal::ParseTableField + const TableStruct::entries[] GOOGLE_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + {0, 0, 0, ::google::protobuf::internal::kInvalidMask, 0, 0}, +}; + +PROTOBUF_CONSTEXPR_VAR ::google::protobuf::internal::AuxillaryParseTableField + const TableStruct::aux[] GOOGLE_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + ::google::protobuf::internal::AuxillaryParseTableField(), +}; +PROTOBUF_CONSTEXPR_VAR ::google::protobuf::internal::ParseTable const + TableStruct::schema[] GOOGLE_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + { NULL, NULL, 0, -1, -1, -1, -1, NULL, false }, +}; + +const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ExternalClientLoginResponse, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ExternalClientLoginResponse, authenticated_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ExternalClientLoginResponse, serialnumber_), +}; +static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + { 0, -1, sizeof(ExternalClientLoginResponse)}, +}; + +static ::google::protobuf::Message const * const file_default_instances[] = { + reinterpret_cast(&_ExternalClientLoginResponse_default_instance_), +}; + +namespace { + +void protobuf_AssignDescriptors() { + AddDescriptors(); + ::google::protobuf::MessageFactory* factory = NULL; + AssignDescriptors( + "ExternalClientLoginResponse.proto", schemas, file_default_instances, TableStruct::offsets, factory, + file_level_metadata, NULL, NULL); +} + +void protobuf_AssignDescriptorsOnce() { + static GOOGLE_PROTOBUF_DECLARE_ONCE(once); + ::google::protobuf::GoogleOnceInit(&once, &protobuf_AssignDescriptors); +} + +void protobuf_RegisterTypes(const ::std::string&) GOOGLE_ATTRIBUTE_COLD; +void protobuf_RegisterTypes(const ::std::string&) { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 1); +} + +} // namespace +void TableStruct::InitDefaultsImpl() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + ::google::protobuf::internal::InitProtobufDefaults(); + _ExternalClientLoginResponse_default_instance_._instance.DefaultConstruct(); + ::google::protobuf::internal::OnShutdownDestroyMessage( + &_ExternalClientLoginResponse_default_instance_);} + +void InitDefaults() { + static GOOGLE_PROTOBUF_DECLARE_ONCE(once); + ::google::protobuf::GoogleOnceInit(&once, &TableStruct::InitDefaultsImpl); +} +namespace { +void AddDescriptorsImpl() { + InitDefaults(); + static const char descriptor[] GOOGLE_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + "\n!ExternalClientLoginResponse.proto\022\025Tan" + "go.PMR.Integration\"J\n\033ExternalClientLogi" + "nResponse\022\025\n\rAuthenticated\030\001 \001(\010\022\024\n\014Seri" + "alNumber\030\002 \001(\tB!\n\037com.twine.tango.pmr.in" + "tegrationb\006proto3" + }; + ::google::protobuf::DescriptorPool::InternalAddGeneratedFile( + descriptor, 177); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile( + "ExternalClientLoginResponse.proto", &protobuf_RegisterTypes); +} +} // anonymous namespace + +void AddDescriptors() { + static GOOGLE_PROTOBUF_DECLARE_ONCE(once); + ::google::protobuf::GoogleOnceInit(&once, &AddDescriptorsImpl); +} +// Force AddDescriptors() to be called at dynamic initialization time. +struct StaticDescriptorInitializer { + StaticDescriptorInitializer() { + AddDescriptors(); + } +} static_descriptor_initializer; + +} // namespace protobuf_ExternalClientLoginResponse_2eproto + + +// =================================================================== + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int ExternalClientLoginResponse::kAuthenticatedFieldNumber; +const int ExternalClientLoginResponse::kSerialNumberFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +ExternalClientLoginResponse::ExternalClientLoginResponse() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) { + protobuf_ExternalClientLoginResponse_2eproto::InitDefaults(); + } + SharedCtor(); + // @@protoc_insertion_point(constructor:Tango.PMR.Integration.ExternalClientLoginResponse) +} +ExternalClientLoginResponse::ExternalClientLoginResponse(const ExternalClientLoginResponse& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + _cached_size_(0) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + serialnumber_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.serialnumber().size() > 0) { + serialnumber_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.serialnumber_); + } + authenticated_ = from.authenticated_; + // @@protoc_insertion_point(copy_constructor:Tango.PMR.Integration.ExternalClientLoginResponse) +} + +void ExternalClientLoginResponse::SharedCtor() { + serialnumber_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + authenticated_ = false; + _cached_size_ = 0; +} + +ExternalClientLoginResponse::~ExternalClientLoginResponse() { + // @@protoc_insertion_point(destructor:Tango.PMR.Integration.ExternalClientLoginResponse) + SharedDtor(); +} + +void ExternalClientLoginResponse::SharedDtor() { + serialnumber_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +void ExternalClientLoginResponse::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* ExternalClientLoginResponse::descriptor() { + protobuf_ExternalClientLoginResponse_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_ExternalClientLoginResponse_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const ExternalClientLoginResponse& ExternalClientLoginResponse::default_instance() { + protobuf_ExternalClientLoginResponse_2eproto::InitDefaults(); + return *internal_default_instance(); +} + +ExternalClientLoginResponse* ExternalClientLoginResponse::New(::google::protobuf::Arena* arena) const { + ExternalClientLoginResponse* n = new ExternalClientLoginResponse; + if (arena != NULL) { + arena->Own(n); + } + return n; +} + +void ExternalClientLoginResponse::Clear() { +// @@protoc_insertion_point(message_clear_start:Tango.PMR.Integration.ExternalClientLoginResponse) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + serialnumber_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + authenticated_ = false; + _internal_metadata_.Clear(); +} + +bool ExternalClientLoginResponse::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:Tango.PMR.Integration.ExternalClientLoginResponse) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // bool Authenticated = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &authenticated_))); + } else { + goto handle_unusual; + } + break; + } + + // string SerialNumber = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_serialnumber())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->serialnumber().data(), static_cast(this->serialnumber().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "Tango.PMR.Integration.ExternalClientLoginResponse.SerialNumber")); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:Tango.PMR.Integration.ExternalClientLoginResponse) + return true; +failure: + // @@protoc_insertion_point(parse_failure:Tango.PMR.Integration.ExternalClientLoginResponse) + return false; +#undef DO_ +} + +void ExternalClientLoginResponse::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:Tango.PMR.Integration.ExternalClientLoginResponse) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // bool Authenticated = 1; + if (this->authenticated() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteBool(1, this->authenticated(), output); + } + + // string SerialNumber = 2; + if (this->serialnumber().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->serialnumber().data(), static_cast(this->serialnumber().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "Tango.PMR.Integration.ExternalClientLoginResponse.SerialNumber"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 2, this->serialnumber(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:Tango.PMR.Integration.ExternalClientLoginResponse) +} + +::google::protobuf::uint8* ExternalClientLoginResponse::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:Tango.PMR.Integration.ExternalClientLoginResponse) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // bool Authenticated = 1; + if (this->authenticated() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(1, this->authenticated(), target); + } + + // string SerialNumber = 2; + if (this->serialnumber().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->serialnumber().data(), static_cast(this->serialnumber().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "Tango.PMR.Integration.ExternalClientLoginResponse.SerialNumber"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 2, this->serialnumber(), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:Tango.PMR.Integration.ExternalClientLoginResponse) + return target; +} + +size_t ExternalClientLoginResponse::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:Tango.PMR.Integration.ExternalClientLoginResponse) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // string SerialNumber = 2; + if (this->serialnumber().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->serialnumber()); + } + + // bool Authenticated = 1; + if (this->authenticated() != 0) { + total_size += 1 + 1; + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void ExternalClientLoginResponse::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:Tango.PMR.Integration.ExternalClientLoginResponse) + GOOGLE_DCHECK_NE(&from, this); + const ExternalClientLoginResponse* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:Tango.PMR.Integration.ExternalClientLoginResponse) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:Tango.PMR.Integration.ExternalClientLoginResponse) + MergeFrom(*source); + } +} + +void ExternalClientLoginResponse::MergeFrom(const ExternalClientLoginResponse& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:Tango.PMR.Integration.ExternalClientLoginResponse) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.serialnumber().size() > 0) { + + serialnumber_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.serialnumber_); + } + if (from.authenticated() != 0) { + set_authenticated(from.authenticated()); + } +} + +void ExternalClientLoginResponse::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:Tango.PMR.Integration.ExternalClientLoginResponse) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void ExternalClientLoginResponse::CopyFrom(const ExternalClientLoginResponse& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:Tango.PMR.Integration.ExternalClientLoginResponse) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ExternalClientLoginResponse::IsInitialized() const { + return true; +} + +void ExternalClientLoginResponse::Swap(ExternalClientLoginResponse* other) { + if (other == this) return; + InternalSwap(other); +} +void ExternalClientLoginResponse::InternalSwap(ExternalClientLoginResponse* other) { + using std::swap; + serialnumber_.Swap(&other->serialnumber_); + swap(authenticated_, other->authenticated_); + _internal_metadata_.Swap(&other->_internal_metadata_); + swap(_cached_size_, other->_cached_size_); +} + +::google::protobuf::Metadata ExternalClientLoginResponse::GetMetadata() const { + protobuf_ExternalClientLoginResponse_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_ExternalClientLoginResponse_2eproto::file_level_metadata[kIndexInFileMessages]; +} + +#if PROTOBUF_INLINE_NOT_IN_HEADERS +// ExternalClientLoginResponse + +// bool Authenticated = 1; +void ExternalClientLoginResponse::clear_authenticated() { + authenticated_ = false; +} +bool ExternalClientLoginResponse::authenticated() const { + // @@protoc_insertion_point(field_get:Tango.PMR.Integration.ExternalClientLoginResponse.Authenticated) + return authenticated_; +} +void ExternalClientLoginResponse::set_authenticated(bool value) { + + authenticated_ = value; + // @@protoc_insertion_point(field_set:Tango.PMR.Integration.ExternalClientLoginResponse.Authenticated) +} + +// string SerialNumber = 2; +void ExternalClientLoginResponse::clear_serialnumber() { + serialnumber_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +const ::std::string& ExternalClientLoginResponse::serialnumber() const { + // @@protoc_insertion_point(field_get:Tango.PMR.Integration.ExternalClientLoginResponse.SerialNumber) + return serialnumber_.GetNoArena(); +} +void ExternalClientLoginResponse::set_serialnumber(const ::std::string& value) { + + serialnumber_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:Tango.PMR.Integration.ExternalClientLoginResponse.SerialNumber) +} +#if LANG_CXX11 +void ExternalClientLoginResponse::set_serialnumber(::std::string&& value) { + + serialnumber_.SetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); + // @@protoc_insertion_point(field_set_rvalue:Tango.PMR.Integration.ExternalClientLoginResponse.SerialNumber) +} +#endif +void ExternalClientLoginResponse::set_serialnumber(const char* value) { + GOOGLE_DCHECK(value != NULL); + + serialnumber_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:Tango.PMR.Integration.ExternalClientLoginResponse.SerialNumber) +} +void ExternalClientLoginResponse::set_serialnumber(const char* value, size_t size) { + + serialnumber_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:Tango.PMR.Integration.ExternalClientLoginResponse.SerialNumber) +} +::std::string* ExternalClientLoginResponse::mutable_serialnumber() { + + // @@protoc_insertion_point(field_mutable:Tango.PMR.Integration.ExternalClientLoginResponse.SerialNumber) + return serialnumber_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +::std::string* ExternalClientLoginResponse::release_serialnumber() { + // @@protoc_insertion_point(field_release:Tango.PMR.Integration.ExternalClientLoginResponse.SerialNumber) + + return serialnumber_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +void ExternalClientLoginResponse::set_allocated_serialnumber(::std::string* serialnumber) { + if (serialnumber != NULL) { + + } else { + + } + serialnumber_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), serialnumber); + // @@protoc_insertion_point(field_set_allocated:Tango.PMR.Integration.ExternalClientLoginResponse.SerialNumber) +} + +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// @@protoc_insertion_point(namespace_scope) + +} // namespace Integration +} // namespace PMR +} // namespace Tango + +// @@protoc_insertion_point(global_scope) diff --git a/Software/Visual_Studio/Native/Tango.ProtoTest/PMR/ExternalClientLoginResponse.pb.h b/Software/Visual_Studio/Native/Tango.ProtoTest/PMR/ExternalClientLoginResponse.pb.h new file mode 100644 index 000000000..92e83ff41 --- /dev/null +++ b/Software/Visual_Studio/Native/Tango.ProtoTest/PMR/ExternalClientLoginResponse.pb.h @@ -0,0 +1,267 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: ExternalClientLoginResponse.proto + +#ifndef PROTOBUF_ExternalClientLoginResponse_2eproto__INCLUDED +#define PROTOBUF_ExternalClientLoginResponse_2eproto__INCLUDED + +#include + +#include + +#if GOOGLE_PROTOBUF_VERSION < 3004000 +#error This file was generated by a newer version of protoc which is +#error incompatible with your Protocol Buffer headers. Please update +#error your headers. +#endif +#if 3004000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION +#error This file was generated by an older version of protoc which is +#error incompatible with your Protocol Buffer headers. Please +#error regenerate this file with a newer version of protoc. +#endif + +#include +#include +#include +#include +#include +#include +#include +#include // IWYU pragma: export +#include // IWYU pragma: export +#include +// @@protoc_insertion_point(includes) +namespace Tango { +namespace PMR { +namespace Integration { +class ExternalClientLoginResponse; +class ExternalClientLoginResponseDefaultTypeInternal; +extern ExternalClientLoginResponseDefaultTypeInternal _ExternalClientLoginResponse_default_instance_; +} // namespace Integration +} // namespace PMR +} // namespace Tango + +namespace Tango { +namespace PMR { +namespace Integration { + +namespace protobuf_ExternalClientLoginResponse_2eproto { +// Internal implementation detail -- do not call these. +struct TableStruct { + static const ::google::protobuf::internal::ParseTableField entries[]; + static const ::google::protobuf::internal::AuxillaryParseTableField aux[]; + static const ::google::protobuf::internal::ParseTable schema[]; + static const ::google::protobuf::uint32 offsets[]; + static const ::google::protobuf::internal::FieldMetadata field_metadata[]; + static const ::google::protobuf::internal::SerializationTable serialization_table[]; + static void InitDefaultsImpl(); +}; +void AddDescriptors(); +void InitDefaults(); +} // namespace protobuf_ExternalClientLoginResponse_2eproto + +// =================================================================== + +class ExternalClientLoginResponse : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:Tango.PMR.Integration.ExternalClientLoginResponse) */ { + public: + ExternalClientLoginResponse(); + virtual ~ExternalClientLoginResponse(); + + ExternalClientLoginResponse(const ExternalClientLoginResponse& from); + + inline ExternalClientLoginResponse& operator=(const ExternalClientLoginResponse& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + ExternalClientLoginResponse(ExternalClientLoginResponse&& from) noexcept + : ExternalClientLoginResponse() { + *this = ::std::move(from); + } + + inline ExternalClientLoginResponse& operator=(ExternalClientLoginResponse&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + static const ::google::protobuf::Descriptor* descriptor(); + static const ExternalClientLoginResponse& default_instance(); + + static inline const ExternalClientLoginResponse* internal_default_instance() { + return reinterpret_cast( + &_ExternalClientLoginResponse_default_instance_); + } + static PROTOBUF_CONSTEXPR int const kIndexInFileMessages = + 0; + + void Swap(ExternalClientLoginResponse* other); + friend void swap(ExternalClientLoginResponse& a, ExternalClientLoginResponse& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline ExternalClientLoginResponse* New() const PROTOBUF_FINAL { return New(NULL); } + + ExternalClientLoginResponse* New(::google::protobuf::Arena* arena) const PROTOBUF_FINAL; + void CopyFrom(const ::google::protobuf::Message& from) PROTOBUF_FINAL; + void MergeFrom(const ::google::protobuf::Message& from) PROTOBUF_FINAL; + void CopyFrom(const ExternalClientLoginResponse& from); + void MergeFrom(const ExternalClientLoginResponse& from); + void Clear() PROTOBUF_FINAL; + bool IsInitialized() const PROTOBUF_FINAL; + + size_t ByteSizeLong() const PROTOBUF_FINAL; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) PROTOBUF_FINAL; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const PROTOBUF_FINAL; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const PROTOBUF_FINAL; + int GetCachedSize() const PROTOBUF_FINAL { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const PROTOBUF_FINAL; + void InternalSwap(ExternalClientLoginResponse* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return NULL; + } + inline void* MaybeArenaPtr() const { + return NULL; + } + public: + + ::google::protobuf::Metadata GetMetadata() const PROTOBUF_FINAL; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // string SerialNumber = 2; + void clear_serialnumber(); + static const int kSerialNumberFieldNumber = 2; + const ::std::string& serialnumber() const; + void set_serialnumber(const ::std::string& value); + #if LANG_CXX11 + void set_serialnumber(::std::string&& value); + #endif + void set_serialnumber(const char* value); + void set_serialnumber(const char* value, size_t size); + ::std::string* mutable_serialnumber(); + ::std::string* release_serialnumber(); + void set_allocated_serialnumber(::std::string* serialnumber); + + // bool Authenticated = 1; + void clear_authenticated(); + static const int kAuthenticatedFieldNumber = 1; + bool authenticated() const; + void set_authenticated(bool value); + + // @@protoc_insertion_point(class_scope:Tango.PMR.Integration.ExternalClientLoginResponse) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::internal::ArenaStringPtr serialnumber_; + bool authenticated_; + mutable int _cached_size_; + friend struct protobuf_ExternalClientLoginResponse_2eproto::TableStruct; +}; +// =================================================================== + + +// =================================================================== + +#if !PROTOBUF_INLINE_NOT_IN_HEADERS +#ifdef __GNUC__ + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wstrict-aliasing" +#endif // __GNUC__ +// ExternalClientLoginResponse + +// bool Authenticated = 1; +inline void ExternalClientLoginResponse::clear_authenticated() { + authenticated_ = false; +} +inline bool ExternalClientLoginResponse::authenticated() const { + // @@protoc_insertion_point(field_get:Tango.PMR.Integration.ExternalClientLoginResponse.Authenticated) + return authenticated_; +} +inline void ExternalClientLoginResponse::set_authenticated(bool value) { + + authenticated_ = value; + // @@protoc_insertion_point(field_set:Tango.PMR.Integration.ExternalClientLoginResponse.Authenticated) +} + +// string SerialNumber = 2; +inline void ExternalClientLoginResponse::clear_serialnumber() { + serialnumber_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline const ::std::string& ExternalClientLoginResponse::serialnumber() const { + // @@protoc_insertion_point(field_get:Tango.PMR.Integration.ExternalClientLoginResponse.SerialNumber) + return serialnumber_.GetNoArena(); +} +inline void ExternalClientLoginResponse::set_serialnumber(const ::std::string& value) { + + serialnumber_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:Tango.PMR.Integration.ExternalClientLoginResponse.SerialNumber) +} +#if LANG_CXX11 +inline void ExternalClientLoginResponse::set_serialnumber(::std::string&& value) { + + serialnumber_.SetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); + // @@protoc_insertion_point(field_set_rvalue:Tango.PMR.Integration.ExternalClientLoginResponse.SerialNumber) +} +#endif +inline void ExternalClientLoginResponse::set_serialnumber(const char* value) { + GOOGLE_DCHECK(value != NULL); + + serialnumber_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:Tango.PMR.Integration.ExternalClientLoginResponse.SerialNumber) +} +inline void ExternalClientLoginResponse::set_serialnumber(const char* value, size_t size) { + + serialnumber_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:Tango.PMR.Integration.ExternalClientLoginResponse.SerialNumber) +} +inline ::std::string* ExternalClientLoginResponse::mutable_serialnumber() { + + // @@protoc_insertion_point(field_mutable:Tango.PMR.Integration.ExternalClientLoginResponse.SerialNumber) + return serialnumber_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* ExternalClientLoginResponse::release_serialnumber() { + // @@protoc_insertion_point(field_release:Tango.PMR.Integration.ExternalClientLoginResponse.SerialNumber) + + return serialnumber_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void ExternalClientLoginResponse::set_allocated_serialnumber(::std::string* serialnumber) { + if (serialnumber != NULL) { + + } else { + + } + serialnumber_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), serialnumber); + // @@protoc_insertion_point(field_set_allocated:Tango.PMR.Integration.ExternalClientLoginResponse.SerialNumber) +} + +#ifdef __GNUC__ + #pragma GCC diagnostic pop +#endif // __GNUC__ +#endif // !PROTOBUF_INLINE_NOT_IN_HEADERS + +// @@protoc_insertion_point(namespace_scope) + + +} // namespace Integration +} // namespace PMR +} // namespace Tango + +// @@protoc_insertion_point(global_scope) + +#endif // PROTOBUF_ExternalClientLoginResponse_2eproto__INCLUDED diff --git a/Software/Visual_Studio/Native/Tango.ProtoTest/PMR/MessageType.pb.cc b/Software/Visual_Studio/Native/Tango.ProtoTest/PMR/MessageType.pb.cc index 5b1090c5d..0118af70a 100644 --- a/Software/Visual_Studio/Native/Tango.ProtoTest/PMR/MessageType.pb.cc +++ b/Software/Visual_Studio/Native/Tango.ProtoTest/PMR/MessageType.pb.cc @@ -82,7 +82,7 @@ namespace { void AddDescriptorsImpl() { InitDefaults(); static const char descriptor[] GOOGLE_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { - "\n\021MessageType.proto\022\020Tango.PMR.Common*\357\006" + "\n\021MessageType.proto\022\020Tango.PMR.Common*\326\007" "\n\013MessageType\022\007\n\003RGB\020\000\022\007\n\003Job\020\001\022\013\n\007Segme" "nt\020\002\022\024\n\020CalculateRequest\020\003\022\025\n\021CalculateR" "esponse\020\004\022\023\n\017ProgressRequest\020\005\022\024\n\020Progre" @@ -104,11 +104,14 @@ void AddDescriptorsImpl() { "ubOptLimitSwitchRequest\020\033\022\036\n\032StubOptLimi" "tSwitchResponse\020\034\022\032\n\026StubSteperMotorRequ" "est\020\035\022\033\n\027StubSteperMotorResponse\020\036\022\024\n\020St" - "ubValveRequest\020\037\022\025\n\021StubValveResponse\020 B" - "\034\n\032com.twine.tango.pmr.commonb\006proto3" + "ubValveRequest\020\037\022\025\n\021StubValveResponse\020 \022" + "$\n ExternalBridgeUdpDiscoveryPacket\020!\022\036\n" + "\032ExternalClientLoginRequest\020\"\022\037\n\033Externa" + "lClientLoginResponse\020#B\034\n\032com.twine.tang" + "o.pmr.commonb\006proto3" }; ::google::protobuf::DescriptorPool::InternalAddGeneratedFile( - descriptor, 957); + descriptor, 1060); ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile( "MessageType.proto", &protobuf_RegisterTypes); } @@ -166,6 +169,9 @@ bool MessageType_IsValid(int value) { case 30: case 31: case 32: + case 33: + case 34: + case 35: return true; default: return false; diff --git a/Software/Visual_Studio/Native/Tango.ProtoTest/PMR/MessageType.pb.h b/Software/Visual_Studio/Native/Tango.ProtoTest/PMR/MessageType.pb.h index e0db308a8..15fef05c0 100644 --- a/Software/Visual_Studio/Native/Tango.ProtoTest/PMR/MessageType.pb.h +++ b/Software/Visual_Studio/Native/Tango.ProtoTest/PMR/MessageType.pb.h @@ -89,12 +89,15 @@ enum MessageType { StubSteperMotorResponse = 30, StubValveRequest = 31, StubValveResponse = 32, + ExternalBridgeUdpDiscoveryPacket = 33, + ExternalClientLoginRequest = 34, + ExternalClientLoginResponse = 35, MessageType_INT_MIN_SENTINEL_DO_NOT_USE_ = ::google::protobuf::kint32min, MessageType_INT_MAX_SENTINEL_DO_NOT_USE_ = ::google::protobuf::kint32max }; bool MessageType_IsValid(int value); const MessageType MessageType_MIN = RGB; -const MessageType MessageType_MAX = StubValveResponse; +const MessageType MessageType_MAX = ExternalClientLoginResponse; const int MessageType_ARRAYSIZE = MessageType_MAX + 1; const ::google::protobuf::EnumDescriptor* MessageType_descriptor(); diff --git a/Software/Visual_Studio/Tango.Integration/Services/ExternalBridgeClient.cs b/Software/Visual_Studio/Tango.Integration/Services/ExternalBridgeClient.cs index 1cbb6982a..47e30f46f 100644 --- a/Software/Visual_Studio/Tango.Integration/Services/ExternalBridgeClient.cs +++ b/Software/Visual_Studio/Tango.Integration/Services/ExternalBridgeClient.cs @@ -56,7 +56,7 @@ namespace Tango.Integration.Services public async Task Authenticate() { var response = await SendRequest(new ExternalClientLoginRequest() { Key = "1234" }); - return response.Authenticated; + return response.Message.Authenticated; } public ExternalBridgeClient(String serialNumber,String ipAddress) diff --git a/Software/Visual_Studio/Tango.PMR/MessageFactory.cs b/Software/Visual_Studio/Tango.PMR/MessageFactory.cs index 61afa1f2f..bf0074211 100644 --- a/Software/Visual_Studio/Tango.PMR/MessageFactory.cs +++ b/Software/Visual_Studio/Tango.PMR/MessageFactory.cs @@ -2,6 +2,7 @@ using System; using System.Collections.Generic; using System.Linq; +using System.Reflection; using System.Text; using System.Threading.Tasks; using Tango.PMR.Common; @@ -74,6 +75,13 @@ namespace Tango.PMR return tango; } + public static Object ParseTangoMessageAgnostic(byte[] data) + { + MessageContainer container = MessageContainer.Parser.ParseFrom(data); + IMessage message = ParseMessageFromContainer(container); + return typeof(MessageFactory).GetMethod("ParseTangoMessage",BindingFlags.Public | BindingFlags.Static).MakeGenericMethod(message.GetType()).Invoke(null, new[] { data }); + } + /// /// Parses the specified bytes to . /// diff --git a/Software/Visual_Studio/Tango.Stubs/Stubs/Calculate.cs b/Software/Visual_Studio/Tango.Stubs/Stubs/Calculate.cs index e1bea5454..6afedde96 100644 --- a/Software/Visual_Studio/Tango.Stubs/Stubs/Calculate.cs +++ b/Software/Visual_Studio/Tango.Stubs/Stubs/Calculate.cs @@ -34,7 +34,7 @@ namespace Tango.Stubs.Stubs } ); - return response.Sum.ToString(); + return response.Message.Sum.ToString(); } } } diff --git a/Software/Visual_Studio/Tango.Stubs/Stubs/Progress.cs b/Software/Visual_Studio/Tango.Stubs/Stubs/Progress.cs index dc03f538e..cd13a84ff 100644 --- a/Software/Visual_Studio/Tango.Stubs/Stubs/Progress.cs +++ b/Software/Visual_Studio/Tango.Stubs/Stubs/Progress.cs @@ -34,7 +34,7 @@ namespace Tango.Stubs.Stubs Delay = (int)Delay, }), (response) => { - multiResponseCallback(response.Progress.ToString()); + multiResponseCallback(response.Message.Progress.ToString()); }); return Task.FromResult(""); diff --git a/Software/Visual_Studio/Tango.Transport/ITransporter.cs b/Software/Visual_Studio/Tango.Transport/ITransporter.cs index 9127d0138..d805afa2b 100644 --- a/Software/Visual_Studio/Tango.Transport/ITransporter.cs +++ b/Software/Visual_Studio/Tango.Transport/ITransporter.cs @@ -31,7 +31,7 @@ namespace Tango.Transport /// The type of the response. /// The request. /// - Task SendRequest(TangoMessage request) where Request : IMessage where Response : IMessage; + Task> SendRequest(TangoMessage request) where Request : IMessage where Response : IMessage; /// /// Sends a request through the specified adapter. @@ -41,7 +41,7 @@ namespace Tango.Transport /// The request. /// Transport adapter /// - Task SendRequest(TangoMessage request, ITransportAdapter adapter) where Request : IMessage where Response : IMessage; + Task> SendRequest(TangoMessage request, ITransportAdapter adapter) where Request : IMessage where Response : IMessage; /// /// Sends a request through all adapters which is expected to return multiple response messages. @@ -52,7 +52,7 @@ namespace Tango.Transport /// Transport adapter /// The response callback delegate. /// - void SendContinuousRequest(TangoMessage request, Action responseCallback) where Request : IMessage where Response : IMessage; + void SendContinuousRequest(TangoMessage request, Action> responseCallback) where Request : IMessage where Response : IMessage; /// /// Sends a request through the specified adapter which is expected to return multiple response messages. @@ -63,7 +63,7 @@ namespace Tango.Transport /// Transport adapter /// The response callback delegate. /// - void SendContinuousRequest(TangoMessage request, ITransportAdapter adapter, Action responseCallback) where Request : IMessage where Response : IMessage; + void SendContinuousRequest(TangoMessage request, ITransportAdapter adapter, Action> responseCallback) where Request : IMessage where Response : IMessage; /// /// Sends a response. diff --git a/Software/Visual_Studio/Tango.Transport/TransporterBase.cs b/Software/Visual_Studio/Tango.Transport/TransporterBase.cs index aeda918fa..ec53d0fc6 100644 --- a/Software/Visual_Studio/Tango.Transport/TransporterBase.cs +++ b/Software/Visual_Studio/Tango.Transport/TransporterBase.cs @@ -202,6 +202,16 @@ namespace Tango.Transport return MessageFactory.ParseMessageFromContainer(container); } + /// + /// Called when [parse tango message]. + /// + /// The bytes. + /// + protected virtual Object OnParseTangoMessage(byte[] bytes) + { + return MessageFactory.ParseTangoMessageAgnostic(bytes); + } + #endregion #region Constructors @@ -263,7 +273,7 @@ namespace Tango.Transport /// The type of the response. /// The request. /// - public Task SendRequest(TangoMessage request) where Request : IMessage where Response : IMessage + public Task> SendRequest(TangoMessage request) where Request : IMessage where Response : IMessage { return SendRequest(request, null); } @@ -276,13 +286,13 @@ namespace Tango.Transport /// The request. /// Transport adapter /// - public Task SendRequest(TangoMessage request, ITransportAdapter adapter) where Request : IMessage where Response : IMessage + public Task> SendRequest(TangoMessage request, ITransportAdapter adapter) where Request : IMessage where Response : IMessage { LogManager.Log("Queuing request message: " + typeof(Request).Name + " Token: " + request.Container.Token + " on adapter: " + (adapter != null ? adapter.Address : "ALL")); LogManager.Log("Expected response: " + typeof(Response).Name); - TaskCompletionSource source = new TaskCompletionSource(); - TransportMessage message = new TransportMessage(adapter, request.Container.Token, request, TransportMessageDirection.Request, OnSerializeingMessage(request), source); + TaskCompletionSource> source = new TaskCompletionSource>(); + TransportMessage> message = new TransportMessage>(adapter, request.Container.Token, request, TransportMessageDirection.Request, OnSerializeingMessage(request), source); _sendingQueue.Enqueue(message); Task.Delay(RequestTimeout).ContinueWith((x) => { @@ -303,7 +313,7 @@ namespace Tango.Transport /// The type of the response. /// The request. /// The response callback delegate. - public void SendContinuousRequest(TangoMessage request, Action responseCallback) where Request : IMessage where Response : IMessage + public void SendContinuousRequest(TangoMessage request, Action> responseCallback) where Request : IMessage where Response : IMessage { SendContinuousRequest(request, null, responseCallback); } @@ -316,7 +326,7 @@ namespace Tango.Transport /// The request. /// Transport adapter /// The response callback delegate. - public void SendContinuousRequest(TangoMessage request, ITransportAdapter adapter, Action responseCallback) where Request : IMessage where Response : IMessage + public void SendContinuousRequest(TangoMessage request, ITransportAdapter adapter, Action> responseCallback) where Request : IMessage where Response : IMessage { LogManager.Log("Queuing continuous request message: " + typeof(Request).Name + " on adapter: " + (adapter != null ? adapter.Address : "ALL")); LogManager.Log("Expected response: " + typeof(Response).Name); @@ -324,7 +334,7 @@ namespace Tango.Transport request.Container.Continuous = true; request.Container.Completed = false; - TransportMessage message = new TransportMessage(adapter, request.Container.Token, request, TransportMessageDirection.Request, OnSerializeingMessage(request), null) + TransportMessage> message = new TransportMessage>(adapter, request.Container.Token, request, TransportMessageDirection.Request, OnSerializeingMessage(request), null) { IsContinuous = true, ResponseCallback = responseCallback, @@ -508,7 +518,7 @@ namespace Tango.Transport try { LogManager.Log("Parsing inner response message and setting pending request task result..."); - request.SetResult(OnParseMessage(container), true); + request.SetResult(OnParseTangoMessage(data.Value), true); } catch (Exception ex) { @@ -526,7 +536,7 @@ namespace Tango.Transport { LogManager.Log("Continuous sequence completed."); } - request.InvokeResponseCallback(OnParseMessage(container), container.Completed); + request.InvokeResponseCallback(OnParseTangoMessage(data.Value), container.Completed); } catch (Exception ex) { diff --git a/Software/Visual_Studio/Tango.sln b/Software/Visual_Studio/Tango.sln index f64a4cf59..2360fb7f5 100644 --- a/Software/Visual_Studio/Tango.sln +++ b/Software/Visual_Studio/Tango.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 15 -VisualStudioVersion = 15.0.26430.14 +VisualStudioVersion = 15.0.26430.16 MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tango.Protobuf", "Tango.Protobuf\Tango.Protobuf.csproj", "{40073806-914E-4E78-97AB-FA9639308EBE}" EndProject @@ -363,7 +363,6 @@ Global {35397DDA-DDC7-46BE-A802-3B722B6858E9}.Debug|x64.ActiveCfg = Debug|x64 {35397DDA-DDC7-46BE-A802-3B722B6858E9}.Debug|x64.Build.0 = Debug|x64 {35397DDA-DDC7-46BE-A802-3B722B6858E9}.Debug|x86.ActiveCfg = Debug|Win32 - {35397DDA-DDC7-46BE-A802-3B722B6858E9}.Debug|x86.Build.0 = Debug|Win32 {35397DDA-DDC7-46BE-A802-3B722B6858E9}.Release|Any CPU.ActiveCfg = Release|Win32 {35397DDA-DDC7-46BE-A802-3B722B6858E9}.Release|ARM.ActiveCfg = Release|Win32 {35397DDA-DDC7-46BE-A802-3B722B6858E9}.Release|ARM64.ActiveCfg = Release|Win32 @@ -835,7 +834,6 @@ Global {625B2A26-97A9-45C9-8BCF-6BD30F593E17}.Debug|x64.ActiveCfg = Debug|x64 {625B2A26-97A9-45C9-8BCF-6BD30F593E17}.Debug|x64.Build.0 = Debug|x64 {625B2A26-97A9-45C9-8BCF-6BD30F593E17}.Debug|x86.ActiveCfg = Debug|Win32 - {625B2A26-97A9-45C9-8BCF-6BD30F593E17}.Debug|x86.Build.0 = Debug|Win32 {625B2A26-97A9-45C9-8BCF-6BD30F593E17}.Release|Any CPU.ActiveCfg = Release|Win32 {625B2A26-97A9-45C9-8BCF-6BD30F593E17}.Release|ARM.ActiveCfg = Release|Win32 {625B2A26-97A9-45C9-8BCF-6BD30F593E17}.Release|ARM64.ActiveCfg = Release|Win32 diff --git a/Software/Visual_Studio/Utilities/Tango.MobileEM.UI/App.xaml.cs b/Software/Visual_Studio/Utilities/Tango.MobileEM.UI/App.xaml.cs index 577dd41b4..fc953a2fa 100644 --- a/Software/Visual_Studio/Utilities/Tango.MobileEM.UI/App.xaml.cs +++ b/Software/Visual_Studio/Utilities/Tango.MobileEM.UI/App.xaml.cs @@ -21,7 +21,7 @@ namespace Tango.MobileEM.UI protected override void OnStartup(StartupEventArgs e) { base.OnStartup(e); - Emulator = new MobileEmulator(new ProtoTransporter(new UsbTransportAdapter("COM9"))); + Emulator = new MobileEmulator(new ProtoTransporter(new TcpTransportAdapter("127.0.0.1",9999))); } } } diff --git a/Software/Visual_Studio/Web/Tango.MachineService/App_Data/Tango.db b/Software/Visual_Studio/Web/Tango.MachineService/App_Data/Tango.db index 00c79da9c..0419b065c 100644 Binary files a/Software/Visual_Studio/Web/Tango.MachineService/App_Data/Tango.db and b/Software/Visual_Studio/Web/Tango.MachineService/App_Data/Tango.db differ -- cgit v1.3.1