diff --git a/lib/bridgeSetupSession.js b/lib/bridgeSetupSession.js index 88d5205..eb70a96 100644 --- a/lib/bridgeSetupSession.js +++ b/lib/bridgeSetupSession.js @@ -36,12 +36,12 @@ inherits(BridgeSetupSession, EventEmitter); BridgeSetupSession.prototype.handleWriteRequest = function(request) { if (request.type === "Negotiate") { - this.transactionID = request.tid; + this.transactionID = request.tid + 1; this.preferedLanguage = request.language; this.validSession = true var respDict = { - "tid": this.transactionID + 1, + "tid": this.transactionID, "type": "Negotiate", "sid": this.sessionUUID, "attachment": { @@ -91,7 +91,8 @@ BridgeSetupSession.prototype.pluginResponseHandler = function(response, type, re this.emit('newConfig', type, this.currentPluginName, replace, config); this.presentMainMenu(); } else if (response) { - response.tid = this.transactionID + 1; + this.transactionID += 1; + response.tid = this.transactionID; response.sid = this.sessionUUID; this.sendResponse(response); @@ -101,8 +102,10 @@ BridgeSetupSession.prototype.pluginResponseHandler = function(response, type, re BridgeSetupSession.prototype.presentMainMenu = function() { this.currentStage = 1; + this.transactionID += 1; + var respDict = { - "tid": this.transactionID + 1, + "tid": this.transactionID, "sid": this.sessionUUID, "type": "Interface", "interface": "list", @@ -123,8 +126,10 @@ BridgeSetupSession.prototype.presentManagePlatformMenu = function() { } this.listOfPlatforms = listOfPlatforms; + this.transactionID += 1; + var respDict = { - "tid": this.transactionID + 1, + "tid": this.transactionID, "type": "Interface", "sid": this.sessionUUID, "interface": "list", @@ -142,8 +147,10 @@ BridgeSetupSession.prototype.presentManageAccessoryMenu = function() { this.currentConfig = config; }.bind(this)); + this.transactionID += 1; + var respDict = { - "tid": this.transactionID + 1, + "tid": this.transactionID, "type": "Interface", "sid": this.sessionUUID, "interface": "instruction", diff --git a/package.json b/package.json index be3316b..8b382cd 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,7 @@ "dependencies": { "chalk": "^1.1.1", "commander": "2.8.1", - "hap-nodejs": "0.2.0", + "hap-nodejs": "0.2.1", "semver": "5.0.3", "node-persist": "^0.0.8" }