Skip to content

Commit

Permalink
Long-distance commit.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ian Lindsay committed Feb 9, 2019
1 parent e5c0319 commit 16ec5e5
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 26 deletions.
50 changes: 26 additions & 24 deletions lib/mHub.js
Original file line number Diff line number Diff line change
Expand Up @@ -365,17 +365,10 @@ function mHub(cli_config) {
//TODO: the following simplistic check makes version-control in engines
// harder than it should be.
engineConfig = me.engines[eng].self_description;
//TODO: THIS IS TEMPORARY AS WELL. NEED A BETTER WAY OF DETERMINING...
//if (name === engineConfig.identity) {
if (name === engineConfig.identity) {
// Pass the factory method into the session so it can instance it.

// TESTING
if(name === Deacon){ name = "DeaconMgmt.js" }

me.log('mHub is about to assign engine '+name+' to session '+adjunctID);
me.interface_spec.adjuncts[adjunctID].instance.assignEngine(me.engines[eng]);
break;;
}
}
return false; // don't emit
Expand Down Expand Up @@ -415,23 +408,32 @@ function mHub(cli_config) {
}
}

// this.interface_spec.taps.names["bluetooth"] = {
// "scanResult": function(me, msg, adjunctID){
// if (me.interface_spec.hasOwnProperty(genEngine)) {
// me.mH.sendToAdjunct(genEngine, {target: ["scanResult", "metaSchema"], data: msg.data})
// }
// return true;
// }
// }

// this.interface_spec.taps.names["tcp"] = {
// "connected": function(me, msg, adjunctID){
// me.buildNewSession(msg.data, 'NewUnnumbered');
// me.log(msg.target.toString(), 'Got a connected broadcast from '+adjunctID, 7);
// me.emit('input', {target: ["assignEngine"], data: [genEngine, 'Deacon.js']});
// return true;
// }
// }
this.interface_spec.taps.names["bluetooth"] = {
"scanResult": function(me, msg, adjunctID){
if (me.interface_spec.hasOwnProperty(genEngine)) {
me.log(msg.target.toString(), 'Got a BT MAC ID '+adjunctID, 7);
me.mH.sendToAdjunct(genEngine, {target: ["scanResult", "metaSchema"], data: msg.data})
}
return true;
}
}

this.interface_spec.taps.names["tcp"] = {
"connected": function(me, msg, adjunctID){

if(me.interface_spec.adjuncts.hasOwnProperty(genEngine)){

me.removeAdjunct(genEngine)
}
me.buildNewSession(msg.data, genEngine);
me.log(msg.target.toString(), 'Got a connected broadcast from ' + adjunctID, 7);
me.emit('input', {target: ["assignEngine"], data: [genEngine, 'Deacon.js']});
// setTimeout(function() {
// me.emit('input', {target: ["selfDescribe", "metaSchema", genEngine], data: []});
// }, 2000);
return true;
}
}



Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,14 @@
"lodash.merge": "^4.3.1",
"machina": "^1.1.2",
"noble": "^1.3.0",
"npm": "^6.7.0",
"prompt": "^0.2.14",
"request": "^2.69.0",
"serialport": "^2.0.5",
"socket.io": "^1.3.7",
"socket.io-client": "^1.3.7",
"telehash": "*",
"stream-browserify": "^2.0.1"
"stream-browserify": "^2.0.1",
"telehash": "*"
},
"devDependencies": {
"eslint": "^2.0.0"
Expand Down

0 comments on commit 16ec5e5

Please sign in to comment.