Skip to content
This repository has been archived by the owner on Jan 8, 2024. It is now read-only.

Commit

Permalink
Merge branch 'development'
Browse files Browse the repository at this point in the history
  • Loading branch information
srware committed Oct 7, 2019
2 parents 0f1cbb1 + 093594c commit 451e081
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
11 changes: 9 additions & 2 deletions lib/proxies/iot.mqtt.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,18 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
var common = require('../common'),
Broker = require("../../api/mqtt/connector");

var topic = {
"metric_topic": "server/metric/{accountid}/{deviceid}",
"health": "server/devices/{deviceid}/health",
"health_status": "device/{deviceid}/health"
}

function IoTKitMQTTCloud(conf, broker) {

var me = this;
me.client = broker;
me.type = 'mqtt';
me.topics = conf.connector[me.type].topic;
me.topics = topic;
me.pubArgs = {
qos: 1,
retain: false
Expand Down Expand Up @@ -76,8 +82,9 @@ IoTKitMQTTCloud.prototype.health = function (device, callback) {
var topic = common.buildPath(me.topics.health, device);
var data = { 'detail': 'mqtt'};
me.client.publish(topic, data, me.pubArgs);
callback(1)
} else {
callback();
callback(0);
}

});
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@open-iot-service-platform/oisp-sdk-js",
"version": "1.1.0",
"version": "1.1.1",
"description": "OISP SDK for Node.js",
"main": "index.js",
"scripts": {
Expand Down

0 comments on commit 451e081

Please sign in to comment.