Commit 21774812 by zhouhaibao

[+]新增日志

1 parent 9791bd7f
package cn.com.glsx.charging.modules.gbt.ocpp16.tcp.base;
import cn.com.glsx.charging.modules.gbt.ocpp16.tcp.handler.ModelSetRspHandler;
import java.util.Map;
import com.fasterxml.jackson.annotation.JsonIgnore;
......@@ -86,7 +87,7 @@ public final class TcpMapper {
public static TcpMapper CMD_REQ_MODEL_SET = regist(0x58, "计费模型设置", null);
public static TcpMapper CMD_RSP_MODEL_SET = regist(0x57, "对时设置应答", null);
public static TcpMapper CMD_RSP_MODEL_SET = regist(0x57, "对时设置应答", ModelSetRspHandler.class);
public static TcpMapper fromType(byte type) {
......
package cn.com.glsx.charging.modules.gbt.ocpp16.tcp.handler;
import cn.com.glsx.charging.modules.gbt.ocpp16.Ocpp16Helper;
import cn.com.glsx.charging.modules.gbt.ocpp16.tcp.base.TcpHandler;
import cn.com.glsx.charging.modules.gbt.ocpp16.tcp.data.LoginRspData;
import cn.com.glsx.charging.modules.gbt.ocpp16.tcp.protocol.LoginReq;
......@@ -11,6 +12,7 @@ public class LoginReqHandler implements TcpHandler<LoginReq, LoginRsp> {
@Override
public LoginRsp handle(Channel channel, LoginReq req) {
LoginRspData data = new LoginRspData();
log.info("请求验证的桩号{}", Ocpp16Helper.bcdToStr(req.getData().getPointId()));
data.setPointId(req.getData().getPointId());
data.setResult((byte) 0);
......
package cn.com.glsx.charging.modules.gbt.ocpp16.tcp.handler;
import cn.com.glsx.charging.modules.gbt.ocpp16.Ocpp16Helper;
import cn.com.glsx.charging.modules.gbt.ocpp16.tcp.base.TcpHandler;
import cn.com.glsx.charging.modules.gbt.ocpp16.tcp.data.ModelChargingRspData;
import cn.com.glsx.charging.modules.gbt.ocpp16.tcp.data.ModelSetRspData;
import cn.com.glsx.charging.modules.gbt.ocpp16.tcp.protocol.ModelChargingReq;
import cn.com.glsx.charging.modules.gbt.ocpp16.tcp.protocol.ModelChargingRsp;
import cn.com.glsx.charging.modules.gbt.ocpp16.tcp.protocol.ModelSetReq;
import cn.com.glsx.charging.modules.gbt.ocpp16.tcp.protocol.ModelSetRsp;
import com.alibaba.fastjson.JSONObject;
import io.netty.channel.Channel;
import lombok.extern.slf4j.Slf4j;
@Slf4j
public class ModelSetRspHandler implements TcpHandler<ModelSetRsp, ModelSetRsp> {
@Override
public ModelSetRsp handle(Channel channel, ModelSetRsp req) {
//
log.info("请求验证的桩号{}", Ocpp16Helper.bcdToStr(req.getData().getPointId()));
log.info("设置的结果{}", req.getData().getSetResult());
return null;
}
}
......@@ -6,7 +6,7 @@ import cn.com.glsx.charging.modules.gbt.ocpp16.tcp.data.ModelSetReqData;
import cn.com.glsx.charging.modules.gbt.ocpp16.tcp.data.ModelValReqData;
/**
* 计算模型验证
* 计算模型设置请求
*
* @author zhouhb
* @date 2023年11月6日
......
......@@ -6,7 +6,7 @@ import cn.com.glsx.charging.modules.gbt.ocpp16.tcp.data.ModelSetRspData;
import cn.com.glsx.charging.modules.gbt.ocpp16.tcp.data.ModelValRspData;
/**
* 计算模型验证应答
* 计算模型设置应答
*
* @author zhouhb
* @date 2023年11月6日
......
......@@ -8,10 +8,10 @@ import cn.com.glsx.charging.modules.gbt.ocpp16.tcp.protocol.ModelChargingReq;
import lombok.extern.slf4j.Slf4j;
/**
* 模拟充电桩端,连接云快充平台的测试服务器 实现登录,心跳,交互
* 计费模型请求
*
* @author kome
* @date 2023年11月6日 上午9:49:10
* @author zhouhb
* @date 2023年11月7日 上午9:49:10
*/
@Slf4j
public class ModelChargingTest {
......
package cn.com.glsx.charging.gbt.ocpp16;
import cn.com.glsx.charging.modules.gbt.ocpp16.ClientMain;
import cn.com.glsx.charging.modules.gbt.ocpp16.Ocpp16Helper;
import cn.com.glsx.charging.modules.gbt.ocpp16.tcp.client.TcpClient;
import cn.com.glsx.charging.modules.gbt.ocpp16.tcp.data.ModelSetRspData;
import cn.com.glsx.charging.modules.gbt.ocpp16.tcp.data.ModelValReqData;
import cn.com.glsx.charging.modules.gbt.ocpp16.tcp.protocol.ModelSetRsp;
import cn.com.glsx.charging.modules.gbt.ocpp16.tcp.protocol.ModelValReq;
/**
* 计费模型设置应答
*
* @author zhouhb
* @date 2023年11月8日 上午9:49:10
*/
public class ModelSetTest {
public static void main(String[] args) throws Exception {
Ocpp16Helper.scan();
String host = "localhost";
int port = 8888;
TcpClient client = ClientMain.getInstance(host, port);
Thread.sleep(3000);
ModelSetRsp req = new ModelSetRsp();
req.setData(new ModelSetRspData());
req.getData().setPointId(Ocpp16Helper.strToBcd("55031412782305", req.getData().getPointId()));
req.getData().setSetResult((byte) 0x01);
client.sendSync(req);
}
}
......@@ -7,10 +7,10 @@ import cn.com.glsx.charging.modules.gbt.ocpp16.tcp.data.ModelValReqData;
import cn.com.glsx.charging.modules.gbt.ocpp16.tcp.protocol.ModelValReq;
/**
* 模拟充电桩端,连接云快充平台的测试服务器 实现登录,心跳,交互
* 计费模型校验
*
* @author kome
* @date 2023年11月6日 上午9:49:10
* @author zhouhb
* @date 2023年11月7日 上午9:49:10
*/
public class ModelValTest {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!