Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
new-socketemulator
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
李远洪
new-socketemulator
Commits
f21d3a19
Commit
f21d3a19
authored
Mar 18, 2020
by
liyuanhong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加了页面16进制消息的显示
parent
f0bb02f9
Changes
17
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
120 additions
and
51 deletions
+120
-51
lib/multiThread/SendMultMsgThread_m300.py
lib/multiThread/SendMultMsgThread_m300.py
+6
-4
lib/multiThread/SendMultMsgThread_m500.py
lib/multiThread/SendMultMsgThread_m500.py
+2
-2
templates/messageTools/message/dataUpstreamTransport_msg_f2_page.html
...ssageTools/message/dataUpstreamTransport_msg_f2_page.html
+2
-0
templates/messageTools/message/dataUpstreamTransport_msg_f3_page.html
...ssageTools/message/dataUpstreamTransport_msg_f3_page.html
+2
-0
templates/messageTools/message/dataUpstreamTransport_msg_f4_page.html
...ssageTools/message/dataUpstreamTransport_msg_f4_page.html
+6
-4
templates/messageTools/message/dataUpstreamTransport_msg_page.html
.../messageTools/message/dataUpstreamTransport_msg_page.html
+6
-4
templates/messageTools/message/heartBeat_msg_page.html
templates/messageTools/message/heartBeat_msg_page.html
+2
-0
templates/messageTools/message/location_msg_page.html
templates/messageTools/message/location_msg_page.html
+6
-4
templates/messageTools/message/terminalRegister_msg_page.html
...lates/messageTools/message/terminalRegister_msg_page.html
+6
-4
templates/messageTools/message/terminalVersionInfoUpload_msg_page.html
...sageTools/message/terminalVersionInfoUpload_msg_page.html
+6
-4
templates/protocolTools/report/GPS_protocol_page.html
templates/protocolTools/report/GPS_protocol_page.html
+6
-1
templates/protocolTools/report/OBD_CAN_protocol_page.html
templates/protocolTools/report/OBD_CAN_protocol_page.html
+6
-1
templates/protocolTools/report/heartBeat_protocol_page.html
templates/protocolTools/report/heartBeat_protocol_page.html
+6
-1
templates/protocolTools/report/login_protocol_page.html
templates/protocolTools/report/login_protocol_page.html
+6
-2
templates/protocolTools/report/securityStatus_protocol_page.html
...es/protocolTools/report/securityStatus_protocol_page.html
+6
-1
views/messageTools/message_process.py
views/messageTools/message_process.py
+21
-7
views/protocolTools/protocolReport_process.py
views/protocolTools/protocolReport_process.py
+25
-12
No files found.
lib/multiThread/SendMultMsgThread_m300.py
View file @
f21d3a19
...
...
@@ -23,12 +23,13 @@ class SendMultMsgThread():
self
.
threadArr
=
{}
#保存每个线程的信息
self
.
failThreadCount
=
0
#失败线程数
self
.
durThreads
=
[]
#持续发送线程数组,当数组为空,表示所有线程已经结束
dt
=
1
*
1
*
60
dt
=
1
*
20
*
60
self
.
durTime
=
dt
#线程持续时间
self
.
connectTimeoutNum
=
0
#连接超时线程数
self
.
sendTimeoutNum
=
0
#发送超时线程数
self
.
reviceTimeoutNum
=
0
#接收超时线程数
self
.
sucessNum
=
0
#成功线程数
self
.
failThreadCount
=
0
#失败线程数
self
.
messageCon
=
[]
#用来统计每个线程所发的消息数
self
.
messageCons
=
0
# 用来统计每个线程所发的消息数
pass
...
...
@@ -127,6 +128,7 @@ class SendMultMsgThread():
self
.
durThreads
.
remove
(
threadName
)
self
.
threadArr
[
threadName
][
"status"
]
=
1
self
.
failThreadCount
=
self
.
failThreadCount
+
1
self
.
sendTimeoutNum
=
self
.
sendTimeoutNum
+
1
endTime
=
int
(
time
.
time
())
timeExpend
=
endTime
-
startTime
self
.
threadArr
[
threadName
][
"timeExp"
]
=
timeExpend
...
...
@@ -142,7 +144,7 @@ class SendMultMsgThread():
self
.
durThreads
.
remove
(
threadName
)
self
.
threadArr
[
threadName
][
"status"
]
=
1
self
.
failThreadCount
=
self
.
failThreadCount
+
1
self
.
reviceTimeoutNum
=
self
.
connect
TimeoutNum
+
1
self
.
reviceTimeoutNum
=
self
.
revice
TimeoutNum
+
1
self
.
messageCon
.
append
(
msgCon
)
self
.
threadArr
[
threadName
][
"msgCon"
]
=
msgCon
print
(
threadName
+
":"
+
'socket 接收消息超时!'
)
...
...
@@ -191,9 +193,9 @@ class SendMultMsgThread():
def
startThreadContinuous
(
self
):
timeStart
=
int
(
time
.
time
()
*
1000
)
for
i
in
range
(
0
,
self
.
threadCount
):
threadName
=
"thread-"
+
str
(
i
)
threadName
=
"thread-"
+
str
(
i
+
42000
)
print
(
threadName
)
carid
=
201912000000
+
i
carid
=
201912000000
+
i
+
42000
theThread
=
threading
.
Thread
(
target
=
self
.
sendMsgContinuous
,
args
=
(
carid
,
threadName
,))
# 数据写死,心跳
threadInfo
=
{}
threadInfo
[
"name"
]
=
threadName
...
...
lib/multiThread/SendMultMsgThread_m500.py
View file @
f21d3a19
...
...
@@ -18,12 +18,12 @@ class SendMultMsgThread():
self
.
msg
=
msg
self
.
timeOut
=
30
#socket超时时间
self
.
BUF_SIZE
=
1024
#接收消息缓存
self
.
threadCount
=
1000
#并发线程数
self
.
threadCount
=
1000
0
#并发线程数
self
.
totalTime
=
0
#所有线程的运行总和
self
.
threadArr
=
{}
#保存每个线程的信息
self
.
failThreadCount
=
0
#失败线程数
self
.
durThreads
=
[]
#持续发送线程数组,当数组为空,表示所有线程已经结束
dt
=
1
*
1
*
60
dt
=
1
*
20
*
60
self
.
durTime
=
dt
#线程持续时间
self
.
connectTimeoutNum
=
0
#连接超时线程数
self
.
sendTimeoutNum
=
0
#发送超时线程数
...
...
templates/messageTools/message/dataUpstreamTransport_msg_f2_page.html
View file @
f21d3a19
...
...
@@ -92,6 +92,7 @@ $("#sendMsgBtn").click(function(){
data
[
"
troubleCodeNums
"
]
=
troubleCodeNums
;
var
host
=
window
.
location
.
host
;
$
(
"
#showFeedback
"
).
val
(
""
)
$
.
ajax
({
url
:
"
http://
"
+
host
+
"
/messageTools/message_process/porcessDataUpstreamTransportMsg_F2
"
,
type
:
"
post
"
,
...
...
@@ -102,6 +103,7 @@ $("#sendMsgBtn").click(function(){
//window.location.reload()
var
theShow
=
"
原始数据:
"
+
data
.
original
+
"
\n
"
;
theShow
=
theShow
+
"
收到数据:
"
+
data
.
result
+
"
\n
"
;
theShow
=
theShow
+
"
收到数据16进制:
"
+
data
.
resultH
+
"
\n
"
;
theShow
=
theShow
+
"
解析数据:
"
+
JSON
.
stringify
(
data
.
parse
)
+
"
\n
"
;
$
(
"
#showFeedback
"
).
val
(
theShow
)
}
else
{
...
...
templates/messageTools/message/dataUpstreamTransport_msg_f3_page.html
View file @
f21d3a19
...
...
@@ -69,6 +69,7 @@ $("#sendMsgBtn").click(function(){
data
[
"
infoTime
"
]
=
infoTime
;
var
host
=
window
.
location
.
host
;
$
(
"
#showFeedback
"
).
val
(
""
)
$
.
ajax
({
url
:
"
http://
"
+
host
+
"
/messageTools/message_process/porcessDataUpstreamTransportMsg_F3
"
,
type
:
"
post
"
,
...
...
@@ -79,6 +80,7 @@ $("#sendMsgBtn").click(function(){
//window.location.reload()
var
theShow
=
"
原始数据:
"
+
data
.
original
+
"
\n
"
;
theShow
=
theShow
+
"
收到数据:
"
+
data
.
result
+
"
\n
"
;
theShow
=
theShow
+
"
收到数据16进制:
"
+
data
.
resultH
+
"
\n
"
;
theShow
=
theShow
+
"
解析数据:
"
+
JSON
.
stringify
(
data
.
parse
)
+
"
\n
"
;
$
(
"
#showFeedback
"
).
val
(
theShow
)
}
else
{
...
...
templates/messageTools/message/dataUpstreamTransport_msg_f4_page.html
View file @
f21d3a19
...
...
@@ -85,6 +85,7 @@ $("#sendMsgBtn").click(function(){
data
[
"
vibrateOutSleepSpeedUpVal
"
]
=
vibrateOutSleepSpeedUpVal
;
var
host
=
window
.
location
.
host
;
$
(
"
#showFeedback
"
).
val
(
""
)
$
.
ajax
({
url
:
"
http://
"
+
host
+
"
/messageTools/message_process/porcessDataUpstreamTransportMsg_F4
"
,
type
:
"
post
"
,
...
...
@@ -93,10 +94,11 @@ $("#sendMsgBtn").click(function(){
success
:
function
(
data
){
if
(
data
.
status
==
200
){
//window.location.reload()
var
theShow
=
"
原始数据:
"
+
data
.
original
+
"
\n
"
;
theShow
=
theShow
+
"
收到数据:
"
+
data
.
result
+
"
\n
"
;
theShow
=
theShow
+
"
解析数据:
"
+
JSON
.
stringify
(
data
.
parse
)
+
"
\n
"
;
$
(
"
#showFeedback
"
).
val
(
theShow
)
var
theShow
=
"
原始数据:
"
+
data
.
original
+
"
\n
"
;
theShow
=
theShow
+
"
收到数据:
"
+
data
.
result
+
"
\n
"
;
theShow
=
theShow
+
"
收到数据16进制:
"
+
data
.
resultH
+
"
\n
"
;
theShow
=
theShow
+
"
解析数据:
"
+
JSON
.
stringify
(
data
.
parse
)
+
"
\n
"
;
$
(
"
#showFeedback
"
).
val
(
theShow
)
}
else
{
$
(
"
#showFeedback
"
).
val
(
data
.
message
)
alert
(
data
.
message
);
...
...
templates/messageTools/message/dataUpstreamTransport_msg_page.html
View file @
f21d3a19
...
...
@@ -162,6 +162,7 @@ $("#sendMsgBtn").click(function(){
data
[
"
sharpCurveTimes
"
]
=
sharpCurveTimes
;
var
host
=
window
.
location
.
host
;
$
(
"
#showFeedback
"
).
val
(
""
)
$
.
ajax
({
url
:
"
http://
"
+
host
+
"
/messageTools/message_process/porcessDataUpstreamTransportMsg
"
,
type
:
"
post
"
,
...
...
@@ -170,10 +171,11 @@ $("#sendMsgBtn").click(function(){
success
:
function
(
data
){
if
(
data
.
status
==
200
){
//window.location.reload()
var
theShow
=
"
原始数据:
"
+
data
.
original
+
"
\n
"
;
theShow
=
theShow
+
"
收到数据:
"
+
data
.
result
+
"
\n
"
;
theShow
=
theShow
+
"
解析数据:
"
+
JSON
.
stringify
(
data
.
parse
)
+
"
\n
"
;
$
(
"
#showFeedback
"
).
val
(
theShow
)
var
theShow
=
"
原始数据:
"
+
data
.
original
+
"
\n
"
;
theShow
=
theShow
+
"
收到数据:
"
+
data
.
result
+
"
\n
"
;
theShow
=
theShow
+
"
收到数据16进制:
"
+
data
.
resultH
+
"
\n
"
;
theShow
=
theShow
+
"
解析数据:
"
+
JSON
.
stringify
(
data
.
parse
)
+
"
\n
"
;
$
(
"
#showFeedback
"
).
val
(
theShow
)
}
else
{
$
(
"
#showFeedback
"
).
val
(
data
.
message
)
alert
(
data
.
message
);
...
...
templates/messageTools/message/heartBeat_msg_page.html
View file @
f21d3a19
...
...
@@ -97,6 +97,7 @@
data
[
"
pkgCounts
"
]
=
pkgCounts
;
var
host
=
window
.
location
.
host
;
$
(
"
#showFeedback
"
).
val
(
""
)
$
.
ajax
({
url
:
"
http://
"
+
host
+
"
/messageTools/message_process/porcessHeartBeatMsg
"
,
type
:
"
post
"
,
...
...
@@ -107,6 +108,7 @@
//window.location.reload()
var
theShow
=
"
原始数据:
"
+
data
.
original
+
"
\n
"
;
theShow
=
theShow
+
"
收到数据:
"
+
data
.
result
+
"
\n
"
;
theShow
=
theShow
+
"
收到数据16进制:
"
+
data
.
resultH
+
"
\n
"
;
theShow
=
theShow
+
"
解析数据:
"
+
JSON
.
stringify
(
data
.
parse
)
+
"
\n
"
;
$
(
"
#showFeedback
"
).
val
(
theShow
)
}
else
{
...
...
templates/messageTools/message/location_msg_page.html
View file @
f21d3a19
...
...
@@ -746,6 +746,7 @@ $("#sendMsgBtn").click(function(){
data
[
"
extraInfo
"
]
=
getExtraInfo
();
var
host
=
window
.
location
.
host
;
$
(
"
#showFeedback
"
).
val
(
""
)
$
.
ajax
({
url
:
"
http://
"
+
host
+
"
/messageTools/message_process/porcessTerminalRegisterMsg
"
,
type
:
"
post
"
,
...
...
@@ -754,10 +755,11 @@ $("#sendMsgBtn").click(function(){
success
:
function
(
data
){
if
(
data
.
status
==
200
){
//window.location.reload()
var
theShow
=
"
原始数据:
"
+
data
.
original
+
"
\n
"
;
theShow
=
theShow
+
"
收到数据:
"
+
data
.
result
+
"
\n
"
;
theShow
=
theShow
+
"
解析数据:
"
+
JSON
.
stringify
(
data
.
parse
)
+
"
\n
"
;
$
(
"
#showFeedback
"
).
val
(
theShow
)
var
theShow
=
"
原始数据:
"
+
data
.
original
+
"
\n
"
;
theShow
=
theShow
+
"
收到数据:
"
+
data
.
result
+
"
\n
"
;
theShow
=
theShow
+
"
收到数据16进制:
"
+
data
.
resultH
+
"
\n
"
;
theShow
=
theShow
+
"
解析数据:
"
+
JSON
.
stringify
(
data
.
parse
)
+
"
\n
"
;
$
(
"
#showFeedback
"
).
val
(
theShow
)
}
else
{
$
(
"
#showFeedback
"
).
val
(
data
.
message
)
alert
(
data
.
message
);
...
...
templates/messageTools/message/terminalRegister_msg_page.html
View file @
f21d3a19
...
...
@@ -77,6 +77,7 @@ $("#sendMsgBtn").click(function(){
data
[
"
carSign
"
]
=
carSign
;
var
host
=
window
.
location
.
host
;
$
(
"
#showFeedback
"
).
val
(
""
)
$
.
ajax
({
url
:
"
http://
"
+
host
+
"
/messageTools/message_process/porcessTerminalRegisterMsg
"
,
type
:
"
post
"
,
...
...
@@ -85,10 +86,11 @@ $("#sendMsgBtn").click(function(){
success
:
function
(
data
){
if
(
data
.
status
==
200
){
//window.location.reload()
var
theShow
=
"
原始数据:
"
+
data
.
original
+
"
\n
"
;
theShow
=
theShow
+
"
收到数据:
"
+
data
.
result
+
"
\n
"
;
theShow
=
theShow
+
"
解析数据:
"
+
JSON
.
stringify
(
data
.
parse
)
+
"
\n
"
;
$
(
"
#showFeedback
"
).
val
(
theShow
)
var
theShow
=
"
原始数据:
"
+
data
.
original
+
"
\n
"
;
theShow
=
theShow
+
"
收到数据:
"
+
data
.
result
+
"
\n
"
;
theShow
=
theShow
+
"
收到数据16进制:
"
+
data
.
resultH
+
"
\n
"
;
theShow
=
theShow
+
"
解析数据:
"
+
JSON
.
stringify
(
data
.
parse
)
+
"
\n
"
;
$
(
"
#showFeedback
"
).
val
(
theShow
)
}
else
{
$
(
"
#showFeedback
"
).
val
(
data
.
message
)
alert
(
data
.
message
);
...
...
templates/messageTools/message/terminalVersionInfoUpload_msg_page.html
View file @
f21d3a19
...
...
@@ -89,6 +89,7 @@ $("#sendMsgBtn").click(function(){
data
[
"
totalOilExpend
"
]
=
totalOilExpend
;
var
host
=
window
.
location
.
host
;
$
(
"
#showFeedback
"
).
val
(
""
)
$
.
ajax
({
url
:
"
http://
"
+
host
+
"
/messageTools/message_process/porcessTerminalVersionInfoUploadMsg
"
,
type
:
"
post
"
,
...
...
@@ -97,10 +98,11 @@ $("#sendMsgBtn").click(function(){
success
:
function
(
data
){
if
(
data
.
status
==
200
){
//window.location.reload()
var
theShow
=
"
原始数据:
"
+
data
.
original
+
"
\n
"
;
theShow
=
theShow
+
"
收到数据:
"
+
data
.
result
+
"
\n
"
;
theShow
=
theShow
+
"
解析数据:
"
+
JSON
.
stringify
(
data
.
parse
)
+
"
\n
"
;
$
(
"
#showFeedback
"
).
val
(
theShow
)
var
theShow
=
"
原始数据:
"
+
data
.
original
+
"
\n
"
;
theShow
=
theShow
+
"
收到数据:
"
+
data
.
result
+
"
\n
"
;
theShow
=
theShow
+
"
收到数据16进制:
"
+
data
.
resultH
+
"
\n
"
;
theShow
=
theShow
+
"
解析数据:
"
+
JSON
.
stringify
(
data
.
parse
)
+
"
\n
"
;
$
(
"
#showFeedback
"
).
val
(
theShow
)
}
else
{
$
(
"
#showFeedback
"
).
val
(
data
.
message
)
alert
(
data
.
message
);
...
...
templates/protocolTools/report/GPS_protocol_page.html
View file @
f21d3a19
...
...
@@ -140,6 +140,7 @@
data
[
"
GPSTimestamp
"
]
=
GPSTimestamp
;
var
host
=
window
.
location
.
host
;
$
(
"
#showFeedback
"
).
val
(
""
)
$
.
ajax
({
url
:
"
http://
"
+
host
+
"
/protocolTools/protocolReport_process/porcessGPSMsg
"
,
type
:
"
post
"
,
...
...
@@ -148,7 +149,11 @@
success
:
function
(
data
){
if
(
data
.
status
==
200
){
//window.location.reload()
$
(
"
#showFeedback
"
).
val
(
data
.
result
)
msg
=
"
发送消息:
"
+
data
.
msgSend
+
"
\n
"
msg
=
msg
+
"
收到消息:
"
+
data
.
result
+
"
\n
"
msg
=
msg
+
"
收到消息16进制:
"
+
data
.
rev
+
"
\n
"
msg
=
msg
+
"
收到消息解析结果:
"
+
data
.
orgRev
+
"
\n
"
$
(
"
#showFeedback
"
).
val
(
msg
)
}
else
{
$
(
"
#showFeedback
"
).
val
(
data
.
message
)
alert
(
data
.
message
);
...
...
templates/protocolTools/report/OBD_CAN_protocol_page.html
View file @
f21d3a19
...
...
@@ -191,6 +191,7 @@ $("#sendMsgBtn").click(function(){
data
[
"
GPSMileage
"
]
=
GPSMileage
;
var
host
=
window
.
location
.
host
;
$
(
"
#showFeedback
"
).
val
(
""
)
$
.
ajax
({
url
:
"
http://
"
+
host
+
"
/protocolTools/protocolReport_process/porcessOBD_CAN_Msg
"
,
type
:
"
post
"
,
...
...
@@ -199,7 +200,11 @@ $("#sendMsgBtn").click(function(){
success
:
function
(
data
){
if
(
data
.
status
==
200
){
//window.location.reload()
$
(
"
#showFeedback
"
).
val
(
data
.
result
)
msg
=
"
发送消息:
"
+
data
.
msgSend
+
"
\n
"
msg
=
msg
+
"
收到消息:
"
+
data
.
result
+
"
\n
"
msg
=
msg
+
"
收到消息16进制:
"
+
data
.
rev
+
"
\n
"
msg
=
msg
+
"
收到消息解析结果:
"
+
data
.
orgRev
+
"
\n
"
$
(
"
#showFeedback
"
).
val
(
msg
)
}
else
{
$
(
"
#showFeedback
"
).
val
(
data
.
message
)
alert
(
data
.
message
);
...
...
templates/protocolTools/report/heartBeat_protocol_page.html
View file @
f21d3a19
...
...
@@ -31,6 +31,7 @@ $("#sendMsgBtn").click(function(){
data
[
"
DEV_ID
"
]
=
DEV_ID
;
var
host
=
window
.
location
.
host
;
$
(
"
#showFeedback
"
).
val
(
""
)
$
.
ajax
({
url
:
"
http://
"
+
host
+
"
/protocolTools/protocolReport_process/porcessHeartBeatMsg
"
,
type
:
"
post
"
,
...
...
@@ -39,7 +40,11 @@ $("#sendMsgBtn").click(function(){
success
:
function
(
data
){
if
(
data
.
status
==
200
){
//window.location.reload()
$
(
"
#showFeedback
"
).
val
(
data
.
result
)
msg
=
"
发送消息:
"
+
data
.
msgSend
+
"
\n
"
msg
=
msg
+
"
收到消息:
"
+
data
.
result
+
"
\n
"
msg
=
msg
+
"
收到消息16进制:
"
+
data
.
rev
+
"
\n
"
msg
=
msg
+
"
收到消息解析结果:
"
+
data
.
orgRev
+
"
\n
"
$
(
"
#showFeedback
"
).
val
(
msg
)
}
else
{
$
(
"
#showFeedback
"
).
val
(
data
.
message
)
alert
(
data
.
message
);
...
...
templates/protocolTools/report/login_protocol_page.html
View file @
f21d3a19
...
...
@@ -44,6 +44,7 @@ $("#sendMsgBtn").click(function(){
data
[
"
imei
"
]
=
imei
var
host
=
window
.
location
.
host
;
$
(
"
#showFeedback
"
).
val
(
""
)
$
.
ajax
({
url
:
"
http://
"
+
host
+
"
/protocolTools/protocolReport_process/porcessLoginMsg
"
,
type
:
"
post
"
,
...
...
@@ -51,8 +52,11 @@ $("#sendMsgBtn").click(function(){
dataType
:
"
json
"
,
success
:
function
(
data
){
if
(
data
.
status
==
200
){
//window.location.reload()
$
(
"
#showFeedback
"
).
val
(
data
.
result
)
msg
=
"
发送消息:
"
+
data
.
msgSend
+
"
\n
"
msg
=
msg
+
"
收到消息:
"
+
data
.
result
+
"
\n
"
msg
=
msg
+
"
收到消息16进制:
"
+
data
.
rev
+
"
\n
"
msg
=
msg
+
"
收到消息解析结果:
"
+
data
.
orgRev
+
"
\n
"
$
(
"
#showFeedback
"
).
val
(
msg
)
}
else
{
$
(
"
#showFeedback
"
).
val
(
data
.
message
)
alert
(
data
.
message
);
...
...
templates/protocolTools/report/securityStatus_protocol_page.html
View file @
f21d3a19
...
...
@@ -333,6 +333,7 @@ $("#sendMsgBtn").click(function(){
data
[
"
dataByte
"
]
=
dataByte
var
host
=
window
.
location
.
host
;
$
(
"
#showFeedback
"
).
val
(
""
)
$
.
ajax
({
url
:
"
http://
"
+
host
+
"
/protocolTools/protocolReport_process/porcessSecurityStatusMsg
"
,
type
:
"
post
"
,
...
...
@@ -341,7 +342,11 @@ $("#sendMsgBtn").click(function(){
success
:
function
(
data
){
if
(
data
.
status
==
200
){
//window.location.reload()
$
(
"
#showFeedback
"
).
val
(
data
.
result
)
msg
=
"
发送消息:
"
+
data
.
msgSend
+
"
\n
"
msg
=
msg
+
"
收到消息:
"
+
data
.
result
+
"
\n
"
msg
=
msg
+
"
收到消息16进制:
"
+
data
.
rev
+
"
\n
"
msg
=
msg
+
"
收到消息解析结果:
"
+
data
.
orgRev
+
"
\n
"
$
(
"
#showFeedback
"
).
val
(
msg
)
}
else
{
$
(
"
#showFeedback
"
).
val
(
data
.
message
)
alert
(
data
.
message
);
...
...
views/messageTools/message_process.py
View file @
f21d3a19
...
...
@@ -52,7 +52,9 @@ def porcessHeartBeatMsg():
data
[
"message"
]
=
"Sucess: "
data
[
"original"
]
=
msg
data
[
"result"
]
=
socRecv_2
data
[
"parse"
]
=
json
.
loads
(
PlatformCommon_res
(
socRecv_1
)
.
getMsg
())
msgP
=
PlatformCommon_res
(
socRecv_1
)
data
[
"resultH"
]
=
msgP
.
getOriginalMsg
()
data
[
"parse"
]
=
json
.
loads
(
msgP
.
getMsg
())
except
BaseException
as
e
:
# 打印异常信息
traceback
.
print_exc
()
...
...
@@ -104,7 +106,9 @@ def porcessTerminalRegisterMsg():
data
[
"message"
]
=
"Sucess: "
data
[
"original"
]
=
msg
data
[
"result"
]
=
socRecv_2
data
[
"parse"
]
=
json
.
loads
(
PlatformCommon_res
(
socRecv_1
)
.
getMsg
())
msgP
=
PlatformCommon_res
(
socRecv_1
)
data
[
"resultH"
]
=
msgP
.
getOriginalMsg
()
data
[
"parse"
]
=
json
.
loads
(
msgP
.
getMsg
())
except
BaseException
as
e
:
# 打印异常信息
traceback
.
print_exc
()
...
...
@@ -162,7 +166,9 @@ def porcessTerminalVersionInfoUploadMsg():
data
[
"message"
]
=
"Sucess: "
data
[
"original"
]
=
msg
data
[
"result"
]
=
socRecv_2
data
[
"parse"
]
=
json
.
loads
(
PlatefromVersionInfo_res
(
socRecv_1
)
.
getMsg
())
msgP
=
PlatformCommon_res
(
socRecv_1
)
data
[
"resultH"
]
=
msgP
.
getOriginalMsg
()
data
[
"parse"
]
=
json
.
loads
(
msgP
.
getMsg
())
except
BaseException
as
e
:
# 打印异常信息
traceback
.
print_exc
()
...
...
@@ -278,7 +284,9 @@ def porcessDataUpstreamTransportMsg():
data
[
"message"
]
=
"Sucess: "
data
[
"original"
]
=
msg
data
[
"result"
]
=
socRecv_2
data
[
"parse"
]
=
json
.
loads
(
PlatformCommon_res
(
socRecv_1
)
.
getMsg
())
msgP
=
PlatformCommon_res
(
socRecv_1
)
data
[
"resultH"
]
=
msgP
.
getOriginalMsg
()
data
[
"parse"
]
=
json
.
loads
(
msgP
.
getMsg
())
except
BaseException
as
e
:
# 打印异常信息
traceback
.
print_exc
()
...
...
@@ -333,7 +341,9 @@ def porcessDataUpstreamTransportMsg_F2():
data
[
"message"
]
=
"Sucess: "
data
[
"original"
]
=
msg
data
[
"result"
]
=
socRecv_2
data
[
"parse"
]
=
json
.
loads
(
PlatformCommon_res
(
socRecv_1
)
.
getMsg
())
msgP
=
PlatformCommon_res
(
socRecv_1
)
data
[
"resultH"
]
=
msgP
.
getOriginalMsg
()
data
[
"parse"
]
=
json
.
loads
(
msgP
.
getMsg
())
except
BaseException
as
e
:
# 打印异常信息
traceback
.
print_exc
()
...
...
@@ -382,7 +392,9 @@ def porcessDataUpstreamTransportMsg_F3():
data
[
"message"
]
=
"Sucess: "
data
[
"original"
]
=
msg
data
[
"result"
]
=
socRecv_2
data
[
"parse"
]
=
json
.
loads
(
PlatformCommon_res
(
socRecv_1
)
.
getMsg
())
msgP
=
PlatformCommon_res
(
socRecv_1
)
data
[
"resultH"
]
=
msgP
.
getOriginalMsg
()
data
[
"parse"
]
=
json
.
loads
(
msgP
.
getMsg
())
except
BaseException
as
e
:
# 打印异常信息
traceback
.
print_exc
()
...
...
@@ -437,7 +449,9 @@ def porcessDataUpstreamTransportMsg_F4():
data
[
"message"
]
=
"Sucess: "
data
[
"original"
]
=
msg
data
[
"result"
]
=
socRecv_2
data
[
"parse"
]
=
json
.
loads
(
PlatformCommon_res
(
socRecv_1
)
.
getMsg
())
msgP
=
PlatformCommon_res
(
socRecv_1
)
data
[
"resultH"
]
=
msgP
.
getOriginalMsg
()
data
[
"parse"
]
=
json
.
loads
(
msgP
.
getMsg
())
except
BaseException
as
e
:
# 打印异常信息
traceback
.
print_exc
()
...
...
views/protocolTools/protocolReport_process.py
View file @
f21d3a19
...
...
@@ -39,11 +39,14 @@ def porcessHeartBeatMsg():
msg
=
heartBeatProtocolObj
.
generateHeartBeatMsg
()
cliSocket
.
send
(
msg
)
socRecv
=
cliSocket
.
receive
()
socRecv
=
str
(
socRecv
)
socRecv
o
=
str
(
socRecv
)
cliSocket
.
close
()
data
[
"status"
]
=
"200"
data
[
"message"
]
=
"Sucess: "
data
[
"result"
]
=
socRecv
data
[
"msgSend"
]
=
msg
data
[
"result"
]
=
socRecvo
data
[
"rev"
]
=
str
(
binascii
.
b2a_hex
(
socRecv
))[
2
:][:
-
1
]
data
[
"orgRev"
]
=
"*********返回的消息还未解析*********"
except
BaseException
as
e
:
# 打印异常信息
traceback
.
print_exc
()
...
...
@@ -80,11 +83,14 @@ def porcessLoginBeatMsg():
msg
=
loginProtocolObj
.
generateLoginMsg
()
cliSocket
.
send
(
msg
)
socRecv
=
cliSocket
.
receive
()
socRecv
=
str
(
socRecv
)
socRecv
o
=
str
(
socRecv
)
cliSocket
.
close
()
data
[
"status"
]
=
"200"
data
[
"message"
]
=
"Sucess: "
data
[
"result"
]
=
socRecv
data
[
"msgSend"
]
=
msg
data
[
"result"
]
=
socRecvo
data
[
"rev"
]
=
str
(
binascii
.
b2a_hex
(
socRecv
))[
2
:][:
-
1
]
data
[
"orgRev"
]
=
"*********返回的消息还未解析*********"
except
BaseException
as
e
:
# 打印异常信息
traceback
.
print_exc
()
...
...
@@ -137,12 +143,14 @@ def porcessGPSMsg():
msg
=
GPSProtocolObj
.
generateGpsMsg
()
cliSocket
.
send
(
msg
)
socRecv
=
cliSocket
.
receive
()
socRecv
=
str
(
socRecv
)
# socRecv = str(binascii.b2a_hex(socRecv))
socRecvo
=
str
(
socRecv
)
cliSocket
.
close
()
data
[
"status"
]
=
"200"
data
[
"message"
]
=
"Sucess: "
data
[
"result"
]
=
socRecv
data
[
"msgSend"
]
=
msg
data
[
"result"
]
=
socRecvo
data
[
"rev"
]
=
str
(
binascii
.
b2a_hex
(
socRecv
))[
2
:][:
-
1
]
data
[
"orgRev"
]
=
"*********返回的消息还未解析*********"
except
BaseException
as
e
:
# 打印异常信息
traceback
.
print_exc
()
...
...
@@ -220,12 +228,14 @@ def porcessOBD_CAN_Msg():
msg
=
OBD_CAN_protocolObj
.
generateOBDReportCANMsg
()
cliSocket
.
send
(
msg
)
socRecv
=
cliSocket
.
receive
()
socRecv
=
str
(
socRecv
)
# socRecv = str(binascii.b2a_hex(socRecv))
socRecvo
=
str
(
socRecv
)
cliSocket
.
close
()
data
[
"status"
]
=
"200"
data
[
"message"
]
=
"Sucess: "
data
[
"result"
]
=
socRecv
data
[
"msgSend"
]
=
msg
data
[
"result"
]
=
socRecvo
data
[
"rev"
]
=
str
(
binascii
.
b2a_hex
(
socRecv
))[
2
:][:
-
1
]
data
[
"orgRev"
]
=
"*********返回的消息还未解析*********"
except
BaseException
as
e
:
# 打印异常信息
traceback
.
print_exc
()
...
...
@@ -269,11 +279,14 @@ def porcessSecurityStatusMsg():
msg
=
securityStatusProtocolObj
.
generateSecurityStatusMsg
()
cliSocket
.
send
(
msg
)
socRecv
=
cliSocket
.
receive
()
socRecv
=
str
(
socRecv
)
socRecv
o
=
str
(
socRecv
)
cliSocket
.
close
()
data
[
"status"
]
=
"200"
data
[
"message"
]
=
"Sucess: "
data
[
"result"
]
=
socRecv
data
[
"msgSend"
]
=
msg
data
[
"result"
]
=
socRecvo
data
[
"rev"
]
=
str
(
binascii
.
b2a_hex
(
socRecv
))[
2
:][:
-
1
]
data
[
"orgRev"
]
=
"*********返回的消息还未解析*********"
except
BaseException
as
e
:
# 打印异常信息
traceback
.
print_exc
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment