Statistics.js 696 B

1234567891011121314151617181920212223242526272829
  1. var Sequence = require('./Sequence');
  2. var Util = require('util');
  3. var Packets = require('../packets');
  4. module.exports = Statistics;
  5. Util.inherits(Statistics, Sequence);
  6. function Statistics(options, callback) {
  7. if (!callback && typeof options === 'function') {
  8. callback = options;
  9. options = {};
  10. }
  11. Sequence.call(this, options, callback);
  12. }
  13. Statistics.prototype.start = function() {
  14. this.emit('packet', new Packets.ComStatisticsPacket);
  15. };
  16. Statistics.prototype['StatisticsPacket'] = function (packet) {
  17. this.end(null, packet);
  18. };
  19. Statistics.prototype.determinePacket = function(firstByte, parser) {
  20. if (firstByte === 0x55) {
  21. return Packets.StatisticsPacket;
  22. }
  23. };