New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

bluetooth-rpc-client

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-client - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

2

package.json
{
"name": "bluetooth-rpc-client",
"version": "1.0.1",
"version": "1.0.2",
"description": "The client side of a library allowing Remove Procedure Call (RPC) from a web application to a Node.js server on a Bluetooth-enabled device.",

@@ -5,0 +5,0 @@ "main": "dist/bluetooth-rpc-client.js",

# Bluetooth RPC Client
The client side of a library allowing Remove Procedure Call (RPC) from a web application to a Node.js server on a Bluetooth-enabled device.
## Installation
To install, simply run:
npm install bluetooth-rpc-client
## Usage
**This library is designed to be used with [bluetooth-rpc-server](https://www.npmjs.com/package/bluetooth-rpc-server)**
**This library requires a browser which supports [Web Bluetooth](https://developers.google.com/web/updates/2015/07/interact-with-ble-devices-on-the-web)**
import * as BluetoothRPCClient from 'bluetooth-rpc-client';
const serviceUuid = '...this is defined on the server...';
const characteristicUuid = '...this is defined on the server...';
BluetoothRPCClient.connect({ serviceUuid, characteristicUuid });
.then(device => device.doSomething(1, 2, 3)) // doSomething(x, y, z) is an async function defined on the server
.then(returnValue => {
// ... do something with the return value here ...
});
Upon calling `BluetoothRPCClient.connect()`, the user will be presented with
a dialog to select the device they wish to connect to. If your server is
running, you will see the device name you defined in the list. If everything
goes well, the Promise will resolve with a `device` object, which you can use
to call methods corresponding to the `handlers` defined on the server.
**Note: all of these handlers will return a Promise, regardless of whether they
were defined as async functions on the server.**
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