mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-20 19:15:35 +08:00
update 电单车协议
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package com.jsowell.netty.decoder;
|
||||
|
||||
import com.jsowell.common.constant.Constants;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import io.netty.channel.ChannelHandlerContext;
|
||||
import io.netty.handler.codec.ByteToMessageDecoder;
|
||||
@@ -47,7 +48,7 @@ public class StartAndLengthFieldFrameDecoder extends ByteToMessageDecoder {
|
||||
buffer.getBytes(beginReader, headerBytes, 0, HEADER_LENGTH_DNY);
|
||||
String header = new String(headerBytes, StandardCharsets.UTF_8);
|
||||
// log.info("检查包头是否是DNY, header:{}", header);
|
||||
if ("DNY".equals(header)) {
|
||||
if (Constants.EBIKE_HEADER.equals(header)) {
|
||||
// 处理 DNY 协议
|
||||
decodeDnyMessage(buffer, out, beginReader);
|
||||
return;
|
||||
@@ -73,7 +74,7 @@ public class StartAndLengthFieldFrameDecoder extends ByteToMessageDecoder {
|
||||
byte[] headerBytes = new byte[HEADER_LENGTH_DNY];
|
||||
buffer.getBytes(beginReader, headerBytes, 0, HEADER_LENGTH_DNY);
|
||||
String header = new String(headerBytes, StandardCharsets.UTF_8);
|
||||
return "DNY".equals(header);
|
||||
return Constants.EBIKE_HEADER.equals(header);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user