namespace ZB.MOM.WW.OtOpcUa.Driver.TwinCAT;
///
/// Thrown by when the TARGET refuses the ADS sum-read
/// command as a whole (service or index group not supported). It is not a comms fault: the driver marks
/// the device "no sum-read" and re-reads the batch with individual reads, so the poll still completes.
///
internal sealed class TwinCATSumReadRefusedException : Exception
{
/// Initializes a new instance of the class.
/// The overall ADS error code the target answered with.
/// The underlying exception, if any.
public TwinCATSumReadRefusedException(uint adsErrorCode, Exception? inner = null)
: base($"ADS sum-read refused by the target (ADS error {adsErrorCode})", inner)
{
AdsErrorCode = adsErrorCode;
}
/// Gets the overall ADS error code.
public uint AdsErrorCode { get; }
}