@hangtime/grip-connect 0.3.10 → 0.4.1
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/README.md +32 -23
- package/dist/battery.d.ts +8 -3
- package/dist/battery.js +19 -7
- package/dist/calibration.js +5 -3
- package/dist/commands/kilterboard.js +1 -1
- package/dist/connect.js +4 -3
- package/dist/data/motherboard.d.ts +6 -2
- package/dist/data/motherboard.js +8 -3
- package/dist/data/progressor.d.ts +6 -2
- package/dist/data/progressor.js +10 -7
- package/dist/devices/kilterboard.d.ts +4 -0
- package/dist/devices/kilterboard.js +5 -1
- package/dist/firmware.d.ts +12 -0
- package/dist/firmware.js +37 -0
- package/dist/hardware.d.ts +11 -0
- package/dist/hardware.js +25 -0
- package/dist/index.d.ts +7 -2
- package/dist/index.js +10 -4
- package/dist/is-device.d.ts +31 -0
- package/dist/is-device.js +33 -0
- package/dist/led.d.ts +7 -3
- package/dist/led.js +32 -31
- package/dist/manufacturer.d.ts +11 -0
- package/dist/manufacturer.js +25 -0
- package/dist/read.d.ts +2 -2
- package/dist/read.js +3 -5
- package/dist/serial.d.ts +11 -0
- package/dist/serial.js +30 -0
- package/dist/stop.js +5 -5
- package/dist/stream.js +8 -8
- package/dist/text.d.ts +14 -0
- package/dist/text.js +33 -0
- package/dist/write.d.ts +26 -8
- package/dist/write.js +50 -47
- package/package.json +1 -1
- package/src/battery.ts +20 -8
- package/src/calibration.ts +5 -3
- package/src/commands/kilterboard.ts +1 -1
- package/src/connect.ts +4 -3
- package/src/data/motherboard.ts +8 -3
- package/src/data/progressor.ts +10 -7
- package/src/devices/kilterboard.ts +6 -1
- package/src/firmware.ts +39 -0
- package/src/hardware.ts +27 -0
- package/src/index.ts +10 -4
- package/src/is-device.ts +43 -0
- package/src/led.ts +35 -31
- package/src/manufacturer.ts +27 -0
- package/src/read.ts +5 -7
- package/src/serial.ts +32 -0
- package/src/stop.ts +5 -5
- package/src/stream.ts +8 -8
- package/src/text.ts +35 -0
- package/src/types/download.ts +1 -1
- package/src/write.ts +57 -45
- package/dist/info.d.ts +0 -7
- package/dist/info.js +0 -30
- package/src/info.ts +0 -32
package/dist/info.js
DELETED
|
@@ -1,30 +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 { MotherboardCommands, ProgressorCommands } from "./commands";
|
|
6
|
-
/**
|
|
7
|
-
* Retrieves device information.
|
|
8
|
-
* @param {Device} board - The device to retrieve information from.
|
|
9
|
-
* @returns {Promise<void>} A promise that resolves when the information retrieval is completed.
|
|
10
|
-
*/
|
|
11
|
-
export const info = async (board) => {
|
|
12
|
-
if (isConnected(board)) {
|
|
13
|
-
if (board.filters.some((filter) => filter.name === "Motherboard")) {
|
|
14
|
-
// Read manufacturer information
|
|
15
|
-
await read(Motherboard, "device", "manufacturer", 250);
|
|
16
|
-
// Read hardware version
|
|
17
|
-
await read(Motherboard, "device", "hardware", 250);
|
|
18
|
-
// Read firmware version
|
|
19
|
-
await read(Motherboard, "device", "firmware", 250);
|
|
20
|
-
// Get text from Motherboard
|
|
21
|
-
await write(Motherboard, "uart", "tx", MotherboardCommands.GET_TEXT, 250);
|
|
22
|
-
// Get serial number from Motherboard
|
|
23
|
-
await write(Motherboard, "uart", "tx", MotherboardCommands.GET_SERIAL, 250);
|
|
24
|
-
}
|
|
25
|
-
if (board.filters.some((filter) => filter.namePrefix === "Progressor")) {
|
|
26
|
-
// Get firmware version from Progressor
|
|
27
|
-
await write(Progressor, "progressor", "tx", ProgressorCommands.GET_FW_VERSION, 250);
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
};
|
package/src/info.ts
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import type { Device } from "./types/devices"
|
|
2
|
-
import { write } from "./write"
|
|
3
|
-
import { read } from "./read"
|
|
4
|
-
import { isConnected } from "./is-connected"
|
|
5
|
-
import { Motherboard, Progressor } from "./devices"
|
|
6
|
-
import { MotherboardCommands, ProgressorCommands } from "./commands"
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Retrieves device information.
|
|
10
|
-
* @param {Device} board - The device to retrieve information from.
|
|
11
|
-
* @returns {Promise<void>} A promise that resolves when the information retrieval is completed.
|
|
12
|
-
*/
|
|
13
|
-
export const info = async (board: Device): Promise<void> => {
|
|
14
|
-
if (isConnected(board)) {
|
|
15
|
-
if (board.filters.some((filter) => filter.name === "Motherboard")) {
|
|
16
|
-
// Read manufacturer information
|
|
17
|
-
await read(Motherboard, "device", "manufacturer", 250)
|
|
18
|
-
// Read hardware version
|
|
19
|
-
await read(Motherboard, "device", "hardware", 250)
|
|
20
|
-
// Read firmware version
|
|
21
|
-
await read(Motherboard, "device", "firmware", 250)
|
|
22
|
-
// Get text from Motherboard
|
|
23
|
-
await write(Motherboard, "uart", "tx", MotherboardCommands.GET_TEXT, 250)
|
|
24
|
-
// Get serial number from Motherboard
|
|
25
|
-
await write(Motherboard, "uart", "tx", MotherboardCommands.GET_SERIAL, 250)
|
|
26
|
-
}
|
|
27
|
-
if (board.filters.some((filter) => filter.namePrefix === "Progressor")) {
|
|
28
|
-
// Get firmware version from Progressor
|
|
29
|
-
await write(Progressor, "progressor", "tx", ProgressorCommands.GET_FW_VERSION, 250)
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
}
|