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 🙏

© 2026 – Pkg Stats / Ryan Hefner

react-native-yzdev-ble

v0.1.0

Published

YZDEV 蓝牙配网协议的 React Native TypeScript 封装

Readme

react-native-yzdev-ble

YZDEV 蓝牙配网协议的 React Native TypeScript 封装。

安装

npm install react-native-yzdev-ble react-native-ble-plx
cd ios && pod install

Android 需要在应用里声明蓝牙权限;iOS 需要在应用的 Info.plist 里声明蓝牙用途说明。

基本使用

import { YzdevBleClient } from 'react-native-yzdev-ble';

const client = new YzdevBleClient();

const devices = await client.scanForDevices({ timeoutMs: 5000 });
await client.connect(devices[0].id);

await client.provision({
  wifi: {
    ssid: 'zwsd',
    pwd: 'ZW31415926',
    security: 'wpa',
  },
  server: {
    ws_url: 'wss://earphone.meimeifa.cn/v1/device/stream',
    snid: 'TEST_WS_o12k8y',
    device_secret: '892ab03ab30052673288874ce8a8a82ad13439c8efa4e768efb25bbbcc934e9d',
  },
});

备用 WiFi 和主 WiFi 字段一致:

await client.provision({
  wifi: {
    ssid: 'main',
    pwd: 'pwd1',
  },
  wifi_backup: {
    ssid: 'backup',
    pwd: 'pwd2',
  },
  server: {
    ws_url: 'wss://example.test',
    snid: 'SN001',
    device_secret: 'secret',
  },
});

API

  • scanForDevices(options):扫描设备,默认只返回名称以 YZDEV- 开头的设备。
  • startScan(onDevice, onError, options):持续扫描,返回 remove() 用于停止。
  • connect(deviceId, options):连接并发现服务。
  • provision(input):生成配网 JSON 并写入 FE01
  • writeStatusRequest():向 FE01 写入 {"cmd":"getstatus"}
  • queryStatus(options):写入状态查询并等待 FE02 通知。
  • onStatus(listener, onError):监听 FE02 状态通知。
  • readDeviceInfo():读取 FE03 设备信息。
  • disconnect():断开连接。

协议默认值

  • 服务 UUID:FE00
  • 配置写入:FE01
  • 状态通知:FE02
  • 设备信息:FE03
  • 设备名前缀:YZDEV-
  • WiFi 加密方式默认:wpa
  • 自动录音默认:开启