From 5f8a6184e8c0b6de2e61fd9845378eb4324c50a6 Mon Sep 17 00:00:00 2001 From: Roy Date: Mon, 6 Feb 2023 19:47:59 +0200 Subject: Machine Type Connection, Discovery Handling. --- .../Visual_Studio/Tango.PMR/Common/MachineType.cs | 45 ++++++++++++++++++++++ .../Tango.PMR/Connection/ConnectRequest.cs | 42 +++++++++++++++++--- .../ExternalBridgeUdpDiscoveryPacket.cs | 41 +++++++++++++++++--- Software/Visual_Studio/Tango.PMR/Tango.PMR.csproj | 3 +- 4 files changed, 118 insertions(+), 13 deletions(-) create mode 100644 Software/Visual_Studio/Tango.PMR/Common/MachineType.cs (limited to 'Software/Visual_Studio/Tango.PMR') diff --git a/Software/Visual_Studio/Tango.PMR/Common/MachineType.cs b/Software/Visual_Studio/Tango.PMR/Common/MachineType.cs new file mode 100644 index 000000000..4ef97d168 --- /dev/null +++ b/Software/Visual_Studio/Tango.PMR/Common/MachineType.cs @@ -0,0 +1,45 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: MachineType.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.Common { + + /// Holder for reflection information generated from MachineType.proto + public static partial class MachineTypeReflection { + + #region Descriptor + /// File descriptor for MachineType.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static MachineTypeReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "ChFNYWNoaW5lVHlwZS5wcm90bxIQVGFuZ28uUE1SLkNvbW1vbiolCgtNYWNo", + "aW5lVHlwZRIKCgZUUzE4MDAQABIKCgZFdXJla2EQAUIcChpjb20udHdpbmUu", + "dGFuZ28ucG1yLmNvbW1vbmIGcHJvdG8z")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { }, + new pbr::GeneratedClrTypeInfo(new[] {typeof(global::Tango.PMR.Common.MachineType), }, null)); + } + #endregion + + } + #region Enums + public enum MachineType { + [pbr::OriginalName("TS1800")] Ts1800 = 0, + [pbr::OriginalName("Eureka")] Eureka = 1, + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Software/Visual_Studio/Tango.PMR/Connection/ConnectRequest.cs b/Software/Visual_Studio/Tango.PMR/Connection/ConnectRequest.cs index 0edef7665..d62d5dbc5 100644 --- a/Software/Visual_Studio/Tango.PMR/Connection/ConnectRequest.cs +++ b/Software/Visual_Studio/Tango.PMR/Connection/ConnectRequest.cs @@ -23,14 +23,16 @@ namespace Tango.PMR.Connection { byte[] descriptorData = global::System.Convert.FromBase64String( string.Concat( "ChRDb25uZWN0UmVxdWVzdC5wcm90bxIUVGFuZ28uUE1SLkNvbm5lY3Rpb24a", - "EkpvYlNwb29sVHlwZS5wcm90byJpCg5Db25uZWN0UmVxdWVzdBIQCghQYXNz", - "d29yZBgBIAEoCRIQCghVbml4VGltZRgCIAEoAxIzCglTcG9vbFR5cGUYAyAB", - "KA4yIC5UYW5nby5QTVIuUHJpbnRpbmcuSm9iU3Bvb2xUeXBlQiAKHmNvbS50", - "d2luZS50YW5nby5wbXIuY29ubmVjdGlvbmIGcHJvdG8z")); + "EkpvYlNwb29sVHlwZS5wcm90bxoRTWFjaGluZVR5cGUucHJvdG8inQEKDkNv", + "bm5lY3RSZXF1ZXN0EhAKCFBhc3N3b3JkGAEgASgJEhAKCFVuaXhUaW1lGAIg", + "ASgDEjMKCVNwb29sVHlwZRgDIAEoDjIgLlRhbmdvLlBNUi5QcmludGluZy5K", + "b2JTcG9vbFR5cGUSMgoLTWFjaGluZVR5cGUYBCABKA4yHS5UYW5nby5QTVIu", + "Q29tbW9uLk1hY2hpbmVUeXBlQiAKHmNvbS50d2luZS50YW5nby5wbXIuY29u", + "bmVjdGlvbmIGcHJvdG8z")); descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, - new pbr::FileDescriptor[] { global::Tango.PMR.Printing.JobSpoolTypeReflection.Descriptor, }, + new pbr::FileDescriptor[] { global::Tango.PMR.Printing.JobSpoolTypeReflection.Descriptor, global::Tango.PMR.Common.MachineTypeReflection.Descriptor, }, new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] { - new pbr::GeneratedClrTypeInfo(typeof(global::Tango.PMR.Connection.ConnectRequest), global::Tango.PMR.Connection.ConnectRequest.Parser, new[]{ "Password", "UnixTime", "SpoolType" }, null, null, null) + new pbr::GeneratedClrTypeInfo(typeof(global::Tango.PMR.Connection.ConnectRequest), global::Tango.PMR.Connection.ConnectRequest.Parser, new[]{ "Password", "UnixTime", "SpoolType", "MachineType" }, null, null, null) })); } #endregion @@ -64,6 +66,7 @@ namespace Tango.PMR.Connection { password_ = other.password_; unixTime_ = other.unixTime_; spoolType_ = other.spoolType_; + machineType_ = other.machineType_; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -104,6 +107,17 @@ namespace Tango.PMR.Connection { } } + /// Field number for the "MachineType" field. + public const int MachineTypeFieldNumber = 4; + private global::Tango.PMR.Common.MachineType machineType_ = 0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Tango.PMR.Common.MachineType MachineType { + get { return machineType_; } + set { + machineType_ = value; + } + } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { return Equals(other as ConnectRequest); @@ -120,6 +134,7 @@ namespace Tango.PMR.Connection { if (Password != other.Password) return false; if (UnixTime != other.UnixTime) return false; if (SpoolType != other.SpoolType) return false; + if (MachineType != other.MachineType) return false; return true; } @@ -129,6 +144,7 @@ namespace Tango.PMR.Connection { if (Password.Length != 0) hash ^= Password.GetHashCode(); if (UnixTime != 0L) hash ^= UnixTime.GetHashCode(); if (SpoolType != 0) hash ^= SpoolType.GetHashCode(); + if (MachineType != 0) hash ^= MachineType.GetHashCode(); return hash; } @@ -151,6 +167,10 @@ namespace Tango.PMR.Connection { output.WriteRawTag(24); output.WriteEnum((int) SpoolType); } + if (MachineType != 0) { + output.WriteRawTag(32); + output.WriteEnum((int) MachineType); + } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -165,6 +185,9 @@ namespace Tango.PMR.Connection { if (SpoolType != 0) { size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) SpoolType); } + if (MachineType != 0) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) MachineType); + } return size; } @@ -182,6 +205,9 @@ namespace Tango.PMR.Connection { if (other.SpoolType != 0) { SpoolType = other.SpoolType; } + if (other.MachineType != 0) { + MachineType = other.MachineType; + } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -204,6 +230,10 @@ namespace Tango.PMR.Connection { spoolType_ = (global::Tango.PMR.Printing.JobSpoolType) input.ReadEnum(); break; } + case 32: { + machineType_ = (global::Tango.PMR.Common.MachineType) input.ReadEnum(); + break; + } } } } diff --git a/Software/Visual_Studio/Tango.PMR/Integration/ExternalBridgeUdpDiscoveryPacket.cs b/Software/Visual_Studio/Tango.PMR/Integration/ExternalBridgeUdpDiscoveryPacket.cs index 309f95be3..21563b570 100644 --- a/Software/Visual_Studio/Tango.PMR/Integration/ExternalBridgeUdpDiscoveryPacket.cs +++ b/Software/Visual_Studio/Tango.PMR/Integration/ExternalBridgeUdpDiscoveryPacket.cs @@ -23,14 +23,15 @@ namespace Tango.PMR.Integration { byte[] descriptorData = global::System.Convert.FromBase64String( string.Concat( "CiZFeHRlcm5hbEJyaWRnZVVkcERpc2NvdmVyeVBhY2tldC5wcm90bxIVVGFu", - "Z28uUE1SLkludGVncmF0aW9uIlQKIEV4dGVybmFsQnJpZGdlVWRwRGlzY292", - "ZXJ5UGFja2V0EgwKBFRpbWUYASABKAkSFAoMU2VyaWFsTnVtYmVyGAIgASgJ", - "EgwKBEd1aWQYAyABKAlCIQofY29tLnR3aW5lLnRhbmdvLnBtci5pbnRlZ3Jh", - "dGlvbmIGcHJvdG8z")); + "Z28uUE1SLkludGVncmF0aW9uGhFNYWNoaW5lVHlwZS5wcm90byKIAQogRXh0", + "ZXJuYWxCcmlkZ2VVZHBEaXNjb3ZlcnlQYWNrZXQSDAoEVGltZRgBIAEoCRIU", + "CgxTZXJpYWxOdW1iZXIYAiABKAkSDAoER3VpZBgDIAEoCRIyCgtNYWNoaW5l", + "VHlwZRgEIAEoDjIdLlRhbmdvLlBNUi5Db21tb24uTWFjaGluZVR5cGVCIQof", + "Y29tLnR3aW5lLnRhbmdvLnBtci5pbnRlZ3JhdGlvbmIGcHJvdG8z")); descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, - new pbr::FileDescriptor[] { }, + new pbr::FileDescriptor[] { global::Tango.PMR.Common.MachineTypeReflection.Descriptor, }, new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] { - new pbr::GeneratedClrTypeInfo(typeof(global::Tango.PMR.Integration.ExternalBridgeUdpDiscoveryPacket), global::Tango.PMR.Integration.ExternalBridgeUdpDiscoveryPacket.Parser, new[]{ "Time", "SerialNumber", "Guid" }, null, null, null) + new pbr::GeneratedClrTypeInfo(typeof(global::Tango.PMR.Integration.ExternalBridgeUdpDiscoveryPacket), global::Tango.PMR.Integration.ExternalBridgeUdpDiscoveryPacket.Parser, new[]{ "Time", "SerialNumber", "Guid", "MachineType" }, null, null, null) })); } #endregion @@ -64,6 +65,7 @@ namespace Tango.PMR.Integration { time_ = other.time_; serialNumber_ = other.serialNumber_; guid_ = other.guid_; + machineType_ = other.machineType_; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -104,6 +106,17 @@ namespace Tango.PMR.Integration { } } + /// Field number for the "MachineType" field. + public const int MachineTypeFieldNumber = 4; + private global::Tango.PMR.Common.MachineType machineType_ = 0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Tango.PMR.Common.MachineType MachineType { + get { return machineType_; } + set { + machineType_ = value; + } + } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { return Equals(other as ExternalBridgeUdpDiscoveryPacket); @@ -120,6 +133,7 @@ namespace Tango.PMR.Integration { if (Time != other.Time) return false; if (SerialNumber != other.SerialNumber) return false; if (Guid != other.Guid) return false; + if (MachineType != other.MachineType) return false; return true; } @@ -129,6 +143,7 @@ namespace Tango.PMR.Integration { if (Time.Length != 0) hash ^= Time.GetHashCode(); if (SerialNumber.Length != 0) hash ^= SerialNumber.GetHashCode(); if (Guid.Length != 0) hash ^= Guid.GetHashCode(); + if (MachineType != 0) hash ^= MachineType.GetHashCode(); return hash; } @@ -151,6 +166,10 @@ namespace Tango.PMR.Integration { output.WriteRawTag(26); output.WriteString(Guid); } + if (MachineType != 0) { + output.WriteRawTag(32); + output.WriteEnum((int) MachineType); + } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -165,6 +184,9 @@ namespace Tango.PMR.Integration { if (Guid.Length != 0) { size += 1 + pb::CodedOutputStream.ComputeStringSize(Guid); } + if (MachineType != 0) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) MachineType); + } return size; } @@ -182,6 +204,9 @@ namespace Tango.PMR.Integration { if (other.Guid.Length != 0) { Guid = other.Guid; } + if (other.MachineType != 0) { + MachineType = other.MachineType; + } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -204,6 +229,10 @@ namespace Tango.PMR.Integration { Guid = input.ReadString(); break; } + case 32: { + machineType_ = (global::Tango.PMR.Common.MachineType) input.ReadEnum(); + break; + } } } } diff --git a/Software/Visual_Studio/Tango.PMR/Tango.PMR.csproj b/Software/Visual_Studio/Tango.PMR/Tango.PMR.csproj index 50c0966c3..9490c118b 100644 --- a/Software/Visual_Studio/Tango.PMR/Tango.PMR.csproj +++ b/Software/Visual_Studio/Tango.PMR/Tango.PMR.csproj @@ -79,6 +79,7 @@ + @@ -516,7 +517,7 @@ - + \ No newline at end of file -- cgit v1.3.1