package com.dcs.equipment.exception.device;

import lombok.Data;

/**
 * 设备协议异常
 * @author: wangpx
 * @date: 2025-07-22 15:06
 */
@Data
public class DeviceProtocolException extends DeviceException {
    private static final long serialVersionUID = 1L;
    private String functionCode;
    private Integer slaveId;
    private Integer offset;
    private Integer quantity;

    public DeviceProtocolException() {
        super();
    }

    public DeviceProtocolException(String message) {
        super(message);
    }

    public DeviceProtocolException(String message, Integer code) {
        super(message, code);
    }

    public DeviceProtocolException(String message, String functionCode, Integer slaveId, Integer offset, Integer quantity) {
        super(message);
        this.functionCode = functionCode;
        this.slaveId = slaveId;
        this.offset = offset;
        this.quantity = quantity;
    }

    public DeviceProtocolException(String message, Integer code, String functionCode, Integer slaveId, Integer offset, Integer quantity) {
        super(message, code);
        this.functionCode = functionCode;
        this.slaveId = slaveId;
        this.offset = offset;
        this.quantity = quantity;
    }

    public DeviceProtocolException(Exception e) {
        super(e);
    }

    public DeviceProtocolException(Exception e, String functionCode, Integer slaveId, Integer offset, Integer quantity) {
        super(e);
        this.functionCode = functionCode;
        this.slaveId = slaveId;
        this.offset = offset;
        this.quantity = quantity;
    }
} 