@neurosity/sdk
Version:
Neurosity SDK
19 lines (18 loc) • 701 B
JavaScript
import semverGte from "semver/functions/gte";
export function osHasBluetoothSupport(selectedDevice, osVersion) {
if (!selectedDevice) {
return false;
}
// Only the Crown supports Bluetooth
const isCrown = Number(selectedDevice.modelVersion) >= 3;
if (!isCrown) {
return false;
}
const isEmulator = !!(selectedDevice === null || selectedDevice === void 0 ? void 0 : selectedDevice.emulator);
if (isEmulator) {
return false;
}
// `osVersion` is updated in real time,
// unlike accessing via `selectedDevice.osVersion`
return semverGte(osVersion !== null && osVersion !== void 0 ? osVersion : selectedDevice.osVersion, "16.0.0");
}