diff --git a/.gitignore b/.gitignore index b90e7bff9..0308b0b2e 100644 --- a/.gitignore +++ b/.gitignore @@ -12,6 +12,7 @@ logs/* bower_components settings/ssl-key.pem settings/ssl-cert.pem +/*.iml *.tgz work/ diff --git a/packages/streams/n2kAnalyzer.js b/packages/streams/n2kAnalyzer.js index fd68563e6..36b9270c6 100644 --- a/packages/streams/n2kAnalyzer.js +++ b/packages/streams/n2kAnalyzer.js @@ -48,9 +48,13 @@ function N2KAnalyzer(options) { const that = this this.linereader.on('line', function (data) { try { - parsed = JSON.parse(data) + let parsed = JSON.parse(data) + if (parsed.version) { + console.log('Connected to analyzer v' + parsed.version) + return + } that.push(parsed) - options.app.emit(this.analyzerOutEvent, parsed) + options.app.emit(that.analyzerOutEvent, parsed) } catch (ex) { console.error(data) console.error(ex.stack)