diff options
| author | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2018-06-04 01:22:32 +0300 |
|---|---|---|
| committer | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2018-06-04 01:22:32 +0300 |
| commit | acf120606f7495bd132c0250fccb1b975e9660da (patch) | |
| tree | 7ee25d9229317cf5042f20dd3966c7ea21be95c1 /Software/Visual_Studio/Tango.PMR/Discovery | |
| parent | a56f07ca4373ae1dd6127f7a047a2bf0689ac6ad (diff) | |
| download | Tango-acf120606f7495bd132c0250fccb1b975e9660da.tar.gz Tango-acf120606f7495bd132c0250fccb1b975e9660da.zip | |
Added PMR_VS solution.
Refactored discovery to be more generic.
Diffstat (limited to 'Software/Visual_Studio/Tango.PMR/Discovery')
| -rw-r--r-- | Software/Visual_Studio/Tango.PMR/Discovery/BasicDiscoveryMessage.cs | 36 |
1 files changed, 32 insertions, 4 deletions
diff --git a/Software/Visual_Studio/Tango.PMR/Discovery/BasicDiscoveryMessage.cs b/Software/Visual_Studio/Tango.PMR/Discovery/BasicDiscoveryMessage.cs index e926a55c4..b3c3ec5d5 100644 --- a/Software/Visual_Studio/Tango.PMR/Discovery/BasicDiscoveryMessage.cs +++ b/Software/Visual_Studio/Tango.PMR/Discovery/BasicDiscoveryMessage.cs @@ -23,13 +23,13 @@ namespace Tango.PMR.Discovery { byte[] descriptorData = global::System.Convert.FromBase64String( string.Concat( "ChtCYXNpY0Rpc2NvdmVyeU1lc3NhZ2UucHJvdG8SE1RhbmdvLlBNUi5EaXNj", - "b3ZlcnkiLAoVQmFzaWNEaXNjb3ZlcnlNZXNzYWdlEhMKC1NlcnZpY2VOYW1l", - "GAEgASgJQh8KHWNvbS50d2luZS50YW5nby5wbXIuZGlzY292ZXJ5YgZwcm90", - "bzM=")); + "b3ZlcnkiOgoVQmFzaWNEaXNjb3ZlcnlNZXNzYWdlEhMKC1NlcnZpY2VOYW1l", + "GAEgASgJEgwKBFBvcnQYAiABKAVCHwodY29tLnR3aW5lLnRhbmdvLnBtci5k", + "aXNjb3ZlcnliBnByb3RvMw==")); descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, new pbr::FileDescriptor[] { }, new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] { - new pbr::GeneratedClrTypeInfo(typeof(global::Tango.PMR.Discovery.BasicDiscoveryMessage), global::Tango.PMR.Discovery.BasicDiscoveryMessage.Parser, new[]{ "ServiceName" }, null, null, null) + new pbr::GeneratedClrTypeInfo(typeof(global::Tango.PMR.Discovery.BasicDiscoveryMessage), global::Tango.PMR.Discovery.BasicDiscoveryMessage.Parser, new[]{ "ServiceName", "Port" }, null, null, null) })); } #endregion @@ -61,6 +61,7 @@ namespace Tango.PMR.Discovery { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public BasicDiscoveryMessage(BasicDiscoveryMessage other) : this() { serviceName_ = other.serviceName_; + port_ = other.port_; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -79,6 +80,17 @@ namespace Tango.PMR.Discovery { } } + /// <summary>Field number for the "Port" field.</summary> + public const int PortFieldNumber = 2; + private int port_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int Port { + get { return port_; } + set { + port_ = value; + } + } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { return Equals(other as BasicDiscoveryMessage); @@ -93,6 +105,7 @@ namespace Tango.PMR.Discovery { return true; } if (ServiceName != other.ServiceName) return false; + if (Port != other.Port) return false; return true; } @@ -100,6 +113,7 @@ namespace Tango.PMR.Discovery { public override int GetHashCode() { int hash = 1; if (ServiceName.Length != 0) hash ^= ServiceName.GetHashCode(); + if (Port != 0) hash ^= Port.GetHashCode(); return hash; } @@ -114,6 +128,10 @@ namespace Tango.PMR.Discovery { output.WriteRawTag(10); output.WriteString(ServiceName); } + if (Port != 0) { + output.WriteRawTag(16); + output.WriteInt32(Port); + } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -122,6 +140,9 @@ namespace Tango.PMR.Discovery { if (ServiceName.Length != 0) { size += 1 + pb::CodedOutputStream.ComputeStringSize(ServiceName); } + if (Port != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(Port); + } return size; } @@ -133,6 +154,9 @@ namespace Tango.PMR.Discovery { if (other.ServiceName.Length != 0) { ServiceName = other.ServiceName; } + if (other.Port != 0) { + Port = other.Port; + } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -147,6 +171,10 @@ namespace Tango.PMR.Discovery { ServiceName = input.ReadString(); break; } + case 16: { + Port = input.ReadInt32(); + break; + } } } } |
