@hangtime/grip-connect
Version:
Griptonite Motherboard, Tindeq Progressor, PitchSix Force Board, WHC-06, Entralpi, Climbro, mySmartBoard: Bluetooth API Force-Sensing strength analysis for climbers
121 lines • 5.55 kB
TypeScript
import { Device } from "../device.model.js";
import type { IProgressor } from "../../interfaces/device/progressor.interface.js";
export declare class Progressor extends Device implements IProgressor {
/** Device timestamps (µs) of recent samples (samples in last 1s device time). */
private recentSampleTimestamps;
/** 1-based index for multi-packet calibration-table export responses. */
private calibrationTableRecordIndex;
constructor();
/**
* Retrieves battery or voltage information from the device.
* @returns {Promise<string | undefined>} A Promise that resolves with the battery or voltage information,
*/
battery: () => Promise<string | undefined>;
/**
* Retrieves firmware version from the device.
* @returns {Promise<string>} A Promise that resolves with the firmware version,
*/
firmware: () => Promise<string | undefined>;
/**
* Retrieves the Progressor ID from the device.
* @returns {Promise<string>} A Promise that resolves with the raw response (hex of payload).
*/
progressorId: () => Promise<string | undefined>;
/**
* Retrieves the linear calibration block from the device.
* Returns raw hex plus decoded slope/intercept/trim coefficients.
*/
calibration: () => Promise<string | undefined>;
/**
* Retrieves the hidden 15-entry piecewise calibration table.
* Each response packet contains one 16-byte record.
* @returns {Promise<string | undefined>} Newline-separated decoded records.
*/
calibrationTable: () => Promise<string | undefined>;
/**
* Computes calibration curve from stored points and saves to flash.
* Requires addCalibrationPoint() for zero and reference. Normal flow: i → i → j.
* @returns {Promise<void>} A Promise that resolves when the command is sent.
*/
saveCalibration: () => Promise<void>;
/**
* Write calibration block directly (raw overwrite).
*
* Payload layout (14 bytes):
* - [0] opcode ('q')
* - [1] reserved (ignored by firmware)
* - [2..13] 12-byte calibration block (3× float32 LE: slope, intercept, trim)
*
* Notes:
* - This command does not compute anything; it overwrites stored calibration data.
* - Sending only the opcode (no 12-byte calibration block) is not a supported "reset" mode.
*
* @param curve - Raw 12-byte calibration block (3× float32 LE: slope, intercept, trim) (required).
* @returns Promise that resolves when the command is sent.
*/
setCalibration: (curve: Uint8Array) => Promise<void>;
/**
* Captures a calibration point from the *current live measurement*.
*
* Command: 0x69 ('i') written to the control characteristic.
*
* The firmware does **not** parse a float payload for this command. It simply snapshots the
* current raw ADC/force reading and stores it as the next calibration point (typically
* used as the zero point and the reference point for two-point calibration).
*
* Typical two-point calibration flow:
* 1) Ensure the device is stable with **no load** attached → send addCalibrationPoint() (zero point)
* 2) Attach a **known weight** and wait until stable → send addCalibrationPoint() (reference point)
* 3) Call saveCalibration() ('j') to compute + persist the curve
*
* Notes:
* - Order usually doesn’t matter, but capturing the zero point first is common practice.
* - Any extra payload bytes are ignored by the firmware for this command.
*
* @returns {Promise<void>} Resolves when the command is sent.
*/
addCalibrationPoint: () => Promise<void>;
/** True if tare() uses device hardware tare rather than software averaging. */
readonly usesHardwareTare = true;
tare(duration?: number): boolean;
/**
* Puts the device to sleep / shutdown.
* @returns {Promise<void>} A Promise that resolves when the command is sent.
*/
sleep: () => Promise<void>;
/**
* Reboots the device immediately.
* @returns {Promise<void>} A Promise that resolves when the command is sent.
*/
reboot: () => Promise<void>;
/**
* Retrieves error information from the device.
* @returns {Promise<string | undefined>} A Promise that resolves with the error info text.
*/
errorInfo: () => Promise<string | undefined>;
/**
* Clears error information on the device.
* @returns {Promise<void>} A Promise that resolves when the command is sent.
*/
clearErrorInfo: () => Promise<void>;
/**
* Handles data received from the device, processes weight measurements,
* and updates mass data including maximum and average values.
* It also handles command responses for retrieving device information.
*
* @param {DataView} value - The notification event.
*/
handleNotifications: (value: DataView) => void;
/**
* Stops the data stream on the specified device.
* @returns {Promise<void>} A promise that resolves when the stream is stopped.
*/
stop: () => Promise<void>;
/**
* Starts streaming data from the specified device.
* @param {number} [duration=0] - The duration of the stream in milliseconds. If set to 0, stream will continue indefinitely.
* @returns {Promise<void>} A promise that resolves when the streaming operation is completed.
*/
stream: (duration?: number) => Promise<void>;
}
//# sourceMappingURL=progressor.model.d.ts.map