Skip to content

Instantly share code, notes, and snippets.

@Taym95
Created February 17, 2022 16:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Taym95/2470b2a25fa4b597687a492c0a27c590 to your computer and use it in GitHub Desktop.
Save Taym95/2470b2a25fa4b597687a492c0a27c590 to your computer and use it in GitHub Desktop.
Web Zigbee
const device = await navigator.bluetooth.requestDevice({
filters: [{ services: ["services"] }],
optionalServices: ["services"],
});
const server = await device.gatt.connect();
const service = await server.getPrimaryService("services");
const characteristic = await service.getCharacteristic("characteristic");
await characteristic.writeValue(payload);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment