public class Header extends Object implements IObjectByteArray
| 限定符和类型 | 字段和说明 |
|---|---|
static int |
BYTE_LENGTH |
protected int |
dataLength
数据的长度(大端)
字节大小:2 字节序数:8-9 |
protected EMessageType |
messageType
pdu(协议数据单元(Protocol Data Unit))的类型
字节大小:1 字节序数:1 |
protected int |
parameterLength
参数的长度(大端)
字节大小:2 字节序数:6-7 |
protected int |
pduReference
pdu的参考–由主站生成,每次新传输递增,大端
字节大小:2 字节序数:4-5 |
protected byte |
protocolId
协议id
字节大小:1 字节序数:0 |
protected int |
reserved
保留
字节大小:2 字节序数:2-3 |
| 构造器和说明 |
|---|
Header() |
| 限定符和类型 | 方法和说明 |
|---|---|
int |
byteArrayLength()
获取字节数组长度
|
static Header |
createDefault()
创建默认的头header
|
static Header |
fromBytes(byte[] data)
字节数组数据解析
|
static int |
getNewPduNumber()
获取新的pduNumber
|
byte[] |
toByteArray()
转换为字节数组
|
public static final int BYTE_LENGTH
protected byte protocolId
protected EMessageType messageType
protected int reserved
protected int pduReference
protected int parameterLength
protected int dataLength
public static int getNewPduNumber()
public static Header fromBytes(byte[] data)
data - 字节数组数据public static Header createDefault()
public int byteArrayLength()
IObjectByteArraybyteArrayLength 在接口中 IObjectByteArraypublic byte[] toByteArray()
IObjectByteArraytoByteArray 在接口中 IObjectByteArrayCopyright © 2024. All rights reserved.