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
0198e4ba
Commit
0198e4ba
authored
Apr 15, 2020
by
liyuanhong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改了新硬件,消息长度不对的bug 2
parent
cb0493a0
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
4 deletions
+7
-4
lib/protocol/message/MessageBase.py
lib/protocol/message/MessageBase.py
+7
-4
No files found.
lib/protocol/message/MessageBase.py
View file @
0198e4ba
...
@@ -65,8 +65,8 @@ class MessageBase(Base):
...
@@ -65,8 +65,8 @@ class MessageBase(Base):
if
msgBodyLen
>=
512
:
if
msgBodyLen
>=
512
:
raise
RuntimeError
(
'消息体长度超长!'
)
raise
RuntimeError
(
'消息体长度超长!'
)
msgBodyLen
=
msgBodyLen
#消息体长度
msgBodyLen
=
msgBodyLen
#消息体长度
encryptionType
=
encryptionType
<<
10
#加密方式
encryptionType
=
encryptionType
#加密方式
subPkg
=
subPkg
<<
13
#分包
subPkg
=
subPkg
#分包
retain
=
0
#保留位
retain
=
0
#保留位
data
=
msgBodyLen
+
encryptionType
+
subPkg
+
retain
data
=
msgBodyLen
+
encryptionType
+
subPkg
+
retain
dataHex
=
self
.
int2hexStringByBytes
(
data
,
2
)
dataHex
=
self
.
int2hexStringByBytes
(
data
,
2
)
...
@@ -77,11 +77,14 @@ class MessageBase(Base):
...
@@ -77,11 +77,14 @@ class MessageBase(Base):
if
msgBodyLen
>=
512
:
if
msgBodyLen
>=
512
:
raise
RuntimeError
(
'消息体长度超长!'
)
raise
RuntimeError
(
'消息体长度超长!'
)
msgBodyLen
=
msgBodyLen
#消息体长度
msgBodyLen
=
msgBodyLen
#消息体长度
encryptionType
=
encryptionType
<<
10
#加密方式
encryptionType
=
encryptionType
#加密方式
subPkg
=
subPkg
<<
13
#分包
subPkg
=
subPkg
#分包
retain
=
0
#保留位
retain
=
0
#保留位
data
=
msgBodyLen
+
encryptionType
+
subPkg
+
retain
data
=
msgBodyLen
+
encryptionType
+
subPkg
+
retain
dataHex
=
self
.
int2hexStringByBytes
(
data
,
2
)
dataHex
=
self
.
int2hexStringByBytes
(
data
,
2
)
print
(
encryptionType
)
print
(
subPkg
)
print
(
dataHex
)
return
dataHex
return
dataHex
#获取消息封装项
#获取消息封装项
...
...
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