2014-12-16 03:15:29 +08:00
|
|
|
"use strict";
|
2014-02-27 22:44:53 +08:00
|
|
|
|
2014-12-16 03:15:29 +08:00
|
|
|
var Driver = require("../driver"),
|
|
|
|
Utils = require("../utils");
|
2014-05-07 09:24:43 +08:00
|
|
|
|
2014-08-06 09:41:57 +08:00
|
|
|
var Ping = module.exports = function Ping() {
|
2014-05-07 09:56:13 +08:00
|
|
|
Ping.__super__.constructor.apply(this, arguments);
|
2014-08-06 09:41:57 +08:00
|
|
|
|
|
|
|
this.commands = {
|
2014-08-12 06:29:35 +08:00
|
|
|
ping: this.ping
|
2014-08-06 09:41:57 +08:00
|
|
|
};
|
2015-01-06 04:20:53 +08:00
|
|
|
|
|
|
|
this.events = ["ping"];
|
2014-05-07 09:56:13 +08:00
|
|
|
};
|
2014-02-27 22:44:53 +08:00
|
|
|
|
2014-06-06 03:11:37 +08:00
|
|
|
Utils.subclass(Ping, Driver);
|
2014-02-27 22:44:53 +08:00
|
|
|
|
2014-05-07 09:56:13 +08:00
|
|
|
Ping.prototype.ping = function() {
|
2014-12-16 03:15:29 +08:00
|
|
|
this.emit("ping", "ping");
|
2014-05-07 09:56:13 +08:00
|
|
|
return "pong";
|
|
|
|
};
|
2014-02-27 22:44:53 +08:00
|
|
|
|
2014-09-09 00:31:16 +08:00
|
|
|
Ping.prototype.start = function(callback) {
|
|
|
|
callback();
|
|
|
|
};
|
|
|
|
|
2014-10-01 03:15:46 +08:00
|
|
|
Ping.prototype.halt = function(callback) {
|
|
|
|
callback();
|
|
|
|
};
|
|
|
|
|
2014-12-16 03:15:29 +08:00
|
|
|
Ping.drivers = ["ping"];
|
2014-10-31 04:15:40 +08:00
|
|
|
Ping.driver = function(opts) { return new Ping(opts); };
|