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 3d26008c
authored
Nov 10, 2023
by
叶立庆
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
Merge branch 'master' of
http://192.168.3.233:8090/platform/platform-charging-server
2 parents
cb29cf23
a5c48b6a
Hide whitespace changes
Inline
Side-by-side
Showing
29 changed files
with
1250 additions
and
1 deletions
platform-charging/src/main/java/cn/com/glsx/charging/modules/controller/GetDataController.java
platform-charging/src/main/java/cn/com/glsx/charging/modules/controller/ParkingLockController.java
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/data/ChargingBmsMachineReqData.java
platform-charging/src/main/java/cn/com/glsx/charging/modules/gbt/ocpp16/tcp/data/ChargingBmsReqData.java
platform-charging/src/main/java/cn/com/glsx/charging/modules/gbt/ocpp16/tcp/data/MachineParamConfigReqData.java
platform-charging/src/main/java/cn/com/glsx/charging/modules/gbt/ocpp16/tcp/data/ParkingLockChangeStatusReqData.java
platform-charging/src/main/java/cn/com/glsx/charging/modules/gbt/ocpp16/tcp/data/ParkingLockChangeStatusRspData.java
platform-charging/src/main/java/cn/com/glsx/charging/modules/gbt/ocpp16/tcp/data/ParkingLockStatusReportReqData.java
platform-charging/src/main/java/cn/com/glsx/charging/modules/gbt/ocpp16/tcp/data/RealTimeDataReqData.java
platform-charging/src/main/java/cn/com/glsx/charging/modules/gbt/ocpp16/tcp/handler/ChargingBmsMachineRspHandler.java
platform-charging/src/main/java/cn/com/glsx/charging/modules/gbt/ocpp16/tcp/handler/ChargingBmsRspHandler.java
platform-charging/src/main/java/cn/com/glsx/charging/modules/gbt/ocpp16/tcp/handler/MachineParamConfigRspHandler.java
platform-charging/src/main/java/cn/com/glsx/charging/modules/gbt/ocpp16/tcp/handler/ParkingLockChangeStatusReqHandler.java
platform-charging/src/main/java/cn/com/glsx/charging/modules/gbt/ocpp16/tcp/handler/ParkingLockChangeStatusRspHandler.java
platform-charging/src/main/java/cn/com/glsx/charging/modules/gbt/ocpp16/tcp/handler/ParkingLockStatusReportReqHandler.java
platform-charging/src/main/java/cn/com/glsx/charging/modules/gbt/ocpp16/tcp/handler/RealTimeDataReqHandler.java
platform-charging/src/main/java/cn/com/glsx/charging/modules/gbt/ocpp16/tcp/protocol/ChargingBmsMachineReq.java
platform-charging/src/main/java/cn/com/glsx/charging/modules/gbt/ocpp16/tcp/protocol/ChargingBmsReq.java
platform-charging/src/main/java/cn/com/glsx/charging/modules/gbt/ocpp16/tcp/protocol/MachineParamConfigReq.java
platform-charging/src/main/java/cn/com/glsx/charging/modules/gbt/ocpp16/tcp/protocol/ParkingLockChangeStatusReq.java
platform-charging/src/main/java/cn/com/glsx/charging/modules/gbt/ocpp16/tcp/protocol/ParkingLockChangeStatusRsp.java
platform-charging/src/main/java/cn/com/glsx/charging/modules/gbt/ocpp16/tcp/protocol/ParkingLockStatusReportReq.java
platform-charging/src/main/java/cn/com/glsx/charging/modules/gbt/ocpp16/tcp/protocol/RealTimeReq.java
platform-charging/src/test/java/cn/com/glsx/charging/gbt/ocpp16/ChargingBmsMachineTest.java
platform-charging/src/test/java/cn/com/glsx/charging/gbt/ocpp16/ChargingBmsTest.java
platform-charging/src/test/java/cn/com/glsx/charging/gbt/ocpp16/GetDataTest.java
platform-charging/src/test/java/cn/com/glsx/charging/gbt/ocpp16/MachineParamConfigTest.java
platform-charging/src/test/java/cn/com/glsx/charging/gbt/ocpp16/ParkingLockTest.java
platform-charging/src/main/java/cn/com/glsx/charging/modules/controller/GetDataController.java
0 → 100644
View file @
3d26008
package
cn
.
com
.
glsx
.
charging
.
modules
.
controller
;
import
cn.com.glsx.charging.modules.BaseController
;
import
cn.com.glsx.charging.modules.gbt.ocpp16.Ocpp16Helper
;
import
cn.com.glsx.charging.modules.gbt.ocpp16.ServerMain
;
import
cn.com.glsx.charging.modules.gbt.ocpp16.tcp.base.TcpCallback
;
import
cn.com.glsx.charging.modules.gbt.ocpp16.tcp.base.TcpRsp
;
import
cn.com.glsx.charging.modules.gbt.ocpp16.tcp.data.RealTimeDataReqData
;
import
cn.com.glsx.charging.modules.gbt.ocpp16.tcp.protocol.RealTimeReq
;
import
com.glsx.plat.core.annotation.ResponseResultBody
;
import
com.glsx.plat.core.web.R
;
import
io.swagger.v3.oas.annotations.Operation
;
import
io.swagger.v3.oas.annotations.tags.Tag
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.ibatis.annotations.Param
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
/**
* @Author: chenxi
* @Date: 2023/11/10
*/
@Slf4j
@Tag
(
name
=
""
)
@RestController
@RequestMapping
(
value
=
"/getdata"
)
@ResponseResultBody
public
class
GetDataController
extends
BaseController
{
@Operation
(
summary
=
"读取实时监测数据"
,
description
=
"读取实时监测数据"
)
@GetMapping
(
"/realtime"
)
public
R
<
Boolean
>
getRealTimeData
(
@Param
(
"pileId"
)
String
pileId
,
@Param
(
"gunNumber"
)
String
gunNumber
)
{
log
.
info
(
"读取实时监测数据,充电桩编号:{}"
,
pileId
);
log
.
info
(
"读取实时监测数据,枪号:{}"
,
gunNumber
);
RealTimeReq
req
=
new
RealTimeReq
();
RealTimeDataReqData
data
=
new
RealTimeDataReqData
();
data
.
setPileId
(
Ocpp16Helper
.
strToBcd
(
pileId
,
data
.
getPileId
()));
data
.
setPileId
(
Ocpp16Helper
.
strToBcd
(
pileId
,
new
byte
[]
{
data
.
getGunNumber
()}
));
TcpCallback
<
TcpRsp
>
tcpRspTcpCallback
=
ServerMain
.
getServer
().
sendSync
(
req
);
TcpRsp
tcpRsp
=
tcpRspTcpCallback
.
get
();
return
R
.
ok
().
data
(
tcpRsp
);
}
}
platform-charging/src/main/java/cn/com/glsx/charging/modules/controller/ParkingLockController.java
0 → 100644
View file @
3d26008
package
cn
.
com
.
glsx
.
charging
.
modules
.
controller
;
import
cn.com.glsx.charging.modules.gbt.ocpp16.Ocpp16Helper
;
import
cn.com.glsx.charging.modules.gbt.ocpp16.ServerMain
;
import
cn.com.glsx.charging.modules.gbt.ocpp16.tcp.base.TcpCallback
;
import
cn.com.glsx.charging.modules.gbt.ocpp16.tcp.base.TcpRsp
;
import
cn.com.glsx.charging.modules.gbt.ocpp16.tcp.data.ParkingLockChangeStatusReqData
;
import
cn.com.glsx.charging.modules.gbt.ocpp16.tcp.protocol.ParkingLockChangeStatusReq
;
import
cn.com.glsx.charging.modules.gbt.ocpp16.tcp.protocol.ParkingLockChangeStatusRsp
;
import
com.glsx.plat.core.annotation.ResponseResultBody
;
import
com.glsx.plat.core.web.Result
;
import
io.swagger.v3.oas.annotations.Operation
;
import
io.swagger.v3.oas.annotations.tags.Tag
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.ibatis.annotations.Param
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.Objects
;
/**
* @Title:
* @Description:
* @Author xiehx
* @Date 2023/11/10
**/
@Slf4j
@Tag
(
name
=
"地锁开放接口"
)
@RestController
@RequestMapping
(
value
=
"/api/charging/parkingLocks"
)
@ResponseResultBody
public
class
ParkingLockController
{
@Operation
(
summary
=
"遥控地锁升锁与降锁命令"
,
description
=
"遥控地锁升锁与降锁命令(升锁 0X55,降锁 0XFF)"
)
@GetMapping
(
"/changeStatus"
)
public
Result
<
String
>
changeStatus
(
@Param
(
"pileId"
)
String
pileId
,
@Param
(
"gunNo"
)
Integer
gunNo
,
@Param
(
"status"
)
String
status
)
{
log
.
info
(
"遥控地锁升锁与降锁 请求参数pileId {} gunNo {} status {}"
,
pileId
,
gunNo
,
status
);
ParkingLockChangeStatusReqData
data
=
new
ParkingLockChangeStatusReqData
();
data
.
setPileId
(
Ocpp16Helper
.
strToBcd
(
pileId
,
data
.
getPileId
()));
data
.
setGunNo
(
gunNo
.
byteValue
());
data
.
setStatus
(
Ocpp16Helper
.
strToBcd
(
status
,
data
.
getStatus
()));
ParkingLockChangeStatusReq
req
=
new
ParkingLockChangeStatusReq
();
req
.
setData
(
data
);
TcpCallback
<
TcpRsp
>
callback
=
ServerMain
.
getServer
().
sendSync
(
req
);
ParkingLockChangeStatusRsp
rsp
=
(
ParkingLockChangeStatusRsp
)
callback
.
get
();
log
.
info
(
"遥控地锁升锁与降锁 结果 {}"
,
rsp
);
if
(
Objects
.
nonNull
(
rsp
)
&&
rsp
.
getData
().
getResult
()
==
1
)
{
return
Result
.
success
(
"成功"
);
}
else
{
return
Result
.
failure
();
}
}
}
platform-charging/src/main/java/cn/com/glsx/charging/modules/gbt/ocpp16/tcp/base/TcpMapper.java
View file @
3d26008
...
...
@@ -42,10 +42,14 @@ public final class TcpMapper {
public
static
TcpMapper
CMD_RSP_MODEL_QUERY
=
regist
(
0x0A
,
"计费模型请求应答"
,
null
);
public
static
TcpMapper
CMD_REQ_UPLOAD_REAL_TIME_DATA
=
regist
(
0x13
,
"读取实时检测数据"
,
UploadRealTimeReqHandler
.
class
);
public
static
TcpMapper
CMD_REQ_GET_REAL_TIME_DATA
=
regist
(
0x12
,
"读取实时检测数据"
,
RealTimeDataReqHandler
.
class
);
public
static
TcpMapper
CMD_REQ_UPLOAD_REAL_TIME_DATA
=
regist
(
0x13
,
"上传实时检测数据"
,
UploadRealTimeReqHandler
.
class
);
public
static
TcpMapper
CMD_REQ_CHARGING_HAND_SHAKE
=
regist
(
0x15
,
"充电握手"
,
ChargingHandshakeReqHandler
.
class
);
public
static
TcpMapper
CMD_RSP_MACHINE_PARAM_CONFIG
=
regist
(
0x17
,
"参数配置"
,
MachineParamConfigRspHandler
.
class
);
public
static
TcpMapper
CMD_REQ_CHARGING_COMPLETION
=
regist
(
0x19
,
"充电结束"
,
ChargingCompletionReqHandler
.
class
);
public
static
TcpMapper
CMD_REQ_ERROR_MESSAGE
=
regist
(
0x1B
,
"错误报文"
,
ErrorMessageReqHandler
.
class
);
...
...
@@ -54,6 +58,10 @@ public final class TcpMapper {
public
static
TcpMapper
CMD_REQ_MACHINE_ABORT_CHARGING
=
regist
(
0x21
,
"充电阶段充电机中止"
,
MachineChargingReqHandler
.
class
);
public
static
TcpMapper
CMD_RSP_CHARGING_BMS_MACHINE
=
regist
(
0x23
,
"充电过程BMS需求与充电机输出"
,
ChargingBmsMachineRspHandler
.
class
);
public
static
TcpMapper
CMD_RSP_CHARGING_BMS
=
regist
(
0x25
,
"充电过程BMS信息"
,
ChargingBmsRspHandler
.
class
);
// public static TcpMapper CMD_NOTIFY_TIME = regist(0x56, "对时设置", TimeNotifyHandler.class);
// 运营交互帧类型码数据定义 0x31~0x47
...
...
@@ -109,6 +117,12 @@ public final class TcpMapper {
public
static
TcpMapper
CMD_RSP_REMOTE_UPDATE
=
regist
(
0x93
,
"远程更新应答"
,
RemoteRestartRspHandler
.
class
);
public
static
TcpMapper
CMD_REQ_PARKING_LOCK_STATUS_REPORT
=
regist
(
0x61
,
"地锁数据上送"
,
ParkingLockStatusReportReqHandler
.
class
);
public
static
TcpMapper
CMD_REQ_PARKING_LOCK_CHANGE_STATUS
=
regist
(
0x62
,
"遥控地锁升锁与降锁命令"
,
ParkingLockChangeStatusReqHandler
.
class
);
public
static
TcpMapper
CMD_RSP_PARKING_LOCK_CHANGE_STATUS
=
regist
(
0x63
,
"充电桩返回数据(上行)"
,
ParkingLockChangeStatusRspHandler
.
class
);
public
static
TcpMapper
fromType
(
byte
type
)
{
TcpMapper
c
=
mappers
.
get
(
type
);
...
...
platform-charging/src/main/java/cn/com/glsx/charging/modules/gbt/ocpp16/tcp/data/ChargingBmsMachineReqData.java
0 → 100644
View file @
3d26008
package
cn
.
com
.
glsx
.
charging
.
modules
.
gbt
.
ocpp16
.
tcp
.
data
;
import
cn.com.glsx.charging.modules.gbt.ocpp16.tcp.base.TcpData
;
import
lombok.Data
;
/**
* @Author: chenx
* @Description: 充电过程BMS需求与充电机输出-上报实体类
* @Date: 2023/11/10 17:55
* @Version: 1.0
*/
@Data
public
class
ChargingBmsMachineReqData
extends
TcpData
{
/**
* 交易流水号
* 数据类型:byte[] (BCD码)
* 长度(Byte):16
* 备注:
*/
private
byte
[]
transactionSerialNumber
=
new
byte
[
16
];
/**
* 桩编号
* 数据类型:byte[] (BCD码)
* 长度(Byte):7
* 备注:不足7位补0
*/
private
byte
[]
pileId
=
new
byte
[
7
];
/**
* 枪号
* 数据类型:byte[] (BCD码)
* 长度(Byte):1
* 备注:
*/
private
byte
gunNumber
;
/**
* BMS 电压需求
* 数据类型:byte[] (bin码)
* 长度(Byte):2
* 备注:0.1 V/位,0 V 偏移量
*/
private
byte
[]
bmsRequiredVoltage
=
new
byte
[
2
];
/**
* BMS 电流需求
* 数据类型:byte[] (bin码)
* 长度(Byte):2
* 备注:0.1 A/位,-400 A 偏移量
*/
private
byte
[]
bmsRequiredCurrent
=
new
byte
[
2
];
/**
* BMS 充电模式
* 数据类型:byte (bin码)
* 长度(Byte):1
* 备注:0x01:恒压充电;0x02:恒流充电
*/
private
byte
bmsChargingMode
;
/**
* BMS 充电电压测量值
* 数据类型:byte[] (bin码)
* 长度(Byte):2
* 备注:0.1 V/位,0 V 偏移量
*/
private
byte
[]
bmsChargingMeasuredVoltage
=
new
byte
[
2
];
/**
* BMS 充电电流测量值
* 数据类型:byte[] (bin码)
* 长度(Byte):2
* 备注:0.1 A/位,-400 A 偏移量
*/
private
byte
[]
bmsChargingMeasuredCurrent
=
new
byte
[
2
];
/**
* BMS 最高单体动力蓄电池电压及组号
* 数据类型:byte[] (bin码)
* 长度(Byte):2
* 备注:1-12 位:最高单体动力蓄电池电压,数据分辨率:0.01 V/位,0 V偏移量;数据范围:0~24 V;13-16 位:最高单体动力蓄电池电
* 压所在组号,数据分辨率:1/位,0 偏移量;数据范围:0~15
*/
private
byte
[]
bmsHighestVoltageAndNumber
=
new
byte
[
2
];
/**
* BMS 当前荷电状态 SOC( %)
* 数据类型:byte (bin码)
* 长度(Byte):1
* 备注:1%/位,0%偏移量;数据范围:0~100%
*/
private
byte
bmsChargingSoc
;
/**
* BMS 估算剩余充电时间
* 数据类型:byte[] (bin码)
* 长度(Byte):2
* 1 min/位,0 min 偏移量;数据范围:0~600 min
*/
private
byte
[]
bmsLeftChargingTime
=
new
byte
[
2
];
}
platform-charging/src/main/java/cn/com/glsx/charging/modules/gbt/ocpp16/tcp/data/ChargingBmsReqData.java
0 → 100644
View file @
3d26008
package
cn
.
com
.
glsx
.
charging
.
modules
.
gbt
.
ocpp16
.
tcp
.
data
;
import
cn.com.glsx.charging.modules.gbt.ocpp16.tcp.base.TcpData
;
import
lombok.Data
;
/**
* @Author: chenx
* @Description: 充电过程BMS信息-上报实体类
* @Date: 2023/11/10 18:08
* @Version: 1.0
*/
@Data
public
class
ChargingBmsReqData
extends
TcpData
{
/**
* 交易流水号
* 数据类型:byte[] (BCD码)
* 长度(Byte):16
* 备注:
*/
private
byte
[]
transactionSerialNumber
=
new
byte
[
16
];
/**
* 桩编号
* 数据类型:byte[] (BCD码)
* 长度(Byte):7
* 备注:不足7位补0
*/
private
byte
[]
pileId
=
new
byte
[
7
];
/**
* 枪号
* 数据类型:byte[] (BCD码)
* 长度(Byte):1
* 备注:
*/
private
byte
gunNumber
;
/**
* BMS 最高单体动力蓄电池电压所在编号
* 数据类型:byte (bin码)
* 长度(Byte):1
* 备注:1/位,1 偏移量;数据范围:1~256
*/
private
byte
bmsHighestVoltageNumber
;
/**
* BMS 最高单体动力蓄电池温度
* 数据类型:byte (bin码)
* 长度(Byte):1
* 备注:1ºC/位,-50 ºC 偏移量;数据范围:-50 ºC ~+200 ºC
*/
private
byte
bmsBatteryTemperature
;
/**
* BMS 最高温度检测点编号
* 数据类型:byte (bin码)
* 长度(Byte):1
* 备注:1/位,1 偏移量;数据范围:1~128
*/
private
byte
highestBatteryTemperatureNumber
;
/**
* BMS 最低动力蓄电池温度
* 数据类型:byte (bin码)
* 长度(Byte):1
* 备注:1ºC/位,-50 ºC 偏移量;数据范围:-50 ºC ~+200 ºC
*/
private
byte
lowestTemperatureNumber
;
/**
* BMS 最低单体动力蓄电池电压所在编号
* 数据类型:byte (bin码)
* 长度(Byte):1
* 备注:1/位,1 偏移量;数据范围:1~256
*/
private
byte
lowestBatteryTemperatureNumber
;
/**
* BMS 单体动力蓄电池电压过高/过低
* 数据类型:byte (bin码)
* 长度(Byte):2
* 备注:(<00>:=正常; <01>:=过高; <10>:=过低)
*/
private
byte
[]
bmsBatteryVoltageStatus
=
new
byte
[
2
];
/**
* BMS 整车动力蓄电池荷电状态SOC 过高/过低
* 数据类型:byte (bin码)
* 长度(Byte):2
* 备注:(<00>:=正常; <01>:=过高; <10>:=过低)
*/
private
byte
[]
bmsBatteryChargingStatus
=
new
byte
[
2
];
/**
* BMS 动力蓄电池充电过电流
* 数据类型:byte (bin码)
* 长度(Byte):2
* 备注:(<00>:=正常; <01>:=过流; <10>:=不可信状态)
*/
private
byte
[]
bmsBatteryOverCurrent
=
new
byte
[
2
];
/**
* BMS 动力蓄电池温度过高
* 数据类型:byte (bin码)
* 长度(Byte):2
* 备注:(<00>:=正常; <01>:=过流; <10>:=不可信状态)
*/
private
byte
[]
bmsBatteryTemperatureStatus
=
new
byte
[
2
];
/**
* BMS 动力蓄电池绝缘状态
* 数据类型:byte (bin码)
* 长度(Byte):2
* 备注:(<00>:=正常; <01>:=过流; <10>:=不可信状态)
*/
private
byte
[]
bmsBatteryInsulationState
=
new
byte
[
2
];
/**
* 充电禁止
* 数据类型:byte (bin码)
* 长度(Byte):2
* 备注:(<00>:=禁止; <01>:=允许)
*/
private
byte
[]
chargingProhibition
=
new
byte
[
2
];
/**
* 预留位
* 数据类型:byte (bin码)
* 长度(Byte):2
* 备注:00
*/
private
byte
[]
reserved
=
new
byte
[
2
];
}
platform-charging/src/main/java/cn/com/glsx/charging/modules/gbt/ocpp16/tcp/data/MachineParamConfigReqData.java
0 → 100644
View file @
3d26008
package
cn
.
com
.
glsx
.
charging
.
modules
.
gbt
.
ocpp16
.
tcp
.
data
;
import
cn.com.glsx.charging.modules.gbt.ocpp16.tcp.base.TcpData
;
import
lombok.Data
;
/**
* @Author: chenx
* @Description: 参数配置-上报实体类
* @Date: 2023/11/10 17:39
* @Version: 1.0
*/
@Data
public
class
MachineParamConfigReqData
extends
TcpData
{
/**
* 交易流水号
* 数据类型:byte[] (BCD码)
* 长度(Byte):16
* 备注:
*/
private
byte
[]
transactionSerialNumber
=
new
byte
[
16
];
/**
* 桩编号
* 数据类型:byte[] (BCD码)
* 长度(Byte):7
* 备注:不足7位补0
*/
private
byte
[]
pileId
=
new
byte
[
7
];
/**
* 枪号
* 数据类型:byte[] (BCD码)
* 长度(Byte):1
* 备注:
*/
private
byte
gunNumber
;
/**
* BMS 单体动力蓄电池最高允许充电电压
* 数据类型:byte[] (bin码)
* 长度(Byte):2
* 备注:0.01 V/位,0 V 偏移量; 数据范围:0~24 V
*/
private
byte
[]
bmsBatteryHighestVoltage
=
new
byte
[
2
];
/**
* BMS最高允许充电电流
* 数据类型:byte[] (bin码)
* 长度(Byte):2
* 备注:0.1 A/位,-400A 偏移量
*/
private
byte
[]
bmsBatteryHighestCurrent
=
new
byte
[
2
];
/**
* BMS 最高允许充电总电压
* 数据类型:byte[] (bin码)
* 长度(Byte):2
* 备注:0.1 V/位,0 V 偏移量
*/
private
byte
[]
bmsBatteryHighestTotalVoltage
=
new
byte
[
2
];
/**
* BMS 最高允许温度
* 数据类型:byte (bin码)
* 长度(Byte):1
* 备注:1ºC/位,-50 ºC 偏移量;数据范围:-50 ºC ~+200 ºC
*/
private
byte
bmsBatteryHighestTemperature
;
/**
* BMS 整车动力蓄电池荷电状态(soc)
* 数据类型:byte[] (bin码)
* 长度(Byte):2
* 备注:0.1%/位,0%偏移量;数据范围:0~100%
*/
private
byte
[]
bmsBatteryStatus
=
new
byte
[
2
];
/**
* BMS 整车动力蓄电池当前电池电压
* 数据类型:byte[] (bin码)
* 长度(Byte):2
* 备注:整车动力蓄电池总电压
*/
private
byte
[]
bmsBatteryCurrentVoltage
=
new
byte
[
2
];
/**
* 电桩最高输出电压
* 数据类型:byte[] (bin码)
* 长度(Byte):2
* 备注:0.1 V /位,0 V 偏移量
*/
private
byte
[]
pileHighestOutputVoltage
=
new
byte
[
2
];
/**
* 电桩最低输出电压
* 数据类型:byte[] (bin码)
* 长度(Byte):2
* 备注:0.1 V /位,0 V 偏移量
*/
private
byte
[]
pileLowestOutputVoltage
=
new
byte
[
2
];
/**
* 电桩最大输出电流
* 数据类型:byte[] (bin码)
* 长度(Byte):2
* 备注:0.1 A/位,-400A 偏移量
*/
private
byte
[]
pileHighestCurrent
=
new
byte
[
2
];
/**
* 电桩最小输出电流
* 数据类型:byte[] (bin码)
* 长度(Byte):2
* 备注:0.1 A/位,-400A 偏移量
*/
private
byte
[]
pileLowestCurrent
=
new
byte
[
2
];
}
platform-charging/src/main/java/cn/com/glsx/charging/modules/gbt/ocpp16/tcp/data/ParkingLockChangeStatusReqData.java
0 → 100644
View file @
3d26008
package
cn
.
com
.
glsx
.
charging
.
modules
.
gbt
.
ocpp16
.
tcp
.
data
;
import
cn.com.glsx.charging.modules.gbt.ocpp16.tcp.base.TcpData
;
import
lombok.Data
;
/**
* 遥控地锁升锁与降锁命令
*
* 68(起始标志) 0D(数据长度) 0001(序列号域) 00(加密标志) 62(类型) 32010200000001
* (桩编码) 0x01(枪号: 1 号枪) 55(升/降地锁) 00000000(预留位) 6890(帧校验域)
*
* @Title:
* @Description:
* @Author xiehx
* @Date 2023/11/10
**/
@Data
public
class
ParkingLockChangeStatusReqData
extends
TcpData
{
/**
* 参数名称:桩编号
* 数据类型:BCD 码
* 长度:Byte
* 备注:充电桩资产编号,系统参数的编号 (终端机器编码)
*
* 充电桩id: BCD 码 ,不足 7 位补 0
*/
private
byte
[]
pileId
=
new
byte
[
7
];
/**
* 枪号 BIN 码 1
*/
private
byte
gunNo
;
/**
* 升/降地锁 BCD 码 1
*
* 升锁 0X55,降锁 0XFF
*/
private
byte
[]
status
=
new
byte
[
1
];
/**
* 预留位 BIN 码 4
*
* 全部置 0(可用于多枪)
*/
private
byte
[]
other
=
new
byte
[
4
];
}
platform-charging/src/main/java/cn/com/glsx/charging/modules/gbt/ocpp16/tcp/data/ParkingLockChangeStatusRspData.java
0 → 100644
View file @
3d26008
package
cn
.
com
.
glsx
.
charging
.
modules
.
gbt
.
ocpp16
.
tcp
.
data
;
import
cn.com.glsx.charging.modules.gbt.ocpp16.tcp.base.TcpData
;
import
lombok.Data
;
/**
* 地锁收到遥控地锁升锁与降锁命令指令,响应本数据
*
* 68(起始标志) 0D(数据长度) 0001(序列号域) 00(加密标志) 63(类型) 32010200000001
* (桩编码) 0x01(枪号: 1 号枪) 00(地锁控制返回标志) 00000000(预留位) 6890(帧校验域)
*
* @Title:
* @Description:
* @Author xiehx
* @Date 2023/11/10
**/
@Data
public
class
ParkingLockChangeStatusRspData
extends
TcpData
{
/**
* 参数名称:桩编号
* 数据类型:BCD 码
* 长度:Byte
* 备注:充电桩资产编号,系统参数的编号 (终端机器编码)
*
* 充电桩id: BCD 码 ,不足 7 位补 0
*/
private
byte
[]
pileId
=
new
byte
[
7
];
/**
* 枪号 BIN 码 1
*/
private
byte
gunNo
;
/**
* 地锁控制返回标志 BIN 码 1
*
* 布尔型(1,鉴权成功; 0,鉴权失败)
*/
private
byte
result
;
/**
* 预留位 BIN 码 4
*
* 全部置0
*/
private
byte
[]
other
=
new
byte
[
4
];
}
platform-charging/src/main/java/cn/com/glsx/charging/modules/gbt/ocpp16/tcp/data/ParkingLockStatusReportReqData.java
0 → 100644
View file @
3d26008
package
cn
.
com
.
glsx
.
charging
.
modules
.
gbt
.
ocpp16
.
tcp
.
data
;
import
cn.com.glsx.charging.modules.gbt.ocpp16.tcp.base.TcpData
;
import
lombok.Data
;
/**
* 地锁数据上送
*
* 68(起始标志) 14(数据长度) 0001(序列号域) 00(加密标志) 61(类型) 32010200000001
* (桩编码) 0x01(枪号: 1 号枪) 00(车位状态: 无车辆) 00(地锁电量状态: 0) 00(报警状
* 态) 00000000(预留位) 6890(帧校验域)
*
* @Title:
* @Description:
* @Author xiehx
* @Date 2023/11/10
**/
@Data
public
class
ParkingLockStatusReportReqData
extends
TcpData
{
/**
* 参数名称:桩编号
* 数据类型:BCD 码
* 长度:Byte
* 备注:充电桩资产编号,系统参数的编号 (终端机器编码)
*
* 充电桩id: BCD 码 ,不足 7 位补 0
*/
private
byte
[]
pileId
=
new
byte
[
7
];
/**
* 枪号 BCD 码 1
*/
private
byte
gunNo
;
/**
* 车位锁状态 BIN 码 1
*
* 0x00:未到位状态
* 0x55:升锁到位状态
* 0xFF:降锁到位状态
*/
private
byte
parkingLockStatus
;
/**
* 车位状态 BIN 码 1
*
* 0x00:无车辆
* 0xFF:停放车辆
*/
private
byte
parkingStatus
;
/**
* 地锁电量状态 BIN 码 1
*
* 百分比值0~100
*/
private
byte
charge
;
/**
* 报警状态 BIN 码 1
*
* 0x00:正常无报警
* 0xFF:待机状态摇臂破坏
* 0x55:摇臂升降异常(未到位)
*/
private
byte
alarmState
;
/**
* 预留位 BIN 码 4
*
* 全部置0
*/
private
byte
[]
other
=
new
byte
[
4
];
}
platform-charging/src/main/java/cn/com/glsx/charging/modules/gbt/ocpp16/tcp/data/RealTimeDataReqData.java
0 → 100644
View file @
3d26008
package
cn
.
com
.
glsx
.
charging
.
modules
.
gbt
.
ocpp16
.
tcp
.
data
;
import
cn.com.glsx.charging.modules.gbt.ocpp16.tcp.base.TcpData
;
import
lombok.Data
;
/**
* @Author: chenx
* @Description: 读取实时监测数据请求类
* @Date: 2023/11/10 16:29
* @Version: 1.0
*/
@Data
public
class
RealTimeDataReqData
extends
TcpData
{
/**
* 桩编号
* 数据类型:byte[] (BCD码)
* 长度(Byte):7
* 备注:不足7位补0
*/
private
byte
[]
pileId
=
new
byte
[
7
];
/**
* 枪号
* 数据类型:byte[] (BCD码)
* 长度(Byte):1
* 备注:
*/
private
byte
gunNumber
;
}
platform-charging/src/main/java/cn/com/glsx/charging/modules/gbt/ocpp16/tcp/handler/ChargingBmsMachineRspHandler.java
0 → 100644
View file @
3d26008
package
cn
.
com
.
glsx
.
charging
.
modules
.
gbt
.
ocpp16
.
tcp
.
handler
;
import
cn.com.glsx.charging.modules.gbt.ocpp16.tcp.base.TcpHandler
;
import
cn.com.glsx.charging.modules.gbt.ocpp16.tcp.data.ChargingBmsMachineReqData
;
import
cn.com.glsx.charging.modules.gbt.ocpp16.tcp.protocol.ChargingBmsMachineReq
;
import
io.netty.channel.Channel
;
import
java.util.Objects
;
/**
* @Author: chenx
* @Description: 充电过程BMS需求与充电机输出 rsp handler
* @Date: 2023/11/10 18:26
* @Version: 1.0
*/
public
class
ChargingBmsMachineRspHandler
implements
TcpHandler
<
ChargingBmsMachineReq
,
ChargingBmsMachineReq
>
{
@Override
public
ChargingBmsMachineReq
handle
(
Channel
channel
,
ChargingBmsMachineReq
chargingBmsMachineReq
)
{
ChargingBmsMachineReqData
data
=
chargingBmsMachineReq
.
getData
();
if
(
Objects
.
isNull
(
data
))
{
log
.
info
(
"充电过程BMS需求与充电机输出为空"
);
return
null
;
}
log
.
info
(
"充电过程BMS需求与充电机输出:{}"
,
data
);
return
null
;
}
}
platform-charging/src/main/java/cn/com/glsx/charging/modules/gbt/ocpp16/tcp/handler/ChargingBmsRspHandler.java
0 → 100644
View file @
3d26008
package
cn
.
com
.
glsx
.
charging
.
modules
.
gbt
.
ocpp16
.
tcp
.
handler
;
import
cn.com.glsx.charging.modules.gbt.ocpp16.tcp.base.TcpHandler
;
import
cn.com.glsx.charging.modules.gbt.ocpp16.tcp.data.ChargingBmsReqData
;
import
cn.com.glsx.charging.modules.gbt.ocpp16.tcp.protocol.ChargingBmsReq
;
import
io.netty.channel.Channel
;
import
java.util.Objects
;
/**
* @Author: chenx
* @Description: 充电过程BMS信息rsp handler
* @Date: 2023/11/10 18:26
* @Version: 1.0
*/
public
class
ChargingBmsRspHandler
implements
TcpHandler
<
ChargingBmsReq
,
ChargingBmsReq
>
{
@Override
public
ChargingBmsReq
handle
(
Channel
channel
,
ChargingBmsReq
chargingBmsReq
)
{
ChargingBmsReqData
data
=
chargingBmsReq
.
getData
();
if
(
Objects
.
isNull
(
data
))
{
log
.
info
(
"充电过程BMS信息为空"
);
return
null
;
}
log
.
info
(
"充电过程BMS信息:{}"
,
data
);
return
null
;
}
}
platform-charging/src/main/java/cn/com/glsx/charging/modules/gbt/ocpp16/tcp/handler/MachineParamConfigRspHandler.java
0 → 100644
View file @
3d26008
package
cn
.
com
.
glsx
.
charging
.
modules
.
gbt
.
ocpp16
.
tcp
.
handler
;
import
cn.com.glsx.charging.modules.gbt.ocpp16.tcp.base.TcpHandler
;
import
cn.com.glsx.charging.modules.gbt.ocpp16.tcp.data.MachineParamConfigReqData
;
import
cn.com.glsx.charging.modules.gbt.ocpp16.tcp.protocol.MachineParamConfigReq
;
import
io.netty.channel.Channel
;
import
java.util.Objects
;
/**
* @Author: chenx
* @Description: 参数配置 rsp handler
* @Date: 2023/11/10 18:25
* @Version: 1.0
*/
public
class
MachineParamConfigRspHandler
implements
TcpHandler
<
MachineParamConfigReq
,
MachineParamConfigReq
>
{
@Override
public
MachineParamConfigReq
handle
(
Channel
channel
,
MachineParamConfigReq
machineParamConfigReq
)
{
MachineParamConfigReqData
data
=
machineParamConfigReq
.
getData
();
if
(
Objects
.
isNull
(
data
))
{
log
.
info
(
"参数配置消息为空"
);
return
null
;
}
log
.
info
(
"参数配置消息:{}"
,
data
);
return
null
;
}
}
platform-charging/src/main/java/cn/com/glsx/charging/modules/gbt/ocpp16/tcp/handler/ParkingLockChangeStatusReqHandler.java
0 → 100644
View file @
3d26008
package
cn
.
com
.
glsx
.
charging
.
modules
.
gbt
.
ocpp16
.
tcp
.
handler
;
import
cn.com.glsx.charging.modules.gbt.ocpp16.tcp.base.TcpHandler
;
import
cn.com.glsx.charging.modules.gbt.ocpp16.tcp.data.ParkingLockChangeStatusReqData
;
import
cn.com.glsx.charging.modules.gbt.ocpp16.tcp.data.ParkingLockChangeStatusRspData
;
import
cn.com.glsx.charging.modules.gbt.ocpp16.tcp.protocol.ParkingLockChangeStatusReq
;
import
cn.com.glsx.charging.modules.gbt.ocpp16.tcp.protocol.ParkingLockChangeStatusRsp
;
import
io.netty.channel.Channel
;
/**
* 遥控地锁升锁与降锁请求处理器
* <p>
* 服务器下发命令给地锁,地锁执行动作
*
* @Title:
* @Description:
* @Author xiehx
* @Date 2023/11/10
**/
public
class
ParkingLockChangeStatusReqHandler
implements
TcpHandler
<
ParkingLockChangeStatusReq
,
ParkingLockChangeStatusRsp
>
{
@Override
public
ParkingLockChangeStatusRsp
handle
(
Channel
channel
,
ParkingLockChangeStatusReq
req
)
{
ParkingLockChangeStatusReqData
data
=
req
.
getData
();
log
.
info
(
"桩编码:{} 枪号:{} 升/降地锁:{} 预留位:{}"
,
data
.
getPileIdStr
(),
data
.
getGunNo
(),
data
.
getStatus
(),
data
.
getOther
());
ParkingLockChangeStatusRspData
rspData
=
new
ParkingLockChangeStatusRspData
();
rspData
.
setPileId
(
data
.
getPileId
());
rspData
.
setGunNo
(
data
.
getGunNo
());
rspData
.
setResult
((
byte
)
1
);
ParkingLockChangeStatusRsp
rsp
=
new
ParkingLockChangeStatusRsp
();
rsp
.
setData
(
rspData
);
return
rsp
;
}
}
platform-charging/src/main/java/cn/com/glsx/charging/modules/gbt/ocpp16/tcp/handler/ParkingLockChangeStatusRspHandler.java
0 → 100644
View file @
3d26008
package
cn
.
com
.
glsx
.
charging
.
modules
.
gbt
.
ocpp16
.
tcp
.
handler
;
import
cn.com.glsx.charging.modules.gbt.ocpp16.tcp.base.TcpHandler
;
import
cn.com.glsx.charging.modules.gbt.ocpp16.tcp.data.ParkingLockChangeStatusRspData
;
import
cn.com.glsx.charging.modules.gbt.ocpp16.tcp.protocol.ParkingLockChangeStatusRsp
;
import
cn.com.glsx.charging.modules.gbt.ocpp16.tcp.server.ProxyHelper
;
import
io.netty.channel.Channel
;
/**
* 地锁升锁与降锁 充电桩返回数据(上行) 处理器
*
* @Title:
* @Description:
* @Author xiehx
* @Date 2023/11/10
**/
public
class
ParkingLockChangeStatusRspHandler
implements
TcpHandler
<
ParkingLockChangeStatusRsp
,
ParkingLockChangeStatusRsp
>
{
@Override
public
ParkingLockChangeStatusRsp
handle
(
Channel
channel
,
ParkingLockChangeStatusRsp
rsp
)
{
ParkingLockChangeStatusRspData
data
=
rsp
.
getData
();
log
.
info
(
"桩编码:{} 枪号:{} 地锁控制返回标志:{} 预留位:{}"
,
data
.
getPileIdStr
(),
data
.
getGunNo
(),
data
.
getResult
(),
data
.
getOther
());
ProxyHelper
.
setCallback
(
channel
,
rsp
);
return
null
;
}
}
platform-charging/src/main/java/cn/com/glsx/charging/modules/gbt/ocpp16/tcp/handler/ParkingLockStatusReportReqHandler.java
0 → 100644
View file @
3d26008
package
cn
.
com
.
glsx
.
charging
.
modules
.
gbt
.
ocpp16
.
tcp
.
handler
;
import
cn.com.glsx.charging.modules.gbt.ocpp16.tcp.base.TcpHandler
;
import
cn.com.glsx.charging.modules.gbt.ocpp16.tcp.data.ParkingLockStatusReportReqData
;
import
cn.com.glsx.charging.modules.gbt.ocpp16.tcp.protocol.ParkingLockStatusReportReq
;
import
io.netty.channel.Channel
;
/**
* 地锁数据上送 处理器
*
* 地锁状态/报警信息变化时,桩立刻上送变位/报警信息;地锁状态不变化时,每隔 5 分钟周期
* 性上送地锁状态。若无报警信息,不上送。
*
* @Title:
* @Description:
* @Author xiehx
* @Date 2023/11/10
**/
public
class
ParkingLockStatusReportReqHandler
implements
TcpHandler
<
ParkingLockStatusReportReq
,
ParkingLockStatusReportReq
>
{
@Override
public
ParkingLockStatusReportReq
handle
(
Channel
channel
,
ParkingLockStatusReportReq
req
)
{
ParkingLockStatusReportReqData
data
=
req
.
getData
();
log
.
info
(
"桩编码:{} 枪号:{} 车位锁状态:{} 车位状态:{} 地锁电量状态:{} 报警状态:{} 预留位:{}"
,
data
.
getPileIdStr
(),
data
.
getGunNo
(),
data
.
getParkingLockStatus
(),
data
.
getParkingStatus
(),
data
.
getCharge
(),
data
.
getAlarmState
(),
data
.
getOther
());
return
null
;
}
}
platform-charging/src/main/java/cn/com/glsx/charging/modules/gbt/ocpp16/tcp/handler/RealTimeDataReqHandler.java
0 → 100644
View file @
3d26008
package
cn
.
com
.
glsx
.
charging
.
modules
.
gbt
.
ocpp16
.
tcp
.
handler
;
import
cn.com.glsx.charging.modules.gbt.ocpp16.tcp.base.TcpHandler
;
import
cn.com.glsx.charging.modules.gbt.ocpp16.tcp.protocol.RealTimeReq
;
import
cn.com.glsx.charging.modules.gbt.ocpp16.tcp.protocol.UploadRealtimeDataReq
;
import
io.netty.channel.Channel
;
/**
* @Author: chenx
* @Description:
* @Date: 2023/11/10 16:31
* @Version: 1.0
*/
public
class
RealTimeDataReqHandler
implements
TcpHandler
<
RealTimeReq
,
UploadRealtimeDataReq
>
{
@Override
public
UploadRealtimeDataReq
handle
(
Channel
channel
,
RealTimeReq
realTimeReq
)
{
return
null
;
}
}
platform-charging/src/main/java/cn/com/glsx/charging/modules/gbt/ocpp16/tcp/protocol/ChargingBmsMachineReq.java
0 → 100644
View file @
3d26008
package
cn
.
com
.
glsx
.
charging
.
modules
.
gbt
.
ocpp16
.
tcp
.
protocol
;
import
cn.com.glsx.charging.modules.gbt.ocpp16.tcp.base.TcpMapper
;
import
cn.com.glsx.charging.modules.gbt.ocpp16.tcp.base.TcpReq
;
import
cn.com.glsx.charging.modules.gbt.ocpp16.tcp.data.ChargingBmsMachineReqData
;
/**
* @Author: chenx
* @Description: 充电过程BMS需求与充电机输出 req
* @Date: 2023/11/10 18:23
* @Version: 1.0
*/
public
class
ChargingBmsMachineReq
extends
TcpReq
<
ChargingBmsMachineReqData
>
{
public
ChargingBmsMachineReq
()
{
super
(
TcpMapper
.
CMD_RSP_CHARGING_BMS_MACHINE
.
getType
());
}
}
platform-charging/src/main/java/cn/com/glsx/charging/modules/gbt/ocpp16/tcp/protocol/ChargingBmsReq.java
0 → 100644
View file @
3d26008
package
cn
.
com
.
glsx
.
charging
.
modules
.
gbt
.
ocpp16
.
tcp
.
protocol
;
import
cn.com.glsx.charging.modules.gbt.ocpp16.tcp.base.TcpMapper
;
import
cn.com.glsx.charging.modules.gbt.ocpp16.tcp.base.TcpReq
;
import
cn.com.glsx.charging.modules.gbt.ocpp16.tcp.data.ChargingBmsReqData
;
/**
* @Author: chenx
* @Description: 充电过程BMS信息 req
* @Date: 2023/11/10 18:24
* @Version: 1.0
*/
public
class
ChargingBmsReq
extends
TcpReq
<
ChargingBmsReqData
>
{
public
ChargingBmsReq
()
{
super
(
TcpMapper
.
CMD_RSP_CHARGING_BMS
.
getType
());
}
}
platform-charging/src/main/java/cn/com/glsx/charging/modules/gbt/ocpp16/tcp/protocol/MachineParamConfigReq.java
0 → 100644
View file @
3d26008
package
cn
.
com
.
glsx
.
charging
.
modules
.
gbt
.
ocpp16
.
tcp
.
protocol
;
import
cn.com.glsx.charging.modules.gbt.ocpp16.tcp.base.TcpMapper
;
import
cn.com.glsx.charging.modules.gbt.ocpp16.tcp.base.TcpReq
;
import
cn.com.glsx.charging.modules.gbt.ocpp16.tcp.data.MachineParamConfigReqData
;
/**
* @Author: chenx
* @Description:
* @Date: 2023/11/10 18:23
* @Version: 1.0
*/
public
class
MachineParamConfigReq
extends
TcpReq
<
MachineParamConfigReqData
>
{
public
MachineParamConfigReq
()
{
super
(
TcpMapper
.
CMD_RSP_MACHINE_PARAM_CONFIG
.
getType
());
}
}
platform-charging/src/main/java/cn/com/glsx/charging/modules/gbt/ocpp16/tcp/protocol/ParkingLockChangeStatusReq.java
0 → 100644
View file @
3d26008
package
cn
.
com
.
glsx
.
charging
.
modules
.
gbt
.
ocpp16
.
tcp
.
protocol
;
import
cn.com.glsx.charging.modules.gbt.ocpp16.tcp.base.TcpMapper
;
import
cn.com.glsx.charging.modules.gbt.ocpp16.tcp.base.TcpReq
;
import
cn.com.glsx.charging.modules.gbt.ocpp16.tcp.data.ParkingLockChangeStatusReqData
;
/**
* @Title:
* @Description:
* @Author xiehx
* @Date 2023/11/10
**/
public
class
ParkingLockChangeStatusReq
extends
TcpReq
<
ParkingLockChangeStatusReqData
>
{
public
ParkingLockChangeStatusReq
()
{
super
(
TcpMapper
.
CMD_REQ_PARKING_LOCK_CHANGE_STATUS
.
getType
());
}
}
platform-charging/src/main/java/cn/com/glsx/charging/modules/gbt/ocpp16/tcp/protocol/ParkingLockChangeStatusRsp.java
0 → 100644
View file @
3d26008
package
cn
.
com
.
glsx
.
charging
.
modules
.
gbt
.
ocpp16
.
tcp
.
protocol
;
import
cn.com.glsx.charging.modules.gbt.ocpp16.tcp.base.TcpMapper
;
import
cn.com.glsx.charging.modules.gbt.ocpp16.tcp.base.TcpRsp
;
import
cn.com.glsx.charging.modules.gbt.ocpp16.tcp.data.ParkingLockChangeStatusRspData
;
/**
* @Title:
* @Description:
* @Author xiehx
* @Date 2023/11/10
**/
public
class
ParkingLockChangeStatusRsp
extends
TcpRsp
<
ParkingLockChangeStatusRspData
>
{
public
ParkingLockChangeStatusRsp
()
{
super
(
TcpMapper
.
CMD_RSP_PARKING_LOCK_CHANGE_STATUS
.
getType
());
}
}
platform-charging/src/main/java/cn/com/glsx/charging/modules/gbt/ocpp16/tcp/protocol/ParkingLockStatusReportReq.java
0 → 100644
View file @
3d26008
package
cn
.
com
.
glsx
.
charging
.
modules
.
gbt
.
ocpp16
.
tcp
.
protocol
;
import
cn.com.glsx.charging.modules.gbt.ocpp16.tcp.base.TcpMapper
;
import
cn.com.glsx.charging.modules.gbt.ocpp16.tcp.base.TcpRsp
;
import
cn.com.glsx.charging.modules.gbt.ocpp16.tcp.data.ParkingLockStatusReportReqData
;
/**
* @Title:
* @Description:
* @Author xiehx
* @Date 2023/11/10
**/
public
class
ParkingLockStatusReportReq
extends
TcpRsp
<
ParkingLockStatusReportReqData
>
{
public
ParkingLockStatusReportReq
()
{
super
(
TcpMapper
.
CMD_REQ_PARKING_LOCK_STATUS_REPORT
.
getType
());
}
}
platform-charging/src/main/java/cn/com/glsx/charging/modules/gbt/ocpp16/tcp/protocol/RealTimeReq.java
0 → 100644
View file @
3d26008
package
cn
.
com
.
glsx
.
charging
.
modules
.
gbt
.
ocpp16
.
tcp
.
protocol
;
import
cn.com.glsx.charging.modules.gbt.ocpp16.tcp.base.TcpMapper
;
import
cn.com.glsx.charging.modules.gbt.ocpp16.tcp.base.TcpRsp
;
import
cn.com.glsx.charging.modules.gbt.ocpp16.tcp.data.RealTimeDataReqData
;
/**
* @Author: chenx
* @Description:
* @Date: 2023/11/10 16:45
* @Version: 1.0
*/
public
class
RealTimeReq
extends
TcpRsp
<
RealTimeDataReqData
>
{
public
RealTimeReq
()
{
super
(
TcpMapper
.
CMD_REQ_GET_REAL_TIME_DATA
.
getType
());
}
}
platform-charging/src/test/java/cn/com/glsx/charging/gbt/ocpp16/ChargingBmsMachineTest.java
0 → 100644
View file @
3d26008
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.ChargingBmsMachineReqData
;
import
cn.com.glsx.charging.modules.gbt.ocpp16.tcp.protocol.ChargingBmsMachineReq
;
/**
* 充电过程BMS需求与充电机输出-上报测试类
* @author chenxi
* @date 2023年11月10日 18:42:00
**/
public
class
ChargingBmsMachineTest
{
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
);
ChargingBmsMachineReq
req
=
new
ChargingBmsMachineReq
();
ChargingBmsMachineReqData
data
=
new
ChargingBmsMachineReqData
();
data
.
setTransactionSerialNumber
(
Ocpp16Helper
.
strToBcd
(
"3201020000000011151116155535026"
,
data
.
getTransactionSerialNumber
()));
data
.
setPileId
(
Ocpp16Helper
.
strToBcd
(
"32010200000001"
,
data
.
getPileId
()));
data
.
setGunNumber
((
byte
)
1
);
byte
[]
bmsRequiredVoltage
=
new
byte
[]{(
byte
)
0x00
,
0x00
};
data
.
setBmsRequiredVoltage
(
bmsRequiredVoltage
);
data
.
setBmsRequiredCurrent
(
bmsRequiredVoltage
);
data
.
setBmsChargingMode
((
byte
)
0
);
data
.
setBmsChargingMeasuredVoltage
(
bmsRequiredVoltage
);
data
.
setBmsChargingMeasuredCurrent
(
bmsRequiredVoltage
);
data
.
setBmsHighestVoltageAndNumber
(
bmsRequiredVoltage
);
data
.
setBmsChargingSoc
((
byte
)
0
);
data
.
setBmsLeftChargingTime
(
bmsRequiredVoltage
);
req
.
setData
(
data
);
client
.
sendSync
(
req
);
}
}
platform-charging/src/test/java/cn/com/glsx/charging/gbt/ocpp16/ChargingBmsTest.java
0 → 100644
View file @
3d26008
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.ChargingBmsReqData
;
import
cn.com.glsx.charging.modules.gbt.ocpp16.tcp.protocol.ChargingBmsReq
;
/**
* 充电过程BMS信息上报测试类
* @author chenxi
* @date 2023年11月10日 18:43:39
**/
public
class
ChargingBmsTest
{
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
);
ChargingBmsReq
req
=
new
ChargingBmsReq
();
ChargingBmsReqData
data
=
new
ChargingBmsReqData
();
data
.
setTransactionSerialNumber
(
Ocpp16Helper
.
strToBcd
(
"3201020000000011151116155535026"
,
data
.
getTransactionSerialNumber
()));
data
.
setPileId
(
Ocpp16Helper
.
strToBcd
(
"32010200000001"
,
data
.
getPileId
()));
data
.
setGunNumber
((
byte
)
1
);
data
.
setBmsHighestVoltageNumber
((
byte
)
0
);
data
.
setBmsBatteryTemperature
((
byte
)
0
);
data
.
setHighestBatteryTemperatureNumber
((
byte
)
0
);
data
.
setLowestTemperatureNumber
((
byte
)
0
);
data
.
setLowestBatteryTemperatureNumber
((
byte
)
0
);
byte
[]
bmsBatteryVoltageStatus
=
new
byte
[]{(
byte
)
0x00
,
0x00
};
data
.
setBmsBatteryVoltageStatus
(
bmsBatteryVoltageStatus
);
data
.
setBmsBatteryChargingStatus
(
bmsBatteryVoltageStatus
);
data
.
setBmsBatteryOverCurrent
(
bmsBatteryVoltageStatus
);
data
.
setBmsBatteryTemperatureStatus
(
bmsBatteryVoltageStatus
);
data
.
setBmsBatteryInsulationState
(
bmsBatteryVoltageStatus
);
data
.
setChargingProhibition
(
bmsBatteryVoltageStatus
);
data
.
setReserved
(
bmsBatteryVoltageStatus
);
req
.
setData
(
data
);
client
.
sendSync
(
req
);
}
}
platform-charging/src/test/java/cn/com/glsx/charging/gbt/ocpp16/GetDataTest.java
0 → 100644
View file @
3d26008
package
cn
.
com
.
glsx
.
charging
.
gbt
.
ocpp16
;
import
cn.com.glsx.charging.modules.gbt.ocpp16.Ocpp16Helper
;
import
cn.com.glsx.charging.modules.gbt.ocpp16.ServerMain
;
import
cn.com.glsx.charging.modules.gbt.ocpp16.tcp.base.TcpCallback
;
import
cn.com.glsx.charging.modules.gbt.ocpp16.tcp.base.TcpRsp
;
import
cn.com.glsx.charging.modules.gbt.ocpp16.tcp.data.RealTimeDataReqData
;
import
cn.com.glsx.charging.modules.gbt.ocpp16.tcp.protocol.RealTimeReq
;
import
cn.com.glsx.charging.modules.gbt.ocpp16.tcp.server.TcpServer
;
import
lombok.extern.slf4j.Slf4j
;
import
org.junit.Test
;
/**
* @Author: chenx
* @Description: 读取实时监测数据
* @Date: 2023/11/10 17:06
* @Version: 1.0
*/
@Slf4j
public
class
GetDataTest
{
String
host
=
"localhost"
;
int
port
=
8888
;
private
TcpServer
serverStart
()
throws
Exception
{
// 启动服务端
TcpServer
start
=
ServerMain
.
start
(
host
,
port
);
Thread
.
sleep
(
15000
);
return
start
;
}
@Test
public
void
test
()
throws
Exception
{
TcpServer
tcpServer
=
serverStart
();
RealTimeDataReqData
data
=
new
RealTimeDataReqData
();
data
.
setPileId
(
Ocpp16Helper
.
strToBcd
(
"32010200000001"
,
data
.
getPileId
()));
data
.
setGunNumber
((
byte
)
01
);
RealTimeReq
req
=
new
RealTimeReq
();
req
.
setData
(
data
);
Thread
.
sleep
(
20000
);
TcpCallback
<
TcpRsp
>
callback
=
tcpServer
.
sendSync
(
req
);
Thread
.
sleep
(
10000
);
TcpRsp
rsp
=
callback
.
get
();
log
.
info
(
"callback{}"
,
rsp
.
getData
());
}
}
platform-charging/src/test/java/cn/com/glsx/charging/gbt/ocpp16/MachineParamConfigTest.java
0 → 100644
View file @
3d26008
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.MachineParamConfigReqData
;
import
cn.com.glsx.charging.modules.gbt.ocpp16.tcp.protocol.MachineParamConfigReq
;
/**
* @Author: chenx
* @Description: 参数配置上报
* @Date: 2023/11/10 18:45
* @Version: 1.0
*/
public
class
MachineParamConfigTest
{
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
);
MachineParamConfigReq
req
=
new
MachineParamConfigReq
();
MachineParamConfigReqData
data
=
new
MachineParamConfigReqData
();
data
.
setTransactionSerialNumber
(
Ocpp16Helper
.
strToBcd
(
"3201020000000011151116155535026"
,
data
.
getTransactionSerialNumber
()));
data
.
setPileId
(
Ocpp16Helper
.
strToBcd
(
"32010200000001"
,
data
.
getPileId
()));
data
.
setGunNumber
((
byte
)
1
);
byte
[]
bmsBatteryLowestVoltage
=
new
byte
[]{(
byte
)
0x00
,
0x00
};
data
.
setBmsBatteryHighestVoltage
(
bmsBatteryLowestVoltage
);
data
.
setBmsBatteryHighestCurrent
(
bmsBatteryLowestVoltage
);
data
.
setBmsBatteryHighestTotalVoltage
(
bmsBatteryLowestVoltage
);
data
.
setBmsBatteryHighestTemperature
((
byte
)
0
);
data
.
setBmsBatteryStatus
(
bmsBatteryLowestVoltage
);
data
.
setBmsBatteryCurrentVoltage
(
bmsBatteryLowestVoltage
);
data
.
setPileHighestOutputVoltage
(
bmsBatteryLowestVoltage
);
data
.
setPileLowestOutputVoltage
(
bmsBatteryLowestVoltage
);
data
.
setPileHighestCurrent
(
bmsBatteryLowestVoltage
);
data
.
setPileLowestCurrent
(
bmsBatteryLowestVoltage
);
req
.
setData
(
data
);
client
.
sendSync
(
req
);
}
}
platform-charging/src/test/java/cn/com/glsx/charging/gbt/ocpp16/ParkingLockTest.java
0 → 100644
View file @
3d26008
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.ParkingLockStatusReportReqData
;
import
cn.com.glsx.charging.modules.gbt.ocpp16.tcp.protocol.ParkingLockStatusReportReq
;
import
cn.com.glsx.charging.util.ByteUtils
;
import
lombok.extern.slf4j.Slf4j
;
import
org.junit.Test
;
/**
* @Title:
* @Description:
* @Author xiehx
* @Date 2023/11/10
**/
@Slf4j
public
class
ParkingLockTest
{
@Test
public
void
report
()
throws
Exception
{
ParkingLockStatusReportReqData
data
=
new
ParkingLockStatusReportReqData
();
data
.
setPileId
(
Ocpp16Helper
.
strToBcd
(
"32010200000001"
,
data
.
getPileId
()));
data
.
setGunNo
((
byte
)
1
);
data
.
setParkingLockStatus
((
byte
)
0
);
data
.
setParkingStatus
((
byte
)
0
);
data
.
setCharge
((
byte
)
0
);
data
.
setAlarmState
((
byte
)
0
);
ParkingLockStatusReportReq
req
=
new
ParkingLockStatusReportReq
();
req
.
setData
(
data
);
log
.
info
(
"报文:{}"
,
ByteUtils
.
toHex
(
Ocpp16Helper
.
build
(
req
)));
String
host
=
"localhost"
;
int
port
=
8888
;
TcpClient
client
=
ClientMain
.
getInstance
(
host
,
port
);
Thread
.
sleep
(
5000
);
client
.
sendSync
(
req
);
}
}
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