@hangtime/grip-connect 0.12.0 → 0.13.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 (180) hide show
  1. package/README.md +20 -9
  2. package/dist/cjs/index.d.ts +2 -2
  3. package/dist/cjs/index.d.ts.map +1 -1
  4. package/dist/cjs/index.js +3 -3
  5. package/dist/cjs/index.js.map +1 -1
  6. package/dist/cjs/interfaces/command.interface.d.ts +110 -21
  7. package/dist/cjs/interfaces/command.interface.d.ts.map +1 -1
  8. package/dist/cjs/interfaces/device/aurora.interface.d.ts +17 -0
  9. package/dist/cjs/interfaces/device/aurora.interface.d.ts.map +1 -0
  10. package/dist/cjs/interfaces/device/{kilterboard.interface.js → aurora.interface.js} +1 -1
  11. package/dist/cjs/interfaces/device/aurora.interface.js.map +1 -0
  12. package/dist/cjs/interfaces/device/cts500.interface.d.ts +96 -0
  13. package/dist/cjs/interfaces/device/cts500.interface.d.ts.map +1 -0
  14. package/dist/cjs/interfaces/device/cts500.interface.js +3 -0
  15. package/dist/cjs/interfaces/device/cts500.interface.js.map +1 -0
  16. package/dist/cjs/interfaces/device/forceboard.interface.d.ts +2 -2
  17. package/dist/cjs/interfaces/device/forceboard.interface.d.ts.map +1 -1
  18. package/dist/cjs/interfaces/device/motherboard.interface.d.ts +1 -1
  19. package/dist/cjs/interfaces/device/pb-700bt.interface.d.ts +53 -0
  20. package/dist/cjs/interfaces/device/pb-700bt.interface.d.ts.map +1 -0
  21. package/dist/cjs/interfaces/device/pb-700bt.interface.js +3 -0
  22. package/dist/cjs/interfaces/device/pb-700bt.interface.js.map +1 -0
  23. package/dist/cjs/interfaces/device/progressor.interface.d.ts +2 -2
  24. package/dist/cjs/interfaces/device/progressor.interface.d.ts.map +1 -1
  25. package/dist/cjs/interfaces/index.d.ts +4 -1
  26. package/dist/cjs/interfaces/index.d.ts.map +1 -1
  27. package/dist/cjs/interfaces/nordic.interface.d.ts +47 -0
  28. package/dist/cjs/interfaces/nordic.interface.d.ts.map +1 -0
  29. package/dist/cjs/interfaces/nordic.interface.js +3 -0
  30. package/dist/cjs/interfaces/nordic.interface.js.map +1 -0
  31. package/dist/cjs/models/device/{kilterboard.model.d.ts → aurora.model.d.ts} +82 -40
  32. package/dist/cjs/models/device/aurora.model.d.ts.map +1 -0
  33. package/dist/cjs/models/device/aurora.model.js +407 -0
  34. package/dist/cjs/models/device/aurora.model.js.map +1 -0
  35. package/dist/cjs/models/device/climbro.model.js +1 -1
  36. package/dist/cjs/models/device/climbro.model.js.map +1 -1
  37. package/dist/cjs/models/device/cts500.model.d.ts +173 -0
  38. package/dist/cjs/models/device/cts500.model.d.ts.map +1 -0
  39. package/dist/cjs/models/device/cts500.model.js +596 -0
  40. package/dist/cjs/models/device/cts500.model.js.map +1 -0
  41. package/dist/cjs/models/device/forceboard.model.d.ts +2 -2
  42. package/dist/cjs/models/device/forceboard.model.d.ts.map +1 -1
  43. package/dist/cjs/models/device/forceboard.model.js +9 -16
  44. package/dist/cjs/models/device/forceboard.model.js.map +1 -1
  45. package/dist/cjs/models/device/motherboard.model.d.ts +4 -1
  46. package/dist/cjs/models/device/motherboard.model.d.ts.map +1 -1
  47. package/dist/cjs/models/device/motherboard.model.js +26 -10
  48. package/dist/cjs/models/device/motherboard.model.js.map +1 -1
  49. package/dist/cjs/models/device/pb-700bt.model.d.ts +2 -1
  50. package/dist/cjs/models/device/pb-700bt.model.d.ts.map +1 -1
  51. package/dist/cjs/models/device/pb-700bt.model.js.map +1 -1
  52. package/dist/cjs/models/device/progressor.model.d.ts +2 -2
  53. package/dist/cjs/models/device/progressor.model.d.ts.map +1 -1
  54. package/dist/cjs/models/device/progressor.model.js +4 -20
  55. package/dist/cjs/models/device/progressor.model.js.map +1 -1
  56. package/dist/cjs/models/device/wh-c06.model.d.ts +2 -0
  57. package/dist/cjs/models/device/wh-c06.model.d.ts.map +1 -1
  58. package/dist/cjs/models/device/wh-c06.model.js +45 -34
  59. package/dist/cjs/models/device/wh-c06.model.js.map +1 -1
  60. package/dist/cjs/models/device.model.d.ts +25 -5
  61. package/dist/cjs/models/device.model.d.ts.map +1 -1
  62. package/dist/cjs/models/device.model.js +94 -24
  63. package/dist/cjs/models/device.model.js.map +1 -1
  64. package/dist/cjs/models/index.d.ts +3 -1
  65. package/dist/cjs/models/index.d.ts.map +1 -1
  66. package/dist/cjs/models/index.js +8 -4
  67. package/dist/cjs/models/index.js.map +1 -1
  68. package/dist/cjs/models/nordic.model.d.ts +128 -0
  69. package/dist/cjs/models/nordic.model.d.ts.map +1 -0
  70. package/dist/cjs/models/nordic.model.js +405 -0
  71. package/dist/cjs/models/nordic.model.js.map +1 -0
  72. package/dist/cjs/package.json +3 -0
  73. package/dist/index.d.ts +2 -2
  74. package/dist/index.d.ts.map +1 -1
  75. package/dist/index.js +1 -1
  76. package/dist/index.js.map +1 -1
  77. package/dist/interfaces/command.interface.d.ts +110 -21
  78. package/dist/interfaces/command.interface.d.ts.map +1 -1
  79. package/dist/interfaces/device/aurora.interface.d.ts +17 -0
  80. package/dist/interfaces/device/aurora.interface.d.ts.map +1 -0
  81. package/dist/interfaces/device/aurora.interface.js +2 -0
  82. package/dist/interfaces/device/aurora.interface.js.map +1 -0
  83. package/dist/interfaces/device/cts500.interface.d.ts +96 -0
  84. package/dist/interfaces/device/cts500.interface.d.ts.map +1 -0
  85. package/dist/interfaces/device/cts500.interface.js +2 -0
  86. package/dist/interfaces/device/cts500.interface.js.map +1 -0
  87. package/dist/interfaces/device/forceboard.interface.d.ts +2 -2
  88. package/dist/interfaces/device/forceboard.interface.d.ts.map +1 -1
  89. package/dist/interfaces/device/motherboard.interface.d.ts +1 -1
  90. package/dist/interfaces/device/pb-700bt.interface.d.ts +53 -0
  91. package/dist/interfaces/device/pb-700bt.interface.d.ts.map +1 -0
  92. package/dist/interfaces/device/pb-700bt.interface.js +2 -0
  93. package/dist/interfaces/device/pb-700bt.interface.js.map +1 -0
  94. package/dist/interfaces/device/progressor.interface.d.ts +2 -2
  95. package/dist/interfaces/device/progressor.interface.d.ts.map +1 -1
  96. package/dist/interfaces/index.d.ts +4 -1
  97. package/dist/interfaces/index.d.ts.map +1 -1
  98. package/dist/interfaces/nordic.interface.d.ts +47 -0
  99. package/dist/interfaces/nordic.interface.d.ts.map +1 -0
  100. package/dist/interfaces/nordic.interface.js +2 -0
  101. package/dist/interfaces/nordic.interface.js.map +1 -0
  102. package/dist/models/device/{kilterboard.model.d.ts → aurora.model.d.ts} +82 -40
  103. package/dist/models/device/aurora.model.d.ts.map +1 -0
  104. package/dist/models/device/aurora.model.js +401 -0
  105. package/dist/models/device/aurora.model.js.map +1 -0
  106. package/dist/models/device/climbro.model.js +1 -1
  107. package/dist/models/device/climbro.model.js.map +1 -1
  108. package/dist/models/device/cts500.model.d.ts +173 -0
  109. package/dist/models/device/cts500.model.d.ts.map +1 -0
  110. package/dist/models/device/cts500.model.js +592 -0
  111. package/dist/models/device/cts500.model.js.map +1 -0
  112. package/dist/models/device/forceboard.model.d.ts +2 -2
  113. package/dist/models/device/forceboard.model.d.ts.map +1 -1
  114. package/dist/models/device/forceboard.model.js +9 -16
  115. package/dist/models/device/forceboard.model.js.map +1 -1
  116. package/dist/models/device/motherboard.model.d.ts +4 -1
  117. package/dist/models/device/motherboard.model.d.ts.map +1 -1
  118. package/dist/models/device/motherboard.model.js +26 -10
  119. package/dist/models/device/motherboard.model.js.map +1 -1
  120. package/dist/models/device/pb-700bt.model.d.ts +2 -1
  121. package/dist/models/device/pb-700bt.model.d.ts.map +1 -1
  122. package/dist/models/device/pb-700bt.model.js.map +1 -1
  123. package/dist/models/device/progressor.model.d.ts +2 -2
  124. package/dist/models/device/progressor.model.d.ts.map +1 -1
  125. package/dist/models/device/progressor.model.js +4 -20
  126. package/dist/models/device/progressor.model.js.map +1 -1
  127. package/dist/models/device/wh-c06.model.d.ts +2 -0
  128. package/dist/models/device/wh-c06.model.d.ts.map +1 -1
  129. package/dist/models/device/wh-c06.model.js +44 -34
  130. package/dist/models/device/wh-c06.model.js.map +1 -1
  131. package/dist/models/device.model.d.ts +25 -5
  132. package/dist/models/device.model.d.ts.map +1 -1
  133. package/dist/models/device.model.js +93 -24
  134. package/dist/models/device.model.js.map +1 -1
  135. package/dist/models/index.d.ts +3 -1
  136. package/dist/models/index.d.ts.map +1 -1
  137. package/dist/models/index.js +3 -1
  138. package/dist/models/index.js.map +1 -1
  139. package/dist/models/nordic.model.d.ts +128 -0
  140. package/dist/models/nordic.model.d.ts.map +1 -0
  141. package/dist/models/nordic.model.js +393 -0
  142. package/dist/models/nordic.model.js.map +1 -0
  143. package/package.json +47 -43
  144. package/src/index.ts +6 -3
  145. package/src/interfaces/command.interface.ts +131 -21
  146. package/src/interfaces/device/aurora.interface.ts +18 -0
  147. package/src/interfaces/device/cts500.interface.ts +113 -0
  148. package/src/interfaces/device/forceboard.interface.ts +2 -2
  149. package/src/interfaces/device/motherboard.interface.ts +1 -1
  150. package/src/interfaces/device/pb-700bt.interface.ts +61 -0
  151. package/src/interfaces/device/progressor.interface.ts +2 -2
  152. package/src/interfaces/index.ts +8 -2
  153. package/src/interfaces/nordic.interface.ts +47 -0
  154. package/src/models/device/aurora.model.ts +497 -0
  155. package/src/models/device/climbro.model.ts +1 -1
  156. package/src/models/device/cts500.model.ts +709 -0
  157. package/src/models/device/forceboard.model.ts +9 -16
  158. package/src/models/device/motherboard.model.ts +51 -9
  159. package/src/models/device/pb-700bt.model.ts +2 -1
  160. package/src/models/device/progressor.model.ts +4 -20
  161. package/src/models/device/wh-c06.model.ts +54 -42
  162. package/src/models/device.model.ts +104 -24
  163. package/src/models/index.ts +5 -1
  164. package/src/models/nordic.model.ts +468 -0
  165. package/dist/cjs/interfaces/device/kilterboard.interface.d.ts +0 -17
  166. package/dist/cjs/interfaces/device/kilterboard.interface.d.ts.map +0 -1
  167. package/dist/cjs/interfaces/device/kilterboard.interface.js.map +0 -1
  168. package/dist/cjs/models/device/kilterboard.model.d.ts.map +0 -1
  169. package/dist/cjs/models/device/kilterboard.model.js +0 -327
  170. package/dist/cjs/models/device/kilterboard.model.js.map +0 -1
  171. package/dist/interfaces/device/kilterboard.interface.d.ts +0 -17
  172. package/dist/interfaces/device/kilterboard.interface.d.ts.map +0 -1
  173. package/dist/interfaces/device/kilterboard.interface.js +0 -2
  174. package/dist/interfaces/device/kilterboard.interface.js.map +0 -1
  175. package/dist/models/device/kilterboard.model.d.ts.map +0 -1
  176. package/dist/models/device/kilterboard.model.js +0 -323
  177. package/dist/models/device/kilterboard.model.js.map +0 -1
  178. package/dist/tsconfig.cjs.tsbuildinfo +0 -1
  179. package/src/interfaces/device/kilterboard.interface.ts +0 -12
  180. package/src/models/device/kilterboard.model.ts +0 -347
@@ -1,16 +1,15 @@
1
1
  import { Device } from "../device.model.js";
2
- import type { IKilterBoard } from "../../interfaces/device/kilterboard.interface.js";
2
+ import type { AuroraLedPlacement, IAurora } from "../../interfaces/device/aurora.interface.js";
3
3
  /**
4
4
  * For API level 2 and API level 3.
5
5
  * The first byte in the data is dependent on where the packet is in the message as a whole.
6
- * More details: https://github.com/1-max-1/fake_kilter_board
7
6
  */
8
- export declare enum KilterBoardPacket {
7
+ export declare enum AuroraPacket {
9
8
  /** If this packet is in the middle, the byte gets set to 77 (M). */
10
9
  V2_MIDDLE = 77,
11
10
  /** If this packet is the first packet in the message, then this byte gets set to 78 (N). */
12
11
  V2_FIRST = 78,
13
- /** If this is the last packet in the message, this byte gets set to 79 (0). */
12
+ /** If this is the last packet in the message, this byte gets set to 79 (O). */
14
13
  V2_LAST = 79,
15
14
  /** If this packet is the only packet in the message, the byte gets set to 80 (P). Note that this takes priority over the other conditions. */
16
15
  V2_ONLY = 80,
@@ -23,27 +22,15 @@ export declare enum KilterBoardPacket {
23
22
  /** If this packet is the only packet in the message, the byte gets set to 84 (T). Note that this takes priority over the other conditions. */
24
23
  V3_ONLY = 84
25
24
  }
26
- /**
27
- * Extracted from placement_roles database table.
28
- */
29
- export declare const KilterBoardPlacementRoles: {
30
- id: number;
31
- product_id: number;
32
- position: number;
33
- name: string;
34
- full_name: string;
35
- led_color: string;
36
- screen_color: string;
37
- }[];
38
25
  /**
39
26
  * Represents a Aurora Climbing device.
40
- * Kilter Board, Tension Board, Decoy Board, Touchstone Board, Grasshopper Board, Aurora Board, So iLL Board
27
+ * Aurora Board
41
28
  * {@link https://auroraclimbing.com}
42
29
  */
43
- export declare class KilterBoard extends Device implements IKilterBoard {
30
+ export declare class Aurora extends Device implements IAurora {
44
31
  /**
45
32
  * UUID for the Aurora Climbing Advertising service.
46
- * This constant is used to identify the specific Bluetooth service for Kilter Boards.
33
+ * This constant is used to identify the specific Bluetooth service for Aurora LED boards.
47
34
  * @type {string}
48
35
  * @static
49
36
  * @readonly
@@ -70,9 +57,20 @@ export declare class KilterBoard extends Device implements IKilterBoard {
70
57
  * @constant
71
58
  */
72
59
  private static readonly maxBluetoothMessageSize;
60
+ private apiLevel;
61
+ private writeQueue;
73
62
  constructor();
74
63
  /**
75
- * Calculates the checksum for a byte array by summing up all bytes ot hre packet in a single-byte variable.
64
+ * Sets the API level from the Aurora board name format:
65
+ * display name, optional #serial, optional trailing @apiLevel. Missing @apiLevel defaults to API level 2.
66
+ * @param name - The name of the device.
67
+ */
68
+ protected setApiLevelFromDeviceName(name?: string | null): void;
69
+ protected onBluetoothDeviceSelected(device: BluetoothDevice): void;
70
+ private getApiLevelFromDeviceName;
71
+ private normalizeApiLevel;
72
+ /**
73
+ * Calculates the checksum for a byte array by summing up all packet-data bytes in a single-byte variable.
76
74
  * @param data - The array of bytes to calculate the checksum for.
77
75
  * @returns {number} The calculated checksum value.
78
76
  */
@@ -84,13 +82,20 @@ export declare class KilterBoard extends Device implements IKilterBoard {
84
82
  */
85
83
  private wrapBytes;
86
84
  /**
87
- * Encodes a position into a byte array.
88
- * The lowest 8 bits of the position get put in the first byte of the group.
89
- * The highest 8 bits of the position get put in the second byte of the group.
85
+ * Encodes an API level 2 position into two bytes.
86
+ * The lowest 8 bits go in the first byte; the highest 2 bits are reserved for the second byte.
90
87
  * @param position - The position to encode.
91
88
  * @returns {number[]} The encoded byte array representing the position.
92
89
  */
93
- private encodePosition;
90
+ private validatePosition;
91
+ private encodePositionV2;
92
+ /**
93
+ * Encodes an API level 3 position into two bytes.
94
+ * The lowest 8 bits go in the first byte; the highest 8 bits go in the second byte.
95
+ * @param position - The position to encode.
96
+ * @returns {number[]} The encoded byte array representing the position.
97
+ */
98
+ private encodePositionV3;
94
99
  /**
95
100
  * Encodes a color string into a numeric representation.
96
101
  * The rgb color, 3 bits for the R and G components, 2 bits for the B component, with the 3 R bits occupying the high end of the byte and the 2 B bits in the low end (hence 3 G bits in the middle).
@@ -98,20 +103,51 @@ export declare class KilterBoard extends Device implements IKilterBoard {
98
103
  * @param color - The color string in hexadecimal format (e.g., 'FFFFFF').
99
104
  * @returns The encoded /compressed color value.
100
105
  */
101
- private encodeColor;
106
+ private encodeColorV3;
107
+ /**
108
+ * Encodes a color string using API level 2's 2-bit RGB format.
109
+ * Format: 0bRRGGBB00. The lowest two bits are reserved for the high bits of the LED position.
110
+ * @param color - The color string in hexadecimal format (e.g., 'FFFFFF').
111
+ * @returns The encoded /compressed color value.
112
+ */
113
+ private encodeColorV2;
114
+ private normalizeColor;
102
115
  /**
103
- * Encodes a placement (requires a 16-bit position and a 24-bit rgb color. ) into a byte array.
116
+ * Encodes an API level 2 placement into two bytes.
117
+ * API level 2 stores a 10-bit position and a 2-bit-per-channel RGB color.
104
118
  * @param position - The position to encode.
105
119
  * @param ledColor - The color of the LED in hexadecimal format (e.g., 'FFFFFF').
106
120
  * @returns The encoded byte array representing the placement.
107
121
  */
108
- private encodePlacement;
122
+ private encodePlacementV2;
109
123
  /**
110
- * Prepares byte arrays for transmission based on a list of climb placements.
111
- * @param {{ position: number; role_id?: number; color?: string }[]} climbPlacementList - The list of climb placements containing position and either role ID or color.
112
- * @returns {number[]} The final byte array ready for transmission.
124
+ * Encodes an API level 3 placement into three bytes.
125
+ * API level 3 stores a 16-bit position and a 3/3/2-bit RGB color.
126
+ * @param position - The position to encode.
127
+ * @param ledColor - The color of the LED in hexadecimal format (e.g., 'FFFFFF').
128
+ * @returns The encoded byte array representing the placement.
129
+ */
130
+ private encodePlacementV3;
131
+ /**
132
+ * Resolves placements into LED positions and concrete hex colors.
133
+ * @param climbPlacementList - The list of climb placements containing position and color.
134
+ * @returns The resolved placements ready for API-level encoding.
135
+ */
136
+ private resolvePlacements;
137
+ private buildPayload;
138
+ /**
139
+ * Prepares API level 2 byte arrays for transmission based on a list of climb placements.
140
+ * @param climbPlacementList - The list of climb placements containing position and color.
141
+ * @returns The final byte array ready for transmission.
142
+ */
143
+ private prepBytesV2;
144
+ /**
145
+ * Prepares API level 3 byte arrays for transmission based on a list of climb placements.
146
+ * @param climbPlacementList - The list of climb placements containing position and color.
147
+ * @returns The final byte array ready for transmission.
113
148
  */
114
149
  private prepBytesV3;
150
+ private prepBytes;
115
151
  /**
116
152
  * Splits a collection into slices of the specified length.
117
153
  * https://github.com/ramda/ramda/blob/master/source/splitEvery
@@ -121,26 +157,32 @@ export declare class KilterBoard extends Device implements IKilterBoard {
121
157
  */
122
158
  private splitEvery;
123
159
  /**
124
- * The kilter board only supports messages of 20 bytes
160
+ * Aurora boards only support messages of 20 bytes
125
161
  * at a time. This method splits a full message into parts
126
162
  * of 20 bytes
127
163
  *
128
164
  * @param buffer
129
165
  */
130
166
  private splitMessages;
167
+ private getWriteCharacteristic;
131
168
  /**
132
169
  * Sends a series of messages to a device.
133
170
  */
134
171
  private writeMessageSeries;
172
+ private queueWrite;
173
+ private writeMessageChunk;
174
+ private canWriteWithoutResponse;
135
175
  /**
136
176
  * Configures the LEDs based on an array of climb placements.
137
- * @param {{ position: number; role_id?: number; color?: string }[]} config - Array of climb placements for the LEDs. Either role_id or color (hex string) must be provided.
138
- * @returns {Promise<number[] | undefined>} A promise that resolves with the payload array for the Kilter Board if LED settings were applied, or `undefined` if no action was taken or for the Motherboard.
139
- */
140
- led: (config: {
141
- position: number;
142
- role_id?: number;
143
- color?: string;
144
- }[]) => Promise<number[] | undefined>;
177
+ * @param config - Array of climb placements for the LEDs. Each placement must include a color hex string.
178
+ * @returns {Promise<number[] | undefined>} A promise that resolves with the payload array for the Aurora board if LED settings were applied, or `undefined` if no action was taken.
179
+ */
180
+ led: (config?: AuroraLedPlacement[]) => Promise<number[] | undefined>;
181
+ }
182
+ /**
183
+ * Aurora Board
184
+ * {@link https://auroraboardapp.com}
185
+ */
186
+ export declare class AuroraBoard extends Aurora implements IAurora {
145
187
  }
146
- //# sourceMappingURL=kilterboard.model.d.ts.map
188
+ //# sourceMappingURL=aurora.model.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"aurora.model.d.ts","sourceRoot":"","sources":["../../../src/models/device/aurora.model.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAA;AAC3C,OAAO,KAAK,EAAE,kBAAkB,EAAE,OAAO,EAAE,MAAM,6CAA6C,CAAA;AAgB9F;;;GAGG;AACH,oBAAY,YAAY;IACtB,oEAAoE;IACpE,SAAS,KAAK;IACd,4FAA4F;IAC5F,QAAQ,KAAA;IACR,+EAA+E;IAC/E,OAAO,KAAA;IACP,8IAA8I;IAC9I,OAAO,KAAA;IACP,oEAAoE;IACpE,SAAS,KAAA;IACT,4FAA4F;IAC5F,QAAQ,KAAA;IACR,+EAA+E;IAC/E,OAAO,KAAA;IACP,8IAA8I;IAC9I,OAAO,KAAA;CACR;AAED;;;;GAIG;AACH,qBAAa,MAAO,SAAQ,MAAO,YAAW,OAAO;IACnD;;;;;;;OAOG;IACH,MAAM,CAAC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAyC;IAE3E;;;;;;;;OAQG;IACH,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,oBAAoB,CAAc;IAE1D;;;;;;;;OAQG;IACH,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,uBAAuB,CAAa;IAE5D,OAAO,CAAC,QAAQ,CAA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
+ /**
3
+ * For API level 2 and API level 3.
4
+ * The first byte in the data is dependent on where the packet is in the message as a whole.
5
+ */
6
+ export var AuroraPacket;
7
+ (function (AuroraPacket) {
8
+ /** If this packet is in the middle, the byte gets set to 77 (M). */
9
+ AuroraPacket[AuroraPacket["V2_MIDDLE"] = 77] = "V2_MIDDLE";
10
+ /** If this packet is the first packet in the message, then this byte gets set to 78 (N). */
11
+ AuroraPacket[AuroraPacket["V2_FIRST"] = 78] = "V2_FIRST";
12
+ /** If this is the last packet in the message, this byte gets set to 79 (O). */
13
+ AuroraPacket[AuroraPacket["V2_LAST"] = 79] = "V2_LAST";
14
+ /** If this packet is the only packet in the message, the byte gets set to 80 (P). Note that this takes priority over the other conditions. */
15
+ AuroraPacket[AuroraPacket["V2_ONLY"] = 80] = "V2_ONLY";
16
+ /** If this packet is in the middle, the byte gets set to 81 (Q). */
17
+ AuroraPacket[AuroraPacket["V3_MIDDLE"] = 81] = "V3_MIDDLE";
18
+ /** If this packet is the first packet in the message, then this byte gets set to 82 (R). */
19
+ AuroraPacket[AuroraPacket["V3_FIRST"] = 82] = "V3_FIRST";
20
+ /** If this is the last packet in the message, this byte gets set to 83 (S). */
21
+ AuroraPacket[AuroraPacket["V3_LAST"] = 83] = "V3_LAST";
22
+ /** If this packet is the only packet in the message, the byte gets set to 84 (T). Note that this takes priority over the other conditions. */
23
+ AuroraPacket[AuroraPacket["V3_ONLY"] = 84] = "V3_ONLY";
24
+ })(AuroraPacket || (AuroraPacket = {}));
25
+ /**
26
+ * Represents a Aurora Climbing device.
27
+ * Aurora Board
28
+ * {@link https://auroraclimbing.com}
29
+ */
30
+ export class Aurora extends Device {
31
+ /**
32
+ * UUID for the Aurora Climbing Advertising service.
33
+ * This constant is used to identify the specific Bluetooth service for Aurora LED boards.
34
+ * @type {string}
35
+ * @static
36
+ * @readonly
37
+ * @constant
38
+ */
39
+ static AuroraUUID = "4488b571-7806-4df6-bcff-a2897e4953ff";
40
+ /**
41
+ * Maximum length of the message body for byte wrapping.
42
+ * This value defines the limit for the size of messages that can be sent or received
43
+ * to ensure proper byte wrapping in communication.
44
+ * @type {number}
45
+ * @private
46
+ * @readonly
47
+ * @constant
48
+ */
49
+ static messageBodyMaxLength = 255;
50
+ /**
51
+ * Maximum length of the Bluetooth message chunk.
52
+ * This value sets the upper limit for the size of individual Bluetooth messages
53
+ * sent to and from the device to comply with Bluetooth protocol constraints.
54
+ * @type {number}
55
+ * @private
56
+ * @readonly
57
+ * @constant
58
+ */
59
+ static maxBluetoothMessageSize = 20;
60
+ apiLevel;
61
+ writeQueue = Promise.resolve();
62
+ constructor() {
63
+ super({
64
+ filters: [
65
+ {
66
+ services: [Aurora.AuroraUUID],
67
+ },
68
+ ],
69
+ services: [
70
+ {
71
+ name: "UART Nordic Service",
72
+ id: "uart",
73
+ uuid: "6e400001-b5a3-f393-e0a9-e50e24dcca9e",
74
+ characteristics: [
75
+ {
76
+ name: "TX",
77
+ id: "tx",
78
+ uuid: "6e400002-b5a3-f393-e0a9-e50e24dcca9e",
79
+ },
80
+ // {
81
+ // name: "RX",
82
+ // id: "rx",
83
+ // uuid: "6e400003-b5a3-f393-e0a9-e50e24dcca9e",
84
+ // },
85
+ ],
86
+ },
87
+ ],
88
+ });
89
+ this.apiLevel = 2;
90
+ }
91
+ /**
92
+ * Sets the API level from the Aurora board name format:
93
+ * display name, optional #serial, optional trailing @apiLevel. Missing @apiLevel defaults to API level 2.
94
+ * @param name - The name of the device.
95
+ */
96
+ setApiLevelFromDeviceName(name) {
97
+ const detectedApiLevel = this.getApiLevelFromDeviceName(name);
98
+ this.apiLevel = detectedApiLevel;
99
+ }
100
+ onBluetoothDeviceSelected(device) {
101
+ this.setApiLevelFromDeviceName(device.name);
102
+ }
103
+ getApiLevelFromDeviceName(name) {
104
+ const apiLevel = name?.match(/@(\d+)$/)?.[1];
105
+ if (apiLevel === undefined) {
106
+ return 2;
107
+ }
108
+ return this.normalizeApiLevel(Number(apiLevel));
109
+ }
110
+ normalizeApiLevel(apiLevel) {
111
+ if (apiLevel !== 2 && apiLevel !== 3) {
112
+ throw new Error(`Unsupported Aurora Board API level: ${apiLevel}`);
113
+ }
114
+ return apiLevel;
115
+ }
116
+ /**
117
+ * Calculates the checksum for a byte array by summing up all packet-data bytes in a single-byte variable.
118
+ * @param data - The array of bytes to calculate the checksum for.
119
+ * @returns {number} The calculated checksum value.
120
+ */
121
+ checksum(data) {
122
+ let i = 0;
123
+ for (const value of data) {
124
+ i = (i + value) & 255;
125
+ }
126
+ return ~i & 255;
127
+ }
128
+ /**
129
+ * Wraps a byte array with header and footer bytes for transmission.
130
+ * @param data - The array of bytes to wrap.
131
+ * @returns {number[]} The wrapped byte array.
132
+ */
133
+ wrapBytes(data) {
134
+ if (data.length > Aurora.messageBodyMaxLength) {
135
+ return [];
136
+ }
137
+ /**
138
+ - 0x1
139
+ - len(packets)
140
+ - checksum(packets)
141
+ - 0x2
142
+ - *packets
143
+ - 0x3
144
+
145
+ First byte is always 1, the second is a number of packets, then checksum, then 2, packets themselves, and finally 3.
146
+ */
147
+ return [1, data.length, this.checksum(data), 2, ...data, 3];
148
+ }
149
+ /**
150
+ * Encodes an API level 2 position into two bytes.
151
+ * The lowest 8 bits go in the first byte; the highest 2 bits are reserved for the second byte.
152
+ * @param position - The position to encode.
153
+ * @returns {number[]} The encoded byte array representing the position.
154
+ */
155
+ validatePosition(position, maxPosition, apiLevel) {
156
+ if (!Number.isInteger(position) || position < 0 || position > maxPosition) {
157
+ throw new Error(`Aurora Board API level ${apiLevel} requires an integer LED position between 0 and ${maxPosition}`);
158
+ }
159
+ }
160
+ encodePositionV2(position) {
161
+ this.validatePosition(position, 0x3ff, 2);
162
+ const position1 = position & 255;
163
+ const position2 = (position & 0x300) >> 8;
164
+ return [position1, position2];
165
+ }
166
+ /**
167
+ * Encodes an API level 3 position into two bytes.
168
+ * The lowest 8 bits go in the first byte; the highest 8 bits go in the second byte.
169
+ * @param position - The position to encode.
170
+ * @returns {number[]} The encoded byte array representing the position.
171
+ */
172
+ encodePositionV3(position) {
173
+ this.validatePosition(position, 0xffff, 3);
174
+ const position1 = position & 255;
175
+ const position2 = (position & 65280) >> 8;
176
+ return [position1, position2];
177
+ }
178
+ /**
179
+ * Encodes a color string into a numeric representation.
180
+ * The rgb color, 3 bits for the R and G components, 2 bits for the B component, with the 3 R bits occupying the high end of the byte and the 2 B bits in the low end (hence 3 G bits in the middle).
181
+ * Format: 0bRRRGGGBB where RRR is 3 bits for red, GGG is 3 bits for green, BB is 2 bits for blue.
182
+ * @param color - The color string in hexadecimal format (e.g., 'FFFFFF').
183
+ * @returns The encoded /compressed color value.
184
+ */
185
+ encodeColorV3(color) {
186
+ const r = parseInt(color.substring(0, 2), 16);
187
+ const g = parseInt(color.substring(2, 4), 16);
188
+ const b = parseInt(color.substring(4, 6), 16);
189
+ // Integer division: R and G divided by 32, B divided by 64
190
+ // Then pack into 0bRRRGGGBB format
191
+ const rBits = Math.floor(r / 32); // 0-7 (3 bits)
192
+ const gBits = Math.floor(g / 32); // 0-7 (3 bits)
193
+ const bBits = Math.floor(b / 64); // 0-3 (2 bits)
194
+ // Pack: RRR in bits 7-5, GGG in bits 4-2, BB in bits 1-0
195
+ return (rBits << 5) | (gBits << 2) | bBits;
196
+ }
197
+ /**
198
+ * Encodes a color string using API level 2's 2-bit RGB format.
199
+ * Format: 0bRRGGBB00. The lowest two bits are reserved for the high bits of the LED position.
200
+ * @param color - The color string in hexadecimal format (e.g., 'FFFFFF').
201
+ * @returns The encoded /compressed color value.
202
+ */
203
+ encodeColorV2(color) {
204
+ const r = parseInt(color.substring(0, 2), 16);
205
+ const g = parseInt(color.substring(2, 4), 16);
206
+ const b = parseInt(color.substring(4, 6), 16);
207
+ const rBits = Math.floor(r / 64); // 0-3 (2 bits)
208
+ const gBits = Math.floor(g / 64); // 0-3 (2 bits)
209
+ const bBits = Math.floor(b / 64); // 0-3 (2 bits)
210
+ return (rBits << 6) | (gBits << 4) | (bBits << 2);
211
+ }
212
+ normalizeColor(color) {
213
+ const colorHex = color.trim().replace(/^#/, "").toUpperCase();
214
+ if (!/^[0-9A-F]{6}$/.test(colorHex)) {
215
+ throw new Error(`Invalid Aurora Board LED color: ${color}`);
216
+ }
217
+ return colorHex;
218
+ }
219
+ /**
220
+ * Encodes an API level 2 placement into two bytes.
221
+ * API level 2 stores a 10-bit position and a 2-bit-per-channel RGB color.
222
+ * @param position - The position to encode.
223
+ * @param ledColor - The color of the LED in hexadecimal format (e.g., 'FFFFFF').
224
+ * @returns The encoded byte array representing the placement.
225
+ */
226
+ encodePlacementV2(position, ledColor) {
227
+ const [position1, position2] = this.encodePositionV2(position);
228
+ return [position1, this.encodeColorV2(ledColor) | position2];
229
+ }
230
+ /**
231
+ * Encodes an API level 3 placement into three bytes.
232
+ * API level 3 stores a 16-bit position and a 3/3/2-bit RGB color.
233
+ * @param position - The position to encode.
234
+ * @param ledColor - The color of the LED in hexadecimal format (e.g., 'FFFFFF').
235
+ * @returns The encoded byte array representing the placement.
236
+ */
237
+ encodePlacementV3(position, ledColor) {
238
+ return [...this.encodePositionV3(position), this.encodeColorV3(ledColor)];
239
+ }
240
+ /**
241
+ * Resolves placements into LED positions and concrete hex colors.
242
+ * @param climbPlacementList - The list of climb placements containing position and color.
243
+ * @returns The resolved placements ready for API-level encoding.
244
+ */
245
+ resolvePlacements(climbPlacementList) {
246
+ return climbPlacementList.flatMap((climbPlacement) => {
247
+ const color = climbPlacement.color?.trim() ?? "";
248
+ if (color === "") {
249
+ return [];
250
+ }
251
+ return [
252
+ {
253
+ position: climbPlacement.position,
254
+ colorHex: this.normalizeColor(color),
255
+ },
256
+ ];
257
+ });
258
+ }
259
+ buildPayload(resolvedPlacements, markers, bytesPerPlacement, encodePlacement) {
260
+ const resultArray = [];
261
+ let tempArray = [markers.middle];
262
+ for (const climbPlacement of resolvedPlacements) {
263
+ if (tempArray.length + bytesPerPlacement > Aurora.messageBodyMaxLength) {
264
+ resultArray.push(tempArray);
265
+ tempArray = [markers.middle];
266
+ }
267
+ const encodedPlacement = encodePlacement(climbPlacement.position, climbPlacement.colorHex);
268
+ tempArray.push(...encodedPlacement);
269
+ }
270
+ resultArray.push(tempArray);
271
+ if (resultArray.length === 1) {
272
+ resultArray[0][0] = markers.only;
273
+ }
274
+ else if (resultArray.length > 1) {
275
+ resultArray[0][0] = markers.first;
276
+ resultArray[resultArray.length - 1][0] = markers.last;
277
+ }
278
+ const finalResultArray = [];
279
+ for (const currentArray of resultArray) {
280
+ finalResultArray.push(...this.wrapBytes(currentArray));
281
+ }
282
+ return finalResultArray;
283
+ }
284
+ /**
285
+ * Prepares API level 2 byte arrays for transmission based on a list of climb placements.
286
+ * @param climbPlacementList - The list of climb placements containing position and color.
287
+ * @returns The final byte array ready for transmission.
288
+ */
289
+ prepBytesV2(climbPlacementList) {
290
+ return this.buildPayload(this.resolvePlacements(climbPlacementList), {
291
+ middle: AuroraPacket.V2_MIDDLE,
292
+ first: AuroraPacket.V2_FIRST,
293
+ last: AuroraPacket.V2_LAST,
294
+ only: AuroraPacket.V2_ONLY,
295
+ }, 2, (position, ledColor) => this.encodePlacementV2(position, ledColor));
296
+ }
297
+ /**
298
+ * Prepares API level 3 byte arrays for transmission based on a list of climb placements.
299
+ * @param climbPlacementList - The list of climb placements containing position and color.
300
+ * @returns The final byte array ready for transmission.
301
+ */
302
+ prepBytesV3(climbPlacementList) {
303
+ return this.buildPayload(this.resolvePlacements(climbPlacementList), {
304
+ middle: AuroraPacket.V3_MIDDLE,
305
+ first: AuroraPacket.V3_FIRST,
306
+ last: AuroraPacket.V3_LAST,
307
+ only: AuroraPacket.V3_ONLY,
308
+ }, 3, (position, ledColor) => this.encodePlacementV3(position, ledColor));
309
+ }
310
+ prepBytes(climbPlacementList, apiLevel) {
311
+ return apiLevel === 2 ? this.prepBytesV2(climbPlacementList) : this.prepBytesV3(climbPlacementList);
312
+ }
313
+ /**
314
+ * Splits a collection into slices of the specified length.
315
+ * https://github.com/ramda/ramda/blob/master/source/splitEvery
316
+ * @param {Number} n
317
+ * @param {Array} list
318
+ * @return {Array<number[]>}
319
+ */
320
+ splitEvery(n, list) {
321
+ if (n <= 0) {
322
+ throw new Error("First argument to splitEvery must be a positive integer");
323
+ }
324
+ const result = [];
325
+ let idx = 0;
326
+ while (idx < list.length) {
327
+ result.push(list.slice(idx, (idx += n)));
328
+ }
329
+ return result;
330
+ }
331
+ /**
332
+ * Aurora boards only support messages of 20 bytes
333
+ * at a time. This method splits a full message into parts
334
+ * of 20 bytes
335
+ *
336
+ * @param buffer
337
+ */
338
+ splitMessages = (buffer) => this.splitEvery(Aurora.maxBluetoothMessageSize, buffer).map((arr) => new Uint8Array(arr));
339
+ getWriteCharacteristic() {
340
+ return this.services.find((service) => service.id === "uart")?.characteristics.find((char) => char.id === "tx")
341
+ ?.characteristic;
342
+ }
343
+ /**
344
+ * Sends a series of messages to a device.
345
+ */
346
+ async writeMessageSeries(characteristic, messages) {
347
+ for (const message of messages) {
348
+ if (!message) {
349
+ continue;
350
+ }
351
+ await this.writeMessageChunk(characteristic, message);
352
+ }
353
+ }
354
+ async queueWrite(operation) {
355
+ const queuedOperation = this.writeQueue.catch(() => undefined).then(operation);
356
+ this.writeQueue = queuedOperation.catch(() => undefined);
357
+ await queuedOperation;
358
+ }
359
+ async writeMessageChunk(characteristic, message) {
360
+ this.updateTimestamp();
361
+ const valueToWrite = new Uint8Array(message);
362
+ if (this.canWriteWithoutResponse(characteristic)) {
363
+ await characteristic.writeValueWithoutResponse(valueToWrite);
364
+ }
365
+ else {
366
+ await characteristic.writeValue(valueToWrite);
367
+ }
368
+ this.writeLast = message;
369
+ }
370
+ canWriteWithoutResponse(characteristic) {
371
+ return (characteristic.properties.writeWithoutResponse !== false &&
372
+ typeof characteristic.writeValueWithoutResponse === "function");
373
+ }
374
+ /**
375
+ * Configures the LEDs based on an array of climb placements.
376
+ * @param config - Array of climb placements for the LEDs. Each placement must include a color hex string.
377
+ * @returns {Promise<number[] | undefined>} A promise that resolves with the payload array for the Aurora board if LED settings were applied, or `undefined` if no action was taken.
378
+ */
379
+ led = async (config = []) => {
380
+ // Handle Aurora LED board logic: process placements and send payload if connected
381
+ if (Array.isArray(config)) {
382
+ // Prepares byte arrays for transmission based on a list of climb placements.
383
+ const payload = this.prepBytes(config, this.apiLevel);
384
+ if (this.isConnected()) {
385
+ const characteristic = this.getWriteCharacteristic();
386
+ if (characteristic) {
387
+ await this.queueWrite(() => this.writeMessageSeries(characteristic, this.splitMessages(payload)));
388
+ }
389
+ }
390
+ return payload;
391
+ }
392
+ return undefined;
393
+ };
394
+ }
395
+ /**
396
+ * Aurora Board
397
+ * {@link https://auroraboardapp.com}
398
+ */
399
+ export class AuroraBoard extends Aurora {
400
+ }
401
+ //# sourceMappingURL=aurora.model.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"aurora.model.js","sourceRoot":"","sources":["../../../src/models/device/aurora.model.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAA;AAiB3C;;;GAGG;AACH,MAAM,CAAN,IAAY,YAiBX;AAjBD,WAAY,YAAY;IACtB,oEAAoE;IACpE,0DAAc,CAAA;IACd,4FAA4F;IAC5F,wDAAQ,CAAA;IACR,+EAA+E;IAC/E,sDAAO,CAAA;IACP,8IAA8I;IAC9I,sDAAO,CAAA;IACP,oEAAoE;IACpE,0DAAS,CAAA;IACT,4FAA4F;IAC5F,wDAAQ,CAAA;IACR,+EAA+E;IAC/E,sDAAO,CAAA;IACP,8IAA8I;IAC9I,sDAAO,CAAA;AACT,CAAC,EAjBW,YAAY,KAAZ,YAAY,QAiBvB;AAED;;;;GAIG;AACH,MAAM,OAAO,MAAO,SAAQ,MAAM;IAChC;;;;;;;OAOG;IACH,MAAM,CAAU,UAAU,GAAW,sCAAsC,CAAA;IAE3E;;;;;;;;OAQG;IACK,MAAM,CAAU,oBAAoB,GAAW,GAAG,CAAA;IAE1D;;;;;;;;OAQG;IACK,MAAM,CAAU,uBAAuB,GAAW,EAAE,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AK,UAAU,CAC/D,CAAA;IACH,CAAC;IAED;;;;OAIG;IACH,GAAG,GAAG,KAAK,EAAE,SAA+B,EAAE,EAAiC,EAAE;QAC/E,kFAAkF;QAClF,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;YAC1B,6EAA6E;YAC7E,MAAM,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAA;YACrD,IAAI,IAAI,CAAC,WAAW,EAAE,EAAE,CAAC;gBACvB,MAAM,cAAc,GAAG,IAAI,CAAC,sBAAsB,EAAE,CAAA;gBACpD,IAAI,cAAc,EAAE,CAAC;oBACnB,MAAM,IAAI,CAAC,UAAU,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,kBAAkB,CAAC,cAAc,EAAE,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,CAAC,CAAA;gBACnG,CAAC;YACH,CAAC;YACD,OAAO,OAAO,CAAA;QAChB,CAAC;QACD,OAAO,SAAS,CAAA;IAClB,CAAC,CAAA;;AAGH;;;GAGG;AACH,MAAM,OAAO,WAAY,SAAQ,MAAM;CAAsB"}
@@ -171,7 +171,7 @@ export class Climbro extends Device {
171
171
  if (value) {
172
172
  this.updateTimestamp();
173
173
  if (value.buffer) {
174
- const buffer = new Uint8Array(value.buffer);
174
+ const buffer = new Uint8Array(value.buffer, value.byteOffset, value.byteLength);
175
175
  const byteCount = buffer.length;
176
176
  let flagSynchro = this.flagSynchro;
177
177
  let forceCount = 0;
@@ -1 +1 @@
1
- {"version":3,"file":"climbro.model.js","sourceRoot":"","sources":["../../../src/models/device/climbro.model.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAA;AAG3C;;GAEG;AACH,IAAK,gBAaJ;AAbD,WAAK,gBAAgB;IACnB;;OAEG;IACH,+DAAc,CAAA;IACd;;OAEG;IACH,iEAAe,CAAA;IACf;;OAEG;IAC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