cidermill-apple-ble
v0.2.0
Published
WASM bindings for cidermill-apple-ble: a decoder for Apple BLE proximity-pairing advertisements (AirPods, Beats, etc.).
Readme
cidermill-apple-ble (JavaScript)
WASM bindings for cidermill-apple-ble, a Rust decoder for the Bluetooth LE advertisements AirPods and Beats broadcast: battery, charging, in-ear, lid and color. Works in browsers and Node (ESM).
import init, { parse } from "cidermill-apple-ble";
await init();
// Manufacturer data for company ID 0x004C, with the ID stripped.
const advert = parse(0x004c, data); // Uint8Array, ArrayBuffer or DataView
if (advert) console.log(advert.modelName, advert.lowestBattery, advert.anyInEar);parse returns undefined for anything else; it never throws on bad input. TypeScript types are
included. Also: parseManufacturerData, modelName, colorName, isMono, knownModels,
knownColors.
License: GPL-3.0-or-later, the same as the core (see LICENSE).
