add example of scanning

pull/1/head
Lambda 5 months ago
parent ede805fb53
commit 79d339a4d3

@ -0,0 +1,12 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8"/>
<title>Ridein</title>
</head>
<body>
<button id="start">start</button>
<script type="module" src="js/main.js"></script>
</body>
</html>

@ -0,0 +1,13 @@
const startButton = document.getElementById("start");
const FTM_SERVICE_UUID = "00001825-0000-1000-8000-00805f9b34fb";
startButton.addEventListener("click", async () => {
try {
const device = await navigator.bluetooth.requestDevice({
acceptAllDevices: true,
});
console.log(device);
} catch (error) {
console.log(error);
}
});
Loading…
Cancel
Save