AlpacaDiscoveryValidateAlpacaAddress Method

Validates that a device exists on the supplied IP address and port. If not, an attempt is made to re-discover the device based on the supplied unique ID.

Definition

Namespace: ASCOM.Alpaca.Discovery
Assembly: ASCOM.Alpaca (in ASCOM.Alpaca.dll) Version: 4.1.0+517b408ca408f7a19aace78c1509f524714a3a13
C#
public static bool ValidateAlpacaAddress(
	string ipAddressString,
	int portNumber,
	string uniqueId,
	out AscomDevice foundDevice,
	ILogger logger = null
)

Parameters

ipAddressString  String
The IP address of the Alpaca device as a string.
portNumber  Int32
The IP port number of the Alpaca device.
uniqueId  String
The unique ID of the Alpaca device.
foundDevice  AscomDevice
An AlpacaDevice instance containing the new IP address and port of the Alpaca device when returning false and the device is found on another address. Otherwise null.
logger  ILogger  (Optional)
Optional logger for debug messages. Defaults to null, which suppresses logging.

Return Value

Boolean
True if the device exists on the supplied IP address and port, otherwise false. If a device with the same unique ID is found on a different address, foundDevice will be set to that device.

Remarks

When the device is found on multiple paths, this method returns the address of the device that is closest to the original address e.g. is on the same sub-net.

Version Information

Supported in: .NET Standard 2.0, .NET 8 .NET 9. .NET 10

See Also