严智鑫
2025-06-13 d14cdaf28222bfef468185e34de7c823f1436b19
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package com.mes.connect.protocol;
 
/**
 * 协议地址类
 */
public class ProtocolAddress {
    private final ProtocolType protocol;
    private final int functionCode;
    private final int dbNumber;
    private final int address;
    private final int bit;
    
    public ProtocolAddress(ProtocolType protocol, int functionCode, int dbNumber, int address, int bit) {
        this.protocol = protocol;
        this.functionCode = functionCode;
        this.dbNumber = dbNumber;
        this.address = address;
        this.bit = bit;
    }
    
    // Getters
    public ProtocolType getProtocol() { return protocol; }
    public int getFunctionCode() { return functionCode; }
    public int getDbNumber() { return dbNumber; }
    public int getAddress() { return address; }
    public int getBit() { return bit; }
    
    @Override
    public String toString() {
        return "ProtocolAddress{" +
                "protocol=" + protocol +
                ", functionCode=" + functionCode +
                ", dbNumber=" + dbNumber +
                ", address=" + address +
                ", bit=" + bit +
                '}';
    }
}