🚀 DAY 5 OF LAUNCH WEEK: Introducing Socket Firewall Enterprise.Learn more →
Socket
Book a DemoInstallSign in
Socket

@matter.js/nodejs-ble

Package Overview
Dependencies
Maintainers
0
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@matter.js/nodejs-ble

Matter BLE support for node.js

latest
Source
npmnpm
Version
0.11.0-alpha.0-20240919-89f6a6e7
Version published
Maintainers
0
Created
Source

matter-node-ble.js

license

Matter BLE support using bleno for Peripheral/Device side and noble (not implemented yet) for Central/Controller side.

This package supports all Node.js LTS versions starting with 18.x

This package contains the specific Platform implementations for Bluetooth LE with Node.js. It is designed to be used in addition to the @matter.js/nodejs package to enable BLE specific functionality.

Prerequisites and Limitations

The used packages have some limitations and prerequisites. Please check the Readme's of the packages for more details:

How to use this package

This package is designed to be used in addition to matter.ja and matter-node.js to enable BLE support. It is not intended to be used standalone.

Add this package to your package dependencies and make sure it is exactly the same version as matter.js and matter-node.js.

In your code you register the BLE instance by using:

import { BleNode } from "@matter.js/nodejs-ble";
import { Ble } from "@matter.js/protocol/ble";

Ble.get = singleton(
    () =>
        new BleNode({
          // hciId: 1, // If you need to change it from default 0 on linux systems
        }),
);

The relevant classes in matter.js will detect the registration and use the BLE instance for BLE operations if needed.

How to choose the HCI device (Linux)

You can optionally set an options object when instantiating BleNode. this object can have the following properties:

  • hciId: HCI ID (number) of the HCI device to use. If not set, ID 0 is used

Building

  • npm run build: Build all code and create CommonJS and ES6 variants in dist directory. This will built incrementally and only build the changed files.
  • npm run build-clean: Clean the dist directory and build all code from scratch

Testing

  • npm run test: Run all tests - TBD

Keywords

iot

FAQs

Package last updated on 19 Sep 2024

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