motion-master-client 0.0.133 → 0.0.134

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "motion-master-client",
3
- "version": "0.0.133",
3
+ "version": "0.0.134",
4
4
  "type": "commonjs",
5
5
  "description": "A library and CLI program used for communicating with Motion Master.",
6
6
  "dependencies": {
package/src/index.d.ts CHANGED
@@ -5,6 +5,7 @@ export * from './lib/device';
5
5
  export * from './lib/device-log-line';
6
6
  export * from './lib/device-parameter';
7
7
  export * from './lib/encoder';
8
+ export * from './lib/firmware';
8
9
  export * from './lib/hardware-description';
9
10
  export * from './lib/integro-variant';
10
11
  export * from './lib/integro-encoder-calibration';
package/src/index.js CHANGED
@@ -8,6 +8,7 @@ tslib_1.__exportStar(require("./lib/device"), exports);
8
8
  tslib_1.__exportStar(require("./lib/device-log-line"), exports);
9
9
  tslib_1.__exportStar(require("./lib/device-parameter"), exports);
10
10
  tslib_1.__exportStar(require("./lib/encoder"), exports);
11
+ tslib_1.__exportStar(require("./lib/firmware"), exports);
11
12
  tslib_1.__exportStar(require("./lib/hardware-description"), exports);
12
13
  tslib_1.__exportStar(require("./lib/integro-variant"), exports);
13
14
  tslib_1.__exportStar(require("./lib/integro-encoder-calibration"), exports);
package/src/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../libs/motion-master-client/src/index.ts"],"names":[],"mappings":";;;AAAA,uDAA6B;AAC7B,4DAAkC;AAClC,gEAAsC;AACtC,uDAA6B;AAC7B,gEAAsC;AACtC,iEAAuC;AACvC,wDAA8B;AAC9B,qEAA2C;AAC3C,gEAAsC;AACtC,4EAAkD;AAClD,kEAAwC;AACxC,iEAAuC;AACvC,qEAA2C;AAC3C,6EAAmD;AACnD,6EAAmD;AACnD,iFAAuD;AACvD,oFAA0D;AAC1D,6EAAmD;AACnD,6EAAmD;AACnD,iFAAuD;AACvD,oFAA0D;AAC1D,0DAAgC;AAChC,wDAA8B;AAC9B,2DAAiC;AACjC,0DAAgC;AAChC,wDAA8B;AAC9B,wEAA8C;AAC9C,oDAA0B;AAC1B,gEAAsC;AACtC,sDAA4B;AAC5B,qDAA2B;AAC3B,qDAA2B;AAC3B,kFAAwD"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../libs/motion-master-client/src/index.ts"],"names":[],"mappings":";;;AAAA,uDAA6B;AAC7B,4DAAkC;AAClC,gEAAsC;AACtC,uDAA6B;AAC7B,gEAAsC;AACtC,iEAAuC;AACvC,wDAA8B;AAC9B,yDAA+B;AAC/B,qEAA2C;AAC3C,gEAAsC;AACtC,4EAAkD;AAClD,kEAAwC;AACxC,iEAAuC;AACvC,qEAA2C;AAC3C,6EAAmD;AACnD,6EAAmD;AACnD,iFAAuD;AACvD,oFAA0D;AAC1D,6EAAmD;AACnD,6EAAmD;AACnD,iFAAuD;AACvD,oFAA0D;AAC1D,0DAAgC;AAChC,wDAA8B;AAC9B,2DAAiC;AACjC,0DAAgC;AAChC,wDAA8B;AAC9B,wEAA8C;AAC9C,oDAA0B;AAC1B,gEAAsC;AACtC,sDAA4B;AAC5B,qDAA2B;AAC3B,qDAA2B;AAC3B,kFAAwD"}
@@ -0,0 +1,168 @@
1
+ /// <reference types="node" />
2
+ import { DeviceComponent, HardwareDescription, StackInfo } from "./hardware-description";
3
+ import { IntegroVariant } from "./integro-variant";
4
+ export declare const firmwareIdRegExp: RegExp;
5
+ export declare const newFirmwarePackageNameRegExp: RegExp;
6
+ export declare const oldFirmwarePackageNameRegExp: RegExp;
7
+ /**
8
+ * New firmware package names are described in section 4.3.3 of the "Hardware Description File Format".
9
+ * For more details, refer to the document at: {@link https://docs.google.com/document/d/1bafY-F8qFMLd0Las8fQFF6H9PTVYFjv01bhV7owqx8E}.
10
+ *
11
+ * @example
12
+ * "package_SOMANET-Servo-Node-400-EtherCAT_9501-01-4622-1_motion-drive_v4.1.0.zip"
13
+ */
14
+ export interface NewFirmwarePackageName {
15
+ /**
16
+ * General format description: "package" refers to the zip bundles used to deliver firmware for SOMANET devices.
17
+ */
18
+ description: string;
19
+ /**
20
+ * Human-readable hardware name, e.g., "SOMANET-Servo-Node-400-EtherCAT".
21
+ */
22
+ hardwareName: string;
23
+ /**
24
+ * {@link FirmwareId}
25
+ */
26
+ firmwareId: string;
27
+ /**
28
+ * Name of the firmware (SOMANET Software).
29
+ *
30
+ * @example
31
+ * "motion-drive"
32
+ */
33
+ firmwareName: string;
34
+ /**
35
+ * Version of the firmware (SOMANET Software).
36
+ *
37
+ * @example
38
+ * "v4.1.0"
39
+ */
40
+ firmwareVersion: string;
41
+ productId: number;
42
+ productVersion: number;
43
+ keyId?: number;
44
+ fieldbusProtocol?: number;
45
+ }
46
+ /**
47
+ * Documentation for old firmware package names is not available.
48
+ *
49
+ * @example
50
+ * "package-motion-drive_ComEtherCAT-b_CoreC2X-a_Drive400-e_v4.2.1.zip"
51
+ */
52
+ export interface OldFirmwarePackageName {
53
+ description: string;
54
+ components: DeviceComponent[];
55
+ firmwareVersion: string;
56
+ }
57
+ /**
58
+ * This is referred to as the Firmware ID (FWID).
59
+ * The firmware ID is composed of:
60
+ * - Product ID, e.g., 9501 (mandatory)
61
+ * - Product Version, e.g., 01 (mandatory)
62
+ * - Key ID, e.g., 4622 (optional)
63
+ * - Fieldbus Protocol, e.g., 1 for EtherCAT (optional)
64
+ *
65
+ * @example
66
+ * "9501-01-4622-1"
67
+ */
68
+ export interface FirmwareId {
69
+ productId: number;
70
+ productVersion: number;
71
+ keyId?: number;
72
+ fieldbusProtocol?: number;
73
+ }
74
+ /**
75
+ * Parses the FWID string and returns an instance of the {@link FirmwareId} object.
76
+ *
77
+ * @throws {Error} Throws an error if the provided FWID does not match the expected pattern.
78
+ */
79
+ export declare function parseFirmwareId(fwid: string): FirmwareId;
80
+ /**
81
+ * The format for new firmware package names is detailed in the "Hardware Description File Format" document.
82
+ */
83
+ export declare function isNewFirmwarePackageName(name: string): boolean;
84
+ /**
85
+ * Documentation for older firmware package names, such as "package-motion-drive_ComEtherCAT-b_CoreC2X-a_Drive400-e_v4.2.1.zip", is unavailable.
86
+ * These package names consist of three hardware components (modules): Com, Core, and Drive.
87
+ * Firmware packages with these older naming conventions are specifically built for legacy SOMANET Node devices.
88
+ */
89
+ export declare function isOldFirmwarePackageName(name: string): boolean;
90
+ /**
91
+ * Parses a new firmware package name and returns an instance of {@link NewFirmwarePackageName}.
92
+ * Returns `undefined` if the name does not match the new firmware package name format.
93
+ *
94
+ * @throws {Error} Throws an error if the provided name does not match the expected pattern.
95
+ */
96
+ export declare function parseNewFirmwarePackageName(name: string): NewFirmwarePackageName;
97
+ /**
98
+ * Given an old firmware package name in the format:
99
+ * "package-motion-drive_ComEtherCAT-b_CoreC2X-a_Drive400-e_v4.2.1.zip",
100
+ * this function extracts the hardware components and returns an array of objects.
101
+ * Each object includes the component name, version, and an empty serial number.
102
+ *
103
+ * This function is useful for determining the compatibility of a firmware package with devices that use an old `stack_info.json` file,
104
+ * which includes only hardware components but lacks a firmware ID. To check if two sets of components match and verify compatibility,
105
+ * use the {@link deviceComponentsMatch} function.
106
+ *
107
+ * @throws {Error} Throws an error if the provided name does not match the expected pattern.
108
+ */
109
+ export declare function extractDeviceComponentsFromOldFirmwarePackageName(name: string): DeviceComponent[];
110
+ /**
111
+ * Parses an old firmware package name and returns an instance of {@link OldFirmwarePackageName}.
112
+ * Returns `undefined` if the name does not match the old firmware package name format.
113
+ *
114
+ * @throws {Error} Throws an error if the provided name does not match the expected pattern.
115
+ */
116
+ export declare function parseOldFirmwarePackageName(name: string): OldFirmwarePackageName;
117
+ /**
118
+ * Type guard to determine if the provided value is a Stack Info object.
119
+ */
120
+ export declare function isStackInfo(value: any): value is StackInfo;
121
+ /**
122
+ * Checks if a firmware package name is compatible with a device based on the provided FWID, Stack Info, or Hardware Description.
123
+ * This function is useful for determining whether a firmware package can be installed on a device.
124
+ *
125
+ * - If you provide Stack Info, use the old firmware package name.
126
+ * - If you provide FWID or Hardware Description, use the new firmware package name.
127
+ *
128
+ * @param name The firmware package name (either old or new).
129
+ * @param id The identifier, which can be FWID, Stack Info, or Hardware Description.
130
+ * @param integroVariant The parsed Integro Variant file or its raw buffer.
131
+ * @returns `true` if the firmware package name is compatible with the device; otherwise, `false`.
132
+ * @throws {Error} Throws an error if an invalid combination is provided, such as FWID with an old firmware package name.
133
+ */
134
+ export declare function isFirmwarePackageNameCompatibleWithDevice(name: string, id: string | StackInfo | HardwareDescription, integroVariant?: Buffer | IntegroVariant): boolean;
135
+ /**
136
+ * Extracts the Firmware ID (FWID) from either the new firmware package name or the provided Hardware Description.
137
+ * The optional Integro Variant is used if the Firmware ID includes the Fieldbus Protocol.
138
+ *
139
+ * Note: If additional options from the Integro Variant are incorporated into the FWID in the future, this code will need to be updated accordingly.
140
+ *
141
+ * Note: When a Hardware Description (HD) is provided, the FWID is assembled as follows:
142
+ * - If no assembly is present in the HD, the ID, version, and key ID are taken from the device.
143
+ * - If an assembly is present, the ID and version are taken from the assembly, while the key ID is still taken from the device.
144
+ * - In all cases, the key ID is sourced from the device.
145
+ *
146
+ * @param sub The new firmware package name or hardware description.
147
+ * @param integroVariant The parsed Integro Variant file or its raw buffer.
148
+ * @throws {Error} If the provided name does not match the expected pattern.
149
+ * @returns The Firmware ID (FWID), e.g., "9501-01-4622-1".
150
+ */
151
+ export declare function extractFirmwareId(sub: string | HardwareDescription, integroVariant?: Buffer | IntegroVariant): string;
152
+ /**
153
+ * Extracts the firmware version from the given firmware package name, whether it's in the old or new format.
154
+ *
155
+ * @example
156
+ * "v4.1.0"
157
+ *
158
+ * @throws {Error} Throws an error if the provided name does not match the expected pattern.
159
+ */
160
+ export declare function extractFirmwareVersionFromFirmwarePackageName(name: string): string;
161
+ /**
162
+ * Older firmware versions for Circulo included a different build to support the Encoder Calibration feature in order to save memory.
163
+ * Newer firmware versions now include the Encoder Calibration feature, so a separate build is no longer necessary.
164
+ *
165
+ * @example
166
+ * "package_SOMANET-Servo-Node-Circulo-7-700_8502-01_motion-drive_v0.4.3-calibration.zip"
167
+ */
168
+ export declare function isFirmwareVersionCalibration(version: string): boolean;
@@ -0,0 +1,229 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isFirmwareVersionCalibration = exports.extractFirmwareVersionFromFirmwarePackageName = exports.extractFirmwareId = exports.isFirmwarePackageNameCompatibleWithDevice = exports.isStackInfo = exports.parseOldFirmwarePackageName = exports.extractDeviceComponentsFromOldFirmwarePackageName = exports.parseNewFirmwarePackageName = exports.isOldFirmwarePackageName = exports.isNewFirmwarePackageName = exports.parseFirmwareId = exports.oldFirmwarePackageNameRegExp = exports.newFirmwarePackageNameRegExp = exports.firmwareIdRegExp = void 0;
4
+ const hardware_description_1 = require("./hardware-description");
5
+ const integro_variant_1 = require("./integro-variant");
6
+ exports.firmwareIdRegExp = /^\d{4}-\d{2}(-\d{4})?(-\d{1})?$/;
7
+ exports.newFirmwarePackageNameRegExp = /^package_[^_]+_\d{4}-\d{2}(-\d{4})?(-\d{1})?_([^_]+)_v[\w.-]+\.zip$/;
8
+ exports.oldFirmwarePackageNameRegExp = /^package-motion-drive_[^_]+(?:_[^_]+)*_v[\w.-]+\.zip$/;
9
+ /**
10
+ * Parses the FWID string and returns an instance of the {@link FirmwareId} object.
11
+ *
12
+ * @throws {Error} Throws an error if the provided FWID does not match the expected pattern.
13
+ */
14
+ function parseFirmwareId(fwid) {
15
+ if (!exports.firmwareIdRegExp.test(fwid)) {
16
+ throw new Error(`The provided FWID "${fwid}" does not match the expected pattern.`);
17
+ }
18
+ const [productId, productVersion, keyId, fieldbusProtocol] = fwid.split('-').map(part => parseInt(part));
19
+ return { productId, productVersion, keyId, fieldbusProtocol };
20
+ }
21
+ exports.parseFirmwareId = parseFirmwareId;
22
+ /**
23
+ * The format for new firmware package names is detailed in the "Hardware Description File Format" document.
24
+ */
25
+ function isNewFirmwarePackageName(name) {
26
+ return exports.newFirmwarePackageNameRegExp.test(name);
27
+ }
28
+ exports.isNewFirmwarePackageName = isNewFirmwarePackageName;
29
+ /**
30
+ * Documentation for older firmware package names, such as "package-motion-drive_ComEtherCAT-b_CoreC2X-a_Drive400-e_v4.2.1.zip", is unavailable.
31
+ * These package names consist of three hardware components (modules): Com, Core, and Drive.
32
+ * Firmware packages with these older naming conventions are specifically built for legacy SOMANET Node devices.
33
+ */
34
+ function isOldFirmwarePackageName(name) {
35
+ return exports.oldFirmwarePackageNameRegExp.test(name);
36
+ }
37
+ exports.isOldFirmwarePackageName = isOldFirmwarePackageName;
38
+ /**
39
+ * Parses a new firmware package name and returns an instance of {@link NewFirmwarePackageName}.
40
+ * Returns `undefined` if the name does not match the new firmware package name format.
41
+ *
42
+ * @throws {Error} Throws an error if the provided name does not match the expected pattern.
43
+ */
44
+ function parseNewFirmwarePackageName(name) {
45
+ if (!isNewFirmwarePackageName(name)) {
46
+ throw new Error(`The provided name "${name}" does not match the expected pattern.`);
47
+ }
48
+ const nameNoExt = name.replace(/\.[^/.]+$/, "");
49
+ const [description, hardwareName, firmwareId, firmwareName, firmwareVersion] = nameNoExt.split('_');
50
+ return Object.assign({ description,
51
+ hardwareName,
52
+ firmwareId,
53
+ firmwareName,
54
+ firmwareVersion }, (parseFirmwareId(firmwareId)));
55
+ }
56
+ exports.parseNewFirmwarePackageName = parseNewFirmwarePackageName;
57
+ /**
58
+ * Given an old firmware package name in the format:
59
+ * "package-motion-drive_ComEtherCAT-b_CoreC2X-a_Drive400-e_v4.2.1.zip",
60
+ * this function extracts the hardware components and returns an array of objects.
61
+ * Each object includes the component name, version, and an empty serial number.
62
+ *
63
+ * This function is useful for determining the compatibility of a firmware package with devices that use an old `stack_info.json` file,
64
+ * which includes only hardware components but lacks a firmware ID. To check if two sets of components match and verify compatibility,
65
+ * use the {@link deviceComponentsMatch} function.
66
+ *
67
+ * @throws {Error} Throws an error if the provided name does not match the expected pattern.
68
+ */
69
+ function extractDeviceComponentsFromOldFirmwarePackageName(name) {
70
+ if (!isOldFirmwarePackageName(name)) {
71
+ throw new Error(`The provided name "${name}" does not match the expected pattern.`);
72
+ }
73
+ if (name.match(/_Com[^_]+_Core[^_]+_Drive/g)) {
74
+ return name
75
+ .split('_')
76
+ .slice(1, 4)
77
+ .map((b) => {
78
+ const p = b.split('-'); // p = ['ComEtherCAT', 'b']
79
+ return {
80
+ name: p[0],
81
+ serialNumber: '',
82
+ version: p[1],
83
+ };
84
+ });
85
+ }
86
+ return [];
87
+ }
88
+ exports.extractDeviceComponentsFromOldFirmwarePackageName = extractDeviceComponentsFromOldFirmwarePackageName;
89
+ /**
90
+ * Parses an old firmware package name and returns an instance of {@link OldFirmwarePackageName}.
91
+ * Returns `undefined` if the name does not match the old firmware package name format.
92
+ *
93
+ * @throws {Error} Throws an error if the provided name does not match the expected pattern.
94
+ */
95
+ function parseOldFirmwarePackageName(name) {
96
+ var _a, _b;
97
+ if (!isOldFirmwarePackageName(name)) {
98
+ throw new Error(`The provided name "${name}" does not match the expected pattern.`);
99
+ }
100
+ const parts = name.split('_');
101
+ const components = extractDeviceComponentsFromOldFirmwarePackageName(name);
102
+ return {
103
+ description: parts[0],
104
+ components,
105
+ firmwareVersion: (_b = (_a = parts === null || parts === void 0 ? void 0 : parts.at(-1)) === null || _a === void 0 ? void 0 : _a.replace('.zip', '')) !== null && _b !== void 0 ? _b : '',
106
+ };
107
+ }
108
+ exports.parseOldFirmwarePackageName = parseOldFirmwarePackageName;
109
+ /**
110
+ * Type guard to determine if the provided value is a Stack Info object.
111
+ */
112
+ function isStackInfo(value) {
113
+ return Array.isArray(value === null || value === void 0 ? void 0 : value.boards);
114
+ }
115
+ exports.isStackInfo = isStackInfo;
116
+ /**
117
+ * Checks if a firmware package name is compatible with a device based on the provided FWID, Stack Info, or Hardware Description.
118
+ * This function is useful for determining whether a firmware package can be installed on a device.
119
+ *
120
+ * - If you provide Stack Info, use the old firmware package name.
121
+ * - If you provide FWID or Hardware Description, use the new firmware package name.
122
+ *
123
+ * @param name The firmware package name (either old or new).
124
+ * @param id The identifier, which can be FWID, Stack Info, or Hardware Description.
125
+ * @param integroVariant The parsed Integro Variant file or its raw buffer.
126
+ * @returns `true` if the firmware package name is compatible with the device; otherwise, `false`.
127
+ * @throws {Error} Throws an error if an invalid combination is provided, such as FWID with an old firmware package name.
128
+ */
129
+ function isFirmwarePackageNameCompatibleWithDevice(name, id, integroVariant) {
130
+ if (isOldFirmwarePackageName(name) && !isStackInfo(id)) {
131
+ throw new Error('The old firmware package name must be checked against the Stack Info to verify compatibility.');
132
+ }
133
+ if (isNewFirmwarePackageName(name) && isStackInfo(id)) {
134
+ throw new Error('The new firmware package name must be checked against the FWID or Hardware Description to verify compatibility.');
135
+ }
136
+ if (typeof id === 'string') {
137
+ return id === extractFirmwareId(name);
138
+ }
139
+ else if (isStackInfo(id)) {
140
+ const firmwarePackageNameDeviceComponents = extractDeviceComponentsFromOldFirmwarePackageName(name);
141
+ const stackInfoDeviceComponents = (0, hardware_description_1.extractDeviceComponentsFromStackInfo)(id);
142
+ return (0, hardware_description_1.deviceComponentsMatch)(firmwarePackageNameDeviceComponents, stackInfoDeviceComponents);
143
+ }
144
+ else {
145
+ const firmwarePackageNameFirmwareId = extractFirmwareId(name);
146
+ const hardwareDescriptionFirmwareId = extractFirmwareId(id, integroVariant);
147
+ return firmwarePackageNameFirmwareId === hardwareDescriptionFirmwareId;
148
+ }
149
+ }
150
+ exports.isFirmwarePackageNameCompatibleWithDevice = isFirmwarePackageNameCompatibleWithDevice;
151
+ /**
152
+ * Extracts the Firmware ID (FWID) from either the new firmware package name or the provided Hardware Description.
153
+ * The optional Integro Variant is used if the Firmware ID includes the Fieldbus Protocol.
154
+ *
155
+ * Note: If additional options from the Integro Variant are incorporated into the FWID in the future, this code will need to be updated accordingly.
156
+ *
157
+ * Note: When a Hardware Description (HD) is provided, the FWID is assembled as follows:
158
+ * - If no assembly is present in the HD, the ID, version, and key ID are taken from the device.
159
+ * - If an assembly is present, the ID and version are taken from the assembly, while the key ID is still taken from the device.
160
+ * - In all cases, the key ID is sourced from the device.
161
+ *
162
+ * @param sub The new firmware package name or hardware description.
163
+ * @param integroVariant The parsed Integro Variant file or its raw buffer.
164
+ * @throws {Error} If the provided name does not match the expected pattern.
165
+ * @returns The Firmware ID (FWID), e.g., "9501-01-4622-1".
166
+ */
167
+ function extractFirmwareId(sub, integroVariant) {
168
+ if (typeof sub === 'string') {
169
+ if (isNewFirmwarePackageName(sub)) {
170
+ const obj = parseNewFirmwarePackageName(sub);
171
+ return obj === null || obj === void 0 ? void 0 : obj.firmwareId;
172
+ }
173
+ else {
174
+ throw new Error(`The provided name "${sub}" does not match the expected pattern.`);
175
+ }
176
+ }
177
+ else {
178
+ let fwid = sub.assembly
179
+ ? `${sub.assembly.id}-${sub.assembly.version}`
180
+ : `${sub.device.id}-${sub.device.version}`;
181
+ if (sub.device.keyId) {
182
+ fwid += `-${sub.device.keyId}`;
183
+ }
184
+ if (integroVariant) {
185
+ if (integroVariant instanceof Buffer) {
186
+ integroVariant = (0, integro_variant_1.parseIntegroVariantBuffer)(integroVariant);
187
+ }
188
+ const fieldbusProtocol = integroVariant.selectedOptionId['fieldbusProtocol'];
189
+ fwid += `-${fieldbusProtocol}`;
190
+ }
191
+ return fwid;
192
+ }
193
+ }
194
+ exports.extractFirmwareId = extractFirmwareId;
195
+ /**
196
+ * Extracts the firmware version from the given firmware package name, whether it's in the old or new format.
197
+ *
198
+ * @example
199
+ * "v4.1.0"
200
+ *
201
+ * @throws {Error} Throws an error if the provided name does not match the expected pattern.
202
+ */
203
+ function extractFirmwareVersionFromFirmwarePackageName(name) {
204
+ if (isNewFirmwarePackageName(name)) {
205
+ const parsed = parseNewFirmwarePackageName(name);
206
+ return parsed.firmwareVersion;
207
+ }
208
+ else if (isOldFirmwarePackageName(name)) {
209
+ const parsed = parseOldFirmwarePackageName(name);
210
+ return parsed.firmwareVersion;
211
+ }
212
+ else {
213
+ throw new Error(`The provided name "${name}" does not match the expected pattern.`);
214
+ }
215
+ }
216
+ exports.extractFirmwareVersionFromFirmwarePackageName = extractFirmwareVersionFromFirmwarePackageName;
217
+ /**
218
+ * Older firmware versions for Circulo included a different build to support the Encoder Calibration feature in order to save memory.
219
+ * Newer firmware versions now include the Encoder Calibration feature, so a separate build is no longer necessary.
220
+ *
221
+ * @example
222
+ * "package_SOMANET-Servo-Node-Circulo-7-700_8502-01_motion-drive_v0.4.3-calibration.zip"
223
+ */
224
+ function isFirmwareVersionCalibration(version) {
225
+ var _a;
226
+ return (_a = version.includes('calibration')) !== null && _a !== void 0 ? _a : false;
227
+ }
228
+ exports.isFirmwareVersionCalibration = isFirmwareVersionCalibration;
229
+ //# sourceMappingURL=firmware.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"firmware.js","sourceRoot":"","sources":["../../../../../libs/motion-master-client/src/lib/firmware.ts"],"names":[],"mappings":";;;AAAA,iEAAsJ;AACtJ,uDAA8E;AAEjE,QAAA,gBAAgB,GAAG,iCAAiC,CAAC;AACrD,QAAA,4BAA4B,GAAG,qEAAqE,CAAC;AACrG,QAAA,4BAA4B,GAAG,uDAAuD,CAAC;AA6EpG;;;;GAIG;AACH,SAAgB,eAAe,CAAC,IAAY;IAC1C,IAAI,CAAC,wBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;QAChC,MAAM,IAAI,KAAK,CAAC,sBAAsB,IAAI,wCAAwC,CAAC,CAAC;KACrF;IACD,MAAM,CAAC,SAAS,EAAE,cAAc,EAAE,KAAK,EAAE,gBAAgB,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC;IACzG,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,KAAK,EAAE,gBAAgB,EAAE,CAAC;AAChE,CAAC;AAND,0CAMC;AAED;;GAEG;AACH,SAAgB,wBAAwB,CAAC,IAA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CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;SAChC;QAED,IAAI,cAAc,EAAE;YAClB,IAAI,cAAc,YAAY,MAAM,EAAE;gBACpC,cAAc,GAAG,IAAA,2CAAyB,EAAC,cAAc,CAAC,CAAC;aAC5D;YACD,MAAM,gBAAgB,GAAG,cAAc,CAAC,gBAAgB,CAAC,kBAAkB,CAAC,CAAC;YAC7E,IAAI,IAAI,IAAI,gBAAgB,EAAE,CAAC;SAChC;QAED,OAAO,IAAI,CAAC;KACb;AACH,CAAC;AA3BD,8CA2BC;AAED;;;;;;;GAOG;AACH,SAAgB,6CAA6C,CAAC,IAAY;IACxE,IAAI,wBAAwB,CAAC,IAAI,CAAC,EAAE;QAClC,MAAM,MAAM,GAAG,2BAA2B,CAAC,IAAI,CAAC,CAAC;QACjD,OAAO,MAAM,CAAC,eAAe,CAAC;KAC/B;SAAM,IAAI,wBAAwB,CAAC,IAAI,CAAC,EAAE;QACzC,MAAM,MAAM,GAAG,2BAA2B,CAAC,IAAI,CAAC,CAAC;QACjD,OAAO,MAAM,CAAC,eAAe,CAAC;KAC/B;SAAM;QACL,MAAM,IAAI,KAAK,CAAC,sBAAsB,IAAI,wCAAwC,CAAC,CAAC;KACrF;AACH,CAAC;AAVD,sGAUC;AAED;;;;;;GAMG;AACH,SAAgB,4BAA4B,CAAC,OAAe;;IAC1D,OAAO,MAAA,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAC,mCAAI,KAAK,CAAC;AAClD,CAAC;AAFD,oEAEC"}
@@ -22,14 +22,13 @@ export interface HardwareDevice {
22
22
  components: DeviceComponent[];
23
23
  }
24
24
  /**
25
- * @link https://docs.google.com/document/d/1N00-ZjxHkjoWNIsnoTtza9CUHrxm8-e54298DXLuD94
25
+ * @link https://docs.google.com/document/d/1bafY-F8qFMLd0Las8fQFF6H9PTVYFjv01bhV7owqx8E
26
26
  */
27
27
  export interface HardwareDescription {
28
28
  fileVersion: string;
29
29
  assembly?: Assembly;
30
30
  device: HardwareDevice;
31
31
  }
32
- export declare function getIdFromHardwareDescription(hd: HardwareDescription): string;
33
32
  /**
34
33
  * Constructs the API ID from the hardware description file.
35
34
  * The API ID is a combination of the assembly or device ID, version, and optionally a Key ID, which is used for encrypting firmware binaries.
@@ -42,22 +41,44 @@ export declare function getApiIdentifierFromHardwareDescription(hd: HardwareDesc
42
41
  export declare function getNameFromHardwareDescription(hd: HardwareDescription): string;
43
42
  export declare function getSerialNumberFromHardwareDescription(hd: HardwareDescription): string;
44
43
  export declare function getAllComponentsFromHardwareDescription(hd: HardwareDescription): HardwareComponent[];
45
- export declare function hardwareComponentsMatch(a: HardwareComponent[], b: HardwareComponent[]): boolean;
46
- export declare function isHardwareDescriptionCompatibleWithPackageFilename(hardwareDescription: HardwareDescription, packageFilename: string): boolean;
47
- export declare function getHardwareComponentsFromPackageFilename(packageFilename: string): HardwareComponent[];
48
- export declare function getVersionFromPackageFilename(packageFilename: string): string | undefined;
49
- export declare function getApiIdentifierFromPackageFilename(packageFilename: string): string | undefined;
44
+ /**
45
+ * Verifies if two sets of device components are identical.
46
+ * Both sets must contain the same number of components, and each component must match by name and version.
47
+ */
48
+ export declare function deviceComponentsMatch(a: DeviceComponent[], b: DeviceComponent[]): boolean;
50
49
  /**
51
50
  * This template is to be used in cases where hardware description file is not available on a device.
52
51
  * It is imperative to replace the serial number with a unique identifier.
53
52
  */
54
53
  export declare const dummyHardwareDescriptionFileContentTemplate: HardwareDescription;
55
54
  export declare const serialNumberPattern: RegExp;
56
- export interface SerialNumberPart {
55
+ export interface SerialNumber {
57
56
  productId: string;
58
57
  revision: string;
59
58
  apiId: string;
60
59
  consecutiveNumber: string;
61
60
  productionWeek: string;
62
61
  }
63
- export declare function parseSerialNumber(serialNumber: string): SerialNumberPart;
62
+ /**
63
+ * Parses a serial number and returns an instance of {@link SerialNumber}.
64
+ *
65
+ * @throws {Error} Throws an error if the provided serial number does not match the expected pattern.
66
+ */
67
+ export declare function parseSerialNumber(serialNumber: string): SerialNumber;
68
+ export interface Board {
69
+ description?: string;
70
+ serial_number?: string;
71
+ device_serial_number?: string;
72
+ revision?: string;
73
+ version?: string;
74
+ }
75
+ export interface StackInfo {
76
+ mac_address: number;
77
+ stack_serial_number: string;
78
+ boards: Board[];
79
+ }
80
+ /**
81
+ * Extracts device components from the provided Stack Info.
82
+ * The Stack Info typically includes three components: Com, Core, and Drive, each with a name, serial number, and version.
83
+ */
84
+ export declare function extractDeviceComponentsFromStackInfo(stackInfo: StackInfo): DeviceComponent[];
@@ -1,15 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.parseSerialNumber = exports.serialNumberPattern = exports.dummyHardwareDescriptionFileContentTemplate = exports.getApiIdentifierFromPackageFilename = exports.getVersionFromPackageFilename = exports.getHardwareComponentsFromPackageFilename = exports.isHardwareDescriptionCompatibleWithPackageFilename = exports.hardwareComponentsMatch = exports.getAllComponentsFromHardwareDescription = exports.getSerialNumberFromHardwareDescription = exports.getNameFromHardwareDescription = exports.getApiIdentifierFromHardwareDescription = exports.getIdFromHardwareDescription = void 0;
4
- const tslib_1 = require("tslib");
3
+ exports.extractDeviceComponentsFromStackInfo = exports.parseSerialNumber = exports.serialNumberPattern = exports.dummyHardwareDescriptionFileContentTemplate = exports.deviceComponentsMatch = exports.getAllComponentsFromHardwareDescription = exports.getSerialNumberFromHardwareDescription = exports.getNameFromHardwareDescription = exports.getApiIdentifierFromHardwareDescription = void 0;
5
4
  const lodash_1 = require("lodash");
6
- const semver_1 = tslib_1.__importDefault(require("semver"));
7
- function getIdFromHardwareDescription(hd) {
8
- return hd.assembly
9
- ? hd.assembly.id
10
- : hd.device.id;
11
- }
12
- exports.getIdFromHardwareDescription = getIdFromHardwareDescription;
13
5
  /**
14
6
  * Constructs the API ID from the hardware description file.
15
7
  * The API ID is a combination of the assembly or device ID, version, and optionally a Key ID, which is used for encrypting firmware binaries.
@@ -46,7 +38,11 @@ function getAllComponentsFromHardwareDescription(hd) {
46
38
  : hd.device.components;
47
39
  }
48
40
  exports.getAllComponentsFromHardwareDescription = getAllComponentsFromHardwareDescription;
49
- function hardwareComponentsMatch(a, b) {
41
+ /**
42
+ * Verifies if two sets of device components are identical.
43
+ * Both sets must contain the same number of components, and each component must match by name and version.
44
+ */
45
+ function deviceComponentsMatch(a, b) {
50
46
  if (a.length === 0 && b.length === 0) {
51
47
  return false; // edge case: when both components are empty they don't match since there are no components to compare
52
48
  }
@@ -54,52 +50,7 @@ function hardwareComponentsMatch(a, b) {
54
50
  const bc = b.map((c) => `${c.name}-${c.version[0]}`.replace(/\s/g, '').toLocaleLowerCase()).sort();
55
51
  return (0, lodash_1.isEqual)(ac, bc);
56
52
  }
57
- exports.hardwareComponentsMatch = hardwareComponentsMatch;
58
- function isHardwareDescriptionCompatibleWithPackageFilename(hardwareDescription, packageFilename) {
59
- const hdApiId = getApiIdentifierFromHardwareDescription(hardwareDescription);
60
- const pfApiId = getApiIdentifierFromPackageFilename(packageFilename);
61
- if (hdApiId && pfApiId) {
62
- return hdApiId === pfApiId;
63
- }
64
- else {
65
- const pfComponents = getHardwareComponentsFromPackageFilename(packageFilename);
66
- const hdComponents = getAllComponentsFromHardwareDescription(hardwareDescription);
67
- return hardwareComponentsMatch(pfComponents, hdComponents);
68
- }
69
- }
70
- exports.isHardwareDescriptionCompatibleWithPackageFilename = isHardwareDescriptionCompatibleWithPackageFilename;
71
- function getHardwareComponentsFromPackageFilename(packageFilename) {
72
- if (packageFilename.match(/_Com[^_]+_Core[^_]+_Drive/g)) {
73
- return packageFilename.split('_').slice(1, 4).map((b) => {
74
- const p = b.split('-'); // ['ComEtherCAT', 'b']
75
- return {
76
- name: p[0],
77
- serialNumber: '',
78
- version: p[1],
79
- };
80
- });
81
- }
82
- else {
83
- // not all package filenames have components,
84
- // e.g. 'package_SOMANET-Servo-Node-Circulo-1800_circulo1800_motion-drive_v4.2.0-beta.5.zip'
85
- return [];
86
- }
87
- }
88
- exports.getHardwareComponentsFromPackageFilename = getHardwareComponentsFromPackageFilename;
89
- function getVersionFromPackageFilename(packageFilename) {
90
- const parts = packageFilename.split('_');
91
- const version = parts[parts.length - 1].replace(/\.zip$/, '').split(/\s+/)[0];
92
- return semver_1.default.valid(version) ? version : undefined;
93
- }
94
- exports.getVersionFromPackageFilename = getVersionFromPackageFilename;
95
- function getApiIdentifierFromPackageFilename(packageFilename) {
96
- if (packageFilename.match(/_Com[^_]+_Core[^_]+_Drive/g)) {
97
- return undefined;
98
- }
99
- const [, , apiIdentifier] = packageFilename.split('_');
100
- return apiIdentifier;
101
- }
102
- exports.getApiIdentifierFromPackageFilename = getApiIdentifierFromPackageFilename;
53
+ exports.deviceComponentsMatch = deviceComponentsMatch;
103
54
  /**
104
55
  * This template is to be used in cases where hardware description file is not available on a device.
105
56
  * It is imperative to replace the serial number with a unique identifier.
@@ -118,13 +69,33 @@ exports.dummyHardwareDescriptionFileContentTemplate = {
118
69
  };
119
70
  exports.serialNumberPattern = /\d{4}-\d{2}-\d{7,8}-\d{4}/;
120
71
  ;
72
+ /**
73
+ * Parses a serial number and returns an instance of {@link SerialNumber}.
74
+ *
75
+ * @throws {Error} Throws an error if the provided serial number does not match the expected pattern.
76
+ */
121
77
  function parseSerialNumber(serialNumber) {
122
78
  if (!exports.serialNumberPattern.test(serialNumber)) {
123
- throw new Error('The provided string is not a serial number.');
79
+ throw new Error('The provided string is not a valid serial number.');
124
80
  }
125
81
  const [productId, revision, consecutiveNumber, productionWeek] = serialNumber.split('-');
126
82
  const apiId = `${productId}-${revision}`;
127
83
  return { productId, revision, apiId, consecutiveNumber, productionWeek };
128
84
  }
129
85
  exports.parseSerialNumber = parseSerialNumber;
86
+ /**
87
+ * Extracts device components from the provided Stack Info.
88
+ * The Stack Info typically includes three components: Com, Core, and Drive, each with a name, serial number, and version.
89
+ */
90
+ function extractDeviceComponentsFromStackInfo(stackInfo) {
91
+ return stackInfo.boards.map((board) => {
92
+ var _a, _b, _c;
93
+ return ({
94
+ name: (_a = board.description) !== null && _a !== void 0 ? _a : '',
95
+ serialNumber: (_b = board.serial_number) !== null && _b !== void 0 ? _b : '',
96
+ version: (_c = (board.revision || board.version)) !== null && _c !== void 0 ? _c : '',
97
+ });
98
+ });
99
+ }
100
+ exports.extractDeviceComponentsFromStackInfo = extractDeviceComponentsFromStackInfo;
130
101
  //# sourceMappingURL=hardware-description.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"hardware-description.js","sourceRoot":"","sources":["../../../../../libs/motion-master-client/src/lib/hardware-description.ts"],"names":[],"mappings":";;;;AAAA,mCAAiC;AACjC,4DAA4B;AAsC5B,SAAgB,4BAA4B,CAAC,EAAuB;IAClE,OAAO,EAAE,CAAC,QAAQ;QAChB,CAAC,CAAC,EAAE,CAAC,QAAQ,CAAC,EAAE;QAChB,CAAC,CAAC,EAAE,CAAC,MAAM,CAAC,EAAE,CAAC;AACnB,CAAC;AAJD,oEAIC;AAED;;;;;;;GAOG;AACH,SAAgB,uCAAuC,CAAC,EAAuB,EAAE,SAAS,GAAG,KAAK;IAChG,IAAI,KAAK,GAAG,EAAE,CAAC,QAAQ;QACrB,CAAC,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,CAAC,QAAQ,CAAC,OAAO,EAAE;QAC5C,CAAC,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;IAE3C,IAAI,CAAC,SAAS,IAAI,EAAE,CAAC,MAAM,CAAC,KAAK,EAAE;QACjC,KAAK,IAAI,IAAI,EAAE,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;KAChC;IAED,OAAO,KAAK,CAAC;AACf,CAAC;AAVD,0FAUC;AAED,SAAgB,8BAA8B,CAAC,EAAuB;IACpE,OAAO,EAAE,CAAC,QAAQ;QAChB,CAAC,CAAC,EAAE,CAAC,QAAQ,CAAC,IAAI;QAClB,CAAC,CAAC,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC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