Use underscores.
Scouts and drivers appended with _scout.js or _driver.js unless in separate folder.
Examples
var HueScout = require('zetta-hue-driver'); | |
var PushNotificationScout = require('zetta-apigee-driver'); | |
module.exports = function(runtime) { | |
runtime.scouts.push(HueScout); | |
runtime.scouts.push(PushNotificationScout); | |
}; |
var SerialPort = require('serialport').SerialPort; | |
var Sound = require('./sound'); | |
var ArduinoScout = module.exports = function(){ | |
this.portName = '/dev/tty.usbserial'; | |
}; | |
ArduinoScout.prototype.init = function(cb){ | |
this.connect(this.portName, cb); | |
}; |
var util = require('util'); | |
var Scout = require('zetta').Scout; | |
var SerialPort = require('serialport').SerialPort; | |
var Sound = require('./sound'); | |
var ArduinoScout = module.exports = function(runtime) { | |
Scout.call(this); | |
this.runtime = runtime; | |
this.portName = '/dev/tty.usbserial'; |
//Driver is an event emitter | |
var Driver = require('zetta').Driver; | |
var util = require('util'); | |
var Sound = module.exports = function(port){ | |
Driver.call(this); | |
this._port = port; | |
}; | |
//UUID is given to us by the Driver constructor | |
util.inherits(Sound, Driver); |
var zetta = require('zetta'); | |
var ArduinoScout = require('./scouts/arduino_scout'); | |
var app = zetta(); | |
app.name('I heard that!'); | |
app.load(ArduinoScout); | |
app.observe('sound', function(microphone) { | |
app.observe('lcd', function(lcd) { | |
microphone.stream('sound').read(function(value) { |
var zetta = require('zetta'); | |
var Arduino = require('./arduino'); | |
var app = zetta(); | |
app.name('i-heard-that'); // give the empress a name | |
app.expose('*'); // explore other arguments | |
app.load(Arduino); // load that scout in |
{ | |
"class": [ | |
"arm" | |
], | |
"properties": { | |
"type": "arm", | |
"name": "arm-192.168.1.8", | |
"data": {}, | |
"id": "b47c4550-f252-11e3-ba90-b7dd9280b642", | |
"ip": "192.168.1.8", |
//Works... | |
var app = argo(); | |
app.use(titan) | |
.add(RootResource, runtime) | |
.add(DevicesResource, runtime) | |
.add(ServerResource, runtime, 123) | |
.listen(3000) | |
/// Doesn't work? |
var test = function() { | |
var someval = 123; | |
} |