UNPKG

@hangtime/grip-connect

Version:

Griptonite Motherboard, Tindeq Progressor, PitchSix Force Board, WHC-06, Entralpi, Climbro, mySmartBoard: Bluetooth API Force-Sensing strength analysis for climbers

57 lines 2.13 kB
import { Device } from "../device.model.js"; import type { IWHC06 } from "../../interfaces/device/wh-c06.interface.js"; /** * Represents a Weiheng - WH-C06 (or MAT Muscle Meter) device. * To use this device enable: `chrome://flags/#enable-experimental-web-platform-features`. * {@link https://googlechrome.github.io/samples/web-bluetooth/scan.html| Web Bluetooth} * {@link https://weihengmanufacturer.com} */ export declare class WHC06 extends Device implements IWHC06 { /** * Offset for the byte location in the manufacturer data to extract the weight. * @type {number} * @static * @readonly * @constant */ private static readonly weightOffset; /** * Company identifier for WH-C06, also used by 'TomTom International BV': https://www.bluetooth.com/specifications/assigned-numbers/ * @type {number} * @static * @readonly * @constant */ private static readonly manufacturerId; /** * To track disconnection timeout. * @type {number|null} * @private */ private advertisementTimeout; /** * The limit in seconds when timeout is triggered * @type {number} * @private * @readonly */ private readonly advertisementTimeoutTime; constructor(); /** * Connects to a Bluetooth device. * @param {Function} [onSuccess] - Optional callback function to execute on successful connection. Default logs success. * @param {Function} [onError] - Optional callback function to execute on error. Default logs the error. */ connect: (onSuccess?: () => void, onError?: (error: Error) => void) => Promise<void>; /** * Custom check if a Bluetooth device is connected. * For the WH-C06 device, the `gatt.connected` property remains `false` even after the device is connected. * @returns {boolean} A boolean indicating whether the device is connected. */ isConnected: () => boolean; /** * Resets the timeout that checks if the device is still advertising. */ private resetAdvertisementTimeout; } //# sourceMappingURL=wh-c06.model.d.ts.map