HslCommunication.Core.IMessage.FujiSPBMessage Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of HslCommunication Show documentation
Show all versions of HslCommunication Show documentation
一个工业物联网的底层架构框架,专注于底层的技术通信及跨平台,跨语言通信功能,实现各种主流的PLC数据读写,实现modbus的各种协议读写等等
package HslCommunication.Core.IMessage;
import HslCommunication.BasicFramework.SoftBasic;
import HslCommunication.Utilities;
import java.nio.charset.StandardCharsets;
/**
* 富士SPB的消息内容
*/
public class FujiSPBMessage extends NetMessageBase implements INetMessage {
public int ProtocolHeadBytesLength() {
return 5;
}
public int GetContentLengthByHeadBytes() {
byte[] HeadBytes = getHeadBytes();
byte[] SendBytes = getSendBytes();
if (HeadBytes == null) return 0;
return Integer.parseInt(new String(HeadBytes, 3, 2, StandardCharsets.US_ASCII), 16) * 2 + 2;
}
}