@zwave-js/cc 14.0.0-beta.4 → 14.0.0-beta.5
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/build/cjs/cc/AlarmSensorCC.js +381 -266
- package/build/cjs/cc/AlarmSensorCC.js.map +3 -3
- package/build/cjs/cc/AssociationCC.js +669 -503
- package/build/cjs/cc/AssociationCC.js.map +3 -3
- package/build/cjs/cc/AssociationGroupInfoCC.js +633 -492
- package/build/cjs/cc/AssociationGroupInfoCC.js.map +3 -3
- package/build/cjs/cc/BarrierOperatorCC.js +595 -429
- package/build/cjs/cc/BarrierOperatorCC.js.map +3 -3
- package/build/cjs/cc/BasicCC.js +354 -260
- package/build/cjs/cc/BasicCC.js.map +3 -3
- package/build/cjs/cc/BatteryCC.js +427 -345
- package/build/cjs/cc/BatteryCC.js.map +3 -3
- package/build/cjs/cc/BinarySensorCC.js +391 -276
- package/build/cjs/cc/BinarySensorCC.js.map +3 -3
- package/build/cjs/cc/BinarySwitchCC.js +347 -253
- package/build/cjs/cc/BinarySwitchCC.js.map +3 -3
- package/build/cjs/cc/CRC16CC.js +160 -85
- package/build/cjs/cc/CRC16CC.js.map +3 -3
- package/build/cjs/cc/CentralSceneCC.js +459 -324
- package/build/cjs/cc/CentralSceneCC.js.map +3 -3
- package/build/cjs/cc/ClimateControlScheduleCC.js +459 -293
- package/build/cjs/cc/ClimateControlScheduleCC.js.map +3 -3
- package/build/cjs/cc/ClockCC.js +254 -150
- package/build/cjs/cc/ClockCC.js.map +3 -3
- package/build/cjs/cc/ColorSwitchCC.js +758 -610
- package/build/cjs/cc/ColorSwitchCC.js.map +3 -3
- package/build/cjs/cc/ConfigurationCC.js +1700 -1453
- package/build/cjs/cc/ConfigurationCC.js.map +3 -3
- package/build/cjs/cc/DeviceResetLocallyCC.js +125 -49
- package/build/cjs/cc/DeviceResetLocallyCC.js.map +3 -3
- package/build/cjs/cc/DoorLockCC.js +904 -777
- package/build/cjs/cc/DoorLockCC.js.map +3 -3
- package/build/cjs/cc/DoorLockLoggingCC.js +321 -206
- package/build/cjs/cc/DoorLockLoggingCC.js.map +3 -3
- package/build/cjs/cc/EnergyProductionCC.js +249 -160
- package/build/cjs/cc/EnergyProductionCC.js.map +3 -3
- package/build/cjs/cc/EntryControlCC.js +619 -458
- package/build/cjs/cc/EntryControlCC.js.map +3 -3
- package/build/cjs/cc/FirmwareUpdateMetaDataCC.js +898 -698
- package/build/cjs/cc/FirmwareUpdateMetaDataCC.js.map +3 -3
- package/build/cjs/cc/HailCC.js +57 -11
- package/build/cjs/cc/HailCC.js.map +2 -2
- package/build/cjs/cc/HumidityControlModeCC.js +359 -233
- package/build/cjs/cc/HumidityControlModeCC.js.map +3 -3
- package/build/cjs/cc/HumidityControlOperatingStateCC.js +189 -103
- package/build/cjs/cc/HumidityControlOperatingStateCC.js.map +3 -3
- package/build/cjs/cc/HumidityControlSetpointCC.js +682 -495
- package/build/cjs/cc/HumidityControlSetpointCC.js.map +3 -3
- package/build/cjs/cc/InclusionControllerCC.js +205 -114
- package/build/cjs/cc/InclusionControllerCC.js.map +3 -3
- package/build/cjs/cc/IndicatorCC.js +897 -736
- package/build/cjs/cc/IndicatorCC.js.map +3 -3
- package/build/cjs/cc/IrrigationCC.js +1651 -1405
- package/build/cjs/cc/IrrigationCC.js.map +3 -3
- package/build/cjs/cc/LanguageCC.js +268 -171
- package/build/cjs/cc/LanguageCC.js.map +3 -3
- package/build/cjs/cc/LockCC.js +254 -154
- package/build/cjs/cc/LockCC.js.map +3 -3
- package/build/cjs/cc/ManufacturerProprietaryCC.js +189 -129
- package/build/cjs/cc/ManufacturerProprietaryCC.js.map +2 -2
- package/build/cjs/cc/ManufacturerSpecificCC.js +319 -213
- package/build/cjs/cc/ManufacturerSpecificCC.js.map +3 -3
- package/build/cjs/cc/MeterCC.js +827 -707
- package/build/cjs/cc/MeterCC.js.map +3 -3
- package/build/cjs/cc/MultiChannelAssociationCC.js +612 -478
- package/build/cjs/cc/MultiChannelAssociationCC.js.map +3 -3
- package/build/cjs/cc/MultiChannelCC.js +1037 -819
- package/build/cjs/cc/MultiChannelCC.js.map +3 -3
- package/build/cjs/cc/MultiCommandCC.js +172 -97
- package/build/cjs/cc/MultiCommandCC.js.map +3 -3
- package/build/cjs/cc/MultilevelSensorCC.js +589 -449
- package/build/cjs/cc/MultilevelSensorCC.js.map +3 -3
- package/build/cjs/cc/MultilevelSwitchCC.js +587 -439
- package/build/cjs/cc/MultilevelSwitchCC.js.map +3 -3
- package/build/cjs/cc/NoOperationCC.js +89 -27
- package/build/cjs/cc/NoOperationCC.js.map +2 -2
- package/build/cjs/cc/NodeNamingCC.js +417 -277
- package/build/cjs/cc/NodeNamingCC.js.map +3 -3
- package/build/cjs/cc/NotificationCC.js +972 -818
- package/build/cjs/cc/NotificationCC.js.map +3 -3
- package/build/cjs/cc/PowerlevelCC.js +450 -303
- package/build/cjs/cc/PowerlevelCC.js.map +3 -3
- package/build/cjs/cc/ProtectionCC.js +686 -494
- package/build/cjs/cc/ProtectionCC.js.map +3 -3
- package/build/cjs/cc/SceneActivationCC.js +165 -97
- package/build/cjs/cc/SceneActivationCC.js.map +3 -3
- package/build/cjs/cc/SceneActuatorConfigurationCC.js +346 -243
- package/build/cjs/cc/SceneActuatorConfigurationCC.js.map +3 -3
- package/build/cjs/cc/SceneControllerConfigurationCC.js +401 -298
- package/build/cjs/cc/SceneControllerConfigurationCC.js.map +3 -3
- package/build/cjs/cc/ScheduleEntryLockCC.js +1552 -1272
- package/build/cjs/cc/ScheduleEntryLockCC.js.map +3 -3
- package/build/cjs/cc/Security2CC.js +1483 -1219
- package/build/cjs/cc/Security2CC.js.map +3 -3
- package/build/cjs/cc/SecurityCC.js +839 -619
- package/build/cjs/cc/SecurityCC.js.map +3 -3
- package/build/cjs/cc/SoundSwitchCC.js +707 -515
- package/build/cjs/cc/SoundSwitchCC.js.map +3 -3
- package/build/cjs/cc/SupervisionCC.js +327 -237
- package/build/cjs/cc/SupervisionCC.js.map +3 -3
- package/build/cjs/cc/ThermostatFanModeCC.js +386 -263
- package/build/cjs/cc/ThermostatFanModeCC.js.map +3 -3
- package/build/cjs/cc/ThermostatFanStateCC.js +192 -106
- package/build/cjs/cc/ThermostatFanStateCC.js.map +3 -3
- package/build/cjs/cc/ThermostatModeCC.js +425 -302
- package/build/cjs/cc/ThermostatModeCC.js.map +3 -3
- package/build/cjs/cc/ThermostatOperatingStateCC.js +188 -102
- package/build/cjs/cc/ThermostatOperatingStateCC.js.map +3 -3
- package/build/cjs/cc/ThermostatSetbackCC.js +277 -173
- package/build/cjs/cc/ThermostatSetbackCC.js.map +3 -3
- package/build/cjs/cc/ThermostatSetpointCC.js +645 -491
- package/build/cjs/cc/ThermostatSetpointCC.js.map +3 -3
- package/build/cjs/cc/TimeCC.js +515 -353
- package/build/cjs/cc/TimeCC.js.map +3 -3
- package/build/cjs/cc/TimeParametersCC.js +302 -202
- package/build/cjs/cc/TimeParametersCC.js.map +3 -3
- package/build/cjs/cc/TransportServiceCC.js +433 -315
- package/build/cjs/cc/TransportServiceCC.js.map +3 -3
- package/build/cjs/cc/UserCodeCC.js +1385 -1102
- package/build/cjs/cc/UserCodeCC.js.map +3 -3
- package/build/cjs/cc/VersionCC.js +696 -562
- package/build/cjs/cc/VersionCC.js.map +3 -3
- package/build/cjs/cc/WakeUpCC.js +499 -346
- package/build/cjs/cc/WakeUpCC.js.map +3 -3
- package/build/cjs/cc/WindowCoveringCC.js +626 -478
- package/build/cjs/cc/WindowCoveringCC.js.map +3 -3
- package/build/cjs/cc/ZWaveLongRangeCC.js +57 -10
- package/build/cjs/cc/ZWaveLongRangeCC.js.map +2 -2
- package/build/cjs/cc/ZWavePlusCC.js +233 -159
- package/build/cjs/cc/ZWavePlusCC.js.map +3 -3
- package/build/cjs/cc/ZWaveProtocolCC.js +1515 -948
- package/build/cjs/cc/ZWaveProtocolCC.js.map +3 -3
- package/build/cjs/cc/manufacturerProprietary/Decorators.d.ts +4 -4
- package/build/cjs/cc/manufacturerProprietary/Decorators.js.map +1 -1
- package/build/cjs/cc/manufacturerProprietary/FibaroCC.js +395 -274
- package/build/cjs/cc/manufacturerProprietary/FibaroCC.js.map +3 -3
- package/build/cjs/lib/CommandClassDecorators.d.ts +11 -15
- package/build/cjs/lib/CommandClassDecorators.js +19 -20
- package/build/cjs/lib/CommandClassDecorators.js.map +2 -2
- package/build/cjs/lib/Security2/Extension.d.ts +1 -1
- package/build/cjs/lib/Security2/Extension.js +217 -126
- package/build/cjs/lib/Security2/Extension.js.map +3 -3
- package/build/esm/cc/AlarmSensorCC.d.ts.map +1 -1
- package/build/esm/cc/AlarmSensorCC.js +389 -291
- package/build/esm/cc/AlarmSensorCC.js.map +1 -1
- package/build/esm/cc/AssociationCC.d.ts.map +1 -1
- package/build/esm/cc/AssociationCC.js +678 -537
- package/build/esm/cc/AssociationCC.js.map +1 -1
- package/build/esm/cc/AssociationGroupInfoCC.d.ts.map +1 -1
- package/build/esm/cc/AssociationGroupInfoCC.js +659 -539
- package/build/esm/cc/AssociationGroupInfoCC.js.map +1 -1
- package/build/esm/cc/BarrierOperatorCC.d.ts.map +1 -1
- package/build/esm/cc/BarrierOperatorCC.js +634 -493
- package/build/esm/cc/BarrierOperatorCC.js.map +1 -1
- package/build/esm/cc/BasicCC.d.ts.map +1 -1
- package/build/esm/cc/BasicCC.js +380 -302
- package/build/esm/cc/BasicCC.js.map +1 -1
- package/build/esm/cc/BatteryCC.d.ts.map +1 -1
- package/build/esm/cc/BatteryCC.js +449 -384
- package/build/esm/cc/BatteryCC.js.map +1 -1
- package/build/esm/cc/BinarySensorCC.d.ts.map +1 -1
- package/build/esm/cc/BinarySensorCC.js +395 -297
- package/build/esm/cc/BinarySensorCC.js.map +1 -1
- package/build/esm/cc/BinarySwitchCC.d.ts.map +1 -1
- package/build/esm/cc/BinarySwitchCC.js +353 -274
- package/build/esm/cc/BinarySwitchCC.js.map +1 -1
- package/build/esm/cc/CRC16CC.js +162 -98
- package/build/esm/cc/CRC16CC.js.map +1 -1
- package/build/esm/cc/CentralSceneCC.d.ts.map +1 -1
- package/build/esm/cc/CentralSceneCC.js +465 -351
- package/build/esm/cc/CentralSceneCC.js.map +1 -1
- package/build/esm/cc/ClimateControlScheduleCC.d.ts.map +1 -1
- package/build/esm/cc/ClimateControlScheduleCC.js +454 -313
- package/build/esm/cc/ClimateControlScheduleCC.js.map +1 -1
- package/build/esm/cc/ClockCC.js +248 -159
- package/build/esm/cc/ClockCC.js.map +1 -1
- package/build/esm/cc/ColorSwitchCC.d.ts.map +1 -1
- package/build/esm/cc/ColorSwitchCC.js +802 -677
- package/build/esm/cc/ColorSwitchCC.js.map +1 -1
- package/build/esm/cc/ConfigurationCC.js +1899 -1687
- package/build/esm/cc/ConfigurationCC.js.map +1 -1
- package/build/esm/cc/DeviceResetLocallyCC.js +124 -59
- package/build/esm/cc/DeviceResetLocallyCC.js.map +1 -1
- package/build/esm/cc/DoorLockCC.d.ts.map +1 -1
- package/build/esm/cc/DoorLockCC.js +951 -849
- package/build/esm/cc/DoorLockCC.js.map +1 -1
- package/build/esm/cc/DoorLockLoggingCC.d.ts.map +1 -1
- package/build/esm/cc/DoorLockLoggingCC.js +316 -218
- package/build/esm/cc/DoorLockLoggingCC.js.map +1 -1
- package/build/esm/cc/EnergyProductionCC.js +240 -164
- package/build/esm/cc/EnergyProductionCC.js.map +1 -1
- package/build/esm/cc/EntryControlCC.d.ts.map +1 -1
- package/build/esm/cc/EntryControlCC.js +629 -493
- package/build/esm/cc/EntryControlCC.js.map +1 -1
- package/build/esm/cc/FirmwareUpdateMetaDataCC.d.ts.map +1 -1
- package/build/esm/cc/FirmwareUpdateMetaDataCC.js +938 -769
- package/build/esm/cc/FirmwareUpdateMetaDataCC.js.map +1 -1
- package/build/esm/cc/HailCC.js +51 -12
- package/build/esm/cc/HailCC.js.map +1 -1
- package/build/esm/cc/HumidityControlModeCC.d.ts.map +1 -1
- package/build/esm/cc/HumidityControlModeCC.js +357 -250
- package/build/esm/cc/HumidityControlModeCC.js.map +1 -1
- package/build/esm/cc/HumidityControlOperatingStateCC.d.ts.map +1 -1
- package/build/esm/cc/HumidityControlOperatingStateCC.js +182 -109
- package/build/esm/cc/HumidityControlOperatingStateCC.js.map +1 -1
- package/build/esm/cc/HumidityControlSetpointCC.d.ts.map +1 -1
- package/build/esm/cc/HumidityControlSetpointCC.js +706 -546
- package/build/esm/cc/HumidityControlSetpointCC.js.map +1 -1
- package/build/esm/cc/InclusionControllerCC.js +197 -119
- package/build/esm/cc/InclusionControllerCC.js.map +1 -1
- package/build/esm/cc/IndicatorCC.js +973 -835
- package/build/esm/cc/IndicatorCC.js.map +1 -1
- package/build/esm/cc/IrrigationCC.d.ts.map +1 -1
- package/build/esm/cc/IrrigationCC.js +1697 -1496
- package/build/esm/cc/IrrigationCC.js.map +1 -1
- package/build/esm/cc/LanguageCC.d.ts.map +1 -1
- package/build/esm/cc/LanguageCC.js +266 -184
- package/build/esm/cc/LanguageCC.js.map +1 -1
- package/build/esm/cc/LockCC.d.ts.map +1 -1
- package/build/esm/cc/LockCC.js +247 -162
- package/build/esm/cc/LockCC.js.map +1 -1
- package/build/esm/cc/ManufacturerProprietaryCC.js +192 -141
- package/build/esm/cc/ManufacturerProprietaryCC.js.map +1 -1
- package/build/esm/cc/ManufacturerSpecificCC.d.ts.map +1 -1
- package/build/esm/cc/ManufacturerSpecificCC.js +312 -223
- package/build/esm/cc/ManufacturerSpecificCC.js.map +1 -1
- package/build/esm/cc/MeterCC.d.ts.map +1 -1
- package/build/esm/cc/MeterCC.js +896 -795
- package/build/esm/cc/MeterCC.js.map +1 -1
- package/build/esm/cc/MultiChannelAssociationCC.d.ts.map +1 -1
- package/build/esm/cc/MultiChannelAssociationCC.js +631 -518
- package/build/esm/cc/MultiChannelAssociationCC.js.map +1 -1
- package/build/esm/cc/MultiChannelCC.d.ts.map +1 -1
- package/build/esm/cc/MultiChannelCC.js +1106 -921
- package/build/esm/cc/MultiChannelCC.js.map +1 -1
- package/build/esm/cc/MultiCommandCC.js +166 -102
- package/build/esm/cc/MultiCommandCC.js.map +1 -1
- package/build/esm/cc/MultilevelSensorCC.d.ts.map +1 -1
- package/build/esm/cc/MultilevelSensorCC.js +616 -497
- package/build/esm/cc/MultilevelSensorCC.js.map +1 -1
- package/build/esm/cc/MultilevelSwitchCC.d.ts.map +1 -1
- package/build/esm/cc/MultilevelSwitchCC.js +621 -496
- package/build/esm/cc/MultilevelSwitchCC.js.map +1 -1
- package/build/esm/cc/NoOperationCC.js +82 -29
- package/build/esm/cc/NoOperationCC.js.map +1 -1
- package/build/esm/cc/NodeNamingCC.d.ts.map +1 -1
- package/build/esm/cc/NodeNamingCC.js +413 -294
- package/build/esm/cc/NodeNamingCC.js.map +1 -1
- package/build/esm/cc/NotificationCC.d.ts.map +1 -1
- package/build/esm/cc/NotificationCC.js +1097 -966
- package/build/esm/cc/NotificationCC.js.map +1 -1
- package/build/esm/cc/PowerlevelCC.js +437 -311
- package/build/esm/cc/PowerlevelCC.js.map +1 -1
- package/build/esm/cc/ProtectionCC.d.ts.map +1 -1
- package/build/esm/cc/ProtectionCC.js +704 -543
- package/build/esm/cc/ProtectionCC.js.map +1 -1
- package/build/esm/cc/SceneActivationCC.d.ts.map +1 -1
- package/build/esm/cc/SceneActivationCC.js +157 -100
- package/build/esm/cc/SceneActivationCC.js.map +1 -1
- package/build/esm/cc/SceneActuatorConfigurationCC.js +357 -269
- package/build/esm/cc/SceneActuatorConfigurationCC.js.map +1 -1
- package/build/esm/cc/SceneControllerConfigurationCC.js +434 -346
- package/build/esm/cc/SceneControllerConfigurationCC.js.map +1 -1
- package/build/esm/cc/ScheduleEntryLockCC.d.ts.map +1 -1
- package/build/esm/cc/ScheduleEntryLockCC.js +1596 -1357
- package/build/esm/cc/ScheduleEntryLockCC.js.map +1 -1
- package/build/esm/cc/Security2CC.js +1633 -1406
- package/build/esm/cc/Security2CC.js.map +1 -1
- package/build/esm/cc/SecurityCC.js +876 -687
- package/build/esm/cc/SecurityCC.js.map +1 -1
- package/build/esm/cc/SoundSwitchCC.d.ts.map +1 -1
- package/build/esm/cc/SoundSwitchCC.js +689 -526
- package/build/esm/cc/SoundSwitchCC.js.map +1 -1
- package/build/esm/cc/SupervisionCC.js +349 -272
- package/build/esm/cc/SupervisionCC.js.map +1 -1
- package/build/esm/cc/ThermostatFanModeCC.d.ts.map +1 -1
- package/build/esm/cc/ThermostatFanModeCC.js +388 -284
- package/build/esm/cc/ThermostatFanModeCC.js.map +1 -1
- package/build/esm/cc/ThermostatFanStateCC.d.ts.map +1 -1
- package/build/esm/cc/ThermostatFanStateCC.js +184 -111
- package/build/esm/cc/ThermostatFanStateCC.js.map +1 -1
- package/build/esm/cc/ThermostatModeCC.d.ts.map +1 -1
- package/build/esm/cc/ThermostatModeCC.js +435 -331
- package/build/esm/cc/ThermostatModeCC.js.map +1 -1
- package/build/esm/cc/ThermostatOperatingStateCC.d.ts.map +1 -1
- package/build/esm/cc/ThermostatOperatingStateCC.js +180 -107
- package/build/esm/cc/ThermostatOperatingStateCC.js.map +1 -1
- package/build/esm/cc/ThermostatSetbackCC.js +274 -185
- package/build/esm/cc/ThermostatSetbackCC.js.map +1 -1
- package/build/esm/cc/ThermostatSetpointCC.d.ts.map +1 -1
- package/build/esm/cc/ThermostatSetpointCC.js +674 -543
- package/build/esm/cc/ThermostatSetpointCC.js.map +1 -1
- package/build/esm/cc/TimeCC.js +499 -360
- package/build/esm/cc/TimeCC.js.map +1 -1
- package/build/esm/cc/TimeParametersCC.d.ts.map +1 -1
- package/build/esm/cc/TimeParametersCC.js +296 -211
- package/build/esm/cc/TimeParametersCC.js.map +1 -1
- package/build/esm/cc/TransportServiceCC.js +464 -363
- package/build/esm/cc/TransportServiceCC.js.map +1 -1
- package/build/esm/cc/UserCodeCC.d.ts.map +1 -1
- package/build/esm/cc/UserCodeCC.js +1443 -1205
- package/build/esm/cc/UserCodeCC.js.map +1 -1
- package/build/esm/cc/VersionCC.d.ts.map +1 -1
- package/build/esm/cc/VersionCC.js +744 -635
- package/build/esm/cc/VersionCC.js.map +1 -1
- package/build/esm/cc/WakeUpCC.d.ts.map +1 -1
- package/build/esm/cc/WakeUpCC.js +494 -364
- package/build/esm/cc/WakeUpCC.js.map +1 -1
- package/build/esm/cc/WindowCoveringCC.d.ts.map +1 -1
- package/build/esm/cc/WindowCoveringCC.js +655 -530
- package/build/esm/cc/WindowCoveringCC.js.map +1 -1
- package/build/esm/cc/ZWaveLongRangeCC.js +51 -11
- package/build/esm/cc/ZWaveLongRangeCC.js.map +1 -1
- package/build/esm/cc/ZWavePlusCC.d.ts.map +1 -1
- package/build/esm/cc/ZWavePlusCC.js +223 -162
- package/build/esm/cc/ZWavePlusCC.js.map +1 -1
- package/build/esm/cc/ZWaveProtocolCC.js +1443 -953
- package/build/esm/cc/ZWaveProtocolCC.js.map +1 -1
- package/build/esm/cc/manufacturerProprietary/Decorators.d.ts +4 -4
- package/build/esm/cc/manufacturerProprietary/Decorators.d.ts.map +1 -1
- package/build/esm/cc/manufacturerProprietary/FibaroCC.js +390 -286
- package/build/esm/cc/manufacturerProprietary/FibaroCC.js.map +1 -1
- package/build/esm/lib/CommandClassDecorators.d.ts +11 -15
- package/build/esm/lib/CommandClassDecorators.d.ts.map +1 -1
- package/build/esm/lib/CommandClassDecorators.js +24 -24
- package/build/esm/lib/CommandClassDecorators.js.map +1 -1
- package/build/esm/lib/Security2/Extension.d.ts +1 -1
- package/build/esm/lib/Security2/Extension.d.ts.map +1 -1
- package/build/esm/lib/Security2/Extension.js +207 -123
- package/build/esm/lib/Security2/Extension.js.map +1 -1
- package/package.json +6 -6
|
@@ -1,10 +1,37 @@
|
|
|
1
|
-
var
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
|
|
2
|
+
function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
|
|
3
|
+
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
|
|
4
|
+
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
|
|
5
|
+
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
|
|
6
|
+
var _, done = false;
|
|
7
|
+
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
8
|
+
var context = {};
|
|
9
|
+
for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
|
|
10
|
+
for (var p in contextIn.access) context.access[p] = contextIn.access[p];
|
|
11
|
+
context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
|
|
12
|
+
var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
|
|
13
|
+
if (kind === "accessor") {
|
|
14
|
+
if (result === void 0) continue;
|
|
15
|
+
if (result === null || typeof result !== "object") throw new TypeError("Object expected");
|
|
16
|
+
if (_ = accept(result.get)) descriptor.get = _;
|
|
17
|
+
if (_ = accept(result.set)) descriptor.set = _;
|
|
18
|
+
if (_ = accept(result.init)) initializers.unshift(_);
|
|
19
|
+
}
|
|
20
|
+
else if (_ = accept(result)) {
|
|
21
|
+
if (kind === "field") initializers.unshift(_);
|
|
22
|
+
else descriptor[key] = _;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
if (target) Object.defineProperty(target, contextIn.name, descriptor);
|
|
26
|
+
done = true;
|
|
27
|
+
};
|
|
28
|
+
var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) {
|
|
29
|
+
var useValue = arguments.length > 2;
|
|
30
|
+
for (var i = 0; i < initializers.length; i++) {
|
|
31
|
+
value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
|
|
32
|
+
}
|
|
33
|
+
return useValue ? value : void 0;
|
|
6
34
|
};
|
|
7
|
-
var TransportServiceCCFirstSegment_1, TransportServiceCCSubsequentSegment_1, TransportServiceCCSegmentRequest_1, TransportServiceCCSegmentComplete_1, TransportServiceCCSegmentWait_1;
|
|
8
35
|
import { CRC16_CCITT, CommandClasses, ZWaveError, ZWaveErrorCodes, validatePayload, } from "@zwave-js/core/safe";
|
|
9
36
|
import { Bytes } from "@zwave-js/shared/safe";
|
|
10
37
|
import { buffer2hex } from "@zwave-js/shared/safe";
|
|
@@ -29,12 +56,24 @@ export const TransportServiceTimeouts = {
|
|
|
29
56
|
/** Waiting time between segments when sending more than {@link RELAXED_TIMING_THRESHOLD} segments at data rate R3 */
|
|
30
57
|
relaxedTimingDelayR3: 15,
|
|
31
58
|
};
|
|
32
|
-
let TransportServiceCC =
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
59
|
+
let TransportServiceCC = (() => {
|
|
60
|
+
let _classDecorators = [commandClass(CommandClasses["Transport Service"]), implementedVersion(2)];
|
|
61
|
+
let _classDescriptor;
|
|
62
|
+
let _classExtraInitializers = [];
|
|
63
|
+
let _classThis;
|
|
64
|
+
let _classSuper = CommandClass;
|
|
65
|
+
var TransportServiceCC = class extends _classSuper {
|
|
66
|
+
static { _classThis = this; }
|
|
67
|
+
static {
|
|
68
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
69
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
70
|
+
TransportServiceCC = _classThis = _classDescriptor.value;
|
|
71
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
72
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
return TransportServiceCC = _classThis;
|
|
76
|
+
})();
|
|
38
77
|
export { TransportServiceCC };
|
|
39
78
|
/** @publicAPI */
|
|
40
79
|
export function isTransportServiceEncapsulation(command) {
|
|
@@ -42,273 +81,297 @@ export function isTransportServiceEncapsulation(command) {
|
|
|
42
81
|
&& (command.ccCommand === TransportServiceCommand.FirstSegment
|
|
43
82
|
|| command.ccCommand === TransportServiceCommand.SubsequentSegment));
|
|
44
83
|
}
|
|
45
|
-
let TransportServiceCCFirstSegment =
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
headerExtension
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
84
|
+
let TransportServiceCCFirstSegment = (() => {
|
|
85
|
+
let _classDecorators = [CCCommand(TransportServiceCommand.FirstSegment)];
|
|
86
|
+
let _classDescriptor;
|
|
87
|
+
let _classExtraInitializers = [];
|
|
88
|
+
let _classThis;
|
|
89
|
+
let _classSuper = TransportServiceCC;
|
|
90
|
+
var TransportServiceCCFirstSegment = class extends _classSuper {
|
|
91
|
+
static { _classThis = this; }
|
|
92
|
+
static {
|
|
93
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
94
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
95
|
+
TransportServiceCCFirstSegment = _classThis = _classDescriptor.value;
|
|
96
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
97
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
98
|
+
}
|
|
99
|
+
constructor(options) {
|
|
100
|
+
super(options);
|
|
101
|
+
this.datagramSize = options.datagramSize;
|
|
102
|
+
this.sessionId = options.sessionId;
|
|
103
|
+
this.headerExtension = options.headerExtension;
|
|
104
|
+
this.partialDatagram = options.partialDatagram;
|
|
105
|
+
}
|
|
106
|
+
static from(raw, ctx) {
|
|
107
|
+
// Deserialization has already split the datagram size from the ccCommand.
|
|
108
|
+
// Therefore we have one more payload byte
|
|
109
|
+
validatePayload(raw.payload.length >= 6); // 2 bytes dgram size, 1 byte sessid/ext, 1+ bytes payload, 2 bytes checksum
|
|
110
|
+
// Verify the CRC
|
|
111
|
+
const headerBuffer = Bytes.from([
|
|
112
|
+
CommandClasses["Transport Service"],
|
|
113
|
+
TransportServiceCommand.FirstSegment | raw.payload[0],
|
|
114
|
+
]);
|
|
115
|
+
const ccBuffer = raw.payload.subarray(1, -2);
|
|
116
|
+
let expectedCRC = CRC16_CCITT(headerBuffer);
|
|
117
|
+
expectedCRC = CRC16_CCITT(ccBuffer, expectedCRC);
|
|
118
|
+
const actualCRC = raw.payload.readUInt16BE(raw.payload.length - 2);
|
|
119
|
+
validatePayload(expectedCRC === actualCRC);
|
|
120
|
+
const datagramSize = raw.payload.readUInt16BE(0);
|
|
121
|
+
const sessionId = raw.payload[2] >>> 4;
|
|
122
|
+
let payloadOffset = 3;
|
|
123
|
+
// If there is a header extension, read it
|
|
124
|
+
const hasHeaderExtension = !!(raw.payload[2] & 0b1000);
|
|
125
|
+
let headerExtension;
|
|
126
|
+
if (hasHeaderExtension) {
|
|
127
|
+
const extLength = raw.payload[3];
|
|
128
|
+
headerExtension = raw.payload.subarray(4, 4 + extLength);
|
|
129
|
+
payloadOffset += 1 + extLength;
|
|
130
|
+
}
|
|
131
|
+
const partialDatagram = raw.payload.subarray(payloadOffset, -2);
|
|
132
|
+
// A node supporting the Transport Service Command Class, version 2
|
|
133
|
+
// MUST NOT send Transport Service segments with the Payload field longer than 39 bytes.
|
|
134
|
+
validatePayload(partialDatagram.length <= MAX_SEGMENT_SIZE);
|
|
135
|
+
return new this({
|
|
136
|
+
nodeId: ctx.sourceNodeId,
|
|
137
|
+
datagramSize,
|
|
138
|
+
sessionId,
|
|
139
|
+
headerExtension,
|
|
140
|
+
partialDatagram,
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
datagramSize;
|
|
144
|
+
sessionId;
|
|
145
|
+
headerExtension;
|
|
146
|
+
partialDatagram;
|
|
147
|
+
encapsulated;
|
|
148
|
+
serialize(ctx) {
|
|
149
|
+
// Transport Service re-uses the lower 3 bits of the ccCommand as payload
|
|
150
|
+
this.ccCommand = (this.ccCommand & 0b11111_000)
|
|
151
|
+
| ((this.datagramSize >>> 8) & 0b111);
|
|
152
|
+
const ext = !!this.headerExtension && this.headerExtension.length >= 1;
|
|
153
|
+
this.payload = Bytes.from([
|
|
154
|
+
this.datagramSize & 0xff,
|
|
155
|
+
((this.sessionId & 0b1111) << 4) | (ext ? 0b1000 : 0),
|
|
156
|
+
]);
|
|
157
|
+
if (ext) {
|
|
158
|
+
this.payload = Bytes.concat([
|
|
159
|
+
this.payload,
|
|
160
|
+
Bytes.from([this.headerExtension.length]),
|
|
161
|
+
this.headerExtension,
|
|
162
|
+
]);
|
|
163
|
+
}
|
|
105
164
|
this.payload = Bytes.concat([
|
|
106
165
|
this.payload,
|
|
107
|
-
|
|
108
|
-
|
|
166
|
+
this.partialDatagram,
|
|
167
|
+
Bytes.alloc(2, 0), // checksum
|
|
109
168
|
]);
|
|
169
|
+
// Compute and save the CRC16 in the payload
|
|
170
|
+
// The CC header is included in the CRC computation
|
|
171
|
+
const headerBuffer = Bytes.from([this.ccId, this.ccCommand]);
|
|
172
|
+
let crc = CRC16_CCITT(headerBuffer);
|
|
173
|
+
crc = CRC16_CCITT(this.payload.subarray(0, -2), crc);
|
|
174
|
+
// Write the checksum into the last two bytes of the payload
|
|
175
|
+
this.payload.writeUInt16BE(crc, this.payload.length - 2);
|
|
176
|
+
return super.serialize(ctx);
|
|
110
177
|
}
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
toLogEntry(ctx) {
|
|
141
|
-
return {
|
|
142
|
-
...super.toLogEntry(ctx),
|
|
143
|
-
message: {
|
|
144
|
-
"session ID": this.sessionId,
|
|
145
|
-
"datagram size": this.datagramSize,
|
|
146
|
-
"byte range": `0...${this.partialDatagram.length - 1}`,
|
|
147
|
-
payload: buffer2hex(this.partialDatagram),
|
|
148
|
-
},
|
|
149
|
-
};
|
|
150
|
-
}
|
|
151
|
-
};
|
|
152
|
-
TransportServiceCCFirstSegment = TransportServiceCCFirstSegment_1 = __decorate([
|
|
153
|
-
CCCommand(TransportServiceCommand.FirstSegment)
|
|
154
|
-
// @expectedCCResponse(TransportServiceCCReport)
|
|
155
|
-
], TransportServiceCCFirstSegment);
|
|
178
|
+
expectMoreMessages() {
|
|
179
|
+
return true; // The FirstSegment message always expects more messages
|
|
180
|
+
}
|
|
181
|
+
getPartialCCSessionId() {
|
|
182
|
+
// Only use the session ID to identify the session, not the CC command
|
|
183
|
+
return { ccCommand: undefined, sessionId: this.sessionId };
|
|
184
|
+
}
|
|
185
|
+
computeEncapsulationOverhead() {
|
|
186
|
+
// Transport Service CC (first segment) adds 1 byte datagram size, 1 byte Session ID/..., 2 bytes checksum and (0 OR n+1) bytes header extension
|
|
187
|
+
return (super.computeEncapsulationOverhead()
|
|
188
|
+
+ 4
|
|
189
|
+
+ (this.headerExtension?.length
|
|
190
|
+
? 1 + this.headerExtension.length
|
|
191
|
+
: 0));
|
|
192
|
+
}
|
|
193
|
+
toLogEntry(ctx) {
|
|
194
|
+
return {
|
|
195
|
+
...super.toLogEntry(ctx),
|
|
196
|
+
message: {
|
|
197
|
+
"session ID": this.sessionId,
|
|
198
|
+
"datagram size": this.datagramSize,
|
|
199
|
+
"byte range": `0...${this.partialDatagram.length - 1}`,
|
|
200
|
+
payload: buffer2hex(this.partialDatagram),
|
|
201
|
+
},
|
|
202
|
+
};
|
|
203
|
+
}
|
|
204
|
+
};
|
|
205
|
+
return TransportServiceCCFirstSegment = _classThis;
|
|
206
|
+
})();
|
|
156
207
|
export { TransportServiceCCFirstSegment };
|
|
157
|
-
let TransportServiceCCSubsequentSegment =
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
const
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
datagramSize;
|
|
207
|
-
datagramOffset;
|
|
208
|
-
sessionId;
|
|
209
|
-
headerExtension;
|
|
210
|
-
partialDatagram;
|
|
211
|
-
// This can only be received
|
|
212
|
-
_encapsulated;
|
|
213
|
-
get encapsulated() {
|
|
214
|
-
return this._encapsulated;
|
|
215
|
-
}
|
|
216
|
-
expectMoreMessages(session) {
|
|
217
|
-
if (!(session[0] instanceof TransportServiceCCFirstSegment)) {
|
|
218
|
-
// First segment is missing
|
|
219
|
-
return true;
|
|
220
|
-
}
|
|
221
|
-
const datagramSize = session[0].datagramSize;
|
|
222
|
-
const receivedBytes = new Array(datagramSize).fill(false);
|
|
223
|
-
for (const segment of [...session, this]) {
|
|
224
|
-
const offset = segment instanceof TransportServiceCCFirstSegment
|
|
225
|
-
? 0
|
|
226
|
-
: segment.datagramOffset;
|
|
227
|
-
for (let i = offset; i <= offset + segment.partialDatagram.length; i++) {
|
|
228
|
-
receivedBytes[i] = true;
|
|
208
|
+
let TransportServiceCCSubsequentSegment = (() => {
|
|
209
|
+
let _classDecorators = [CCCommand(TransportServiceCommand.SubsequentSegment)];
|
|
210
|
+
let _classDescriptor;
|
|
211
|
+
let _classExtraInitializers = [];
|
|
212
|
+
let _classThis;
|
|
213
|
+
let _classSuper = TransportServiceCC;
|
|
214
|
+
var TransportServiceCCSubsequentSegment = class extends _classSuper {
|
|
215
|
+
static { _classThis = this; }
|
|
216
|
+
static {
|
|
217
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
218
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
219
|
+
TransportServiceCCSubsequentSegment = _classThis = _classDescriptor.value;
|
|
220
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
221
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
222
|
+
}
|
|
223
|
+
constructor(options) {
|
|
224
|
+
super(options);
|
|
225
|
+
this.datagramSize = options.datagramSize;
|
|
226
|
+
this.datagramOffset = options.datagramOffset;
|
|
227
|
+
this.sessionId = options.sessionId;
|
|
228
|
+
this.headerExtension = options.headerExtension;
|
|
229
|
+
this.partialDatagram = options.partialDatagram;
|
|
230
|
+
}
|
|
231
|
+
static from(raw, ctx) {
|
|
232
|
+
// Deserialization has already split the datagram size from the ccCommand.
|
|
233
|
+
// Therefore we have one more payload byte
|
|
234
|
+
validatePayload(raw.payload.length >= 7); // 2 bytes dgram size, 1 byte sessid/ext/offset, 1 byte offset, 1+ bytes payload, 2 bytes checksum
|
|
235
|
+
// Verify the CRC
|
|
236
|
+
const headerBuffer = Bytes.from([
|
|
237
|
+
CommandClasses["Transport Service"],
|
|
238
|
+
TransportServiceCommand.SubsequentSegment | raw.payload[0],
|
|
239
|
+
]);
|
|
240
|
+
const ccBuffer = raw.payload.subarray(1, -2);
|
|
241
|
+
let expectedCRC = CRC16_CCITT(headerBuffer);
|
|
242
|
+
expectedCRC = CRC16_CCITT(ccBuffer, expectedCRC);
|
|
243
|
+
const actualCRC = raw.payload.readUInt16BE(raw.payload.length - 2);
|
|
244
|
+
validatePayload(expectedCRC === actualCRC);
|
|
245
|
+
const datagramSize = raw.payload.readUInt16BE(0);
|
|
246
|
+
const sessionId = raw.payload[2] >>> 4;
|
|
247
|
+
const datagramOffset = ((raw.payload[2] & 0b111) << 8)
|
|
248
|
+
+ raw.payload[3];
|
|
249
|
+
let payloadOffset = 4;
|
|
250
|
+
// If there is a header extension, read it
|
|
251
|
+
const hasHeaderExtension = !!(raw.payload[2] & 0b1000);
|
|
252
|
+
let headerExtension;
|
|
253
|
+
if (hasHeaderExtension) {
|
|
254
|
+
const extLength = raw.payload[4];
|
|
255
|
+
headerExtension = raw.payload.subarray(5, 5 + extLength);
|
|
256
|
+
payloadOffset += 1 + extLength;
|
|
229
257
|
}
|
|
258
|
+
const partialDatagram = raw.payload.subarray(payloadOffset, -2);
|
|
259
|
+
// A node supporting the Transport Service Command Class, version 2
|
|
260
|
+
// MUST NOT send Transport Service segments with the Payload field longer than 39 bytes.
|
|
261
|
+
validatePayload(partialDatagram.length <= MAX_SEGMENT_SIZE);
|
|
262
|
+
return new this({
|
|
263
|
+
nodeId: ctx.sourceNodeId,
|
|
264
|
+
datagramSize,
|
|
265
|
+
sessionId,
|
|
266
|
+
datagramOffset,
|
|
267
|
+
headerExtension,
|
|
268
|
+
partialDatagram,
|
|
269
|
+
});
|
|
230
270
|
}
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
: partial.datagramOffset;
|
|
246
|
-
if (offset + partial.partialDatagram.length > datagram.length) {
|
|
247
|
-
throw new ZWaveError(`The partial datagram offset and length in a segment are not compatible to the communicated datagram length`, ZWaveErrorCodes.PacketFormat_InvalidPayload);
|
|
271
|
+
datagramSize;
|
|
272
|
+
datagramOffset;
|
|
273
|
+
sessionId;
|
|
274
|
+
headerExtension;
|
|
275
|
+
partialDatagram;
|
|
276
|
+
// This can only be received
|
|
277
|
+
_encapsulated;
|
|
278
|
+
get encapsulated() {
|
|
279
|
+
return this._encapsulated;
|
|
280
|
+
}
|
|
281
|
+
expectMoreMessages(session) {
|
|
282
|
+
if (!(session[0] instanceof TransportServiceCCFirstSegment)) {
|
|
283
|
+
// First segment is missing
|
|
284
|
+
return true;
|
|
248
285
|
}
|
|
249
|
-
|
|
286
|
+
const datagramSize = session[0].datagramSize;
|
|
287
|
+
const receivedBytes = new Array(datagramSize).fill(false);
|
|
288
|
+
for (const segment of [...session, this]) {
|
|
289
|
+
const offset = segment instanceof TransportServiceCCFirstSegment
|
|
290
|
+
? 0
|
|
291
|
+
: segment.datagramOffset;
|
|
292
|
+
for (let i = offset; i <= offset + segment.partialDatagram.length; i++) {
|
|
293
|
+
receivedBytes[i] = true;
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
// Expect more messages as long as we haven't received everything
|
|
297
|
+
return receivedBytes.includes(false);
|
|
250
298
|
}
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
299
|
+
getPartialCCSessionId() {
|
|
300
|
+
// Only use the session ID to identify the session, not the CC command
|
|
301
|
+
return { ccCommand: undefined, sessionId: this.sessionId };
|
|
302
|
+
}
|
|
303
|
+
mergePartialCCs(partials, ctx) {
|
|
304
|
+
// Concat the CC buffers
|
|
305
|
+
const datagram = new Bytes(this.datagramSize);
|
|
306
|
+
for (const partial of [...partials, this]) {
|
|
307
|
+
// Ensure that we don't try to write out-of-bounds
|
|
308
|
+
const offset = partial instanceof TransportServiceCCFirstSegment
|
|
309
|
+
? 0
|
|
310
|
+
: partial.datagramOffset;
|
|
311
|
+
if (offset + partial.partialDatagram.length > datagram.length) {
|
|
312
|
+
throw new ZWaveError(`The partial datagram offset and length in a segment are not compatible to the communicated datagram length`, ZWaveErrorCodes.PacketFormat_InvalidPayload);
|
|
313
|
+
}
|
|
314
|
+
datagram.set(partial.partialDatagram, offset);
|
|
315
|
+
}
|
|
316
|
+
// and deserialize the CC
|
|
317
|
+
this._encapsulated = CommandClass.parse(datagram, ctx);
|
|
318
|
+
this._encapsulated.encapsulatingCC = this;
|
|
319
|
+
}
|
|
320
|
+
serialize(ctx) {
|
|
321
|
+
// Transport Service re-uses the lower 3 bits of the ccCommand as payload
|
|
322
|
+
this.ccCommand = (this.ccCommand & 0b11111_000)
|
|
323
|
+
| ((this.datagramSize >>> 8) & 0b111);
|
|
324
|
+
const ext = !!this.headerExtension && this.headerExtension.length >= 1;
|
|
325
|
+
this.payload = Bytes.from([
|
|
326
|
+
this.datagramSize & 0xff,
|
|
327
|
+
((this.sessionId & 0b1111) << 4)
|
|
328
|
+
| (ext ? 0b1000 : 0)
|
|
329
|
+
| ((this.datagramOffset >>> 8) & 0b111),
|
|
330
|
+
this.datagramOffset & 0xff,
|
|
331
|
+
]);
|
|
332
|
+
if (ext) {
|
|
333
|
+
this.payload = Bytes.concat([
|
|
334
|
+
this.payload,
|
|
335
|
+
Bytes.from([this.headerExtension.length]),
|
|
336
|
+
this.headerExtension,
|
|
337
|
+
]);
|
|
338
|
+
}
|
|
268
339
|
this.payload = Bytes.concat([
|
|
269
340
|
this.payload,
|
|
270
|
-
|
|
271
|
-
|
|
341
|
+
this.partialDatagram,
|
|
342
|
+
Bytes.alloc(2, 0), // checksum
|
|
272
343
|
]);
|
|
344
|
+
// Compute and save the CRC16 in the payload
|
|
345
|
+
// The CC header is included in the CRC computation
|
|
346
|
+
const headerBuffer = Bytes.from([this.ccId, this.ccCommand]);
|
|
347
|
+
let crc = CRC16_CCITT(headerBuffer);
|
|
348
|
+
crc = CRC16_CCITT(this.payload.subarray(0, -2), crc);
|
|
349
|
+
// Write the checksum into the last two bytes of the payload
|
|
350
|
+
this.payload.writeUInt16BE(crc, this.payload.length - 2);
|
|
351
|
+
return super.serialize(ctx);
|
|
273
352
|
}
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
toLogEntry(ctx) {
|
|
297
|
-
return {
|
|
298
|
-
...super.toLogEntry(ctx),
|
|
299
|
-
message: {
|
|
300
|
-
"session ID": this.sessionId,
|
|
301
|
-
"datagram size": this.datagramSize,
|
|
302
|
-
"byte range": `${this.datagramOffset}...${this.datagramOffset + this.partialDatagram.length - 1}`,
|
|
303
|
-
payload: buffer2hex(this.partialDatagram),
|
|
304
|
-
},
|
|
305
|
-
};
|
|
306
|
-
}
|
|
307
|
-
};
|
|
308
|
-
TransportServiceCCSubsequentSegment = TransportServiceCCSubsequentSegment_1 = __decorate([
|
|
309
|
-
CCCommand(TransportServiceCommand.SubsequentSegment)
|
|
310
|
-
// @expectedCCResponse(TransportServiceCCReport)
|
|
311
|
-
], TransportServiceCCSubsequentSegment);
|
|
353
|
+
computeEncapsulationOverhead() {
|
|
354
|
+
// Transport Service CC (first segment) adds 1 byte datagram size, 1 byte Session ID/..., 1 byte offset, 2 bytes checksum and (0 OR n+1) bytes header extension
|
|
355
|
+
return (super.computeEncapsulationOverhead()
|
|
356
|
+
+ 5
|
|
357
|
+
+ (this.headerExtension?.length
|
|
358
|
+
? 1 + this.headerExtension.length
|
|
359
|
+
: 0));
|
|
360
|
+
}
|
|
361
|
+
toLogEntry(ctx) {
|
|
362
|
+
return {
|
|
363
|
+
...super.toLogEntry(ctx),
|
|
364
|
+
message: {
|
|
365
|
+
"session ID": this.sessionId,
|
|
366
|
+
"datagram size": this.datagramSize,
|
|
367
|
+
"byte range": `${this.datagramOffset}...${this.datagramOffset + this.partialDatagram.length - 1}`,
|
|
368
|
+
payload: buffer2hex(this.partialDatagram),
|
|
369
|
+
},
|
|
370
|
+
};
|
|
371
|
+
}
|
|
372
|
+
};
|
|
373
|
+
return TransportServiceCCSubsequentSegment = _classThis;
|
|
374
|
+
})();
|
|
312
375
|
export { TransportServiceCCSubsequentSegment };
|
|
313
376
|
function testResponseForSegmentRequest(sent, received) {
|
|
314
377
|
return ((sent.datagramOffset === 0
|
|
@@ -319,104 +382,142 @@ function testResponseForSegmentRequest(sent, received) {
|
|
|
319
382
|
&& sent.datagramOffset === received.datagramOffset
|
|
320
383
|
&& received.sessionId === sent.sessionId));
|
|
321
384
|
}
|
|
322
|
-
let TransportServiceCCSegmentRequest =
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
(
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
385
|
+
let TransportServiceCCSegmentRequest = (() => {
|
|
386
|
+
let _classDecorators = [CCCommand(TransportServiceCommand.SegmentRequest), expectedCCResponse(TransportServiceCC, testResponseForSegmentRequest)];
|
|
387
|
+
let _classDescriptor;
|
|
388
|
+
let _classExtraInitializers = [];
|
|
389
|
+
let _classThis;
|
|
390
|
+
let _classSuper = TransportServiceCC;
|
|
391
|
+
var TransportServiceCCSegmentRequest = class extends _classSuper {
|
|
392
|
+
static { _classThis = this; }
|
|
393
|
+
static {
|
|
394
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
395
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
396
|
+
TransportServiceCCSegmentRequest = _classThis = _classDescriptor.value;
|
|
397
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
398
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
399
|
+
}
|
|
400
|
+
constructor(options) {
|
|
401
|
+
super(options);
|
|
402
|
+
this.sessionId = options.sessionId;
|
|
403
|
+
this.datagramOffset = options.datagramOffset;
|
|
404
|
+
}
|
|
405
|
+
static from(raw, ctx) {
|
|
406
|
+
validatePayload(raw.payload.length >= 3);
|
|
407
|
+
const sessionId = raw.payload[1] >>> 4;
|
|
408
|
+
const datagramOffset = ((raw.payload[1] & 0b111) << 8)
|
|
409
|
+
+ raw.payload[2];
|
|
410
|
+
return new this({
|
|
411
|
+
nodeId: ctx.sourceNodeId,
|
|
412
|
+
sessionId,
|
|
413
|
+
datagramOffset,
|
|
414
|
+
});
|
|
415
|
+
}
|
|
416
|
+
sessionId;
|
|
417
|
+
datagramOffset;
|
|
418
|
+
serialize(ctx) {
|
|
419
|
+
this.payload = Bytes.from([
|
|
420
|
+
((this.sessionId & 0b1111) << 4)
|
|
421
|
+
| ((this.datagramOffset >>> 8) & 0b111),
|
|
422
|
+
this.datagramOffset & 0xff,
|
|
423
|
+
]);
|
|
424
|
+
return super.serialize(ctx);
|
|
425
|
+
}
|
|
426
|
+
toLogEntry(ctx) {
|
|
427
|
+
return {
|
|
428
|
+
...super.toLogEntry(ctx),
|
|
429
|
+
message: {
|
|
430
|
+
"session ID": this.sessionId,
|
|
431
|
+
offset: this.datagramOffset,
|
|
432
|
+
},
|
|
433
|
+
};
|
|
434
|
+
}
|
|
435
|
+
};
|
|
436
|
+
return TransportServiceCCSegmentRequest = _classThis;
|
|
437
|
+
})();
|
|
363
438
|
export { TransportServiceCCSegmentRequest };
|
|
364
|
-
let TransportServiceCCSegmentComplete =
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
439
|
+
let TransportServiceCCSegmentComplete = (() => {
|
|
440
|
+
let _classDecorators = [CCCommand(TransportServiceCommand.SegmentComplete)];
|
|
441
|
+
let _classDescriptor;
|
|
442
|
+
let _classExtraInitializers = [];
|
|
443
|
+
let _classThis;
|
|
444
|
+
let _classSuper = TransportServiceCC;
|
|
445
|
+
var TransportServiceCCSegmentComplete = class extends _classSuper {
|
|
446
|
+
static { _classThis = this; }
|
|
447
|
+
static {
|
|
448
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
449
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
450
|
+
TransportServiceCCSegmentComplete = _classThis = _classDescriptor.value;
|
|
451
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
452
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
453
|
+
}
|
|
454
|
+
constructor(options) {
|
|
455
|
+
super(options);
|
|
456
|
+
this.sessionId = options.sessionId;
|
|
457
|
+
}
|
|
458
|
+
static from(raw, ctx) {
|
|
459
|
+
validatePayload(raw.payload.length >= 2);
|
|
460
|
+
const sessionId = raw.payload[1] >>> 4;
|
|
461
|
+
return new this({
|
|
462
|
+
nodeId: ctx.sourceNodeId,
|
|
463
|
+
sessionId,
|
|
464
|
+
});
|
|
465
|
+
}
|
|
466
|
+
sessionId;
|
|
467
|
+
serialize(ctx) {
|
|
468
|
+
this.payload = Bytes.from([(this.sessionId & 0b1111) << 4]);
|
|
469
|
+
return super.serialize(ctx);
|
|
470
|
+
}
|
|
471
|
+
toLogEntry(ctx) {
|
|
472
|
+
return {
|
|
473
|
+
...super.toLogEntry(ctx),
|
|
474
|
+
message: { "session ID": this.sessionId },
|
|
475
|
+
};
|
|
476
|
+
}
|
|
477
|
+
};
|
|
478
|
+
return TransportServiceCCSegmentComplete = _classThis;
|
|
479
|
+
})();
|
|
392
480
|
export { TransportServiceCCSegmentComplete };
|
|
393
|
-
let TransportServiceCCSegmentWait =
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
481
|
+
let TransportServiceCCSegmentWait = (() => {
|
|
482
|
+
let _classDecorators = [CCCommand(TransportServiceCommand.SegmentWait)];
|
|
483
|
+
let _classDescriptor;
|
|
484
|
+
let _classExtraInitializers = [];
|
|
485
|
+
let _classThis;
|
|
486
|
+
let _classSuper = TransportServiceCC;
|
|
487
|
+
var TransportServiceCCSegmentWait = class extends _classSuper {
|
|
488
|
+
static { _classThis = this; }
|
|
489
|
+
static {
|
|
490
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
491
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
492
|
+
TransportServiceCCSegmentWait = _classThis = _classDescriptor.value;
|
|
493
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
494
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
495
|
+
}
|
|
496
|
+
constructor(options) {
|
|
497
|
+
super(options);
|
|
498
|
+
this.pendingSegments = options.pendingSegments;
|
|
499
|
+
}
|
|
500
|
+
static from(raw, ctx) {
|
|
501
|
+
validatePayload(raw.payload.length >= 2);
|
|
502
|
+
const pendingSegments = raw.payload[1];
|
|
503
|
+
return new this({
|
|
504
|
+
nodeId: ctx.sourceNodeId,
|
|
505
|
+
pendingSegments,
|
|
506
|
+
});
|
|
507
|
+
}
|
|
508
|
+
pendingSegments;
|
|
509
|
+
serialize(ctx) {
|
|
510
|
+
this.payload = Bytes.from([this.pendingSegments]);
|
|
511
|
+
return super.serialize(ctx);
|
|
512
|
+
}
|
|
513
|
+
toLogEntry(ctx) {
|
|
514
|
+
return {
|
|
515
|
+
...super.toLogEntry(ctx),
|
|
516
|
+
message: { "pending segments": this.pendingSegments },
|
|
517
|
+
};
|
|
518
|
+
}
|
|
519
|
+
};
|
|
520
|
+
return TransportServiceCCSegmentWait = _classThis;
|
|
521
|
+
})();
|
|
421
522
|
export { TransportServiceCCSegmentWait };
|
|
422
523
|
//# sourceMappingURL=TransportServiceCC.js.map
|