npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@matter.js/nodejs-ble

v0.11.0-alpha.0-20240919-89f6a6e7

Published

Matter BLE support for node.js

Downloads

85

Readme

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:

  • bleno
    • For Linux: also consider https://github.com/abandonware/bleno#running-on-linux
    • Bleno is currently not working on macOS because it cannot announce the proper data because of macOS limitations!
  • noble
    • Consider Noble prerequisites for your platform: https://github.com/abandonware/noble#prerequisites
    • For Linux: https://github.com/abandonware/noble#running-without-rootsudo-linux-specific
    • When using Device and Controller in parallel: https://github.com/abandonware/noble#bleno-compatibility-linux-specific (NOBLE_MULTI_ROLE might be needed to set)
    • Please also see common issues and solutions: https://github.com/abandonware/noble#common-problems

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