Skip to content

sabertooth-io/demo-battery_service

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

web-bluetooth image

Web-Bluetooth Demo: Battery Service

This simple demo uses the Web-Bluetooth library to connect to a device broadcasting a Battery Service characteristic and reads it's battery level.

Requirements


Web-Bluetooth is behind an experimental flag in Chrome 45+. Go to chrome://flags/#enable-web-bluetooth to enable the flag. Restart Chrome and you should be good to go.

Experiment with web-bluetooth on the following devices.

  • Linux
  • ChromeOS
  • Android

Installation


First, fork this repo and then run:

$ npm install
$ npm run demo
$ open http://localhost:3000

Use


Connect to any device by its Name or Name Prefix. This demo uses four of the many methods in the web-bluetooth library.

new BluetoothDevice()
connect()
disconnect()
getValue()

For more information, visit the web-bluetooth docs.

About

Batter Level demo application using the web-bluetooth library.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published