jooby-codec 1.15.0 → 2.0.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/dist/analog/Command.d.ts +29 -0
- package/dist/analog/Command.js +34 -0
- package/dist/analog/Command.js.map +1 -0
- package/dist/{CommandBinaryBuffer.d.ts → analog/CommandBinaryBuffer.d.ts} +2 -211
- package/dist/{CommandBinaryBuffer.js → analog/CommandBinaryBuffer.js} +6 -80
- package/dist/analog/CommandBinaryBuffer.js.map +1 -0
- package/dist/{UnknownCommand.d.ts → analog/UnknownCommand.d.ts} +0 -8
- package/dist/{UnknownCommand.js → analog/UnknownCommand.js} +0 -5
- package/dist/analog/UnknownCommand.js.map +1 -0
- package/dist/analog/commands/downlink/CorrectTime2000.d.ts +16 -0
- package/dist/{commands → analog/commands}/downlink/CorrectTime2000.js +3 -23
- package/dist/analog/commands/downlink/CorrectTime2000.js.map +1 -0
- package/dist/analog/commands/downlink/GetArchiveDaysMC.d.ts +18 -0
- package/dist/{commands → analog/commands}/downlink/GetArchiveDaysMC.js +3 -27
- package/dist/analog/commands/downlink/GetArchiveDaysMC.js.map +1 -0
- package/dist/analog/commands/downlink/GetArchiveEvents.d.ts +17 -0
- package/dist/{commands → analog/commands}/downlink/GetArchiveEvents.js +0 -19
- package/dist/analog/commands/downlink/GetArchiveEvents.js.map +1 -0
- package/dist/analog/commands/downlink/GetArchiveHoursMC.d.ts +18 -0
- package/dist/{commands → analog/commands}/downlink/GetArchiveHoursMC.js +3 -22
- package/dist/analog/commands/downlink/GetArchiveHoursMC.js.map +1 -0
- package/dist/analog/commands/downlink/GetCurrentMC.d.ts +10 -0
- package/dist/analog/commands/downlink/GetCurrentMC.js +23 -0
- package/dist/analog/commands/downlink/GetCurrentMC.js.map +1 -0
- package/dist/analog/commands/downlink/GetExAbsArchiveDaysMC.d.ts +18 -0
- package/dist/{commands → analog/commands}/downlink/GetExAbsArchiveDaysMC.js +3 -24
- package/dist/analog/commands/downlink/GetExAbsArchiveDaysMC.js.map +1 -0
- package/dist/analog/commands/downlink/GetExAbsArchiveHoursMC.d.ts +18 -0
- package/dist/{commands → analog/commands}/downlink/GetExAbsArchiveHoursMC.js +3 -23
- package/dist/analog/commands/downlink/GetExAbsArchiveHoursMC.js.map +1 -0
- package/dist/analog/commands/downlink/GetExAbsCurrentMC.d.ts +11 -0
- package/dist/{commands → analog/commands}/downlink/GetExAbsCurrentMC.js +0 -20
- package/dist/analog/commands/downlink/GetExAbsCurrentMC.js.map +1 -0
- package/dist/analog/commands/downlink/GetLmicInfo.d.ts +10 -0
- package/dist/analog/commands/downlink/GetLmicInfo.js +23 -0
- package/dist/analog/commands/downlink/GetLmicInfo.js.map +1 -0
- package/dist/analog/commands/downlink/GetParameter.d.ts +15 -0
- package/dist/{commands → analog/commands}/downlink/GetParameter.js +0 -20
- package/dist/analog/commands/downlink/GetParameter.js.map +1 -0
- package/dist/analog/commands/downlink/GetStatus.d.ts +11 -0
- package/dist/{commands → analog/commands}/downlink/GetStatus.js +0 -19
- package/dist/analog/commands/downlink/GetStatus.js.map +1 -0
- package/dist/analog/commands/downlink/SetParameter.d.ts +13 -0
- package/dist/{commands → analog/commands}/downlink/SetParameter.js +0 -19
- package/dist/analog/commands/downlink/SetParameter.js.map +1 -0
- package/dist/analog/commands/downlink/SetTime2000.d.ts +16 -0
- package/dist/{commands → analog/commands}/downlink/SetTime2000.js +3 -22
- package/dist/analog/commands/downlink/SetTime2000.js.map +1 -0
- package/dist/analog/commands/downlink/SoftRestart.d.ts +10 -0
- package/dist/analog/commands/downlink/SoftRestart.js +23 -0
- package/dist/analog/commands/downlink/SoftRestart.js.map +1 -0
- package/dist/{commands → analog/commands}/downlink/index.d.ts +0 -5
- package/dist/{commands → analog/commands}/downlink/index.js +0 -5
- package/dist/analog/commands/downlink/index.js.map +1 -0
- package/dist/{commands → analog/commands}/index.d.ts +0 -5
- package/dist/{commands → analog/commands}/index.js +0 -5
- package/dist/analog/commands/index.js.map +1 -0
- package/dist/analog/commands/uplink/CorrectTime2000Response.d.ts +15 -0
- package/dist/{commands → analog/commands}/uplink/CorrectTime2000Response.js +3 -23
- package/dist/analog/commands/uplink/CorrectTime2000Response.js.map +1 -0
- package/dist/{commands → analog/commands}/uplink/CurrentMC.d.ts +0 -24
- package/dist/{commands → analog/commands}/uplink/CurrentMC.js +0 -24
- package/dist/analog/commands/uplink/CurrentMC.js.map +1 -0
- package/dist/analog/commands/uplink/DayMC.d.ts +17 -0
- package/dist/{commands → analog/commands}/uplink/DayMC.js +1 -33
- package/dist/analog/commands/uplink/DayMC.js.map +1 -0
- package/dist/analog/commands/uplink/ExAbsCurrentMC.d.ts +16 -0
- package/dist/{commands → analog/commands}/uplink/ExAbsCurrentMC.js +0 -29
- package/dist/analog/commands/uplink/ExAbsCurrentMC.js.map +1 -0
- package/dist/analog/commands/uplink/ExAbsDayMC.d.ts +19 -0
- package/dist/{commands → analog/commands}/uplink/ExAbsDayMC.js +1 -31
- package/dist/analog/commands/uplink/ExAbsDayMC.js.map +1 -0
- package/dist/analog/commands/uplink/ExAbsHourMC.d.ts +19 -0
- package/dist/{commands → analog/commands}/uplink/ExAbsHourMC.js +1 -36
- package/dist/analog/commands/uplink/ExAbsHourMC.js.map +1 -0
- package/dist/analog/commands/uplink/GetArchiveDaysMCResponse.d.ts +19 -0
- package/dist/{commands → analog/commands}/uplink/GetArchiveDaysMCResponse.js +1 -33
- package/dist/analog/commands/uplink/GetArchiveDaysMCResponse.js.map +1 -0
- package/dist/analog/commands/uplink/GetArchiveEventsResponse.d.ts +21 -0
- package/dist/{commands → analog/commands}/uplink/GetArchiveEventsResponse.js +0 -26
- package/dist/analog/commands/uplink/GetArchiveEventsResponse.js.map +1 -0
- package/dist/analog/commands/uplink/GetArchiveHoursMCResponse.d.ts +19 -0
- package/dist/{commands → analog/commands}/uplink/GetArchiveHoursMCResponse.js +0 -33
- package/dist/analog/commands/uplink/GetArchiveHoursMCResponse.js.map +1 -0
- package/dist/analog/commands/uplink/GetExAbsArchiveDaysMCResponse.d.ts +19 -0
- package/dist/{commands → analog/commands}/uplink/GetExAbsArchiveDaysMCResponse.js +1 -33
- package/dist/analog/commands/uplink/GetExAbsArchiveDaysMCResponse.js.map +1 -0
- package/dist/{commands → analog/commands}/uplink/GetExAbsArchiveHoursMCResponse.d.ts +1 -26
- package/dist/{commands → analog/commands}/uplink/GetExAbsArchiveHoursMCResponse.js +1 -31
- package/dist/analog/commands/uplink/GetExAbsArchiveHoursMCResponse.js.map +1 -0
- package/dist/analog/commands/uplink/GetLmicInfoResponse.d.ts +21 -0
- package/dist/{commands → analog/commands}/uplink/GetLmicInfoResponse.js +4 -29
- package/dist/analog/commands/uplink/GetLmicInfoResponse.js.map +1 -0
- package/dist/analog/commands/uplink/GetParameterResponse.d.ts +13 -0
- package/dist/{commands → analog/commands}/uplink/GetParameterResponse.js +0 -24
- package/dist/analog/commands/uplink/GetParameterResponse.js.map +1 -0
- package/dist/analog/commands/uplink/HourMC.d.ts +20 -0
- package/dist/{commands → analog/commands}/uplink/HourMC.js +1 -35
- package/dist/analog/commands/uplink/HourMC.js.map +1 -0
- package/dist/analog/commands/uplink/LastEvent.d.ts +21 -0
- package/dist/{commands → analog/commands}/uplink/LastEvent.js +22 -48
- package/dist/analog/commands/uplink/LastEvent.js.map +1 -0
- package/dist/{commands → analog/commands}/uplink/NewEvent.d.ts +1 -42
- package/dist/{commands → analog/commands}/uplink/NewEvent.js +2 -32
- package/dist/analog/commands/uplink/NewEvent.js.map +1 -0
- package/dist/analog/commands/uplink/SetTime2000Response.d.ts +15 -0
- package/dist/{commands → analog/commands}/uplink/SetTime2000Response.js +3 -22
- package/dist/analog/commands/uplink/SetTime2000Response.js.map +1 -0
- package/dist/analog/commands/uplink/SoftRestartResponse.d.ts +10 -0
- package/dist/analog/commands/uplink/SoftRestartResponse.js +23 -0
- package/dist/analog/commands/uplink/SoftRestartResponse.js.map +1 -0
- package/dist/analog/commands/uplink/Status.d.ts +23 -0
- package/dist/{commands → analog/commands}/uplink/Status.js +1 -33
- package/dist/analog/commands/uplink/Status.js.map +1 -0
- package/dist/analog/commands/uplink/Time2000.d.ts +17 -0
- package/dist/{commands → analog/commands}/uplink/Time2000.js +2 -22
- package/dist/analog/commands/uplink/Time2000.js.map +1 -0
- package/dist/{commands → analog/commands}/uplink/index.d.ts +0 -5
- package/dist/{commands → analog/commands}/uplink/index.js +0 -5
- package/dist/analog/commands/uplink/index.js.map +1 -0
- package/dist/analog/constants/deviceParameters.d.ts +18 -0
- package/dist/analog/constants/deviceParameters.js +19 -0
- package/dist/analog/constants/deviceParameters.js.map +1 -0
- package/dist/analog/constants/directions.js.map +1 -0
- package/dist/analog/constants/events.d.ts +21 -0
- package/dist/analog/constants/events.js +22 -0
- package/dist/analog/constants/events.js.map +1 -0
- package/dist/analog/constants/hardwareTypes.d.ts +13 -0
- package/dist/analog/constants/hardwareTypes.js +14 -0
- package/dist/analog/constants/hardwareTypes.js.map +1 -0
- package/dist/analog/constants/index.js.map +1 -0
- package/dist/{constants → analog/constants}/rx2SpreadFactors.d.ts +0 -5
- package/dist/{constants → analog/constants}/rx2SpreadFactors.js +0 -5
- package/dist/analog/constants/rx2SpreadFactors.js.map +1 -0
- package/dist/{utils → analog}/header.d.ts +1 -1
- package/dist/{utils → analog}/header.js +2 -4
- package/dist/analog/header.js.map +1 -0
- package/dist/analog/index.d.ts +3 -0
- package/dist/analog/index.js +4 -0
- package/dist/analog/index.js.map +1 -0
- package/dist/{utils → analog}/message.d.ts +8 -13
- package/dist/{utils → analog}/message.js +13 -32
- package/dist/analog/message.js.map +1 -0
- package/dist/config.d.ts +5 -0
- package/dist/config.js +5 -0
- package/dist/config.js.map +1 -0
- package/dist/index.d.ts +3 -3
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/dist/{Command.d.ts → obis-observer/Command.d.ts} +2 -27
- package/dist/obis-observer/Command.js +33 -0
- package/dist/obis-observer/Command.js.map +1 -0
- package/dist/obis-observer/CommandBinaryBuffer.d.ts +56 -0
- package/dist/obis-observer/CommandBinaryBuffer.js +138 -0
- package/dist/obis-observer/CommandBinaryBuffer.js.map +1 -0
- package/dist/obis-observer/UnknownCommand.d.ts +12 -0
- package/dist/obis-observer/UnknownCommand.js +17 -0
- package/dist/obis-observer/UnknownCommand.js.map +1 -0
- package/dist/obis-observer/commands/downlink/AddShortNameProfile.d.ts +17 -0
- package/dist/obis-observer/commands/downlink/AddShortNameProfile.js +55 -0
- package/dist/obis-observer/commands/downlink/AddShortNameProfile.js.map +1 -0
- package/dist/obis-observer/commands/downlink/GetArchiveProfile.d.ts +13 -0
- package/dist/obis-observer/commands/downlink/GetArchiveProfile.js +39 -0
- package/dist/obis-observer/commands/downlink/GetArchiveProfile.js.map +1 -0
- package/dist/obis-observer/commands/downlink/GetContentByObis.d.ts +16 -0
- package/dist/obis-observer/commands/downlink/GetContentByObis.js +48 -0
- package/dist/obis-observer/commands/downlink/GetContentByObis.js.map +1 -0
- package/dist/obis-observer/commands/downlink/GetContentByShortName.d.ts +17 -0
- package/dist/obis-observer/commands/downlink/GetContentByShortName.js +44 -0
- package/dist/obis-observer/commands/downlink/GetContentByShortName.js.map +1 -0
- package/dist/obis-observer/commands/downlink/GetShortNameInfo.d.ts +17 -0
- package/dist/obis-observer/commands/downlink/GetShortNameInfo.js +44 -0
- package/dist/obis-observer/commands/downlink/GetShortNameInfo.js.map +1 -0
- package/dist/obis-observer/commands/downlink/GetShortNameProfile.d.ts +16 -0
- package/dist/obis-observer/commands/downlink/GetShortNameProfile.js +45 -0
- package/dist/obis-observer/commands/downlink/GetShortNameProfile.js.map +1 -0
- package/dist/obis-observer/commands/downlink/GetShortNames.d.ts +16 -0
- package/dist/obis-observer/commands/downlink/GetShortNames.js +48 -0
- package/dist/obis-observer/commands/downlink/GetShortNames.js.map +1 -0
- package/dist/obis-observer/commands/downlink/ReadArchive.d.ts +17 -0
- package/dist/obis-observer/commands/downlink/ReadArchive.js +58 -0
- package/dist/obis-observer/commands/downlink/ReadArchive.js.map +1 -0
- package/dist/obis-observer/commands/downlink/Reboot.d.ts +13 -0
- package/dist/obis-observer/commands/downlink/Reboot.js +39 -0
- package/dist/obis-observer/commands/downlink/Reboot.js.map +1 -0
- package/dist/obis-observer/commands/downlink/RemoveShortNameProfile.d.ts +16 -0
- package/dist/obis-observer/commands/downlink/RemoveShortNameProfile.js +42 -0
- package/dist/obis-observer/commands/downlink/RemoveShortNameProfile.js.map +1 -0
- package/dist/obis-observer/commands/downlink/SetArchiveProfile.d.ts +17 -0
- package/dist/obis-observer/commands/downlink/SetArchiveProfile.js +45 -0
- package/dist/obis-observer/commands/downlink/SetArchiveProfile.js.map +1 -0
- package/dist/obis-observer/commands/downlink/SetSerialPort.d.ts +19 -0
- package/dist/obis-observer/commands/downlink/SetSerialPort.js +61 -0
- package/dist/obis-observer/commands/downlink/SetSerialPort.js.map +1 -0
- package/dist/obis-observer/commands/downlink/SetShortName.d.ts +17 -0
- package/dist/obis-observer/commands/downlink/SetShortName.js +51 -0
- package/dist/obis-observer/commands/downlink/SetShortName.js.map +1 -0
- package/dist/obis-observer/commands/downlink/index.d.ts +13 -0
- package/dist/obis-observer/commands/downlink/index.js +14 -0
- package/dist/obis-observer/commands/downlink/index.js.map +1 -0
- package/dist/obis-observer/commands/index.d.ts +2 -0
- package/dist/obis-observer/commands/index.js +3 -0
- package/dist/obis-observer/commands/index.js.map +1 -0
- package/dist/obis-observer/commands/uplink/AddShortNameProfileResponse.d.ts +16 -0
- package/dist/obis-observer/commands/uplink/AddShortNameProfileResponse.js +43 -0
- package/dist/obis-observer/commands/uplink/AddShortNameProfileResponse.js.map +1 -0
- package/dist/obis-observer/commands/uplink/GetArchiveProfileResponse.d.ts +17 -0
- package/dist/obis-observer/commands/uplink/GetArchiveProfileResponse.js +45 -0
- package/dist/obis-observer/commands/uplink/GetArchiveProfileResponse.js.map +1 -0
- package/dist/obis-observer/commands/uplink/GetContentByObisResponse.d.ts +16 -0
- package/dist/obis-observer/commands/uplink/GetContentByObisResponse.js +45 -0
- package/dist/obis-observer/commands/uplink/GetContentByObisResponse.js.map +1 -0
- package/dist/obis-observer/commands/uplink/GetContentByShortNameResponse.d.ts +16 -0
- package/dist/obis-observer/commands/uplink/GetContentByShortNameResponse.js +44 -0
- package/dist/obis-observer/commands/uplink/GetContentByShortNameResponse.js.map +1 -0
- package/dist/obis-observer/commands/uplink/GetContentByShortNameStringResponse.d.ts +16 -0
- package/dist/obis-observer/commands/uplink/GetContentByShortNameStringResponse.js +45 -0
- package/dist/obis-observer/commands/uplink/GetContentByShortNameStringResponse.js.map +1 -0
- package/dist/obis-observer/commands/uplink/GetShortNameInfoResponse.d.ts +17 -0
- package/dist/obis-observer/commands/uplink/GetShortNameInfoResponse.js +74 -0
- package/dist/obis-observer/commands/uplink/GetShortNameInfoResponse.js.map +1 -0
- package/dist/obis-observer/commands/uplink/GetShortNameProfileResponse.d.ts +16 -0
- package/dist/obis-observer/commands/uplink/GetShortNameProfileResponse.js +54 -0
- package/dist/obis-observer/commands/uplink/GetShortNameProfileResponse.js.map +1 -0
- package/dist/obis-observer/commands/uplink/GetShortNamesResponse.d.ts +16 -0
- package/dist/obis-observer/commands/uplink/GetShortNamesResponse.js +45 -0
- package/dist/obis-observer/commands/uplink/GetShortNamesResponse.js.map +1 -0
- package/dist/obis-observer/commands/uplink/ObservationReport.d.ts +17 -0
- package/dist/obis-observer/commands/uplink/ObservationReport.js +57 -0
- package/dist/obis-observer/commands/uplink/ObservationReport.js.map +1 -0
- package/dist/obis-observer/commands/uplink/ObservationReportString.d.ts +17 -0
- package/dist/obis-observer/commands/uplink/ObservationReportString.js +62 -0
- package/dist/obis-observer/commands/uplink/ObservationReportString.js.map +1 -0
- package/dist/obis-observer/commands/uplink/ReadArchiveResponse.d.ts +17 -0
- package/dist/obis-observer/commands/uplink/ReadArchiveResponse.js +61 -0
- package/dist/obis-observer/commands/uplink/ReadArchiveResponse.js.map +1 -0
- package/dist/obis-observer/commands/uplink/RebootResponse.d.ts +13 -0
- package/dist/obis-observer/commands/uplink/RebootResponse.js +36 -0
- package/dist/obis-observer/commands/uplink/RebootResponse.js.map +1 -0
- package/dist/obis-observer/commands/uplink/RemoveShortNameProfileResponse.d.ts +16 -0
- package/dist/obis-observer/commands/uplink/RemoveShortNameProfileResponse.js +43 -0
- package/dist/obis-observer/commands/uplink/RemoveShortNameProfileResponse.js.map +1 -0
- package/dist/obis-observer/commands/uplink/SetArchiveProfileResponse.d.ts +16 -0
- package/dist/obis-observer/commands/uplink/SetArchiveProfileResponse.js +51 -0
- package/dist/obis-observer/commands/uplink/SetArchiveProfileResponse.js.map +1 -0
- package/dist/obis-observer/commands/uplink/SetSerialPortResponse.d.ts +16 -0
- package/dist/obis-observer/commands/uplink/SetSerialPortResponse.js +51 -0
- package/dist/obis-observer/commands/uplink/SetSerialPortResponse.js.map +1 -0
- package/dist/obis-observer/commands/uplink/SetShortNameResponse.d.ts +16 -0
- package/dist/obis-observer/commands/uplink/SetShortNameResponse.js +43 -0
- package/dist/obis-observer/commands/uplink/SetShortNameResponse.js.map +1 -0
- package/dist/obis-observer/commands/uplink/index.d.ts +16 -0
- package/dist/obis-observer/commands/uplink/index.js +17 -0
- package/dist/obis-observer/commands/uplink/index.js.map +1 -0
- package/dist/obis-observer/constants/archiveTypes.d.ts +3 -0
- package/dist/obis-observer/constants/archiveTypes.js +4 -0
- package/dist/obis-observer/constants/archiveTypes.js.map +1 -0
- package/dist/obis-observer/constants/contentTypes.d.ts +3 -0
- package/dist/obis-observer/constants/contentTypes.js +4 -0
- package/dist/obis-observer/constants/contentTypes.js.map +1 -0
- package/dist/obis-observer/constants/directions.d.ts +2 -0
- package/dist/obis-observer/constants/directions.js +3 -0
- package/dist/obis-observer/constants/directions.js.map +1 -0
- package/dist/obis-observer/constants/index.d.ts +5 -0
- package/dist/obis-observer/constants/index.js +6 -0
- package/dist/obis-observer/constants/index.js.map +1 -0
- package/dist/obis-observer/constants/parityTypes.d.ts +3 -0
- package/dist/obis-observer/constants/parityTypes.js +4 -0
- package/dist/obis-observer/constants/parityTypes.js.map +1 -0
- package/dist/obis-observer/constants/resultCodes.d.ts +6 -0
- package/dist/obis-observer/constants/resultCodes.js +7 -0
- package/dist/obis-observer/constants/resultCodes.js.map +1 -0
- package/dist/obis-observer/index.d.ts +3 -0
- package/dist/obis-observer/index.js +4 -0
- package/dist/obis-observer/index.js.map +1 -0
- package/dist/obis-observer/message.d.ts +18 -0
- package/dist/obis-observer/message.js +58 -0
- package/dist/obis-observer/message.js.map +1 -0
- package/dist/{BinaryBuffer.d.ts → utils/BinaryBuffer.d.ts} +3 -17
- package/dist/{BinaryBuffer.js → utils/BinaryBuffer.js} +17 -19
- package/dist/utils/BinaryBuffer.js.map +1 -0
- package/dist/utils/bitSet.d.ts +2 -36
- package/dist/utils/bitSet.js +10 -36
- package/dist/utils/bitSet.js.map +1 -1
- package/dist/utils/getBytesFromHex.d.ts +0 -9
- package/dist/utils/getBytesFromHex.js +0 -10
- package/dist/utils/getBytesFromHex.js.map +1 -1
- package/dist/utils/getHexFromBytes.d.ts +1 -25
- package/dist/utils/getHexFromBytes.js +2 -16
- package/dist/utils/getHexFromBytes.js.map +1 -1
- package/dist/utils/getHexFromNumber.d.ts +3 -0
- package/dist/utils/getHexFromNumber.js +20 -0
- package/dist/utils/getHexFromNumber.js.map +1 -0
- package/dist/utils/index.d.ts +3 -1
- package/dist/utils/index.js +2 -0
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/time.d.ts +0 -24
- package/dist/utils/time.js +0 -12
- package/dist/utils/time.js.map +1 -1
- package/package.json +13 -9
- package/readme.md +19 -12
- package/dist/BinaryBuffer.js.map +0 -1
- package/dist/Command.js +0 -89
- package/dist/Command.js.map +0 -1
- package/dist/CommandBinaryBuffer.js.map +0 -1
- package/dist/UnknownCommand.js.map +0 -1
- package/dist/commands/downlink/CorrectTime2000.d.ts +0 -46
- package/dist/commands/downlink/CorrectTime2000.js.map +0 -1
- package/dist/commands/downlink/GetArchiveDaysMC.d.ts +0 -45
- package/dist/commands/downlink/GetArchiveDaysMC.js.map +0 -1
- package/dist/commands/downlink/GetArchiveEvents.d.ts +0 -40
- package/dist/commands/downlink/GetArchiveEvents.js.map +0 -1
- package/dist/commands/downlink/GetArchiveHoursMC.d.ts +0 -40
- package/dist/commands/downlink/GetArchiveHoursMC.js.map +0 -1
- package/dist/commands/downlink/GetCurrentMC.d.ts +0 -26
- package/dist/commands/downlink/GetCurrentMC.js +0 -42
- package/dist/commands/downlink/GetCurrentMC.js.map +0 -1
- package/dist/commands/downlink/GetExAbsArchiveDaysMC.d.ts +0 -41
- package/dist/commands/downlink/GetExAbsArchiveDaysMC.js.map +0 -1
- package/dist/commands/downlink/GetExAbsArchiveHoursMC.d.ts +0 -40
- package/dist/commands/downlink/GetExAbsArchiveHoursMC.js.map +0 -1
- package/dist/commands/downlink/GetExAbsCurrentMC.d.ts +0 -27
- package/dist/commands/downlink/GetExAbsCurrentMC.js.map +0 -1
- package/dist/commands/downlink/GetLmicInfo.d.ts +0 -26
- package/dist/commands/downlink/GetLmicInfo.js +0 -42
- package/dist/commands/downlink/GetLmicInfo.js.map +0 -1
- package/dist/commands/downlink/GetParameter.d.ts +0 -38
- package/dist/commands/downlink/GetParameter.js.map +0 -1
- package/dist/commands/downlink/GetStatus.d.ts +0 -27
- package/dist/commands/downlink/GetStatus.js.map +0 -1
- package/dist/commands/downlink/SetParameter.d.ts +0 -30
- package/dist/commands/downlink/SetParameter.js.map +0 -1
- package/dist/commands/downlink/SetTime2000.d.ts +0 -42
- package/dist/commands/downlink/SetTime2000.js.map +0 -1
- package/dist/commands/downlink/SoftRestart.d.ts +0 -26
- package/dist/commands/downlink/SoftRestart.js +0 -42
- package/dist/commands/downlink/SoftRestart.js.map +0 -1
- package/dist/commands/downlink/index.js.map +0 -1
- package/dist/commands/index.js.map +0 -1
- package/dist/commands/uplink/CorrectTime2000Response.d.ts +0 -39
- package/dist/commands/uplink/CorrectTime2000Response.js.map +0 -1
- package/dist/commands/uplink/CurrentMC.js.map +0 -1
- package/dist/commands/uplink/DayMC.d.ts +0 -47
- package/dist/commands/uplink/DayMC.js.map +0 -1
- package/dist/commands/uplink/ExAbsCurrentMC.d.ts +0 -41
- package/dist/commands/uplink/ExAbsCurrentMC.js.map +0 -1
- package/dist/commands/uplink/ExAbsDayMC.d.ts +0 -45
- package/dist/commands/uplink/ExAbsDayMC.js.map +0 -1
- package/dist/commands/uplink/ExAbsHourMC.d.ts +0 -69
- package/dist/commands/uplink/ExAbsHourMC.js.map +0 -1
- package/dist/commands/uplink/GetArchiveDaysMCResponse.d.ts +0 -58
- package/dist/commands/uplink/GetArchiveDaysMCResponse.js.map +0 -1
- package/dist/commands/uplink/GetArchiveEventsResponse.d.ts +0 -54
- package/dist/commands/uplink/GetArchiveEventsResponse.js.map +0 -1
- package/dist/commands/uplink/GetArchiveHoursMCResponse.d.ts +0 -50
- package/dist/commands/uplink/GetArchiveHoursMCResponse.js.map +0 -1
- package/dist/commands/uplink/GetExAbsArchiveDaysMCResponse.d.ts +0 -47
- package/dist/commands/uplink/GetExAbsArchiveDaysMCResponse.js.map +0 -1
- package/dist/commands/uplink/GetExAbsArchiveHoursMCResponse.js.map +0 -1
- package/dist/commands/uplink/GetLmicInfoResponse.d.ts +0 -52
- package/dist/commands/uplink/GetLmicInfoResponse.js.map +0 -1
- package/dist/commands/uplink/GetParameterResponse.d.ts +0 -35
- package/dist/commands/uplink/GetParameterResponse.js.map +0 -1
- package/dist/commands/uplink/HourMC.d.ts +0 -48
- package/dist/commands/uplink/HourMC.js.map +0 -1
- package/dist/commands/uplink/LastEvent.d.ts +0 -54
- package/dist/commands/uplink/LastEvent.js.map +0 -1
- package/dist/commands/uplink/NewEvent.js.map +0 -1
- package/dist/commands/uplink/SetTime2000Response.d.ts +0 -38
- package/dist/commands/uplink/SetTime2000Response.js.map +0 -1
- package/dist/commands/uplink/SoftRestartResponse.d.ts +0 -28
- package/dist/commands/uplink/SoftRestartResponse.js +0 -44
- package/dist/commands/uplink/SoftRestartResponse.js.map +0 -1
- package/dist/commands/uplink/Status.d.ts +0 -55
- package/dist/commands/uplink/Status.js.map +0 -1
- package/dist/commands/uplink/Time2000.d.ts +0 -43
- package/dist/commands/uplink/Time2000.js.map +0 -1
- package/dist/commands/uplink/index.js.map +0 -1
- package/dist/constants/deviceParameters.d.ts +0 -53
- package/dist/constants/deviceParameters.js +0 -54
- package/dist/constants/deviceParameters.js.map +0 -1
- package/dist/constants/directions.js.map +0 -1
- package/dist/constants/events.d.ts +0 -42
- package/dist/constants/events.js +0 -43
- package/dist/constants/events.js.map +0 -1
- package/dist/constants/hardwareTypes.d.ts +0 -108
- package/dist/constants/hardwareTypes.js +0 -109
- package/dist/constants/hardwareTypes.js.map +0 -1
- package/dist/constants/index.js.map +0 -1
- package/dist/constants/rx2SpreadFactors.js.map +0 -1
- package/dist/utils/header.js.map +0 -1
- package/dist/utils/message.js.map +0 -1
- /package/dist/{constants → analog/constants}/directions.d.ts +0 -0
- /package/dist/{constants → analog/constants}/directions.js +0 -0
- /package/dist/{constants → analog/constants}/index.d.ts +0 -0
- /package/dist/{constants → analog/constants}/index.js +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GetExAbsArchiveDaysMCResponse.js","sourceRoot":"","sources":["../../../../src/analog/commands/uplink/GetExAbsArchiveDaysMCResponse.ts"],"names":[],"mappings":"AAAA,OAAO,OAA8B,MAAM,kBAAkB,CAAC;AAC9D,OAAO,mBAA0C,MAAM,8BAA8B,CAAC;AACtF,OAAO,EAAC,kBAAkB,EAAY,MAAM,wBAAwB,CAAC;AACrE,OAAO,EAAC,MAAM,EAAC,MAAM,+BAA+B,CAAC;AAUrD,MAAM,UAAU,GAAG,MAAM,CAAC;AAI1B,MAAM,qBAAqB,GAAG,IAAI,CAAC;AAEnC,MAAM,QAAQ,GAAwB;IAClC;QACI,IAAI,EAAE,+DAA+D;QACrE,UAAU,EAAE;YACR,SAAS,EAAE,SAAS;YACpB,I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AAC,WAAW,EAAE,IAAI,EAAE,SAAS,EAAE,kBAAkB,CAAC,IAAI,CAAC,EAAC,CAAC,CAAC;IACvG,CAAC;IAGD,OAAO;QACH,MAAM,MAAM,GAAG,IAAI,mBAAmB,CAAC,qBAAqB,CAAC,CAAC;QAC9D,MAAM,EAAC,WAAW,EAAE,SAAS,EAAE,IAAI,EAAC,GAAG,IAAI,CAAC,UAAU,CAAC;QAEvD,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;QAC1B,MAAM,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC;QAChC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;QAEtB,WAAW,CAAC,OAAO,CAAC,CAAC,EAAC,OAAO,EAAC,EAAE,EAAE;YAC9B,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,MAAM,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC,CAAC;QAC7D,CAAC,CAAC,CAAC;QAEH,OAAO,OAAO,CAAC,OAAO,CAAC,UAAU,EAAE,MAAM,CAAC,gBAAgB,EAAE,CAAC,CAAC;IAClE,CAAC;;AA/CM,gCAAE,GAAG,UAAU,CAAC;AAEP,2CAAa,GAAG,MAAM,CAAC;AAEvB,sCAAQ,GAAG,QAAQ,CAAC;AAEpB,2CAAa,GAAG,IAAI,CAAC;AA6CzC,eAAe,6BAA6B,CAAC"}
|
|
@@ -1,36 +1,11 @@
|
|
|
1
1
|
import Command, { TCommandExampleList } from '../../Command.js';
|
|
2
|
-
import { TTime2000 } from '
|
|
2
|
+
import { TTime2000 } from '../../../utils/time.js';
|
|
3
3
|
import { IChannelHours } from '../../CommandBinaryBuffer.js';
|
|
4
4
|
interface IGetExAbsArchiveHoursMCResponseParameters {
|
|
5
5
|
channelList: Array<IChannelHours>;
|
|
6
6
|
startTime: TTime2000;
|
|
7
7
|
hours: number;
|
|
8
8
|
}
|
|
9
|
-
/**
|
|
10
|
-
* Uplink command.
|
|
11
|
-
*
|
|
12
|
-
* @example create command instance from command body hex dump
|
|
13
|
-
* ```js
|
|
14
|
-
* import GetExAbsArchiveHoursMCResponse from 'jooby-codec/commands/uplink/GetExAbsArchiveHoursMCResponse';
|
|
15
|
-
*
|
|
16
|
-
* const commandBody = new Uint8Array([
|
|
17
|
-
* 0x2f, 0x97, 0x0c, 0x04, 0xea, 0x01, 0x02
|
|
18
|
-
* ]);
|
|
19
|
-
* const command = GetExAbsArchiveHoursMCResponse.fromBytes(commandBody);
|
|
20
|
-
*
|
|
21
|
-
* console.log(command.parameters);
|
|
22
|
-
* // output:
|
|
23
|
-
* {
|
|
24
|
-
* startTime: 756648000,
|
|
25
|
-
* hours: 1,
|
|
26
|
-
* channelList: [
|
|
27
|
-
* {value: 234, index: 2, diff: [2]}
|
|
28
|
-
* ]
|
|
29
|
-
* }
|
|
30
|
-
* ```
|
|
31
|
-
*
|
|
32
|
-
* [Command format documentation](https://github.com/jooby-dev/jooby-docs/blob/main/docs/commands/GetExAbsArchiveHoursMC.md#response)
|
|
33
|
-
*/
|
|
34
9
|
declare class GetExAbsArchiveHoursMCResponse extends Command {
|
|
35
10
|
parameters: IGetExAbsArchiveHoursMCResponseParameters;
|
|
36
11
|
constructor(parameters: IGetExAbsArchiveHoursMCResponseParameters);
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
import Command from '../../Command.js';
|
|
2
|
-
import { getSecondsFromDate, getDateFromSeconds } from '
|
|
2
|
+
import { getSecondsFromDate, getDateFromSeconds } from '../../../utils/time.js';
|
|
3
3
|
import CommandBinaryBuffer from '../../CommandBinaryBuffer.js';
|
|
4
4
|
import { UPLINK } from '../../constants/directions.js';
|
|
5
|
-
// TODO: rework extended headers detection
|
|
6
5
|
const COMMAND_ID = 0x0c1f;
|
|
7
|
-
// date 2 bytes, hour 1 byte (max hours: 7), channelList 1 byte (max channelList: 4)
|
|
8
|
-
// 4 + (4 channelList * 1 byte pulse coefficient) + (4 channelList * 5 bytes of hour values) + (4 * 5 bytes of diff * 7 max hours diff)
|
|
9
6
|
const COMMAND_BODY_MAX_SIZE = 168;
|
|
10
7
|
const examples = [
|
|
11
8
|
{
|
|
@@ -20,38 +17,12 @@ const examples = [
|
|
|
20
17
|
hex: { header: '1f 0c 07', body: '2f 97 0c 02 ea 01 02' }
|
|
21
18
|
}
|
|
22
19
|
];
|
|
23
|
-
/**
|
|
24
|
-
* Uplink command.
|
|
25
|
-
*
|
|
26
|
-
* @example create command instance from command body hex dump
|
|
27
|
-
* ```js
|
|
28
|
-
* import GetExAbsArchiveHoursMCResponse from 'jooby-codec/commands/uplink/GetExAbsArchiveHoursMCResponse';
|
|
29
|
-
*
|
|
30
|
-
* const commandBody = new Uint8Array([
|
|
31
|
-
* 0x2f, 0x97, 0x0c, 0x04, 0xea, 0x01, 0x02
|
|
32
|
-
* ]);
|
|
33
|
-
* const command = GetExAbsArchiveHoursMCResponse.fromBytes(commandBody);
|
|
34
|
-
*
|
|
35
|
-
* console.log(command.parameters);
|
|
36
|
-
* // output:
|
|
37
|
-
* {
|
|
38
|
-
* startTime: 756648000,
|
|
39
|
-
* hours: 1,
|
|
40
|
-
* channelList: [
|
|
41
|
-
* {value: 234, index: 2, diff: [2]}
|
|
42
|
-
* ]
|
|
43
|
-
* }
|
|
44
|
-
* ```
|
|
45
|
-
*
|
|
46
|
-
* [Command format documentation](https://github.com/jooby-dev/jooby-docs/blob/main/docs/commands/GetExAbsArchiveHoursMC.md#response)
|
|
47
|
-
*/
|
|
48
20
|
class GetExAbsArchiveHoursMCResponse extends Command {
|
|
49
21
|
constructor(parameters) {
|
|
50
22
|
super();
|
|
51
23
|
this.parameters = parameters;
|
|
52
24
|
this.parameters.channelList = this.parameters.channelList.sort((a, b) => a.index - b.index);
|
|
53
25
|
}
|
|
54
|
-
// data - only body (without header)
|
|
55
26
|
static fromBytes(data) {
|
|
56
27
|
const buffer = new CommandBinaryBuffer(data);
|
|
57
28
|
const date = buffer.getDate();
|
|
@@ -73,7 +44,6 @@ class GetExAbsArchiveHoursMCResponse extends Command {
|
|
|
73
44
|
});
|
|
74
45
|
return new GetExAbsArchiveHoursMCResponse({ channelList, hours, startTime: getSecondsFromDate(date) });
|
|
75
46
|
}
|
|
76
|
-
// returns full message - header with body
|
|
77
47
|
toBytes() {
|
|
78
48
|
const buffer = new CommandBinaryBuffer(COMMAND_BODY_MAX_SIZE);
|
|
79
49
|
const { channelList, startTime, hours } = this.parameters;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GetExAbsArchiveHoursMCResponse.js","sourceRoot":"","sources":["../../../../src/analog/commands/uplink/GetExAbsArchiveHoursMCResponse.ts"],"names":[],"mappings":"AAAA,OAAO,OAA8B,MAAM,kBAAkB,CAAC;AAC9D,OAAO,EAAC,kBAAkB,EAAE,kBAAkB,EAAY,MAAM,wBAAwB,CAAC;AACzF,OAAO,mBAAoC,MAAM,8BAA8B,CAAC;AAChF,OAAO,EAAC,MAAM,EAAC,MAAM,+BAA+B,CAAC;AAWrD,MAAM,UAAU,GAAG,MAAM,CAAC;AAI1B,MAAM,qBAAqB,GAAG,GAAG,CAAC;AAElC,MAAM,QAAQ,GAAwB;IAClC;QACI,IAAI,EAAE,sCAAsC;QAC5C,UAAU,EAAE;YACR,SAAS,EAAE,SAAS;YACpB,KAAK,EAAE,CAAC;YACR,WAAW,EAAE;gBACT,EAAC,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,EAAC;aACpC;SACJ;QACD,GAAG,EAAE,EAAC,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE,sBAAsB,EAAC;KAC1D;CACJ,CAAC;AA4BF,MAAM,8BAA+B,SAAQ,OAAO;IAChD,YAAqB,UAAqD;QACtE,KAAK,EAAE,CAAC;QADS,eAAU,GAAV,UAAU,CAA2C;QAGtE,IAAI,CAAC,UAAU,CAAC,WAAW,GAAG,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC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,CAAC,SAAS,CAAC,CAAC;QAC3C,MAAM,IAAI,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC;QAEhC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QACrB,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;QAC7B,MAAM,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC;QAEhC,KAAM,MAAM,EAAC,KAAK,EAAE,IAAI,EAAC,IAAI,WAAW,EAAG;YACvC,MAAM,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC;YAC/B,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,CAAC,MAAM,CAAC,gBAAgB,CAAC,SAAS,CAAC,CAAC,CAAC;SACjE;QAED,OAAO,OAAO,CAAC,OAAO,CAAC,UAAU,EAAE,MAAM,CAAC,gBAAgB,EAAE,CAAC,CAAC;IAClE,CAAC;;AAtDe,iCAAE,GAAG,UAAU,CAAC;AAEhB,4CAAa,GAAG,MAAM,CAAC;AAEvB,uCAAQ,GAAG,QAAQ,CAAC;AAEpB,4CAAa,GAAG,IAAI,CAAC;AAoDzC,eAAe,8BAA8B,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import Command, { TCommandExampleList } from '../../Command.js';
|
|
2
|
+
import * as bitSet from '../../../utils/bitSet.js';
|
|
3
|
+
interface ILmicCapabilities extends bitSet.TBooleanObject {
|
|
4
|
+
isMulticastSupported: boolean;
|
|
5
|
+
isFragmentedDataSupported: boolean;
|
|
6
|
+
}
|
|
7
|
+
interface IGetLmicInfoResponseParameters {
|
|
8
|
+
capabilities: ILmicCapabilities;
|
|
9
|
+
version: number;
|
|
10
|
+
}
|
|
11
|
+
declare class GetLmicInfoResponse extends Command {
|
|
12
|
+
parameters: IGetLmicInfoResponseParameters;
|
|
13
|
+
constructor(parameters: IGetLmicInfoResponseParameters);
|
|
14
|
+
static readonly id = 543;
|
|
15
|
+
static readonly directionType = 2;
|
|
16
|
+
static readonly examples: TCommandExampleList;
|
|
17
|
+
static readonly hasParameters = true;
|
|
18
|
+
static fromBytes(data: Uint8Array): GetLmicInfoResponse;
|
|
19
|
+
toBytes(): Uint8Array;
|
|
20
|
+
}
|
|
21
|
+
export default GetLmicInfoResponse;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import Command from '../../Command.js';
|
|
2
|
-
import BinaryBuffer from '
|
|
3
|
-
import * as bitSet from '
|
|
2
|
+
import BinaryBuffer from '../../../utils/BinaryBuffer.js';
|
|
3
|
+
import * as bitSet from '../../../utils/bitSet.js';
|
|
4
4
|
import { UPLINK } from '../../constants/directions.js';
|
|
5
5
|
const COMMAND_ID = 0x021f;
|
|
6
6
|
const COMMAND_BODY_SIZE = 2;
|
|
@@ -32,48 +32,23 @@ const examples = [
|
|
|
32
32
|
hex: { header: '1f 02 02', body: '03 08' }
|
|
33
33
|
}
|
|
34
34
|
];
|
|
35
|
-
/**
|
|
36
|
-
* Uplink command.
|
|
37
|
-
*
|
|
38
|
-
* @example create command instance from command body hex dump
|
|
39
|
-
* ```js
|
|
40
|
-
* import GetLmicInfoResponse from 'jooby-codec/commands/uplink/GetLmicInfoResponse';
|
|
41
|
-
*
|
|
42
|
-
* const commandBody = new Uint8Array([0x01, 0x05]);
|
|
43
|
-
* const command = GetLmicInfoResponse.fromBytes(commandBody);
|
|
44
|
-
*
|
|
45
|
-
* console.log(command.parameters);
|
|
46
|
-
* // output:
|
|
47
|
-
* {
|
|
48
|
-
* version: 5,
|
|
49
|
-
* capabilities: {
|
|
50
|
-
* isMulticastSupported: true,
|
|
51
|
-
* isFragmentedDataSupported: false
|
|
52
|
-
* }
|
|
53
|
-
* }
|
|
54
|
-
* ```
|
|
55
|
-
*
|
|
56
|
-
* [Command format documentation](https://github.com/jooby-dev/jooby-docs/blob/main/docs/commands/GetLmicInfo.md#response)
|
|
57
|
-
*/
|
|
58
35
|
class GetLmicInfoResponse extends Command {
|
|
59
36
|
constructor(parameters) {
|
|
60
37
|
super();
|
|
61
38
|
this.parameters = parameters;
|
|
62
39
|
}
|
|
63
|
-
// data - only body (without header)
|
|
64
40
|
static fromBytes(data) {
|
|
65
41
|
if (data.byteLength !== COMMAND_BODY_SIZE) {
|
|
66
|
-
throw new Error(
|
|
42
|
+
throw new Error(`Wrong buffer size: ${data.byteLength}.`);
|
|
67
43
|
}
|
|
68
44
|
const buffer = new BinaryBuffer(data);
|
|
69
45
|
const capabilities = bitSet.toObject(lmicCapabilitiesBitMask, buffer.getUint8());
|
|
70
46
|
const version = buffer.getUint8();
|
|
71
47
|
if (!buffer.isEmpty) {
|
|
72
|
-
throw new Error(
|
|
48
|
+
throw new Error('BinaryBuffer is not empty.');
|
|
73
49
|
}
|
|
74
50
|
return new GetLmicInfoResponse({ capabilities, version });
|
|
75
51
|
}
|
|
76
|
-
// returns full message - header with body
|
|
77
52
|
toBytes() {
|
|
78
53
|
const { capabilities, version } = this.parameters;
|
|
79
54
|
const buffer = new BinaryBuffer(COMMAND_BODY_SIZE);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GetLmicInfoResponse.js","sourceRoot":"","sources":["../../../../src/analog/commands/uplink/GetLmicInfoResponse.ts"],"names":[],"mappings":"AAAA,OAAO,OAA8B,MAAM,kBAAkB,CAAC;AAC9D,OAAO,YAAY,MAAM,gCAAgC,CAAC;AAC1D,OAAO,KAAK,MAAM,MAAM,0BAA0B,CAAC;AACnD,OAAO,EAAC,MAAM,EAAC,MAAM,+BAA+B,CAAC;AAwBrD,MAAM,UAAU,GAAG,MAAM,CAAC;AAC1B,MAAM,iBAAiB,GAAG,CAAC,CAAC;AAE5B,MAAM,uBAAuB,GAAG;IAC5B,oBAAoB,EAAE,CAAC,IAAI,CAAC;IAC5B,yBAAyB,EAAE,CAAC,IAAI,CAAC;CACpC,CAAC;AAEF,MAAM,QAAQ,GAAwB;IAClC;QACI,IAAI,EAAE,oCAAoC;QAC1C,UAAU,EAAE;YACR,OAAO,EAAE,CA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C,iBAAiB,CAAC,CAAC;QAEnD,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,UAAU,CAAC,uBAAuB,EAAE,YAAY,CAAC,CAAC,CAAC;QAC1E,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QAEzB,OAAO,OAAO,CAAC,OAAO,CAAC,UAAU,EAAE,MAAM,CAAC,YAAY,EAAE,CAAC,CAAC;IAC9D,CAAC;;AApCe,sBAAE,GAAG,UAAU,CAAC;AAEhB,iCAAa,GAAG,MAAM,CAAC;AAEvB,4BAAQ,GAAG,QAAQ,CAAC;AAEpB,iCAAa,GAAG,IAAI,CAAC;AAkCzC,eAAe,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import Command, { TCommandExampleList } from '../../Command.js';
|
|
2
|
+
import { IParameter } from '../../CommandBinaryBuffer.js';
|
|
3
|
+
declare class GetParameterResponse extends Command {
|
|
4
|
+
parameters: IParameter;
|
|
5
|
+
constructor(parameters: IParameter);
|
|
6
|
+
static readonly id = 4;
|
|
7
|
+
static readonly directionType = 2;
|
|
8
|
+
static readonly examples: TCommandExampleList;
|
|
9
|
+
static readonly hasParameters = true;
|
|
10
|
+
static fromBytes(data: Uint8Array): GetParameterResponse;
|
|
11
|
+
toBytes(): Uint8Array;
|
|
12
|
+
}
|
|
13
|
+
export default GetParameterResponse;
|
|
@@ -37,39 +37,15 @@ const examples = [
|
|
|
37
37
|
hex: { header: '04 03', body: '1e 01 01' }
|
|
38
38
|
}
|
|
39
39
|
];
|
|
40
|
-
/**
|
|
41
|
-
* Uplink command.
|
|
42
|
-
*
|
|
43
|
-
* @example create command instance from command body hex dump
|
|
44
|
-
* ```js
|
|
45
|
-
* import GetParameterResponse from 'jooby-codec/commands/uplink/GetParameterResponse';
|
|
46
|
-
*
|
|
47
|
-
* const commandBody = new Uint8Array([
|
|
48
|
-
* 0x1d, 0x01, 0x00, 0x00, 0x01, 0x92, 0x80, 0x00, 0x00, 0x07, 0xf0
|
|
49
|
-
* ]);
|
|
50
|
-
* const command = GetParameterResponse.fromBytes(commandBody);
|
|
51
|
-
*
|
|
52
|
-
* console.log(command.parameters);
|
|
53
|
-
* // output:
|
|
54
|
-
* {
|
|
55
|
-
* id: 29,
|
|
56
|
-
* data: { channel: 2, meterValue: 402, pulseCoefficient: 1, value: 2032 }
|
|
57
|
-
* }
|
|
58
|
-
* ```
|
|
59
|
-
*
|
|
60
|
-
* [Command format documentation](https://github.com/jooby-dev/jooby-docs/blob/main/docs/commands/GetParameter.md#response)
|
|
61
|
-
*/
|
|
62
40
|
class GetParameterResponse extends Command {
|
|
63
41
|
constructor(parameters) {
|
|
64
42
|
super();
|
|
65
43
|
this.parameters = parameters;
|
|
66
44
|
}
|
|
67
|
-
// data - only body (without header)
|
|
68
45
|
static fromBytes(data) {
|
|
69
46
|
const buffer = new CommandBinaryBuffer(data);
|
|
70
47
|
return new GetParameterResponse(buffer.getParameter());
|
|
71
48
|
}
|
|
72
|
-
// returns full message - header with body
|
|
73
49
|
toBytes() {
|
|
74
50
|
const buffer = new CommandBinaryBuffer(CommandBinaryBuffer.getParameterSize(this.parameters));
|
|
75
51
|
buffer.setParameter(this.parameters);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GetParameterResponse.js","sourceRoot":"","sources":["../../../../src/analog/commands/uplink/GetParameterResponse.ts"],"names":[],"mappings":"AAAA,OAAO,OAA8B,MAAM,kBAAkB,CAAC;AAC9D,OAAO,mBAAiC,MAAM,8BAA8B,CAAC;AAC7E,OAAO,EAAC,MAAM,EAAC,MAAM,+BAA+B,CAAC;AACrD,OAAO,KAAK,gBAAgB,MAAM,qCAAqC,CAAC;AAGxE,MAAM,UAAU,GAAG,IAAI,CAAC;AAExB,MAAM,QAAQ,GAAwB;IAClC;QACI,IAAI,EAAE,yCAAyC;QAC/C,UAAU,EAAE;YACR,EAAE,EAAE,gBAAgB,CAAC,aAAa;YAClC,IAAI,EAAE,EAAC,KAAK,EA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;IAGD,OAAO;QACH,MAAM,MAAM,GAAG,IAAI,mBAAmB,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC;QAE9F,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QAErC,OAAO,OAAO,CAAC,OAAO,CAAC,UAAU,EAAE,MAAM,CAAC,gBAAgB,EAAE,CAAC,CAAC;IAClE,CAAC;;AAvBe,uBAAE,GAAG,UAAU,CAAC;AAEhB,kCAAa,GAAG,MAAM,CAAC;AAEvB,6BAAQ,GAAG,QAAQ,CAAC;AAEpB,kCAAa,GAAG,IAAI,CAAC;AAqBzC,eAAe,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { TCommandExampleList } from '../../Command.js';
|
|
2
|
+
import CurrentMC from './CurrentMC.js';
|
|
3
|
+
import { TTime2000 } from '../../../utils/time.js';
|
|
4
|
+
import { IChannelHours } from '../../CommandBinaryBuffer.js';
|
|
5
|
+
interface IHourMCParameters {
|
|
6
|
+
channelList: Array<IChannelHours>;
|
|
7
|
+
startTime: TTime2000;
|
|
8
|
+
hours: number;
|
|
9
|
+
}
|
|
10
|
+
declare class HourMC extends CurrentMC {
|
|
11
|
+
parameters: IHourMCParameters;
|
|
12
|
+
constructor(parameters: IHourMCParameters);
|
|
13
|
+
static readonly id = 23;
|
|
14
|
+
static readonly directionType = 2;
|
|
15
|
+
static readonly examples: TCommandExampleList;
|
|
16
|
+
static readonly hasParameters = true;
|
|
17
|
+
static fromBytes(data: Uint8Array): HourMC;
|
|
18
|
+
toBytes(): Uint8Array;
|
|
19
|
+
}
|
|
20
|
+
export default HourMC;
|
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
import Command from '../../Command.js';
|
|
2
2
|
import CurrentMC from './CurrentMC.js';
|
|
3
|
-
import { getSecondsFromDate, getDateFromSeconds } from '
|
|
3
|
+
import { getSecondsFromDate, getDateFromSeconds } from '../../../utils/time.js';
|
|
4
4
|
import CommandBinaryBuffer from '../../CommandBinaryBuffer.js';
|
|
5
5
|
import { UPLINK } from '../../constants/directions.js';
|
|
6
6
|
const COMMAND_ID = 0x17;
|
|
7
|
-
// date 2 bytes, hour 1 byte, channelList - 1 byte, so max channelList = 4
|
|
8
|
-
// max hours diff - 7 (3 bit value)
|
|
9
|
-
// 4 + (4 channelList * 5 bytes of hour values) + (4 * 5 bytes of diff * 7 max hours diff)
|
|
10
7
|
const COMMAND_BODY_MAX_SIZE = 164;
|
|
11
8
|
const examples = [
|
|
12
9
|
{
|
|
@@ -24,40 +21,11 @@ const examples = [
|
|
|
24
21
|
hex: { header: '17 0f', body: '2f 97 0c 0f 83 01 0a c0 06 0c 26 08 ea 01 0b' }
|
|
25
22
|
}
|
|
26
23
|
];
|
|
27
|
-
/**
|
|
28
|
-
* Uplink command.
|
|
29
|
-
*
|
|
30
|
-
* @example create command instance from command body hex dump
|
|
31
|
-
* ```js
|
|
32
|
-
* import HourMC from 'jooby-codec/commands/uplink/HourMC';
|
|
33
|
-
*
|
|
34
|
-
* const commandBody = new Uint8Array([
|
|
35
|
-
* 0x2f, 0x97, 0x0c, 0x0f, 0x83, 0x01, 0x0a, 0xc0, 0x06, 0x0c, 0x26, 0x08, 0xea, 0x01, 0x0b
|
|
36
|
-
* ]);
|
|
37
|
-
* const command = HourMC.fromBytes(commandBody);
|
|
38
|
-
*
|
|
39
|
-
* console.log(command.parameters);
|
|
40
|
-
* // output:
|
|
41
|
-
* {
|
|
42
|
-
* startTime: 756648000,
|
|
43
|
-
* hours: 1,
|
|
44
|
-
* channelList: [
|
|
45
|
-
* {value: 131, index: 1, diff: [10]},
|
|
46
|
-
* {value: 832, index: 2, diff: [12]},
|
|
47
|
-
* {value: 38, index: 3, diff: [8]},
|
|
48
|
-
* {value: 234, index: 4, diff: [11]}
|
|
49
|
-
* ]
|
|
50
|
-
* }
|
|
51
|
-
* ```
|
|
52
|
-
*
|
|
53
|
-
* [Command format documentation](https://github.com/jooby-dev/jooby-docs/blob/main/docs/commands/uplink/HourMC.md)
|
|
54
|
-
*/
|
|
55
24
|
class HourMC extends CurrentMC {
|
|
56
25
|
constructor(parameters) {
|
|
57
26
|
super(parameters);
|
|
58
27
|
this.parameters = parameters;
|
|
59
28
|
}
|
|
60
|
-
// data - only body (without header)
|
|
61
29
|
static fromBytes(data) {
|
|
62
30
|
const buffer = new CommandBinaryBuffer(data);
|
|
63
31
|
const date = buffer.getDate();
|
|
@@ -67,7 +35,6 @@ class HourMC extends CurrentMC {
|
|
|
67
35
|
let value;
|
|
68
36
|
date.setUTCHours(hour);
|
|
69
37
|
channels.forEach(channelIndex => {
|
|
70
|
-
// decode hour value for channel
|
|
71
38
|
value = buffer.getExtendedValue();
|
|
72
39
|
const diff = [];
|
|
73
40
|
for (let diffHour = 0; diffHour < hours; ++diffHour) {
|
|
@@ -77,7 +44,6 @@ class HourMC extends CurrentMC {
|
|
|
77
44
|
});
|
|
78
45
|
return new HourMC({ channelList, hours, startTime: getSecondsFromDate(date) });
|
|
79
46
|
}
|
|
80
|
-
// returns full message - header with body
|
|
81
47
|
toBytes() {
|
|
82
48
|
const buffer = new CommandBinaryBuffer(COMMAND_BODY_MAX_SIZE);
|
|
83
49
|
const { channelList, startTime, hours } = this.parameters;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HourMC.js","sourceRoot":"","sources":["../../../../src/analog/commands/uplink/HourMC.ts"],"names":[],"mappings":"AAAA,OAAO,OAA8B,MAAM,kBAAkB,CAAC;AAC9D,OAAO,SAAS,MAAM,gBAAgB,CAAC;AACvC,OAAO,EAAC,kBAAkB,EAAE,kBAAkB,EAAY,MAAM,wBAAwB,CAAC;AACzF,OAAO,mBAAoC,MAAM,8BAA8B,CAAC;AAChF,OAAO,EAAC,MAAM,EAAC,MAAM,+BAA+B,CAAC;AAUrD,MAAM,UAAU,GAAG,IAAI,CAAC;AAKxB,MAAM,qBAAqB,GAAG,GAAG,CAAC;AA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AC;IAClE,CAAC;;AAtDe,SAAE,GAAG,UAAU,CAAC;AAEhB,oBAAa,GAAG,MAAM,CAAC;AAEvB,eAAQ,GAAG,QAAQ,CAAC;AAEpB,oBAAa,GAAG,IAAI,CAAC;AAoDzC,eAAe,MAAM,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import Command, { TCommandExampleList } from '../../Command.js';
|
|
2
|
+
import { TEventStatus } from '../../CommandBinaryBuffer.js';
|
|
3
|
+
interface ILastEventParameters {
|
|
4
|
+
sequenceNumber: number;
|
|
5
|
+
status: TEventStatus;
|
|
6
|
+
}
|
|
7
|
+
interface ILastEventConfig {
|
|
8
|
+
hardwareType?: number;
|
|
9
|
+
}
|
|
10
|
+
declare class LastEvent extends Command {
|
|
11
|
+
parameters: ILastEventParameters;
|
|
12
|
+
config: ILastEventConfig;
|
|
13
|
+
constructor(parameters: ILastEventParameters, config: ILastEventConfig);
|
|
14
|
+
static readonly id = 96;
|
|
15
|
+
static readonly directionType = 2;
|
|
16
|
+
static readonly examples: TCommandExampleList;
|
|
17
|
+
static readonly hasParameters = true;
|
|
18
|
+
static fromBytes(data: Uint8Array, config: ILastEventConfig): LastEvent;
|
|
19
|
+
toBytes(): Uint8Array;
|
|
20
|
+
}
|
|
21
|
+
export default LastEvent;
|
|
@@ -15,7 +15,9 @@ const examples = [
|
|
|
15
15
|
isMagneticInfluence: false
|
|
16
16
|
}
|
|
17
17
|
},
|
|
18
|
-
|
|
18
|
+
config: {
|
|
19
|
+
hardwareType: hardwareTypes.GASI3
|
|
20
|
+
},
|
|
19
21
|
hex: { header: '62', body: '20 09' }
|
|
20
22
|
},
|
|
21
23
|
{
|
|
@@ -23,17 +25,17 @@ const examples = [
|
|
|
23
25
|
parameters: {
|
|
24
26
|
sequenceNumber: 16,
|
|
25
27
|
status: {
|
|
26
|
-
// first byte: 11100001 = e1 (225)
|
|
27
28
|
isBatteryLow: true,
|
|
28
29
|
isConnectionLost: false,
|
|
29
30
|
isFirstChannelInactive: false,
|
|
30
31
|
isSecondChannelInactive: true,
|
|
31
32
|
isThirdChannelInactive: true,
|
|
32
|
-
// second byte: 00000001 = 01
|
|
33
33
|
isForthChannelInactive: true
|
|
34
34
|
}
|
|
35
35
|
},
|
|
36
|
-
|
|
36
|
+
config: {
|
|
37
|
+
hardwareType: hardwareTypes.IMP4EU
|
|
38
|
+
},
|
|
37
39
|
hex: { header: '63', body: '10 e1 01' }
|
|
38
40
|
},
|
|
39
41
|
{
|
|
@@ -41,7 +43,6 @@ const examples = [
|
|
|
41
43
|
parameters: {
|
|
42
44
|
sequenceNumber: 48,
|
|
43
45
|
status: {
|
|
44
|
-
// first byte: 10000011 = 83 (131)
|
|
45
46
|
isMeterCaseOpen: true,
|
|
46
47
|
isMagneticInfluence: true,
|
|
47
48
|
isParametersSetRemotely: false,
|
|
@@ -50,7 +51,6 @@ const examples = [
|
|
|
50
51
|
isLockedOut: false,
|
|
51
52
|
isTimeSet: false,
|
|
52
53
|
isTimeCorrected: true,
|
|
53
|
-
// second byte: 00001010 = 0a (10)
|
|
54
54
|
isMeterFailure: false,
|
|
55
55
|
isMeterTerminalBoxOpen: true,
|
|
56
56
|
isModuleCompartmentOpen: false,
|
|
@@ -58,62 +58,36 @@ const examples = [
|
|
|
58
58
|
isNewTariffPlanReceived: false
|
|
59
59
|
}
|
|
60
60
|
},
|
|
61
|
-
|
|
61
|
+
config: {
|
|
62
|
+
hardwareType: hardwareTypes.MTXLORA
|
|
63
|
+
},
|
|
62
64
|
hex: { header: '63', body: '30 83 0a' }
|
|
63
65
|
}
|
|
64
66
|
];
|
|
65
|
-
/**
|
|
66
|
-
* Uplink command.
|
|
67
|
-
*
|
|
68
|
-
* @example create command instance from command body hex dump
|
|
69
|
-
* ```js
|
|
70
|
-
* import LastEvent from 'jooby-codec/commands/uplink/LastEvent';
|
|
71
|
-
* import * as hardwareTypes from 'jooby-codec/constants/hardwareTypes.js';
|
|
72
|
-
*
|
|
73
|
-
* const commandBody = new Uint8Array([0x10, 0xe1, 0x01]);
|
|
74
|
-
* const command = LastEvent.fromBytes(commandBody, hardwareTypes.IMP4EU);
|
|
75
|
-
*
|
|
76
|
-
* console.log(command.parameters);
|
|
77
|
-
* // output:
|
|
78
|
-
* {
|
|
79
|
-
* sequenceNumber: 16,
|
|
80
|
-
* status: {
|
|
81
|
-
* isBatteryLow: true,
|
|
82
|
-
* isConnectionLost: false,
|
|
83
|
-
* isFirstChannelInactive: false,
|
|
84
|
-
* isSecondChannelInactive: true,
|
|
85
|
-
* isThirdChannelInactive: true,
|
|
86
|
-
* isForthChannelInactive: true
|
|
87
|
-
* }
|
|
88
|
-
* }
|
|
89
|
-
* ```
|
|
90
|
-
*
|
|
91
|
-
* [Command format documentation](https://github.com/jooby-dev/jooby-docs/blob/main/docs/commands/uplink/LastEvent.md)
|
|
92
|
-
*/
|
|
93
67
|
class LastEvent extends Command {
|
|
94
|
-
constructor(parameters,
|
|
68
|
+
constructor(parameters, config) {
|
|
69
|
+
if (!config.hardwareType) {
|
|
70
|
+
throw new Error('hardwareType in config is mandatory');
|
|
71
|
+
}
|
|
95
72
|
super();
|
|
96
73
|
this.parameters = parameters;
|
|
97
|
-
this.
|
|
74
|
+
this.config = config;
|
|
98
75
|
}
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
throw new Error('hardwareType argument is mandatory');
|
|
76
|
+
static fromBytes(data, config) {
|
|
77
|
+
if (!config.hardwareType) {
|
|
78
|
+
throw new Error('hardwareType in config is mandatory');
|
|
103
79
|
}
|
|
104
80
|
const buffer = new CommandBinaryBuffer(data);
|
|
105
81
|
const sequenceNumber = buffer.getUint8();
|
|
106
|
-
const status = buffer.getEventStatus(hardwareType);
|
|
107
|
-
return new LastEvent({ sequenceNumber, status },
|
|
82
|
+
const status = buffer.getEventStatus(config.hardwareType);
|
|
83
|
+
return new LastEvent({ sequenceNumber, status }, config);
|
|
108
84
|
}
|
|
109
|
-
// returns full message - header with body
|
|
110
85
|
toBytes() {
|
|
111
86
|
const { sequenceNumber, status } = this.parameters;
|
|
112
|
-
const
|
|
113
|
-
|
|
114
|
-
1 + CommandBinaryBuffer.getEventStatusSize(this.hardwareType));
|
|
87
|
+
const { hardwareType } = this.config;
|
|
88
|
+
const buffer = new CommandBinaryBuffer(1 + CommandBinaryBuffer.getEventStatusSize(hardwareType));
|
|
115
89
|
buffer.setUint8(sequenceNumber);
|
|
116
|
-
buffer.setEventStatus(
|
|
90
|
+
buffer.setEventStatus(hardwareType, status);
|
|
117
91
|
return Command.toBytes(COMMAND_ID, buffer.toUint8Array());
|
|
118
92
|
}
|
|
119
93
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LastEvent.js","sourceRoot":"","sources":["../../../../src/analog/commands/uplink/LastEvent.ts"],"names":[],"mappings":"AAAA,OAAO,OAA8B,MAAM,kBAAkB,CAAC;AAC9D,OAAO,mBAAmC,MAAM,8BAA8B,CAAC;AAC/E,OAAO,EAAC,MAAM,EAAC,MAAM,+BAA+B,CAAC;AACrD,OAAO,KAAK,aAAa,MAAM,kCAAkC,CAAC;AAqBlE,MAAM,UAAU,GAAG,IAAI,CAAC;AAExB,MAAM,QAAQ,GAAwB;IAClC;QACI,IAAI,EAAE,kBAAkB;QACxB,UAAU,EAAE;YACR,cAAc,EAAE,EAAE;YAClB,MAAM,EAAE;gBACJ,YAAY,EAAE,IAAI;gBAClB,gBAAgB,EAAE,KAAK;gBACvB,gBAAgB,EAAE,IAAI;gBACtB,mBAAmB,EAAE,KAAK;aAC7B;SACJ;QACD,MAAM,EAAE;YACJ,YAAY,EAAE,aAAa,CAAC,KAAK;SACpC;QACD,GAAG,EAAE,EAAC,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAC;KACrC;IACD;QACI,IAAI,EAAE,mBAAmB;QACzB,UAAU,EAAE;YACR,cAAc,EAAE,EAAE;YAClB,MAAM,EAAE;gBAEJ,YAAY,EAAE,IAAI;gBAClB,gBAAgB,EAA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G;YACxB,MAAM,IAAI,KAAK,CAAC,qCAAqC,CAAC,CAAC;SAC1D;QAED,MAAM,MAAM,GAAG,IAAI,mBAAmB,CAAC,IAAI,CAAC,CAAC;QAC7C,MAAM,cAAc,GAAG,MAAM,CAAC,QAAQ,EAAE,CAAC;QACzC,MAAM,MAAM,GAAG,MAAM,CAAC,cAAc,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;QAE1D,OAAO,IAAI,SAAS,CAAC,EAAC,cAAc,EAAE,MAAM,EAAC,EAAE,MAAM,CAAC,CAAC;IAC3D,CAAC;IAGD,OAAO;QACH,MAAM,EAAC,cAAc,EAAE,MAAM,EAAC,GAAG,IAAI,CAAC,UAAU,CAAC;QACjD,MAAM,EAAC,YAAY,EAAC,GAAG,IAAI,CAAC,MAAM,CAAC;QACnC,MAAM,MAAM,GAAG,IAAI,mBAAmB,CAElC,CAAC,GAAG,mBAAmB,CAAC,kBAAkB,CAAC,YAAa,CAAC,CAC5D,CAAC;QAEF,MAAM,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAC;QAChC,MAAM,CAAC,cAAc,CAAC,YAAa,EAAE,MAAM,CAAC,CAAC;QAE7C,OAAO,OAAO,CAAC,OAAO,CAAC,UAAU,EAAE,MAAM,CAAC,YAAY,EAAE,CAAC,CAAC;IAC9D,CAAC;;AAnCe,YAAE,GAAG,UAAU,CAAC;AAEhB,uBAAa,GAAG,MAAM,CAAC;AAEvB,kBAAQ,GAAG,QAAQ,CAAC;AAEpB,uBAAa,GAAG,IAAI,CAAC;AAiCzC,eAAe,SAAS,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import Command, { TCommandExampleList } from '../../Command.js';
|
|
2
2
|
import { IEventMtxStatus } from '../../CommandBinaryBuffer.js';
|
|
3
|
-
import { TTime2000 } from '
|
|
3
|
+
import { TTime2000 } from '../../../utils/time.js';
|
|
4
4
|
interface IEventBase {
|
|
5
5
|
}
|
|
6
6
|
interface IEventTime extends IEventBase {
|
|
@@ -9,15 +9,7 @@ interface IEventTime extends IEventBase {
|
|
|
9
9
|
interface IEventBatteryAlarm extends IEventBase {
|
|
10
10
|
voltage: number;
|
|
11
11
|
}
|
|
12
|
-
/**
|
|
13
|
-
* MTX meters activation event.
|
|
14
|
-
*/
|
|
15
12
|
interface IEventActivateMtx extends IEventTime {
|
|
16
|
-
/**
|
|
17
|
-
* hex string, 8 bytes contains unique meter ID
|
|
18
|
-
* @example
|
|
19
|
-
* '00 1A 79 88 17 01 23 56'
|
|
20
|
-
*/
|
|
21
13
|
deviceId: string;
|
|
22
14
|
}
|
|
23
15
|
interface IEventConnection extends IEventBase {
|
|
@@ -28,44 +20,11 @@ interface IEventMtx extends IEventBase {
|
|
|
28
20
|
status: IEventMtxStatus;
|
|
29
21
|
}
|
|
30
22
|
type TEventData = IEventTime | IEventBatteryAlarm | IEventActivateMtx | IEventConnection | IEventMtx;
|
|
31
|
-
/**
|
|
32
|
-
* NewEvent command parameters
|
|
33
|
-
*
|
|
34
|
-
* @example
|
|
35
|
-
* ```js
|
|
36
|
-
* import {constants} from 'jooby-codec'
|
|
37
|
-
*
|
|
38
|
-
* // `MAGNET_ON` event at 2023-04-05 13:17:20 GMT
|
|
39
|
-
* {id: constants.events.MAGNET_ON, sequenceNumber: 1, data: {time: 734015840}}
|
|
40
|
-
*/
|
|
41
23
|
interface INewEventParameters {
|
|
42
24
|
id: number;
|
|
43
25
|
sequenceNumber: number;
|
|
44
26
|
data: TEventData;
|
|
45
27
|
}
|
|
46
|
-
/**
|
|
47
|
-
* Uplink command.
|
|
48
|
-
*
|
|
49
|
-
* @example create command instance from command body hex dump
|
|
50
|
-
* ```js
|
|
51
|
-
* import NewEvent from 'jooby-codec/commands/uplink/NewEvent';
|
|
52
|
-
*
|
|
53
|
-
* const commandBody = new Uint8Array([
|
|
54
|
-
* 0x05, 0x02, 0x0c, 0xec
|
|
55
|
-
* ]);
|
|
56
|
-
* const command = NewEvent.fromBytes(commandBody);
|
|
57
|
-
*
|
|
58
|
-
* console.log(command.parameters);
|
|
59
|
-
* // output:
|
|
60
|
-
* {
|
|
61
|
-
* id: 5,
|
|
62
|
-
* sequenceNumber: 2,
|
|
63
|
-
* data: {voltage: 3308}
|
|
64
|
-
* }
|
|
65
|
-
* ```
|
|
66
|
-
*
|
|
67
|
-
* [Command format documentation](https://github.com/jooby-dev/jooby-docs/blob/main/docs/commands/uplink/NewEvent.md)
|
|
68
|
-
*/
|
|
69
28
|
declare class NewEvent extends Command {
|
|
70
29
|
parameters: INewEventParameters;
|
|
71
30
|
constructor(parameters: INewEventParameters);
|