mirror of
https://gitee.com/san-bing/JChargePointProtocol
synced 2026-05-05 18:39:56 +08:00
!18 远程更新 远程更新应答
* 远程更新应答 补充 onRemoteUpdate 去掉 UpgradeStatusEnum 枚举 用hashMap 处理升级结果返回 领域模型优化 代码优化 * Merge branch 'master' of gitee.com:san-bing/JChargePointProtocol into Feat_远程更新 * 远程更新 远程更新应答
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
package sanbing.jcpp.app.service;
|
||||
|
||||
import sanbing.jcpp.infrastructure.queue.Callback;
|
||||
import sanbing.jcpp.proto.gen.ProtocolProto;
|
||||
import sanbing.jcpp.proto.gen.ProtocolProto.SetPricingRequest;
|
||||
import sanbing.jcpp.proto.gen.ProtocolProto.UplinkQueueMessage;
|
||||
|
||||
@@ -112,6 +113,16 @@ public interface PileProtocolService {
|
||||
void onBmsAbort(UplinkQueueMessage uplinkQueueMessage, Callback callback);
|
||||
|
||||
/**
|
||||
* 远程更新
|
||||
*/
|
||||
void remoteUpdate(ProtocolProto.OtaRequest request);
|
||||
|
||||
/**
|
||||
* 远程更新应答
|
||||
*/
|
||||
void onRemoteUpdate(UplinkQueueMessage uplinkQueueMessage, Callback callback);
|
||||
|
||||
/*
|
||||
* BMS充电握手
|
||||
*/
|
||||
void onBmsHandshake(UplinkQueueMessage uplinkQueueMessage, Callback callback);
|
||||
|
||||
@@ -378,6 +378,35 @@ public class DefaultPileProtocolService implements PileProtocolService {
|
||||
callback.onSuccess();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void remoteUpdate(OtaRequest request) {
|
||||
|
||||
UUID messageId = UUID.randomUUID();
|
||||
UUID requestId = UUID.randomUUID();
|
||||
|
||||
DownlinkRequestMessage.Builder downlinkRequestMessageBuilder = DownlinkRequestMessage.newBuilder()
|
||||
.setMessageIdMSB(messageId.getMostSignificantBits())
|
||||
.setMessageIdLSB(messageId.getLeastSignificantBits())
|
||||
.setPileCode(request.getPileCode())
|
||||
.setRequestIdMSB(requestId.getMostSignificantBits())
|
||||
.setRequestIdLSB(requestId.getLeastSignificantBits())
|
||||
.setDownlinkCmd(DownlinkCmdEnum.REMOTE_UPDATE.name())
|
||||
.setOtaRequest(request);
|
||||
downlinkCallService.sendDownlinkMessage(downlinkRequestMessageBuilder,request.getPileCode());
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRemoteUpdate(UplinkQueueMessage uplinkQueueMessage, Callback callback) {
|
||||
|
||||
log.info("接收到充电桩更新应答 {}", uplinkQueueMessage);
|
||||
|
||||
// TODO 处理相关业务逻辑
|
||||
|
||||
callback.onSuccess();
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBmsHandshake(UplinkQueueMessage uplinkQueueMessage, Callback callback) {
|
||||
log.info("接收到BMS充电握手信息 {}", uplinkQueueMessage);
|
||||
@@ -424,4 +453,8 @@ public class DefaultPileProtocolService implements PileProtocolService {
|
||||
builder.setRequestData(uplinkQueueMessage.getRequestData());
|
||||
return builder;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -216,6 +216,10 @@ public class ProtocolUplinkConsumerService extends AbstractConsumerService imple
|
||||
|
||||
pileProtocolService.onBmsHandshake(uplinkQueueMsg, callback);
|
||||
|
||||
} else if (uplinkQueueMsg.hasOtaResponse()) {
|
||||
|
||||
pileProtocolService.onRemoteUpdate(uplinkQueueMsg, callback);
|
||||
|
||||
} else {
|
||||
|
||||
callback.onSuccess();
|
||||
|
||||
Reference in New Issue
Block a user