Plugins/Drivers/DriverModbusMaster/NModbus4/SlaveException.cs

(开头部分) 7KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

namespace Modbus
{
    using System;
    using System.Diagnostics.CodeAnalysis;
#if NET46
    using System.Runtime.Serialization;
    using System.Security.Permissions;
#endif
    using Message;

    /// <summary>
    ///     Represents slave errors that occur during communication.
    /// </summary>
#if NET46
    [Serializable]
#endif
    public class SlaveException : Exception
    {
        private const string SlaveAddressPropertyName = "SlaveAdress";
        private const string FunctionCodePropertyName = "FunctionCode";
        private const string SlaveExceptionCodePropertyName = "SlaveExceptionCode";

        private readonly SlaveExceptionResponse _slaveExceptionResponse;

        /// <summary>
        ///     Initializes a new instance of the <see cref="SlaveException" /> class.
        /// </summary>
        public SlaveException()
        {
        }

        /// <summary>
        ///     Initializes a new instance of the <see cref="SlaveException" /> class.
        /// </summary>
        /// <param name="message">The message.</param>
        public SlaveException(string message)
            : base(message)
        {
        }

        /// <summary>
        ///     Initializes a new instance of the <see cref="SlaveException" /> class.
        /// </summary>
        /// <param name="message">The message.</param>
        /// <param name="innerException">The inner exception.</param>
        public SlaveException(string message, Exception innerException)
            : base(message, innerException)
        {
        }

        internal SlaveException(SlaveExceptionResponse slaveExceptionResponse)
        {
            _slaveExceptionResponse = slaveExceptionResponse;
        }

        [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "Used by test code.")]
        internal SlaveException(string message, SlaveExceptionResponse slaveExceptionResponse)
            : base(message)
        {
            _slaveExceptionResponse = slaveExceptionResponse;
后面还有 113 行代码,购买后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。