@hangtime/grip-connect 0.3.0 → 0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/battery.ts +1 -1
- package/src/calibration.ts +1 -1
- package/src/characteristic.ts +1 -1
- package/src/commands/climbro.ts +1 -1
- package/src/commands/entralpi.ts +1 -1
- package/src/commands/motherboard.ts +1 -1
- package/src/commands/musclemeter.ts +1 -1
- package/src/commands/mysmartboard.ts +1 -1
- package/src/commands/progressor.ts +7 -7
- package/src/connect.ts +2 -2
- package/src/data.ts +2 -1
- package/src/devices/climbro.ts +1 -1
- package/src/devices/entralpi.ts +1 -1
- package/src/devices/motherboard.ts +1 -1
- package/src/devices/musclemeter.ts +1 -1
- package/src/devices/mysmartboard.ts +1 -1
- package/src/devices/progressor.ts +1 -1
- package/src/disconnect.ts +1 -1
- package/src/download.ts +1 -11
- package/src/info.ts +1 -1
- package/src/is-connected.ts +4 -4
- package/src/notify.ts +3 -10
- package/src/read.ts +1 -1
- package/src/stop.ts +1 -1
- package/src/stream.ts +1 -1
- package/src/types/devices.ts +41 -0
- package/src/types/download.ts +15 -0
- package/src/types/notify.ts +14 -0
- package/src/write.ts +1 -1
- package/src/battery.d.ts +0 -7
- package/src/battery.js +0 -25
- package/src/calibration.d.ts +0 -7
- package/src/calibration.js +0 -19
- package/src/characteristic.d.ts +0 -10
- package/src/characteristic.js +0 -20
- package/src/commands/climbro.d.ts +0 -6
- package/src/commands/climbro.js +0 -5
- package/src/commands/entralpi.d.ts +0 -6
- package/src/commands/entralpi.js +0 -5
- package/src/commands/index.d.ts +0 -6
- package/src/commands/index.js +0 -6
- package/src/commands/motherboard.d.ts +0 -6
- package/src/commands/motherboard.js +0 -13
- package/src/commands/musclemeter.d.ts +0 -6
- package/src/commands/musclemeter.js +0 -5
- package/src/commands/mysmartboard.d.ts +0 -6
- package/src/commands/mysmartboard.js +0 -5
- package/src/commands/progressor.d.ts +0 -17
- package/src/commands/progressor.js +0 -29
- package/src/commands/types.d.ts +0 -18
- package/src/commands/types.js +0 -1
- package/src/connect.d.ts +0 -7
- package/src/connect.js +0 -152
- package/src/data.d.ts +0 -16
- package/src/data.js +0 -220
- package/src/devices/climbro.d.ts +0 -6
- package/src/devices/climbro.js +0 -8
- package/src/devices/entralpi.d.ts +0 -5
- package/src/devices/entralpi.js +0 -55
- package/src/devices/index.d.ts +0 -6
- package/src/devices/index.js +0 -6
- package/src/devices/motherboard.d.ts +0 -5
- package/src/devices/motherboard.js +0 -82
- package/src/devices/musclemeter.d.ts +0 -6
- package/src/devices/musclemeter.js +0 -8
- package/src/devices/mysmartboard.d.ts +0 -6
- package/src/devices/mysmartboard.js +0 -8
- package/src/devices/progressor.d.ts +0 -5
- package/src/devices/progressor.js +0 -37
- package/src/devices/types.d.ts +0 -29
- package/src/devices/types.js +0 -1
- package/src/devices/types.ts +0 -29
- package/src/disconnect.d.ts +0 -6
- package/src/disconnect.js +0 -12
- package/src/download.d.ts +0 -19
- package/src/download.js +0 -50
- package/src/index.d.ts +0 -12
- package/src/index.js +0 -20
- package/src/info.d.ts +0 -7
- package/src/info.js +0 -30
- package/src/is-connected.d.ts +0 -7
- package/src/is-connected.js +0 -13
- package/src/notify.d.ts +0 -22
- package/src/notify.js +0 -14
- package/src/read.d.ts +0 -10
- package/src/read.js +0 -49
- package/src/stop.d.ts +0 -7
- package/src/stop.js +0 -21
- package/src/stream.d.ts +0 -8
- package/src/stream.js +0 -41
- package/src/struct/index.d.ts +0 -9
- package/src/struct/index.js +0 -176
- package/src/tare.d.ts +0 -12
- package/src/tare.js +0 -70
- package/src/write.d.ts +0 -16
- package/src/write.js +0 -56
- /package/src/{commands/types.ts → types/commands.ts} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hangtime/grip-connect",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.2",
|
|
4
4
|
"description": "A client that can establish connections with various Force-Sensing Hangboards/Plates used by climbers for strength measurement. Examples of such hangboards include the Griptonite Motherboard, Climbro, SmartBoard, Entralpi or Tindeq Progressor",
|
|
5
5
|
"main": "src/index.ts",
|
|
6
6
|
"scripts": {
|
package/src/battery.ts
CHANGED
package/src/calibration.ts
CHANGED
package/src/characteristic.ts
CHANGED
package/src/commands/climbro.ts
CHANGED
package/src/commands/entralpi.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Commands } from "../commands
|
|
1
|
+
import type { Commands } from "../types/commands"
|
|
2
2
|
/**
|
|
3
3
|
* Warning:
|
|
4
4
|
* Using other commands can seriously harm your device
|
|
@@ -22,10 +22,10 @@ export const ProgressorCommands: Commands = {
|
|
|
22
22
|
* The Progressor returns a Uint8Array.
|
|
23
23
|
* The first item [0] is the type of response it returns
|
|
24
24
|
*/
|
|
25
|
-
export
|
|
26
|
-
COMMAND_RESPONSE
|
|
27
|
-
WEIGHT_MEASURE
|
|
28
|
-
PEAK_RFD_MEAS
|
|
29
|
-
PEAK_RFD_MEAS_SERIES
|
|
30
|
-
LOW_BATTERY_WARNING
|
|
25
|
+
export enum ProgressorResponses {
|
|
26
|
+
COMMAND_RESPONSE,
|
|
27
|
+
WEIGHT_MEASURE,
|
|
28
|
+
PEAK_RFD_MEAS,
|
|
29
|
+
PEAK_RFD_MEAS_SERIES,
|
|
30
|
+
LOW_BATTERY_WARNING,
|
|
31
31
|
}
|
package/src/connect.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Device } from "./devices
|
|
1
|
+
import type { Device } from "./types/devices"
|
|
2
2
|
import { handleEntralpiData, handleMotherboardData, handleProgressorData } from "./data"
|
|
3
3
|
|
|
4
4
|
let server: BluetoothRemoteGATTServer
|
|
@@ -90,7 +90,7 @@ const onConnected = async (board: Device, onSuccess: () => void): Promise<void>
|
|
|
90
90
|
// notify
|
|
91
91
|
if (element.id === "rx") {
|
|
92
92
|
matchingCharacteristic.startNotifications()
|
|
93
|
-
matchingCharacteristic.addEventListener("characteristicvaluechanged", (event) =>
|
|
93
|
+
matchingCharacteristic.addEventListener("characteristicvaluechanged", (event: Event) =>
|
|
94
94
|
handleNotifications(event, board),
|
|
95
95
|
)
|
|
96
96
|
}
|
package/src/data.ts
CHANGED
|
@@ -3,8 +3,9 @@ import { applyTare } from "./tare"
|
|
|
3
3
|
import { ProgressorCommands, ProgressorResponses } from "./commands/progressor"
|
|
4
4
|
import { MotherboardCommands } from "./commands"
|
|
5
5
|
import { lastWrite } from "./write"
|
|
6
|
-
import { DownloadPacket, DownloadPackets } from "./download"
|
|
7
6
|
import struct from "./struct"
|
|
7
|
+
import { DownloadPackets } from "./download"
|
|
8
|
+
import type { DownloadPacket } from "./types/download"
|
|
8
9
|
|
|
9
10
|
// Constants
|
|
10
11
|
const PACKET_LENGTH: number = 32
|
package/src/devices/climbro.ts
CHANGED
package/src/devices/entralpi.ts
CHANGED
package/src/disconnect.ts
CHANGED
package/src/download.ts
CHANGED
|
@@ -1,14 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
* Represents a single data packet.
|
|
3
|
-
*/
|
|
4
|
-
export interface DownloadPacket {
|
|
5
|
-
received: number // Timestamp of when the packet was received
|
|
6
|
-
sampleNum: number // Sample number
|
|
7
|
-
battRaw: number // Battery raw value
|
|
8
|
-
samples: number[] // Array of sample values
|
|
9
|
-
masses: number[] // Array of mass values
|
|
10
|
-
}
|
|
11
|
-
|
|
1
|
+
import type { DownloadPacket } from "./types/download"
|
|
12
2
|
/**
|
|
13
3
|
* Array of DownloadPacket entries.
|
|
14
4
|
*/
|
package/src/info.ts
CHANGED
package/src/is-connected.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { Device } from "./devices
|
|
1
|
+
import type { Device } from "./types/devices"
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Checks if a Bluetooth device is connected.
|
|
5
5
|
* @param {Device} board - The device to check for connection.
|
|
6
6
|
* @returns {boolean} A boolean indicating whether the device is connected.
|
|
7
7
|
*/
|
|
8
|
-
export const isConnected = (board
|
|
9
|
-
// Check if the device is available
|
|
10
|
-
if (!board
|
|
8
|
+
export const isConnected = (board?: Device): boolean => {
|
|
9
|
+
// Check if the device is defined and available
|
|
10
|
+
if (!board?.device) {
|
|
11
11
|
return false
|
|
12
12
|
}
|
|
13
13
|
// Check if the device is connected using optional chaining
|
package/src/notify.ts
CHANGED
|
@@ -1,13 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
massAverage: string // The total average mass.
|
|
5
|
-
massLeft?: string // The mass on the left side (optional: Motherboard).
|
|
6
|
-
massCenter?: string // The mass at the center (optional: Motherboard).
|
|
7
|
-
massRight?: string // The mass on the right side (optional: Motherboard).
|
|
8
|
-
}
|
|
9
|
-
// Define the type for the callback function
|
|
10
|
-
type NotifyCallback = (data: massObject) => void
|
|
1
|
+
import type { massObject } from "./types/notify"
|
|
2
|
+
/** Define the type for the callback function */
|
|
3
|
+
export type NotifyCallback = (data: massObject) => void
|
|
11
4
|
/**
|
|
12
5
|
* Defines the type for the callback function.
|
|
13
6
|
* @callback NotifyCallback
|
package/src/read.ts
CHANGED
package/src/stop.ts
CHANGED
package/src/stream.ts
CHANGED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Represents a characteristic of a Bluetooth service.
|
|
3
|
+
*/
|
|
4
|
+
interface Characteristic {
|
|
5
|
+
/** Name of the characteristic */
|
|
6
|
+
name: string
|
|
7
|
+
/** Identifier of the characteristic */
|
|
8
|
+
id: string
|
|
9
|
+
/** UUID of the characteristic */
|
|
10
|
+
uuid: string
|
|
11
|
+
/** Reference to the characteristic object */
|
|
12
|
+
characteristic?: BluetoothRemoteGATTCharacteristic
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Represents a Bluetooth service.
|
|
17
|
+
*/
|
|
18
|
+
interface Service {
|
|
19
|
+
/** Name of the service */
|
|
20
|
+
name: string
|
|
21
|
+
/** Identifier of the service */
|
|
22
|
+
id: string
|
|
23
|
+
/** UUID of the service */
|
|
24
|
+
uuid: string
|
|
25
|
+
/** Array of characteristics belonging to this service */
|
|
26
|
+
characteristics: Characteristic[]
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Represents a Bluetooth device.
|
|
31
|
+
*/
|
|
32
|
+
export interface Device {
|
|
33
|
+
/** Name of the device */
|
|
34
|
+
name: string
|
|
35
|
+
/** Optional company identifier of the device */
|
|
36
|
+
companyId?: number
|
|
37
|
+
/** Array of services provided by the device */
|
|
38
|
+
services: Service[]
|
|
39
|
+
/** Reference to the BluetoothDevice object representing this device */
|
|
40
|
+
device?: BluetoothDevice
|
|
41
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Represents a single data packet.
|
|
3
|
+
*/
|
|
4
|
+
export interface DownloadPacket {
|
|
5
|
+
/** Timestamp of when the packet was received */
|
|
6
|
+
received: number
|
|
7
|
+
/** Sample number */
|
|
8
|
+
sampleNum: number //
|
|
9
|
+
/** Battery raw value */
|
|
10
|
+
battRaw: number
|
|
11
|
+
/** Array of sample values */
|
|
12
|
+
samples: number[]
|
|
13
|
+
/** Array of mass values */
|
|
14
|
+
masses: number[]
|
|
15
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface massObject {
|
|
2
|
+
/** The total mass. */
|
|
3
|
+
massTotal: string
|
|
4
|
+
/** The total maximum mass. */
|
|
5
|
+
massMax: string
|
|
6
|
+
/** The total average mass. */
|
|
7
|
+
massAverage: string
|
|
8
|
+
/** The mass on the left side (optional: Motherboard). */
|
|
9
|
+
massLeft?: string
|
|
10
|
+
/** The mass at the center (optional: Motherboard). */
|
|
11
|
+
massCenter?: string
|
|
12
|
+
/** The mass on the right side (optional: Motherboard). */
|
|
13
|
+
massRight?: string
|
|
14
|
+
}
|
package/src/write.ts
CHANGED
package/src/battery.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { Device } from "./devices/types";
|
|
2
|
-
/**
|
|
3
|
-
* Retrieves battery or voltage information from the device.
|
|
4
|
-
* @param {Device} board - The device.
|
|
5
|
-
* @returns {Promise<void>} A Promise that resolves when the information is successfully retrieved.
|
|
6
|
-
*/
|
|
7
|
-
export declare const battery: (board: Device) => Promise<void>;
|
package/src/battery.js
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { write } from "./write";
|
|
2
|
-
import { read } from "./read";
|
|
3
|
-
import { isConnected } from "./is-connected";
|
|
4
|
-
import { Motherboard, Progressor } from "./devices";
|
|
5
|
-
import { ProgressorCommands } from "./commands";
|
|
6
|
-
/**
|
|
7
|
-
* Retrieves battery or voltage information from the device.
|
|
8
|
-
* @param {Device} board - The device.
|
|
9
|
-
* @returns {Promise<void>} A Promise that resolves when the information is successfully retrieved.
|
|
10
|
-
*/
|
|
11
|
-
export const battery = async (board) => {
|
|
12
|
-
// Check if the device is connected
|
|
13
|
-
if (isConnected(board)) {
|
|
14
|
-
// If the device is connected and it is a Motherboard device
|
|
15
|
-
if (board.name === "Motherboard") {
|
|
16
|
-
// Read battery level information from the Motherboard
|
|
17
|
-
await read(Motherboard, "battery", "level", 250);
|
|
18
|
-
}
|
|
19
|
-
// If the device is connected and its name starts with "Progressor"
|
|
20
|
-
if (board.name && board.name.startsWith("Progressor")) {
|
|
21
|
-
// Write command to get battery voltage information to the Progressor
|
|
22
|
-
await write(Progressor, "progressor", "tx", ProgressorCommands.GET_BATT_VLTG, 250);
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
};
|
package/src/calibration.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { Device } from "./devices/types";
|
|
2
|
-
/**
|
|
3
|
-
* Writes a command to get calibration data from the device.
|
|
4
|
-
* @param {Device} board - The device.
|
|
5
|
-
* @returns {Promise<void>} A Promise that resolves when the command is successfully sent.
|
|
6
|
-
*/
|
|
7
|
-
export declare const calibration: (board: Device) => Promise<void>;
|
package/src/calibration.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { isConnected } from "./is-connected";
|
|
2
|
-
import { write } from "./write";
|
|
3
|
-
import { Motherboard } from "./devices";
|
|
4
|
-
import { MotherboardCommands } from "./commands";
|
|
5
|
-
/**
|
|
6
|
-
* Writes a command to get calibration data from the device.
|
|
7
|
-
* @param {Device} board - The device.
|
|
8
|
-
* @returns {Promise<void>} A Promise that resolves when the command is successfully sent.
|
|
9
|
-
*/
|
|
10
|
-
export const calibration = async (board) => {
|
|
11
|
-
// Check if the device is connected
|
|
12
|
-
if (isConnected(board)) {
|
|
13
|
-
// If the device is connected, and it is a Motherboard device
|
|
14
|
-
if (board.name === "Motherboard") {
|
|
15
|
-
// Write the command to get calibration data to the device
|
|
16
|
-
await write(Motherboard, "uart", "tx", MotherboardCommands.GET_CALIBRATION, 2500);
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
};
|
package/src/characteristic.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/// <reference types="web-bluetooth" />
|
|
2
|
-
import { Device } from "./devices/types";
|
|
3
|
-
/**
|
|
4
|
-
* Retrieves the characteristic from the device's service.
|
|
5
|
-
* @param {Device} board - The device.
|
|
6
|
-
* @param {string} serviceId - The UUID of the service.
|
|
7
|
-
* @param {string} characteristicId - The UUID of the characteristic.
|
|
8
|
-
* @returns {BluetoothRemoteGATTCharacteristic | undefined} The characteristic, if found.
|
|
9
|
-
*/
|
|
10
|
-
export declare const getCharacteristic: (board: Device, serviceId: string, characteristicId: string) => BluetoothRemoteGATTCharacteristic | undefined;
|
package/src/characteristic.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Retrieves the characteristic from the device's service.
|
|
3
|
-
* @param {Device} board - The device.
|
|
4
|
-
* @param {string} serviceId - The UUID of the service.
|
|
5
|
-
* @param {string} characteristicId - The UUID of the characteristic.
|
|
6
|
-
* @returns {BluetoothRemoteGATTCharacteristic | undefined} The characteristic, if found.
|
|
7
|
-
*/
|
|
8
|
-
export const getCharacteristic = (board, serviceId, characteristicId) => {
|
|
9
|
-
// Find the service with the specified serviceId
|
|
10
|
-
const boardService = board.services.find((service) => service.id === serviceId);
|
|
11
|
-
if (boardService) {
|
|
12
|
-
// If the service is found, find the characteristic with the specified characteristicId
|
|
13
|
-
const boardCharacteristic = boardService.characteristics.find((characteristic) => characteristic.id === characteristicId);
|
|
14
|
-
if (boardCharacteristic) {
|
|
15
|
-
// If the characteristic is found, return it
|
|
16
|
-
return boardCharacteristic.characteristic;
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
// Return undefined if the service or characteristic is not found
|
|
20
|
-
};
|
package/src/commands/climbro.js
DELETED
package/src/commands/entralpi.js
DELETED
package/src/commands/index.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export { ClimbroCommands } from "./climbro";
|
|
2
|
-
export { EntralpiCommands } from "./entralpi";
|
|
3
|
-
export { MotherboardCommands } from "./motherboard";
|
|
4
|
-
export { MuscleMeterCommands } from "./musclemeter";
|
|
5
|
-
export { ProgressorCommands } from "./progressor";
|
|
6
|
-
export { mySmartBoardCommands } from "./mysmartboard";
|
package/src/commands/index.js
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export { ClimbroCommands } from "./climbro";
|
|
2
|
-
export { EntralpiCommands } from "./entralpi";
|
|
3
|
-
export { MotherboardCommands } from "./motherboard";
|
|
4
|
-
export { MuscleMeterCommands } from "./musclemeter";
|
|
5
|
-
export { ProgressorCommands } from "./progressor";
|
|
6
|
-
export { mySmartBoardCommands } from "./mysmartboard";
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Warning:
|
|
3
|
-
* Using other commands can seriously harm your device
|
|
4
|
-
*/
|
|
5
|
-
export const MotherboardCommands = {
|
|
6
|
-
GET_SERIAL: "#",
|
|
7
|
-
START_WEIGHT_MEAS: "S30",
|
|
8
|
-
STOP_WEIGHT_MEAS: "", // All commands will stop the data stream.
|
|
9
|
-
GET_CALIBRATION: "C",
|
|
10
|
-
SLEEP: 0,
|
|
11
|
-
GET_TEXT: "T",
|
|
12
|
-
DEBUG_STREAM: "D",
|
|
13
|
-
};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { Commands } from "../commands/types";
|
|
2
|
-
/**
|
|
3
|
-
* Warning:
|
|
4
|
-
* Using other commands can seriously harm your device
|
|
5
|
-
*/
|
|
6
|
-
export declare const ProgressorCommands: Commands;
|
|
7
|
-
/**
|
|
8
|
-
* The Progressor returns a Uint8Array.
|
|
9
|
-
* The first item [0] is the type of response it returns
|
|
10
|
-
*/
|
|
11
|
-
export declare const ProgressorResponses: {
|
|
12
|
-
COMMAND_RESPONSE: number;
|
|
13
|
-
WEIGHT_MEASURE: number;
|
|
14
|
-
PEAK_RFD_MEAS: number;
|
|
15
|
-
PEAK_RFD_MEAS_SERIES: number;
|
|
16
|
-
LOW_BATTERY_WARNING: number;
|
|
17
|
-
};
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Warning:
|
|
3
|
-
* Using other commands can seriously harm your device
|
|
4
|
-
*/
|
|
5
|
-
export const ProgressorCommands = {
|
|
6
|
-
TARE_SCALE: "d", // 0x64,
|
|
7
|
-
START_WEIGHT_MEAS: "e", // 0x65,
|
|
8
|
-
STOP_WEIGHT_MEAS: "f", // 0x66,
|
|
9
|
-
START_PEAK_RFD_MEAS: "g", // 0x67,
|
|
10
|
-
START_PEAK_RFD_MEAS_SERIES: "h", // 0x68,
|
|
11
|
-
ADD_CALIB_POINT: "i", // 0x69,
|
|
12
|
-
SAVE_CALIB: "j", // 0x6a,
|
|
13
|
-
GET_FW_VERSION: "k", // 0x6b,
|
|
14
|
-
GET_ERR_INFO: "l", // 0x6c,
|
|
15
|
-
CLR_ERR_INFO: "m", // 0x6d,
|
|
16
|
-
SLEEP: "n", // 0x6e,
|
|
17
|
-
GET_BATT_VLTG: "o", // 0x6f,
|
|
18
|
-
};
|
|
19
|
-
/**
|
|
20
|
-
* The Progressor returns a Uint8Array.
|
|
21
|
-
* The first item [0] is the type of response it returns
|
|
22
|
-
*/
|
|
23
|
-
export const ProgressorResponses = {
|
|
24
|
-
COMMAND_RESPONSE: 0,
|
|
25
|
-
WEIGHT_MEASURE: 1,
|
|
26
|
-
PEAK_RFD_MEAS: 2,
|
|
27
|
-
PEAK_RFD_MEAS_SERIES: 3,
|
|
28
|
-
LOW_BATTERY_WARNING: 4,
|
|
29
|
-
};
|
package/src/commands/types.d.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
export interface Commands {
|
|
2
|
-
START_WEIGHT_MEAS?: string;
|
|
3
|
-
STOP_WEIGHT_MEAS?: string;
|
|
4
|
-
SLEEP?: number | string;
|
|
5
|
-
GET_SERIAL?: string;
|
|
6
|
-
GET_TEXT?: string;
|
|
7
|
-
DEBUG_STREAM?: string;
|
|
8
|
-
GET_CALIBRATION?: string;
|
|
9
|
-
TARE_SCALE?: string;
|
|
10
|
-
START_PEAK_RFD_MEAS?: string;
|
|
11
|
-
START_PEAK_RFD_MEAS_SERIES?: string;
|
|
12
|
-
ADD_CALIB_POINT?: string;
|
|
13
|
-
SAVE_CALIB?: string;
|
|
14
|
-
GET_FW_VERSION?: string;
|
|
15
|
-
GET_ERR_INFO?: string;
|
|
16
|
-
CLR_ERR_INFO?: string;
|
|
17
|
-
GET_BATT_VLTG?: string;
|
|
18
|
-
}
|
package/src/commands/types.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/src/connect.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { Device } from "./devices/types";
|
|
2
|
-
/**
|
|
3
|
-
* Connects to a Bluetooth device.
|
|
4
|
-
* @param {Device} board - The device to connect to.
|
|
5
|
-
* @param {Function} onSuccess - Callback function to execute on successful connection.
|
|
6
|
-
*/
|
|
7
|
-
export declare const connect: (board: Device, onSuccess: () => void) => Promise<void>;
|