motion-master-client 0.0.418 → 0.0.420

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.418",
3
+ "version": "0.0.420",
4
4
  "type": "commonjs",
5
5
  "description": "A library and CLI program used for communicating with Motion Master.",
6
6
  "dependencies": {
package/src/api.js CHANGED
@@ -1048,70 +1048,68 @@ app.get('/api/devices/:deviceRef/force-on-demand-parameters-update', asyncHandle
1048
1048
  res.send();
1049
1049
  })));
1050
1050
  app.get('/api/devices/:deviceRef/start-circulo-encoder-narrow-angle-calibration', asyncHandler((req, res) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
1051
- var _74, _75, _76;
1051
+ var _74, _75, _76, _77, _78;
1052
1052
  const deviceRef = (0, device_1.ensureDeviceRef)(req.params['deviceRef']);
1053
1053
  const deviceRefObj = (0, device_1.makeDeviceRefObj)(deviceRef);
1054
1054
  const encoderOrdinal = parseInt(((_74 = req.query['encoder-ordinal']) !== null && _74 !== void 0 ? _74 : '1'));
1055
1055
  const activateHealthMonitoring = asBoolean(req.query['activate-health-monitoring']);
1056
1056
  const measurementOnly = asBoolean(req.query['measurement-only']);
1057
1057
  const externalEncoderType = parseInt(((_75 = req.query['external-encoder-type']) !== null && _75 !== void 0 ? _75 : '0'));
1058
- const requestTimeout = parseInt(((_76 = req.query['request-timeout']) !== null && _76 !== void 0 ? _76 : '120000'));
1058
+ const requestTimeout = parseInt(((_76 = req.query['request-timeout']) !== null && _76 !== void 0 ? _76 : '600000'));
1059
1059
  const statuses = yield (0, rxjs_1.lastValueFrom)(client.request
1060
1060
  .startCirculoEncoderNarrowAngleCalibrationProcedure(Object.assign(Object.assign({}, deviceRefObj), { encoderOrdinal, activateHealthMonitoring, measurementOnly, externalEncoderType }), requestTimeout)
1061
1061
  .pipe((0, rxjs_1.toArray)()));
1062
- let result = [];
1063
- statuses.forEach((status) => {
1062
+ // One entry per calibration iteration. Only the iteration flagged `final` measures an already
1063
+ // calibrated encoder; the earlier ones measure an encoder that is still being calibrated, so
1064
+ // their percentage is not the quality of the calibration.
1065
+ const result = statuses.reduce((acc, status) => {
1064
1066
  var _a, _b, _c;
1065
- if (((_a = status === null || status === void 0 ? void 0 : status.progress) === null || _a === void 0 ? void 0 : _a.position) && ((_b = status === null || status === void 0 ? void 0 : status.progress) === null || _b === void 0 ? void 0 : _b.phaseError)) {
1066
- const data = status.progress.position
1067
- .map((p, i) => {
1068
- var _a;
1069
- const phaseError = (_a = status.progress) === null || _a === void 0 ? void 0 : _a.phaseError[i];
1070
- if (typeof p === 'number' && typeof phaseError === 'number') {
1071
- return [p, phaseError];
1072
- }
1073
- return undefined;
1074
- })
1075
- .filter((pt) => Array.isArray(pt));
1076
- let maxIndex = 0;
1077
- data.forEach((point, i) => {
1078
- if (Math.abs(point[1]) > Math.abs(data[maxIndex][1])) {
1079
- maxIndex = i;
1080
- }
1081
- });
1082
- const maxValue = (_c = data[maxIndex]) === null || _c === void 0 ? void 0 : _c[1];
1083
- const yDomainLimit = 256;
1084
- let maxValuePercentage = 0;
1085
- if (maxValue !== undefined) {
1086
- maxValuePercentage = 100 - Math.floor((Math.abs(maxValue) / yDomainLimit) * 100);
1087
- maxValuePercentage = Math.max(maxValuePercentage, 0);
1088
- }
1089
- const meaning = (0, circulo_1.getCirculoEncoderCalibrationMaxValuePercentageLabel)(maxValuePercentage);
1090
- result.push({
1091
- data,
1067
+ const computed = (0, circulo_1.computeCirculoEncoderCalibrationProgressResult)(status.progress);
1068
+ if (computed) {
1069
+ acc.push({
1070
+ iteration: (_b = (_a = status.progress) === null || _a === void 0 ? void 0 : _a.iteration) !== null && _b !== void 0 ? _b : 0,
1071
+ final: ((_c = status.progress) === null || _c === void 0 ? void 0 : _c.final) === true,
1072
+ data: computed.data,
1092
1073
  result: {
1093
- value: maxValuePercentage,
1094
- meaning,
1074
+ value: computed.value,
1075
+ meaning: computed.meaning,
1076
+ maxPermissiblePhaseError: computed.maxPermissiblePhaseError,
1095
1077
  },
1096
1078
  });
1097
1079
  }
1098
- });
1080
+ return acc;
1081
+ }, []);
1099
1082
  const finalStatus = statuses.at(-1);
1100
1083
  if ((finalStatus === null || finalStatus === void 0 ? void 0 : finalStatus.request) === 'succeeded') {
1101
1084
  res.json(result);
1102
1085
  }
1103
1086
  else {
1104
- res.status(500).send(finalStatus === null || finalStatus === void 0 ? void 0 : finalStatus.error);
1087
+ // The procedure failed or was stopped. Preserve the standard `{ message, code }` error body that the
1088
+ // rest of the API returns on 500 (so existing clients keep reading those fields unchanged), and extend
1089
+ // it with `data`: the phase-error samples collected before the procedure ended, so callers can still
1090
+ // diagnose why the calibration did not succeed instead of getting an empty response.
1091
+ //
1092
+ // A stop resolves to a failed request through a `success` status (code STOPPED) rather than an `error`,
1093
+ // so its message comes from there. `code` is taken only from a genuine `error`: the STOPPED success
1094
+ // code (4) collides numerically with Error TIMED_OUT (4), so we omit it on a stop rather than report an
1095
+ // ambiguous code — the message still explains what happened. The per-iteration robustness verdict from
1096
+ // `result` is intentionally omitted too: it labels a *successful* calibration, which this was not.
1097
+ const failure = (_77 = finalStatus === null || finalStatus === void 0 ? void 0 : finalStatus.error) !== null && _77 !== void 0 ? _77 : finalStatus === null || finalStatus === void 0 ? void 0 : finalStatus.success;
1098
+ res.status(500).json({
1099
+ code: (_78 = finalStatus === null || finalStatus === void 0 ? void 0 : finalStatus.error) === null || _78 === void 0 ? void 0 : _78.code,
1100
+ message: failure === null || failure === void 0 ? void 0 : failure.message,
1101
+ data: result.map((iteration) => iteration.data),
1102
+ });
1105
1103
  }
1106
1104
  })));
1107
1105
  app.get('/api/devices/:deviceRef/start-circulo-encoder-configuration', asyncHandler((req, res) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
1108
- var _77, _78, _79, _80;
1106
+ var _79, _80, _81, _82;
1109
1107
  const deviceRef = (0, device_1.ensureDeviceRef)(req.params['deviceRef']);
1110
1108
  const deviceRefObj = (0, device_1.makeDeviceRefObj)(deviceRef);
1111
- const encoderOrdinal = parseInt(((_77 = req.query['encoder-ordinal']) !== null && _77 !== void 0 ? _77 : '1'));
1112
- const batteryModeMaxAcceleration = parseInt(((_78 = req.query['battery-mode-max-acceleration']) !== null && _78 !== void 0 ? _78 : '0'));
1113
- const externalCirculoType = parseInt(((_79 = req.query['external-circulo-type']) !== null && _79 !== void 0 ? _79 : '0'));
1114
- const requestTimeout = parseInt(((_80 = req.query['request-timeout']) !== null && _80 !== void 0 ? _80 : '30000'));
1109
+ const encoderOrdinal = parseInt(((_79 = req.query['encoder-ordinal']) !== null && _79 !== void 0 ? _79 : '1'));
1110
+ const batteryModeMaxAcceleration = parseInt(((_80 = req.query['battery-mode-max-acceleration']) !== null && _80 !== void 0 ? _80 : '0'));
1111
+ const externalCirculoType = parseInt(((_81 = req.query['external-circulo-type']) !== null && _81 !== void 0 ? _81 : '0'));
1112
+ const requestTimeout = parseInt(((_82 = req.query['request-timeout']) !== null && _82 !== void 0 ? _82 : '30000'));
1115
1113
  const status = yield (0, rxjs_1.lastValueFrom)(client.request.startCirculoEncoderConfiguration(Object.assign(Object.assign({}, deviceRefObj), { encoderOrdinal, batteryModeMaxAcceleration, externalCirculoType }), requestTimeout));
1116
1114
  if (status.request === 'succeeded') {
1117
1115
  res.send();
@@ -1121,9 +1119,9 @@ app.get('/api/devices/:deviceRef/start-circulo-encoder-configuration', asyncHand
1121
1119
  }
1122
1120
  })));
1123
1121
  app.get('/api/devices/:deviceRef/check-circulo-encoder-errors', asyncHandler((req, res) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
1124
- var _81;
1122
+ var _83;
1125
1123
  const deviceRef = (0, device_1.ensureDeviceRef)(req.params['deviceRef']);
1126
- const encoderOrdinal = parseInt(((_81 = req.query['encoder-ordinal']) !== null && _81 !== void 0 ? _81 : '1'));
1124
+ const encoderOrdinal = parseInt(((_83 = req.query['encoder-ordinal']) !== null && _83 !== void 0 ? _83 : '1'));
1127
1125
  const result = yield (0, rxjs_1.lastValueFrom)(client.request.checkCirculoEncoderErrors(deviceRef, encoderOrdinal));
1128
1126
  res.send(result);
1129
1127
  })));
@@ -1133,12 +1131,12 @@ app.get('/api/devices/:deviceRef/start-integro-encoder-calibration', asyncHandle
1133
1131
  res.send();
1134
1132
  })));
1135
1133
  app.get('/api/devices/:deviceRef/circulo-encoder-magnet-distance', asyncHandler((req, res) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
1136
- var _82, _83, _84;
1134
+ var _84, _85, _86;
1137
1135
  const deviceRef = (0, device_1.ensureDeviceRef)(req.params['deviceRef']);
1138
1136
  const deviceRefObj = (0, device_1.makeDeviceRefObj)(deviceRef);
1139
- const encoderOrdinal = parseInt(((_82 = req.query['encoder-ordinal']) !== null && _82 !== void 0 ? _82 : '1'));
1140
- const ringRevision = parseInt(((_83 = req.query['ring-revision']) !== null && _83 !== void 0 ? _83 : '0'));
1141
- const requestTimeout = parseInt(((_84 = req.query['request-timeout']) !== null && _84 !== void 0 ? _84 : '5000'));
1137
+ const encoderOrdinal = parseInt(((_84 = req.query['encoder-ordinal']) !== null && _84 !== void 0 ? _84 : '1'));
1138
+ const ringRevision = parseInt(((_85 = req.query['ring-revision']) !== null && _85 !== void 0 ? _85 : '0'));
1139
+ const requestTimeout = parseInt(((_86 = req.query['request-timeout']) !== null && _86 !== void 0 ? _86 : '5000'));
1142
1140
  const status = yield (0, rxjs_1.lastValueFrom)(client.request.getCirculoEncoderMagnetDistance(Object.assign(Object.assign({}, deviceRefObj), { encoderOrdinal, ringRevision }), requestTimeout));
1143
1141
  if (status.request === 'succeeded') {
1144
1142
  res.send({ distance: status.distance, position: status.position });
@@ -1148,7 +1146,7 @@ app.get('/api/devices/:deviceRef/circulo-encoder-magnet-distance', asyncHandler(
1148
1146
  }
1149
1147
  })));
1150
1148
  app.post('/api/devices/:deviceRef/run-os-command', asyncHandler((req, res) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
1151
- var _85, _86, _87, _88;
1149
+ var _87, _88, _89, _90;
1152
1150
  const deviceRef = (0, device_1.ensureDeviceRef)(req.params['deviceRef']);
1153
1151
  const commandQuery = req.query['command'];
1154
1152
  if (!commandQuery) {
@@ -1163,12 +1161,12 @@ app.post('/api/devices/:deviceRef/run-os-command', asyncHandler((req, res) => ts
1163
1161
  return;
1164
1162
  }
1165
1163
  const commandArray = new Uint8Array(command);
1166
- const commandTimeout = parseInt(((_85 = req.query['command-timeout']) !== null && _85 !== void 0 ? _85 : '10000'));
1167
- const responsePollingInterval = parseInt(((_86 = req.query['response-polling-interval']) !== null && _86 !== void 0 ? _86 : '1000'));
1164
+ const commandTimeout = parseInt(((_87 = req.query['command-timeout']) !== null && _87 !== void 0 ? _87 : '10000'));
1165
+ const responsePollingInterval = parseInt(((_88 = req.query['response-polling-interval']) !== null && _88 !== void 0 ? _88 : '1000'));
1168
1166
  const osCommandModeQuery = req.query['os-command-mode'];
1169
1167
  const osCommandMode = osCommandModeQuery !== undefined && asBoolean(osCommandModeQuery)
1170
1168
  ? true
1171
- : (_87 = os_command_1.OsCommandMode[osCommandModeQuery === null || osCommandModeQuery === void 0 ? void 0 : osCommandModeQuery.toUpperCase()]) !== null && _87 !== void 0 ? _87 : false;
1169
+ : (_89 = os_command_1.OsCommandMode[osCommandModeQuery === null || osCommandModeQuery === void 0 ? void 0 : osCommandModeQuery.toUpperCase()]) !== null && _89 !== void 0 ? _89 : false;
1172
1170
  const readFsBuffer = asBoolean(req.query['read-fs-buffer']);
1173
1171
  const fsBufferContent = req.body;
1174
1172
  let fsBufferContentArray = undefined;
@@ -1176,7 +1174,7 @@ app.post('/api/devices/:deviceRef/run-os-command', asyncHandler((req, res) => ts
1176
1174
  fsBufferContentArray = new Uint8Array(fsBufferContent);
1177
1175
  }
1178
1176
  const fsBuffer = fsBufferContentArray !== null && fsBufferContentArray !== void 0 ? fsBufferContentArray : readFsBuffer;
1179
- const fsBufferReadWriteTimeout = parseInt(((_88 = req.query['fs-buffer-read-write-timeout']) !== null && _88 !== void 0 ? _88 : '30000'));
1177
+ const fsBufferReadWriteTimeout = parseInt(((_90 = req.query['fs-buffer-read-write-timeout']) !== null && _90 !== void 0 ? _90 : '30000'));
1180
1178
  const status = yield (0, rxjs_1.lastValueFrom)(client.request.runOsCommand(deviceRef, commandArray, commandTimeout, responsePollingInterval, osCommandMode, fsBuffer, fsBufferReadWriteTimeout));
1181
1179
  if (status.request === 'succeeded') {
1182
1180
  res.send(status);
@@ -1191,10 +1189,10 @@ app.post('/api/devices/:deviceRef/run-os-command', asyncHandler((req, res) => ts
1191
1189
  * @example curl -X POST "http://localhost:63526/api/devices/0/os-command/abort?command-timeout=10000&response-polling-interval=250"
1192
1190
  */
1193
1191
  app.post('/api/devices/:deviceRef/os-command/abort', asyncHandler((req, res) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
1194
- var _89, _90;
1192
+ var _91, _92;
1195
1193
  const deviceRef = (0, device_1.ensureDeviceRef)(req.params['deviceRef']);
1196
- const commandTimeout = parseInt(((_89 = req.query['command-timeout']) !== null && _89 !== void 0 ? _89 : '10000'));
1197
- const responsePollingInterval = parseInt(((_90 = req.query['response-polling-interval']) !== null && _90 !== void 0 ? _90 : '250'));
1194
+ const commandTimeout = parseInt(((_91 = req.query['command-timeout']) !== null && _91 !== void 0 ? _91 : '10000'));
1195
+ const responsePollingInterval = parseInt(((_92 = req.query['response-polling-interval']) !== null && _92 !== void 0 ? _92 : '250'));
1198
1196
  const status = yield (0, rxjs_1.lastValueFrom)(client.request.abortOsCommand(deviceRef, commandTimeout, responsePollingInterval));
1199
1197
  if (status.request === 'succeeded') {
1200
1198
  res.send(status);
@@ -1204,10 +1202,10 @@ app.post('/api/devices/:deviceRef/os-command/abort', asyncHandler((req, res) =>
1204
1202
  }
1205
1203
  })));
1206
1204
  app.post('/api/devices/:deviceRef/configure-smm', asyncHandler((req, res) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
1207
- var _91, _92, _93;
1205
+ var _93, _94, _95;
1208
1206
  const deviceRef = (0, device_1.ensureDeviceRef)(req.params['deviceRef']);
1209
- const username = (_91 = req.query['username']) !== null && _91 !== void 0 ? _91 : 'Test';
1210
- const password = (_92 = req.query['password']) !== null && _92 !== void 0 ? _92 : 'SomanetSMM';
1207
+ const username = (_93 = req.query['username']) !== null && _93 !== void 0 ? _93 : 'Test';
1208
+ const password = (_94 = req.query['password']) !== null && _94 !== void 0 ? _94 : 'SomanetSMM';
1211
1209
  let configString;
1212
1210
  if (Buffer.isBuffer(req.body)) {
1213
1211
  // application/octet-stream (or express.raw)
@@ -1218,49 +1216,49 @@ app.post('/api/devices/:deviceRef/configure-smm', asyncHandler((req, res) => tsl
1218
1216
  configString = req.body;
1219
1217
  }
1220
1218
  else {
1221
- const contentType = (_93 = req.headers['content-type']) !== null && _93 !== void 0 ? _93 : '';
1219
+ const contentType = (_95 = req.headers['content-type']) !== null && _95 !== void 0 ? _95 : '';
1222
1220
  throw new Error(`Unsupported body type for configure-smm: ${typeof req.body} (Content-Type: ${contentType})`);
1223
1221
  }
1224
1222
  const safetyParametersReport = yield (0, rxjs_1.lastValueFrom)(client.request.configureSmmFromFile(deviceRef, username, password, configString));
1225
1223
  res.send(safetyParametersReport);
1226
1224
  })));
1227
1225
  app.post('/api/devices/:deviceRef/update-smm-software', asyncHandler((req, res) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
1228
- var _94, _95, _96, _97, _98, _99, _100;
1226
+ var _96, _97, _98, _99, _100, _101, _102;
1229
1227
  const deviceRef = (0, device_1.ensureDeviceRef)(req.params['deviceRef']);
1230
- const username = (_94 = req.query['username']) !== null && _94 !== void 0 ? _94 : 'Test';
1231
- const password = (_95 = req.query['password']) !== null && _95 !== void 0 ? _95 : 'SomanetSMM';
1232
- const crc = parseInt(((_96 = req.query['crc']) !== null && _96 !== void 0 ? _96 : ''), 16);
1228
+ const username = (_96 = req.query['username']) !== null && _96 !== void 0 ? _96 : 'Test';
1229
+ const password = (_97 = req.query['password']) !== null && _97 !== void 0 ? _97 : 'SomanetSMM';
1230
+ const crc = parseInt(((_98 = req.query['crc']) !== null && _98 !== void 0 ? _98 : ''), 16);
1233
1231
  // Validate CRC
1234
1232
  if (Number.isNaN(crc)) {
1235
1233
  res.status(400).send('Invalid CRC format. Expected hexadecimal string.');
1236
1234
  return;
1237
1235
  }
1238
1236
  // Get optional parameters from query string
1239
- const chunkSize = parseInt(((_97 = req.query['chunkSize']) !== null && _97 !== void 0 ? _97 : '1000'));
1240
- const commandTimeout = parseInt(((_98 = req.query['commandTimeout']) !== null && _98 !== void 0 ? _98 : '30000'));
1241
- const responsePollingInterval = parseInt(((_99 = req.query['responsePollingInterval']) !== null && _99 !== void 0 ? _99 : '1000'));
1242
- const fsBufferReadWriteTimeout = parseInt(((_100 = req.query['fsBufferReadWriteTimeout']) !== null && _100 !== void 0 ? _100 : '120000'));
1237
+ const chunkSize = parseInt(((_99 = req.query['chunkSize']) !== null && _99 !== void 0 ? _99 : '1000'));
1238
+ const commandTimeout = parseInt(((_100 = req.query['commandTimeout']) !== null && _100 !== void 0 ? _100 : '30000'));
1239
+ const responsePollingInterval = parseInt(((_101 = req.query['responsePollingInterval']) !== null && _101 !== void 0 ? _101 : '1000'));
1240
+ const fsBufferReadWriteTimeout = parseInt(((_102 = req.query['fsBufferReadWriteTimeout']) !== null && _102 !== void 0 ? _102 : '120000'));
1243
1241
  // Create buffer from request body
1244
1242
  const buffer = new Uint8Array(req.body);
1245
1243
  yield (0, rxjs_1.lastValueFrom)(client.request.updateSmmSoftware(deviceRef, username, password, buffer, crc, chunkSize, commandTimeout, responsePollingInterval, fsBufferReadWriteTimeout));
1246
1244
  res.send();
1247
1245
  })));
1248
1246
  app.post('/api/devices/:deviceRef/update-smm-software-to-encrypted', asyncHandler((req, res) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
1249
- var _101, _102, _103, _104, _105, _106, _107;
1247
+ var _103, _104, _105, _106, _107, _108, _109;
1250
1248
  const deviceRef = (0, device_1.ensureDeviceRef)(req.params['deviceRef']);
1251
- const username = (_101 = req.query['username']) !== null && _101 !== void 0 ? _101 : 'Test';
1252
- const password = (_102 = req.query['password']) !== null && _102 !== void 0 ? _102 : 'SomanetSMM';
1253
- const crc = parseInt(((_103 = req.query['crc']) !== null && _103 !== void 0 ? _103 : ''), 16);
1249
+ const username = (_103 = req.query['username']) !== null && _103 !== void 0 ? _103 : 'Test';
1250
+ const password = (_104 = req.query['password']) !== null && _104 !== void 0 ? _104 : 'SomanetSMM';
1251
+ const crc = parseInt(((_105 = req.query['crc']) !== null && _105 !== void 0 ? _105 : ''), 16);
1254
1252
  // Validate CRC
1255
1253
  if (Number.isNaN(crc)) {
1256
1254
  res.status(400).send('Invalid CRC format. Expected hexadecimal string.');
1257
1255
  return;
1258
1256
  }
1259
1257
  // Get optional parameters from query string
1260
- const chunkSize = parseInt(((_104 = req.query['chunkSize']) !== null && _104 !== void 0 ? _104 : '1000'));
1261
- const commandTimeout = parseInt(((_105 = req.query['commandTimeout']) !== null && _105 !== void 0 ? _105 : '30000'));
1262
- const responsePollingInterval = parseInt(((_106 = req.query['responsePollingInterval']) !== null && _106 !== void 0 ? _106 : '1000'));
1263
- const fsBufferReadWriteTimeout = parseInt(((_107 = req.query['fsBufferReadWriteTimeout']) !== null && _107 !== void 0 ? _107 : '120000'));
1258
+ const chunkSize = parseInt(((_106 = req.query['chunkSize']) !== null && _106 !== void 0 ? _106 : '1000'));
1259
+ const commandTimeout = parseInt(((_107 = req.query['commandTimeout']) !== null && _107 !== void 0 ? _107 : '30000'));
1260
+ const responsePollingInterval = parseInt(((_108 = req.query['responsePollingInterval']) !== null && _108 !== void 0 ? _108 : '1000'));
1261
+ const fsBufferReadWriteTimeout = parseInt(((_109 = req.query['fsBufferReadWriteTimeout']) !== null && _109 !== void 0 ? _109 : '120000'));
1264
1262
  // Create buffer from request body
1265
1263
  const buffer = new Uint8Array(req.body);
1266
1264
  yield (0, rxjs_1.lastValueFrom)(client.request.updateSmmSoftwareToEncrypted(deviceRef, username, password, buffer, crc, chunkSize, commandTimeout, responsePollingInterval, fsBufferReadWriteTimeout));
@@ -1273,16 +1271,16 @@ app.get('/api/devices/:deviceRef/write-circulo-integrated-encoder-config-bin-fil
1273
1271
  res.send(status);
1274
1272
  })));
1275
1273
  app.get('/api/devices/:deviceRef/run-chirp-signal', asyncHandler((req, res) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
1276
- var _108, _109, _110, _111, _112, _113, _114, _115;
1277
- const deviceRef = (0, device_1.ensureDeviceRef)(req.params['deviceRef']);
1278
- const hrdStreamingDuration = parseInt(((_108 = req.query['hrd-streaming-duration']) !== null && _108 !== void 0 ? _108 : '4000'));
1279
- const modesOfOperation = parseInt(((_109 = req.query['modes-of-operation']) !== null && _109 !== void 0 ? _109 : '10'));
1280
- const signalType = parseInt(((_110 = req.query['signal-type']) !== null && _110 !== void 0 ? _110 : '0'));
1281
- const startFrequency = parseInt(((_111 = req.query['start-frequency']) !== null && _111 !== void 0 ? _111 : '2000'));
1282
- const startProcedure = parseInt(((_112 = req.query['start-procedure']) !== null && _112 !== void 0 ? _112 : '2'));
1283
- const targetAmplitude = parseInt(((_113 = req.query['target-amplitude']) !== null && _113 !== void 0 ? _113 : '300'));
1284
- const targetFrequency = parseInt(((_114 = req.query['target-frequency']) !== null && _114 !== void 0 ? _114 : '100000'));
1285
- const transitionTime = parseInt(((_115 = req.query['transition-time']) !== null && _115 !== void 0 ? _115 : '3000'));
1274
+ var _110, _111, _112, _113, _114, _115, _116, _117;
1275
+ const deviceRef = (0, device_1.ensureDeviceRef)(req.params['deviceRef']);
1276
+ const hrdStreamingDuration = parseInt(((_110 = req.query['hrd-streaming-duration']) !== null && _110 !== void 0 ? _110 : '4000'));
1277
+ const modesOfOperation = parseInt(((_111 = req.query['modes-of-operation']) !== null && _111 !== void 0 ? _111 : '10'));
1278
+ const signalType = parseInt(((_112 = req.query['signal-type']) !== null && _112 !== void 0 ? _112 : '0'));
1279
+ const startFrequency = parseInt(((_113 = req.query['start-frequency']) !== null && _113 !== void 0 ? _113 : '2000'));
1280
+ const startProcedure = parseInt(((_114 = req.query['start-procedure']) !== null && _114 !== void 0 ? _114 : '2'));
1281
+ const targetAmplitude = parseInt(((_115 = req.query['target-amplitude']) !== null && _115 !== void 0 ? _115 : '300'));
1282
+ const targetFrequency = parseInt(((_116 = req.query['target-frequency']) !== null && _116 !== void 0 ? _116 : '100000'));
1283
+ const transitionTime = parseInt(((_117 = req.query['transition-time']) !== null && _117 !== void 0 ? _117 : '3000'));
1286
1284
  const options = {
1287
1285
  hrdStreamingDuration,
1288
1286
  modesOfOperation,
@@ -1303,18 +1301,18 @@ app.get('/api/devices/:deviceRef/run-chirp-signal', asyncHandler((req, res) => t
1303
1301
  }
1304
1302
  })));
1305
1303
  app.get('/api/devices/:deviceRef/start-limited-range-system-identification', asyncHandler((req, res) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
1306
- var _116, _117, _118, _119, _120, _121, _122;
1304
+ var _118, _119, _120, _121, _122, _123, _124;
1307
1305
  const deviceRef = (0, device_1.ensureDeviceRef)(req.params['deviceRef']);
1308
- const hrdStreamingDuration = parseInt(((_116 = req.query['hrd-streaming-duration']) !== null && _116 !== void 0 ? _116 : '3200'));
1306
+ const hrdStreamingDuration = parseInt(((_118 = req.query['hrd-streaming-duration']) !== null && _118 !== void 0 ? _118 : '3200'));
1309
1307
  const modesOfOperation = cia402_1.ModesOfOperation.CYCLIC_SYNC_POSITION_MODE;
1310
- const rangeLimit = parseInt(((_117 = req.query['range-limit']) !== null && _117 !== void 0 ? _117 : '10000'));
1311
- const rangeLimitMin = parseInt(((_118 = req.query['range-limit-min']) !== null && _118 !== void 0 ? _118 : '1000'));
1308
+ const rangeLimit = parseInt(((_119 = req.query['range-limit']) !== null && _119 !== void 0 ? _119 : '10000'));
1309
+ const rangeLimitMin = parseInt(((_120 = req.query['range-limit-min']) !== null && _120 !== void 0 ? _120 : '1000'));
1312
1310
  const signalType = os_command_1.SystemIdentificationOsCommandSignalType.LINEAR_WITH_CONSTANT_AMPLITUDE;
1313
- const startFrequency = parseInt(((_119 = req.query['start-frequency']) !== null && _119 !== void 0 ? _119 : '1000'));
1311
+ const startFrequency = parseInt(((_121 = req.query['start-frequency']) !== null && _121 !== void 0 ? _121 : '1000'));
1314
1312
  const startProcedure = os_command_1.SystemIdentificationOsCommandStartProcedure.WAIT_FOR_HRD_STREAMING_TO_START;
1315
- const targetAmplitude = parseInt(((_120 = req.query['target-amplitude']) !== null && _120 !== void 0 ? _120 : '300'));
1316
- const targetFrequency = parseInt(((_121 = req.query['target-frequency']) !== null && _121 !== void 0 ? _121 : '10000'));
1317
- const transitionTime = parseInt(((_122 = req.query['transition-time']) !== null && _122 !== void 0 ? _122 : '3000'));
1313
+ const targetAmplitude = parseInt(((_122 = req.query['target-amplitude']) !== null && _122 !== void 0 ? _122 : '300'));
1314
+ const targetFrequency = parseInt(((_123 = req.query['target-frequency']) !== null && _123 !== void 0 ? _123 : '10000'));
1315
+ const transitionTime = parseInt(((_124 = req.query['transition-time']) !== null && _124 !== void 0 ? _124 : '3000'));
1318
1316
  const options = {
1319
1317
  hrdStreamingDuration,
1320
1318
  modesOfOperation,
@@ -1357,15 +1355,15 @@ app.get('/api/motion-composer/stop', asyncHandler((_req, res) => tslib_1.__await
1357
1355
  res.send();
1358
1356
  })));
1359
1357
  app.get('/api/devices/:deviceRef/run-kubler-encoder-register-communication-os-command', asyncHandler((req, res) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
1360
- var _123, _124, _125, _126, _127, _128, _129;
1361
- const deviceRef = (0, device_1.ensureDeviceRef)(req.params['deviceRef']);
1362
- const rw = parseInt(((_123 = req.query['rw']) !== null && _123 !== void 0 ? _123 : '0'));
1363
- const registerAddress = parseInt(((_124 = req.query['register-address']) !== null && _124 !== void 0 ? _124 : '0'));
1364
- const registerLength = parseInt(((_125 = req.query['register-length']) !== null && _125 !== void 0 ? _125 : '0'));
1365
- const registerWriteValue = parseInt(((_126 = req.query['register-write-value']) !== null && _126 !== void 0 ? _126 : '0'));
1366
- const commandTimeout = parseInt(((_127 = req.query['command-timeout']) !== null && _127 !== void 0 ? _127 : '10000'));
1367
- const responsePollingInterval = parseInt(((_128 = req.query['response-polling-interval']) !== null && _128 !== void 0 ? _128 : '1000'));
1368
- const osCommandMode = asBoolean(((_129 = req.query['os-command-mode']) !== null && _129 !== void 0 ? _129 : 'false'));
1358
+ var _125, _126, _127, _128, _129, _130, _131;
1359
+ const deviceRef = (0, device_1.ensureDeviceRef)(req.params['deviceRef']);
1360
+ const rw = parseInt(((_125 = req.query['rw']) !== null && _125 !== void 0 ? _125 : '0'));
1361
+ const registerAddress = parseInt(((_126 = req.query['register-address']) !== null && _126 !== void 0 ? _126 : '0'));
1362
+ const registerLength = parseInt(((_127 = req.query['register-length']) !== null && _127 !== void 0 ? _127 : '0'));
1363
+ const registerWriteValue = parseInt(((_128 = req.query['register-write-value']) !== null && _128 !== void 0 ? _128 : '0'));
1364
+ const commandTimeout = parseInt(((_129 = req.query['command-timeout']) !== null && _129 !== void 0 ? _129 : '10000'));
1365
+ const responsePollingInterval = parseInt(((_130 = req.query['response-polling-interval']) !== null && _130 !== void 0 ? _130 : '1000'));
1366
+ const osCommandMode = asBoolean(((_131 = req.query['os-command-mode']) !== null && _131 !== void 0 ? _131 : 'false'));
1369
1367
  const status = yield (0, rxjs_1.lastValueFrom)(client.request.runKublerEncoderRegisterCommunicationOsCommand(deviceRef, rw, registerAddress, registerLength, registerWriteValue, commandTimeout, responsePollingInterval, osCommandMode));
1370
1368
  if (status.request === 'succeeded') {
1371
1369
  res.send(status);
@@ -1414,28 +1412,28 @@ app.get('/api/devices/:deviceRef/factory-reset', asyncHandler((req, res) => tsli
1414
1412
  }
1415
1413
  })));
1416
1414
  app.get('/api/devices/:deviceRef/monitoring/start', asyncHandler((req, res) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
1417
- var _130;
1415
+ var _132;
1418
1416
  const deviceRef = (0, device_1.ensureDeviceRef)(req.params['deviceRef']);
1419
1417
  const device = yield (0, rxjs_1.lastValueFrom)(client.request.resolveDevice(deviceRef));
1420
1418
  const monitoringParameterIds = yield createDefaultDataMonitoringParameterIds(deviceRef);
1421
- (_130 = dataMonitoringMap.get(device.id)) === null || _130 === void 0 ? void 0 : _130.stop();
1419
+ (_132 = dataMonitoringMap.get(device.id)) === null || _132 === void 0 ? void 0 : _132.stop();
1422
1420
  const dataMonitoring = client.createDataMonitoring(monitoringParameterIds, 1000);
1423
1421
  dataMonitoring.start();
1424
1422
  dataMonitoringMap.set(device.id, dataMonitoring);
1425
1423
  res.send();
1426
1424
  })));
1427
1425
  app.get('/api/devices/:deviceRef/monitoring/data', asyncHandler((req, res) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
1428
- var _131;
1426
+ var _133;
1429
1427
  const deviceRef = (0, device_1.ensureDeviceRef)(req.params['deviceRef']);
1430
1428
  const device = yield (0, rxjs_1.lastValueFrom)(client.request.resolveDevice(deviceRef));
1431
1429
  const dataMonitoring = dataMonitoringMap.get(device.id);
1432
- res.type('text/csv').send((_131 = dataMonitoring === null || dataMonitoring === void 0 ? void 0 : dataMonitoring.csv) !== null && _131 !== void 0 ? _131 : '');
1430
+ res.type('text/csv').send((_133 = dataMonitoring === null || dataMonitoring === void 0 ? void 0 : dataMonitoring.csv) !== null && _133 !== void 0 ? _133 : '');
1433
1431
  })));
1434
1432
  app.get('/api/devices/:deviceRef/monitoring/stop', asyncHandler((req, res) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
1435
- var _132;
1433
+ var _134;
1436
1434
  const deviceRef = (0, device_1.ensureDeviceRef)(req.params['deviceRef']);
1437
1435
  const device = yield (0, rxjs_1.lastValueFrom)(client.request.resolveDevice(deviceRef));
1438
- (_132 = dataMonitoringMap.get(device.id)) === null || _132 === void 0 ? void 0 : _132.stop();
1436
+ (_134 = dataMonitoringMap.get(device.id)) === null || _134 === void 0 ? void 0 : _134.stop();
1439
1437
  res.send();
1440
1438
  })));
1441
1439
  app.listen(port, () => {