Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
黄嘉阳
/
iot-mqtt-protocol
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
ca4eecca
authored
Apr 17, 2024
by
罗志长
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
fix: 读写属性回复
parent
551b0435
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
src/main/java/org/jetlinks/protocol/official/JetLinksMqttDeviceMessageCodec.java
src/main/java/org/jetlinks/protocol/official/JetLinksMqttDeviceMessageCodec.java
View file @
ca4eecca
...
...
@@ -253,11 +253,15 @@ public class JetLinksMqttDeviceMessageCodec implements DeviceMessageCodec {
Set
<
String
>
keySet
=
jsonObject
.
keySet
();
Map
<
String
,
Object
>
propertiesMap
=
new
HashMap
<>();
for
(
String
key
:
keySet
)
{
Integer
retCode
=
((
JSONObject
)
jsonObject
.
get
(
key
)).
getInteger
(
"retCode"
);
Object
value
=
((
JSONObject
)
jsonObject
.
get
(
key
)).
get
(
"value"
);
propertiesMap
.
put
(
key
,
value
);
if
(
message
.
getTopic
().
contains
(
"write"
))
{
if
(
retCode
!=
null
&&
retCode
==
0
)
{
if
(
value
!=
null
&&
value
.
toString
().
equals
(
"success"
))
{
propertiesMap
.
put
(
key
,
0
);
}
else
{
propertiesMap
.
put
(
key
,
value
);
}
}
}
}
map
.
put
(
"properties"
,
propertiesMap
);
...
...
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