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 6021514e
authored
Nov 06, 2023
by
tiger
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
日志调整
1 parent
67284dc7
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
4 deletions
platform-charging/src/main/java/cn/com/glsx/charging/modules/gbt/ocpp16/tcp/server/TcpServerHandler.java
platform-charging/src/main/java/cn/com/glsx/charging/modules/gbt/ocpp16/tcp/server/TcpServerHandler.java
View file @
6021514
...
@@ -64,8 +64,6 @@ public class TcpServerHandler extends SimpleChannelInboundHandler<byte[]> {
...
@@ -64,8 +64,6 @@ public class TcpServerHandler extends SimpleChannelInboundHandler<byte[]> {
protected
void
channelRead0
(
ChannelHandlerContext
ctx
,
byte
[]
bytes
)
throws
Exception
{
protected
void
channelRead0
(
ChannelHandlerContext
ctx
,
byte
[]
bytes
)
throws
Exception
{
String
ip
=
TcpServer
.
getIp
(
ctx
);
String
ip
=
TcpServer
.
getIp
(
ctx
);
log
.
info
(
"【{}】up: {}"
,
ip
,
ByteUtils
.
toHex
(
bytes
));
// 收到的rsp或者notify
// 收到的rsp或者notify
try
{
try
{
TcpBase
<
TcpData
>
up
=
Ocpp16Helper
.
parse
(
bytes
);
TcpBase
<
TcpData
>
up
=
Ocpp16Helper
.
parse
(
bytes
);
...
@@ -76,7 +74,8 @@ public class TcpServerHandler extends SimpleChannelInboundHandler<byte[]> {
...
@@ -76,7 +74,8 @@ public class TcpServerHandler extends SimpleChannelInboundHandler<byte[]> {
return
;
return
;
}
}
log
.
info
(
"up:{}"
,
up
);
log
.
info
(
"【{}】【{}】recv1: {}"
,
ip
,
up
.
getClass
().
getSimpleName
(),
ByteUtils
.
toHex
(
bytes
));
log
.
info
(
"【{}】【{}】recv2: {}"
,
ip
,
up
.
getClass
().
getSimpleName
(),
up
);
Class
<?
extends
TcpHandler
>
handlerClass
=
mapper
.
getHandlerClass
();
Class
<?
extends
TcpHandler
>
handlerClass
=
mapper
.
getHandlerClass
();
if
(
handlerClass
==
null
&&
up
instanceof
TcpReq
)
{
if
(
handlerClass
==
null
&&
up
instanceof
TcpReq
)
{
...
@@ -93,7 +92,9 @@ public class TcpServerHandler extends SimpleChannelInboundHandler<byte[]> {
...
@@ -93,7 +92,9 @@ public class TcpServerHandler extends SimpleChannelInboundHandler<byte[]> {
if
(
rsp
!=
null
)
{
if
(
rsp
!=
null
)
{
byte
[]
rspBytes
=
Ocpp16Helper
.
build
(
rsp
);
byte
[]
rspBytes
=
Ocpp16Helper
.
build
(
rsp
);
ctx
.
channel
().
writeAndFlush
(
rspBytes
);
ctx
.
channel
().
writeAndFlush
(
rspBytes
);
log
.
info
(
"【{}】send: {}"
,
ip
,
rsp
);
log
.
info
(
"【{}】【{}】send1: {} "
,
ip
,
rsp
.
getClass
().
getSimpleName
(),
ByteUtils
.
toHex
(
rspBytes
));
log
.
info
(
"【{}】【{}】send2: {} "
,
ip
,
rsp
.
getClass
().
getSimpleName
(),
rsp
);
}
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
"【{}】{}"
,
ip
,
e
);
log
.
error
(
"【{}】{}"
,
ip
,
e
);
...
...
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