diff --git a/lib/index.js b/lib/index.js index c8eaf65..0b5cd37 100644 --- a/lib/index.js +++ b/lib/index.js @@ -6,8 +6,10 @@ * */ +var cp = require('child_process'); +var spawn = cp.spawn; +var fork = cp.fork; -var spawn = require('child_process').spawn; var EventEmitter = require('events'); var busEmitter = new EventEmitter(); @@ -27,7 +29,7 @@ var bluetest = module.exports = function(options) { core.connectGatt = function() { logger.info('trying to connect using gatttool'); - var gatt = spawn('gatttool',['-I']); + var gatt = fork('gatttool',['-I']); var cStr; gatt.on('error', function(err) { logger.error(err);