Removing extraneous things from Adaptor/Driver
This commit is contained in:
parent
c83ce83788
commit
ed50c385c4
|
@ -28,6 +28,7 @@
|
|||
this.self = this;
|
||||
this.name = opts.name;
|
||||
this.device = opts.device;
|
||||
this.connection = this.device.connection;
|
||||
}
|
||||
|
||||
Driver.prototype.start = function(callback) {
|
||||
|
|
|
@ -29,11 +29,13 @@
|
|||
};
|
||||
|
||||
namespace('Cylon.Adaptors', function() {
|
||||
var _ref;
|
||||
return this.Loopback = (function(_super) {
|
||||
__extends(Loopback, _super);
|
||||
|
||||
function Loopback(opts) {
|
||||
Loopback.__super__.constructor.apply(this, arguments);
|
||||
function Loopback() {
|
||||
_ref = Loopback.__super__.constructor.apply(this, arguments);
|
||||
return _ref;
|
||||
}
|
||||
|
||||
Loopback.prototype.commands = function() {
|
||||
|
|
|
@ -29,11 +29,13 @@
|
|||
};
|
||||
|
||||
namespace('Cylon.Drivers', function() {
|
||||
var _ref;
|
||||
return this.Ping = (function(_super) {
|
||||
__extends(Ping, _super);
|
||||
|
||||
function Ping(opts) {
|
||||
Ping.__super__.constructor.apply(this, arguments);
|
||||
function Ping() {
|
||||
_ref = Ping.__super__.constructor.apply(this, arguments);
|
||||
return _ref;
|
||||
}
|
||||
|
||||
Ping.prototype.commands = function() {
|
||||
|
|
|
@ -18,6 +18,7 @@ namespace 'Cylon.Drivers', ->
|
|||
@self = this
|
||||
@name = opts.name
|
||||
@device = opts.device
|
||||
@connection = @device.connection
|
||||
|
||||
start: (callback) ->
|
||||
Logger.info "Driver #{@name} started"
|
||||
|
|
|
@ -16,8 +16,5 @@ module.exports =
|
|||
|
||||
namespace 'Cylon.Adaptors', ->
|
||||
class @Loopback extends Cylon.Adaptors.Adaptor
|
||||
constructor: (opts) ->
|
||||
super
|
||||
|
||||
commands: ->
|
||||
['ping']
|
||||
|
|
|
@ -16,9 +16,6 @@ module.exports =
|
|||
|
||||
namespace 'Cylon.Drivers', ->
|
||||
class @Ping extends Cylon.Drivers.Driver
|
||||
constructor: (opts) ->
|
||||
super
|
||||
|
||||
commands: ->
|
||||
['ping']
|
||||
|
||||
|
|
|
@ -14,7 +14,11 @@
|
|||
name: 'me'
|
||||
});
|
||||
driver = new Cylon.Drivers.Ping({
|
||||
name: 'driving'
|
||||
name: 'driving',
|
||||
device: {
|
||||
connection: 'connect',
|
||||
pin: 13
|
||||
}
|
||||
});
|
||||
initDriver = sinon.stub(robot, 'initDriver').returns(driver);
|
||||
device = new Cylon.Device({
|
||||
|
|
|
@ -7,7 +7,7 @@ source "test/ping"
|
|||
|
||||
describe "Device", ->
|
||||
robot = new Cylon.Robot(name: 'me')
|
||||
driver = new Cylon.Drivers.Ping(name: 'driving')
|
||||
driver = new Cylon.Drivers.Ping(name: 'driving', device: {connection: 'connect', pin: 13})
|
||||
initDriver = sinon.stub(robot, 'initDriver').returns(driver)
|
||||
device = new Cylon.Device(name: "devisive", driver: 'driving', robot: robot)
|
||||
|
||||
|
|
Loading…
Reference in New Issue