diff --git a/lib/connection.js b/lib/connection.js index dc6d22e..36e161f 100644 --- a/lib/connection.js +++ b/lib/connection.js @@ -102,6 +102,19 @@ namespace("Cylon", function() { return this.robot.initAdaptor(opts.adaptor, this.self, opts); }; + // Public: Stop the adaptor's connection + // + // Returns nothing + Connection.prototype.stop = function() { + var msg; + msg = "Stopping adaptor '" + this.name + "'"; + if (this.port != null) { + msg += " on port '" + (this.port.toString()) + "'"; + } + Logger.info(msg); + return this.disconnect(); + }; + return Connection; })(EventEmitter);