jooby-codec 1.15.0 → 2.1.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} +4 -213
- package/dist/{CommandBinaryBuffer.js → analog/CommandBinaryBuffer.js} +10 -84
- 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 +7 -31
- 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 +5 -24
- 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 +7 -26
- 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 +7 -28
- 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 +7 -27
- 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 +6 -38
- 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 +5 -35
- 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 +6 -41
- 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 +5 -37
- 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 +7 -33
- 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 +3 -36
- 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 +5 -37
- package/dist/analog/commands/uplink/GetExAbsArchiveDaysMCResponse.js.map +1 -0
- package/dist/analog/commands/uplink/GetExAbsArchiveHoursMCResponse.d.ts +19 -0
- package/dist/{commands → analog/commands}/uplink/GetExAbsArchiveHoursMCResponse.js +5 -35
- 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 +5 -39
- 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 +2 -43
- package/dist/{commands → analog/commands}/uplink/NewEvent.js +8 -38
- 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 +6 -26
- 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 +18 -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 +18 -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 +18 -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 +18 -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 +2 -26
- package/dist/utils/time.js +2 -14
- package/dist/utils/time.js.map +1 -1
- package/package.json +13 -9
- package/readme.md +20 -13
- 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.d.ts +0 -44
- 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":"SetTime2000.js","sourceRoot":"","sources":["../../../../src/analog/commands/downlink/SetTime2000.ts"],"names":[],"mappings":"AAAA,OAAO,OAA8B,MAAM,kBAAkB,CAAC;AAC9D,OAAO,YAAY,MAAM,gCAAgC,CAAC;AAC1D,OAAO,EAAC,QAAQ,EAAC,MAAM,+BAA+B,CAAC;AAkBvD,MAAM,UAAU,GAAG,IAAI,CAAC;AACxB,MAAM,iBAAiB,GAAG,CAAC,CAAC;AAE5B,MAAM,QAAQ,GAAwB;IAClC;QACI,IAAI,EAAE,qCAAqC;QAC3C,UAAU,EAAE,EAAC,cAAc,EAAE,EAAE,EAAE,OAAO,EAAE,SAAS,EAAC;QACpD,GAAG,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W,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import Command, { TCommandExampleList } from '../../Command.js';
|
|
2
|
+
declare class SoftRestart extends Command {
|
|
3
|
+
static readonly id = 25;
|
|
4
|
+
static readonly directionType = 1;
|
|
5
|
+
static readonly examples: TCommandExampleList;
|
|
6
|
+
static readonly hasParameters = false;
|
|
7
|
+
static fromBytes(): SoftRestart;
|
|
8
|
+
toBytes(): Uint8Array;
|
|
9
|
+
}
|
|
10
|
+
export default SoftRestart;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import Command from '../../Command.js';
|
|
2
|
+
import { DOWNLINK } from '../../constants/directions.js';
|
|
3
|
+
const COMMAND_ID = 0x19;
|
|
4
|
+
const examples = [
|
|
5
|
+
{
|
|
6
|
+
name: 'simple request',
|
|
7
|
+
hex: { header: '19 00', body: '' }
|
|
8
|
+
}
|
|
9
|
+
];
|
|
10
|
+
class SoftRestart extends Command {
|
|
11
|
+
static fromBytes() {
|
|
12
|
+
return new SoftRestart();
|
|
13
|
+
}
|
|
14
|
+
toBytes() {
|
|
15
|
+
return Command.toBytes(COMMAND_ID);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
SoftRestart.id = COMMAND_ID;
|
|
19
|
+
SoftRestart.directionType = DOWNLINK;
|
|
20
|
+
SoftRestart.examples = examples;
|
|
21
|
+
SoftRestart.hasParameters = false;
|
|
22
|
+
export default SoftRestart;
|
|
23
|
+
//# sourceMappingURL=SoftRestart.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SoftRestart.js","sourceRoot":"","sources":["../../../../src/analog/commands/downlink/SoftRestart.ts"],"names":[],"mappings":"AAAA,OAAO,OAA8B,MAAM,kBAAkB,CAAC;AAC9D,OAAO,EAAC,QAAQ,EAAC,MAAM,+BAA+B,CAAC;AAGvD,MAAM,UAAU,GAAG,IAAI,CAAC;AAExB,MAAM,QAAQ,GAAwB;IAClC;QACI,IAAI,EAAE,gBAAgB;QACtB,GAAG,EAAE,EAAC,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,EAAC;KACnC;CACJ,CAAC;AAmBF,MAAM,WAAY,SAAQ,OAAO;IAW7B,MAAM,CAAC,SAAS;QACZ,OAAO,IAAI,WAAW,EAAE,CAAC;IAC7B,CAAC;IAID,OAAO;QACH,OAAO,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;IACvC,CAAC;;AAlBe,cAAE,GAAG,UAAU,CAAC;AAEhB,yBAAa,GAAG,QAAQ,CAAC;AAEzB,oBAAQ,GAAG,QAAQ,CAAC;AAEpB,yBAAa,GAAG,KAAK,CAAC;AAgB1C,eAAe,WAAW,CAAC"}
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* All downlink commands.
|
|
3
|
-
*
|
|
4
|
-
* @packageDocumentation
|
|
5
|
-
*/
|
|
6
1
|
export { default as CorrectTime2000 } from './CorrectTime2000.js';
|
|
7
2
|
export { default as GetArchiveDaysMC } from './GetArchiveDaysMC.js';
|
|
8
3
|
export { default as GetArchiveEvents } from './GetArchiveEvents.js';
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* All downlink commands.
|
|
3
|
-
*
|
|
4
|
-
* @packageDocumentation
|
|
5
|
-
*/
|
|
6
1
|
export { default as CorrectTime2000 } from './CorrectTime2000.js';
|
|
7
2
|
export { default as GetArchiveDaysMC } from './GetArchiveDaysMC.js';
|
|
8
3
|
export { default as GetArchiveEvents } from './GetArchiveEvents.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/analog/commands/downlink/index.ts"],"names":[],"mappings":"AAMA,OAAO,EAAC,OAAO,IAAI,eAAe,EAAC,MAAM,sBAAsB,CAAC;AAChE,OAAO,EAAC,OAAO,IAAI,gBAAgB,EAAC,MAAM,uBAAuB,CAAC;AAClE,OAAO,EAAC,OAAO,IAAI,gBAAgB,EAAC,MAAM,uBAAuB,CAAC;AAClE,OAAO,EAAC,OAAO,IAAI,iBAAiB,EAAC,MAAM,wBAAwB,CAAC;AACpE,OAAO,EAAC,OAAO,IAAI,YAAY,EAAC,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EAAC,OAAO,IAAI,qBAAqB,EAAC,MAAM,4BAA4B,CAAC;AAC5E,OAAO,EAAC,OAAO,IAAI,sBAAsB,EAAC,MAAM,6BAA6B,CAAC;AAC9E,OAAO,EAAC,OAAO,IAAI,iBAAiB,EAAC,MAAM,wBAAwB,CAAC;AACpE,OAAO,EAAC,OAAO,IAAI,WAAW,EAAC,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAC,OAAO,IAAI,YAAY,EAAC,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EAAC,OAAO,IAAI,SAAS,EAAC,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAC,OAAO,IAAI,YAAY,EAAC,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EAAC,OAAO,IAAI,WAAW,EAAC,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAC,OAAO,IAAI,WAAW,EAAC,MAAM,kBAAkB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/analog/commands/index.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,QAAQ,MAAM,qBAAqB,CAAC;AAChD,OAAO,KAAK,MAAM,MAAM,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import Command, { TCommandExampleList } from '../../Command.js';
|
|
2
|
+
interface ICorrectTime2000ResponseParameters {
|
|
3
|
+
status: number;
|
|
4
|
+
}
|
|
5
|
+
declare class CorrectTime2000Response extends Command {
|
|
6
|
+
parameters: ICorrectTime2000ResponseParameters;
|
|
7
|
+
constructor(parameters: ICorrectTime2000ResponseParameters);
|
|
8
|
+
static readonly id = 12;
|
|
9
|
+
static readonly directionType = 2;
|
|
10
|
+
static readonly examples: TCommandExampleList;
|
|
11
|
+
static readonly hasParameters = true;
|
|
12
|
+
static fromBytes(data: Uint8Array): CorrectTime2000Response;
|
|
13
|
+
toBytes(): Uint8Array;
|
|
14
|
+
}
|
|
15
|
+
export default CorrectTime2000Response;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import Command from '../../Command.js';
|
|
2
|
-
import BinaryBuffer from '
|
|
2
|
+
import BinaryBuffer from '../../../utils/BinaryBuffer.js';
|
|
3
3
|
import { UPLINK } from '../../constants/directions.js';
|
|
4
4
|
const COMMAND_ID = 0x0c;
|
|
5
5
|
const COMMAND_BODY_SIZE = 1;
|
|
@@ -10,44 +10,24 @@ const examples = [
|
|
|
10
10
|
hex: { header: '0c 01', body: '00' }
|
|
11
11
|
}
|
|
12
12
|
];
|
|
13
|
-
/**
|
|
14
|
-
* Uplink command.
|
|
15
|
-
*
|
|
16
|
-
* @example create command instance from command body hex dump
|
|
17
|
-
* ```js
|
|
18
|
-
* import CorrectTime2000Response from 'jooby-codec/commands/uplink/CorrectTime2000Response';
|
|
19
|
-
*
|
|
20
|
-
* // failure
|
|
21
|
-
* const commandBody = new Uint8Array([0x00]);
|
|
22
|
-
* const command = CorrectTime2000Response.fromBytes(commandBody);
|
|
23
|
-
*
|
|
24
|
-
* console.log(command.parameters);
|
|
25
|
-
* // output:
|
|
26
|
-
* {status: 0}
|
|
27
|
-
* ```
|
|
28
|
-
*
|
|
29
|
-
* [Command format documentation](https://github.com/jooby-dev/jooby-docs/blob/main/docs/commands/CorrectTime2000.md#response)
|
|
30
|
-
*/
|
|
31
13
|
class CorrectTime2000Response extends Command {
|
|
32
14
|
constructor(parameters) {
|
|
33
15
|
super();
|
|
34
16
|
this.parameters = parameters;
|
|
35
17
|
}
|
|
36
|
-
// data - only body (without header)
|
|
37
18
|
static fromBytes(data) {
|
|
38
19
|
if (data.byteLength !== COMMAND_BODY_SIZE) {
|
|
39
|
-
throw new Error(
|
|
20
|
+
throw new Error(`Wrong buffer size: ${data.byteLength}.`);
|
|
40
21
|
}
|
|
41
22
|
const buffer = new BinaryBuffer(data, false);
|
|
42
23
|
const parameters = {
|
|
43
24
|
status: buffer.getUint8()
|
|
44
25
|
};
|
|
45
26
|
if (!buffer.isEmpty) {
|
|
46
|
-
throw new Error(
|
|
27
|
+
throw new Error('BinaryBuffer is not empty.');
|
|
47
28
|
}
|
|
48
29
|
return new CorrectTime2000Response(parameters);
|
|
49
30
|
}
|
|
50
|
-
// returns full message - header with body
|
|
51
31
|
toBytes() {
|
|
52
32
|
const { status } = this.parameters;
|
|
53
33
|
const buffer = new BinaryBuffer(COMMAND_BODY_SIZE, false);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CorrectTime2000Response.js","sourceRoot":"","sources":["../../../../src/analog/commands/uplink/CorrectTime2000Response.ts"],"names":[],"mappings":"AAAA,OAAO,OAA8B,MAAM,kBAAkB,CAAC;AAC9D,OAAO,YAAY,MAAM,gCAAgC,CAAC;AAC1D,OAAO,EAAC,MAAM,EAAC,MAAM,+BAA+B,CAAC;AAcrD,MAAM,UAAU,GAAG,IAAI,CAAC;AACxB,MAAM,iBAAiB,GAAG,CAAC,CAAC;AAE5B,MAAM,QAAQ,GAAwB;IAClC;QACI,IAAI,EAAE,SAAS;QACf,UAAU,EAAE,EAAC,MAAM,EAAE,CAAC,EAAC;QACvB,GAAG,EAAE,EAAC,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAC;KACrC;CACJ,CAAC;AAoBF,MAAM,uBAAwB,SAAQ,OAAO;IACzC,YAAqB,UAA8C;QAC/D,KAAK,EAAE,CAAC;QADS,eAAU,GAAV,UAAU,CAAoC;IAEnE,CAAC;IAaD,MAAM,CAAC,SAAS,CAAG,IAAgB;QAC/B,IAAK,IAAI,CAAC,UAAU,KAAK,iBAAiB,EAAG;YACzC,MAAM,IAAI,KAAK,CAAC,sBAAsB,IAAI,CAAC,UAAU,GAAG,CAAC,CAAC;SAC7D;QAED,MAAM,MAAM,GAAG,IAAI,YAAY,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;QAC7C,MAAM,UAAU,GAAG;YACf,MAAM,EAAE,MAAM,CAAC,QAAQ,EAAE;SAC5B,CAAC;QAEF,IAAK,CAAC,MAAM,CAAC,OAAO,EAAG;YACnB,MAAM,IAAI,KAAK,CAAC,4BAA4B,CAAC,CAAC;SACjD;QAED,OAAO,IAAI,uBAAuB,CAAC,UAAU,CAAC,CAAC;IACnD,CAAC;IAGD,OAAO;QACH,MAAM,EAAC,MAAM,EAAC,GAAG,IAAI,CAAC,UAAU,CAAC;QACjC,MAAM,MAAM,GAAG,IAAI,YAAY,CAAC,iBAAiB,EAAE,KAAK,CAAC,CAAC;QAE1D,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;QAExB,OAAO,OAAO,CAAC,OAAO,CAAC,UAAU,EAAE,MAAM,CAAC,YAAY,EAAE,CAAC,CAAC;IAC9D,CAAC;;AAnCe,0BAAE,GAAG,UAAU,CAAC;AAEhB,qCAAa,GAAG,MAAM,CAAC;AAEvB,gCAAQ,GAAG,QAAQ,CAAC;AAEpB,qCAAa,GAAG,IAAI,CAAC;AAiCzC,eAAe,uBAAuB,CAAC"}
|
|
@@ -1,32 +1,8 @@
|
|
|
1
1
|
import Command, { TCommandExampleList } from '../../Command.js';
|
|
2
2
|
import { IChannelValue } from '../../CommandBinaryBuffer.js';
|
|
3
|
-
/**
|
|
4
|
-
* CurrentMC command parameters.
|
|
5
|
-
*/
|
|
6
3
|
export interface ICurrentMCParameters {
|
|
7
4
|
channelList: Array<IChannelValue>;
|
|
8
5
|
}
|
|
9
|
-
/**
|
|
10
|
-
* Uplink command.
|
|
11
|
-
*
|
|
12
|
-
* @example create command instance from command body hex dump
|
|
13
|
-
* ```js
|
|
14
|
-
* import CurrentMC from 'jooby-codec/commands/uplink/CurrentMC';
|
|
15
|
-
*
|
|
16
|
-
* const commandBody = new Uint8Array([0x01, 0x32]);
|
|
17
|
-
* const command = CurrentMC.fromBytes(commandBody);
|
|
18
|
-
*
|
|
19
|
-
* console.log(command.parameters);
|
|
20
|
-
* // output:
|
|
21
|
-
* {
|
|
22
|
-
* channelList: [
|
|
23
|
-
* {index: 1, value: 50}
|
|
24
|
-
* ]
|
|
25
|
-
* }
|
|
26
|
-
* ```
|
|
27
|
-
*
|
|
28
|
-
* [Command format documentation](https://github.com/jooby-dev/jooby-docs/blob/main/docs/commands/GetCurrentMC.md#response)
|
|
29
|
-
*/
|
|
30
6
|
declare class CurrentMC extends Command {
|
|
31
7
|
parameters: ICurrentMCParameters;
|
|
32
8
|
constructor(parameters: ICurrentMCParameters);
|
|
@@ -2,7 +2,6 @@ import Command from '../../Command.js';
|
|
|
2
2
|
import CommandBinaryBuffer from '../../CommandBinaryBuffer.js';
|
|
3
3
|
import { UPLINK } from '../../constants/directions.js';
|
|
4
4
|
const COMMAND_ID = 0x18;
|
|
5
|
-
// 2 bytes for 7 channelList + (7 channelList * 5 byte for current value of channel)
|
|
6
5
|
const COMMAND_BODY_MAX_SIZE = 37;
|
|
7
6
|
const examples = [
|
|
8
7
|
{
|
|
@@ -38,34 +37,12 @@ const examples = [
|
|
|
38
37
|
hex: { header: '18 07', body: 'b0 10 d2 3f a4 01 4b' }
|
|
39
38
|
}
|
|
40
39
|
];
|
|
41
|
-
/**
|
|
42
|
-
* Uplink command.
|
|
43
|
-
*
|
|
44
|
-
* @example create command instance from command body hex dump
|
|
45
|
-
* ```js
|
|
46
|
-
* import CurrentMC from 'jooby-codec/commands/uplink/CurrentMC';
|
|
47
|
-
*
|
|
48
|
-
* const commandBody = new Uint8Array([0x01, 0x32]);
|
|
49
|
-
* const command = CurrentMC.fromBytes(commandBody);
|
|
50
|
-
*
|
|
51
|
-
* console.log(command.parameters);
|
|
52
|
-
* // output:
|
|
53
|
-
* {
|
|
54
|
-
* channelList: [
|
|
55
|
-
* {index: 1, value: 50}
|
|
56
|
-
* ]
|
|
57
|
-
* }
|
|
58
|
-
* ```
|
|
59
|
-
*
|
|
60
|
-
* [Command format documentation](https://github.com/jooby-dev/jooby-docs/blob/main/docs/commands/GetCurrentMC.md#response)
|
|
61
|
-
*/
|
|
62
40
|
class CurrentMC extends Command {
|
|
63
41
|
constructor(parameters) {
|
|
64
42
|
super();
|
|
65
43
|
this.parameters = parameters;
|
|
66
44
|
this.parameters.channelList = this.parameters.channelList.sort((a, b) => a.index - b.index);
|
|
67
45
|
}
|
|
68
|
-
// data - only body (without header)
|
|
69
46
|
static fromBytes(data) {
|
|
70
47
|
const parameters = { channelList: [] };
|
|
71
48
|
const buffer = new CommandBinaryBuffer(data);
|
|
@@ -76,7 +53,6 @@ class CurrentMC extends Command {
|
|
|
76
53
|
}));
|
|
77
54
|
return new CurrentMC(parameters);
|
|
78
55
|
}
|
|
79
|
-
// returns full message - header with body
|
|
80
56
|
toBytes() {
|
|
81
57
|
const buffer = new CommandBinaryBuffer(COMMAND_BODY_MAX_SIZE);
|
|
82
58
|
const { channelList } = this.parameters;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CurrentMC.js","sourceRoot":"","sources":["../../../../src/analog/commands/uplink/CurrentMC.ts"],"names":[],"mappings":"AAAA,OAAO,OAA8B,MAAM,kBAAkB,CAAC;AAC9D,OAAO,mBAAoC,MAAM,8BAA8B,CAAC;AAChF,OAAO,EAAC,MAAM,EAAC,MAAM,+BAA+B,CAAC;AAUrD,MAAM,UAAU,GAAG,IAAI,CAAC;AAGxB,MAAM,qBAAqB,GAAG,EAAE,CAAC;AAEjC,MAAM,QAAQ,GAAwB;IAClC;QACI,IAAI,EAAE,kBAAkB;QACxB,UAAU,EAAE;YACR,WAAW,EAAE;gBACT,EAAC,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,GAAG,EAAC;gBACtB,EAAC,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAC;gBACpB,EAAC,KAAK,EAAE,CAAC,EAAE,KAAK,EAA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,MAAM,CAAC,WAAW,EAAE,CAAC;QAEzC,UAAU,CAAC,WAAW,GAAG,WAAW,CAAC,GAAG,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC;YACtD,KAAK,EAAE,MAAM,CAAC,gBAAgB,EAAE;YAChC,KAAK,EAAE,YAAY;SACtB,CAAkB,CAAC,CAAC;QAErB,OAAO,IAAI,SAAS,CAAC,UAAU,CAAC,CAAC;IACrC,CAAC;IAGD,OAAO;QACH,MAAM,MAAM,GAAG,IAAI,mBAAmB,CAAC,qBAAqB,CAAC,CAAC;QAC9D,MAAM,EAAC,WAAW,EAAC,GAAG,IAAI,CAAC,UAAU,CAAC;QAEtC,MAAM,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC;QAChC,WAAW,CAAC,OAAO,CAAC,CAAC,EAAC,KAAK,EAAC,EAAE,EAAE,CAAC,MAAM,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC,CAAC;QAEjE,OAAO,OAAO,CAAC,OAAO,CAAC,UAAU,EAAE,MAAM,CAAC,gBAAgB,EAAE,CAAC,CAAC;IAClE,CAAC;;AAhCM,YAAE,GAAG,UAAU,CAAC;AAEP,uBAAa,GAAG,MAAM,CAAC;AAEvB,kBAAQ,GAAG,QAAQ,CAAC;AAEpB,uBAAa,GAAG,IAAI,CAAC;AA8BzC,eAAe,SAAS,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { TCommandExampleList } from '../../Command.js';
|
|
2
|
+
import { TTime2000 } from '../../../utils/time.js';
|
|
3
|
+
import CurrentMC, { ICurrentMCParameters } from './CurrentMC.js';
|
|
4
|
+
interface IDayMCParameters extends ICurrentMCParameters {
|
|
5
|
+
startTime2000: TTime2000;
|
|
6
|
+
}
|
|
7
|
+
declare class DayMC extends CurrentMC {
|
|
8
|
+
parameters: IDayMCParameters;
|
|
9
|
+
constructor(parameters: IDayMCParameters);
|
|
10
|
+
static readonly id = 22;
|
|
11
|
+
static readonly directionType = 2;
|
|
12
|
+
static readonly examples: TCommandExampleList;
|
|
13
|
+
static readonly hasParameters = true;
|
|
14
|
+
static fromBytes(data: Uint8Array): DayMC;
|
|
15
|
+
toBytes(): Uint8Array;
|
|
16
|
+
}
|
|
17
|
+
export default DayMC;
|
|
@@ -1,18 +1,15 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
|
|
2
1
|
import Command from '../../Command.js';
|
|
3
2
|
import CommandBinaryBuffer from '../../CommandBinaryBuffer.js';
|
|
4
|
-
import {
|
|
3
|
+
import { getTime2000FromDate } from '../../../utils/time.js';
|
|
5
4
|
import CurrentMC from './CurrentMC.js';
|
|
6
5
|
import { UPLINK } from '../../constants/directions.js';
|
|
7
6
|
const COMMAND_ID = 0x16;
|
|
8
|
-
// 2 byte for date + 2 for channels (max channels: 7)
|
|
9
|
-
// 4 + (7 * 4)
|
|
10
7
|
const COMMAND_BODY_MAX_SIZE = 32;
|
|
11
8
|
const examples = [
|
|
12
9
|
{
|
|
13
10
|
name: '4 channels at 2023.12.23 00:00:00 GMT',
|
|
14
11
|
parameters: {
|
|
15
|
-
|
|
12
|
+
startTime2000: 756604800,
|
|
16
13
|
channelList: [
|
|
17
14
|
{ index: 3, value: 131 },
|
|
18
15
|
{ index: 5, value: 8 },
|
|
@@ -23,41 +20,13 @@ const examples = [
|
|
|
23
20
|
hex: { header: '16 08', body: '2f 97 55 0c 83 01 08 0a' }
|
|
24
21
|
}
|
|
25
22
|
];
|
|
26
|
-
/**
|
|
27
|
-
* Uplink command.
|
|
28
|
-
*
|
|
29
|
-
* @example create command instance from command body hex dump
|
|
30
|
-
* ```js
|
|
31
|
-
* import DayMC from 'jooby-codec/commands/uplink/DayMC';
|
|
32
|
-
*
|
|
33
|
-
* const commandBody = new Uint8Array([
|
|
34
|
-
* 0x2f, 0x97, 0x55, 0x0c, 0x83, 0x01, 0x08, 0x0a
|
|
35
|
-
* ]);
|
|
36
|
-
* const command = DayMC.fromBytes(commandBody);
|
|
37
|
-
*
|
|
38
|
-
* console.log(command.parameters);
|
|
39
|
-
* // output:
|
|
40
|
-
* {
|
|
41
|
-
* startTime: 756604800,
|
|
42
|
-
* channelList: [,
|
|
43
|
-
* {value: 12, index: 1}
|
|
44
|
-
* {value: 131, index: 3},
|
|
45
|
-
* {value: 8, index: 5},
|
|
46
|
-
* {value: 10, index: 7}
|
|
47
|
-
* ]
|
|
48
|
-
* }
|
|
49
|
-
* ```
|
|
50
|
-
*
|
|
51
|
-
* [Command format documentation](https://github.com/jooby-dev/jooby-docs/blob/main/docs/commands/uplink/DayMC.md)
|
|
52
|
-
*/
|
|
53
23
|
class DayMC extends CurrentMC {
|
|
54
24
|
constructor(parameters) {
|
|
55
25
|
super(parameters);
|
|
56
26
|
this.parameters = parameters;
|
|
57
27
|
}
|
|
58
|
-
// data - only body (without header)
|
|
59
28
|
static fromBytes(data) {
|
|
60
|
-
const parameters = { channelList: [],
|
|
29
|
+
const parameters = { channelList: [], startTime2000: 0 };
|
|
61
30
|
const buffer = new CommandBinaryBuffer(data);
|
|
62
31
|
const date = buffer.getDate();
|
|
63
32
|
const channelList = buffer.getChannels();
|
|
@@ -65,14 +34,13 @@ class DayMC extends CurrentMC {
|
|
|
65
34
|
value: buffer.getExtendedValue(),
|
|
66
35
|
index: channelIndex
|
|
67
36
|
}));
|
|
68
|
-
parameters.
|
|
37
|
+
parameters.startTime2000 = getTime2000FromDate(date);
|
|
69
38
|
return new DayMC(parameters);
|
|
70
39
|
}
|
|
71
|
-
// returns full message - header with body
|
|
72
40
|
toBytes() {
|
|
73
41
|
const buffer = new CommandBinaryBuffer(COMMAND_BODY_MAX_SIZE);
|
|
74
|
-
const { channelList,
|
|
75
|
-
buffer.setDate(
|
|
42
|
+
const { channelList, startTime2000 } = this.parameters;
|
|
43
|
+
buffer.setDate(startTime2000);
|
|
76
44
|
buffer.setChannels(channelList);
|
|
77
45
|
channelList.forEach(({ value }) => buffer.setExtendedValue(value));
|
|
78
46
|
return Command.toBytes(COMMAND_ID, bu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AM,IAAI,GAAG,MAAM,CAAC,OAAO,EAAE,CAAC;QAC9B,MAAM,WAAW,GAAG,MAAM,CAAC,WAAW,EAAE,CAAC;QAEzC,UAAU,CAAC,WAAW,GAAG,WAAW,CAAC,GAAG,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC;YACtD,KAAK,EAAE,MAAM,CAAC,gBAAgB,EAAE;YAChC,KAAK,EAAE,YAAY;SACtB,CAAkB,CAAC,CAAC;QAErB,UAAU,CAAC,aAAa,GAAG,mBAAmB,CAAC,IAAI,CAAC,CAAC;QAErD,OAAO,IAAI,KAAK,CAAC,UAAU,CAAC,CAAC;IACjC,CAAC;IAGD,OAAO;QACH,MAAM,MAAM,GAAG,IAAI,mBAAmB,CAAC,qBAAqB,CAAC,CAAC;QAC9D,MAAM,EAAC,WAAW,EAAE,aAAa,EAAC,GAAG,IAAI,CAAC,UAAU,CAAC;QAErD,MAAM,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;QAC9B,MAAM,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC;QAChC,WAAW,CAAC,OAAO,CAAC,CAAC,EAAC,KAAK,EAAC,EAAE,EAAE,CAAC,MAAM,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC,CAAC;QAEjE,OAAO,OAAO,CAAC,OAAO,CAAC,UAAU,EAAE,MAAM,CAAC,gBAAgB,EAAE,CAAC,CAAC;IAClE,CAAC;;AApCe,QAAE,GAAG,UAAU,CAAC;AAEhB,mBAAa,GAAG,MAAM,CAAC;AAEvB,cAAQ,GAAG,QAAQ,CAAC;AAEpB,mBAAa,GAAG,IAAI,CAAC;AAkCzC,eAAe,KAAK,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import Command, { TCommandExampleList } from '../../Command.js';
|
|
2
|
+
import { IChannelAbsoluteValue } from '../../CommandBinaryBuffer.js';
|
|
3
|
+
interface IExAbsCurrentMCParameters {
|
|
4
|
+
channelList: Array<IChannelAbsoluteValue>;
|
|
5
|
+
}
|
|
6
|
+
declare class ExAbsCurrentMC extends Command {
|
|
7
|
+
parameters: IExAbsCurrentMCParameters;
|
|
8
|
+
constructor(parameters: IExAbsCurrentMCParameters);
|
|
9
|
+
static id: number;
|
|
10
|
+
static readonly directionType = 2;
|
|
11
|
+
static readonly examples: TCommandExampleList;
|
|
12
|
+
static readonly hasParameters = true;
|
|
13
|
+
static fromBytes(data: Uint8Array): ExAbsCurrentMC;
|
|
14
|
+
toBytes(): Uint8Array;
|
|
15
|
+
}
|
|
16
|
+
export default ExAbsCurrentMC;
|
|
@@ -2,8 +2,6 @@ import Command from '../../Command.js';
|
|
|
2
2
|
import CommandBinaryBuffer from '../../CommandBinaryBuffer.js';
|
|
3
3
|
import { UPLINK } from '../../constants/directions.js';
|
|
4
4
|
const COMMAND_ID = 0x0f1f;
|
|
5
|
-
// channelList 3 byte (max channelList: 14)
|
|
6
|
-
// 3 + (14 * (1 byte pulse coefficient + 5 bytes of day values))
|
|
7
5
|
const COMMAND_BODY_MAX_SIZE = 87;
|
|
8
6
|
const examples = [
|
|
9
7
|
{
|
|
@@ -16,43 +14,16 @@ const examples = [
|
|
|
16
14
|
hex: { header: '1f 0f 04', body: '04 83 d6 02' }
|
|
17
15
|
}
|
|
18
16
|
];
|
|
19
|
-
/**
|
|
20
|
-
* Uplink command.
|
|
21
|
-
*
|
|
22
|
-
* @example create command instance from command body hex dump
|
|
23
|
-
* ```js
|
|
24
|
-
* import ExAbsCurrentMC from 'jooby-codec/commands/uplink/ExAbsCurrentMC';
|
|
25
|
-
*
|
|
26
|
-
* const commandBody = new Uint8Array([0x04, 0x82, 0xd6, 0x02']);
|
|
27
|
-
* const command = ExAbsCurrentMC.fromBytes(commandBody);
|
|
28
|
-
*
|
|
29
|
-
* console.log(command.parameters);
|
|
30
|
-
* // output:
|
|
31
|
-
* {
|
|
32
|
-
* channelList: [
|
|
33
|
-
* {
|
|
34
|
-
* pulseCoefficient: 100,
|
|
35
|
-
* index: 3,
|
|
36
|
-
* value: 342
|
|
37
|
-
* }
|
|
38
|
-
* ]
|
|
39
|
-
* }
|
|
40
|
-
* ```
|
|
41
|
-
*
|
|
42
|
-
* [Command format documentation](https://github.com/jooby-dev/jooby-docs/blob/main/docs/commands/uplink/ExAbsCurrentMC.md)
|
|
43
|
-
*/
|
|
44
17
|
class ExAbsCurrentMC extends Command {
|
|
45
18
|
constructor(parameters) {
|
|
46
19
|
super();
|
|
47
20
|
this.parameters = parameters;
|
|
48
21
|
this.parameters.channelList = this.parameters.channelList.sort((a, b) => a.index - b.index);
|
|
49
22
|
}
|
|
50
|
-
// data - only body (without header)
|
|
51
23
|
static fromBytes(data) {
|
|
52
24
|
const buffer = new CommandBinaryBuffer(data);
|
|
53
25
|
return new ExAbsCurrentMC({ channelList: buffer.getChannelsWithAbsoluteValues() });
|
|
54
26
|
}
|
|
55
|
-
// returns full message - header with body
|
|
56
27
|
toBytes() {
|
|
57
28
|
const buffer = new CommandBinaryBuffer(COMMAND_BODY_MAX_SIZE);
|
|
58
29
|
const { channelList } = this.parameters;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExAbsCurrentMC.js","sourceRoot":"","sources":["../../../../src/analog/commands/uplink/ExAbsCurrentMC.ts"],"names":[],"mappings":"AAAA,OAAO,OAA8B,MAAM,kBAAkB,CAAC;AAC9D,OAAO,mBAA4C,MAAM,8BAA8B,CAAC;AACxF,OAAO,EAAC,MAAM,EAAC,MAAM,+BAA+B,CAAC;AAOrD,MAAM,UAAU,GAAG,MAAM,CAAC;AAI1B,MAAM,qBAAqB,GAAG,EAAE,CAAC;AAEjC,MAAM,QAAQ,GAAwB;IAClC;QACI,IAAI,EAAE,uCAAuC;QAC7C,UAAU,EAAE;YACR,WAAW,EAAE;gBACT,EAAC,gBAAgB,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,GAAG,EAAC;aAChD;SACJ;QACD,GAAG,EAAE,EAAC,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE,aAAa,EAAC;KACjD;CACJ,CAAC;AA4BF,MAAM,cAAe,SAAQ,OAAO;IAChC,YAAqB,UAAqC;QACtD,KAAK,EAAE,CAAC;QADS,eAAU,GAAV,UAAU,CAA2B;QAGtD,IAAI,CAAC,UAAU,CAAC,WAAW,GAAG,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC;IAChG,CAAC;IAaD,MAAM,CAAC,SAAS,CAAG,IAAgB;QAC/B,MAAM,MAAM,GAAG,IAAI,mBAAmB,CAAC,IAAI,CAAC,CAAC;QAE7C,OAAO,IAAI,cAAc,CAAC,EAAC,WAAW,EAAE,MAAM,CAAC,6BAA6B,EAAE,EAAC,CAAC,CAAC;IACrF,CAAC;IAGD,OAAO;QACH,MAAM,MAAM,GAAG,IAAI,mBAAmB,CAAC,qBAAqB,CAAC,CAAC;QAC9D,MAAM,EAAC,WAAW,EAAC,GAAG,IAAI,CAAC,UAAU,CAAC;QAEtC,MAAM,CAAC,6BAA6B,CAAC,WAAW,CAAC,CAAC;QAElD,OAAO,OAAO,CAAC,OAAO,CAAC,UAAU,EAAE,MAAM,CAAC,gBAAgB,EAAE,CAAC,CAAC;IAClE,CAAC;;AAxBM,iBAAE,GAAG,UAAU,CAAC;AAEP,4BAAa,GAAG,MAAM,CAAC;AAEvB,uBAAQ,GAAG,QAAQ,CAAC;AAEpB,4BAAa,GAAG,IAAI,CAAC;AAsBzC,eAAe,cAAc,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { TCommandExampleList } from '../../Command.js';
|
|
2
|
+
import CurrentMC from './CurrentMC.js';
|
|
3
|
+
import { IChannelAbsoluteValue } from '../../CommandBinaryBuffer.js';
|
|
4
|
+
import { TTime2000 } from '../../../utils/time.js';
|
|
5
|
+
interface IExAbsDayMCParameters {
|
|
6
|
+
channelList: Array<IChannelAbsoluteValue>;
|
|
7
|
+
startTime2000: TTime2000;
|
|
8
|
+
}
|
|
9
|
+
declare class ExAbsDayMC extends CurrentMC {
|
|
10
|
+
parameters: IExAbsDayMCParameters;
|
|
11
|
+
constructor(parameters: IExAbsDayMCParameters);
|
|
12
|
+
static id: number;
|
|
13
|
+
static readonly directionType = 2;
|
|
14
|
+
static readonly examples: TCommandExampleList;
|
|
15
|
+
static readonly hasParameters = true;
|
|
16
|
+
static fromBytes(data: Uint8Array): ExAbsDayMC;
|
|
17
|
+
toBytes(): Uint8Array;
|
|
18
|
+
}
|
|
19
|
+
export default ExAbsDayMC;
|
|
@@ -2,16 +2,14 @@ import Command from '../../Command.js';
|
|
|
2
2
|
import CurrentMC from './CurrentMC.js';
|
|
3
3
|
import CommandBinaryBuffer from '../../CommandBinaryBuffer.js';
|
|
4
4
|
import { UPLINK } from '../../constants/directions.js';
|
|
5
|
-
import {
|
|
5
|
+
import { getTime2000FromDate } from '../../../utils/time.js';
|
|
6
6
|
const COMMAND_ID = 0x0b1f;
|
|
7
|
-
// date 2 bytes, channelList 3 bytes (max channelList: 14)
|
|
8
|
-
// 5 + (14 channelList * (1 byte pulse coefficient + 5 bytes of day values))
|
|
9
7
|
const COMMAND_BODY_MAX_SIZE = 89;
|
|
10
8
|
const examples = [
|
|
11
9
|
{
|
|
12
10
|
name: 'absolute day value for 2023.03.10 00:00:00 GMT',
|
|
13
11
|
parameters: {
|
|
14
|
-
|
|
12
|
+
startTime2000: 731721600,
|
|
15
13
|
channelList: [
|
|
16
14
|
{ pulseCoefficient: 100, index: 1, value: 342 }
|
|
17
15
|
]
|
|
@@ -19,49 +17,21 @@ const examples = [
|
|
|
19
17
|
hex: { header: '1f 0b 06', body: '2e 6a 01 83 d6 02' }
|
|
20
18
|
}
|
|
21
19
|
];
|
|
22
|
-
/**
|
|
23
|
-
* Uplink command.
|
|
24
|
-
*
|
|
25
|
-
* @example create command instance from command body hex dump
|
|
26
|
-
* ```js
|
|
27
|
-
* import ExAbsDayMC from 'jooby-codec/commands/uplink/ExAbsDayMC';
|
|
28
|
-
*
|
|
29
|
-
* const commandBody = new Uint8Array([0x2e, 0x6a, 0x01, 0x82, 0xd6, 0x02']);
|
|
30
|
-
* const command = ExAbsDayMC.fromBytes(commandBody);
|
|
31
|
-
*
|
|
32
|
-
* console.log(command.parameters);
|
|
33
|
-
* // output:
|
|
34
|
-
* {
|
|
35
|
-
* startTime: 731721600,
|
|
36
|
-
* channelList: [
|
|
37
|
-
* {
|
|
38
|
-
* pulseCoefficient: 100,
|
|
39
|
-
* index: 1,
|
|
40
|
-
* value: 342
|
|
41
|
-
* }
|
|
42
|
-
* ]
|
|
43
|
-
* }
|
|
44
|
-
* ```
|
|
45
|
-
*
|
|
46
|
-
* [Command format documentation](https://github.com/jooby-dev/jooby-docs/blob/main/docs/commands/uplink/ExAbsDayMC.md)
|
|
47
|
-
*/
|
|
48
20
|
class ExAbsDayMC extends CurrentMC {
|
|
49
21
|
constructor(parameters) {
|
|
50
22
|
super(parameters);
|
|
51
23
|
this.parameters = parameters;
|
|
52
24
|
}
|
|
53
|
-
// data - only body (without header)
|
|
54
25
|
static fromBytes(data) {
|
|
55
26
|
const buffer = new CommandBinaryBuffer(data);
|
|
56
27
|
const date = buffer.getDate();
|
|
57
28
|
const channelList = buffer.getChannelsWithAbsoluteValues();
|
|
58
|
-
return new ExAbsDayMC({ channelList,
|
|
29
|
+
return new ExAbsDayMC({ channelList, startTime2000: getTime2000FromDate(date) });
|
|
59
30
|
}
|
|
60
|
-
// returns full message - header with body
|
|
61
31
|
toBytes() {
|
|
62
32
|
const buffer = new CommandBinaryBuffer(COMMAND_BODY_MAX_SIZE);
|
|
63
|
-
const { channelList,
|
|
64
|
-
buffer.setDate(
|
|
33
|
+
const { channelList, startTime2000 } = this.parameters;
|
|
34
|
+
buffer.setDate(startTime2000);
|
|
65
35
|
buffer.setChannelsWithAbsoluteValues(channelList);
|
|
66
36
|
return Command.toBytes(CO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nF,CAAC;IAGD,OAAO;QACH,MAAM,MAAM,GAAG,IAAI,mBAAmB,CAAC,qBAAqB,CAAC,CAAC;QAC9D,MAAM,EAAC,WAAW,EAAE,aAAa,EAAC,GAAG,IAAI,CAAC,UAAU,CAAC;QAErD,MAAM,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;QAC9B,MAAM,CAAC,6BAA6B,CAAC,WAAW,CAAC,CAAC;QAElD,OAAO,OAAO,CAAC,OAAO,CAAC,UAAU,EAAE,MAAM,CAAC,gBAAgB,EAAE,CAAC,CAAC;IAClE,CAAC;;AA3BM,aAAE,GAAG,UAAU,CAAC;AAEP,wBAAa,GAAG,MAAM,CAAC;AAEvB,mBAAQ,GAAG,QAAQ,CAAC;AAEpB,wBAAa,GAAG,IAAI,CAAC;AAyBzC,eAAe,UAAU,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import Command, { TCommandExampleList } from '../../Command.js';
|
|
2
|
+
import { TTime2000 } from '../../../utils/time.js';
|
|
3
|
+
import { IChannelHourAbsoluteValue } from '../../CommandBinaryBuffer.js';
|
|
4
|
+
interface IUplinkExAbsHourMCParameters {
|
|
5
|
+
channelList: Array<IChannelHourAbsoluteValue>;
|
|
6
|
+
startTime2000: TTime2000;
|
|
7
|
+
hours: number;
|
|
8
|
+
}
|
|
9
|
+
declare class ExAbsHourMC extends Command {
|
|
10
|
+
parameters: IUplinkExAbsHourMCParameters;
|
|
11
|
+
constructor(parameters: IUplinkExAbsHourMCParameters);
|
|
12
|
+
static readonly id = 2591;
|
|
13
|
+
static readonly directionType = 2;
|
|
14
|
+
static readonly examples: TCommandExampleList;
|
|
15
|
+
static readonly hasParameters = true;
|
|
16
|
+
static fromBytes(data: Uint8Array): ExAbsHourMC;
|
|
17
|
+
toBytes(): Uint8Array;
|
|
18
|
+
}
|
|
19
|
+
export default ExAbsHourMC;
|
|
@@ -1,17 +1,14 @@
|
|
|
1
1
|
import Command from '../../Command.js';
|
|
2
|
-
import {
|
|
2
|
+
import { getTime2000FromDate, getDateFromTime2000 } from '../../../utils/time.js';
|
|
3
3
|
import CommandBinaryBuffer from '../../CommandBinaryBuffer.js';
|
|
4
4
|
import { UPLINK } from '../../constants/directions.js';
|
|
5
5
|
const COMMAND_ID = 0x0a1f;
|
|
6
|
-
// date 2 bytes, hour 1 byte, channelList - 1 byte (max channelList: 4)
|
|
7
|
-
// max hours diff - 7 (3 bit value)
|
|
8
|
-
// 4 + (4 channelList * (1 byte pulse coefficient + 5 bytes of hour value)) + (4 * 2 bytes of diff * 7 max hours diff)
|
|
9
6
|
const COMMAND_BODY_MAX_SIZE = 84;
|
|
10
7
|
const examples = [
|
|
11
8
|
{
|
|
12
9
|
name: '1 channel at 2023.03.10 12:00:00 GMT',
|
|
13
10
|
parameters: {
|
|
14
|
-
|
|
11
|
+
startTime2000: 731764800,
|
|
15
12
|
hours: 1,
|
|
16
13
|
channelList: [
|
|
17
14
|
{
|
|
@@ -25,43 +22,12 @@ const examples = [
|
|
|
25
22
|
hex: { header: '1f 0a 0a', body: '2e 6a 0c 01 83 b9 f3 14 80 01' }
|
|
26
23
|
}
|
|
27
24
|
];
|
|
28
|
-
/**
|
|
29
|
-
* Uplink command.
|
|
30
|
-
*
|
|
31
|
-
* @example create command instance from command body hex dump
|
|
32
|
-
* ```js
|
|
33
|
-
* import ExAbsHourMC from 'jooby-codec/commands/uplink/ExAbsHourMC';
|
|
34
|
-
*
|
|
35
|
-
* const commandBody = new Uint8Array([
|
|
36
|
-
* 0x2e, 0x6a, 0x0c, 0x01, 0x82, 0xb9, 0xf3, 0x14, 0x80, 0x01
|
|
37
|
-
* ]);
|
|
38
|
-
* const command = ExAbsHourMC.fromBytes(commandBody);
|
|
39
|
-
*
|
|
40
|
-
* console.log(command.parameters);
|
|
41
|
-
* // output:
|
|
42
|
-
* {
|
|
43
|
-
* startTime: 731764800,
|
|
44
|
-
* hours: 1,
|
|
45
|
-
* channelList: [
|
|
46
|
-
* {
|
|
47
|
-
* pulseCoefficient: 100,
|
|
48
|
-
* index: 1,
|
|
49
|
-
* value: 342457,
|
|
50
|
-
* diff: [128]
|
|
51
|
-
* }
|
|
52
|
-
* ]
|
|
53
|
-
* }
|
|
54
|
-
* ```
|
|
55
|
-
*
|
|
56
|
-
* [Command format documentation](https://github.com/jooby-dev/jooby-docs/blob/main/docs/commands/uplink/ExAbsHourMC.md)
|
|
57
|
-
*/
|
|
58
25
|
class ExAbsHourMC extends Command {
|
|
59
26
|
constructor(parameters) {
|
|
60
27
|
super();
|
|
61
28
|
this.parameters = parameters;
|
|
62
29
|
this.parameters.channelList = this.parameters.channelList.sort((a, b) => a.index - b.index);
|
|
63
30
|
}
|
|
64
|
-
// data - only body (without header)
|
|
65
31
|
static fromBytes(data) {
|
|
66
32
|
const buffer = new CommandBinaryBuffer(data);
|
|
67
33
|
const date = buffer.getDate();
|
|
@@ -84,15 +50,14 @@ class ExAbsHourMC extends Command {
|
|
|
84
50
|
index: channelIndex
|
|
85
51
|
});
|
|
86
52
|
});
|
|
87
|
-
return new ExAbsHourMC({ channelList, hours: hourAmount,
|
|
53
|
+
return new ExAbsHourMC({ channelList, hours: hourAmount, startTime2000: getTime2000FromDate(date) });
|
|
88
54
|
}
|
|
89
|
-
// returns full message - header with body
|
|
90
55
|
toBytes() {
|
|
91
56
|
const buffer = new CommandBinaryBuffer(COMMAND_BODY_MAX_SIZE);
|
|
92
|
-
const { hours,
|
|
93
|
-
const date =
|
|
57
|
+
const { hours, startTime2000, channelList } = this.parameters;
|
|
58
|
+
const date = getDateFromTime2000(startTime2000);
|
|
94
59
|
const hour = date.getUTCHours();
|
|
95
|
-
buffer.setDate(
|
|
60
|
+
buffer.setDate(startTime2000);
|
|
96
61
|
buffer.setHours(hour, hours);
|
|
97
62
|
buffer.setChannels(channelList);
|
|
98
63
|
for (const { value, diff, pulseCoefficient } of channelList) {
|