Created
February 22, 2016 19:30
-
-
Save ryanjbaxter/b384dd282a25c8b41ba9 to your computer and use it in GitHub Desktop.
Sample Node.js Code From IDA-6754 At InterConnect 2016
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Client = require('ibmiotf').IotfApplication; | |
var app = new Client({ | |
"org" : "quickstart", | |
"id" : "interconnectdemo" | |
}); | |
app.connect(); | |
app.on('connect', function() { | |
console.log('connected'); | |
app.subscribeToDeviceEvents('+','b0b448b87385','+'); | |
}); | |
app.on('deviceEvent', function(deviceType, deviceId, eventType, format, payload) { | |
console.log(payload.toString()); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment