Commit 793014f7 by Chavee Issariyapat

remove comment

parent d176edea
...@@ -59,12 +59,6 @@ const Coordinator = function(param={}) { ...@@ -59,12 +59,6 @@ const Coordinator = function(param={}) {
this.localserver.on('clientSubscribed', function(packet, client) { this.localserver.on('clientSubscribed', function(packet, client) {
let deviceid = client.id.split(':')[0]; let deviceid = client.id.split(':')[0];
// if client try to subscribe @msg/xxx/yyy --> flowagent subscribe @tap on a remote broker // if client try to subscribe @msg/xxx/yyy --> flowagent subscribe @tap on a remote broker
// if (packet.topic.startsWith('@msg/')) {
// let msgpart = packet.topic.split('/').splice(3).join('/');
// outtopic = `@tap/msg/topic/${deviceid}:${client.token}/${msgpart}`;
// that.remoteclient.subscribe(outtopic);
// }
if (packet.topic.startsWith('@local/msgin/')) { if (packet.topic.startsWith('@local/msgin/')) {
let msgpart = packet.topic.split('/').splice(4).join('/'); let msgpart = packet.topic.split('/').splice(4).join('/');
outtopic = `@tap/msg/topic/${deviceid}:${client.token}/${msgpart}`; outtopic = `@tap/msg/topic/${deviceid}:${client.token}/${msgpart}`;
...@@ -72,7 +66,6 @@ const Coordinator = function(param={}) { ...@@ -72,7 +66,6 @@ const Coordinator = function(param={}) {
} }
else { else {
} }
}); });
this.localserver.on('clientPublished', function(packet, client){ this.localserver.on('clientPublished', function(packet, client){
...@@ -98,12 +91,6 @@ const Coordinator = function(param={}) { ...@@ -98,12 +91,6 @@ const Coordinator = function(param={}) {
that.remoteclient.publish(outtopic, outmsg); that.remoteclient.publish(outtopic, outmsg);
break; break;
default: default:
// if (packet.topic.startsWith('@msg/')) {
// let part = packet.topic.substr(5);
// outtopic = `@tap/msg/topic/${deviceid}:${client.token}/${part}`;
// outmsg = packet.payload.toString();
// that.remoteclient.publish(outtopic, outmsg);
// }
if (packet.topic.startsWith('@local/msgout/')) { if (packet.topic.startsWith('@local/msgout/')) {
let part = packet.topic.substr(14); let part = packet.topic.substr(14);
outtopic = `@tap/msg/topic/${deviceid}:${client.token}/${part}`; outtopic = `@tap/msg/topic/${deviceid}:${client.token}/${part}`;
......
...@@ -39,6 +39,7 @@ MQTTClient.prototype.publish = function(topic, payload) { ...@@ -39,6 +39,7 @@ MQTTClient.prototype.publish = function(topic, payload) {
this.client.publish(topic, payload); this.client.publish(topic, payload);
} }
else { else {
} }
} }
......
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