-
Notifications
You must be signed in to change notification settings - Fork 15
/
index.html
45 lines (40 loc) · 1.74 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body>
<div style="padding-top: 15px">
<h2>Electron with Chrome WebBluetooth API</h2>
<strong>Get device info</strong>
<p>This sample illustrates the use of the Web Bluetooth API to retrieve basic device information from a nearby Bluetooth
Low Energy Device.</p>
<label for="allDevices">All Devices</label>
<input id="allDevices" type="checkbox">
<input id="service" type="text" size=17 list="services" placeholder="Bluetooth Service">
<input id="name" type="text" size=17 placeholder="Device Name">
<input id="namePrefix" type="text" size=17 placeholder="Device Name Prefix">
<button id="get-device-info">Log Bluetooth Device Info</button>
</div>
<div style="padding-top: 15px">
<strong>Get heart rate data</strong>
<p>To get heart rate data, I've used a Bluetooth Prephiral Simulator app called LightBlue downloaded from the App Store.
There, create a virtual prephiral service for heart rate. Go to the 'Heart Rate Control Point' characterisitc, add
read and write capabilities. You can also set a default Hex value. You need this to be able to get a result from 'Get
Heart Rate' button.</p>
<button id="get-heart-rate">Get Heart Rate</button>
</div>
<div style="padding-top: 15px">
<strong>Set heart rate data</strong>
<p>Send a number to your bluetooth device, and see the value there.</p>
<input id="set-heart-rate-value" value="1" type="number" size=17 placeholder="Type value">
<button id="set-heart-rate">Set Heart Rate</button>
</div>
</body>
</html>
<script>
// You can also require other files to run in this process
require('./renderer.js')
require('./index.js')
</script>