Skip to content

Commit a0ce15b

Browse files
committed
allow load from storage
1 parent 11e1b15 commit a0ce15b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

modules/MQTT.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ MQTT.prototype.packetHandler = function(data) {
231231
//console.log("Unsubscription succesful.");
232232
this.emit('unsubscribed');
233233
} else if (type === TYPE.PINGREQ) {
234-
this.client.write(fromCharCode(TYPE.PINGRESP << 4) + "\x00");
234+
this.client.write(fromCharCode(TYPE.PINGRESP << 4,0));
235235
} else if (type === TYPE.PINGRESP) {
236236
this.emit('ping_reply');
237237
} else if (type === TYPE.CONNACK) {
@@ -317,7 +317,7 @@ MQTT.prototype._scktClosed = function () {
317317
MQTT.prototype.disconnect = function () {
318318
if (!this.client) return;
319319
try {
320-
this.client.write(fromCharCode(TYPE.DISCONNECT << 4) + "\x00");
320+
this.client.write(fromCharCode(TYPE.DISCONNECT << 4,0));
321321
} catch(e) {
322322
return this._scktClosed();
323323
}
@@ -383,7 +383,7 @@ MQTT.prototype.unsubscribe = function (topic) {
383383
MQTT.prototype.ping = function () {
384384
if (!this.client) return;
385385
try {
386-
this.client.write(fromCharCode(TYPE.PINGREQ << 4) + "\x00");
386+
this.client.write(fromCharCode(TYPE.PINGREQ << 4,0));
387387
} catch (e) {
388388
this._scktClosed();
389389
}

0 commit comments

Comments
 (0)