From c1fa797d9fc5c79d195c78b10734f00f6858d9f0 Mon Sep 17 00:00:00 2001 From: Bryan Roe Date: Thu, 22 Aug 2019 16:58:10 -0700 Subject: [PATCH] Deleted un-needed files, becuase they are integrated into the agent --- agents/modules_meshcore/linux-dbus.js | 128 ------------------ agents/modules_meshcore_min/linux-dbus.min.js | 1 - 2 files changed, 129 deletions(-) delete mode 100644 agents/modules_meshcore/linux-dbus.js delete mode 100644 agents/modules_meshcore_min/linux-dbus.min.js diff --git a/agents/modules_meshcore/linux-dbus.js b/agents/modules_meshcore/linux-dbus.js deleted file mode 100644 index 59d41bf1..00000000 --- a/agents/modules_meshcore/linux-dbus.js +++ /dev/null @@ -1,128 +0,0 @@ -/* -Copyright 2018-2019 Intel Corporation - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -try { Object.defineProperty(Array.prototype, "peek", { value: function () { return (this.length > 0 ? this[this.length - 1] : undefined); } }); } catch (e) { } - - - -function dbus(address, uid) -{ - this._ObjectID = 'linux-dbus'; - require('events').EventEmitter.call(this, true) - .createEvent('signal'); - Object.defineProperty(this, "uid", { value: uid }); - this._child = require('child_process').execFile("/bin/sh", ["sh"], { type: require('child_process').SpawnTypes.TERM, uid: uid == null ? -1 : uid }); - this._child.stdin.write('dbus-monitor --session "type=\'signal\', interface=\'' + address + '\'" | ( while read X; do echo "$X"; done )\n'); - this._child.stdout.dbus = this; - this._child.stdout.on('data', function (chunk) - { - // Parse DBUS Data - if (!this.ready) { this.ready = true; return; } - - var lines = []; - var tokens = chunk.toString().split('\r\n'); - for (var i in tokens) - { - if (tokens[i] == '') - { - // End of record - this.dbus.preParseRecords(lines); - lines = []; - } - else - { - lines.push(tokens[i]); - } - } - }); - this.preParseRecords = function (lines) - { - var record = []; - for (var i in lines) - { - if(lines[i].startsWith('signal ')) - { - if(record.length>0) - { - this.parseRecords(record); - } - record = []; - } - record.push(lines[i]); - } - if (record.length > 0) - { - this.parseRecords(record); - } - } - this.parseRecords = function (lines) - { - if (lines[0].startsWith('signal ')) - { - var signal = {}; - var sigtokens = lines[0].split(' '); - sigtokens.shift(); - - for (var i in sigtokens) { - var sigitems = sigtokens[i].split('='); - if (sigitems.length == 2) { - signal[sigitems[0]] = sigitems[1]; - } - } - - lines.shift(); - signal.data = lines; - - this.parseSignal(signal); - } - } - this.parseSignal = function(signal) - { - var data = signal.data; - signal.data = []; - - for(var i=0; i0?this[this.length-1]:undefined)}})}catch(e){}function dbus(a,b){this._ObjectID="linux-dbus";require("events").EventEmitter.call(this,true).createEvent("signal");Object.defineProperty(this,"uid",{value:b});this._child=require("child_process").execFile("/bin/sh",["sh"],{type:require("child_process").SpawnTypes.TERM,uid:b==null?-1:b});this._child.stdin.write("dbus-monitor --session \"type='signal', interface='"+a+'\'" | ( while read X; do echo "$X"; done )\n');this._child.stdout.dbus=this;this._child.stdout.on("data",function(c){if(!this.ready){this.ready=true;return}var f=[];var g=c.toString().split("\r\n");for(var d in g){if(g[d]==""){this.dbus.preParseRecords(f);f=[]}else{f.push(g[d])}}});this.preParseRecords=function(d){var f=[];for(var c in d){if(d[c].startsWith("signal ")){if(f.length>0){this.parseRecords(f)}f=[]}f.push(d[c])}if(f.length>0){this.parseRecords(f)}};this.parseRecords=function(d){if(d[0].startsWith("signal ")){var g={};var h=d[0].split(" ");h.shift();for(var c in h){var f=h[c].split("=");if(f.length==2){g[f[0]]=f[1]}}d.shift();g.data=d;this.parseSignal(g)}};this.parseSignal=function(f){var c=f.data;f.data=[];for(var d=0;d