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 4776ab7c
authored
Nov 07, 2023
by
chenxi
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
Merge remote-tracking branch 'origin/master'
2 parents
710fad26
c23dade5
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
13 additions
and
10 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/protocol/interactive/req/ShutdownMachineReq.java
platform-charging/src/main/java/cn/com/glsx/charging/modules/gbt/ocpp16/tcp/protocol/interactive/req/StartMachineReq.java
platform-charging/src/main/java/cn/com/glsx/charging/modules/gbt/ocpp16/tcp/protocol/interactive/resp/ShutdownMachineResp.java
platform-charging/src/main/java/cn/com/glsx/charging/modules/gbt/ocpp16/tcp/protocol/interactive/resp/StartMachineResp.java
platform-charging/src/test/java/cn/com/glsx/charging/gbt/ocpp16/CrcTest.java
platform-charging/src/main/java/cn/com/glsx/charging/modules/gbt/ocpp16/tcp/base/TcpMapper.java
View file @
4776ab7
...
...
@@ -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
(
0x3
3
,
"远程启动充电命令回复"
,
StartMachineRespHandler
.
class
);
public
static
TcpMapper
CMD_RSP_START_CHARGING
=
regist
(
0x3
1
,
"充电桩主动申请启动充电 "
,
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
)
{
...
...
platform-charging/src/main/java/cn/com/glsx/charging/modules/gbt/ocpp16/tcp/protocol/interactive/req/ShutdownMachineReq.java
View file @
4776ab7
...
...
@@ -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
());
}
}
platform-charging/src/main/java/cn/com/glsx/charging/modules/gbt/ocpp16/tcp/protocol/interactive/req/StartMachineReq.java
View file @
4776ab7
...
...
@@ -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
());
}
}
platform-charging/src/main/java/cn/com/glsx/charging/modules/gbt/ocpp16/tcp/protocol/interactive/resp/ShutdownMachineResp.java
View file @
4776ab7
...
...
@@ -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
());
}
}
platform-charging/src/main/java/cn/com/glsx/charging/modules/gbt/ocpp16/tcp/protocol/interactive/resp/StartMachineResp.java
View file @
4776ab7
...
...
@@ -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
());
}
}
platform-charging/src/test/java/cn/com/glsx/charging/gbt/ocpp16/CrcTest.java
View file @
4776ab7
...
...
@@ -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
);
Time
Notify
protocol
=
Ocpp16Helper
.
parse
(
bytes
);
Time
SettingReq
protocol
=
Ocpp16Helper
.
parse
(
bytes
);
log
.
info
(
"expect: "
+
protocol
.
getCrc
());
byte
[]
data
=
ByteUtils
.
getBytes
(
bytes
,
2
,
bytes
.
length
-
4
);
...
...
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