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
6109db68
Commit
6109db68
authored
Feb 11, 2020
by
liyuanhong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
完成批量数据上传消息
parent
f3cf20d4
Changes
4
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
458 additions
and
8 deletions
+458
-8
lib/protocol/LocationDataBatchUpdate_msg.py
lib/protocol/LocationDataBatchUpdate_msg.py
+442
-0
lib/socket/messageTest.py
lib/socket/messageTest.py
+11
-5
templates/messageTools/message/heartBeat_msg_page.html
templates/messageTools/message/heartBeat_msg_page.html
+4
-3
views/messageTools/message_process.py
views/messageTools/message_process.py
+1
-0
No files found.
lib/protocol/LocationDataBatchUpdate_msg.py
0 → 100644
View file @
6109db68
This diff is collapsed.
Click to expand it.
lib/socket/messageTest.py
View file @
6109db68
...
...
@@ -3,14 +3,17 @@ import binascii
import
socket
from
time
import
sleep
from
lib.protocol.LocationDataBatchUpdate_msg
import
LocationDataBatchUpdate_msg
from
lib.protocol.message.DataUpstreamTransport_msg
import
DataUpstreamTransport_msg
from
lib.protocol.message.Location_msg
import
Location_msg
from
lib.protocol.message.MessageBase
import
MessageBase
from
lib.protocol.message.QueryTerminalParam_res
import
QueryTerminalParam_res
from
lib.protocol.message.QueryTerminalProperty_res
import
QueryTerminalProperty_res
from
lib.protocol.message.TerminalAuthenticate_msg
import
TerminalAuthenticate_msg
from
lib.protocol.message.TerminalCommonMsgRes_msg
import
TerminalCommonMsgRes_msg
from
lib.protocol.message.TerminalHeartbeat_msg
import
TerminalHeartbeat_msg
from
lib.protocol.message.TerminalRegister_msg
import
TerminalRegister_msg
from
lib.protocol.message.TerminalUpdateResult_msg
import
TerminalUpdataResult_msg
from
lib.protocol.message.TerminalVersionInfo_msg
import
TerminalVersionInfo_msg
from
lib.protocol.message.data.TerminalCancle_msg
import
TerminalCancle_msg
from
lib.protocol.messagePlateform.PlatformCommon_res
import
PlatformCommon_res
...
...
@@ -26,9 +29,12 @@ port = 9001
# msg = TerminalCancle_msg().generateMsg() #终端注销
# msg = TerminalAuthenticate_msg().generateMsg() #终端鉴权
# msg = TerminalVersionInfo_msg().generateMsg() #终端版本信息上报
msg
=
QueryTerminalParam_res
()
.
generateMsg
()
#查询终端参数应答
# msg = QueryTerminalParam_res().generateMsg() #查询终端参数应答
# msg = QueryTerminalProperty_res().generateMsg() #查询终端属性应答消息
# msg = Location_msg().generateMsg() #位置信息汇报
# msg = DataUpstreamTransport_msg().generateMsg() #数据上行透传消息
# msg = TerminalUpdataResult_msg().generateMsg() #终端升级结果通知
msg
=
LocationDataBatchUpdate_msg
()
.
generateMsg
()
#定位数据批量上传
#发送单条消息
def
sendSingleMsg
(
msg
):
...
...
@@ -42,8 +48,8 @@ def sendSingleMsg(msg):
# client.send(bytes.fromhex(msg))
data
=
client
.
recv
(
BUF_SIZE
)
print
(
data
)
print
(
PlatformCommon_res
(
data
)
.
getMsg
())
# print(TerminalRegister_res(data).getMsg())
print
(
PlatformCommon_res
(
data
)
.
getMsg
())
#终端通用应答消息
# print(TerminalRegister_res(data).getMsg())
#终端注册应答消息
client
.
close
()
def
closeSocket
(
soc
):
...
...
templates/messageTools/message/heartBeat_msg_page.html
View file @
6109db68
...
...
@@ -46,7 +46,7 @@
<option
value=
"0"
>
无
</option>
<option
value=
"8192"
>
有
</option>
</select>
<label
id=
"subPkg_label"
style=
"color:grey;"
>
分包个数:
</label><input
disabled=
"disabled"
id=
"pkgCounts"
type=
"text"
class=
"form-control"
value=
"
2
"
style=
"width:60px;"
>
<label
id=
"subPkg_label"
style=
"color:grey;"
>
分包个数:
</label><input
disabled=
"disabled"
id=
"pkgCounts"
type=
"text"
class=
"form-control"
value=
"
0
"
style=
"width:60px;"
>
</div>
<H3
style=
"border-bottom: 1px solid #eee;"
>
设置心跳消息内容:
</H3>
<ul
class=
"protocol_content"
style=
"padding:0px;"
>
...
...
@@ -96,8 +96,9 @@
success
:
function
(
data
){
if
(
data
.
status
==
200
){
//window.location.reload()
var
theShow
=
"
原始数据:
"
+
data
.
result
+
"
\n
"
theShow
=
theShow
+
"
解析数据:
"
+
JSON
.
stringify
(
data
.
parse
)
+
"
\n
"
var
theShow
=
"
原始数据:
"
+
data
.
original
+
"
\n
"
;
theShow
=
theShow
+
"
收到数据:
"
+
data
.
result
+
"
\n
"
;
theShow
=
theShow
+
"
解析数据:
"
+
JSON
.
stringify
(
data
.
parse
)
+
"
\n
"
;
$
(
"
#showFeedback
"
).
val
(
theShow
)
}
else
{
$
(
"
#showFeedback
"
).
val
(
data
.
message
)
...
...
views/messageTools/message_process.py
View file @
6109db68
...
...
@@ -46,6 +46,7 @@ def porcessHeartBeatMsg():
cliSocket
.
close
()
data
[
"status"
]
=
"200"
data
[
"message"
]
=
"Sucess: "
data
[
"original"
]
=
msg
data
[
"result"
]
=
socRecv_2
data
[
"parse"
]
=
PlatformCommon_res
(
socRecv_1
)
.
getMsg
()
except
BaseException
as
e
:
...
...
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