You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
395 B
18 lines
395 B
import { GATT } from "./gatt.js";
|
|
|
|
const hrSensorOptions = {
|
|
filters: [{ services: [GATT.HeartRate.service] }],
|
|
optionalServices: [GATT.DeviceInfo.service, GATT.Battery.service],
|
|
};
|
|
|
|
const requestHRSensor = async () => {
|
|
try {
|
|
return await navigator.bluetooth.requestDevice(hrSensorOptions);
|
|
} catch (err) {
|
|
console.log(err);
|
|
return null;
|
|
}
|
|
};
|
|
|
|
export { requestHRSensor };
|