1、修改d331解析角度的bug
This commit is contained in:
parent
ab0bd9943c
commit
f2ef68a9ae
@ -20,21 +20,22 @@ public class D331RtcmMessage extends BaseMessage {
|
||||
@Override
|
||||
public void decodeBody(ByteBuf src) {
|
||||
// get操作不会移动指针,这样可以确保整个全转发出去
|
||||
int pos = 0;
|
||||
this.packetNum = 1;
|
||||
this.len = src.readableBytes();//this.len & 0x7FF;//有可能两个d331粘包
|
||||
this.header = src.getUnsignedShort(0); // flag
|
||||
int onePacketLen = src.getUnsignedShort(2); // length:11 bits
|
||||
this.header = src.getUnsignedShort(pos); pos+=2;// flag
|
||||
int onePacketLen = src.getUnsignedShort(pos); pos+=2;// length:11 bits
|
||||
this.seq = onePacketLen >> 11;
|
||||
onePacketLen = onePacketLen&0x7FF;
|
||||
this.id = String.valueOf(src.getUnsignedInt(4)); //id
|
||||
int pos = onePacketLen + 4;
|
||||
while(pos < this.len){
|
||||
if(src.getUnsignedShort(pos) == 0xd331){
|
||||
onePacketLen = src.getUnsignedShort(pos+2)&0x7FF;
|
||||
pos = pos+4+onePacketLen;
|
||||
packetNum ++;
|
||||
this.id = String.valueOf(src.getUnsignedInt(pos)); pos+=4;//id
|
||||
if(onePacketLen + 4<this.len) {
|
||||
while (pos < this.len) {
|
||||
if (src.getUnsignedShort(pos) == 0xd331) {
|
||||
onePacketLen = src.getUnsignedShort(pos + 2) & 0x7FF;
|
||||
pos = pos + 4 + onePacketLen;
|
||||
packetNum++;
|
||||
} else pos++;
|
||||
}
|
||||
else pos++;
|
||||
}
|
||||
/*if (src.readableBytes() - 4 < this.len) {
|
||||
String msg = String.format("id[%s],长度字段值[%s]效益包的消息体长度[%s]", id, this.len, src.readableBytes() - 4);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user