Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
platform
/
platform-charging-server
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 21774812
authored
Nov 08, 2023
by
zhouhaibao
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
[+]新增日志
1 parent
9791bd7f
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
78 additions
and
9 deletions
platform-charging/src/main/java/cn/com/glsx/charging/modules/gbt/ocpp16/tcp/base/TcpMapper.java
platform-charging/src/main/java/cn/com/glsx/charging/modules/gbt/ocpp16/tcp/handler/LoginReqHandler.java
platform-charging/src/main/java/cn/com/glsx/charging/modules/gbt/ocpp16/tcp/handler/ModelSetRspHandler.java
platform-charging/src/main/java/cn/com/glsx/charging/modules/gbt/ocpp16/tcp/protocol/ModelSetReq.java
platform-charging/src/main/java/cn/com/glsx/charging/modules/gbt/ocpp16/tcp/protocol/ModelSetRsp.java
platform-charging/src/test/java/cn/com/glsx/charging/gbt/ocpp16/ModelChargingTest.java
platform-charging/src/test/java/cn/com/glsx/charging/gbt/ocpp16/ModelSetTest.java
platform-charging/src/test/java/cn/com/glsx/charging/gbt/ocpp16/ModelValTest.java
platform-charging/src/main/java/cn/com/glsx/charging/modules/gbt/ocpp16/tcp/base/TcpMapper.java
View file @
2177481
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
)
{
...
...
platform-charging/src/main/java/cn/com/glsx/charging/modules/gbt/ocpp16/tcp/handler/LoginReqHandler.java
View file @
2177481
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
);
...
...
platform-charging/src/main/java/cn/com/glsx/charging/modules/gbt/ocpp16/tcp/handler/ModelSetRspHandler.java
0 → 100644
View file @
2177481
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
;
}
}
platform-charging/src/main/java/cn/com/glsx/charging/modules/gbt/ocpp16/tcp/protocol/ModelSetReq.java
View file @
2177481
...
...
@@ -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日
...
...
platform-charging/src/main/java/cn/com/glsx/charging/modules/gbt/ocpp16/tcp/protocol/ModelSetRsp.java
View file @
2177481
...
...
@@ -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日
...
...
platform-charging/src/test/java/cn/com/glsx/charging/gbt/ocpp16/ModelChargingTest.java
View file @
2177481
...
...
@@ -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
{
...
...
platform-charging/src/test/java/cn/com/glsx/charging/gbt/ocpp16/ModelSetTest.java
0 → 100644
View file @
2177481
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
);
}
}
platform-charging/src/test/java/cn/com/glsx/charging/gbt/ocpp16/ModelValTest.java
View file @
2177481
...
...
@@ -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
{
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment