-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Description
Bug fixed on MQTT.java: mqtt.retain il the last bit of the first byte, not on the second byte
public static MQTTMessage decode(byte[] message) {
int i = 0;
MQTTMessage mqtt = new MQTTMessage();
mqtt.type = (message[i] >> 4) & 0x0F;
mqtt.DUP = ((message[i] >> 3) & 0x01) == 0 ? false : true;
mqtt.QoS = (message[i] >> 1) & 0x03;
//mqtt.retain = (message[i++] & 0x01) == 0 ? false : true; // credo che l' i++ sia sbagliato
mqtt.retain = (message[i] & 0x01) == 0 ? false : true;
Then an i++ should be added before :
switch (mqtt.type) {
case CONNECT:
There is also something to fix after that to mage the message[0] work.
I still have the problem that I send a byte and I receive, on android side, a char. Any idea?
Metadata
Metadata
Assignees
Labels
No labels