Skip to content

Instantly share code, notes, and snippets.

@mrodem
Created September 12, 2017 09:08
Show Gist options
  • Save mrodem/8bb41f4375a281b7b2d2aeabd935820c to your computer and use it in GitHub Desktop.
Save mrodem/8bb41f4375a281b7b2d2aeabd935820c to your computer and use it in GitHub Desktop.
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