motion-master-client 0.0.245 → 0.0.247

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 (104) hide show
  1. package/README.md +24 -18
  2. package/package.json +1 -1
  3. package/src/api.js +21 -5
  4. package/src/api.js.map +1 -1
  5. package/src/cli.js +47 -19
  6. package/src/cli.js.map +1 -1
  7. package/src/lib/cia402.js +11 -36
  8. package/src/lib/cia402.js.map +1 -1
  9. package/src/lib/config-file.js +4 -2
  10. package/src/lib/config-file.js.map +1 -1
  11. package/src/lib/data-monitoring.d.ts +4 -4
  12. package/src/lib/data-monitoring.js +8 -6
  13. package/src/lib/data-monitoring.js.map +1 -1
  14. package/src/lib/device-parameter.d.ts +5 -5
  15. package/src/lib/device-parameter.js +10 -44
  16. package/src/lib/device-parameter.js.map +1 -1
  17. package/src/lib/device.d.ts +4 -4
  18. package/src/lib/device.js +9 -7
  19. package/src/lib/device.js.map +1 -1
  20. package/src/lib/encoder.js +4 -1
  21. package/src/lib/encoder.js.map +1 -1
  22. package/src/lib/error-report.d.ts +4 -4
  23. package/src/lib/error-report.js +0 -1
  24. package/src/lib/error-report.js.map +1 -1
  25. package/src/lib/ethercat.js +119 -33
  26. package/src/lib/ethercat.js.map +1 -1
  27. package/src/lib/ethernet.d.ts +3 -3
  28. package/src/lib/ethernet.js +5 -5
  29. package/src/lib/ethernet.js.map +1 -1
  30. package/src/lib/fetch.d.ts +1 -1
  31. package/src/lib/fetch.js +7 -7
  32. package/src/lib/fetch.js.map +1 -1
  33. package/src/lib/firmware.js +3 -1
  34. package/src/lib/firmware.js.map +1 -1
  35. package/src/lib/homing.d.ts +1 -1
  36. package/src/lib/homing.js.map +1 -1
  37. package/src/lib/integro-encoder-calibration.js +11 -4
  38. package/src/lib/integro-encoder-calibration.js.map +1 -1
  39. package/src/lib/integro-variant.js.map +1 -1
  40. package/src/lib/is-online.js +2 -2
  41. package/src/lib/is-online.js.map +1 -1
  42. package/src/lib/logger.js +1 -1
  43. package/src/lib/mmcidb.js.map +1 -1
  44. package/src/lib/monitoring-config.d.ts +1 -1
  45. package/src/lib/monitoring-entry.d.ts +3 -3
  46. package/src/lib/motion-composer.d.ts +4 -4
  47. package/src/lib/motion-composer.js +3 -2
  48. package/src/lib/motion-composer.js.map +1 -1
  49. package/src/lib/motion-master-client.d.ts +10 -10
  50. package/src/lib/motion-master-client.js +15 -10
  51. package/src/lib/motion-master-client.js.map +1 -1
  52. package/src/lib/motion-master-pub-sub-client.d.ts +4 -4
  53. package/src/lib/motion-master-pub-sub-client.js +2 -2
  54. package/src/lib/motion-master-pub-sub-client.js.map +1 -1
  55. package/src/lib/motion-master-pub-sub-socket.d.ts +2 -2
  56. package/src/lib/motion-master-pub-sub-web-socket.d.ts +3 -3
  57. package/src/lib/motion-master-pub-sub-web-socket.js.map +1 -1
  58. package/src/lib/motion-master-pub-sub-worker-socket.d.ts +3 -3
  59. package/src/lib/motion-master-pub-sub-worker-socket.js +1 -1
  60. package/src/lib/motion-master-pub-sub-worker-socket.js.map +1 -1
  61. package/src/lib/motion-master-req-res-client.d.ts +291 -15
  62. package/src/lib/motion-master-req-res-client.js +491 -57
  63. package/src/lib/motion-master-req-res-client.js.map +1 -1
  64. package/src/lib/motion-master-req-res-socket.d.ts +2 -2
  65. package/src/lib/motion-master-req-res-web-socket.d.ts +3 -3
  66. package/src/lib/motion-master-req-res-web-socket.js +2 -2
  67. package/src/lib/motion-master-req-res-web-socket.js.map +1 -1
  68. package/src/lib/motion-master-req-res-worker-socket.d.ts +3 -3
  69. package/src/lib/motion-master-req-res-worker-socket.js.map +1 -1
  70. package/src/lib/online.d.ts +1 -1
  71. package/src/lib/online.js +3 -2
  72. package/src/lib/online.js.map +1 -1
  73. package/src/lib/operators.js.map +1 -1
  74. package/src/lib/options.js +5 -5
  75. package/src/lib/options.js.map +1 -1
  76. package/src/lib/os-command.d.ts +82 -22
  77. package/src/lib/os-command.js +95 -55
  78. package/src/lib/os-command.js.map +1 -1
  79. package/src/lib/parameter.d.ts +1 -1
  80. package/src/lib/parameter.js +6 -4
  81. package/src/lib/parameter.js.map +1 -1
  82. package/src/lib/product-id-range.js +5 -5
  83. package/src/lib/product-id-range.js.map +1 -1
  84. package/src/lib/product.js +256 -34
  85. package/src/lib/product.js.map +1 -1
  86. package/src/lib/request-status-resolver.d.ts +1 -1
  87. package/src/lib/request-status-resolver.js +8 -6
  88. package/src/lib/request-status-resolver.js.map +1 -1
  89. package/src/lib/sii.js +4 -11
  90. package/src/lib/sii.js.map +1 -1
  91. package/src/lib/smm-od-v1.json +1836 -0
  92. package/src/lib/smm.d.ts +63 -0
  93. package/src/lib/smm.js +177 -0
  94. package/src/lib/smm.js.map +1 -0
  95. package/src/lib/types.d.ts +8 -8
  96. package/src/lib/types.js +0 -4
  97. package/src/lib/types.js.map +1 -1
  98. package/src/lib/units.js +11 -23
  99. package/src/lib/units.js.map +1 -1
  100. package/src/lib/util.d.ts +3 -2
  101. package/src/lib/util.js +23 -11
  102. package/src/lib/util.js.map +1 -1
  103. package/src/lib/web-socket-connection-close-codes.js +2 -2
  104. package/src/lib/web-socket-connection-close-codes.js.map +1 -1
@@ -1,17 +1,19 @@
1
- import { Observable } from "rxjs";
2
- import { RetryConfig } from "rxjs/operators";
3
- import { Device } from "./device";
4
- import { DeviceParameter } from "./device-parameter";
5
- import { HardwareDescription, StackInfo } from "./hardware-description";
6
- import { MotionMasterReqResSocket } from "./motion-master-req-res-socket";
7
- import { UIFeaturesConfig } from "./parameter";
8
- import { SystemLogLine } from "./system-log-line";
9
- import { MotionMasterMessage, ParameterValueType, ParameterTypeValue, DeviceParameterValuesStatus, ParameterTypeValueKey, DeviceRefObj, DeviceRef, FullAutoTuningStatus, SystemVersionStatus, DeviceInfoStatus, DeviceParameterInfoStatus, GetDeviceParameterInfoRequest, GetDeviceParameterValuesRequest, GetMultiDeviceParameterValuesRequest, MultiDeviceParameterValuesStatus, SetDeviceParameterValuesRequest, SetMultiDeviceParameterValuesRequest, GetDeviceFileListRequest, DeviceFileListStatus, GetDeviceFileRequest, DeviceFileStatus, SetDeviceFileRequest, DeleteDeviceFileRequest, ResetDeviceFaultRequest, DeviceFaultResetStatus, StopDeviceRequest, DeviceStopStatus, StartDeviceFirmwareInstallationRequest, DeviceFirmwareInstallationStatus, GetDeviceLogRequest, DeviceLogStatus, StartCoggingTorqueRecordingRequest, CoggingTorqueRecordingStatus, GetCoggingTorqueDataRequest, CoggingTorqueDataStatus, StartOffsetDetectionRequest, OffsetDetectionStatus, StartPlantModelIdentificationRequest, PlantIdentificationStatus, ComputeAutoTuningGainsRequest, AutoTuningStatus, SetMotionControllerParametersRequest, MotionControllerStatus, EnableMotionControllerRequest, SetSignalGeneratorParametersRequest, SignalGeneratorStatus, StopSignalGeneratorRequest, StartMonitoringDeviceParameterValuesRequest, MonitoringParameterValuesStatus, StopMonitoringDeviceParameterValuesRequest, GetEthercatNetworkStateRequest, EthercatNetworkStateStatus, SetEthercatNetworkStateRequest, StartNarrowAngleCalibrationRequest, NarrowAngleCalibrationStatus, SetSystemClientTimeoutRequest, StartSystemIdentificationRequest, SystemIdentificationStatus, CirculoEncoderMagnetDistanceStatus, StartCirculoEncoderNarrowAngleCalibrationProcedureRequest, CirculoEncoderNarrowAngleCalibrationProcedureStatus, GetDeviceCiA402StateRequest, DeviceCiA402StateStatus, SetDeviceCiA402StateRequest, SystemLogStatus, StartDeviceSiiRestoreRequest, DeviceSiiRestoreStatus, StartOpenLoopFieldControlRequest, OpenLoopFieldControlStatus, ComputeFullAutoTuningGainsRequest, StartFullAutoTuningRequest, StopFullAutoTuningRequest, StartCirculoEncoderConfigurationRequest, CirculoEncoderConfigurationStatus, StopCirculoEncoderNarrowAngleCalibrationProcedureRequest, StartOsCommandRequest, OsCommandStatus, RestoreDefaultParametersType, DeviceParameterAddressValue, DeviceParameterIds, DeviceParameterInfo, RequestStatusMessage } from "./types";
10
- import { Cia402State, ModesOfOperation } from "./cia402";
11
- import { EncoderRegisterCommunicationOsCommandResponse, MotorPhaseOrderDetectionOsCommandResponse, OpenPhaseDetectionOsCommandResponse, OsCommandMode, OsCommandResponse, PhaseResistanceMeasurementOsCommandResponse, PhaseInductanceMeasurementOsCommandResponse, PolePairDetectionOsCommandResponse, CommutationOffsetMeasurementOsCommandResponse, IcMuCalibrationModeOsCommandResponse, OpenLoopFieldModeOsCommandResponse, HrdStreamingOsCommandResponse, TorqueConstantMeasurementOsCommandResponse, SkippedCyclesCounterOsCommandResponse, IgnoreBissStatusBitsOsCommandResponse, SystemIdentificationOsCommandResponse, KublerEncoderCommandOsCommandResponse, UseInternalEncoderVelocityOsCommandResponse, KublerEncoderRegisterCommunicationOsCommandResponse, SmmAcyclicHandlerOsCommandResponse, HrdStreamingOsCommandAction, HrdStreamingOsCommandDataIndex } from "./os-command";
12
- import { IntegroVariant } from "./integro-variant";
1
+ import { Observable } from 'rxjs';
2
+ import { RetryConfig } from 'rxjs/operators';
3
+ import { Device } from './device';
4
+ import { DeviceParameter } from './device-parameter';
5
+ import { HardwareDescription, StackInfo } from './hardware-description';
6
+ import { MotionMasterReqResSocket } from './motion-master-req-res-socket';
7
+ import { Parameter, UIFeaturesConfig } from './parameter';
8
+ import { SystemLogLine } from './system-log-line';
9
+ import { MotionMasterMessage, ParameterValueType, ParameterTypeValue, DeviceParameterValuesStatus, ParameterTypeValueKey, DeviceRefObj, DeviceRef, FullAutoTuningStatus, SystemVersionStatus, DeviceInfoStatus, DeviceParameterInfoStatus, GetDeviceParameterInfoRequest, GetDeviceParameterValuesRequest, GetMultiDeviceParameterValuesRequest, MultiDeviceParameterValuesStatus, SetDeviceParameterValuesRequest, SetMultiDeviceParameterValuesRequest, GetDeviceFileListRequest, DeviceFileListStatus, GetDeviceFileRequest, DeviceFileStatus, SetDeviceFileRequest, DeleteDeviceFileRequest, ResetDeviceFaultRequest, DeviceFaultResetStatus, StopDeviceRequest, DeviceStopStatus, StartDeviceFirmwareInstallationRequest, DeviceFirmwareInstallationStatus, GetDeviceLogRequest, DeviceLogStatus, StartCoggingTorqueRecordingRequest, CoggingTorqueRecordingStatus, GetCoggingTorqueDataRequest, CoggingTorqueDataStatus, StartOffsetDetectionRequest, OffsetDetectionStatus, StartPlantModelIdentificationRequest, PlantIdentificationStatus, ComputeAutoTuningGainsRequest, AutoTuningStatus, SetMotionControllerParametersRequest, MotionControllerStatus, EnableMotionControllerRequest, SetSignalGeneratorParametersRequest, SignalGeneratorStatus, StopSignalGeneratorRequest, StartMonitoringDeviceParameterValuesRequest, MonitoringParameterValuesStatus, StopMonitoringDeviceParameterValuesRequest, GetEthercatNetworkStateRequest, EthercatNetworkStateStatus, SetEthercatNetworkStateRequest, StartNarrowAngleCalibrationRequest, NarrowAngleCalibrationStatus, SetSystemClientTimeoutRequest, StartSystemIdentificationRequest, SystemIdentificationStatus, CirculoEncoderMagnetDistanceStatus, StartCirculoEncoderNarrowAngleCalibrationProcedureRequest, CirculoEncoderNarrowAngleCalibrationProcedureStatus, GetDeviceCiA402StateRequest, DeviceCiA402StateStatus, SetDeviceCiA402StateRequest, SystemLogStatus, StartDeviceSiiRestoreRequest, DeviceSiiRestoreStatus, StartOpenLoopFieldControlRequest, OpenLoopFieldControlStatus, ComputeFullAutoTuningGainsRequest, StartFullAutoTuningRequest, StopFullAutoTuningRequest, StartCirculoEncoderConfigurationRequest, CirculoEncoderConfigurationStatus, StopCirculoEncoderNarrowAngleCalibrationProcedureRequest, StartOsCommandRequest, OsCommandStatus, RestoreDefaultParametersType, DeviceParameterAddressValue, DeviceParameterIds, DeviceParameterInfo, RequestStatusMessage } from './types';
10
+ import { Cia402State, ModesOfOperation } from './cia402';
11
+ import { EncoderRegisterCommunicationOsCommandResponse, MotorPhaseOrderDetectionOsCommandResponse, OpenPhaseDetectionOsCommandResponse, OsCommandMode, OsCommandResponse, PhaseResistanceMeasurementOsCommandResponse, PhaseInductanceMeasurementOsCommandResponse, PolePairDetectionOsCommandResponse, CommutationOffsetMeasurementOsCommandResponse, IcMuCalibrationModeOsCommandResponse, OpenLoopFieldModeOsCommandResponse, HrdStreamingOsCommandResponse, TorqueConstantMeasurementOsCommandResponse, SkippedCyclesCounterOsCommandResponse, IgnoreBissStatusBitsOsCommandResponse, SystemIdentificationOsCommandResponse, KublerEncoderCommandOsCommandResponse, UseInternalEncoderVelocityOsCommandResponse, KublerEncoderRegisterCommunicationOsCommandResponse, SmmAcyclicHandlerOsCommandResponse, HrdStreamingOsCommandAction, HrdStreamingOsCommandDataIndex, SmmAcyclicHandlerLoadParametersForVerificationOsCommandResponse } from './os-command';
12
+ import { IntegroVariant } from './integro-variant';
13
13
  import { ConfigParameter } from './config-file';
14
14
  import { MotionMasterClientIndexedDB } from './mmcidb';
15
+ import { SmmVerificationGroupOrdinal } from './smm';
16
+ import { DataType } from 'python-struct';
15
17
  /**
16
18
  * This class contains methods for making requests to Motion Master using the injected request/response socket.
17
19
  *
@@ -860,7 +862,7 @@ export declare class MotionMasterReqResClient {
860
862
  /**
861
863
  * Get file content.
862
864
  */
863
- getFile(deviceRef: DeviceRef, name: string, requestTimeout?: number, messageId?: string): Observable<Uint8Array | null | undefined>;
865
+ getFile(deviceRef: DeviceRef, name: string, requestTimeout?: number, messageId?: string): Observable<Uint8Array | number[] | null | undefined>;
864
866
  /**
865
867
  * Get decoded file content.
866
868
  *
@@ -1143,7 +1145,7 @@ export declare class MotionMasterReqResClient {
1143
1145
  resetKublerEncoderMultiturnPosition(deviceRef: DeviceRef): Observable<KublerEncoderRegisterCommunicationOsCommandResponse>;
1144
1146
  readOsCommandResponse(deviceRef: DeviceRef): Observable<OsCommandResponse>;
1145
1147
  runOsCommandAndWriteFsBuffer<T extends OsCommandResponse>(deviceRef: DeviceRef, command: Uint8Array, content: Uint8Array, commandTimeout?: number, responsePollingInterval?: number, osCommandMode?: boolean | OsCommandMode): Observable<T>;
1146
- runOsCommandAndReadFsBuffer<T extends OsCommandResponse>(deviceRef: DeviceRef, command: Uint8Array, commandTimeout: 30000, responsePollingInterval?: number, osCommandMode?: boolean | OsCommandMode): Observable<T>;
1148
+ runOsCommandAndReadFsBuffer<T extends OsCommandResponse>(deviceRef: DeviceRef, command: Uint8Array, commandTimeout?: number, responsePollingInterval?: number, osCommandMode?: boolean | OsCommandMode): Observable<T>;
1147
1149
  /**
1148
1150
  * Set halt bit.
1149
1151
  *
@@ -1260,5 +1262,279 @@ export declare class MotionMasterReqResClient {
1260
1262
  * @returns {Promise<void>} Resolves when all PDO parameter updates are complete.
1261
1263
  * The function processes and applies updates sequentially to ensure they are performed in order.
1262
1264
  */
1263
- updatePdoParameterGroupedValues(deviceRef: DeviceRef, pdoGroupedValues: number[][], pdoIndex: 0x1600 | 0x1A00): Promise<void>;
1265
+ updatePdoParameterGroupedValues(deviceRef: DeviceRef, pdoGroupedValues: number[][], pdoIndex: 0x1600 | 0x1a00): Promise<void>;
1266
+ /**
1267
+ * Reads the SMM parameter for a given device.
1268
+ *
1269
+ * @param deviceRef - The reference to the device to which the command will be sent.
1270
+ * @param index - The index of the SMM parameter to read.
1271
+ * @param subindex - The subindex of the SMM parameter to read. Defaults to 0.
1272
+ * @param commandTimeout - The timeout for the command in milliseconds. Defaults to 10,000 ms (10 seconds).
1273
+ * @param responsePollingInterval - The interval between polling attempts for a response in milliseconds. Defaults to 100 ms.
1274
+ *
1275
+ * @returns An observable that emits the response from the command once it is received.
1276
+ */
1277
+ readSmmParameter(deviceRef: DeviceRef, index: number, subindex?: number, commandTimeout?: number, responsePollingInterval?: number): Observable<OsCommandResponse>;
1278
+ /**
1279
+ * Reads the SMM parameter value as a number.
1280
+ *
1281
+ * This method reads a parameter from a device and extracts its value based on the provided `dataViewExtractor`.
1282
+ * The default behavior is to extract a 32-bit integer in little-endian format.
1283
+ *
1284
+ * @param deviceRef - A reference to the device from which the SMM parameter is being read.
1285
+ * @param index - The index of the parameter to read.
1286
+ * @param subindex - The subindex of the parameter (default is 0).
1287
+ * @param dataViewExtractor - A function that extracts a number from the `DataView` (default is `view.getInt32(0, true)`).
1288
+ *
1289
+ * @returns An observable that emits the extracted number value.
1290
+ *
1291
+ * @throws {Error} If the response buffer is empty or invalid.
1292
+ */
1293
+ readSmmParameterNumberValue(deviceRef: DeviceRef, index: number, subindex?: number, dataViewExtractor?: (view: DataView) => number): Observable<number>;
1294
+ /**
1295
+ * Reads the SMM parameter value as a string.
1296
+ *
1297
+ * This method reads a parameter from a device and decodes its value as a UTF-8 string from the response buffer.
1298
+ *
1299
+ * @param deviceRef - A reference to the device from which the SMM parameter is being read.
1300
+ * @param index - The index of the parameter to read.
1301
+ * @param subindex - The subindex of the parameter (default is 0).
1302
+ *
1303
+ * @returns An observable that emits the decoded string value.
1304
+ *
1305
+ * @throws {Error} If the response buffer is empty or invalid.
1306
+ */
1307
+ readSmmParameterStringValue(deviceRef: DeviceRef, index: number, subindex?: number): Observable<string>;
1308
+ /**
1309
+ * Reads the SMM parameter value as an array of numbers.
1310
+ *
1311
+ * This method reads a parameter from a device and returns the values as an array of numbers,
1312
+ * where each element corresponds to a byte from the response buffer.
1313
+ *
1314
+ * @param deviceRef - A reference to the device from which the SMM parameter is being read.
1315
+ * @param index - The index of the parameter to read.
1316
+ * @param subindex - The subindex of the parameter (default is 0).
1317
+ *
1318
+ * @returns An observable that emits an array of numbers, representing the byte values in the response buffer.
1319
+ *
1320
+ * @throws {Error} If the response buffer is empty or invalid.
1321
+ */
1322
+ readSmmParameterArrayValue(deviceRef: DeviceRef, index: number, subindex?: number): Observable<number[]>;
1323
+ /**
1324
+ * Reads the SMM firmware version from a device as an array of bytes.
1325
+ *
1326
+ * This method reads the firmware version (MCU Software Version 0x0001:00) of the device as an array of numbers.
1327
+ * The first byte represents the minor version, and the second byte represents the major version.
1328
+ *
1329
+ * @param deviceRef - A reference to the device from which the firmware version is being read.
1330
+ *
1331
+ * @returns An observable that emits an array of numbers, representing the byte values of the firmware version.
1332
+ */
1333
+ readSmmFirmareVersion(deviceRef: DeviceRef): Observable<number[]>;
1334
+ /**
1335
+ * Reads the SMM firmware version from a device as a number.
1336
+ *
1337
+ * This function retrieves a specific parameter from the device's SMM memory
1338
+ * and interprets the result as a 16-bit version number.
1339
+ *
1340
+ * @param deviceRef - A reference to the target device.
1341
+ * @returns An `Observable<number>` emitting the firmware version, represented as an integer.
1342
+ */
1343
+ readSmmFirmareVersionAsNumber(deviceRef: DeviceRef): Observable<number>;
1344
+ /**
1345
+ * Resolves the SMM parameter structure version for the specified device based on its firmware version.
1346
+ *
1347
+ * @param deviceRef - The reference to the target device.
1348
+ *
1349
+ * @returns An Observable that emits the appropriate SMM parameter structure version:
1350
+ * - 0x0041 for firmware versions below 2.3 (0x0203).
1351
+ * - 0x0203 for firmware versions 2.3 (0x0203) and above.
1352
+ *
1353
+ * @remarks
1354
+ * - The function first reads the firmware version of the device.
1355
+ * - Based on the firmware version, it returns the corresponding parameter structure version:
1356
+ * - If the firmware version is less than 0x0203, the parameter structure version is 0x0041.
1357
+ * - If the firmware version is 0x0203 or greater, the parameter structure version is 0x0203.
1358
+ */
1359
+ resolveSmmParameterStructureVersion(deviceRef: DeviceRef): Observable<number>;
1360
+ /**
1361
+ * Reads the SMM serial number from a device.
1362
+ *
1363
+ * This method reads the serial number of the device as a string.
1364
+ * The serial number is retrieved from the device using the appropriate SMM parameter (0x0003:00).
1365
+ *
1366
+ * @param deviceRef - A reference to the device from which the serial number is being read.
1367
+ *
1368
+ * @returns An observable that emits the serial number as a string.
1369
+ */
1370
+ readSmmSerialNumber(deviceRef: DeviceRef): Observable<string>;
1371
+ /**
1372
+ * Reads the SMM temperature value from a device.
1373
+ *
1374
+ * This method reads the temperature of the device as a number. The temperature is retrieved from the device
1375
+ * using the appropriate SMM parameter (0x000a:00).
1376
+ *
1377
+ * @param deviceRef - A reference to the device from which the temperature is being read.
1378
+ *
1379
+ * @returns An observable that emits the temperature value as a number.
1380
+ */
1381
+ readSmmTemperature(deviceRef: DeviceRef): Observable<number>;
1382
+ /**
1383
+ * Reads the SMM parameter check value from a device.
1384
+ *
1385
+ * This method reads the parameter check value from the device as a 16-bit unsigned integer. The value represents
1386
+ * the number of parameters available on the SMM and is retrieved from the device using the appropriate SMM parameter (0x000b:00).
1387
+ * and the custom data extraction function.
1388
+ *
1389
+ * @param deviceRef - A reference to the device from which the parameter check value is being read.
1390
+ *
1391
+ * @returns An observable that emits the parameter check value as a 16-bit unsigned integer, which represents
1392
+ * the number of parameters available on the SMM.
1393
+ */
1394
+ readSmmParameterCheck(deviceRef: DeviceRef): Observable<number>;
1395
+ /**
1396
+ * Reads the SMM maximum position discrepancy value from a device.
1397
+ *
1398
+ * This method reads the maximum position discrepancy value from the device as a 32-bit unsigned integer.
1399
+ * The value is retrieved from the device using the appropriate SMM parameter and the custom data extraction function.
1400
+ *
1401
+ * @param deviceRef - A reference to the device from which the maximum position discrepancy value is being read.
1402
+ *
1403
+ * @returns An observable that emits the maximum position discrepancy value as a 32-bit unsigned integer.
1404
+ */
1405
+ readSmmMaxPositionDiscrepancy(deviceRef: DeviceRef): Observable<number>;
1406
+ /**
1407
+ * Logs into the SMM for parameter download with the provided credentials.
1408
+ *
1409
+ * This function sends a login command to the device using the provided username and password. It returns an observable
1410
+ * that emits `true` if the login is successful and `false` otherwise. If the device is already logged in, the next login
1411
+ * attempt will fail unless the user logs out beforehand.
1412
+ *
1413
+ * @param deviceRef - The reference to the device to which the login command will be sent.
1414
+ * @param username - The optional username used for logging in to the SMM. If not provided, it will be treated as an empty string.
1415
+ * @param password - The password used for logging in to the SMM.
1416
+ *
1417
+ * @returns An observable that emits a boolean value indicating whether the login attempt succeeded.
1418
+ *
1419
+ * @remarks
1420
+ * If the device is already logged in, the next login attempt will fail unless the user logs out first.
1421
+ */
1422
+ loginToSmmForParameterDownload(deviceRef: DeviceRef, username: string, password: string): Observable<boolean>;
1423
+ /**
1424
+ * Logs into the SMM for software update with the provided credentials.
1425
+ *
1426
+ * This function sends a login command to the device using the provided username and password. It returns an observable
1427
+ * that emits `true` if the login is successful and `false` otherwise. If the device is already logged in, the next login
1428
+ * attempt will fail unless the user logs out beforehand.
1429
+ *
1430
+ * @param deviceRef - The reference to the device to which the login command will be sent.
1431
+ * @param username - The optional username used for logging in to the SMM. If not provided, it will be treated as an empty string.
1432
+ * @param password - The password used for logging in to the SMM.
1433
+ *
1434
+ * @returns An observable that emits a boolean value indicating whether the login attempt succeeded.
1435
+ *
1436
+ * @remarks
1437
+ * If the device is already logged in, the next login attempt will fail unless the user logs out first.
1438
+ */
1439
+ loginToSmmForSoftwareUpdate(deviceRef: DeviceRef, username: string, password: string): Observable<boolean>;
1440
+ /**
1441
+ * Logs out from the SMM.
1442
+ *
1443
+ * This function sends a logout command to the device and returns an observable that emits `true` if the logout
1444
+ * is successful and `false` otherwise. The command times out after 10 seconds if no response is received.
1445
+ *
1446
+ * @param deviceRef - The reference to the device to which the logout command will be sent.
1447
+ *
1448
+ * @returns An observable that emits a boolean value indicating whether the logout attempt succeeded.
1449
+ */
1450
+ logoutFromSmm(deviceRef: DeviceRef): Observable<boolean>;
1451
+ /**
1452
+ * Logs out from the SMM and then logs back in with the provided credentials for parameter download.
1453
+ *
1454
+ * This function first sends a logout command to the device, followed by a login command using the provided username
1455
+ * and password. It returns an observable that emits `true` if both the logout and login attempts are successful
1456
+ * and `false` otherwise. The login process is handled through the `loginToSmmForParameterDownload` function.
1457
+ *
1458
+ * @param deviceRef - The reference to the device to which the logout and login commands will be sent.
1459
+ * @param username - The username used for logging in to the SMM.
1460
+ * @param password - The password used for logging in to the SMM.
1461
+ *
1462
+ * @returns An observable that emits a boolean value indicating whether the relogin attempt succeeded.
1463
+ */
1464
+ reloginToSmmForParameterDownload(deviceRef: DeviceRef, username: string, password: string): Observable<boolean>;
1465
+ /**
1466
+ * Changes the SMM password for the specified device.
1467
+ *
1468
+ * @param deviceRef - A reference to the target device.
1469
+ * @param oldPassword - The current SMM password.
1470
+ * @param newPassword - The new password to set for the SMM.
1471
+ * @returns An Observable that emits `true` if the password change and SMM restart succeed, otherwise `false`.
1472
+ *
1473
+ * @remarks
1474
+ * A prior successful login is required before changing the password.
1475
+ * The new password must be at least 4 characters long.
1476
+ *
1477
+ * This function sends an acyclic command to update the password. If successful, it triggers an SMM restart.
1478
+ */
1479
+ changeSmmPassword(deviceRef: DeviceRef, oldPassword: string, newPassword: string): Observable<boolean>;
1480
+ /**
1481
+ * Triggers a restart for the specified device.
1482
+ *
1483
+ * This method sends a command to the device to trigger an SMM restart and waits for a response.
1484
+ * The method will return `true` if the restart was successful, otherwise `false`.
1485
+ *
1486
+ * @param deviceRef - The reference to the device to restart.
1487
+ * @param commandTimeout - The timeout in milliseconds for the command to complete. Default is 10000ms (10 seconds).
1488
+ * @param responsePollingInterval - The interval in milliseconds between polling for the response. Default is 100ms.
1489
+ *
1490
+ * @returns An Observable that emits `true` if the restart was successful, or `false` otherwise.
1491
+ */
1492
+ triggerSmmRestart(deviceRef: DeviceRef, commandTimeout?: number, responsePollingInterval?: number): Observable<boolean>;
1493
+ /**
1494
+ * Acknowledges an I/O failure on the specified device.
1495
+ *
1496
+ * This method sends a command to the device to acknowledge an I/O failure and waits for a response.
1497
+ * The method will return `true` if the acknowledgment was successful, otherwise `false`.
1498
+ *
1499
+ * @param deviceRef - The reference to the device to acknowledge the I/O failure on.
1500
+ * @param commandTimeout - The timeout in milliseconds for the command to complete. Default is 10000ms (10 seconds).
1501
+ * @param responsePollingInterval - The interval in milliseconds between polling for the response. Default is 100ms.
1502
+ *
1503
+ * @returns An Observable that emits `true` if the acknowledgment was successful, or `false` otherwise.
1504
+ */
1505
+ acknowledgeIoFailureOnSmm(deviceRef: DeviceRef, commandTimeout?: number, responsePollingInterval?: number): Observable<boolean>;
1506
+ configureSmmSoftwareUpdate(deviceRef: DeviceRef, fileSize: number): Observable<boolean>;
1507
+ updateSmmSoftware(deviceRef: DeviceRef, username: string, password: string, buffer: Uint8Array, crc: number, chunkSize?: number): Observable<boolean>;
1508
+ /**
1509
+ * Transmits SMM parameters to the specified device.
1510
+ *
1511
+ * @param deviceRef - The reference to the target device.
1512
+ * @param values - An array of data values to transmit.
1513
+ * @param parameterStructureVersion - The version of the parameter structure (default: 0x0041).
1514
+ *
1515
+ * @returns An Observable that emits `true` if the operation succeeds, or `false` if it fails, the `values` array is empty.
1516
+ *
1517
+ * @remarks
1518
+ * - If the `values` array is empty, the function immediately returns `false`.
1519
+ * - The `version` is prepended to the values array before packing.
1520
+ * - The function constructs an OS command for transmitting the parameters and writes the packed buffer to the file system.
1521
+ */
1522
+ transmitSmmParameters(deviceRef: DeviceRef, values: DataType[], parameterStructureVersion?: number): Observable<boolean>;
1523
+ /**
1524
+ * Loads the SMM parameters for verification on the specified device.
1525
+ *
1526
+ * This method sends a command to the device to load the SMM parameters for verification and waits for the response.
1527
+ * The device returns a buffer with all bits inverted. The OS command will invert the bits and reconstruct the buffer
1528
+ * into valid parameter values, which are then returned in sequence within the OS command response.
1529
+ *
1530
+ * @param deviceRef - The reference to the device from which the parameters should be loaded.
1531
+ * @returns An Observable that emits the response from the device, containing the valid parameter values for verification
1532
+ * after the buffer is processed and reconstructed.
1533
+ *
1534
+ * @throws Will throw an error if the command fails or times out.
1535
+ */
1536
+ loadSmmParametersForVerification(deviceRef: DeviceRef): Observable<SmmAcyclicHandlerLoadParametersForVerificationOsCommandResponse>;
1537
+ verifySmmParameters(deviceRef: DeviceRef, parameters: Pick<Parameter, 'value'>[], groupOrdinal: SmmVerificationGroupOrdinal): Observable<boolean>;
1538
+ loadSmmValidationFile(deviceRef: DeviceRef): Observable<OsCommandResponse>;
1539
+ validateSmmConfiguration(deviceRef: DeviceRef, report: Uint8Array, date: Date, username: string, password: string): Observable<boolean>;
1264
1540
  }