@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.
Files changed (58) hide show
  1. package/README.md +32 -23
  2. package/dist/battery.d.ts +8 -3
  3. package/dist/battery.js +19 -7
  4. package/dist/calibration.js +5 -3
  5. package/dist/commands/kilterboard.js +1 -1
  6. package/dist/connect.js +4 -3
  7. package/dist/data/motherboard.d.ts +6 -2
  8. package/dist/data/motherboard.js +8 -3
  9. package/dist/data/progressor.d.ts +6 -2
  10. package/dist/data/progressor.js +10 -7
  11. package/dist/devices/kilterboard.d.ts +4 -0
  12. package/dist/devices/kilterboard.js +5 -1
  13. package/dist/firmware.d.ts +12 -0
  14. package/dist/firmware.js +37 -0
  15. package/dist/hardware.d.ts +11 -0
  16. package/dist/hardware.js +25 -0
  17. package/dist/index.d.ts +7 -2
  18. package/dist/index.js +10 -4
  19. package/dist/is-device.d.ts +31 -0
  20. package/dist/is-device.js +33 -0
  21. package/dist/led.d.ts +7 -3
  22. package/dist/led.js +32 -31
  23. package/dist/manufacturer.d.ts +11 -0
  24. package/dist/manufacturer.js +25 -0
  25. package/dist/read.d.ts +2 -2
  26. package/dist/read.js +3 -5
  27. package/dist/serial.d.ts +11 -0
  28. package/dist/serial.js +30 -0
  29. package/dist/stop.js +5 -5
  30. package/dist/stream.js +8 -8
  31. package/dist/text.d.ts +14 -0
  32. package/dist/text.js +33 -0
  33. package/dist/write.d.ts +26 -8
  34. package/dist/write.js +50 -47
  35. package/package.json +1 -1
  36. package/src/battery.ts +20 -8
  37. package/src/calibration.ts +5 -3
  38. package/src/commands/kilterboard.ts +1 -1
  39. package/src/connect.ts +4 -3
  40. package/src/data/motherboard.ts +8 -3
  41. package/src/data/progressor.ts +10 -7
  42. package/src/devices/kilterboard.ts +6 -1
  43. package/src/firmware.ts +39 -0
  44. package/src/hardware.ts +27 -0
  45. package/src/index.ts +10 -4
  46. package/src/is-device.ts +43 -0
  47. package/src/led.ts +35 -31
  48. package/src/manufacturer.ts +27 -0
  49. package/src/read.ts +5 -7
  50. package/src/serial.ts +32 -0
  51. package/src/stop.ts +5 -5
  52. package/src/stream.ts +8 -8
  53. package/src/text.ts +35 -0
  54. package/src/types/download.ts +1 -1
  55. package/src/write.ts +57 -45
  56. package/dist/info.d.ts +0 -7
  57. package/dist/info.js +0 -30
  58. 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
- }