aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/main/java/org/traccar/protocol/IotmProtocolDecoder.java4
-rw-r--r--src/test/java/org/traccar/protocol/IotmProtocolDecoderTest.java4
2 files changed, 4 insertions, 4 deletions
diff --git a/src/main/java/org/traccar/protocol/IotmProtocolDecoder.java b/src/main/java/org/traccar/protocol/IotmProtocolDecoder.java
index 0c8954ae9..ac92b299f 100644
--- a/src/main/java/org/traccar/protocol/IotmProtocolDecoder.java
+++ b/src/main/java/org/traccar/protocol/IotmProtocolDecoder.java
@@ -117,10 +117,10 @@ public class IotmProtocolDecoder extends BaseProtocolDecoder {
} else if (msg instanceof MqttSubscribeMessage) {
- MqttPublishMessage message = (MqttPublishMessage) msg;
+ MqttSubscribeMessage message = (MqttSubscribeMessage) msg;
MqttMessage response = MqttMessageBuilders.subAck()
- .packetId((short) message.variableHeader().packetId())
+ .packetId((short) message.variableHeader().messageId())
.build();
if (channel != null) {
diff --git a/src/test/java/org/traccar/protocol/IotmProtocolDecoderTest.java b/src/test/java/org/traccar/protocol/IotmProtocolDecoderTest.java
index 1c783b355..9647b3723 100644
--- a/src/test/java/org/traccar/protocol/IotmProtocolDecoderTest.java
+++ b/src/test/java/org/traccar/protocol/IotmProtocolDecoderTest.java
@@ -16,10 +16,10 @@ public class IotmProtocolDecoderTest extends ProtocolTest {
"123456789012345").build());
verifyPositions(decoder, false, MqttMessageBuilders.publish().payload(binary(
- "020208009188752DE7120300013A002000AD59050030B135030340030C300301A00302A00E00D0B9AB5B420334C04100001F060000320004072064008C000162002000C004476F6F440109002100AD59050030BA359B")).qos(MqttQoS.EXACTLY_ONCE).build());
+ "020208009188752DE7120300013A002000AD59050030B135030340030C300301A00302A00E00D0B9AB5B420334C04100001F060000320004072064008C000162002000C004476F6F440109002100AD59050030BA359B")).qos(MqttQoS.EXACTLY_ONCE).messageId(1).build());
verifyPositions(decoder, false, MqttMessageBuilders.publish().payload(binary(
- "020208009188752DE71203000109002000AD590500309635F3")).qos(MqttQoS.EXACTLY_ONCE).build());
+ "020208009188752DE71203000109002000AD590500309635F3")).qos(MqttQoS.EXACTLY_ONCE).messageId(1).build());
}