Skip to content

Instantly share code, notes, and snippets.

@ryanjbaxter
Created February 22, 2016 19:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ryanjbaxter/b384dd282a25c8b41ba9 to your computer and use it in GitHub Desktop.
Save ryanjbaxter/b384dd282a25c8b41ba9 to your computer and use it in GitHub Desktop.
Sample Node.js Code From IDA-6754 At InterConnect 2016
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