Commit 0198e4ba authored by liyuanhong's avatar liyuanhong

修改了新硬件,消息长度不对的bug 2

parent cb0493a0
...@@ -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
#获取消息封装项 #获取消息封装项
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment