Commit 74489dc2 by Chavee Issariyapat

reset flowchannel when channel endpoint is updated

parent f6b95010
......@@ -208,8 +208,21 @@ Coordinator.prototype.start = function() {
return true;
}
else {
return true;
}
}
Coordinator.prototype.stop = function() {
if (this.started) {
this.started = false;
this.mqttclient.disconnect();
return false;
}
else {
return false;
}
}
function create(param) {
......
......@@ -65,6 +65,11 @@ FlowAgent.prototype.start = function() {
else return false;
}
FlowAgent.prototype.stop = function() {
this.started = this.coordinator.stop();
}
FlowAgent.prototype.getInfo = function() {
return {
broker_uri : this.option.broker_uri,
......
......@@ -22,7 +22,7 @@ function sleep(ms) {
MQTTClient.prototype.__proto__ = EventEmitter.prototype;
MQTTClient.prototype.connect = function() {
var that = this;
let that = this;
if (this.client) delete this.client;
......@@ -49,7 +49,10 @@ MQTTClient.prototype.connect = function() {
console.log('MQClient Error:');
console.log(error);
});
}
MQTTClient.prototype.disconnect = function() {
this.client.end();
}
MQTTClient.prototype.resetbroker = function(topic, payload) {
......
{
"name": "flowagent",
"version": "1.2.1",
"version": "1.2.2",
"description": "",
"main": "flowagent.js",
"scripts": {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment