Commit 4776ab7c by chenxi

Merge remote-tracking branch 'origin/master'

2 parents 710fad26 c23dade5
......@@ -54,12 +54,16 @@ public final class TcpMapper {
public static TcpMapper CMD_RSP_MODEL_QUERY = regist(0x0A, "计费模型请求应答", null);
// public static TcpMapper CMD_NOTIFY_TIME = regist(0x56, "对时设置", TimeNotifyHandler.class);
// public static TcpMapper CMD_NOTIFY_TIME = regist(0x56, "对时设置", TimeNotifyHandler.class);
// 运营交互帧类型码数据定义 0x31~0x47
public static TcpMapper CMD_RSP_START_CHARGING = regist(0x33, "远程启动充电命令回复", StartMachineRespHandler.class);
public static TcpMapper CMD_RSP_START_CHARGING = regist(0x31, "充电桩主动申请启动充电 ", null);
public static TcpMapper CMD_REQ_START_CHARGING = regist(0x34, "运营平台远程控制启机", StartMachineReqHandler.class);
public static TcpMapper CMD_REQ_START_CHARGING = regist(0x32, "充电桩主动申请启动充电应答", null);
public static TcpMapper CMD_RSP_REMOTE_START_CHARGING = regist(0x33, "远程启动充电命令回复", StartMachineRespHandler.class);
public static TcpMapper CMD_REQ_REMOTE_START_CHARGING = regist(0x34, "运营平台远程控制启机", StartMachineReqHandler.class);
public static TcpMapper CMD_RSP_STOP_CHARGING = regist(0x35, "远程停机命令回复", ShutdownMachineRespHandler.class);
......@@ -77,7 +81,6 @@ public final class TcpMapper {
public static TcpMapper CMD_RSP_TIME_CHECK = regist(0x55, "对时设置应答", TimeSettingRspHandler.class);
public static TcpMapper fromType(byte type) {
TcpMapper c = mappers.get(type);
if (c == null) {
......
......@@ -12,6 +12,6 @@ import cn.com.glsx.charging.modules.gbt.ocpp16.tcp.data.interactive.ShutdownMach
*/
public class ShutdownMachineReq extends TcpReq<ShutdownMachineReqData> {
public ShutdownMachineReq() {
super(TcpMapper.FTCD_REQ_REMOTE_SHUTDOWN.getType());
super(TcpMapper.CMD_REQ_STOP_CHARGING.getType());
}
}
......@@ -12,6 +12,6 @@ import cn.com.glsx.charging.modules.gbt.ocpp16.tcp.data.interactive.StartMachine
*/
public class StartMachineReq extends TcpReq<StartMachineReqData> {
public StartMachineReq() {
super(TcpMapper.CMD_REQ_START_CHARGING.getType());
super(TcpMapper.CMD_REQ_REMOTE_START_CHARGING.getType());
}
}
......@@ -12,6 +12,6 @@ import cn.com.glsx.charging.modules.gbt.ocpp16.tcp.data.interactive.ShutdownMach
*/
public class ShutdownMachineResp extends TcpReq<ShutdownMachineRespData> {
public ShutdownMachineResp() {
super(TcpMapper.FTCD_RSP_REMOTE_SHUTDOWN.getType());
super(TcpMapper.CMD_RSP_STOP_CHARGING.getType());
}
}
......@@ -12,6 +12,6 @@ import cn.com.glsx.charging.modules.gbt.ocpp16.tcp.data.interactive.StartMachine
*/
public class StartMachineResp extends TcpRsp<StartMachineRspData> {
public StartMachineResp() {
super(TcpMapper.CMD_RSP_START_CHARGING.getType());
super(TcpMapper.CMD_RSP_REMOTE_START_CHARGING.getType());
}
}
......@@ -9,7 +9,7 @@ import cn.com.glsx.charging.modules.gbt.ocpp16.tcp.protocol.login.HeartbeatReq;
import cn.com.glsx.charging.modules.gbt.ocpp16.tcp.protocol.login.HeartbeatRsp;
import cn.com.glsx.charging.modules.gbt.ocpp16.tcp.protocol.login.LoginReq;
import cn.com.glsx.charging.modules.gbt.ocpp16.tcp.protocol.login.LoginRsp;
import cn.com.glsx.charging.modules.gbt.ocpp16.tcp.protocol.login.TimeNotify;
import cn.com.glsx.charging.modules.gbt.ocpp16.tcp.protocol.time.TimeSettingReq;
import cn.com.glsx.charging.util.ByteUtils;
import cn.com.glsx.charging.util.CrcUtils;
import lombok.extern.slf4j.Slf4j;
......@@ -107,7 +107,7 @@ public class CrcTest {
String hex = "68120002005655031412782305F055020E070B178676";
log.info(hex);
byte[] bytes = ByteUtils.fromHex(hex);
TimeNotify protocol = Ocpp16Helper.parse(bytes);
TimeSettingReq protocol = Ocpp16Helper.parse(bytes);
log.info("expect: " + protocol.getCrc());
byte[] data = ByteUtils.getBytes(bytes, 2, bytes.length - 4);
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!