Fixed issue #1 due to bad filtering for messageType byte

This commit is contained in:
selva.andre
2012-07-24 22:43:13 +02:00
parent a17c07ad46
commit 4cd366e634
8 changed files with 31 additions and 38 deletions
@@ -18,7 +18,7 @@ public abstract class MqttDecoder extends MessageDecoderAdapter {
return NEED_DATA;
}
byte h1 = in.get();
byte messageType = (byte) ((h1 & 0x0010) >> 4);
byte messageType = (byte) ((h1 & 0x00F0) >> 4);
boolean dupFlag = ((byte) ((h1 & 0x0008) >> 3) == 1);
byte qosLevel = (byte) ((h1 & 0x0006) >> 1);
boolean retainFlag = ((byte) (h1 & 0x0001) == 1);