Commit 1d2a73a4 by zhouhaibao

[+]callback统一处理

1 parent 35e05da1
...@@ -35,13 +35,7 @@ public class ParamSettingRspHandler implements TcpHandler<ParamSettingRsp, Param ...@@ -35,13 +35,7 @@ public class ParamSettingRspHandler implements TcpHandler<ParamSettingRsp, Param
} }
// 结果响应给业务侧 // 结果响应给业务侧
String key = ProxyHelper.getCallbackKey(rsp, channel); ProxyHelper.getCallbackKey(rsp, channel, rsp);
TcpCallback<TcpRsp> callback = ProxyHelper.getCallback(key);
if (Objects.nonNull(callback)) {
callback.callback(rsp);
} else {
log.info("callback为空");
}
return null; return null;
} }
} }
...@@ -30,13 +30,8 @@ public class TimeSettingRspHandler implements TcpHandler<TimeSettingRsp, TimeSet ...@@ -30,13 +30,8 @@ public class TimeSettingRspHandler implements TcpHandler<TimeSettingRsp, TimeSet
log.info("对时设置响应 pointId {} time {}", Ocpp16Helper.bcdToStr(data.getPileId()), ByteUtils.parseCp56Time2aStr(data.getTime())); log.info("对时设置响应 pointId {} time {}", Ocpp16Helper.bcdToStr(data.getPileId()), ByteUtils.parseCp56Time2aStr(data.getTime()));
// TODO // TODO
String key = ProxyHelper.getCallbackKey(rsp, channel); ProxyHelper.getCallbackKey(rsp, channel,rsp);
TcpCallback<TcpRsp> callback = ProxyHelper.getCallback(key);
if (Objects.nonNull(callback)) {
callback.callback(rsp);
} else {
log.info("callback为空");
}
return null; return null;
} }
......
...@@ -26,7 +26,7 @@ public class ModelValTest { ...@@ -26,7 +26,7 @@ public class ModelValTest {
ModelValReq req = new ModelValReq(); ModelValReq req = new ModelValReq();
req.setData(new ModelValReqData()); req.setData(new ModelValReqData());
req.getData().setPileId(Ocpp16Helper.strToBcd("00000002100010", req.getData().getPileId())); req.getData().setPileId(Ocpp16Helper.strToBcd("32010200000001", req.getData().getPileId()));
req.getData().setModelCode(Ocpp16Helper.strToBcd("0000", req.getData().getModelCode())); req.getData().setModelCode(Ocpp16Helper.strToBcd("0000", req.getData().getModelCode()));
client.sendSync(req); client.sendSync(req);
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!