Created
September 12, 2017 09:08
-
-
Save mrodem/8bb41f4375a281b7b2d2aeabd935820c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const zerorpc = require("zerorpc"); | |
const AdapterFactory = require('pc-ble-driver-js').AdapterFactory; | |
const server = new zerorpc.Server({ | |
getAdapters: function (reply) { | |
const factory = AdapterFactory.getInstance(); | |
factory.getAdapters((error, adapters) => { | |
reply(error, adapters); | |
}); | |
} | |
}); | |
server.bind("tcp://0.0.0.0:4242"); | |
server.on("error", function(error) { | |
console.error("RPC server error:", error); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment