Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

bluetooth-rpc-server

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bluetooth-rpc-server

The server side of a library allowing Remove Procedure Call (RPC) from a web application to a Node.js server on a Bluetooth-enabled device.

  • 1.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3
increased by200%
Maintainers
1
Weekly downloads
 
Created
Source

Bluetooth RPC Server

The server side of a library allowing Remove Procedure Call (RPC) from a web application to a Node.js server on a Bluetooth-enabled device.

Installation

This library uses bleno, and needs to be run on a device that supports Bluetooth. Any issues related to installation will be due to missing requirements for bleno. To install, simply run:

npm install bluetooth-rpc-server

Usage

This library is designed to be used with bluetooth-rpc-client

const BluetoothRPCServer = require('bluetooth-rpc-server');

BluetoothRPCServer.startServer({
    name: 'My Device', // this name will be broadcast, and visible to the user on pairing
    serviceUuid: '', // choose a UUID. Client must know this value.
    characteristicUuid: '', // choose a UUID. Client must know this value.
    handlers: { // client will be able to call these remotely!
        async doSomething(x, y, z) {
            // ...do some async computations here...
            return 'something';
        }
    }
);

After starting the server, the device should broadcast a bluetooth device called 'My Device'. The client should now be able to connect to this device, and call the async functions defined within handlers as if they were local functions.

Keywords

FAQs

Package last updated on 27 Jan 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc