47 lines
1.5 KiB
Plaintext
47 lines
1.5 KiB
Plaintext
using System.Collections.Generic;
|
|
using DTS.Common.Enums.DASFactory;
|
|
using DTS.Common.ICommunication;
|
|
|
|
namespace DTS.DASLib.Command.SLICE.MulticastCommands
|
|
{
|
|
public class MulticastGetGatewayAddress : MulticastCommandBase
|
|
{
|
|
protected override Commands Command => Commands.GetGatewayAddress;
|
|
|
|
private string _gateway;
|
|
public string Gateway => _gateway;
|
|
|
|
public MulticastGetGatewayAddress(DTS.Common.Interface.DASFactory.ICommunication sock)
|
|
: base(sock)
|
|
{
|
|
}
|
|
|
|
public MulticastGetGatewayAddress(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(FIRST_PARAMETER_OFFSET, out _gateway);
|
|
}
|
|
|
|
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} Gateway: {_gateway}" });
|
|
}
|
|
}
|
|
} |