Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ble test #71

Open
wants to merge 3 commits into
base: gh-pages
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,4 @@ Check your [browser and platform implementation status](https://github.com/WebBl
- [BLE Keyboard & Mouse Dongle](https://github.com/DeqingSun/BLE-Keyboard-Mouse-Dongle) by [@DeqingSun](https://github.com/DeqingSun)
- [Connect to the Myo armband](https://github.com/charliegerard/myo-web-bluetooth.js) by [@charliegerard](https://github.com/charliegerard)
- [Mercedes-Benz car emulator demo](https://www.youtube.com/watch?v=97MlLkfLVf0) by [Mercedes-Benz Digital Challenge](http://www.mercedes-benz-challenge.com/)
try the api to print when using Thermal Mini Printer
6 changes: 3 additions & 3 deletions bluetooth-printer/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -248,16 +248,16 @@ <h2>Error</h2>
if (printCharacteristic == null) {
navigator.bluetooth.requestDevice({
filters: [{
services: ['000018f0-0000-1000-8000-00805f9b34fb']
services: ['0xffe5]
}]
})
.then(device => {
console.log('> Found ' + device.name);
console.log('Connecting to GATT Server...');
return device.gatt.connect();
})
.then(server => server.getPrimaryService("000018f0-0000-1000-8000-00805f9b34fb"))
.then(service => service.getCharacteristic("00002af1-0000-1000-8000-00805f9b34fb"))
.then(server => server.getPrimaryService("0xffe5"))
.then(service => service.getCharacteristic("0xffe9"))
.then(characteristic => {
// Cache the characteristic
printCharacteristic = characteristic;
Expand Down