Skip to content

Commit

Permalink
Add vendor count device
Browse files Browse the repository at this point in the history
  • Loading branch information
thatguydan committed Mar 4, 2013
1 parent 0c060cd commit f1de9a0
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions lib/vendorCount.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@

var stream = require('stream')
, util = require('util');


// Give our module a stream interface
util.inherits(Device,stream);

// Export it
module.exports=Device;

function Device(g) {

var self = this;

// This device will emit data
this.readable = true;
// This device can be actuated
this.writeable = true;

this.G = g; // G is a string a represents the channel
this.V = 0; // 0 is Ninja Blocks' device list
this.D = 9005; // 2000 is a generic Ninja Blocks sandbox device

process.nextTick(this.init);
};

Device.prototype.init = function() {

};

/**
* Called whenever there is data from the cloud
* This is required if Device.writable = true
*
* @param {String} data The data received
*/
Device.prototype.write = function(data) {

// I'm being actuated with data!
console.log(data);
};

0 comments on commit f1de9a0

Please sign in to comment.