@zwave-js/cc 15.1.1 → 15.2.0
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.d.ts +7 -7
- package/build/cjs/cc/AlarmSensorCC.js +22 -23
- package/build/cjs/cc/AlarmSensorCC.js.map +3 -3
- package/build/cjs/cc/AssociationCC.d.ts +8 -9
- package/build/cjs/cc/AssociationCC.js +29 -29
- package/build/cjs/cc/AssociationCC.js.map +3 -3
- package/build/cjs/cc/AssociationGroupInfoCC.d.ts +7 -7
- package/build/cjs/cc/AssociationGroupInfoCC.js +31 -32
- package/build/cjs/cc/AssociationGroupInfoCC.js.map +3 -3
- package/build/cjs/cc/BarrierOperatorCC.d.ts +8 -8
- package/build/cjs/cc/BarrierOperatorCC.js +35 -36
- package/build/cjs/cc/BarrierOperatorCC.js.map +3 -3
- package/build/cjs/cc/BasicCC.d.ts +4 -4
- package/build/cjs/cc/BasicCC.js +23 -24
- package/build/cjs/cc/BasicCC.js.map +3 -3
- package/build/cjs/cc/BasicWindowCoveringCC._validateArgs.d.ts +3 -0
- package/build/cjs/cc/BasicWindowCoveringCC._validateArgs.js +64 -0
- package/build/cjs/cc/BasicWindowCoveringCC._validateArgs.js.map +7 -0
- package/build/cjs/cc/BasicWindowCoveringCC.d.ts +90 -0
- package/build/cjs/cc/BasicWindowCoveringCC.js +273 -0
- package/build/cjs/cc/BasicWindowCoveringCC.js.map +7 -0
- package/build/cjs/cc/BatteryCC.d.ts +4 -7
- package/build/cjs/cc/BatteryCC.js +18 -20
- package/build/cjs/cc/BatteryCC.js.map +3 -3
- package/build/cjs/cc/BinarySensorCC.d.ts +5 -5
- package/build/cjs/cc/BinarySensorCC.js +20 -21
- package/build/cjs/cc/BinarySensorCC.js.map +3 -3
- package/build/cjs/cc/BinarySwitchCC._validateArgs.js +2 -2
- package/build/cjs/cc/BinarySwitchCC.d.ts +6 -6
- package/build/cjs/cc/BinarySwitchCC.js +26 -26
- package/build/cjs/cc/BinarySwitchCC.js.map +3 -3
- package/build/cjs/cc/CRC16CC.d.ts +3 -3
- package/build/cjs/cc/CRC16CC.js +15 -15
- package/build/cjs/cc/CRC16CC.js.map +3 -3
- package/build/cjs/cc/CentralSceneCC.d.ts +8 -8
- package/build/cjs/cc/CentralSceneCC.js +23 -24
- package/build/cjs/cc/CentralSceneCC.js.map +3 -3
- package/build/cjs/cc/ClimateControlScheduleCC.d.ts +6 -6
- package/build/cjs/cc/ClimateControlScheduleCC.js +19 -20
- package/build/cjs/cc/ClimateControlScheduleCC.js.map +3 -3
- package/build/cjs/cc/ClockCC.d.ts +3 -4
- package/build/cjs/cc/ClockCC.js +13 -14
- package/build/cjs/cc/ClockCC.js.map +3 -3
- package/build/cjs/cc/ColorSwitchCC.d.ts +3 -4
- package/build/cjs/cc/ColorSwitchCC.js +22 -24
- package/build/cjs/cc/ColorSwitchCC.js.map +3 -3
- package/build/cjs/cc/ConfigurationCC.d.ts +3 -3
- package/build/cjs/cc/ConfigurationCC.js +114 -115
- package/build/cjs/cc/ConfigurationCC.js.map +3 -3
- package/build/cjs/cc/DeviceResetLocallyCC.d.ts +2 -2
- package/build/cjs/cc/DeviceResetLocallyCC.js +5 -5
- package/build/cjs/cc/DeviceResetLocallyCC.js.map +1 -1
- package/build/cjs/cc/DoorLockCC.d.ts +29 -29
- package/build/cjs/cc/DoorLockCC.js +39 -40
- package/build/cjs/cc/DoorLockCC.js.map +3 -3
- package/build/cjs/cc/DoorLockLoggingCC.d.ts +4 -4
- package/build/cjs/cc/DoorLockLoggingCC.js +13 -14
- package/build/cjs/cc/DoorLockLoggingCC.js.map +3 -3
- package/build/cjs/cc/EnergyProductionCC.d.ts +2 -3
- package/build/cjs/cc/EnergyProductionCC.js.map +2 -2
- package/build/cjs/cc/EntryControlCC.d.ts +8 -8
- package/build/cjs/cc/EntryControlCC.js +41 -42
- package/build/cjs/cc/EntryControlCC.js.map +3 -3
- package/build/cjs/cc/FirmwareUpdateMetaDataCC.d.ts +9 -10
- package/build/cjs/cc/FirmwareUpdateMetaDataCC.js +52 -53
- package/build/cjs/cc/FirmwareUpdateMetaDataCC.js.map +3 -3
- package/build/cjs/cc/HailCC.js +2 -2
- package/build/cjs/cc/HailCC.js.map +1 -1
- package/build/cjs/cc/HumidityControlModeCC.d.ts +5 -5
- package/build/cjs/cc/HumidityControlModeCC.js +20 -21
- package/build/cjs/cc/HumidityControlModeCC.js.map +3 -3
- package/build/cjs/cc/HumidityControlOperatingStateCC.d.ts +3 -3
- package/build/cjs/cc/HumidityControlOperatingStateCC.js +9 -9
- package/build/cjs/cc/HumidityControlOperatingStateCC.js.map +3 -3
- package/build/cjs/cc/HumidityControlSetpointCC.d.ts +6 -6
- package/build/cjs/cc/HumidityControlSetpointCC.js +43 -44
- package/build/cjs/cc/HumidityControlSetpointCC.js.map +3 -3
- package/build/cjs/cc/InclusionControllerCC.d.ts +2 -3
- package/build/cjs/cc/InclusionControllerCC.js.map +2 -2
- package/build/cjs/cc/IndicatorCC.d.ts +3 -3
- package/build/cjs/cc/IndicatorCC.js +50 -52
- package/build/cjs/cc/IndicatorCC.js.map +3 -3
- package/build/cjs/cc/IrrigationCC.d.ts +3 -3
- package/build/cjs/cc/IrrigationCC.js +74 -75
- package/build/cjs/cc/IrrigationCC.js.map +3 -3
- package/build/cjs/cc/LanguageCC.d.ts +5 -6
- package/build/cjs/cc/LanguageCC.js +14 -15
- package/build/cjs/cc/LanguageCC.js.map +3 -3
- package/build/cjs/cc/LockCC.d.ts +4 -4
- package/build/cjs/cc/LockCC.js +10 -10
- package/build/cjs/cc/LockCC.js.map +3 -3
- package/build/cjs/cc/ManufacturerProprietaryCC.d.ts +3 -3
- package/build/cjs/cc/ManufacturerProprietaryCC.js +10 -10
- package/build/cjs/cc/ManufacturerProprietaryCC.js.map +3 -3
- package/build/cjs/cc/ManufacturerSpecificCC.d.ts +7 -8
- package/build/cjs/cc/ManufacturerSpecificCC.js +20 -21
- package/build/cjs/cc/ManufacturerSpecificCC.js.map +3 -3
- package/build/cjs/cc/MeterCC.d.ts +4 -6
- package/build/cjs/cc/MeterCC.js +52 -54
- package/build/cjs/cc/MeterCC.js.map +3 -3
- package/build/cjs/cc/MultiChannelAssociationCC.d.ts +7 -8
- package/build/cjs/cc/MultiChannelAssociationCC.js +34 -35
- package/build/cjs/cc/MultiChannelAssociationCC.js.map +3 -3
- package/build/cjs/cc/MultiChannelCC.d.ts +11 -11
- package/build/cjs/cc/MultiChannelCC.js +53 -53
- package/build/cjs/cc/MultiChannelCC.js.map +3 -3
- package/build/cjs/cc/MultiCommandCC.d.ts +3 -3
- package/build/cjs/cc/MultiCommandCC.js +13 -13
- package/build/cjs/cc/MultiCommandCC.js.map +3 -3
- package/build/cjs/cc/MultilevelSensorCC.d.ts +4 -7
- package/build/cjs/cc/MultilevelSensorCC.js +26 -28
- package/build/cjs/cc/MultilevelSensorCC.js.map +3 -3
- package/build/cjs/cc/MultilevelSwitchCC._validateArgs.js +3 -3
- package/build/cjs/cc/MultilevelSwitchCC.d.ts +13 -13
- package/build/cjs/cc/MultilevelSwitchCC.js +36 -37
- package/build/cjs/cc/MultilevelSwitchCC.js.map +3 -3
- package/build/cjs/cc/NoOperationCC.js +4 -4
- package/build/cjs/cc/NoOperationCC.js.map +1 -1
- package/build/cjs/cc/NodeNamingCC.d.ts +5 -5
- package/build/cjs/cc/NodeNamingCC.js +20 -20
- package/build/cjs/cc/NodeNamingCC.js.map +3 -3
- package/build/cjs/cc/NotificationCC.d.ts +4 -5
- package/build/cjs/cc/NotificationCC.js +66 -68
- package/build/cjs/cc/NotificationCC.js.map +3 -3
- package/build/cjs/cc/PowerlevelCC.d.ts +3 -3
- package/build/cjs/cc/PowerlevelCC.js +25 -26
- package/build/cjs/cc/PowerlevelCC.js.map +3 -3
- package/build/cjs/cc/ProtectionCC._validateArgs.js +2 -2
- package/build/cjs/cc/ProtectionCC.d.ts +11 -11
- package/build/cjs/cc/ProtectionCC.js +35 -36
- package/build/cjs/cc/ProtectionCC.js.map +3 -3
- package/build/cjs/cc/SceneActivationCC._validateArgs.js +2 -2
- package/build/cjs/cc/SceneActivationCC.d.ts +5 -6
- package/build/cjs/cc/SceneActivationCC.js +10 -10
- package/build/cjs/cc/SceneActivationCC.js.map +3 -3
- package/build/cjs/cc/SceneActuatorConfigurationCC._validateArgs.js +2 -2
- package/build/cjs/cc/SceneActuatorConfigurationCC.d.ts +5 -5
- package/build/cjs/cc/SceneActuatorConfigurationCC.js +19 -20
- package/build/cjs/cc/SceneActuatorConfigurationCC.js.map +3 -3
- package/build/cjs/cc/SceneControllerConfigurationCC._validateArgs.js +2 -2
- package/build/cjs/cc/SceneControllerConfigurationCC.d.ts +6 -6
- package/build/cjs/cc/SceneControllerConfigurationCC.js +25 -26
- package/build/cjs/cc/SceneControllerConfigurationCC.js.map +3 -3
- package/build/cjs/cc/ScheduleEntryLockCC.d.ts +2 -3
- package/build/cjs/cc/ScheduleEntryLockCC.js.map +2 -2
- package/build/cjs/cc/Security2CC.d.ts +3 -4
- package/build/cjs/cc/Security2CC.js +60 -62
- package/build/cjs/cc/Security2CC.js.map +3 -3
- package/build/cjs/cc/SecurityCC.d.ts +3 -4
- package/build/cjs/cc/SecurityCC.js +25 -26
- package/build/cjs/cc/SecurityCC.js.map +3 -3
- package/build/cjs/cc/SoundSwitchCC.d.ts +7 -7
- package/build/cjs/cc/SoundSwitchCC.js +28 -29
- package/build/cjs/cc/SoundSwitchCC.js.map +3 -3
- package/build/cjs/cc/SupervisionCC.d.ts +4 -4
- package/build/cjs/cc/SupervisionCC.js +28 -29
- package/build/cjs/cc/SupervisionCC.js.map +3 -3
- package/build/cjs/cc/ThermostatFanModeCC.d.ts +6 -6
- package/build/cjs/cc/ThermostatFanModeCC.js +21 -22
- package/build/cjs/cc/ThermostatFanModeCC.js.map +3 -3
- package/build/cjs/cc/ThermostatFanStateCC.d.ts +3 -3
- package/build/cjs/cc/ThermostatFanStateCC.js +9 -9
- package/build/cjs/cc/ThermostatFanStateCC.js.map +3 -3
- package/build/cjs/cc/ThermostatModeCC.d.ts +6 -6
- package/build/cjs/cc/ThermostatModeCC.js +30 -31
- package/build/cjs/cc/ThermostatModeCC.js.map +3 -3
- package/build/cjs/cc/ThermostatOperatingStateCC.d.ts +3 -4
- package/build/cjs/cc/ThermostatOperatingStateCC.js +9 -9
- package/build/cjs/cc/ThermostatOperatingStateCC.js.map +3 -3
- package/build/cjs/cc/ThermostatSetbackCC.d.ts +3 -3
- package/build/cjs/cc/ThermostatSetbackCC.js +14 -15
- package/build/cjs/cc/ThermostatSetbackCC.js.map +3 -3
- package/build/cjs/cc/ThermostatSetpointCC.d.ts +6 -6
- package/build/cjs/cc/ThermostatSetpointCC.js +48 -49
- package/build/cjs/cc/ThermostatSetpointCC.js.map +3 -3
- package/build/cjs/cc/TimeCC.d.ts +3 -4
- package/build/cjs/cc/TimeCC.js +9 -10
- package/build/cjs/cc/TimeCC.js.map +3 -3
- package/build/cjs/cc/TimeParametersCC.d.ts +3 -4
- package/build/cjs/cc/TimeParametersCC.js +2 -2
- package/build/cjs/cc/TimeParametersCC.js.map +2 -2
- package/build/cjs/cc/TransportServiceCC.d.ts +3 -3
- package/build/cjs/cc/TransportServiceCC.js +44 -45
- package/build/cjs/cc/TransportServiceCC.js.map +3 -3
- package/build/cjs/cc/UserCodeCC.d.ts +19 -19
- package/build/cjs/cc/UserCodeCC.js +102 -103
- package/build/cjs/cc/UserCodeCC.js.map +3 -3
- package/build/cjs/cc/VersionCC.d.ts +17 -17
- package/build/cjs/cc/VersionCC.js +46 -47
- package/build/cjs/cc/VersionCC.js.map +3 -3
- package/build/cjs/cc/WakeUpCC.d.ts +6 -6
- package/build/cjs/cc/WakeUpCC.js +16 -17
- package/build/cjs/cc/WakeUpCC.js.map +3 -3
- package/build/cjs/cc/WindowCoveringCC.d.ts +3 -4
- package/build/cjs/cc/WindowCoveringCC.js +17 -18
- package/build/cjs/cc/WindowCoveringCC.js.map +3 -3
- package/build/cjs/cc/ZWavePlusCC.d.ts +8 -8
- package/build/cjs/cc/ZWavePlusCC.js +15 -16
- package/build/cjs/cc/ZWavePlusCC.js.map +3 -3
- package/build/cjs/cc/ZWaveProtocolCC.d.ts +2 -2
- package/build/cjs/cc/ZWaveProtocolCC.js +35 -35
- package/build/cjs/cc/ZWaveProtocolCC.js.map +2 -2
- package/build/cjs/cc/_CCValues.generated.d.ts +124 -0
- package/build/cjs/cc/_CCValues.generated.js +93 -26
- package/build/cjs/cc/_CCValues.generated.js.map +3 -3
- package/build/cjs/cc/index.d.ts +2 -0
- package/build/cjs/cc/index.js +9 -0
- package/build/cjs/cc/index.js.map +2 -2
- package/build/cjs/cc/manufacturerProprietary/FibaroCC.d.ts +3 -3
- package/build/cjs/cc/manufacturerProprietary/FibaroCC.js +14 -14
- package/build/cjs/cc/manufacturerProprietary/FibaroCC.js.map +1 -1
- package/build/cjs/lib/API.d.ts +5 -3
- package/build/cjs/lib/API.js.map +2 -2
- package/build/cjs/lib/CommandClass.d.ts +5 -6
- package/build/cjs/lib/CommandClass.js +45 -45
- package/build/cjs/lib/CommandClass.js.map +3 -3
- package/build/cjs/lib/CommandClassDecorators.d.ts +2 -2
- package/build/cjs/lib/CommandClassDecorators.js +3 -3
- package/build/cjs/lib/CommandClassDecorators.js.map +2 -2
- package/build/cjs/lib/Security2/Extension.d.ts +2 -2
- package/build/cjs/lib/Security2/Extension.js +17 -17
- package/build/cjs/lib/Security2/Extension.js.map +3 -3
- package/build/cjs/lib/SetValueResult.d.ts +1 -1
- package/build/cjs/lib/SetValueResult.js.map +1 -1
- package/build/cjs/lib/Values.d.ts +3 -3
- package/build/cjs/lib/Values.js +6 -6
- package/build/cjs/lib/Values.js.map +2 -2
- package/build/cjs/lib/_Types.d.ts +6 -2
- package/build/cjs/lib/_Types.js +10 -3
- package/build/cjs/lib/_Types.js.map +3 -3
- package/build/cjs/lib/serializers.d.ts +1 -1
- package/build/cjs/lib/serializers.js +5 -5
- package/build/cjs/lib/serializers.js.map +2 -2
- package/build/cjs/lib/traits.d.ts +2 -2
- package/build/cjs/lib/utils.d.ts +2 -2
- package/build/cjs/lib/utils.js +60 -60
- package/build/cjs/lib/utils.js.map +3 -3
- package/build/esm/cc/AlarmSensorCC.d.ts +7 -7
- package/build/esm/cc/AlarmSensorCC.d.ts.map +1 -1
- package/build/esm/cc/AlarmSensorCC.js +2 -3
- package/build/esm/cc/AlarmSensorCC.js.map +1 -1
- package/build/esm/cc/AssociationCC.d.ts +8 -9
- package/build/esm/cc/AssociationCC.d.ts.map +1 -1
- package/build/esm/cc/AssociationCC.js +2 -2
- package/build/esm/cc/AssociationCC.js.map +1 -1
- package/build/esm/cc/AssociationGroupInfoCC.d.ts +7 -7
- package/build/esm/cc/AssociationGroupInfoCC.d.ts.map +1 -1
- package/build/esm/cc/AssociationGroupInfoCC.js +2 -3
- package/build/esm/cc/AssociationGroupInfoCC.js.map +1 -1
- package/build/esm/cc/BarrierOperatorCC.d.ts +8 -8
- package/build/esm/cc/BarrierOperatorCC.d.ts.map +1 -1
- package/build/esm/cc/BarrierOperatorCC.js +2 -3
- package/build/esm/cc/BarrierOperatorCC.js.map +1 -1
- package/build/esm/cc/BasicCC.d.ts +4 -4
- package/build/esm/cc/BasicCC.d.ts.map +1 -1
- package/build/esm/cc/BasicCC.js +2 -3
- package/build/esm/cc/BasicCC.js.map +1 -1
- package/build/esm/cc/BasicWindowCoveringCC._validateArgs.d.ts +3 -0
- package/build/esm/cc/BasicWindowCoveringCC._validateArgs.d.ts.map +1 -0
- package/build/esm/cc/BasicWindowCoveringCC._validateArgs.js +22 -0
- package/build/esm/cc/BasicWindowCoveringCC._validateArgs.js.map +1 -0
- package/build/esm/cc/BasicWindowCoveringCC.d.ts +90 -0
- package/build/esm/cc/BasicWindowCoveringCC.d.ts.map +1 -0
- package/build/esm/cc/BasicWindowCoveringCC.js +215 -0
- package/build/esm/cc/BasicWindowCoveringCC.js.map +1 -0
- package/build/esm/cc/BatteryCC.d.ts +4 -7
- package/build/esm/cc/BatteryCC.d.ts.map +1 -1
- package/build/esm/cc/BatteryCC.js +2 -4
- package/build/esm/cc/BatteryCC.js.map +1 -1
- package/build/esm/cc/BinarySensorCC.d.ts +5 -5
- package/build/esm/cc/BinarySensorCC.d.ts.map +1 -1
- package/build/esm/cc/BinarySensorCC.js +2 -3
- package/build/esm/cc/BinarySensorCC.js.map +1 -1
- package/build/esm/cc/BinarySwitchCC._validateArgs.js +1 -1
- package/build/esm/cc/BinarySwitchCC._validateArgs.js.map +1 -1
- package/build/esm/cc/BinarySwitchCC.d.ts +6 -6
- package/build/esm/cc/BinarySwitchCC.d.ts.map +1 -1
- package/build/esm/cc/BinarySwitchCC.js +2 -2
- package/build/esm/cc/BinarySwitchCC.js.map +1 -1
- package/build/esm/cc/CRC16CC.d.ts +3 -3
- package/build/esm/cc/CRC16CC.d.ts.map +1 -1
- package/build/esm/cc/CRC16CC.js +2 -2
- package/build/esm/cc/CRC16CC.js.map +1 -1
- package/build/esm/cc/CentralSceneCC.d.ts +8 -8
- package/build/esm/cc/CentralSceneCC.d.ts.map +1 -1
- package/build/esm/cc/CentralSceneCC.js +2 -3
- package/build/esm/cc/CentralSceneCC.js.map +1 -1
- package/build/esm/cc/ClimateControlScheduleCC.d.ts +6 -6
- package/build/esm/cc/ClimateControlScheduleCC.d.ts.map +1 -1
- package/build/esm/cc/ClimateControlScheduleCC.js +2 -3
- package/build/esm/cc/ClimateControlScheduleCC.js.map +1 -1
- package/build/esm/cc/ClockCC.d.ts +3 -4
- package/build/esm/cc/ClockCC.d.ts.map +1 -1
- package/build/esm/cc/ClockCC.js +2 -3
- package/build/esm/cc/ClockCC.js.map +1 -1
- package/build/esm/cc/ColorSwitchCC.d.ts +3 -4
- package/build/esm/cc/ColorSwitchCC.d.ts.map +1 -1
- package/build/esm/cc/ColorSwitchCC.js +2 -4
- package/build/esm/cc/ColorSwitchCC.js.map +1 -1
- package/build/esm/cc/ConfigurationCC.d.ts +3 -3
- package/build/esm/cc/ConfigurationCC.d.ts.map +1 -1
- package/build/esm/cc/ConfigurationCC.js +2 -3
- package/build/esm/cc/ConfigurationCC.js.map +1 -1
- package/build/esm/cc/DeviceResetLocallyCC.d.ts +2 -2
- package/build/esm/cc/DeviceResetLocallyCC.d.ts.map +1 -1
- package/build/esm/cc/DeviceResetLocallyCC.js +1 -1
- package/build/esm/cc/DeviceResetLocallyCC.js.map +1 -1
- package/build/esm/cc/DoorLockCC.d.ts +29 -29
- package/build/esm/cc/DoorLockCC.d.ts.map +1 -1
- package/build/esm/cc/DoorLockCC.js +2 -3
- package/build/esm/cc/DoorLockCC.js.map +1 -1
- package/build/esm/cc/DoorLockLoggingCC.d.ts +4 -4
- package/build/esm/cc/DoorLockLoggingCC.d.ts.map +1 -1
- package/build/esm/cc/DoorLockLoggingCC.js +2 -3
- package/build/esm/cc/DoorLockLoggingCC.js.map +1 -1
- package/build/esm/cc/EnergyProductionCC.d.ts +2 -3
- package/build/esm/cc/EnergyProductionCC.d.ts.map +1 -1
- package/build/esm/cc/EnergyProductionCC.js.map +1 -1
- package/build/esm/cc/EntryControlCC.d.ts +8 -8
- package/build/esm/cc/EntryControlCC.d.ts.map +1 -1
- package/build/esm/cc/EntryControlCC.js +2 -3
- package/build/esm/cc/EntryControlCC.js.map +1 -1
- package/build/esm/cc/FirmwareUpdateMetaDataCC.d.ts +9 -10
- package/build/esm/cc/FirmwareUpdateMetaDataCC.d.ts.map +1 -1
- package/build/esm/cc/FirmwareUpdateMetaDataCC.js +2 -3
- package/build/esm/cc/FirmwareUpdateMetaDataCC.js.map +1 -1
- package/build/esm/cc/HailCC.js +1 -1
- package/build/esm/cc/HailCC.js.map +1 -1
- package/build/esm/cc/HumidityControlModeCC.d.ts +5 -5
- package/build/esm/cc/HumidityControlModeCC.d.ts.map +1 -1
- package/build/esm/cc/HumidityControlModeCC.js +2 -3
- package/build/esm/cc/HumidityControlModeCC.js.map +1 -1
- package/build/esm/cc/HumidityControlOperatingStateCC.d.ts +3 -3
- package/build/esm/cc/HumidityControlOperatingStateCC.d.ts.map +1 -1
- package/build/esm/cc/HumidityControlOperatingStateCC.js +2 -2
- package/build/esm/cc/HumidityControlOperatingStateCC.js.map +1 -1
- package/build/esm/cc/HumidityControlSetpointCC.d.ts +6 -6
- package/build/esm/cc/HumidityControlSetpointCC.d.ts.map +1 -1
- package/build/esm/cc/HumidityControlSetpointCC.js +2 -3
- package/build/esm/cc/HumidityControlSetpointCC.js.map +1 -1
- package/build/esm/cc/InclusionControllerCC.d.ts +2 -3
- package/build/esm/cc/InclusionControllerCC.d.ts.map +1 -1
- package/build/esm/cc/InclusionControllerCC.js.map +1 -1
- package/build/esm/cc/IndicatorCC.d.ts +3 -3
- package/build/esm/cc/IndicatorCC.d.ts.map +1 -1
- package/build/esm/cc/IndicatorCC.js +2 -4
- package/build/esm/cc/IndicatorCC.js.map +1 -1
- package/build/esm/cc/IrrigationCC.d.ts +3 -3
- package/build/esm/cc/IrrigationCC.d.ts.map +1 -1
- package/build/esm/cc/IrrigationCC.js +2 -3
- package/build/esm/cc/IrrigationCC.js.map +1 -1
- package/build/esm/cc/LanguageCC.d.ts +5 -6
- package/build/esm/cc/LanguageCC.d.ts.map +1 -1
- package/build/esm/cc/LanguageCC.js +2 -3
- package/build/esm/cc/LanguageCC.js.map +1 -1
- package/build/esm/cc/LockCC.d.ts +4 -4
- package/build/esm/cc/LockCC.d.ts.map +1 -1
- package/build/esm/cc/LockCC.js +2 -2
- package/build/esm/cc/LockCC.js.map +1 -1
- package/build/esm/cc/ManufacturerProprietaryCC.d.ts +3 -3
- package/build/esm/cc/ManufacturerProprietaryCC.d.ts.map +1 -1
- package/build/esm/cc/ManufacturerProprietaryCC.js +2 -2
- package/build/esm/cc/ManufacturerProprietaryCC.js.map +1 -1
- package/build/esm/cc/ManufacturerSpecificCC.d.ts +7 -8
- package/build/esm/cc/ManufacturerSpecificCC.d.ts.map +1 -1
- package/build/esm/cc/ManufacturerSpecificCC.js +2 -3
- package/build/esm/cc/ManufacturerSpecificCC.js.map +1 -1
- package/build/esm/cc/MeterCC.d.ts +4 -6
- package/build/esm/cc/MeterCC.d.ts.map +1 -1
- package/build/esm/cc/MeterCC.js +2 -4
- package/build/esm/cc/MeterCC.js.map +1 -1
- package/build/esm/cc/MultiChannelAssociationCC.d.ts +7 -8
- package/build/esm/cc/MultiChannelAssociationCC.d.ts.map +1 -1
- package/build/esm/cc/MultiChannelAssociationCC.js +2 -3
- package/build/esm/cc/MultiChannelAssociationCC.js.map +1 -1
- package/build/esm/cc/MultiChannelCC.d.ts +11 -11
- package/build/esm/cc/MultiChannelCC.d.ts.map +1 -1
- package/build/esm/cc/MultiChannelCC.js +2 -2
- package/build/esm/cc/MultiChannelCC.js.map +1 -1
- package/build/esm/cc/MultiCommandCC.d.ts +3 -3
- package/build/esm/cc/MultiCommandCC.d.ts.map +1 -1
- package/build/esm/cc/MultiCommandCC.js +2 -2
- package/build/esm/cc/MultiCommandCC.js.map +1 -1
- package/build/esm/cc/MultilevelSensorCC.d.ts +4 -7
- package/build/esm/cc/MultilevelSensorCC.d.ts.map +1 -1
- package/build/esm/cc/MultilevelSensorCC.js +2 -4
- package/build/esm/cc/MultilevelSensorCC.js.map +1 -1
- package/build/esm/cc/MultilevelSwitchCC._validateArgs.js +1 -1
- package/build/esm/cc/MultilevelSwitchCC._validateArgs.js.map +1 -1
- package/build/esm/cc/MultilevelSwitchCC.d.ts +13 -13
- package/build/esm/cc/MultilevelSwitchCC.d.ts.map +1 -1
- package/build/esm/cc/MultilevelSwitchCC.js +2 -3
- package/build/esm/cc/MultilevelSwitchCC.js.map +1 -1
- package/build/esm/cc/NoOperationCC.js +1 -1
- package/build/esm/cc/NoOperationCC.js.map +1 -1
- package/build/esm/cc/NodeNamingCC.d.ts +5 -5
- package/build/esm/cc/NodeNamingCC.d.ts.map +1 -1
- package/build/esm/cc/NodeNamingCC.js +2 -2
- package/build/esm/cc/NodeNamingCC.js.map +1 -1
- package/build/esm/cc/NotificationCC.d.ts +4 -5
- package/build/esm/cc/NotificationCC.d.ts.map +1 -1
- package/build/esm/cc/NotificationCC.js +2 -4
- package/build/esm/cc/NotificationCC.js.map +1 -1
- package/build/esm/cc/PowerlevelCC.d.ts +3 -3
- package/build/esm/cc/PowerlevelCC.d.ts.map +1 -1
- package/build/esm/cc/PowerlevelCC.js +2 -3
- package/build/esm/cc/PowerlevelCC.js.map +1 -1
- package/build/esm/cc/ProtectionCC._validateArgs.js +1 -1
- package/build/esm/cc/ProtectionCC._validateArgs.js.map +1 -1
- package/build/esm/cc/ProtectionCC.d.ts +11 -11
- package/build/esm/cc/ProtectionCC.d.ts.map +1 -1
- package/build/esm/cc/ProtectionCC.js +2 -3
- package/build/esm/cc/ProtectionCC.js.map +1 -1
- package/build/esm/cc/SceneActivationCC._validateArgs.js +1 -1
- package/build/esm/cc/SceneActivationCC._validateArgs.js.map +1 -1
- package/build/esm/cc/SceneActivationCC.d.ts +5 -6
- package/build/esm/cc/SceneActivationCC.d.ts.map +1 -1
- package/build/esm/cc/SceneActivationCC.js +2 -2
- package/build/esm/cc/SceneActivationCC.js.map +1 -1
- package/build/esm/cc/SceneActuatorConfigurationCC._validateArgs.js +1 -1
- package/build/esm/cc/SceneActuatorConfigurationCC._validateArgs.js.map +1 -1
- package/build/esm/cc/SceneActuatorConfigurationCC.d.ts +5 -5
- package/build/esm/cc/SceneActuatorConfigurationCC.d.ts.map +1 -1
- package/build/esm/cc/SceneActuatorConfigurationCC.js +2 -3
- package/build/esm/cc/SceneActuatorConfigurationCC.js.map +1 -1
- package/build/esm/cc/SceneControllerConfigurationCC._validateArgs.js +1 -1
- package/build/esm/cc/SceneControllerConfigurationCC._validateArgs.js.map +1 -1
- package/build/esm/cc/SceneControllerConfigurationCC.d.ts +6 -6
- package/build/esm/cc/SceneControllerConfigurationCC.d.ts.map +1 -1
- package/build/esm/cc/SceneControllerConfigurationCC.js +2 -3
- package/build/esm/cc/SceneControllerConfigurationCC.js.map +1 -1
- package/build/esm/cc/ScheduleEntryLockCC.d.ts +2 -3
- package/build/esm/cc/ScheduleEntryLockCC.d.ts.map +1 -1
- package/build/esm/cc/ScheduleEntryLockCC.js.map +1 -1
- package/build/esm/cc/Security2CC.d.ts +3 -4
- package/build/esm/cc/Security2CC.d.ts.map +1 -1
- package/build/esm/cc/Security2CC.js +2 -4
- package/build/esm/cc/Security2CC.js.map +1 -1
- package/build/esm/cc/SecurityCC.d.ts +3 -4
- package/build/esm/cc/SecurityCC.d.ts.map +1 -1
- package/build/esm/cc/SecurityCC.js +1 -2
- package/build/esm/cc/SecurityCC.js.map +1 -1
- package/build/esm/cc/SoundSwitchCC.d.ts +7 -7
- package/build/esm/cc/SoundSwitchCC.d.ts.map +1 -1
- package/build/esm/cc/SoundSwitchCC.js +2 -3
- package/build/esm/cc/SoundSwitchCC.js.map +1 -1
- package/build/esm/cc/SupervisionCC.d.ts +4 -4
- package/build/esm/cc/SupervisionCC.d.ts.map +1 -1
- package/build/esm/cc/SupervisionCC.js +2 -3
- package/build/esm/cc/SupervisionCC.js.map +1 -1
- package/build/esm/cc/ThermostatFanModeCC.d.ts +6 -6
- package/build/esm/cc/ThermostatFanModeCC.d.ts.map +1 -1
- package/build/esm/cc/ThermostatFanModeCC.js +2 -3
- package/build/esm/cc/ThermostatFanModeCC.js.map +1 -1
- package/build/esm/cc/ThermostatFanStateCC.d.ts +3 -3
- package/build/esm/cc/ThermostatFanStateCC.d.ts.map +1 -1
- package/build/esm/cc/ThermostatFanStateCC.js +2 -2
- package/build/esm/cc/ThermostatFanStateCC.js.map +1 -1
- package/build/esm/cc/ThermostatModeCC.d.ts +6 -6
- package/build/esm/cc/ThermostatModeCC.d.ts.map +1 -1
- package/build/esm/cc/ThermostatModeCC.js +2 -3
- package/build/esm/cc/ThermostatModeCC.js.map +1 -1
- package/build/esm/cc/ThermostatOperatingStateCC.d.ts +3 -4
- package/build/esm/cc/ThermostatOperatingStateCC.d.ts.map +1 -1
- package/build/esm/cc/ThermostatOperatingStateCC.js +2 -2
- package/build/esm/cc/ThermostatOperatingStateCC.js.map +1 -1
- package/build/esm/cc/ThermostatSetbackCC.d.ts +3 -3
- package/build/esm/cc/ThermostatSetbackCC.d.ts.map +1 -1
- package/build/esm/cc/ThermostatSetbackCC.js +2 -3
- package/build/esm/cc/ThermostatSetbackCC.js.map +1 -1
- package/build/esm/cc/ThermostatSetpointCC.d.ts +6 -6
- package/build/esm/cc/ThermostatSetpointCC.d.ts.map +1 -1
- package/build/esm/cc/ThermostatSetpointCC.js +2 -3
- package/build/esm/cc/ThermostatSetpointCC.js.map +1 -1
- package/build/esm/cc/TimeCC.d.ts +3 -4
- package/build/esm/cc/TimeCC.d.ts.map +1 -1
- package/build/esm/cc/TimeCC.js +1 -2
- package/build/esm/cc/TimeCC.js.map +1 -1
- package/build/esm/cc/TimeParametersCC.d.ts +3 -4
- package/build/esm/cc/TimeParametersCC.d.ts.map +1 -1
- package/build/esm/cc/TimeParametersCC.js +1 -1
- package/build/esm/cc/TimeParametersCC.js.map +1 -1
- package/build/esm/cc/TransportServiceCC.d.ts +3 -3
- package/build/esm/cc/TransportServiceCC.d.ts.map +1 -1
- package/build/esm/cc/TransportServiceCC.js +2 -3
- package/build/esm/cc/TransportServiceCC.js.map +1 -1
- package/build/esm/cc/UserCodeCC.d.ts +19 -19
- package/build/esm/cc/UserCodeCC.d.ts.map +1 -1
- package/build/esm/cc/UserCodeCC.js +2 -3
- package/build/esm/cc/UserCodeCC.js.map +1 -1
- package/build/esm/cc/VersionCC.d.ts +17 -17
- package/build/esm/cc/VersionCC.d.ts.map +1 -1
- package/build/esm/cc/VersionCC.js +2 -3
- package/build/esm/cc/VersionCC.js.map +1 -1
- package/build/esm/cc/WakeUpCC.d.ts +6 -6
- package/build/esm/cc/WakeUpCC.d.ts.map +1 -1
- package/build/esm/cc/WakeUpCC.js +2 -3
- package/build/esm/cc/WakeUpCC.js.map +1 -1
- package/build/esm/cc/WindowCoveringCC.d.ts +3 -4
- package/build/esm/cc/WindowCoveringCC.d.ts.map +1 -1
- package/build/esm/cc/WindowCoveringCC.js +1 -2
- package/build/esm/cc/WindowCoveringCC.js.map +1 -1
- package/build/esm/cc/ZWavePlusCC.d.ts +8 -8
- package/build/esm/cc/ZWavePlusCC.d.ts.map +1 -1
- package/build/esm/cc/ZWavePlusCC.js +2 -3
- package/build/esm/cc/ZWavePlusCC.js.map +1 -1
- package/build/esm/cc/ZWaveProtocolCC.d.ts +2 -2
- package/build/esm/cc/ZWaveProtocolCC.d.ts.map +1 -1
- package/build/esm/cc/ZWaveProtocolCC.js +1 -1
- package/build/esm/cc/ZWaveProtocolCC.js.map +1 -1
- package/build/esm/cc/_CCValues.generated.d.ts +124 -0
- package/build/esm/cc/_CCValues.generated.d.ts.map +1 -1
- package/build/esm/cc/_CCValues.generated.js +75 -4
- package/build/esm/cc/_CCValues.generated.js.map +1 -1
- package/build/esm/cc/index.d.ts +2 -0
- package/build/esm/cc/index.d.ts.map +1 -1
- package/build/esm/cc/index.js +1 -0
- package/build/esm/cc/index.js.map +1 -1
- package/build/esm/cc/manufacturerProprietary/FibaroCC.d.ts +3 -3
- package/build/esm/cc/manufacturerProprietary/FibaroCC.d.ts.map +1 -1
- package/build/esm/cc/manufacturerProprietary/FibaroCC.js +1 -1
- package/build/esm/cc/manufacturerProprietary/FibaroCC.js.map +1 -1
- package/build/esm/lib/API.d.ts +5 -3
- package/build/esm/lib/API.d.ts.map +1 -1
- package/build/esm/lib/API.js.map +1 -1
- package/build/esm/lib/CommandClass.d.ts +5 -6
- package/build/esm/lib/CommandClass.d.ts.map +1 -1
- package/build/esm/lib/CommandClass.js +2 -2
- package/build/esm/lib/CommandClass.js.map +1 -1
- package/build/esm/lib/CommandClassDecorators.d.ts +2 -2
- package/build/esm/lib/CommandClassDecorators.d.ts.map +1 -1
- package/build/esm/lib/CommandClassDecorators.js +1 -1
- package/build/esm/lib/CommandClassDecorators.js.map +1 -1
- package/build/esm/lib/Security2/Extension.d.ts +2 -2
- package/build/esm/lib/Security2/Extension.d.ts.map +1 -1
- package/build/esm/lib/Security2/Extension.js +2 -2
- package/build/esm/lib/Security2/Extension.js.map +1 -1
- package/build/esm/lib/SetValueResult.d.ts +1 -1
- package/build/esm/lib/SetValueResult.d.ts.map +1 -1
- package/build/esm/lib/Values.d.ts +3 -3
- package/build/esm/lib/Values.d.ts.map +1 -1
- package/build/esm/lib/Values.js +1 -1
- package/build/esm/lib/Values.js.map +1 -1
- package/build/esm/lib/_Types.d.ts +6 -2
- package/build/esm/lib/_Types.d.ts.map +1 -1
- package/build/esm/lib/_Types.js +6 -1
- package/build/esm/lib/_Types.js.map +1 -1
- package/build/esm/lib/serializers.d.ts +1 -1
- package/build/esm/lib/serializers.d.ts.map +1 -1
- package/build/esm/lib/serializers.js +1 -1
- package/build/esm/lib/serializers.js.map +1 -1
- package/build/esm/lib/traits.d.ts +2 -2
- package/build/esm/lib/traits.d.ts.map +1 -1
- package/build/esm/lib/utils.d.ts +2 -2
- package/build/esm/lib/utils.d.ts.map +1 -1
- package/build/esm/lib/utils.js +2 -2
- package/build/esm/lib/utils.js.map +1 -1
- package/package.json +6 -6
|
@@ -31,9 +31,8 @@ __export(TransportServiceCC_exports, {
|
|
|
31
31
|
isTransportServiceEncapsulation: () => isTransportServiceEncapsulation
|
|
32
32
|
});
|
|
33
33
|
module.exports = __toCommonJS(TransportServiceCC_exports);
|
|
34
|
-
var
|
|
35
|
-
var
|
|
36
|
-
var import_safe3 = require("@zwave-js/shared/safe");
|
|
34
|
+
var import_core = require("@zwave-js/core");
|
|
35
|
+
var import_shared = require("@zwave-js/shared");
|
|
37
36
|
var import_CommandClass = require("../lib/CommandClass.js");
|
|
38
37
|
var import_CommandClassDecorators = require("../lib/CommandClassDecorators.js");
|
|
39
38
|
var import_Types = require("../lib/_Types.js");
|
|
@@ -94,7 +93,7 @@ const TransportServiceTimeouts = {
|
|
|
94
93
|
relaxedTimingDelayR3: 15
|
|
95
94
|
};
|
|
96
95
|
let TransportServiceCC = (() => {
|
|
97
|
-
let _classDecorators = [(0, import_CommandClassDecorators.commandClass)(
|
|
96
|
+
let _classDecorators = [(0, import_CommandClassDecorators.commandClass)(import_core.CommandClasses["Transport Service"]), (0, import_CommandClassDecorators.implementedVersion)(2)];
|
|
98
97
|
let _classDescriptor;
|
|
99
98
|
let _classExtraInitializers = [];
|
|
100
99
|
let _classThis;
|
|
@@ -117,7 +116,7 @@ let TransportServiceCC = (() => {
|
|
|
117
116
|
return TransportServiceCC2 = _classThis;
|
|
118
117
|
})();
|
|
119
118
|
function isTransportServiceEncapsulation(command) {
|
|
120
|
-
return command.ccId ===
|
|
119
|
+
return command.ccId === import_core.CommandClasses["Transport Service"] && (command.ccCommand === import_Types.TransportServiceCommand.FirstSegment || command.ccCommand === import_Types.TransportServiceCommand.SubsequentSegment);
|
|
121
120
|
}
|
|
122
121
|
__name(isTransportServiceEncapsulation, "isTransportServiceEncapsulation");
|
|
123
122
|
let TransportServiceCCFirstSegment = (() => {
|
|
@@ -148,16 +147,16 @@ let TransportServiceCCFirstSegment = (() => {
|
|
|
148
147
|
this.partialDatagram = options.partialDatagram;
|
|
149
148
|
}
|
|
150
149
|
static from(raw, ctx) {
|
|
151
|
-
(0,
|
|
152
|
-
const headerBuffer =
|
|
153
|
-
|
|
150
|
+
(0, import_core.validatePayload)(raw.payload.length >= 6);
|
|
151
|
+
const headerBuffer = import_shared.Bytes.from([
|
|
152
|
+
import_core.CommandClasses["Transport Service"],
|
|
154
153
|
import_Types.TransportServiceCommand.FirstSegment | raw.payload[0]
|
|
155
154
|
]);
|
|
156
155
|
const ccBuffer = raw.payload.subarray(1, -2);
|
|
157
|
-
let expectedCRC = (0,
|
|
158
|
-
expectedCRC = (0,
|
|
156
|
+
let expectedCRC = (0, import_core.CRC16_CCITT)(headerBuffer);
|
|
157
|
+
expectedCRC = (0, import_core.CRC16_CCITT)(ccBuffer, expectedCRC);
|
|
159
158
|
const actualCRC = raw.payload.readUInt16BE(raw.payload.length - 2);
|
|
160
|
-
(0,
|
|
159
|
+
(0, import_core.validatePayload)(expectedCRC === actualCRC);
|
|
161
160
|
const datagramSize = raw.payload.readUInt16BE(0);
|
|
162
161
|
const sessionId = raw.payload[2] >>> 4;
|
|
163
162
|
let payloadOffset = 3;
|
|
@@ -169,7 +168,7 @@ let TransportServiceCCFirstSegment = (() => {
|
|
|
169
168
|
payloadOffset += 1 + extLength;
|
|
170
169
|
}
|
|
171
170
|
const partialDatagram = raw.payload.subarray(payloadOffset, -2);
|
|
172
|
-
(0,
|
|
171
|
+
(0, import_core.validatePayload)(partialDatagram.length <= MAX_SEGMENT_SIZE);
|
|
173
172
|
return new this({
|
|
174
173
|
nodeId: ctx.sourceNodeId,
|
|
175
174
|
datagramSize,
|
|
@@ -186,26 +185,26 @@ let TransportServiceCCFirstSegment = (() => {
|
|
|
186
185
|
serialize(ctx) {
|
|
187
186
|
this.ccCommand = this.ccCommand & 248 | this.datagramSize >>> 8 & 7;
|
|
188
187
|
const ext = !!this.headerExtension && this.headerExtension.length >= 1;
|
|
189
|
-
this.payload =
|
|
188
|
+
this.payload = import_shared.Bytes.from([
|
|
190
189
|
this.datagramSize & 255,
|
|
191
190
|
(this.sessionId & 15) << 4 | (ext ? 8 : 0)
|
|
192
191
|
]);
|
|
193
192
|
if (ext) {
|
|
194
|
-
this.payload =
|
|
193
|
+
this.payload = import_shared.Bytes.concat([
|
|
195
194
|
this.payload,
|
|
196
|
-
|
|
195
|
+
import_shared.Bytes.from([this.headerExtension.length]),
|
|
197
196
|
this.headerExtension
|
|
198
197
|
]);
|
|
199
198
|
}
|
|
200
|
-
this.payload =
|
|
199
|
+
this.payload = import_shared.Bytes.concat([
|
|
201
200
|
this.payload,
|
|
202
201
|
this.partialDatagram,
|
|
203
|
-
|
|
202
|
+
import_shared.Bytes.alloc(2, 0)
|
|
204
203
|
// checksum
|
|
205
204
|
]);
|
|
206
|
-
const headerBuffer =
|
|
207
|
-
let crc = (0,
|
|
208
|
-
crc = (0,
|
|
205
|
+
const headerBuffer = import_shared.Bytes.from([this.ccId, this.ccCommand]);
|
|
206
|
+
let crc = (0, import_core.CRC16_CCITT)(headerBuffer);
|
|
207
|
+
crc = (0, import_core.CRC16_CCITT)(this.payload.subarray(0, -2), crc);
|
|
209
208
|
this.payload.writeUInt16BE(crc, this.payload.length - 2);
|
|
210
209
|
return super.serialize(ctx);
|
|
211
210
|
}
|
|
@@ -225,7 +224,7 @@ let TransportServiceCCFirstSegment = (() => {
|
|
|
225
224
|
"session ID": this.sessionId,
|
|
226
225
|
"datagram size": this.datagramSize,
|
|
227
226
|
"byte range": `0...${this.partialDatagram.length - 1}`,
|
|
228
|
-
payload: (0,
|
|
227
|
+
payload: (0, import_shared.buffer2hex)(this.partialDatagram)
|
|
229
228
|
}
|
|
230
229
|
};
|
|
231
230
|
}
|
|
@@ -261,16 +260,16 @@ let TransportServiceCCSubsequentSegment = (() => {
|
|
|
261
260
|
this.partialDatagram = options.partialDatagram;
|
|
262
261
|
}
|
|
263
262
|
static from(raw, ctx) {
|
|
264
|
-
(0,
|
|
265
|
-
const headerBuffer =
|
|
266
|
-
|
|
263
|
+
(0, import_core.validatePayload)(raw.payload.length >= 7);
|
|
264
|
+
const headerBuffer = import_shared.Bytes.from([
|
|
265
|
+
import_core.CommandClasses["Transport Service"],
|
|
267
266
|
import_Types.TransportServiceCommand.SubsequentSegment | raw.payload[0]
|
|
268
267
|
]);
|
|
269
268
|
const ccBuffer = raw.payload.subarray(1, -2);
|
|
270
|
-
let expectedCRC = (0,
|
|
271
|
-
expectedCRC = (0,
|
|
269
|
+
let expectedCRC = (0, import_core.CRC16_CCITT)(headerBuffer);
|
|
270
|
+
expectedCRC = (0, import_core.CRC16_CCITT)(ccBuffer, expectedCRC);
|
|
272
271
|
const actualCRC = raw.payload.readUInt16BE(raw.payload.length - 2);
|
|
273
|
-
(0,
|
|
272
|
+
(0, import_core.validatePayload)(expectedCRC === actualCRC);
|
|
274
273
|
const datagramSize = raw.payload.readUInt16BE(0);
|
|
275
274
|
const sessionId = raw.payload[2] >>> 4;
|
|
276
275
|
const datagramOffset = ((raw.payload[2] & 7) << 8) + raw.payload[3];
|
|
@@ -283,7 +282,7 @@ let TransportServiceCCSubsequentSegment = (() => {
|
|
|
283
282
|
payloadOffset += 1 + extLength;
|
|
284
283
|
}
|
|
285
284
|
const partialDatagram = raw.payload.subarray(payloadOffset, -2);
|
|
286
|
-
(0,
|
|
285
|
+
(0, import_core.validatePayload)(partialDatagram.length <= MAX_SEGMENT_SIZE);
|
|
287
286
|
return new this({
|
|
288
287
|
nodeId: ctx.sourceNodeId,
|
|
289
288
|
datagramSize,
|
|
@@ -321,11 +320,11 @@ let TransportServiceCCSubsequentSegment = (() => {
|
|
|
321
320
|
return { ccCommand: void 0, sessionId: this.sessionId };
|
|
322
321
|
}
|
|
323
322
|
async mergePartialCCs(partials, ctx) {
|
|
324
|
-
const datagram = new
|
|
323
|
+
const datagram = new import_shared.Bytes(this.datagramSize);
|
|
325
324
|
for (const partial of [...partials, this]) {
|
|
326
325
|
const offset = partial instanceof TransportServiceCCFirstSegment ? 0 : partial.datagramOffset;
|
|
327
326
|
if (offset + partial.partialDatagram.length > datagram.length) {
|
|
328
|
-
throw new
|
|
327
|
+
throw new import_core.ZWaveError(`The partial datagram offset and length in a segment are not compatible to the communicated datagram length`, import_core.ZWaveErrorCodes.PacketFormat_InvalidPayload);
|
|
329
328
|
}
|
|
330
329
|
datagram.set(partial.partialDatagram, offset);
|
|
331
330
|
}
|
|
@@ -335,27 +334,27 @@ let TransportServiceCCSubsequentSegment = (() => {
|
|
|
335
334
|
serialize(ctx) {
|
|
336
335
|
this.ccCommand = this.ccCommand & 248 | this.datagramSize >>> 8 & 7;
|
|
337
336
|
const ext = !!this.headerExtension && this.headerExtension.length >= 1;
|
|
338
|
-
this.payload =
|
|
337
|
+
this.payload = import_shared.Bytes.from([
|
|
339
338
|
this.datagramSize & 255,
|
|
340
339
|
(this.sessionId & 15) << 4 | (ext ? 8 : 0) | this.datagramOffset >>> 8 & 7,
|
|
341
340
|
this.datagramOffset & 255
|
|
342
341
|
]);
|
|
343
342
|
if (ext) {
|
|
344
|
-
this.payload =
|
|
343
|
+
this.payload = import_shared.Bytes.concat([
|
|
345
344
|
this.payload,
|
|
346
|
-
|
|
345
|
+
import_shared.Bytes.from([this.headerExtension.length]),
|
|
347
346
|
this.headerExtension
|
|
348
347
|
]);
|
|
349
348
|
}
|
|
350
|
-
this.payload =
|
|
349
|
+
this.payload = import_shared.Bytes.concat([
|
|
351
350
|
this.payload,
|
|
352
351
|
this.partialDatagram,
|
|
353
|
-
|
|
352
|
+
import_shared.Bytes.alloc(2, 0)
|
|
354
353
|
// checksum
|
|
355
354
|
]);
|
|
356
|
-
const headerBuffer =
|
|
357
|
-
let crc = (0,
|
|
358
|
-
crc = (0,
|
|
355
|
+
const headerBuffer = import_shared.Bytes.from([this.ccId, this.ccCommand]);
|
|
356
|
+
let crc = (0, import_core.CRC16_CCITT)(headerBuffer);
|
|
357
|
+
crc = (0, import_core.CRC16_CCITT)(this.payload.subarray(0, -2), crc);
|
|
359
358
|
this.payload.writeUInt16BE(crc, this.payload.length - 2);
|
|
360
359
|
return super.serialize(ctx);
|
|
361
360
|
}
|
|
@@ -369,7 +368,7 @@ let TransportServiceCCSubsequentSegment = (() => {
|
|
|
369
368
|
"session ID": this.sessionId,
|
|
370
369
|
"datagram size": this.datagramSize,
|
|
371
370
|
"byte range": `${this.datagramOffset}...${this.datagramOffset + this.partialDatagram.length - 1}`,
|
|
372
|
-
payload: (0,
|
|
371
|
+
payload: (0, import_shared.buffer2hex)(this.partialDatagram)
|
|
373
372
|
}
|
|
374
373
|
};
|
|
375
374
|
}
|
|
@@ -402,7 +401,7 @@ let TransportServiceCCSegmentRequest = (() => {
|
|
|
402
401
|
this.datagramOffset = options.datagramOffset;
|
|
403
402
|
}
|
|
404
403
|
static from(raw, ctx) {
|
|
405
|
-
(0,
|
|
404
|
+
(0, import_core.validatePayload)(raw.payload.length >= 3);
|
|
406
405
|
const sessionId = raw.payload[1] >>> 4;
|
|
407
406
|
const datagramOffset = ((raw.payload[1] & 7) << 8) + raw.payload[2];
|
|
408
407
|
return new this({
|
|
@@ -414,7 +413,7 @@ let TransportServiceCCSegmentRequest = (() => {
|
|
|
414
413
|
sessionId;
|
|
415
414
|
datagramOffset;
|
|
416
415
|
serialize(ctx) {
|
|
417
|
-
this.payload =
|
|
416
|
+
this.payload = import_shared.Bytes.from([
|
|
418
417
|
(this.sessionId & 15) << 4 | this.datagramOffset >>> 8 & 7,
|
|
419
418
|
this.datagramOffset & 255
|
|
420
419
|
]);
|
|
@@ -457,7 +456,7 @@ let TransportServiceCCSegmentComplete = (() => {
|
|
|
457
456
|
this.sessionId = options.sessionId;
|
|
458
457
|
}
|
|
459
458
|
static from(raw, ctx) {
|
|
460
|
-
(0,
|
|
459
|
+
(0, import_core.validatePayload)(raw.payload.length >= 2);
|
|
461
460
|
const sessionId = raw.payload[1] >>> 4;
|
|
462
461
|
return new this({
|
|
463
462
|
nodeId: ctx.sourceNodeId,
|
|
@@ -466,7 +465,7 @@ let TransportServiceCCSegmentComplete = (() => {
|
|
|
466
465
|
}
|
|
467
466
|
sessionId;
|
|
468
467
|
serialize(ctx) {
|
|
469
|
-
this.payload =
|
|
468
|
+
this.payload = import_shared.Bytes.from([(this.sessionId & 15) << 4]);
|
|
470
469
|
return super.serialize(ctx);
|
|
471
470
|
}
|
|
472
471
|
toLogEntry(ctx) {
|
|
@@ -503,7 +502,7 @@ let TransportServiceCCSegmentWait = (() => {
|
|
|
503
502
|
this.pendingSegments = options.pendingSegments;
|
|
504
503
|
}
|
|
505
504
|
static from(raw, ctx) {
|
|
506
|
-
(0,
|
|
505
|
+
(0, import_core.validatePayload)(raw.payload.length >= 2);
|
|
507
506
|
const pendingSegments = raw.payload[1];
|
|
508
507
|
return new this({
|
|
509
508
|
nodeId: ctx.sourceNodeId,
|
|
@@ -512,7 +511,7 @@ let TransportServiceCCSegmentWait = (() => {
|
|
|
512
511
|
}
|
|
513
512
|
pendingSegments;
|
|
514
513
|
serialize(ctx) {
|
|
515
|
-
this.payload =
|
|
514
|
+
this.payload = import_shared.Bytes.from([this.pendingSegments]);
|
|
516
515
|
return super.serialize(ctx);
|
|
517
516
|
}
|
|
518
517
|
toLogEntry(ctx) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/cc/TransportServiceCC.ts"],
|
|
4
|
-
"sourcesContent": ["import { type CCEncodingContext, type CCParsingContext } from \"@zwave-js/cc\";\nimport {\n\tCRC16_CCITT,\n\tCommandClasses,\n\ttype GetValueDB,\n\ttype MessageOrCCLogEntry,\n\ttype SinglecastCC,\n\ttype WithAddress,\n\tZWaveError,\n\tZWaveErrorCodes,\n\tvalidatePayload,\n} from \"@zwave-js/core/safe\";\nimport { Bytes } from \"@zwave-js/shared/safe\";\nimport { buffer2hex } from \"@zwave-js/shared/safe\";\nimport { type CCRaw, CommandClass } from \"../lib/CommandClass.js\";\nimport {\n\tCCCommand,\n\tcommandClass,\n\timplementedVersion,\n} from \"../lib/CommandClassDecorators.js\";\nimport { TransportServiceCommand } from \"../lib/_Types.js\";\n\nexport const MAX_SEGMENT_SIZE = 39;\n\nexport const RELAXED_TIMING_THRESHOLD = 2;\n\n// TODO: Figure out how we know if communicating with R2 or R3\n/** @publicAPI */\nexport const TransportServiceTimeouts = {\n\t/** Waiting time before requesting a missing segment at data rate R2 */\n\trequestMissingSegmentR2: 800,\n\t/** Waiting time before requesting a missing segment at data rate R3 */\n\trequestMissingSegmentR3: 400,\n\t/** Waiting time before sending another datagram at data rate R2 */\n\tsegmentCompleteR2: 1000,\n\t/** Waiting time before sending another datagram at data rate R3 */\n\tsegmentCompleteR3: 500,\n\t/** Waiting time between segments when sending more than {@link RELAXED_TIMING_THRESHOLD} segments at data rate R2 */\n\trelaxedTimingDelayR2: 35,\n\t/** Waiting time between segments when sending more than {@link RELAXED_TIMING_THRESHOLD} segments at data rate R3 */\n\trelaxedTimingDelayR3: 15,\n};\n\n@commandClass(CommandClasses[\"Transport Service\"])\n@implementedVersion(2)\nexport class TransportServiceCC extends CommandClass\n\timplements SinglecastCC<TransportServiceCC>\n{\n\tdeclare ccCommand: TransportServiceCommand;\n\tdeclare nodeId: number;\n}\n\n// @publicAPI\nexport interface TransportServiceCCFirstSegmentOptions {\n\tdatagramSize: number;\n\tsessionId: number;\n\theaderExtension?: Uint8Array | undefined;\n\tpartialDatagram: Uint8Array;\n}\n\n/** @publicAPI */\nexport function isTransportServiceEncapsulation(\n\tcommand: CommandClass,\n): command is\n\t| TransportServiceCCFirstSegment\n\t| TransportServiceCCSubsequentSegment\n{\n\treturn (\n\t\tcommand.ccId === CommandClasses[\"Transport Service\"]\n\t\t&& (command.ccCommand === TransportServiceCommand.FirstSegment\n\t\t\t|| command.ccCommand === TransportServiceCommand.SubsequentSegment)\n\t);\n}\n\n@CCCommand(TransportServiceCommand.FirstSegment)\n// Handling expected responses is done by the RX state machine\nexport class TransportServiceCCFirstSegment extends TransportServiceCC {\n\tpublic constructor(\n\t\toptions: WithAddress<TransportServiceCCFirstSegmentOptions>,\n\t) {\n\t\tsuper(options);\n\t\tthis.datagramSize = options.datagramSize;\n\t\tthis.sessionId = options.sessionId;\n\t\tthis.headerExtension = options.headerExtension;\n\t\tthis.partialDatagram = options.partialDatagram;\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): TransportServiceCCFirstSegment {\n\t\t// Deserialization has already split the datagram size from the ccCommand.\n\t\t// Therefore we have one more payload byte\n\n\t\tvalidatePayload(raw.payload.length >= 6); // 2 bytes dgram size, 1 byte sessid/ext, 1+ bytes payload, 2 bytes checksum\n\n\t\t// Verify the CRC\n\t\tconst headerBuffer = Bytes.from([\n\t\t\tCommandClasses[\"Transport Service\"],\n\t\t\tTransportServiceCommand.FirstSegment | raw.payload[0],\n\t\t]);\n\t\tconst ccBuffer = raw.payload.subarray(1, -2);\n\t\tlet expectedCRC = CRC16_CCITT(headerBuffer);\n\t\texpectedCRC = CRC16_CCITT(ccBuffer, expectedCRC);\n\t\tconst actualCRC = raw.payload.readUInt16BE(\n\t\t\traw.payload.length - 2,\n\t\t);\n\t\tvalidatePayload(expectedCRC === actualCRC);\n\t\tconst datagramSize = raw.payload.readUInt16BE(0);\n\t\tconst sessionId = raw.payload[2] >>> 4;\n\t\tlet payloadOffset = 3;\n\n\t\t// If there is a header extension, read it\n\t\tconst hasHeaderExtension = !!(raw.payload[2] & 0b1000);\n\t\tlet headerExtension: Uint8Array | undefined;\n\n\t\tif (hasHeaderExtension) {\n\t\t\tconst extLength = raw.payload[3];\n\t\t\theaderExtension = raw.payload.subarray(4, 4 + extLength);\n\t\t\tpayloadOffset += 1 + extLength;\n\t\t}\n\t\tconst partialDatagram: Uint8Array = raw.payload.subarray(\n\t\t\tpayloadOffset,\n\t\t\t-2,\n\t\t);\n\n\t\t// A node supporting the Transport Service Command Class, version 2\n\t\t// MUST NOT send Transport Service segments with the Payload field longer than 39 bytes.\n\t\tvalidatePayload(partialDatagram.length <= MAX_SEGMENT_SIZE);\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\tdatagramSize,\n\t\t\tsessionId,\n\t\t\theaderExtension,\n\t\t\tpartialDatagram,\n\t\t});\n\t}\n\n\tpublic datagramSize: number;\n\tpublic sessionId: number;\n\tpublic headerExtension: Uint8Array | undefined;\n\tpublic partialDatagram: Uint8Array;\n\tpublic encapsulated!: CommandClass;\n\n\tpublic serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\t// Transport Service re-uses the lower 3 bits of the ccCommand as payload\n\t\tthis.ccCommand = (this.ccCommand & 0b11111_000)\n\t\t\t| ((this.datagramSize >>> 8) & 0b111);\n\n\t\tconst ext = !!this.headerExtension && this.headerExtension.length >= 1;\n\t\tthis.payload = Bytes.from([\n\t\t\tthis.datagramSize & 0xff,\n\t\t\t((this.sessionId & 0b1111) << 4) | (ext ? 0b1000 : 0),\n\t\t]);\n\t\tif (ext) {\n\t\t\tthis.payload = Bytes.concat([\n\t\t\t\tthis.payload,\n\t\t\t\tBytes.from([this.headerExtension!.length]),\n\t\t\t\tthis.headerExtension!,\n\t\t\t]);\n\t\t}\n\t\tthis.payload = Bytes.concat([\n\t\t\tthis.payload,\n\t\t\tthis.partialDatagram,\n\t\t\tBytes.alloc(2, 0), // checksum\n\t\t]);\n\n\t\t// Compute and save the CRC16 in the payload\n\t\t// The CC header is included in the CRC computation\n\t\tconst headerBuffer = Bytes.from([this.ccId, this.ccCommand]);\n\t\tlet crc = CRC16_CCITT(headerBuffer);\n\t\tcrc = CRC16_CCITT(this.payload.subarray(0, -2), crc);\n\t\t// Write the checksum into the last two bytes of the payload\n\t\tthis.payload.writeUInt16BE(crc, this.payload.length - 2);\n\n\t\treturn super.serialize(ctx);\n\t}\n\n\tpublic expectMoreMessages(): boolean {\n\t\treturn true; // The FirstSegment message always expects more messages\n\t}\n\n\tpublic getPartialCCSessionId(): Record<string, any> | undefined {\n\t\t// Only use the session ID to identify the session, not the CC command\n\t\treturn { ccCommand: undefined, sessionId: this.sessionId };\n\t}\n\n\tprotected computeEncapsulationOverhead(): number {\n\t\t// 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\n\t\treturn (\n\t\t\tsuper.computeEncapsulationOverhead()\n\t\t\t+ 4\n\t\t\t+ (this.headerExtension?.length\n\t\t\t\t? 1 + this.headerExtension.length\n\t\t\t\t: 0)\n\t\t);\n\t}\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage: {\n\t\t\t\t\"session ID\": this.sessionId,\n\t\t\t\t\"datagram size\": this.datagramSize,\n\t\t\t\t\"byte range\": `0...${this.partialDatagram.length - 1}`,\n\t\t\t\tpayload: buffer2hex(this.partialDatagram),\n\t\t\t},\n\t\t};\n\t}\n}\n\n// @publicAPI\nexport interface TransportServiceCCSubsequentSegmentOptions\n\textends TransportServiceCCFirstSegmentOptions\n{\n\tdatagramOffset: number;\n}\n\n@CCCommand(TransportServiceCommand.SubsequentSegment)\n// Handling expected responses is done by the RX state machine\nexport class TransportServiceCCSubsequentSegment extends TransportServiceCC {\n\tpublic constructor(\n\t\toptions: WithAddress<TransportServiceCCSubsequentSegmentOptions>,\n\t) {\n\t\tsuper(options);\n\t\tthis.datagramSize = options.datagramSize;\n\t\tthis.datagramOffset = options.datagramOffset;\n\t\tthis.sessionId = options.sessionId;\n\t\tthis.headerExtension = options.headerExtension;\n\t\tthis.partialDatagram = options.partialDatagram;\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): TransportServiceCCSubsequentSegment {\n\t\t// Deserialization has already split the datagram size from the ccCommand.\n\t\t// Therefore we have one more payload byte\n\n\t\tvalidatePayload(raw.payload.length >= 7); // 2 bytes dgram size, 1 byte sessid/ext/offset, 1 byte offset, 1+ bytes payload, 2 bytes checksum\n\n\t\t// Verify the CRC\n\t\tconst headerBuffer = Bytes.from([\n\t\t\tCommandClasses[\"Transport Service\"],\n\t\t\tTransportServiceCommand.SubsequentSegment | raw.payload[0],\n\t\t]);\n\t\tconst ccBuffer = raw.payload.subarray(1, -2);\n\t\tlet expectedCRC = CRC16_CCITT(headerBuffer);\n\t\texpectedCRC = CRC16_CCITT(ccBuffer, expectedCRC);\n\t\tconst actualCRC = raw.payload.readUInt16BE(\n\t\t\traw.payload.length - 2,\n\t\t);\n\t\tvalidatePayload(expectedCRC === actualCRC);\n\t\tconst datagramSize = raw.payload.readUInt16BE(0);\n\t\tconst sessionId = raw.payload[2] >>> 4;\n\t\tconst datagramOffset = ((raw.payload[2] & 0b111) << 8)\n\t\t\t+ raw.payload[3];\n\t\tlet payloadOffset = 4;\n\n\t\t// If there is a header extension, read it\n\t\tconst hasHeaderExtension = !!(raw.payload[2] & 0b1000);\n\t\tlet headerExtension: Bytes | undefined;\n\n\t\tif (hasHeaderExtension) {\n\t\t\tconst extLength = raw.payload[4];\n\t\t\theaderExtension = raw.payload.subarray(5, 5 + extLength);\n\t\t\tpayloadOffset += 1 + extLength;\n\t\t}\n\t\tconst partialDatagram: Bytes = raw.payload.subarray(payloadOffset, -2);\n\n\t\t// A node supporting the Transport Service Command Class, version 2\n\t\t// MUST NOT send Transport Service segments with the Payload field longer than 39 bytes.\n\t\tvalidatePayload(partialDatagram.length <= MAX_SEGMENT_SIZE);\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\tdatagramSize,\n\t\t\tsessionId,\n\t\t\tdatagramOffset,\n\t\t\theaderExtension,\n\t\t\tpartialDatagram,\n\t\t});\n\t}\n\n\tpublic datagramSize: number;\n\tpublic datagramOffset: number;\n\tpublic sessionId: number;\n\tpublic headerExtension: Uint8Array | undefined;\n\tpublic partialDatagram: Uint8Array;\n\n\t// This can only be received\n\tprivate _encapsulated!: CommandClass;\n\tpublic get encapsulated(): CommandClass {\n\t\treturn this._encapsulated;\n\t}\n\n\tpublic expectMoreMessages(\n\t\tsession: [\n\t\t\tTransportServiceCCFirstSegment,\n\t\t\t...TransportServiceCCSubsequentSegment[],\n\t\t],\n\t): boolean {\n\t\tif (!(session[0] instanceof TransportServiceCCFirstSegment)) {\n\t\t\t// First segment is missing\n\t\t\treturn true;\n\t\t}\n\t\tconst datagramSize = session[0].datagramSize;\n\t\tconst receivedBytes = new Array<boolean>(datagramSize).fill(false);\n\t\tfor (const segment of [...session, this]) {\n\t\t\tconst offset = segment instanceof TransportServiceCCFirstSegment\n\t\t\t\t? 0\n\t\t\t\t: segment.datagramOffset;\n\t\t\tfor (\n\t\t\t\tlet i = offset;\n\t\t\t\ti <= offset + segment.partialDatagram.length;\n\t\t\t\ti++\n\t\t\t) {\n\t\t\t\treceivedBytes[i] = true;\n\t\t\t}\n\t\t}\n\t\t// Expect more messages as long as we haven't received everything\n\t\treturn receivedBytes.includes(false);\n\t}\n\n\tpublic getPartialCCSessionId(): Record<string, any> | undefined {\n\t\t// Only use the session ID to identify the session, not the CC command\n\t\treturn { ccCommand: undefined, sessionId: this.sessionId };\n\t}\n\n\tpublic async mergePartialCCs(\n\t\tpartials: [\n\t\t\tTransportServiceCCFirstSegment,\n\t\t\t...TransportServiceCCSubsequentSegment[],\n\t\t],\n\t\tctx: CCParsingContext,\n\t): Promise<void> {\n\t\t// Concat the CC buffers\n\t\tconst datagram = new Bytes(this.datagramSize);\n\t\tfor (const partial of [...partials, this]) {\n\t\t\t// Ensure that we don't try to write out-of-bounds\n\t\t\tconst offset = partial instanceof TransportServiceCCFirstSegment\n\t\t\t\t? 0\n\t\t\t\t: partial.datagramOffset;\n\t\t\tif (offset + partial.partialDatagram.length > datagram.length) {\n\t\t\t\tthrow new ZWaveError(\n\t\t\t\t\t`The partial datagram offset and length in a segment are not compatible to the communicated datagram length`,\n\t\t\t\t\tZWaveErrorCodes.PacketFormat_InvalidPayload,\n\t\t\t\t);\n\t\t\t}\n\t\t\tdatagram.set(partial.partialDatagram, offset);\n\t\t}\n\n\t\t// and deserialize the CC\n\t\tthis._encapsulated = await CommandClass.parse(datagram, ctx);\n\t\tthis._encapsulated.encapsulatingCC = this as any;\n\t}\n\n\tpublic serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\t// Transport Service re-uses the lower 3 bits of the ccCommand as payload\n\t\tthis.ccCommand = (this.ccCommand & 0b11111_000)\n\t\t\t| ((this.datagramSize >>> 8) & 0b111);\n\n\t\tconst ext = !!this.headerExtension && this.headerExtension.length >= 1;\n\t\tthis.payload = Bytes.from([\n\t\t\tthis.datagramSize & 0xff,\n\t\t\t((this.sessionId & 0b1111) << 4)\n\t\t\t| (ext ? 0b1000 : 0)\n\t\t\t| ((this.datagramOffset >>> 8) & 0b111),\n\t\t\tthis.datagramOffset & 0xff,\n\t\t]);\n\t\tif (ext) {\n\t\t\tthis.payload = Bytes.concat([\n\t\t\t\tthis.payload,\n\t\t\t\tBytes.from([this.headerExtension!.length]),\n\t\t\t\tthis.headerExtension!,\n\t\t\t]);\n\t\t}\n\t\tthis.payload = Bytes.concat([\n\t\t\tthis.payload,\n\t\t\tthis.partialDatagram,\n\t\t\tBytes.alloc(2, 0), // checksum\n\t\t]);\n\n\t\t// Compute and save the CRC16 in the payload\n\t\t// The CC header is included in the CRC computation\n\t\tconst headerBuffer = Bytes.from([this.ccId, this.ccCommand]);\n\t\tlet crc = CRC16_CCITT(headerBuffer);\n\t\tcrc = CRC16_CCITT(this.payload.subarray(0, -2), crc);\n\t\t// Write the checksum into the last two bytes of the payload\n\t\tthis.payload.writeUInt16BE(crc, this.payload.length - 2);\n\n\t\treturn super.serialize(ctx);\n\t}\n\n\tprotected computeEncapsulationOverhead(): number {\n\t\t// 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\n\t\treturn (\n\t\t\tsuper.computeEncapsulationOverhead()\n\t\t\t+ 5\n\t\t\t+ (this.headerExtension?.length\n\t\t\t\t? 1 + this.headerExtension.length\n\t\t\t\t: 0)\n\t\t);\n\t}\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage: {\n\t\t\t\t\"session ID\": this.sessionId,\n\t\t\t\t\"datagram size\": this.datagramSize,\n\t\t\t\t\"byte range\": `${this.datagramOffset}...${\n\t\t\t\t\tthis.datagramOffset + this.partialDatagram.length - 1\n\t\t\t\t}`,\n\t\t\t\tpayload: buffer2hex(this.partialDatagram),\n\t\t\t},\n\t\t};\n\t}\n}\n\n// @publicAPI\nexport interface TransportServiceCCSegmentRequestOptions {\n\tsessionId: number;\n\tdatagramOffset: number;\n}\n\n@CCCommand(TransportServiceCommand.SegmentRequest)\n// Handling expected responses is done by the RX state machine\nexport class TransportServiceCCSegmentRequest extends TransportServiceCC {\n\tpublic constructor(\n\t\toptions: WithAddress<TransportServiceCCSegmentRequestOptions>,\n\t) {\n\t\tsuper(options);\n\t\tthis.sessionId = options.sessionId;\n\t\tthis.datagramOffset = options.datagramOffset;\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): TransportServiceCCSegmentRequest {\n\t\tvalidatePayload(raw.payload.length >= 3);\n\t\tconst sessionId = raw.payload[1] >>> 4;\n\t\tconst datagramOffset = ((raw.payload[1] & 0b111) << 8)\n\t\t\t+ raw.payload[2];\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\tsessionId,\n\t\t\tdatagramOffset,\n\t\t});\n\t}\n\n\tpublic sessionId: number;\n\tpublic datagramOffset: number;\n\n\tpublic serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\tthis.payload = Bytes.from([\n\t\t\t((this.sessionId & 0b1111) << 4)\n\t\t\t| ((this.datagramOffset >>> 8) & 0b111),\n\t\t\tthis.datagramOffset & 0xff,\n\t\t]);\n\t\treturn super.serialize(ctx);\n\t}\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage: {\n\t\t\t\t\"session ID\": this.sessionId,\n\t\t\t\toffset: this.datagramOffset,\n\t\t\t},\n\t\t};\n\t}\n}\n\n// @publicAPI\nexport interface TransportServiceCCSegmentCompleteOptions {\n\tsessionId: number;\n}\n\n@CCCommand(TransportServiceCommand.SegmentComplete)\nexport class TransportServiceCCSegmentComplete extends TransportServiceCC {\n\tpublic constructor(\n\t\toptions: WithAddress<TransportServiceCCSegmentCompleteOptions>,\n\t) {\n\t\tsuper(options);\n\t\tthis.sessionId = options.sessionId;\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): TransportServiceCCSegmentComplete {\n\t\tvalidatePayload(raw.payload.length >= 2);\n\t\tconst sessionId = raw.payload[1] >>> 4;\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\tsessionId,\n\t\t});\n\t}\n\n\tpublic sessionId: number;\n\n\tpublic serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\tthis.payload = Bytes.from([(this.sessionId & 0b1111) << 4]);\n\t\treturn super.serialize(ctx);\n\t}\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage: { \"session ID\": this.sessionId },\n\t\t};\n\t}\n}\n\n// @publicAPI\nexport interface TransportServiceCCSegmentWaitOptions {\n\tpendingSegments: number;\n}\n\n@CCCommand(TransportServiceCommand.SegmentWait)\nexport class TransportServiceCCSegmentWait extends TransportServiceCC {\n\tpublic constructor(\n\t\toptions: WithAddress<TransportServiceCCSegmentWaitOptions>,\n\t) {\n\t\tsuper(options);\n\t\tthis.pendingSegments = options.pendingSegments;\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): TransportServiceCCSegmentWait {\n\t\tvalidatePayload(raw.payload.length >= 2);\n\t\tconst pendingSegments = raw.payload[1];\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\tpendingSegments,\n\t\t});\n\t}\n\n\tpublic pendingSegments: number;\n\n\tpublic serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\tthis.payload = Bytes.from([this.pendingSegments]);\n\t\treturn super.serialize(ctx);\n\t}\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage: { \"pending segments\": this.pendingSegments },\n\t\t};\n\t}\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,kBAUO;AACP,
|
|
6
|
-
"names": [
|
|
4
|
+
"sourcesContent": ["import type { CCEncodingContext, CCParsingContext } from \"@zwave-js/cc\";\nimport {\n\tCRC16_CCITT,\n\tCommandClasses,\n\ttype GetValueDB,\n\ttype MessageOrCCLogEntry,\n\ttype SinglecastCC,\n\ttype WithAddress,\n\tZWaveError,\n\tZWaveErrorCodes,\n\tvalidatePayload,\n} from \"@zwave-js/core\";\nimport { Bytes, buffer2hex } from \"@zwave-js/shared\";\nimport { type CCRaw, CommandClass } from \"../lib/CommandClass.js\";\nimport {\n\tCCCommand,\n\tcommandClass,\n\timplementedVersion,\n} from \"../lib/CommandClassDecorators.js\";\nimport { TransportServiceCommand } from \"../lib/_Types.js\";\n\nexport const MAX_SEGMENT_SIZE = 39;\n\nexport const RELAXED_TIMING_THRESHOLD = 2;\n\n// TODO: Figure out how we know if communicating with R2 or R3\n/** @publicAPI */\nexport const TransportServiceTimeouts = {\n\t/** Waiting time before requesting a missing segment at data rate R2 */\n\trequestMissingSegmentR2: 800,\n\t/** Waiting time before requesting a missing segment at data rate R3 */\n\trequestMissingSegmentR3: 400,\n\t/** Waiting time before sending another datagram at data rate R2 */\n\tsegmentCompleteR2: 1000,\n\t/** Waiting time before sending another datagram at data rate R3 */\n\tsegmentCompleteR3: 500,\n\t/** Waiting time between segments when sending more than {@link RELAXED_TIMING_THRESHOLD} segments at data rate R2 */\n\trelaxedTimingDelayR2: 35,\n\t/** Waiting time between segments when sending more than {@link RELAXED_TIMING_THRESHOLD} segments at data rate R3 */\n\trelaxedTimingDelayR3: 15,\n};\n\n@commandClass(CommandClasses[\"Transport Service\"])\n@implementedVersion(2)\nexport class TransportServiceCC extends CommandClass\n\timplements SinglecastCC<TransportServiceCC>\n{\n\tdeclare ccCommand: TransportServiceCommand;\n\tdeclare nodeId: number;\n}\n\n// @publicAPI\nexport interface TransportServiceCCFirstSegmentOptions {\n\tdatagramSize: number;\n\tsessionId: number;\n\theaderExtension?: Uint8Array | undefined;\n\tpartialDatagram: Uint8Array;\n}\n\n/** @publicAPI */\nexport function isTransportServiceEncapsulation(\n\tcommand: CommandClass,\n): command is\n\t| TransportServiceCCFirstSegment\n\t| TransportServiceCCSubsequentSegment\n{\n\treturn (\n\t\tcommand.ccId === CommandClasses[\"Transport Service\"]\n\t\t&& (command.ccCommand === TransportServiceCommand.FirstSegment\n\t\t\t|| command.ccCommand === TransportServiceCommand.SubsequentSegment)\n\t);\n}\n\n@CCCommand(TransportServiceCommand.FirstSegment)\n// Handling expected responses is done by the RX state machine\nexport class TransportServiceCCFirstSegment extends TransportServiceCC {\n\tpublic constructor(\n\t\toptions: WithAddress<TransportServiceCCFirstSegmentOptions>,\n\t) {\n\t\tsuper(options);\n\t\tthis.datagramSize = options.datagramSize;\n\t\tthis.sessionId = options.sessionId;\n\t\tthis.headerExtension = options.headerExtension;\n\t\tthis.partialDatagram = options.partialDatagram;\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): TransportServiceCCFirstSegment {\n\t\t// Deserialization has already split the datagram size from the ccCommand.\n\t\t// Therefore we have one more payload byte\n\n\t\tvalidatePayload(raw.payload.length >= 6); // 2 bytes dgram size, 1 byte sessid/ext, 1+ bytes payload, 2 bytes checksum\n\n\t\t// Verify the CRC\n\t\tconst headerBuffer = Bytes.from([\n\t\t\tCommandClasses[\"Transport Service\"],\n\t\t\tTransportServiceCommand.FirstSegment | raw.payload[0],\n\t\t]);\n\t\tconst ccBuffer = raw.payload.subarray(1, -2);\n\t\tlet expectedCRC = CRC16_CCITT(headerBuffer);\n\t\texpectedCRC = CRC16_CCITT(ccBuffer, expectedCRC);\n\t\tconst actualCRC = raw.payload.readUInt16BE(\n\t\t\traw.payload.length - 2,\n\t\t);\n\t\tvalidatePayload(expectedCRC === actualCRC);\n\t\tconst datagramSize = raw.payload.readUInt16BE(0);\n\t\tconst sessionId = raw.payload[2] >>> 4;\n\t\tlet payloadOffset = 3;\n\n\t\t// If there is a header extension, read it\n\t\tconst hasHeaderExtension = !!(raw.payload[2] & 0b1000);\n\t\tlet headerExtension: Uint8Array | undefined;\n\n\t\tif (hasHeaderExtension) {\n\t\t\tconst extLength = raw.payload[3];\n\t\t\theaderExtension = raw.payload.subarray(4, 4 + extLength);\n\t\t\tpayloadOffset += 1 + extLength;\n\t\t}\n\t\tconst partialDatagram: Uint8Array = raw.payload.subarray(\n\t\t\tpayloadOffset,\n\t\t\t-2,\n\t\t);\n\n\t\t// A node supporting the Transport Service Command Class, version 2\n\t\t// MUST NOT send Transport Service segments with the Payload field longer than 39 bytes.\n\t\tvalidatePayload(partialDatagram.length <= MAX_SEGMENT_SIZE);\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\tdatagramSize,\n\t\t\tsessionId,\n\t\t\theaderExtension,\n\t\t\tpartialDatagram,\n\t\t});\n\t}\n\n\tpublic datagramSize: number;\n\tpublic sessionId: number;\n\tpublic headerExtension: Uint8Array | undefined;\n\tpublic partialDatagram: Uint8Array;\n\tpublic encapsulated!: CommandClass;\n\n\tpublic serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\t// Transport Service re-uses the lower 3 bits of the ccCommand as payload\n\t\tthis.ccCommand = (this.ccCommand & 0b11111_000)\n\t\t\t| ((this.datagramSize >>> 8) & 0b111);\n\n\t\tconst ext = !!this.headerExtension && this.headerExtension.length >= 1;\n\t\tthis.payload = Bytes.from([\n\t\t\tthis.datagramSize & 0xff,\n\t\t\t((this.sessionId & 0b1111) << 4) | (ext ? 0b1000 : 0),\n\t\t]);\n\t\tif (ext) {\n\t\t\tthis.payload = Bytes.concat([\n\t\t\t\tthis.payload,\n\t\t\t\tBytes.from([this.headerExtension!.length]),\n\t\t\t\tthis.headerExtension!,\n\t\t\t]);\n\t\t}\n\t\tthis.payload = Bytes.concat([\n\t\t\tthis.payload,\n\t\t\tthis.partialDatagram,\n\t\t\tBytes.alloc(2, 0), // checksum\n\t\t]);\n\n\t\t// Compute and save the CRC16 in the payload\n\t\t// The CC header is included in the CRC computation\n\t\tconst headerBuffer = Bytes.from([this.ccId, this.ccCommand]);\n\t\tlet crc = CRC16_CCITT(headerBuffer);\n\t\tcrc = CRC16_CCITT(this.payload.subarray(0, -2), crc);\n\t\t// Write the checksum into the last two bytes of the payload\n\t\tthis.payload.writeUInt16BE(crc, this.payload.length - 2);\n\n\t\treturn super.serialize(ctx);\n\t}\n\n\tpublic expectMoreMessages(): boolean {\n\t\treturn true; // The FirstSegment message always expects more messages\n\t}\n\n\tpublic getPartialCCSessionId(): Record<string, any> | undefined {\n\t\t// Only use the session ID to identify the session, not the CC command\n\t\treturn { ccCommand: undefined, sessionId: this.sessionId };\n\t}\n\n\tprotected computeEncapsulationOverhead(): number {\n\t\t// 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\n\t\treturn (\n\t\t\tsuper.computeEncapsulationOverhead()\n\t\t\t+ 4\n\t\t\t+ (this.headerExtension?.length\n\t\t\t\t? 1 + this.headerExtension.length\n\t\t\t\t: 0)\n\t\t);\n\t}\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage: {\n\t\t\t\t\"session ID\": this.sessionId,\n\t\t\t\t\"datagram size\": this.datagramSize,\n\t\t\t\t\"byte range\": `0...${this.partialDatagram.length - 1}`,\n\t\t\t\tpayload: buffer2hex(this.partialDatagram),\n\t\t\t},\n\t\t};\n\t}\n}\n\n// @publicAPI\nexport interface TransportServiceCCSubsequentSegmentOptions\n\textends TransportServiceCCFirstSegmentOptions\n{\n\tdatagramOffset: number;\n}\n\n@CCCommand(TransportServiceCommand.SubsequentSegment)\n// Handling expected responses is done by the RX state machine\nexport class TransportServiceCCSubsequentSegment extends TransportServiceCC {\n\tpublic constructor(\n\t\toptions: WithAddress<TransportServiceCCSubsequentSegmentOptions>,\n\t) {\n\t\tsuper(options);\n\t\tthis.datagramSize = options.datagramSize;\n\t\tthis.datagramOffset = options.datagramOffset;\n\t\tthis.sessionId = options.sessionId;\n\t\tthis.headerExtension = options.headerExtension;\n\t\tthis.partialDatagram = options.partialDatagram;\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): TransportServiceCCSubsequentSegment {\n\t\t// Deserialization has already split the datagram size from the ccCommand.\n\t\t// Therefore we have one more payload byte\n\n\t\tvalidatePayload(raw.payload.length >= 7); // 2 bytes dgram size, 1 byte sessid/ext/offset, 1 byte offset, 1+ bytes payload, 2 bytes checksum\n\n\t\t// Verify the CRC\n\t\tconst headerBuffer = Bytes.from([\n\t\t\tCommandClasses[\"Transport Service\"],\n\t\t\tTransportServiceCommand.SubsequentSegment | raw.payload[0],\n\t\t]);\n\t\tconst ccBuffer = raw.payload.subarray(1, -2);\n\t\tlet expectedCRC = CRC16_CCITT(headerBuffer);\n\t\texpectedCRC = CRC16_CCITT(ccBuffer, expectedCRC);\n\t\tconst actualCRC = raw.payload.readUInt16BE(\n\t\t\traw.payload.length - 2,\n\t\t);\n\t\tvalidatePayload(expectedCRC === actualCRC);\n\t\tconst datagramSize = raw.payload.readUInt16BE(0);\n\t\tconst sessionId = raw.payload[2] >>> 4;\n\t\tconst datagramOffset = ((raw.payload[2] & 0b111) << 8)\n\t\t\t+ raw.payload[3];\n\t\tlet payloadOffset = 4;\n\n\t\t// If there is a header extension, read it\n\t\tconst hasHeaderExtension = !!(raw.payload[2] & 0b1000);\n\t\tlet headerExtension: Bytes | undefined;\n\n\t\tif (hasHeaderExtension) {\n\t\t\tconst extLength = raw.payload[4];\n\t\t\theaderExtension = raw.payload.subarray(5, 5 + extLength);\n\t\t\tpayloadOffset += 1 + extLength;\n\t\t}\n\t\tconst partialDatagram: Bytes = raw.payload.subarray(payloadOffset, -2);\n\n\t\t// A node supporting the Transport Service Command Class, version 2\n\t\t// MUST NOT send Transport Service segments with the Payload field longer than 39 bytes.\n\t\tvalidatePayload(partialDatagram.length <= MAX_SEGMENT_SIZE);\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\tdatagramSize,\n\t\t\tsessionId,\n\t\t\tdatagramOffset,\n\t\t\theaderExtension,\n\t\t\tpartialDatagram,\n\t\t});\n\t}\n\n\tpublic datagramSize: number;\n\tpublic datagramOffset: number;\n\tpublic sessionId: number;\n\tpublic headerExtension: Uint8Array | undefined;\n\tpublic partialDatagram: Uint8Array;\n\n\t// This can only be received\n\tprivate _encapsulated!: CommandClass;\n\tpublic get encapsulated(): CommandClass {\n\t\treturn this._encapsulated;\n\t}\n\n\tpublic expectMoreMessages(\n\t\tsession: [\n\t\t\tTransportServiceCCFirstSegment,\n\t\t\t...TransportServiceCCSubsequentSegment[],\n\t\t],\n\t): boolean {\n\t\tif (!(session[0] instanceof TransportServiceCCFirstSegment)) {\n\t\t\t// First segment is missing\n\t\t\treturn true;\n\t\t}\n\t\tconst datagramSize = session[0].datagramSize;\n\t\tconst receivedBytes = new Array<boolean>(datagramSize).fill(false);\n\t\tfor (const segment of [...session, this]) {\n\t\t\tconst offset = segment instanceof TransportServiceCCFirstSegment\n\t\t\t\t? 0\n\t\t\t\t: segment.datagramOffset;\n\t\t\tfor (\n\t\t\t\tlet i = offset;\n\t\t\t\ti <= offset + segment.partialDatagram.length;\n\t\t\t\ti++\n\t\t\t) {\n\t\t\t\treceivedBytes[i] = true;\n\t\t\t}\n\t\t}\n\t\t// Expect more messages as long as we haven't received everything\n\t\treturn receivedBytes.includes(false);\n\t}\n\n\tpublic getPartialCCSessionId(): Record<string, any> | undefined {\n\t\t// Only use the session ID to identify the session, not the CC command\n\t\treturn { ccCommand: undefined, sessionId: this.sessionId };\n\t}\n\n\tpublic async mergePartialCCs(\n\t\tpartials: [\n\t\t\tTransportServiceCCFirstSegment,\n\t\t\t...TransportServiceCCSubsequentSegment[],\n\t\t],\n\t\tctx: CCParsingContext,\n\t): Promise<void> {\n\t\t// Concat the CC buffers\n\t\tconst datagram = new Bytes(this.datagramSize);\n\t\tfor (const partial of [...partials, this]) {\n\t\t\t// Ensure that we don't try to write out-of-bounds\n\t\t\tconst offset = partial instanceof TransportServiceCCFirstSegment\n\t\t\t\t? 0\n\t\t\t\t: partial.datagramOffset;\n\t\t\tif (offset + partial.partialDatagram.length > datagram.length) {\n\t\t\t\tthrow new ZWaveError(\n\t\t\t\t\t`The partial datagram offset and length in a segment are not compatible to the communicated datagram length`,\n\t\t\t\t\tZWaveErrorCodes.PacketFormat_InvalidPayload,\n\t\t\t\t);\n\t\t\t}\n\t\t\tdatagram.set(partial.partialDatagram, offset);\n\t\t}\n\n\t\t// and deserialize the CC\n\t\tthis._encapsulated = await CommandClass.parse(datagram, ctx);\n\t\tthis._encapsulated.encapsulatingCC = this as any;\n\t}\n\n\tpublic serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\t// Transport Service re-uses the lower 3 bits of the ccCommand as payload\n\t\tthis.ccCommand = (this.ccCommand & 0b11111_000)\n\t\t\t| ((this.datagramSize >>> 8) & 0b111);\n\n\t\tconst ext = !!this.headerExtension && this.headerExtension.length >= 1;\n\t\tthis.payload = Bytes.from([\n\t\t\tthis.datagramSize & 0xff,\n\t\t\t((this.sessionId & 0b1111) << 4)\n\t\t\t| (ext ? 0b1000 : 0)\n\t\t\t| ((this.datagramOffset >>> 8) & 0b111),\n\t\t\tthis.datagramOffset & 0xff,\n\t\t]);\n\t\tif (ext) {\n\t\t\tthis.payload = Bytes.concat([\n\t\t\t\tthis.payload,\n\t\t\t\tBytes.from([this.headerExtension!.length]),\n\t\t\t\tthis.headerExtension!,\n\t\t\t]);\n\t\t}\n\t\tthis.payload = Bytes.concat([\n\t\t\tthis.payload,\n\t\t\tthis.partialDatagram,\n\t\t\tBytes.alloc(2, 0), // checksum\n\t\t]);\n\n\t\t// Compute and save the CRC16 in the payload\n\t\t// The CC header is included in the CRC computation\n\t\tconst headerBuffer = Bytes.from([this.ccId, this.ccCommand]);\n\t\tlet crc = CRC16_CCITT(headerBuffer);\n\t\tcrc = CRC16_CCITT(this.payload.subarray(0, -2), crc);\n\t\t// Write the checksum into the last two bytes of the payload\n\t\tthis.payload.writeUInt16BE(crc, this.payload.length - 2);\n\n\t\treturn super.serialize(ctx);\n\t}\n\n\tprotected computeEncapsulationOverhead(): number {\n\t\t// 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\n\t\treturn (\n\t\t\tsuper.computeEncapsulationOverhead()\n\t\t\t+ 5\n\t\t\t+ (this.headerExtension?.length\n\t\t\t\t? 1 + this.headerExtension.length\n\t\t\t\t: 0)\n\t\t);\n\t}\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage: {\n\t\t\t\t\"session ID\": this.sessionId,\n\t\t\t\t\"datagram size\": this.datagramSize,\n\t\t\t\t\"byte range\": `${this.datagramOffset}...${\n\t\t\t\t\tthis.datagramOffset + this.partialDatagram.length - 1\n\t\t\t\t}`,\n\t\t\t\tpayload: buffer2hex(this.partialDatagram),\n\t\t\t},\n\t\t};\n\t}\n}\n\n// @publicAPI\nexport interface TransportServiceCCSegmentRequestOptions {\n\tsessionId: number;\n\tdatagramOffset: number;\n}\n\n@CCCommand(TransportServiceCommand.SegmentRequest)\n// Handling expected responses is done by the RX state machine\nexport class TransportServiceCCSegmentRequest extends TransportServiceCC {\n\tpublic constructor(\n\t\toptions: WithAddress<TransportServiceCCSegmentRequestOptions>,\n\t) {\n\t\tsuper(options);\n\t\tthis.sessionId = options.sessionId;\n\t\tthis.datagramOffset = options.datagramOffset;\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): TransportServiceCCSegmentRequest {\n\t\tvalidatePayload(raw.payload.length >= 3);\n\t\tconst sessionId = raw.payload[1] >>> 4;\n\t\tconst datagramOffset = ((raw.payload[1] & 0b111) << 8)\n\t\t\t+ raw.payload[2];\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\tsessionId,\n\t\t\tdatagramOffset,\n\t\t});\n\t}\n\n\tpublic sessionId: number;\n\tpublic datagramOffset: number;\n\n\tpublic serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\tthis.payload = Bytes.from([\n\t\t\t((this.sessionId & 0b1111) << 4)\n\t\t\t| ((this.datagramOffset >>> 8) & 0b111),\n\t\t\tthis.datagramOffset & 0xff,\n\t\t]);\n\t\treturn super.serialize(ctx);\n\t}\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage: {\n\t\t\t\t\"session ID\": this.sessionId,\n\t\t\t\toffset: this.datagramOffset,\n\t\t\t},\n\t\t};\n\t}\n}\n\n// @publicAPI\nexport interface TransportServiceCCSegmentCompleteOptions {\n\tsessionId: number;\n}\n\n@CCCommand(TransportServiceCommand.SegmentComplete)\nexport class TransportServiceCCSegmentComplete extends TransportServiceCC {\n\tpublic constructor(\n\t\toptions: WithAddress<TransportServiceCCSegmentCompleteOptions>,\n\t) {\n\t\tsuper(options);\n\t\tthis.sessionId = options.sessionId;\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): TransportServiceCCSegmentComplete {\n\t\tvalidatePayload(raw.payload.length >= 2);\n\t\tconst sessionId = raw.payload[1] >>> 4;\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\tsessionId,\n\t\t});\n\t}\n\n\tpublic sessionId: number;\n\n\tpublic serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\tthis.payload = Bytes.from([(this.sessionId & 0b1111) << 4]);\n\t\treturn super.serialize(ctx);\n\t}\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage: { \"session ID\": this.sessionId },\n\t\t};\n\t}\n}\n\n// @publicAPI\nexport interface TransportServiceCCSegmentWaitOptions {\n\tpendingSegments: number;\n}\n\n@CCCommand(TransportServiceCommand.SegmentWait)\nexport class TransportServiceCCSegmentWait extends TransportServiceCC {\n\tpublic constructor(\n\t\toptions: WithAddress<TransportServiceCCSegmentWaitOptions>,\n\t) {\n\t\tsuper(options);\n\t\tthis.pendingSegments = options.pendingSegments;\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): TransportServiceCCSegmentWait {\n\t\tvalidatePayload(raw.payload.length >= 2);\n\t\tconst pendingSegments = raw.payload[1];\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\tpendingSegments,\n\t\t});\n\t}\n\n\tpublic pendingSegments: number;\n\n\tpublic serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\tthis.payload = Bytes.from([this.pendingSegments]);\n\t\treturn super.serialize(ctx);\n\t}\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage: { \"pending segments\": this.pendingSegments },\n\t\t};\n\t}\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,kBAUO;AACP,oBAAkC;AAClC,0BAAyC;AACzC,oCAIO;AACP,mBAAwC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEjC,MAAM,mBAAmB;AAEzB,MAAM,2BAA2B;AAIjC,MAAM,2BAA2B;;EAEvC,yBAAyB;;EAEzB,yBAAyB;;EAEzB,mBAAmB;;EAEnB,mBAAmB;;EAEnB,sBAAsB;;EAEtB,sBAAsB;;IAKV,sBAAkB,MAAA;8BAF9B,4CAAa,2BAAe,mBAAmB,CAAC,OAChD,kDAAmB,CAAC,CAAC;;;;oBACkB;0CAAA,YAAY;WAAA;;;;;;;;AAApD,mBAAA,MAAA,mBAAA,EAAA,OAAA,WAAA,GAAA,kBAAA,EAAA,MAAA,SAAA,MAAA,WA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,CAAC,MAAM;AAErC,aAAO,IAAI,KAAK;QACf,QAAQ,IAAI;QACZ;OACA;IACF;IAEO;IAEA,UAAU,KAAsB;AACtC,WAAK,UAAU,oBAAM,KAAK,EAAE,KAAK,YAAY,OAAW,CAAC,CAAC;AAC1D,aAAO,MAAM,UAAU,GAAG;IAC3B;IAEO,WAAW,KAAgB;AACjC,aAAO;QACN,GAAG,MAAM,WAAW,GAAG;QACvB,SAAS,EAAE,cAAc,KAAK,UAAS;;IAEzC;;;;IASY,iCAA6B,MAAA;8BADzC,yCAAU,qCAAwB,WAAW,CAAC;;;;oBACI;qDAAA,YAAkB;WAAA;;;;;;;;AAArE,mBAAA,MAAA,mBAAA,EAAA,OAAA,WAAA,GAAA,kBAAA,EAAA,MAAA,SAAA,MAAA,WAAA,MAAA,UAAA,UAAA,GAAA,MAAA,uBAAA;;;AAAa,wBAAA,YAAA,uBAAA;;IACZ,YACC,SAA0D;AAE1D,YAAM,OAAO;AACb,WAAK,kBAAkB,QAAQ;IAChC;IAEO,OAAO,KACb,KACA,KAAqB;AAErB,uCAAgB,IAAI,QAAQ,UAAU,CAAC;AACvC,YAAM,kBAAkB,IAAI,QAAQ,CAAC;AAErC,aAAO,IAAI,KAAK;QACf,QAAQ,IAAI;QACZ;OACA;IACF;IAEO;IAEA,UAAU,KAAsB;AACtC,WAAK,UAAU,oBAAM,KAAK,CAAC,KAAK,eAAe,CAAC;AAChD,aAAO,MAAM,UAAU,GAAG;IAC3B;IAEO,WAAW,KAAgB;AACjC,aAAO;QACN,GAAG,MAAM,WAAW,GAAG;QACvB,SAAS,EAAE,oBAAoB,KAAK,gBAAe;;IAErD;;;;",
|
|
6
|
+
"names": []
|
|
7
7
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { CommandClasses, type EndpointId, type GetValueDB, type MaybeNotKnown, type MessageOrCCLogEntry, type SupervisionResult, type WithAddress } from "@zwave-js/core
|
|
3
|
-
import { Bytes } from "@zwave-js/shared
|
|
1
|
+
import type { CCEncodingContext, CCParsingContext } from "@zwave-js/cc";
|
|
2
|
+
import { CommandClasses, type EndpointId, type GetValueDB, type MaybeNotKnown, type MessageOrCCLogEntry, type SupervisionResult, type WithAddress } from "@zwave-js/core";
|
|
3
|
+
import { Bytes } from "@zwave-js/shared";
|
|
4
4
|
import { POLL_VALUE, PhysicalCCAPI, type PollValueImplementation, SET_VALUE, type SetValueImplementation } from "../lib/API.js";
|
|
5
5
|
import { type CCRaw, CommandClass, type InterviewContext, type PersistValuesContext, type RefreshValuesContext } from "../lib/CommandClass.js";
|
|
6
6
|
import type { NotificationEventPayload } from "../lib/NotificationEventPayload.js";
|
|
@@ -16,7 +16,7 @@ export declare const UserCodeCCValues: Readonly<{
|
|
|
16
16
|
readonly endpoint: number;
|
|
17
17
|
readonly property: "supportedUsers";
|
|
18
18
|
};
|
|
19
|
-
is: (valueId: import("@zwave-js/core
|
|
19
|
+
is: (valueId: import("@zwave-js/core").ValueID) => boolean;
|
|
20
20
|
readonly meta: Readonly<{
|
|
21
21
|
readonly type: "any";
|
|
22
22
|
readonly readable: true;
|
|
@@ -41,7 +41,7 @@ export declare const UserCodeCCValues: Readonly<{
|
|
|
41
41
|
readonly endpoint: number;
|
|
42
42
|
readonly property: "supportsAdminCode";
|
|
43
43
|
};
|
|
44
|
-
is: (valueId: import("@zwave-js/core
|
|
44
|
+
is: (valueId: import("@zwave-js/core").ValueID) => boolean;
|
|
45
45
|
readonly meta: Readonly<{
|
|
46
46
|
readonly type: "any";
|
|
47
47
|
readonly readable: true;
|
|
@@ -66,7 +66,7 @@ export declare const UserCodeCCValues: Readonly<{
|
|
|
66
66
|
readonly endpoint: number;
|
|
67
67
|
readonly property: "supportsAdminCodeDeactivation";
|
|
68
68
|
};
|
|
69
|
-
is: (valueId: import("@zwave-js/core
|
|
69
|
+
is: (valueId: import("@zwave-js/core").ValueID) => boolean;
|
|
70
70
|
readonly meta: Readonly<{
|
|
71
71
|
readonly type: "any";
|
|
72
72
|
readonly readable: true;
|
|
@@ -91,7 +91,7 @@ export declare const UserCodeCCValues: Readonly<{
|
|
|
91
91
|
readonly endpoint: number;
|
|
92
92
|
readonly property: "supportsMasterCode";
|
|
93
93
|
};
|
|
94
|
-
is: (valueId: import("@zwave-js/core
|
|
94
|
+
is: (valueId: import("@zwave-js/core").ValueID) => boolean;
|
|
95
95
|
readonly meta: Readonly<{
|
|
96
96
|
readonly type: "any";
|
|
97
97
|
readonly readable: true;
|
|
@@ -116,7 +116,7 @@ export declare const UserCodeCCValues: Readonly<{
|
|
|
116
116
|
readonly endpoint: number;
|
|
117
117
|
readonly property: "supportsMasterCodeDeactivation";
|
|
118
118
|
};
|
|
119
|
-
is: (valueId: import("@zwave-js/core
|
|
119
|
+
is: (valueId: import("@zwave-js/core").ValueID) => boolean;
|
|
120
120
|
readonly meta: Readonly<{
|
|
121
121
|
readonly type: "any";
|
|
122
122
|
readonly readable: true;
|
|
@@ -141,7 +141,7 @@ export declare const UserCodeCCValues: Readonly<{
|
|
|
141
141
|
readonly endpoint: number;
|
|
142
142
|
readonly property: "supportsUserCodeChecksum";
|
|
143
143
|
};
|
|
144
|
-
is: (valueId: import("@zwave-js/core
|
|
144
|
+
is: (valueId: import("@zwave-js/core").ValueID) => boolean;
|
|
145
145
|
readonly meta: Readonly<{
|
|
146
146
|
readonly type: "any";
|
|
147
147
|
readonly readable: true;
|
|
@@ -166,7 +166,7 @@ export declare const UserCodeCCValues: Readonly<{
|
|
|
166
166
|
readonly endpoint: number;
|
|
167
167
|
readonly property: "supportsMultipleUserCodeReport";
|
|
168
168
|
};
|
|
169
|
-
is: (valueId: import("@zwave-js/core
|
|
169
|
+
is: (valueId: import("@zwave-js/core").ValueID) => boolean;
|
|
170
170
|
readonly meta: Readonly<{
|
|
171
171
|
readonly type: "any";
|
|
172
172
|
readonly readable: true;
|
|
@@ -191,7 +191,7 @@ export declare const UserCodeCCValues: Readonly<{
|
|
|
191
191
|
readonly endpoint: number;
|
|
192
192
|
readonly property: "supportsMultipleUserCodeSet";
|
|
193
193
|
};
|
|
194
|
-
is: (valueId: import("@zwave-js/core
|
|
194
|
+
is: (valueId: import("@zwave-js/core").ValueID) => boolean;
|
|
195
195
|
readonly meta: Readonly<{
|
|
196
196
|
readonly type: "any";
|
|
197
197
|
readonly readable: true;
|
|
@@ -216,7 +216,7 @@ export declare const UserCodeCCValues: Readonly<{
|
|
|
216
216
|
readonly endpoint: number;
|
|
217
217
|
readonly property: "supportedUserIDStatuses";
|
|
218
218
|
};
|
|
219
|
-
is: (valueId: import("@zwave-js/core
|
|
219
|
+
is: (valueId: import("@zwave-js/core").ValueID) => boolean;
|
|
220
220
|
readonly meta: Readonly<{
|
|
221
221
|
readonly type: "any";
|
|
222
222
|
readonly readable: true;
|
|
@@ -241,7 +241,7 @@ export declare const UserCodeCCValues: Readonly<{
|
|
|
241
241
|
readonly endpoint: number;
|
|
242
242
|
readonly property: "supportedKeypadModes";
|
|
243
243
|
};
|
|
244
|
-
is: (valueId: import("@zwave-js/core
|
|
244
|
+
is: (valueId: import("@zwave-js/core").ValueID) => boolean;
|
|
245
245
|
readonly meta: Readonly<{
|
|
246
246
|
readonly type: "any";
|
|
247
247
|
readonly readable: true;
|
|
@@ -266,7 +266,7 @@ export declare const UserCodeCCValues: Readonly<{
|
|
|
266
266
|
readonly endpoint: number;
|
|
267
267
|
readonly property: "supportedASCIIChars";
|
|
268
268
|
};
|
|
269
|
-
is: (valueId: import("@zwave-js/core
|
|
269
|
+
is: (valueId: import("@zwave-js/core").ValueID) => boolean;
|
|
270
270
|
readonly meta: Readonly<{
|
|
271
271
|
readonly type: "any";
|
|
272
272
|
readonly readable: true;
|
|
@@ -291,7 +291,7 @@ export declare const UserCodeCCValues: Readonly<{
|
|
|
291
291
|
readonly endpoint: number;
|
|
292
292
|
readonly property: "userCodeChecksum";
|
|
293
293
|
};
|
|
294
|
-
is: (valueId: import("@zwave-js/core
|
|
294
|
+
is: (valueId: import("@zwave-js/core").ValueID) => boolean;
|
|
295
295
|
readonly meta: Readonly<{
|
|
296
296
|
readonly type: "any";
|
|
297
297
|
readonly readable: true;
|
|
@@ -316,7 +316,7 @@ export declare const UserCodeCCValues: Readonly<{
|
|
|
316
316
|
readonly endpoint: number;
|
|
317
317
|
readonly property: "keypadMode";
|
|
318
318
|
};
|
|
319
|
-
is: (valueId: import("@zwave-js/core
|
|
319
|
+
is: (valueId: import("@zwave-js/core").ValueID) => boolean;
|
|
320
320
|
readonly meta: {
|
|
321
321
|
readonly label: "Keypad Mode";
|
|
322
322
|
readonly writeable: false;
|
|
@@ -342,7 +342,7 @@ export declare const UserCodeCCValues: Readonly<{
|
|
|
342
342
|
readonly endpoint: number;
|
|
343
343
|
readonly property: "adminCode";
|
|
344
344
|
};
|
|
345
|
-
is: (valueId: import("@zwave-js/core
|
|
345
|
+
is: (valueId: import("@zwave-js/core").ValueID) => boolean;
|
|
346
346
|
readonly meta: {
|
|
347
347
|
readonly label: "Admin Code";
|
|
348
348
|
readonly minLength: 4;
|
|
@@ -379,7 +379,7 @@ export declare const UserCodeCCValues: Readonly<{
|
|
|
379
379
|
readonly writeable: true;
|
|
380
380
|
};
|
|
381
381
|
}) & {
|
|
382
|
-
is: (valueId: import("@zwave-js/core
|
|
382
|
+
is: (valueId: import("@zwave-js/core").ValueID) => boolean;
|
|
383
383
|
options: {
|
|
384
384
|
readonly internal: false;
|
|
385
385
|
readonly minVersion: 1;
|
|
@@ -407,7 +407,7 @@ export declare const UserCodeCCValues: Readonly<{
|
|
|
407
407
|
readonly writeable: true;
|
|
408
408
|
}>;
|
|
409
409
|
}) & {
|
|
410
|
-
is: (valueId: import("@zwave-js/core
|
|
410
|
+
is: (valueId: import("@zwave-js/core").ValueID) => boolean;
|
|
411
411
|
options: {
|
|
412
412
|
readonly internal: false;
|
|
413
413
|
readonly minVersion: 1;
|