Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

QoS read fix. #18

Closed
wants to merge 2 commits into from

2 participants

@radekg

No description provided.

@adamvr
Owner

You're right, QOS_MASK should be 0x06, rather than 0x05.

A couple of qos >= 0 tests scripts are here: https://gist.github.com/2920833

Cheers!

@adamvr adamvr closed this
@kmpm kmpm referenced this pull request from a commit
@kmpm kmpm Added tests for QOS.
Inspired by comments in issue #18
157969a
@kmpm kmpm referenced this pull request from a commit
Commit has since been removed from the repository and is no longer available.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jun 7, 2012
  1. @radekg

    Fix for the client on(connect), first argument should be a client, no…

    radekg authored
    …t null according to the docs.
Commits on Jun 12, 2012
  1. @radekg

    Revert the on(connect) change, fix for QoS status read - based on Ecl…

    radekg authored
    …ipse Paho MqttPublish.java
This page is out of date. Refresh to see the latest.
Showing with 2 additions and 3 deletions.
  1. +1 −2  lib/parse.js
  2. +1 −1  lib/protocol.js
View
3  lib/parse.js
@@ -4,9 +4,8 @@ var protocol = require('./protocol');
module.exports.header = function(buf, packet) {
packet.cmd = protocol.types[buf[0] >> protocol.CMD_SHIFT];
packet.retain = (buf[0] & protocol.RETAIN_MASK) !== 0;
- packet.qos = (buf[0] & protocol.QOS_MASK) >> protocol.QOS_SHIFT;
+ packet.qos = (buf[0] >> protocol.QOS_SHIFT) & protocol.QOS_MASK;
packet.dup = (buf[0] & protocol.DUP_MASK) !== 0;
-
return packet;
};
View
2  lib/protocol.js
@@ -31,7 +31,7 @@ for(var k in module.exports.types) {
module.exports.CMD_SHIFT = 4;
module.exports.CMD_MASK = 0xF0;
module.exports.DUP_MASK = 0x08;
-module.exports.QOS_MASK = 0x05;
+module.exports.QOS_MASK = 0x03;
module.exports.QOS_SHIFT = 1;
module.exports.RETAIN_MASK = 0x01;
Something went wrong with that request. Please try again.