mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-20 11:05:18 +08:00
update 电单车协议
This commit is contained in:
@@ -3,6 +3,8 @@ package com.jsowell.netty.handler.electricbicycles;
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.jsowell.common.constant.Constants;
|
||||
import com.jsowell.common.core.domain.ebike.EBikeDataProtocol;
|
||||
import com.jsowell.common.util.BytesUtil;
|
||||
import com.jsowell.common.util.bean.SerializationUtil;
|
||||
import com.jsowell.netty.factory.EBikeOperateFactory;
|
||||
import com.jsowell.pile.domain.ebike.AbsEBikeMessage;
|
||||
import com.jsowell.pile.domain.ebike.EBikeCommandEnum;
|
||||
@@ -37,6 +39,16 @@ public class HeartbeatHandler extends AbstractEBikeHandler {
|
||||
EBikeMessageCmd21 message = (EBikeMessageCmd21) AbsEBikeMessage.parseMessage(dataProtocol.getBytes());
|
||||
// 保存时间
|
||||
saveLastTimeAndCheckChannel(message.getPhysicalId() + "", ctx);
|
||||
|
||||
try {
|
||||
byte[] serialize = SerializationUtil.serialize(message);
|
||||
log.info("心跳包序列化:{}", BytesUtil.binary(serialize, 16));
|
||||
EBikeMessageCmd21 deserialize = SerializationUtil.deserialize(EBikeMessageCmd21.class, serialize);
|
||||
log.info("心跳包反序列化:{}", JSON.toJSONString(deserialize));
|
||||
} catch (Exception e) {
|
||||
log.info("error", e);
|
||||
}
|
||||
|
||||
EBikeMessageCmd21.DeviceHeartbeat deviceHeartbeat = message.getDeviceHeartbeat();
|
||||
log.info("设备心跳包:{}", JSON.toJSONString(message));
|
||||
return getResult(dataProtocol, Constants.zeroByteArray);
|
||||
|
||||
Reference in New Issue
Block a user