diff --git a/lib/proxies/iot.mqtt.js b/lib/proxies/iot.mqtt.js index 0b70d76..2e0a567 100644 --- a/lib/proxies/iot.mqtt.js +++ b/lib/proxies/iot.mqtt.js @@ -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 @@ -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); } }); diff --git a/package.json b/package.json index 9e48e02..6aad8af 100644 --- a/package.json +++ b/package.json @@ -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": {