添加消息解析异常处理
This commit is contained in:
parent
51ecc2fed8
commit
0ec14986e2
@ -145,6 +145,10 @@ public class FrameSchema {
|
||||
if (messageId.equals(MessageId.UNKNOWN)) {
|
||||
throw new Exception("位置的消息id");
|
||||
}
|
||||
if (messageId.omc == null || messageId.omc.create() == null) {
|
||||
throw new Exception(
|
||||
String.format("id=%s的消息没有消息对象创建接口omc或接口返回null", messageId));
|
||||
}
|
||||
MessageData message = messageId.omc.create();
|
||||
message.decode(msgBuf);
|
||||
messages.add(message);
|
||||
|
@ -34,6 +34,9 @@ public enum MessageId {
|
||||
DEPOT_PLAN(0x0007, null);
|
||||
|
||||
int val;
|
||||
/**
|
||||
* 消息对象创建接口
|
||||
*/
|
||||
OccMessageCreate omc;
|
||||
|
||||
interface OccMessageCreate {
|
||||
|
Loading…
Reference in New Issue
Block a user