init
This commit is contained in:
@@ -0,0 +1,47 @@
|
||||
using System.Collections.Generic;
|
||||
using DTS.Common.Enums.DASFactory;
|
||||
using DTS.Common.ICommunication;
|
||||
|
||||
namespace DTS.DASLib.Command.SLICE.MulticastCommands
|
||||
{
|
||||
public class MulticastGetIpAddress : MulticastCommandBase
|
||||
{
|
||||
protected override Commands Command => Commands.GetIpAddress;
|
||||
|
||||
private string _ip;
|
||||
public string Ip => _ip;
|
||||
|
||||
public MulticastGetIpAddress(DTS.Common.Interface.DASFactory.ICommunication sock)
|
||||
: base(sock)
|
||||
{
|
||||
}
|
||||
|
||||
public MulticastGetIpAddress(DTS.Common.Interface.DASFactory.ICommunication sock, int timeoutMillisec)
|
||||
: base(sock, timeoutMillisec)
|
||||
{
|
||||
}
|
||||
|
||||
protected override CommandReceiveAction WholePackage()
|
||||
{
|
||||
if (response.Status == DFConstantsAndEnums.CommandStatus.StatusNoError)
|
||||
{
|
||||
base.WholePackage();
|
||||
response.GetParameter(DOUBLE_MAC_ADDR_SIZE, out _ip);
|
||||
}
|
||||
|
||||
return CommandReceiveAction.StopReceiving;
|
||||
}
|
||||
|
||||
public override void CommandToString(ref List<List<string>> lines)
|
||||
{
|
||||
base.CommandToString(ref lines);
|
||||
lines.Add(new List<string> { $"MAC: {CommandClientMac} " });
|
||||
}
|
||||
|
||||
public override void ResponseToString(ref List<List<string>> lines)
|
||||
{
|
||||
base.ResponseToString(ref lines);
|
||||
lines.Add(new List<string> { $"MAC: {CommandClientMac} IP: {_ip}" });
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user