SlideShare a Scribd company logo
@fischaelameergeildanke.com #YGLFKyiv18
Using New Web APIs 

For Your Own Pleasure
What? Why?
Created by Ben Davis from the Noun Project, Created by Viktor Vorobyev from the Noun Project
What? Why?
Created by Ben Davis from the Noun Project, Created by Viktor Vorobyev from the Noun Project
What? Why?
Created by Ben Davis from the Noun Project, Created by Viktor Vorobyev from the Noun Project
What? Why?
Created by Ben Davis from the Noun Project, Created by Viktor Vorobyev from the Noun Project
Ahhh
What? Why?
Created by Ben Davis from the Noun Project, Created by Viktor Vorobyev from the Noun Project
Using New Web APIs For Your Own Pleasure
Using New Web APIs For Your Own Pleasure
Web Bluetooth API Support
Devices with
Bluetooth 4.0 or higher
Chrome, Chrome on Android,

Samsung Internet, Opera
Created by Ben Davis from the Noun Project, Created by Viktor Vorobyev from the Noun Project
Three Steps to Happiness
Write Data via Bluetooth API
Connect Bluetooth Device
Request Connection
Read Audio Data
Expose Vowels
Uncover Bluetooth Commands
1. Connect Bluetooth Device
const LUSH_SERVICE = '6e400001-b5a3-f393-e0a9-e50e24dcca9e';
button.addEventListener('click', () => {
navigator.bluetooth.requestDevice({
filters: [{ services: [LUSH_SERVICE] }]
}).then((device) => {
console.log('Device found. Device: ', device);
return device.gatt.connect();
}).then((server) => {
console.log('Device connected. Server ', server);
});
});
1. Connect Bluetooth Device
const LUSH_SERVICE = '6e400001-b5a3-f393-e0a9-e50e24dcca9e';
button.addEventListener('click', () => {
navigator.bluetooth.requestDevice({
filters: [{ services: [LUSH_SERVICE] }]
}).then((device) => {
console.log('Device found. Device: ', device);
return device.gatt.connect();
}).then((server) => {
console.log('Device connected. Server ', server);
});
});
GATT
Generic Attribute Profile
Defines the way two Bluetooth LE devices 

transfer data back and forth 

using characteristics and services.
1. Connect Bluetooth Device
const LUSH_SERVICE = '6e400001-b5a3-f393-e0a9-e50e24dcca9e';
button.addEventListener('click', () => {
navigator.bluetooth.requestDevice({
filters: [{ services: [LUSH_SERVICE] }]
}).then((device) => {
console.log('Device found. Device: ', device);
return device.gatt.connect();
}).then((server) => {
console.log('Device connected. Server ', server);
});
});
nRF Connect
nRF Connect
1. Connect Bluetooth Device
const LUSH_SERVICE = '6e400001-b5a3-f393-e0a9-e50e24dcca9e';
button.addEventListener('click', () => {
navigator.bluetooth.requestDevice({
filters: [{ services: [LUSH_SERVICE] }]
}).then((device) => {
console.log('Device found. Device: ', device);
return device.gatt.connect();
}).then((server) => {
console.log('Device connected. Server ', server);
});
});
1. Connect Bluetooth Device
const LUSH_SERVICE = '6e400001-b5a3-f393-e0a9-e50e24dcca9e';
button.addEventListener('click', () => {
navigator.bluetooth.requestDevice({
filters: [{ services: [LUSH_SERVICE] }]
}).then((device) => {
console.log('Device found. Device: ', device);
return device.gatt.connect();
}).then((server) => {
console.log('Device connected. Server ', server);
});
});
How to detect Vowels
f1 = ~850hz
f2 = ~1610hz
https://de.wikipedia.org/wiki/Formant
How to detect Vowels
createAnalyser()
captureStream()
new window.AudioContext()
getByteFrequencyData() Vowels!!
Identify Bluetooth Commands
Vibrate:4;
Identify Bluetooth Commands
56 69 62 72 61 74 65 3a 34 3b
3. Write to a Bluetooth Characteristic
const LUSH_TX_CHARACTERISTIC = '6e400002-b5a3-f393-e0a9-e50e24dcca9e';
let txCharacteristic = null;
button.addEventListener('click', () => {
/* … */
}).then((server) => {
return server.getPrimaryService(LUSH_SERVICE);
}).then((service) => {
return service.getCharacteristic(LUSH_TX_CHARACTERISTIC);
}).then((characteristic) => { txCharacteristic = characteristic; });
});
3. Write to a Bluetooth Characteristic
const LUSH_TX_CHARACTERISTIC = '6e400002-b5a3-f393-e0a9-e50e24dcca9e';
let txCharacteristic = null;
button.addEventListener('click', () => {
/* … */
}).then((server) => {
return server.getPrimaryService(LUSH_SERVICE);
}).then((service) => {
return service.getCharacteristic(LUSH_TX_CHARACTERISTIC);
}).then((characteristic) => { txCharacteristic = characteristic; });
});
3. Write to a Bluetooth Characteristic
const LUSH_TX_CHARACTERISTIC = '6e400002-b5a3-f393-e0a9-e50e24dcca9e';
let txCharacteristic = null;
button.addEventListener('click', () => {
/* … */
}).then((server) => {
return server.getPrimaryService(LUSH_SERVICE);
}).then((service) => {
return service.getCharacteristic(LUSH_TX_CHARACTERISTIC);
}).then((characteristic) => { txCharacteristic = characteristic; });
});
3. Write to a Bluetooth Characteristic
if (vowels && vowels[0]) {
let message = new TextEncoder('ASCII').encode('Vibrate:10;');
txCharacteristic.writeValue(message);
} else {
let message = new TextEncoder('ASCII').encode('Vibrate:10;');
txCharacteristic.writeValue(message);
}
3. Write to a Bluetooth Characteristic
if (vowels && vowels[0]) {
let message = new TextEncoder('ASCII').encode('Vibrate:10;');
txCharacteristic.writeValue(message);
} else {
let message = new TextEncoder('ASCII').encode('Vibrate:10;');
txCharacteristic.writeValue(message);
}
Using New Web APIs For Your Own Pleasure
@fischaelameergeildanke.com #YGLFKyiv18
Be Creative!
Use More Web APIs, Test, Give Feedback
@fischaelameergeildanke.com #YGLFKyiv18
More Information
https://developers.google.com/web/updates/2015/07/interact-with-ble-devices-on-the-web
http://nilhcem.com/iot/reverse-engineering-simple-bluetooth-devices
https://developer.mozilla.org/en-US/docs/Web/API/Web_Bluetooth_API
https://learn.adafruit.com/introducing-adafruit-ble-bluetooth-low-energy-friend/introduction
https://www.bluetooth.com/specifications/gatt/services
Thanks to:
https://www.metafetish.com/
https://github.com/gre/zpeech

More Related Content

PDF
Using New Web APIs For Your Own Pleasure – How I Wrote New Features For My Vi...
PDF
Getting physical with web bluetooth in the browser
PDF
Let's Get Physical
PDF
Getting Physical with Web Bluetooth - Uri Shaked, BlackBerry
PDF
Getting physical with web bluetooth in the browser
PDF
Getting Physical with Web Bluetooth in the Browser Full Stack Toronto
PPTX
Bluetooth Accessing Android for mca .pptx
PDF
Getting physical with web bluetooth in the browser hackference
Using New Web APIs For Your Own Pleasure – How I Wrote New Features For My Vi...
Getting physical with web bluetooth in the browser
Let's Get Physical
Getting Physical with Web Bluetooth - Uri Shaked, BlackBerry
Getting physical with web bluetooth in the browser
Getting Physical with Web Bluetooth in the Browser Full Stack Toronto
Bluetooth Accessing Android for mca .pptx
Getting physical with web bluetooth in the browser hackference

Similar to Using New Web APIs For Your Own Pleasure (20)

PDF
JAM805 - Beyond the Device
PPTX
Can a browser become an IoT Gateway?
PDF
Android Wi-Fi Manager and Bluetooth Connection
PPTX
Android & Beacons
PDF
Workshop-How_to_use_btlejack.pdfWorkshop-How_to_use_btlejack
PDF
LocalSocial O Reilly Webcast Slides - A Tour of the Beacosystem
PDF
BluedIoT: When a mature and immature technology mixes, becomes an “idiot” sit...
PDF
Bluetooth based-chatting-system-using-android-docx
PDF
208 jpa016 --multy-user-mobile-bluetooth-two-way-text-chat-pdf
PDF
Web Bluetooth - Next Generation Bluetooth?
PDF
HyWAI Web Bluetooth API
PPTX
Bluetooth [in]security
PPTX
Bluetooth insecurity
PDF
Intern_Report
PPTX
Introduction to Bluetooth Low Energy
PDF
Let's Get Physical
PDF
UXperts 2012: Connectivity Beyond the Web (Android), Friedger Müffke
PDF
Cold front - bridging the web and the physical world
PDF
Bluetooth Paper Presentation
PPTX
Controlling Bluetooth Low Energy Devices
JAM805 - Beyond the Device
Can a browser become an IoT Gateway?
Android Wi-Fi Manager and Bluetooth Connection
Android & Beacons
Workshop-How_to_use_btlejack.pdfWorkshop-How_to_use_btlejack
LocalSocial O Reilly Webcast Slides - A Tour of the Beacosystem
BluedIoT: When a mature and immature technology mixes, becomes an “idiot” sit...
Bluetooth based-chatting-system-using-android-docx
208 jpa016 --multy-user-mobile-bluetooth-two-way-text-chat-pdf
Web Bluetooth - Next Generation Bluetooth?
HyWAI Web Bluetooth API
Bluetooth [in]security
Bluetooth insecurity
Intern_Report
Introduction to Bluetooth Low Energy
Let's Get Physical
UXperts 2012: Connectivity Beyond the Web (Android), Friedger Müffke
Cold front - bridging the web and the physical world
Bluetooth Paper Presentation
Controlling Bluetooth Low Energy Devices
Ad

More from GeilDanke (13)

PDF
WebXR: A New Dimension For The Web Writing Virtual and Augmented Reality Apps...
PDF
Writing Virtual And Augmented Reality Apps With Web Technology
PDF
Creating Augmented Reality Apps with Web Technology
PDF
How to Make Your Users Sick in 60 Seconds – About UX Design, WebVR and React VR
PDF
More Ways to Make Your Users Sick – A talk about WebVR and UX Design
PDF
Goodbye, Flatland! An introduction to WebVR and what it means for web developers
PDF
Goodbye, Flatland! An introduction to React VR and what it means for web dev...
PDF
An Introduction to WebVR – or How to make your user sick in 60 seconds
PDF
2016 First steps with Angular 2 – enterjs
PDF
2014 HTML und CSS für Designer – Pubkon
PDF
2013 Digitale Magazine erstellen - Konzeption und Redaktion
PDF
2014 Adobe DPS Update 29
PDF
2012 Digital Publishing IDUG Stuttgart
WebXR: A New Dimension For The Web Writing Virtual and Augmented Reality Apps...
Writing Virtual And Augmented Reality Apps With Web Technology
Creating Augmented Reality Apps with Web Technology
How to Make Your Users Sick in 60 Seconds – About UX Design, WebVR and React VR
More Ways to Make Your Users Sick – A talk about WebVR and UX Design
Goodbye, Flatland! An introduction to WebVR and what it means for web developers
Goodbye, Flatland! An introduction to React VR and what it means for web dev...
An Introduction to WebVR – or How to make your user sick in 60 seconds
2016 First steps with Angular 2 – enterjs
2014 HTML und CSS für Designer – Pubkon
2013 Digitale Magazine erstellen - Konzeption und Redaktion
2014 Adobe DPS Update 29
2012 Digital Publishing IDUG Stuttgart
Ad

Recently uploaded (20)

PDF
DASA ADMISSION 2024_FirstRound_FirstRank_LastRank.pdf
PDF
A comparative study of natural language inference in Swahili using monolingua...
PPTX
MicrosoftCybserSecurityReferenceArchitecture-April-2025.pptx
PDF
From MVP to Full-Scale Product A Startup’s Software Journey.pdf
PDF
NewMind AI Weekly Chronicles – August ’25 Week III
PPTX
observCloud-Native Containerability and monitoring.pptx
PDF
Univ-Connecticut-ChatGPT-Presentaion.pdf
PDF
August Patch Tuesday
PDF
Taming the Chaos: How to Turn Unstructured Data into Decisions
PDF
Transform Your ITIL® 4 & ITSM Strategy with AI in 2025.pdf
PPTX
The various Industrial Revolutions .pptx
PDF
A novel scalable deep ensemble learning framework for big data classification...
PDF
Enhancing emotion recognition model for a student engagement use case through...
PDF
A Late Bloomer's Guide to GenAI: Ethics, Bias, and Effective Prompting - Boha...
PDF
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
PDF
STKI Israel Market Study 2025 version august
PDF
Hybrid horned lizard optimization algorithm-aquila optimizer for DC motor
PDF
Architecture types and enterprise applications.pdf
PDF
Hindi spoken digit analysis for native and non-native speakers
PPTX
Modernising the Digital Integration Hub
DASA ADMISSION 2024_FirstRound_FirstRank_LastRank.pdf
A comparative study of natural language inference in Swahili using monolingua...
MicrosoftCybserSecurityReferenceArchitecture-April-2025.pptx
From MVP to Full-Scale Product A Startup’s Software Journey.pdf
NewMind AI Weekly Chronicles – August ’25 Week III
observCloud-Native Containerability and monitoring.pptx
Univ-Connecticut-ChatGPT-Presentaion.pdf
August Patch Tuesday
Taming the Chaos: How to Turn Unstructured Data into Decisions
Transform Your ITIL® 4 & ITSM Strategy with AI in 2025.pdf
The various Industrial Revolutions .pptx
A novel scalable deep ensemble learning framework for big data classification...
Enhancing emotion recognition model for a student engagement use case through...
A Late Bloomer's Guide to GenAI: Ethics, Bias, and Effective Prompting - Boha...
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
STKI Israel Market Study 2025 version august
Hybrid horned lizard optimization algorithm-aquila optimizer for DC motor
Architecture types and enterprise applications.pdf
Hindi spoken digit analysis for native and non-native speakers
Modernising the Digital Integration Hub

Using New Web APIs For Your Own Pleasure

  • 1. @fischaelameergeildanke.com #YGLFKyiv18 Using New Web APIs 
 For Your Own Pleasure
  • 2. What? Why? Created by Ben Davis from the Noun Project, Created by Viktor Vorobyev from the Noun Project
  • 3. What? Why? Created by Ben Davis from the Noun Project, Created by Viktor Vorobyev from the Noun Project
  • 4. What? Why? Created by Ben Davis from the Noun Project, Created by Viktor Vorobyev from the Noun Project
  • 5. What? Why? Created by Ben Davis from the Noun Project, Created by Viktor Vorobyev from the Noun Project
  • 6. Ahhh What? Why? Created by Ben Davis from the Noun Project, Created by Viktor Vorobyev from the Noun Project
  • 9. Web Bluetooth API Support Devices with Bluetooth 4.0 or higher Chrome, Chrome on Android,
 Samsung Internet, Opera Created by Ben Davis from the Noun Project, Created by Viktor Vorobyev from the Noun Project
  • 10. Three Steps to Happiness Write Data via Bluetooth API Connect Bluetooth Device Request Connection Read Audio Data Expose Vowels Uncover Bluetooth Commands
  • 11. 1. Connect Bluetooth Device const LUSH_SERVICE = '6e400001-b5a3-f393-e0a9-e50e24dcca9e'; button.addEventListener('click', () => { navigator.bluetooth.requestDevice({ filters: [{ services: [LUSH_SERVICE] }] }).then((device) => { console.log('Device found. Device: ', device); return device.gatt.connect(); }).then((server) => { console.log('Device connected. Server ', server); }); });
  • 12. 1. Connect Bluetooth Device const LUSH_SERVICE = '6e400001-b5a3-f393-e0a9-e50e24dcca9e'; button.addEventListener('click', () => { navigator.bluetooth.requestDevice({ filters: [{ services: [LUSH_SERVICE] }] }).then((device) => { console.log('Device found. Device: ', device); return device.gatt.connect(); }).then((server) => { console.log('Device connected. Server ', server); }); });
  • 13. GATT Generic Attribute Profile Defines the way two Bluetooth LE devices 
 transfer data back and forth 
 using characteristics and services.
  • 14. 1. Connect Bluetooth Device const LUSH_SERVICE = '6e400001-b5a3-f393-e0a9-e50e24dcca9e'; button.addEventListener('click', () => { navigator.bluetooth.requestDevice({ filters: [{ services: [LUSH_SERVICE] }] }).then((device) => { console.log('Device found. Device: ', device); return device.gatt.connect(); }).then((server) => { console.log('Device connected. Server ', server); }); });
  • 17. 1. Connect Bluetooth Device const LUSH_SERVICE = '6e400001-b5a3-f393-e0a9-e50e24dcca9e'; button.addEventListener('click', () => { navigator.bluetooth.requestDevice({ filters: [{ services: [LUSH_SERVICE] }] }).then((device) => { console.log('Device found. Device: ', device); return device.gatt.connect(); }).then((server) => { console.log('Device connected. Server ', server); }); });
  • 18. 1. Connect Bluetooth Device const LUSH_SERVICE = '6e400001-b5a3-f393-e0a9-e50e24dcca9e'; button.addEventListener('click', () => { navigator.bluetooth.requestDevice({ filters: [{ services: [LUSH_SERVICE] }] }).then((device) => { console.log('Device found. Device: ', device); return device.gatt.connect(); }).then((server) => { console.log('Device connected. Server ', server); }); });
  • 19. How to detect Vowels f1 = ~850hz f2 = ~1610hz https://de.wikipedia.org/wiki/Formant
  • 20. How to detect Vowels createAnalyser() captureStream() new window.AudioContext() getByteFrequencyData() Vowels!!
  • 22. Vibrate:4; Identify Bluetooth Commands 56 69 62 72 61 74 65 3a 34 3b
  • 23. 3. Write to a Bluetooth Characteristic const LUSH_TX_CHARACTERISTIC = '6e400002-b5a3-f393-e0a9-e50e24dcca9e'; let txCharacteristic = null; button.addEventListener('click', () => { /* … */ }).then((server) => { return server.getPrimaryService(LUSH_SERVICE); }).then((service) => { return service.getCharacteristic(LUSH_TX_CHARACTERISTIC); }).then((characteristic) => { txCharacteristic = characteristic; }); });
  • 24. 3. Write to a Bluetooth Characteristic const LUSH_TX_CHARACTERISTIC = '6e400002-b5a3-f393-e0a9-e50e24dcca9e'; let txCharacteristic = null; button.addEventListener('click', () => { /* … */ }).then((server) => { return server.getPrimaryService(LUSH_SERVICE); }).then((service) => { return service.getCharacteristic(LUSH_TX_CHARACTERISTIC); }).then((characteristic) => { txCharacteristic = characteristic; }); });
  • 25. 3. Write to a Bluetooth Characteristic const LUSH_TX_CHARACTERISTIC = '6e400002-b5a3-f393-e0a9-e50e24dcca9e'; let txCharacteristic = null; button.addEventListener('click', () => { /* … */ }).then((server) => { return server.getPrimaryService(LUSH_SERVICE); }).then((service) => { return service.getCharacteristic(LUSH_TX_CHARACTERISTIC); }).then((characteristic) => { txCharacteristic = characteristic; }); });
  • 26. 3. Write to a Bluetooth Characteristic if (vowels && vowels[0]) { let message = new TextEncoder('ASCII').encode('Vibrate:10;'); txCharacteristic.writeValue(message); } else { let message = new TextEncoder('ASCII').encode('Vibrate:10;'); txCharacteristic.writeValue(message); }
  • 27. 3. Write to a Bluetooth Characteristic if (vowels && vowels[0]) { let message = new TextEncoder('ASCII').encode('Vibrate:10;'); txCharacteristic.writeValue(message); } else { let message = new TextEncoder('ASCII').encode('Vibrate:10;'); txCharacteristic.writeValue(message); }
  • 29. @fischaelameergeildanke.com #YGLFKyiv18 Be Creative! Use More Web APIs, Test, Give Feedback