Comments (2)
原因为: 在报文中间出现了7E,但框架截取了前面半部分,漏掉了后面半部分.导致异常发生.
from jt-framework.
检查后,发现我在0200位置上报处理方法内获取到的报文是被框架处理过的.
如果需要原始报文,则需要自定义解码器来实现.
感谢 @hylexus 提供实现代码.
实现代码如下:
/**
* 自定义解码器
*
* <p>备注: (主要用于将原始报文,传递至后续流程[官方原有流程为: 将修改后的报文传递至后续流程])
*
* @author
* @version 2022/9/10
*/
@Component
public class CustomJt808MsgDecoder extends DefaultJt808MsgDecoder {
public CustomJt808MsgDecoder(
Jt808MsgTypeParser msgTypeParser,
Jt808MsgBytesProcessor msgBytesProcessor,
Jt808ProtocolVersionDetectorRegistry versionDetectorRegistry) {
super(msgTypeParser, msgBytesProcessor, versionDetectorRegistry);
}
@Override
public Jt808Request decode(ByteBuf byteBuf) {
final ByteBuf copy = byteBuf.copy();
final Jt808Request request = super.decode(byteBuf);
return request.mutate().rawByteBuf(copy).build();
}
}
from jt-framework.
Related Issues (20)
- openFeign和jt808出现的异常
- 附加信息,增加不带注解的属性。null错误 HOT 1
- 附加信息。length的类型只能是Integer HOT 1
- DWORD显示应该是有问题的。 HOT 1
- 不支持2019版的消息应答? HOT 1
- handler-scan配置错误
- 麻烦同意一下qq群加入 HOT 1
- 支持808协议的哪些版本? HOT 2
- 报警标志怎么知道具体含义?
- 解析终端参数查询结果 HOT 4
- netty报错 "refCnt: 0, decrement: 1" HOT 1
- 内存泄漏:LEAK: ByteBuf.release() was not called before it's garbage-collected HOT 1
- 服务端无法根据心跳主动断开连接 HOT 1
- 下发终端设置指令异常 HOT 1
- 是否支持JDK 8? HOT 1
- 准备把Gradle升级到7.3.3,报错 HOT 1
- [Question] Logo HOT 1
- 能否安全地去掉注解的 order 属性?
- 在接收不是框架内规定范围内的jt808消息时,会抛异常 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jt-framework.