Commit 4c90d9c0 by zhouhaibao

[+]参数修改

1 parent 775c03db
......@@ -187,7 +187,7 @@ public class PileControController extends BaseController {
data.setGunNumber((byte) 1);
data.setPileId(Ocpp16Helper.strToBcd(pileId, data.getPileId()));
data.setUpdateBalance(Ocpp16Helper.bigDecimalToByteArray(updateBalance, 4));
data.setPhyCardNumber(Ocpp16Helper.strToBcd(phyCardNumber, data.getPhyCardNumber()));
data.setPhyCardNumber(ByteUtils.fromHex(phyCardNumber));
req.setData(data);
TcpCallback<TcpRsp> tcpRspTcpCallback = ServerMain.getServer().sendSync(req);
TcpRsp tcpRsp = tcpRspTcpCallback.get();
......
......@@ -5,6 +5,7 @@ import cn.com.glsx.charging.modules.gbt.ocpp16.tcp.base.TcpHandler;
import cn.com.glsx.charging.modules.gbt.ocpp16.tcp.protocol.BalanceUpdateRsp;
import cn.com.glsx.charging.modules.gbt.ocpp16.tcp.protocol.ModelSetRsp;
import cn.com.glsx.charging.modules.gbt.ocpp16.tcp.server.ProxyHelper;
import cn.com.glsx.charging.util.ByteUtils;
import io.netty.channel.Channel;
import lombok.extern.slf4j.Slf4j;
......@@ -16,7 +17,7 @@ public class BalanceUpdateRspHandler implements TcpHandler<BalanceUpdateRsp, Bal
//
log.info("余额更新的桩号{}", Ocpp16Helper.bcdToStr(req.getData().getPileId()));
log.info("余额更新的物理卡号{}",
Ocpp16Helper.bcdToStr(req.getData().getPhyCardNumber()));
ByteUtils.toHex(req.getData().getPhyCardNumber()));
log.info("修改结果{}", req.getData().getUpdateResult());
ProxyHelper.getCallbackKey(req,channel,req);
return null;
......
......@@ -87,4 +87,11 @@ public class ModelChargingReqHandler implements TcpHandler<ModelChargingReq, Mod
return rsp;
}
public static void main(String[] args) {
byte[] bytes = ByteUtils.fromHex("00000000D14B0A54");
System.out.println(bytes);
String bytes1 = ByteUtils.toHex(bytes);
System.out.println(bytes1);
}
}
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!