jooby-codec 3.2.0 → 3.3.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/CommandBinaryBuffer.d.ts +4 -5
- package/dist/analog/CommandBinaryBuffer.js +59 -18
- package/dist/analog/CommandBinaryBuffer.js.map +1 -1
- package/dist/analog/commands/downlink/CorrectTime2000.js +1 -1
- package/dist/analog/commands/downlink/CorrectTime2000.js.map +1 -1
- package/dist/analog/commands/downlink/GetArchiveDays.js +1 -1
- package/dist/analog/commands/downlink/GetArchiveDays.js.map +1 -1
- package/dist/analog/commands/downlink/GetArchiveDaysMC.js +1 -1
- package/dist/analog/commands/downlink/GetArchiveDaysMC.js.map +1 -1
- package/dist/analog/commands/downlink/GetArchiveEvents.js +1 -1
- package/dist/analog/commands/downlink/GetArchiveEvents.js.map +1 -1
- package/dist/analog/commands/downlink/GetArchiveHours.js +1 -1
- package/dist/analog/commands/downlink/GetArchiveHours.js.map +1 -1
- package/dist/analog/commands/downlink/GetArchiveHoursMC.js +1 -1
- package/dist/analog/commands/downlink/GetArchiveHoursMC.js.map +1 -1
- package/dist/analog/commands/downlink/GetBatteryStatus.d.ts +11 -0
- package/dist/analog/commands/downlink/GetBatteryStatus.js +26 -0
- package/dist/analog/commands/downlink/GetBatteryStatus.js.map +1 -0
- package/dist/analog/commands/downlink/GetCurrent.js +1 -1
- package/dist/analog/commands/downlink/GetCurrent.js.map +1 -1
- package/dist/analog/commands/downlink/GetCurrentMC.js +1 -1
- package/dist/analog/commands/downlink/GetCurrentMC.js.map +1 -1
- package/dist/analog/commands/downlink/GetExAbsArchiveDaysMC.js +1 -1
- package/dist/analog/commands/downlink/GetExAbsArchiveDaysMC.js.map +1 -1
- package/dist/analog/commands/downlink/GetExAbsArchiveHoursMC.js +1 -1
- package/dist/analog/commands/downlink/GetExAbsArchiveHoursMC.js.map +1 -1
- package/dist/analog/commands/downlink/GetExAbsCurrentMC.js +1 -1
- package/dist/analog/commands/downlink/GetExAbsCurrentMC.js.map +1 -1
- package/dist/analog/commands/downlink/GetLmicInfo.js +1 -1
- package/dist/analog/commands/downlink/GetLmicInfo.js.map +1 -1
- package/dist/analog/commands/downlink/GetParameter.js +1 -1
- package/dist/analog/commands/downlink/GetParameter.js.map +1 -1
- package/dist/analog/commands/downlink/GetStatus.js +1 -1
- package/dist/analog/commands/downlink/GetStatus.js.map +1 -1
- package/dist/analog/commands/downlink/GetTime2000.d.ts +11 -0
- package/dist/analog/commands/downlink/GetTime2000.js +26 -0
- package/dist/analog/commands/downlink/GetTime2000.js.map +1 -0
- package/dist/analog/commands/downlink/SetParameter.js +1 -1
- package/dist/analog/commands/downlink/SetParameter.js.map +1 -1
- package/dist/analog/commands/downlink/SetTime2000.js +1 -1
- package/dist/analog/commands/downlink/SetTime2000.js.map +1 -1
- package/dist/analog/commands/downlink/SoftRestart.js +1 -1
- package/dist/analog/commands/downlink/SoftRestart.js.map +1 -1
- package/dist/analog/commands/downlink/UpdateRun.d.ts +10 -0
- package/dist/analog/commands/downlink/UpdateRun.js +23 -0
- package/dist/analog/commands/downlink/UpdateRun.js.map +1 -0
- package/dist/analog/commands/downlink/VerifyImage.d.ts +10 -0
- package/dist/analog/commands/downlink/VerifyImage.js +23 -0
- package/dist/analog/commands/downlink/VerifyImage.js.map +1 -0
- package/dist/analog/commands/downlink/WriteImage.d.ts +16 -0
- package/dist/analog/commands/downlink/WriteImage.js +45 -0
- package/dist/analog/commands/downlink/WriteImage.js.map +1 -0
- package/dist/analog/commands/downlink/index.d.ts +8 -3
- package/dist/analog/commands/downlink/index.js +8 -3
- package/dist/analog/commands/downlink/index.js.map +1 -1
- package/dist/analog/commands/uplink/CorrectTime2000Response.js +1 -1
- package/dist/analog/commands/uplink/CorrectTime2000Response.js.map +1 -1
- package/dist/analog/commands/uplink/Current.js +1 -1
- package/dist/analog/commands/uplink/Current.js.map +1 -1
- package/dist/analog/commands/uplink/CurrentMC.js +1 -1
- package/dist/analog/commands/uplink/CurrentMC.js.map +1 -1
- package/dist/analog/commands/uplink/Day.js +1 -1
- package/dist/analog/commands/uplink/Day.js.map +1 -1
- package/dist/analog/commands/uplink/DayMC.js +1 -1
- package/dist/analog/commands/uplink/DayMC.js.map +1 -1
- package/dist/analog/commands/uplink/ExAbsCurrentMC.js +1 -1
- package/dist/analog/commands/uplink/ExAbsCurrentMC.js.map +1 -1
- package/dist/analog/commands/uplink/ExAbsDayMC.js +1 -1
- package/dist/analog/commands/uplink/ExAbsDayMC.js.map +1 -1
- package/dist/analog/commands/uplink/ExAbsHourMC.js +4 -24
- package/dist/analog/commands/uplink/ExAbsHourMC.js.map +1 -1
- package/dist/analog/commands/uplink/GetArchiveDaysMCResponse.js +15 -1
- package/dist/analog/commands/uplink/GetArchiveDaysMCResponse.js.map +1 -1
- package/dist/analog/commands/uplink/GetArchiveDaysResponse.js +1 -1
- package/dist/analog/commands/uplink/GetArchiveDaysResponse.js.map +1 -1
- package/dist/analog/commands/uplink/GetArchiveEventsResponse.js +1 -1
- package/dist/analog/commands/uplink/GetArchiveEventsResponse.js.map +1 -1
- package/dist/analog/commands/uplink/GetArchiveHoursMCResponse.js +10 -1
- package/dist/analog/commands/uplink/GetArchiveHoursMCResponse.js.map +1 -1
- package/dist/analog/commands/uplink/GetArchiveHoursResponse.js +1 -1
- package/dist/analog/commands/uplink/GetArchiveHoursResponse.js.map +1 -1
- package/dist/analog/commands/uplink/GetBatteryStatusResponse.d.ts +21 -0
- package/dist/analog/commands/uplink/GetBatteryStatusResponse.js +57 -0
- package/dist/analog/commands/uplink/GetBatteryStatusResponse.js.map +1 -0
- package/dist/analog/commands/uplink/GetExAbsArchiveDaysMCResponse.d.ts +2 -2
- package/dist/analog/commands/uplink/GetExAbsArchiveDaysMCResponse.js +7 -3
- package/dist/analog/commands/uplink/GetExAbsArchiveDaysMCResponse.js.map +1 -1
- package/dist/analog/commands/uplink/GetExAbsArchiveHoursMCResponse.d.ts +2 -2
- package/dist/analog/commands/uplink/GetExAbsArchiveHoursMCResponse.js +12 -24
- package/dist/analog/commands/uplink/GetExAbsArchiveHoursMCResponse.js.map +1 -1
- package/dist/analog/commands/uplink/GetLmicInfoResponse.js +1 -1
- package/dist/analog/commands/uplink/GetLmicInfoResponse.js.map +1 -1
- package/dist/analog/commands/uplink/GetParameterResponse.js +1 -1
- package/dist/analog/commands/uplink/GetParameterResponse.js.map +1 -1
- package/dist/analog/commands/uplink/Hour.js +1 -1
- package/dist/analog/commands/uplink/Hour.js.map +1 -1
- package/dist/analog/commands/uplink/HourMC.js +1 -1
- package/dist/analog/commands/uplink/HourMC.js.map +1 -1
- package/dist/analog/commands/uplink/LastEvent.js +1 -1
- package/dist/analog/commands/uplink/LastEvent.js.map +1 -1
- package/dist/analog/commands/uplink/NewEvent.js +1 -1
- package/dist/analog/commands/uplink/NewEvent.js.map +1 -1
- package/dist/analog/commands/uplink/SetParameterResponse.js +1 -1
- package/dist/analog/commands/uplink/SetParameterResponse.js.map +1 -1
- package/dist/analog/commands/uplink/SetTime2000Response.js +1 -1
- package/dist/analog/commands/uplink/SetTime2000Response.js.map +1 -1
- package/dist/analog/commands/uplink/SoftRestartResponse.js +1 -1
- package/dist/analog/commands/uplink/SoftRestartResponse.js.map +1 -1
- package/dist/analog/commands/uplink/Status.js +2 -2
- package/dist/analog/commands/uplink/Status.js.map +1 -1
- package/dist/analog/commands/uplink/Time2000.js +1 -1
- package/dist/analog/commands/uplink/Time2000.js.map +1 -1
- package/dist/analog/commands/uplink/UpdateRunResponse.d.ts +10 -0
- package/dist/analog/commands/uplink/UpdateRunResponse.js +23 -0
- package/dist/analog/commands/uplink/UpdateRunResponse.js.map +1 -0
- package/dist/analog/commands/uplink/VerifyImageResponse.d.ts +15 -0
- package/dist/analog/commands/uplink/VerifyImageResponse.js +29 -0
- package/dist/analog/commands/uplink/VerifyImageResponse.js.map +1 -0
- package/dist/analog/commands/uplink/WriteImageResponse.d.ts +16 -0
- package/dist/analog/commands/uplink/WriteImageResponse.js +41 -0
- package/dist/analog/commands/uplink/WriteImageResponse.js.map +1 -0
- package/dist/analog/commands/uplink/index.d.ts +5 -1
- package/dist/analog/commands/uplink/index.js +5 -1
- package/dist/analog/commands/uplink/index.js.map +1 -1
- package/dist/analog/constants/commandRelations.d.ts +6 -0
- package/dist/analog/constants/commandRelations.js +31 -0
- package/dist/analog/constants/commandRelations.js.map +1 -0
- package/dist/analog/constants/index.d.ts +0 -1
- package/dist/analog/constants/index.js +0 -1
- package/dist/analog/constants/index.js.map +1 -1
- package/dist/analog/message.d.ts +0 -9
- package/dist/analog/message.js +6 -15
- package/dist/analog/message.js.map +1 -1
- package/dist/constants/directions.js.map +1 -0
- package/dist/constants/frameAttributes.js.map +1 -0
- package/dist/constants/index.d.ts +2 -0
- package/dist/constants/index.js +3 -0
- package/dist/constants/index.js.map +1 -0
- package/dist/mtx/CommandBinaryBuffer.d.ts +8 -3
- package/dist/mtx/CommandBinaryBuffer.js +132 -18
- package/dist/mtx/CommandBinaryBuffer.js.map +1 -1
- package/dist/mtx/commands/downlink/ActivateRatePlan.js +1 -1
- package/dist/mtx/commands/downlink/ActivateRatePlan.js.map +1 -1
- package/dist/mtx/commands/downlink/GetDateTime.js +1 -1
- package/dist/mtx/commands/downlink/GetDateTime.js.map +1 -1
- package/dist/mtx/commands/downlink/GetDayProfile.d.ts +19 -0
- package/dist/mtx/commands/downlink/GetDayProfile.js +48 -0
- package/dist/mtx/commands/downlink/GetDayProfile.js.map +1 -0
- package/dist/mtx/commands/downlink/GetDeviceId.js +1 -1
- package/dist/mtx/commands/downlink/GetDeviceId.js.map +1 -1
- package/dist/mtx/commands/downlink/GetDeviceType.d.ts +13 -0
- package/dist/mtx/commands/downlink/GetDeviceType.js +31 -0
- package/dist/mtx/commands/downlink/GetDeviceType.js.map +1 -0
- package/dist/mtx/commands/downlink/GetDisplayParam.js +1 -1
- package/dist/mtx/commands/downlink/GetDisplayParam.js.map +1 -1
- package/dist/mtx/commands/downlink/GetOpParams.js +1 -1
- package/dist/mtx/commands/downlink/GetOpParams.js.map +1 -1
- package/dist/mtx/commands/downlink/GetRatePlanInfo.js +1 -1
- package/dist/mtx/commands/downlink/GetRatePlanInfo.js.map +1 -1
- package/dist/mtx/commands/downlink/GetSeasonProfile.d.ts +19 -0
- package/dist/mtx/commands/downlink/GetSeasonProfile.js +48 -0
- package/dist/mtx/commands/downlink/GetSeasonProfile.js.map +1 -0
- package/dist/mtx/commands/downlink/GetSpecialDay.d.ts +19 -0
- package/dist/mtx/commands/downlink/GetSpecialDay.js +48 -0
- package/dist/mtx/commands/downlink/GetSpecialDay.js.map +1 -0
- package/dist/mtx/commands/downlink/PrepareRatePlan.js +1 -1
- package/dist/mtx/commands/downlink/PrepareRatePlan.js.map +1 -1
- package/dist/mtx/commands/downlink/RunTariffPlan.js +1 -1
- package/dist/mtx/commands/downlink/RunTariffPlan.js.map +1 -1
- package/dist/mtx/commands/downlink/SetAccessKey.d.ts +18 -0
- package/dist/mtx/commands/downlink/SetAccessKey.js +51 -0
- package/dist/mtx/commands/downlink/SetAccessKey.js.map +1 -0
- package/dist/mtx/commands/downlink/SetCorrectDateTime.d.ts +17 -0
- package/dist/mtx/commands/downlink/SetCorrectDateTime.js +51 -0
- package/dist/mtx/commands/downlink/SetCorrectDateTime.js.map +1 -0
- package/dist/mtx/commands/downlink/SetDateTime.d.ts +15 -0
- package/dist/mtx/commands/downlink/SetDateTime.js +48 -0
- package/dist/mtx/commands/downlink/SetDateTime.js.map +1 -0
- package/dist/mtx/commands/downlink/SetDayProfile.js +1 -1
- package/dist/mtx/commands/downlink/SetDayProfile.js.map +1 -1
- package/dist/mtx/commands/downlink/SetDisplayParam.js +1 -1
- package/dist/mtx/commands/downlink/SetDisplayParam.js.map +1 -1
- package/dist/mtx/commands/downlink/SetOpParams.js +1 -1
- package/dist/mtx/commands/downlink/SetOpParams.js.map +1 -1
- package/dist/mtx/commands/downlink/SetSeasonProfile.js +1 -1
- package/dist/mtx/commands/downlink/SetSeasonProfile.js.map +1 -1
- package/dist/mtx/commands/downlink/SetSpecialDay.js +2 -2
- package/dist/mtx/commands/downlink/SetSpecialDay.js.map +1 -1
- package/dist/mtx/commands/downlink/TurnRelayOff.js +1 -1
- package/dist/mtx/commands/downlink/TurnRelayOff.js.map +1 -1
- package/dist/mtx/commands/downlink/TurnRelayOn.js +1 -1
- package/dist/mtx/commands/downlink/TurnRelayOn.js.map +1 -1
- package/dist/mtx/commands/downlink/index.d.ts +7 -0
- package/dist/mtx/commands/downlink/index.js +7 -0
- package/dist/mtx/commands/downlink/index.js.map +1 -1
- package/dist/mtx/commands/uplink/ActivateRatePlanResponse.js +1 -1
- package/dist/mtx/commands/uplink/ActivateRatePlanResponse.js.map +1 -1
- package/dist/mtx/commands/uplink/ErrorResponse.js +1 -1
- package/dist/mtx/commands/uplink/ErrorResponse.js.map +1 -1
- package/dist/mtx/commands/uplink/GetDateTimeResponse.js +3 -3
- package/dist/mtx/commands/uplink/GetDateTimeResponse.js.map +1 -1
- package/dist/mtx/commands/uplink/GetDayProfileResponse.d.ts +18 -0
- package/dist/mtx/commands/uplink/GetDayProfileResponse.js +74 -0
- package/dist/mtx/commands/uplink/GetDayProfileResponse.js.map +1 -0
- package/dist/mtx/commands/uplink/GetDeviceIdResponse.js +1 -1
- package/dist/mtx/commands/uplink/GetDeviceIdResponse.js.map +1 -1
- package/dist/mtx/commands/uplink/GetDeviceTypeResponse.d.ts +15 -0
- package/dist/mtx/commands/uplink/GetDeviceTypeResponse.js +54 -0
- package/dist/mtx/commands/uplink/GetDeviceTypeResponse.js.map +1 -0
- package/dist/mtx/commands/uplink/GetDisplayParamResponse.js +1 -1
- package/dist/mtx/commands/uplink/GetDisplayParamResponse.js.map +1 -1
- package/dist/mtx/commands/uplink/GetOpParamsResponse.js +1 -1
- package/dist/mtx/commands/uplink/GetOpParamsResponse.js.map +1 -1
- package/dist/mtx/commands/uplink/GetRatePlanInfoResponse.js +1 -1
- package/dist/mtx/commands/uplink/GetRatePlanInfoResponse.js.map +1 -1
- package/dist/mtx/commands/uplink/GetSeasonProfileResponse.d.ts +15 -0
- package/dist/mtx/commands/uplink/GetSeasonProfileResponse.js +44 -0
- package/dist/mtx/commands/uplink/GetSeasonProfileResponse.js.map +1 -0
- package/dist/mtx/commands/uplink/GetSpecialDayResponse.d.ts +15 -0
- package/dist/mtx/commands/uplink/GetSpecialDayResponse.js +45 -0
- package/dist/mtx/commands/uplink/GetSpecialDayResponse.js.map +1 -0
- package/dist/mtx/commands/uplink/PrepareRatePlanResponse.js +1 -1
- package/dist/mtx/commands/uplink/PrepareRatePlanResponse.js.map +1 -1
- package/dist/mtx/commands/uplink/RunTariffPlanResponse.js +1 -1
- package/dist/mtx/commands/uplink/RunTariffPlanResponse.js.map +1 -1
- package/dist/mtx/commands/uplink/SetAccessKeyResponse.d.ts +13 -0
- package/dist/mtx/commands/uplink/SetAccessKeyResponse.js +31 -0
- package/dist/mtx/commands/uplink/SetAccessKeyResponse.js.map +1 -0
- package/dist/mtx/commands/uplink/SetCorrectDateTimeResponse.d.ts +13 -0
- package/dist/mtx/commands/uplink/SetCorrectDateTimeResponse.js +31 -0
- package/dist/mtx/commands/uplink/SetCorrectDateTimeResponse.js.map +1 -0
- package/dist/mtx/commands/uplink/SetDateTimeResponse.d.ts +13 -0
- package/dist/mtx/commands/uplink/SetDateTimeResponse.js +31 -0
- package/dist/mtx/commands/uplink/SetDateTimeResponse.js.map +1 -0
- package/dist/mtx/commands/uplink/SetDayProfileResponse.js +1 -1
- package/dist/mtx/commands/uplink/SetDayProfileResponse.js.map +1 -1
- package/dist/mtx/commands/uplink/SetDisplayParamResponse.js +1 -1
- package/dist/mtx/commands/uplink/SetDisplayParamResponse.js.map +1 -1
- package/dist/mtx/commands/uplink/SetOpParamsResponse.js +1 -1
- package/dist/mtx/commands/uplink/SetOpParamsResponse.js.map +1 -1
- package/dist/mtx/commands/uplink/SetSeasonProfileResponse.js +1 -1
- package/dist/mtx/commands/uplink/SetSeasonProfileResponse.js.map +1 -1
- package/dist/mtx/commands/uplink/SetSpecialDayResponse.js +1 -1
- package/dist/mtx/commands/uplink/SetSpecialDayResponse.js.map +1 -1
- package/dist/mtx/commands/uplink/TurnRelayOffResponse.js +1 -1
- package/dist/mtx/commands/uplink/TurnRelayOffResponse.js.map +1 -1
- package/dist/mtx/commands/uplink/TurnRelayOnResponse.js +1 -1
- package/dist/mtx/commands/uplink/TurnRelayOnResponse.js.map +1 -1
- package/dist/mtx/commands/uplink/index.d.ts +7 -0
- package/dist/mtx/commands/uplink/index.js +7 -0
- package/dist/mtx/commands/uplink/index.js.map +1 -1
- package/dist/mtx/constants/commandRelations.d.ts +4 -2
- package/dist/mtx/constants/commandRelations.js +3 -4
- package/dist/mtx/constants/commandRelations.js.map +1 -1
- package/dist/mtx/constants/index.d.ts +1 -2
- package/dist/mtx/constants/index.js +1 -2
- package/dist/mtx/constants/index.js.map +1 -1
- package/dist/mtx/constants/meterTypes.d.ts +3 -0
- package/dist/mtx/constants/meterTypes.js +4 -0
- package/dist/mtx/constants/meterTypes.js.map +1 -0
- package/dist/mtx/constants/resultCodes.js +5 -5
- package/dist/mtx/constants/resultCodes.js.map +1 -1
- package/dist/mtx/message.d.ts +0 -8
- package/dist/mtx/message.js +8 -10
- package/dist/mtx/message.js.map +1 -1
- package/dist/mtx/utils/crypto.d.ts +0 -2
- package/dist/mtx/utils/crypto.js +2 -17
- package/dist/mtx/utils/crypto.js.map +1 -1
- package/dist/obis-observer/commands/downlink/GetArchiveState.js +1 -1
- package/dist/obis-observer/commands/downlink/GetArchiveState.js.map +1 -1
- package/dist/obis-observer/commands/downlink/GetLorawanInfo.js +1 -1
- package/dist/obis-observer/commands/downlink/GetLorawanInfo.js.map +1 -1
- package/dist/obis-observer/commands/downlink/GetLorawanState.js +1 -1
- package/dist/obis-observer/commands/downlink/GetLorawanState.js.map +1 -1
- package/dist/obis-observer/commands/downlink/GetMeterDate.js +1 -1
- package/dist/obis-observer/commands/downlink/GetMeterDate.js.map +1 -1
- package/dist/obis-observer/commands/downlink/GetMeterId.js +1 -1
- package/dist/obis-observer/commands/downlink/GetMeterId.js.map +1 -1
- package/dist/obis-observer/commands/downlink/GetMeterIdList.js +1 -1
- package/dist/obis-observer/commands/downlink/GetMeterIdList.js.map +1 -1
- package/dist/obis-observer/commands/downlink/GetMeterInfo.js +1 -1
- package/dist/obis-observer/commands/downlink/GetMeterInfo.js.map +1 -1
- package/dist/obis-observer/commands/downlink/GetMeterProfile.js +1 -1
- package/dist/obis-observer/commands/downlink/GetMeterProfile.js.map +1 -1
- package/dist/obis-observer/commands/downlink/GetMeterProfileIdList.js +1 -1
- package/dist/obis-observer/commands/downlink/GetMeterProfileIdList.js.map +1 -1
- package/dist/obis-observer/commands/downlink/GetMeterReadoutState.js +1 -1
- package/dist/obis-observer/commands/downlink/GetMeterReadoutState.js.map +1 -1
- package/dist/obis-observer/commands/downlink/GetObisContent.js +1 -1
- package/dist/obis-observer/commands/downlink/GetObisContent.js.map +1 -1
- package/dist/obis-observer/commands/downlink/GetObisContentById.js +1 -1
- package/dist/obis-observer/commands/downlink/GetObisContentById.js.map +1 -1
- package/dist/obis-observer/commands/downlink/GetObisIdList.js +1 -1
- package/dist/obis-observer/commands/downlink/GetObisIdList.js.map +1 -1
- package/dist/obis-observer/commands/downlink/GetObisInfo.js +1 -1
- package/dist/obis-observer/commands/downlink/GetObisInfo.js.map +1 -1
- package/dist/obis-observer/commands/downlink/GetObserverCapabilities.js +1 -1
- package/dist/obis-observer/commands/downlink/GetObserverCapabilities.js.map +1 -1
- package/dist/obis-observer/commands/downlink/GetObserverInfo.js +1 -1
- package/dist/obis-observer/commands/downlink/GetObserverInfo.js.map +1 -1
- package/dist/obis-observer/commands/downlink/GetObserverSingleMode.js +1 -1
- package/dist/obis-observer/commands/downlink/GetObserverSingleMode.js.map +1 -1
- package/dist/obis-observer/commands/downlink/GetObserverUptime.js +1 -1
- package/dist/obis-observer/commands/downlink/GetObserverUptime.js.map +1 -1
- package/dist/obis-observer/commands/downlink/ReadArchive.js +1 -1
- package/dist/obis-observer/commands/downlink/ReadArchive.js.map +1 -1
- package/dist/obis-observer/commands/downlink/ReadMeterArchive.js +1 -1
- package/dist/obis-observer/commands/downlink/ReadMeterArchive.js.map +1 -1
- package/dist/obis-observer/commands/downlink/ReadMeterArchiveWithDate.js +1 -1
- package/dist/obis-observer/commands/downlink/ReadMeterArchiveWithDate.js.map +1 -1
- package/dist/obis-observer/commands/downlink/Reboot.js +1 -1
- package/dist/obis-observer/commands/downlink/Reboot.js.map +1 -1
- package/dist/obis-observer/commands/downlink/RemoveMeter.js +1 -1
- package/dist/obis-observer/commands/downlink/RemoveMeter.js.map +1 -1
- package/dist/obis-observer/commands/downlink/RemoveMeterProfile.js +1 -1
- package/dist/obis-observer/commands/downlink/RemoveMeterProfile.js.map +1 -1
- package/dist/obis-observer/commands/downlink/RemoveObis.js +1 -1
- package/dist/obis-observer/commands/downlink/RemoveObis.js.map +1 -1
- package/dist/obis-observer/commands/downlink/SetLorawanActivationMethod.js +1 -1
- package/dist/obis-observer/commands/downlink/SetLorawanActivationMethod.js.map +1 -1
- package/dist/obis-observer/commands/downlink/SetObserverSingleMode.js +1 -1
- package/dist/obis-observer/commands/downlink/SetObserverSingleMode.js.map +1 -1
- package/dist/obis-observer/commands/downlink/SetSerialPort.js +1 -1
- package/dist/obis-observer/commands/downlink/SetSerialPort.js.map +1 -1
- package/dist/obis-observer/commands/downlink/SetupMeter.js +1 -1
- package/dist/obis-observer/commands/downlink/SetupMeter.js.map +1 -1
- package/dist/obis-observer/commands/downlink/SetupMeterProfile.js +1 -1
- package/dist/obis-observer/commands/downlink/SetupMeterProfile.js.map +1 -1
- package/dist/obis-observer/commands/downlink/SetupObis.js +1 -1
- package/dist/obis-observer/commands/downlink/SetupObis.js.map +1 -1
- package/dist/obis-observer/commands/downlink/UpdateImageVerify.js +1 -1
- package/dist/obis-observer/commands/downlink/UpdateImageVerify.js.map +1 -1
- package/dist/obis-observer/commands/downlink/UpdateImageWrite.js +1 -1
- package/dist/obis-observer/commands/downlink/UpdateImageWrite.js.map +1 -1
- package/dist/obis-observer/commands/downlink/UpdateRun.js +1 -1
- package/dist/obis-observer/commands/downlink/UpdateRun.js.map +1 -1
- package/dist/obis-observer/commands/uplink/ErrorResponse.js +1 -1
- package/dist/obis-observer/commands/uplink/ErrorResponse.js.map +1 -1
- package/dist/obis-observer/commands/uplink/GetArchiveStateResponse.js +1 -1
- package/dist/obis-observer/commands/uplink/GetArchiveStateResponse.js.map +1 -1
- package/dist/obis-observer/commands/uplink/GetLorawanInfoResponse.js +1 -1
- package/dist/obis-observer/commands/uplink/GetLorawanInfoResponse.js.map +1 -1
- package/dist/obis-observer/commands/uplink/GetLorawanStateResponse.js +1 -1
- package/dist/obis-observer/commands/uplink/GetLorawanStateResponse.js.map +1 -1
- package/dist/obis-observer/commands/uplink/GetMeterDateResponse.js +1 -1
- package/dist/obis-observer/commands/uplink/GetMeterDateResponse.js.map +1 -1
- package/dist/obis-observer/commands/uplink/GetMeterIdListResponse.js +1 -1
- package/dist/obis-observer/commands/uplink/GetMeterIdListResponse.js.map +1 -1
- package/dist/obis-observer/commands/uplink/GetMeterIdResponse.js +1 -1
- package/dist/obis-observer/commands/uplink/GetMeterIdResponse.js.map +1 -1
- package/dist/obis-observer/commands/uplink/GetMeterInfoResponse.js +1 -1
- package/dist/obis-observer/commands/uplink/GetMeterInfoResponse.js.map +1 -1
- package/dist/obis-observer/commands/uplink/GetMeterProfileIdListResponse.js +1 -1
- package/dist/obis-observer/commands/uplink/GetMeterProfileIdListResponse.js.map +1 -1
- package/dist/obis-observer/commands/uplink/GetMeterProfileResponse.js +1 -1
- package/dist/obis-observer/commands/uplink/GetMeterProfileResponse.js.map +1 -1
- package/dist/obis-observer/commands/uplink/GetMeterReadoutStateResponse.js +1 -1
- package/dist/obis-observer/commands/uplink/GetMeterReadoutStateResponse.js.map +1 -1
- package/dist/obis-observer/commands/uplink/GetObisContentByIdResponse.js +1 -1
- package/dist/obis-observer/commands/uplink/GetObisContentByIdResponse.js.map +1 -1
- package/dist/obis-observer/commands/uplink/GetObisContentByIdStringResponse.js +1 -1
- package/dist/obis-observer/commands/uplink/GetObisContentByIdStringResponse.js.map +1 -1
- package/dist/obis-observer/commands/uplink/GetObisContentResponse.js +1 -1
- package/dist/obis-observer/commands/uplink/GetObisContentResponse.js.map +1 -1
- package/dist/obis-observer/commands/uplink/GetObisIdListResponse.js +1 -1
- package/dist/obis-observer/commands/uplink/GetObisIdListResponse.js.map +1 -1
- package/dist/obis-observer/commands/uplink/GetObisInfoResponse.js +1 -1
- package/dist/obis-observer/commands/uplink/GetObisInfoResponse.js.map +1 -1
- package/dist/obis-observer/commands/uplink/GetObserverCapabilitiesResponse.js +1 -1
- package/dist/obis-observer/commands/uplink/GetObserverCapabilitiesResponse.js.map +1 -1
- package/dist/obis-observer/commands/uplink/GetObserverInfoResponse.js +1 -1
- package/dist/obis-observer/commands/uplink/GetObserverInfoResponse.js.map +1 -1
- package/dist/obis-observer/commands/uplink/GetObserverSingleModeResponse.js +1 -1
- package/dist/obis-observer/commands/uplink/GetObserverSingleModeResponse.js.map +1 -1
- package/dist/obis-observer/commands/uplink/GetObserverUptimeResponse.js +1 -1
- package/dist/obis-observer/commands/uplink/GetObserverUptimeResponse.js.map +1 -1
- package/dist/obis-observer/commands/uplink/ObservationReport.js +1 -1
- package/dist/obis-observer/commands/uplink/ObservationReport.js.map +1 -1
- package/dist/obis-observer/commands/uplink/ObservationReportString.js +1 -1
- package/dist/obis-observer/commands/uplink/ObservationReportString.js.map +1 -1
- package/dist/obis-observer/commands/uplink/ReadArchiveResponse.js +1 -1
- package/dist/obis-observer/commands/uplink/ReadArchiveResponse.js.map +1 -1
- package/dist/obis-observer/commands/uplink/ReadMeterArchiveResponse.js +1 -1
- package/dist/obis-observer/commands/uplink/ReadMeterArchiveResponse.js.map +1 -1
- package/dist/obis-observer/commands/uplink/ReadMeterArchiveWithDateResponse.js +1 -1
- package/dist/obis-observer/commands/uplink/ReadMeterArchiveWithDateResponse.js.map +1 -1
- package/dist/obis-observer/commands/uplink/RebootResponse.js +1 -1
- package/dist/obis-observer/commands/uplink/RebootResponse.js.map +1 -1
- package/dist/obis-observer/commands/uplink/RemoveMeterProfileResponse.js +1 -1
- package/dist/obis-observer/commands/uplink/RemoveMeterProfileResponse.js.map +1 -1
- package/dist/obis-observer/commands/uplink/RemoveMeterResponse.js +1 -1
- package/dist/obis-observer/commands/uplink/RemoveMeterResponse.js.map +1 -1
- package/dist/obis-observer/commands/uplink/RemoveObisResponse.js +1 -1
- package/dist/obis-observer/commands/uplink/RemoveObisResponse.js.map +1 -1
- package/dist/obis-observer/commands/uplink/SetLorawanActivationMethodResponse.js +1 -1
- package/dist/obis-observer/commands/uplink/SetLorawanActivationMethodResponse.js.map +1 -1
- package/dist/obis-observer/commands/uplink/SetObserverSingleModeResponse.js +1 -1
- package/dist/obis-observer/commands/uplink/SetObserverSingleModeResponse.js.map +1 -1
- package/dist/obis-observer/commands/uplink/SetSerialPortResponse.js +1 -1
- package/dist/obis-observer/commands/uplink/SetSerialPortResponse.js.map +1 -1
- package/dist/obis-observer/commands/uplink/SetupMeterProfileResponse.js +1 -1
- package/dist/obis-observer/commands/uplink/SetupMeterProfileResponse.js.map +1 -1
- package/dist/obis-observer/commands/uplink/SetupMeterResponse.js +1 -1
- package/dist/obis-observer/commands/uplink/SetupMeterResponse.js.map +1 -1
- package/dist/obis-observer/commands/uplink/SetupObisResponse.js +1 -1
- package/dist/obis-observer/commands/uplink/SetupObisResponse.js.map +1 -1
- package/dist/obis-observer/commands/uplink/UpdateImageVerifyResponse.js +1 -1
- package/dist/obis-observer/commands/uplink/UpdateImageVerifyResponse.js.map +1 -1
- package/dist/obis-observer/commands/uplink/UpdateImageWriteResponse.js +1 -1
- package/dist/obis-observer/commands/uplink/UpdateImageWriteResponse.js.map +1 -1
- package/dist/obis-observer/commands/uplink/UpdateRunResponse.js +1 -1
- package/dist/obis-observer/commands/uplink/UpdateRunResponse.js.map +1 -1
- package/dist/obis-observer/constants/commandRelations.d.ts +4 -2
- package/dist/obis-observer/constants/commandRelations.js +2 -4
- package/dist/obis-observer/constants/commandRelations.js.map +1 -1
- package/dist/obis-observer/constants/index.d.ts +0 -1
- package/dist/obis-observer/constants/index.js +0 -1
- package/dist/obis-observer/constants/index.js.map +1 -1
- package/dist/obis-observer/message.d.ts +0 -8
- package/dist/obis-observer/message.js +2 -5
- package/dist/obis-observer/message.js.map +1 -1
- package/dist/utils/BinaryBuffer.d.ts +2 -0
- package/dist/utils/BinaryBuffer.js +12 -1
- package/dist/utils/BinaryBuffer.js.map +1 -1
- package/dist/utils/calculateCrc16.d.ts +6 -0
- package/dist/utils/calculateCrc16.js +22 -0
- package/dist/utils/calculateCrc16.js.map +1 -0
- package/dist/utils/calculateCrc32.d.ts +5 -0
- package/dist/utils/calculateCrc32.js +28 -0
- package/dist/utils/calculateCrc32.js.map +1 -0
- package/dist/utils/calculateLrc.d.ts +2 -0
- package/dist/utils/calculateLrc.js +8 -0
- package/dist/utils/calculateLrc.js.map +1 -0
- package/dist/utils/frame.d.ts +14 -0
- package/dist/utils/frame.js +85 -0
- package/dist/utils/frame.js.map +1 -0
- package/dist/utils/frameCollector.d.ts +12 -0
- package/dist/utils/frameCollector.js +43 -0
- package/dist/utils/frameCollector.js.map +1 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.js +1 -0
- package/dist/utils/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/analog/constants/directions.js.map +0 -1
- package/dist/mtx/constants/directions.d.ts +0 -3
- package/dist/mtx/constants/directions.js +0 -4
- package/dist/mtx/constants/directions.js.map +0 -1
- package/dist/mtx/constants/frameAttributes.js.map +0 -1
- package/dist/obis-observer/constants/directions.d.ts +0 -2
- package/dist/obis-observer/constants/directions.js +0 -3
- package/dist/obis-observer/constants/directions.js.map +0 -1
- /package/dist/{analog/constants → constants}/directions.d.ts +0 -0
- /package/dist/{analog/constants → constants}/directions.js +0 -0
- /package/dist/{mtx/constants → constants}/frameAttributes.d.ts +0 -0
- /package/dist/{mtx/constants → constants}/frameAttributes.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Time2000.js","sourceRoot":"","sources":["../../../../src/analog/commands/uplink/Time2000.ts"],"names":[],"mappings":"AAAA,OAAO,OAA8B,MAAM,kBAAkB,CAAC;AAC9D,OAAO,mBAAmB,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAAC,MAAM,EAAC,MAAM
|
|
1
|
+
{"version":3,"file":"Time2000.js","sourceRoot":"","sources":["../../../../src/analog/commands/uplink/Time2000.ts"],"names":[],"mappings":"AAAA,OAAO,OAA8B,MAAM,kBAAkB,CAAC;AAC9D,OAAO,mBAAmB,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAAC,MAAM,EAAC,MAAM,kCAAkC,CAAC;AAcxD,MAAM,UAAU,GAAG,IAAI,CAAC;AACxB,MAAM,iBAAiB,GAAG,CAAC,CAAC;AAE5B,MAAM,QAAQ,GAAwB;IAClC;QACI,IAAI,EAAE,iCAAiC;QACvC,UAAU,EAAE,EAAC,cAAc,EAAE,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAC;QACrD,GAAG,EAAE,EAAC,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,gBAAgB,EAAC;KACjD;CACJ,CAAC;AAqBF,MAAM,QAAS,SAAQ,OAAO;IAC1B,YAAqB,UAA+B;QAChD,KAAK,EAAE,CAAC;QADS,eAAU,GAAV,UAAU,CAAqB;IAEpD,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,mBAAmB,CAAC,IAAI,CAAC,CAAC;QAC7C,MAAM,UAAU,GAAG;YACf,cAAc,EAAE,MAAM,CAAC,QAAQ,EAAE;YACjC,QAAQ,EAAE,MAAM,CAAC,OAAO,EAAE;SAC7B,CAAC;QAEF,IAAK,CAAC,MAAM,CAAC,OAAO,EAAG;YACnB,MAAM,IAAI,KAAK,CAAC,4BAA4B,CAAC,CAAC;SACjD;QAED,OAAO,IAAI,QAAQ,CAAC,UAAU,CAAC,CAAC;IACpC,CAAC;IAGD,OAAO;QACH,MAAM,EAAC,cAAc,EAAE,QAAQ,EAAC,GAAG,IAAI,CAAC,UAAU,CAAC;QACnD,MAAM,MAAM,GAAG,IAAI,mBAAmB,CAAC,iBAAiB,CAAC,CAAC;QAE1D,MAAM,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAC;QAChC,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;QAEzB,OAAO,OAAO,CAAC,OAAO,CAAC,UAAU,EAAE,MAAM,CAAC,YAAY,EAAE,CAAC,CAAC;IAC9D,CAAC;;AArCe,WAAE,GAAG,UAAU,CAAC;AAEhB,sBAAa,GAAG,MAAM,CAAC;AAEvB,iBAAQ,GAAG,QAAQ,CAAC;AAEpB,sBAAa,GAAG,IAAI,CAAC;AAmCzC,eAAe,QAAQ,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import Command, { TCommandExampleList } from '../../Command.js';
|
|
2
|
+
declare class UpdateRunResponse extends Command {
|
|
3
|
+
static readonly id = 11295;
|
|
4
|
+
static readonly directionType = 1;
|
|
5
|
+
static readonly examples: TCommandExampleList;
|
|
6
|
+
static readonly hasParameters = false;
|
|
7
|
+
static fromBytes(): UpdateRunResponse;
|
|
8
|
+
toBytes(): Uint8Array;
|
|
9
|
+
}
|
|
10
|
+
export default UpdateRunResponse;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import Command from '../../Command.js';
|
|
2
|
+
import { DOWNLINK } from '../../../constants/directions.js';
|
|
3
|
+
const COMMAND_ID = 0x2c1f;
|
|
4
|
+
const examples = [
|
|
5
|
+
{
|
|
6
|
+
name: 'simple request',
|
|
7
|
+
hex: { header: '1f 2c 00', body: '' }
|
|
8
|
+
}
|
|
9
|
+
];
|
|
10
|
+
class UpdateRunResponse extends Command {
|
|
11
|
+
static fromBytes() {
|
|
12
|
+
return new UpdateRunResponse();
|
|
13
|
+
}
|
|
14
|
+
toBytes() {
|
|
15
|
+
return Command.toBytes(COMMAND_ID);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
UpdateRunResponse.id = COMMAND_ID;
|
|
19
|
+
UpdateRunResponse.directionType = DOWNLINK;
|
|
20
|
+
UpdateRunResponse.examples = examples;
|
|
21
|
+
UpdateRunResponse.hasParameters = false;
|
|
22
|
+
export default UpdateRunResponse;
|
|
23
|
+
//# sourceMappingURL=UpdateRunResponse.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UpdateRunResponse.js","sourceRoot":"","sources":["../../../../src/analog/commands/uplink/UpdateRunResponse.ts"],"names":[],"mappings":"AAAA,OAAO,OAA8B,MAAM,kBAAkB,CAAC;AAC9D,OAAO,EAAC,QAAQ,EAAC,MAAM,kCAAkC,CAAC;AAG1D,MAAM,UAAU,GAAG,MAAM,CAAC;AAE1B,MAAM,QAAQ,GAAwB;IAClC;QACI,IAAI,EAAE,gBAAgB;QACtB,GAAG,EAAE,EAAC,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE,EAAE,EAAC;KACtC;CACJ,CAAC;AAsBF,MAAM,iBAAkB,SAAQ,OAAO;IAWnC,MAAM,CAAC,SAAS;QACZ,OAAO,IAAI,iBAAiB,EAAE,CAAC;IACnC,CAAC;IAID,OAAO;QACH,OAAO,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;IACvC,CAAC;;AAlBe,oBAAE,GAAG,UAAU,CAAC;AAEhB,+BAAa,GAAG,QAAQ,CAAC;AAEzB,0BAAQ,GAAG,QAAQ,CAAC;AAEpB,+BAAa,GAAG,KAAK,CAAC;AAgB1C,eAAe,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import Command, { TCommandExampleList } from '../../Command.js';
|
|
2
|
+
interface IVerifyImageParameters {
|
|
3
|
+
status: number;
|
|
4
|
+
}
|
|
5
|
+
declare class VerifyImageResponse extends Command {
|
|
6
|
+
parameters: IVerifyImageParameters;
|
|
7
|
+
constructor(parameters: IVerifyImageParameters);
|
|
8
|
+
static readonly id = 11039;
|
|
9
|
+
static readonly directionType = 1;
|
|
10
|
+
static readonly examples: TCommandExampleList;
|
|
11
|
+
static readonly hasParameters = true;
|
|
12
|
+
static fromBytes([status]: Uint8Array): VerifyImageResponse;
|
|
13
|
+
toBytes(): Uint8Array;
|
|
14
|
+
}
|
|
15
|
+
export default VerifyImageResponse;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import Command from '../../Command.js';
|
|
2
|
+
import { DOWNLINK } from '../../../constants/directions.js';
|
|
3
|
+
const COMMAND_ID = 0x2b1f;
|
|
4
|
+
const examples = [
|
|
5
|
+
{
|
|
6
|
+
name: 'Verify image response',
|
|
7
|
+
parameters: { status: 1 },
|
|
8
|
+
hex: { header: '1f 2b 01', body: '01' }
|
|
9
|
+
}
|
|
10
|
+
];
|
|
11
|
+
class VerifyImageResponse extends Command {
|
|
12
|
+
constructor(parameters) {
|
|
13
|
+
super();
|
|
14
|
+
this.parameters = parameters;
|
|
15
|
+
}
|
|
16
|
+
static fromBytes([status]) {
|
|
17
|
+
return new VerifyImageResponse({ status });
|
|
18
|
+
}
|
|
19
|
+
toBytes() {
|
|
20
|
+
const { parameters } = this;
|
|
21
|
+
return Command.toBytes(COMMAND_ID, new Uint8Array([parameters.status]));
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
VerifyImageResponse.id = COMMAND_ID;
|
|
25
|
+
VerifyImageResponse.directionType = DOWNLINK;
|
|
26
|
+
VerifyImageResponse.examples = examples;
|
|
27
|
+
VerifyImageResponse.hasParameters = true;
|
|
28
|
+
export default VerifyImageResponse;
|
|
29
|
+
//# sourceMappingURL=VerifyImageResponse.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VerifyImageResponse.js","sourceRoot":"","sources":["../../../../src/analog/commands/uplink/VerifyImageResponse.ts"],"names":[],"mappings":"AAAA,OAAO,OAA8B,MAAM,kBAAkB,CAAC;AAC9D,OAAO,EAAC,QAAQ,EAAC,MAAM,kCAAkC,CAAC;AAY1D,MAAM,UAAU,GAAG,MAAM,CAAC;AAE1B,MAAM,QAAQ,GAAwB;IAClC;QACI,IAAI,EAAE,uBAAuB;QAC7B,UAAU,EAAE,EAAC,MAAM,EAAE,CAAC,EAAC;QACvB,GAAG,EAAE,EAAC,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE,IAAI,EAAC;KACxC;CACJ,CAAC;AAwBF,MAAM,mBAAoB,SAAQ,OAAO;IACrC,YAAqB,UAAkC;QACnD,KAAK,EAAE,CAAC;QADS,eAAU,GAAV,UAAU,CAAwB;IAEvD,CAAC;IAaD,MAAM,CAAC,SAAS,CAAG,CAAC,MAAM,CAAa;QACnC,OAAO,IAAI,mBAAmB,CAAC,EAAC,MAAM,EAAC,CAAC,CAAC;IAC7C,CAAC;IAGD,OAAO;QACH,MAAM,EAAC,UAAU,EAAC,GAAG,IAAI,CAAC;QAE1B,OAAO,OAAO,CAAC,OAAO,CAClB,UAAU,EACV,IAAI,UAAU,CAAC,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CACtC,CAAC;IACN,CAAC;;AAtBe,sBAAE,GAAG,UAAU,CAAC;AAEhB,iCAAa,GAAG,QAAQ,CAAC;AAEzB,4BAAQ,GAAG,QAAQ,CAAC;AAEpB,iCAAa,GAAG,IAAI,CAAC;AAoBzC,eAAe,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import Command, { TCommandExampleList } from '../../Command.js';
|
|
2
|
+
interface IWriteImageParameters {
|
|
3
|
+
offset: number;
|
|
4
|
+
status: number;
|
|
5
|
+
}
|
|
6
|
+
declare class WriteImageResponse extends Command {
|
|
7
|
+
parameters: IWriteImageParameters;
|
|
8
|
+
constructor(parameters: IWriteImageParameters);
|
|
9
|
+
static readonly id = 10783;
|
|
10
|
+
static readonly directionType = 2;
|
|
11
|
+
static readonly examples: TCommandExampleList;
|
|
12
|
+
static readonly hasParameters = true;
|
|
13
|
+
static fromBytes(data: Uint8Array): WriteImageResponse;
|
|
14
|
+
toBytes(): Uint8Array;
|
|
15
|
+
}
|
|
16
|
+
export default WriteImageResponse;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import Command from '../../Command.js';
|
|
2
|
+
import CommandBinaryBuffer from '../../CommandBinaryBuffer.js';
|
|
3
|
+
import { UPLINK } from '../../../constants/directions.js';
|
|
4
|
+
const COMMAND_ID = 0x2a1f;
|
|
5
|
+
const COMMAND_SIZE = 5;
|
|
6
|
+
const examples = [
|
|
7
|
+
{
|
|
8
|
+
name: 'write image',
|
|
9
|
+
parameters: {
|
|
10
|
+
offset: 4,
|
|
11
|
+
status: 1
|
|
12
|
+
},
|
|
13
|
+
hex: { header: '1f 2A 05', body: '00 00 00 04 01' }
|
|
14
|
+
}
|
|
15
|
+
];
|
|
16
|
+
class WriteImageResponse extends Command {
|
|
17
|
+
constructor(parameters) {
|
|
18
|
+
super();
|
|
19
|
+
this.parameters = parameters;
|
|
20
|
+
}
|
|
21
|
+
static fromBytes(data) {
|
|
22
|
+
const buffer = new CommandBinaryBuffer(data);
|
|
23
|
+
return new WriteImageResponse({
|
|
24
|
+
offset: buffer.getUint32(false),
|
|
25
|
+
status: buffer.getUint8()
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
toBytes() {
|
|
29
|
+
const buffer = new CommandBinaryBuffer(COMMAND_SIZE);
|
|
30
|
+
const { offset, status } = this.parameters;
|
|
31
|
+
buffer.setUint32(offset, false);
|
|
32
|
+
buffer.setUint8(status);
|
|
33
|
+
return Command.toBytes(COMMAND_ID, buffer.toUint8Array());
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
WriteImageResponse.id = COMMAND_ID;
|
|
37
|
+
WriteImageResponse.directionType = UPLINK;
|
|
38
|
+
WriteImageResponse.examples = examples;
|
|
39
|
+
WriteImageResponse.hasParameters = true;
|
|
40
|
+
export default WriteImageResponse;
|
|
41
|
+
//# sourceMappingURL=WriteImageResponse.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WriteImageResponse.js","sourceRoot":"","sources":["../../../../src/analog/commands/uplink/WriteImageResponse.ts"],"names":[],"mappings":"AAAA,OAAO,OAA8B,MAAM,kBAAkB,CAAC;AAC9D,OAAO,mBAAmB,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAAC,MAAM,EAAC,MAAM,kCAAkC,CAAC;AAYxD,MAAM,UAAU,GAAG,MAAM,CAAC;AAC1B,MAAM,YAAY,GAAG,CAAC,CAAC;AAEvB,MAAM,QAAQ,GAAwB;IAClC;QACI,IAAI,EAAE,aAAa;QACnB,UAAU,EAAE;YACR,MAAM,EAAE,CAAC;YACT,MAAM,EAAE,CAAC;SACZ;QACD,GAAG,EAAE,EAAC,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE,gBAAgB,EAAC;KACpD;CACJ,CAAC;AAyBF,MAAM,kBAAmB,SAAQ,OAAO;IACpC,YAAqB,UAAiC;QAClD,KAAK,EAAE,CAAC;QADS,eAAU,GAAV,UAAU,CAAuB;IAEtD,CAAC;IAaD,MAAM,CAAC,SAAS,CAAG,IAAgB;QAC/B,MAAM,MAAM,GAAG,IAAI,mBAAmB,CAAC,IAAI,CAAC,CAAC;QAE7C,OAAO,IAAI,kBAAkB,CAAC;YAC1B,MAAM,EAAE,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC;YAC/B,MAAM,EAAE,MAAM,CAAC,QAAQ,EAAE;SAC5B,CAAC,CAAC;IACP,CAAC;IAGD,OAAO;QACH,MAAM,MAAM,GAAG,IAAI,mBAAmB,CAAC,YAAY,CAAC,CAAC;QACrD,MAAM,EAAC,MAAM,EAAE,MAAM,EAAC,GAAG,IAAI,CAAC,UAAU,CAAC;QAGzC,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;QAChC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;QAExB,OAAO,OAAO,CAAC,OAAO,CAClB,UAAU,EACV,MAAM,CAAC,YAAY,EAAE,CACxB,CAAC;IACN,CAAC;;AAhCe,qBAAE,GAAG,UAAU,CAAC;AAEhB,gCAAa,GAAG,MAAM,CAAC;AAEvB,2BAAQ,GAAG,QAAQ,CAAC;AAEpB,gCAAa,GAAG,IAAI,CAAC;AA8BzC,eAAe,kBAAkB,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { default as CorrectTime2000Response } from './CorrectTime2000Response.js';
|
|
2
|
-
export { default as CurrentMC } from './CurrentMC.js';
|
|
3
2
|
export { default as Current } from './Current.js';
|
|
3
|
+
export { default as CurrentMC } from './CurrentMC.js';
|
|
4
4
|
export { default as Day } from './Day.js';
|
|
5
5
|
export { default as DayMC } from './DayMC.js';
|
|
6
6
|
export { default as ExAbsCurrentMC } from './ExAbsCurrentMC.js';
|
|
@@ -11,6 +11,7 @@ export { default as GetArchiveDaysResponse } from './GetArchiveDaysResponse.js';
|
|
|
11
11
|
export { default as GetArchiveEventsResponse } from './GetArchiveEventsResponse.js';
|
|
12
12
|
export { default as GetArchiveHoursMCResponse } from './GetArchiveHoursMCResponse.js';
|
|
13
13
|
export { default as GetArchiveHoursResponse } from './GetArchiveHoursResponse.js';
|
|
14
|
+
export { default as GetBatteryStatusResponse } from './GetBatteryStatusResponse.js';
|
|
14
15
|
export { default as GetExAbsArchiveDaysMCResponse } from './GetExAbsArchiveDaysMCResponse.js';
|
|
15
16
|
export { default as GetExAbsArchiveHoursMCResponse } from './GetExAbsArchiveHoursMCResponse.js';
|
|
16
17
|
export { default as GetLmicInfoResponse } from './GetLmicInfoResponse.js';
|
|
@@ -24,3 +25,6 @@ export { default as SetTime2000Response } from './SetTime2000Response.js';
|
|
|
24
25
|
export { default as SoftRestartResponse } from './SoftRestartResponse.js';
|
|
25
26
|
export { default as Status } from './Status.js';
|
|
26
27
|
export { default as Time2000 } from './Time2000.js';
|
|
28
|
+
export { default as UpdateRunResponse } from './UpdateRunResponse.js';
|
|
29
|
+
export { default as VerifyImageResponse } from './VerifyImageResponse.js';
|
|
30
|
+
export { default as WriteImageResponse } from './WriteImageResponse.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { default as CorrectTime2000Response } from './CorrectTime2000Response.js';
|
|
2
|
-
export { default as CurrentMC } from './CurrentMC.js';
|
|
3
2
|
export { default as Current } from './Current.js';
|
|
3
|
+
export { default as CurrentMC } from './CurrentMC.js';
|
|
4
4
|
export { default as Day } from './Day.js';
|
|
5
5
|
export { default as DayMC } from './DayMC.js';
|
|
6
6
|
export { default as ExAbsCurrentMC } from './ExAbsCurrentMC.js';
|
|
@@ -11,6 +11,7 @@ export { default as GetArchiveDaysResponse } from './GetArchiveDaysResponse.js';
|
|
|
11
11
|
export { default as GetArchiveEventsResponse } from './GetArchiveEventsResponse.js';
|
|
12
12
|
export { default as GetArchiveHoursMCResponse } from './GetArchiveHoursMCResponse.js';
|
|
13
13
|
export { default as GetArchiveHoursResponse } from './GetArchiveHoursResponse.js';
|
|
14
|
+
export { default as GetBatteryStatusResponse } from './GetBatteryStatusResponse.js';
|
|
14
15
|
export { default as GetExAbsArchiveDaysMCResponse } from './GetExAbsArchiveDaysMCResponse.js';
|
|
15
16
|
export { default as GetExAbsArchiveHoursMCResponse } from './GetExAbsArchiveHoursMCResponse.js';
|
|
16
17
|
export { default as GetLmicInfoResponse } from './GetLmicInfoResponse.js';
|
|
@@ -24,4 +25,7 @@ export { default as SetTime2000Response } from './SetTime2000Response.js';
|
|
|
24
25
|
export { default as SoftRestartResponse } from './SoftRestartResponse.js';
|
|
25
26
|
export { default as Status } from './Status.js';
|
|
26
27
|
export { default as Time2000 } from './Time2000.js';
|
|
28
|
+
export { default as UpdateRunResponse } from './UpdateRunResponse.js';
|
|
29
|
+
export { default as VerifyImageResponse } from './VerifyImageResponse.js';
|
|
30
|
+
export { default as WriteImageResponse } from './WriteImageResponse.js';
|
|
27
31
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/analog/commands/uplink/index.ts"],"names":[],"mappings":"AAMA,OAAO,EAAC,OAAO,IAAI,uBAAuB,EAAC,MAAM,8BAA8B,CAAC;AAChF,OAAO,EAAC,OAAO,IAAI,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/analog/commands/uplink/index.ts"],"names":[],"mappings":"AAMA,OAAO,EAAC,OAAO,IAAI,uBAAuB,EAAC,MAAM,8BAA8B,CAAC;AAChF,OAAO,EAAC,OAAO,IAAI,OAAO,EAAC,MAAM,cAAc,CAAC;AAChD,OAAO,EAAC,OAAO,IAAI,SAAS,EAAC,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAC,OAAO,IAAI,GAAG,EAAC,MAAM,UAAU,CAAC;AACxC,OAAO,EAAC,OAAO,IAAI,KAAK,EAAC,MAAM,YAAY,CAAC;AAC5C,OAAO,EAAC,OAAO,IAAI,cAAc,EAAC,MAAM,qBAAqB,CAAC;AAC9D,OAAO,EAAC,OAAO,IAAI,UAAU,EAAC,MAAM,iBAAiB,CAAC;AACtD,OAAO,EAAC,OAAO,IAAI,WAAW,EAAC,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAC,OAAO,IAAI,wBAAwB,EAAC,MAAM,+BAA+B,CAAC;AAClF,OAAO,EAAC,OAAO,IAAI,sBAAsB,EAAC,MAAM,6BAA6B,CAAC;AAC9E,OAAO,EAAC,OAAO,IAAI,wBAAwB,EAAC,MAAM,+BAA+B,CAAC;AAClF,OAAO,EAAC,OAAO,IAAI,yBAAyB,EA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'../commands/downlink/index.js';
|
|
2
|
+
import * as uplinkCommands from '../commands/uplink/index.js';
|
|
3
|
+
export declare const requestByResponse: Map<any, any>;
|
|
4
|
+
export declare const responseByRequest: Map<any, any>;
|
|
5
|
+
export declare const requestById: Map<number, typeof downlinkCommands.CorrectTime2000 | typeof downlinkCommands.GetArchiveDays | typeof downlinkCommands.GetArchiveDaysMC | typeof downlinkCommands.GetArchiveEvents | typeof downlinkCommands.GetArchiveHours | typeof downlinkCommands.GetArchiveHoursMC | typeof downlinkCommands.GetBatteryStatus | typeof downlinkCommands.GetCurrent | typeof downlinkCommands.GetCurrentMC | typeof downlinkCommands.GetExAbsArchiveDaysMC | typeof downlinkCommands.GetExAbsArchiveHoursMC | typeof downlinkCommands.GetExAbsCurrentMC | typeof downlinkCommands.GetLmicInfo | typeof downlinkCommands.GetParameter | typeof downlinkCommands.GetStatus | typeof downlinkCommands.GetTime2000 | typeof downlinkCommands.SetParameter | typeof downlinkCommands.SetTime2000 | typeof downlinkCommands.SoftRestart | typeof downlinkCommands.UpdateRun | typeof downlinkCommands.VerifyImage | typeof downlinkCommands.WriteImage>;
|
|
6
|
+
export declare const responseById: Map<number, typeof uplinkCommands.CorrectTime2000Response | typeof uplinkCommands.Current | typeof uplinkCommands.CurrentMC | typeof uplinkCommands.Day | typeof uplinkCommands.DayMC | typeof uplinkCommands.ExAbsCurrentMC | typeof uplinkCommands.ExAbsDayMC | typeof uplinkCommands.ExAbsHourMC | typeof uplinkCommands.GetArchiveDaysMCResponse | typeof uplinkCommands.GetArchiveDaysResponse | typeof uplinkCommands.GetArchiveEventsResponse | typeof uplinkCommands.GetArchiveHoursMCResponse | typeof uplinkCommands.GetArchiveHoursResponse | typeof uplinkCommands.GetBatteryStatusResponse | typeof uplinkCommands.GetExAbsArchiveDaysMCResponse | typeof uplinkCommands.GetExAbsArchiveHoursMCResponse | typeof uplinkCommands.GetLmicInfoResponse | typeof uplinkCommands.GetParameterResponse | typeof uplinkCommands.Hour | typeof uplinkCommands.HourMC | typeof uplinkCommands.LastEvent | typeof uplinkCommands.NewEvent | typeof uplinkCommands.SetParameterResponse | typeof uplinkCommands.SetTime2000Response | typeof uplinkCommands.SoftRestartResponse | typeof uplinkCommands.Status | typeof uplinkCommands.Time2000 | typeof uplinkCommands.UpdateRunResponse | typeof uplinkCommands.VerifyImageResponse | typeof uplinkCommands.WriteImageResponse>;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import * as downlinkCommands from '../commands/downlink/index.js';
|
|
2
|
+
import * as uplinkCommands from '../commands/uplink/index.js';
|
|
3
|
+
export const requestByResponse = new Map();
|
|
4
|
+
export const responseByRequest = new Map();
|
|
5
|
+
export const requestById = new Map(Object.values(downlinkCommands).map(command => [command.id, command]));
|
|
6
|
+
export const responseById = new Map(Object.values(uplinkCommands).map(command => [command.id, command]));
|
|
7
|
+
requestByResponse.set(uplinkCommands.CorrectTime2000Response, downlinkCommands.CorrectTime2000);
|
|
8
|
+
requestByResponse.set(uplinkCommands.Current, downlinkCommands.GetCurrent);
|
|
9
|
+
requestByResponse.set(uplinkCommands.CurrentMC, downlinkCommands.GetCurrentMC);
|
|
10
|
+
requestByResponse.set(uplinkCommands.ExAbsCurrentMC, downlinkCommands.GetExAbsCurrentMC);
|
|
11
|
+
requestByResponse.set(uplinkCommands.GetArchiveDaysMCResponse, downlinkCommands.GetArchiveDaysMC);
|
|
12
|
+
requestByResponse.set(uplinkCommands.GetArchiveDaysResponse, downlinkCommands.GetArchiveDays);
|
|
13
|
+
requestByResponse.set(uplinkCommands.GetArchiveEventsResponse, downlinkCommands.GetArchiveEvents);
|
|
14
|
+
requestByResponse.set(uplinkCommands.GetArchiveHoursMCResponse, downlinkCommands.GetArchiveHoursMC);
|
|
15
|
+
requestByResponse.set(uplinkCommands.GetBatteryStatusResponse, downlinkCommands.GetBatteryStatus);
|
|
16
|
+
requestByResponse.set(uplinkCommands.GetExAbsArchiveDaysMCResponse, downlinkCommands.GetExAbsArchiveDaysMC);
|
|
17
|
+
requestByResponse.set(uplinkCommands.GetExAbsArchiveHoursMCResponse, downlinkCommands.GetExAbsArchiveHoursMC);
|
|
18
|
+
requestByResponse.set(uplinkCommands.GetLmicInfoResponse, downlinkCommands.GetLmicInfo);
|
|
19
|
+
requestByResponse.set(uplinkCommands.GetParameterResponse, downlinkCommands.GetParameter);
|
|
20
|
+
requestByResponse.set(uplinkCommands.SetParameterResponse, downlinkCommands.SetParameter);
|
|
21
|
+
requestByResponse.set(uplinkCommands.SetTime2000Response, downlinkCommands.SetTime2000);
|
|
22
|
+
requestByResponse.set(uplinkCommands.SoftRestartResponse, downlinkCommands.SoftRestart);
|
|
23
|
+
requestByResponse.set(uplinkCommands.Status, downlinkCommands.GetStatus);
|
|
24
|
+
requestByResponse.set(uplinkCommands.Time2000, downlinkCommands.GetTime2000);
|
|
25
|
+
requestByResponse.set(uplinkCommands.UpdateRunResponse, downlinkCommands.UpdateRun);
|
|
26
|
+
requestByResponse.set(uplinkCommands.VerifyImageResponse, downlinkCommands.VerifyImage);
|
|
27
|
+
requestByResponse.set(uplinkCommands.WriteImageResponse, downlinkCommands.WriteImage);
|
|
28
|
+
for (const [response, request] of requestByResponse.entries()) {
|
|
29
|
+
responseByRequest.set(request, response);
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=commandRelations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"commandRelations.js","sourceRoot":"","sources":["../../../src/analog/constants/commandRelations.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,gBAAgB,MAAM,+BAA+B,CAAC;AAClE,OAAO,KAAK,cAAc,MAAM,6BAA6B,CAAC;AAI9D,MAAM,CAAC,MAAM,iBAAiB,GAAG,IAAI,GAAG,EAAE,CAAC;AAC3C,MAAM,CAAC,MAAM,iBAAiB,GAAG,IAAI,GAAG,EAAE,CAAC;AAG3C,MAAM,CAAC,MAAM,WAAW,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,gBAA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":"","sources":["../../../src/analog/constants/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,gBAAgB,MAAM,uBAAuB,CAAC;AAC1D,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/analog/constants/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,gBAAgB,MAAM,uBAAuB,CAAC;AAC1D,OAAO,KAAK,MAAM,MAAM,aAAa,CAAC;AACtC,OAAO,KAAK,aAAa,MAAM,oBAAoB,CAAC"}
|
package/dist/analog/message.d.ts
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import Command from './Command.js';
|
|
2
|
-
import * as downlinkCommands from './commands/downlink/index.js';
|
|
3
|
-
import * as uplinkCommands from './commands/uplink/index.js';
|
|
4
2
|
import { IHexFormatOptions } from '../config.js';
|
|
5
3
|
interface IMessageCommand {
|
|
6
4
|
data: {
|
|
@@ -21,13 +19,6 @@ interface IMessageConfig {
|
|
|
21
19
|
direction?: number;
|
|
22
20
|
hardwareType?: number;
|
|
23
21
|
}
|
|
24
|
-
export declare const downlinkCommandsById: {
|
|
25
|
-
[k: string]: typeof downlinkCommands.CorrectTime2000 | typeof downlinkCommands.GetArchiveDaysMC | typeof downlinkCommands.GetArchiveDays | typeof downlinkCommands.GetArchiveEvents | typeof downlinkCommands.GetArchiveHoursMC | typeof downlinkCommands.GetArchiveHours | typeof downlinkCommands.GetCurrentMC | typeof downlinkCommands.GetCurrent | typeof downlinkCommands.GetExAbsArchiveDaysMC | typeof downlinkCommands.GetExAbsArchiveHoursMC | typeof downlinkCommands.GetExAbsCurrentMC | typeof downlinkCommands.GetLmicInfo | typeof downlinkCommands.GetParameter | typeof downlinkCommands.GetStatus | typeof downlinkCommands.SetParameter | typeof downlinkCommands.SetTime2000 | typeof downlinkCommands.SoftRestart;
|
|
26
|
-
};
|
|
27
|
-
export declare const uplinkCommandsById: {
|
|
28
|
-
[k: string]: typeof uplinkCommands.CorrectTime2000Response | typeof uplinkCommands.CurrentMC | typeof uplinkCommands.Current | typeof uplinkCommands.Day | typeof uplinkCommands.DayMC | typeof uplinkCommands.ExAbsCurrentMC | typeof uplinkCommands.ExAbsDayMC | typeof uplinkCommands.ExAbsHourMC | typeof uplinkCommands.GetArchiveDaysMCResponse | typeof uplinkCommands.GetArchiveDaysResponse | typeof uplinkCommands.GetArchiveEventsResponse | typeof uplinkCommands.GetArchiveHoursMCResponse | typeof uplinkCommands.GetArchiveHoursResponse | typeof uplinkCommands.GetExAbsArchiveDaysMCResponse | typeof uplinkCommands.GetExAbsArchiveHoursMCResponse | typeof uplinkCommands.GetLmicInfoResponse | typeof uplinkCommands.GetParameterResponse | typeof uplinkCommands.Hour | typeof uplinkCommands.HourMC | typeof uplinkCommands.LastEvent | typeof uplinkCommands.NewEvent | typeof uplinkCommands.SetParameterResponse | typeof uplinkCommands.SetTime2000Response | typeof uplinkCommands.SoftRestartResponse | typeof uplinkCommands.Status | typeof uplinkCommands.Time2000;
|
|
29
|
-
};
|
|
30
|
-
export declare const calculateLrc: (data: Uint8Array, initialLrc?: number) => number;
|
|
31
22
|
export declare const fromBytes: (data: Uint8Array, config?: IMessageConfig) => IMessage;
|
|
32
23
|
export declare const fromHex: (data: string, config?: IMessageConfig) => IMessage;
|
|
33
24
|
export declare const fromBase64: (data: string) => IMessage;
|
package/dist/analog/message.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import UnknownCommand from './UnknownCommand.js';
|
|
2
|
-
import
|
|
3
|
-
import * as
|
|
4
|
-
import
|
|
5
|
-
import { AUTO, DOWNLINK, UPLINK } from './constants/directions.js';
|
|
2
|
+
import { requestById, responseById } from './constants/commandRelations.js';
|
|
3
|
+
import * as directionTypes from '../constants/directions.js';
|
|
4
|
+
import { AUTO, DOWNLINK, UPLINK } from '../constants/directions.js';
|
|
6
5
|
import * as header from './header.js';
|
|
6
|
+
import calculateLrc from '../utils/calculateLrc.js';
|
|
7
7
|
import getBytesFromHex from '../utils/getBytesFromHex.js';
|
|
8
8
|
import getBytesFromBase64 from '../utils/getBytesFromBase64.js';
|
|
9
9
|
import getHexFromBytes from '../utils/getHexFromBytes.js';
|
|
@@ -11,21 +11,12 @@ import getBase64FromBytes from '../utils/getBase64FromBytes.js';
|
|
|
11
11
|
import mergeUint8Arrays from '../utils/mergeUint8Arrays.js';
|
|
12
12
|
const HEADER_MAX_SIZE = 3;
|
|
13
13
|
const directionTypeIds = new Set(Object.values(directionTypes));
|
|
14
|
-
export const downlinkCommandsById = Object.fromEntries(Object.values(downlinkCommands).map(item => [item.id, item]));
|
|
15
|
-
export const uplinkCommandsById = Object.fromEntries(Object.values(uplinkCommands).map(item => [item.id, item]));
|
|
16
|
-
export const calculateLrc = (data, initialLrc = 0x55) => {
|
|
17
|
-
let lrc = initialLrc;
|
|
18
|
-
data.forEach(item => {
|
|
19
|
-
lrc ^= item;
|
|
20
|
-
});
|
|
21
|
-
return lrc;
|
|
22
|
-
};
|
|
23
14
|
const getCommand = (id, data, direction = AUTO, hardwareType) => {
|
|
24
15
|
if (!directionTypeIds.has(direction)) {
|
|
25
16
|
throw new Error('wrong direction type');
|
|
26
17
|
}
|
|
27
|
-
const downlinkCommand =
|
|
28
|
-
const uplinkCommand =
|
|
18
|
+
const downlinkCommand = requestById.get(id);
|
|
19
|
+
const uplinkCommand = responseById.get(id);
|
|
29
20
|
if ((!downlinkCommand && !uplinkCommand)
|
|
30
21
|
|| (direction === DOWNLINK && !downlinkCommand)
|
|
31
22
|
|| (direction === UPLINK && !uplinkCommand)) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"message.js","sourceRoot":"","sources":["../../src/analog/message.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"message.js","sourceRoot":"","sources":["../../src/analog/message.ts"],"names":[],"mappings":"AAIA,OAAO,cAAc,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAC,WAAW,EAAE,YAAY,EAAC,MAAM,iCAAiC,CAAC;AAE1E,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C,CAAC,CACtC,CAAC;AAEF,MAAM,CAAC,MAAM,OAAO,GAAG,CAAE,QAAwB,EAAe,EAAE;IAC9D,MAAM,YAAY,GAAG,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC;IAChE,MAAM,IAAI,GAAG,gBAAgB,CAAC,GAAG,YAAY,CAAC,CAAC;IAE/C,OAAO,gBAAgB,CAAC,IAAI,EAAE,IAAI,UAAU,CAAC,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;AACxE,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,KAAK,GAAG,CAAE,QAAwB,EAAE,UAA6B,EAAE,EAAW,EAAE,CAAC,eAAe,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC,CAAC;AAE1I,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAE,QAAwB,EAAW,EAAE,CAAC,kBAAkB,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"directions.js","sourceRoot":"","sources":["../../src/constants/directions.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,IAAI,GAAG,CAAC,CAAC;AACtB,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,CAAC;AAC1B,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"frameAttributes.js","sourceRoot":"","sources":["../../src/constants/frameAttributes.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,UAAU,GAAG,IAAI,CAAC;AAC/B,MAAM,CAAC,MAAM,SAAS,GAAG,IAAI,CAAC;AAC9B,MAAM,CAAC,MAAM,QAAQ,GAAG,GAAG,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/constants/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,eAAe,MAAM,sBAAsB,CAAC;AACxD,OAAO,KAAK,UAAU,MAAM,iBAAiB,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import BinaryBuffer from '../utils/BinaryBuffer.js';
|
|
2
2
|
export interface IDateTime {
|
|
3
|
+
isSummerTime: boolean;
|
|
3
4
|
seconds: number;
|
|
4
5
|
minutes: number;
|
|
5
6
|
hours: number;
|
|
@@ -7,7 +8,6 @@ export interface IDateTime {
|
|
|
7
8
|
date: number;
|
|
8
9
|
month: number;
|
|
9
10
|
year: number;
|
|
10
|
-
isSummerTime: boolean;
|
|
11
11
|
}
|
|
12
12
|
export interface ITariffPlan {
|
|
13
13
|
id: number;
|
|
@@ -172,14 +172,17 @@ export interface IDeviceId {
|
|
|
172
172
|
year: number;
|
|
173
173
|
serial: string;
|
|
174
174
|
}
|
|
175
|
+
export interface IDeviceType {
|
|
176
|
+
type: string;
|
|
177
|
+
revision: number;
|
|
178
|
+
meterType: number;
|
|
179
|
+
}
|
|
175
180
|
export declare const TARIFF_PLAN_SIZE = 11;
|
|
176
181
|
export declare const OPERATOR_PARAMETERS_SIZE = 74;
|
|
177
182
|
export declare const SEASON_PROFILE_DAYS_NUMBER = 7;
|
|
178
183
|
export declare const SEASON_PROFILE_SIZE: number;
|
|
179
184
|
declare class CommandBinaryBuffer extends BinaryBuffer {
|
|
180
185
|
constructor(dataOrLength: Uint8Array | number | string);
|
|
181
|
-
setHexString(value: string): void;
|
|
182
|
-
getHexString(size: number): string;
|
|
183
186
|
static getDateFromDateTime(dateTime: IDateTime): Date;
|
|
184
187
|
static getDateTimeFromDate(date: Date): IDateTime;
|
|
185
188
|
getDateTime(): IDateTime;
|
|
@@ -200,5 +203,7 @@ declare class CommandBinaryBuffer extends BinaryBuffer {
|
|
|
200
203
|
setSpecialDay(specialDay: ISpecialDay): void;
|
|
201
204
|
getDeviceId(): IDeviceId;
|
|
202
205
|
setDeviceId({ manufacturer, type, year, serial }: IDeviceId): void;
|
|
206
|
+
getDeviceType(): IDeviceType;
|
|
207
|
+
setDeviceType({ type, revision, meterType }: IDeviceType): void;
|
|
203
208
|
}
|
|
204
209
|
export default CommandBinaryBuffer;
|
|
@@ -6,6 +6,17 @@ export const TARIFF_PLAN_SIZE = 11;
|
|
|
6
6
|
export const OPERATOR_PARAMETERS_SIZE = 74;
|
|
7
7
|
export const SEASON_PROFILE_DAYS_NUMBER = 7;
|
|
8
8
|
export const SEASON_PROFILE_SIZE = 2 + SEASON_PROFILE_DAYS_NUMBER;
|
|
9
|
+
const DEVICE_TYPE_INVALID_CHAR = 'x';
|
|
10
|
+
const DEVICE_TYPE_1H_NIBBLE = ['.', '1', '3', 'R'];
|
|
11
|
+
const DEVICE_TYPE_1L_NIBBLE = ['.', 'A', 'G', 'R', 'T', 'D'];
|
|
12
|
+
const DEVICE_TYPE_2H_2L_NIBBLE = ['.', '0', '1', '2', '3', '4', '5'];
|
|
13
|
+
const DEVICE_TYPE_3H_NIBBLE = ['.', 'A', 'B', 'C', 'D', 'E', 'F'];
|
|
14
|
+
const DEVICE_TYPE_3L_NIBBLE = ['.', 'A', 'B', 'C', 'D', 'E', 'F', 'H', 'K', 'G'];
|
|
15
|
+
const DEVICE_TYPE_4H_NIBBLE = ['.', '1', '2', '3', '4', '5', '6', '7', '8', '9'];
|
|
16
|
+
const DEVICE_TYPE_4L_NIBBLE = ['.', 'L', 'M', 'Z', 'K'];
|
|
17
|
+
const DEVICE_TYPE_5L_NIBBLE = ['.', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9'];
|
|
18
|
+
const DEVICE_TYPE_N9 = ['.', 'D', 'B', 'C', 'E', 'P', 'R', 'O', 'L', 'F', 'S', 'M', 'Y', 'G', 'N', 'U'];
|
|
19
|
+
const DEVICE_TYPE_N11 = ['0', 'H', 'A', 'T', '0', '0', '0', '0', '0', '1', '2', '3', '4', '0', '0', '0'];
|
|
9
20
|
const displaySetMask = {
|
|
10
21
|
TEST_D: 0x0001,
|
|
11
22
|
VERSION_D: 0x0002,
|
|
@@ -114,31 +125,27 @@ const define1Mask = {
|
|
|
114
125
|
BLOCK_KEY_OPTOPORT: 0x02,
|
|
115
126
|
MAGNET_SCREEN_CONST: 0x20
|
|
116
127
|
};
|
|
128
|
+
const splitDeviceTypeByte = (byte) => [
|
|
129
|
+
byte >> 4,
|
|
130
|
+
byte & 0x0F
|
|
131
|
+
];
|
|
117
132
|
class CommandBinaryBuffer extends BinaryBuffer {
|
|
118
133
|
constructor(dataOrLength) {
|
|
119
134
|
super(dataOrLength, false);
|
|
120
135
|
}
|
|
121
|
-
setHexString(value) {
|
|
122
|
-
getBytesFromHex(value).forEach(byte => this.setUint8(byte));
|
|
123
|
-
}
|
|
124
|
-
getHexString(size) {
|
|
125
|
-
const currentOffset = this.offset;
|
|
126
|
-
this.offset += size;
|
|
127
|
-
return getHexFromBytes(this.toUint8Array().slice(currentOffset, this.offset), { separator: '' });
|
|
128
|
-
}
|
|
129
136
|
static getDateFromDateTime(dateTime) {
|
|
130
137
|
return new Date(dateTime.year + 2000, dateTime.month - 1, dateTime.date, dateTime.hours, dateTime.minutes, dateTime.seconds);
|
|
131
138
|
}
|
|
132
139
|
static getDateTimeFromDate(date) {
|
|
133
140
|
const dateTime = {
|
|
134
|
-
|
|
135
|
-
|
|
141
|
+
isSummerTime: false,
|
|
142
|
+
seconds: date.getSeconds(),
|
|
143
|
+
minutes: date.getMinutes(),
|
|
144
|
+
hours: date.getHours(),
|
|
136
145
|
day: date.getDay(),
|
|
137
146
|
date: date.getDate(),
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
seconds: date.getSeconds(),
|
|
141
|
-
isSummerTime: false
|
|
147
|
+
month: date.getMonth() + 1,
|
|
148
|
+
year: date.getFullYear() - 2000
|
|
142
149
|
};
|
|
143
150
|
return dateTime;
|
|
144
151
|
}
|
|
@@ -393,17 +400,124 @@ class CommandBinaryBuffer extends BinaryBuffer {
|
|
|
393
400
|
this.setUint8(+!specialDay.isPeriodic);
|
|
394
401
|
}
|
|
395
402
|
getDeviceId() {
|
|
396
|
-
const manufacturer = this.
|
|
403
|
+
const manufacturer = getHexFromBytes(this.getBytes(3), { separator: '' });
|
|
397
404
|
const type = this.getUint8();
|
|
398
405
|
const year = this.getUint8() + 2000;
|
|
399
|
-
const serial = this.
|
|
406
|
+
const serial = getHexFromBytes(this.getBytes(3), { separator: '' });
|
|
400
407
|
return { manufacturer, type, year, serial };
|
|
401
408
|
}
|
|
402
409
|
setDeviceId({ manufacturer, type, year, serial }) {
|
|
403
|
-
this.
|
|
410
|
+
this.setBytes(getBytesFromHex(manufacturer));
|
|
404
411
|
this.setUint8(type);
|
|
405
412
|
this.setUint8(year - 2000);
|
|
406
|
-
this.
|
|
413
|
+
this.setBytes(getBytesFromHex(serial));
|
|
414
|
+
}
|
|
415
|
+
getDeviceType() {
|
|
416
|
+
const type = ['MTX '];
|
|
417
|
+
let high;
|
|
418
|
+
let low;
|
|
419
|
+
this.getUint8();
|
|
420
|
+
[high, low] = splitDeviceTypeByte(this.getUint8());
|
|
421
|
+
type.push(DEVICE_TYPE_1H_NIBBLE[high] ?? DEVICE_TYPE_INVALID_CHAR);
|
|
422
|
+
type.push(DEVICE_TYPE_1L_NIBBLE[low] ?? DEVICE_TYPE_INVALID_CHAR);
|
|
423
|
+
[high, low] = splitDeviceTypeByte(this.getUint8());
|
|
424
|
+
type.push(DEVICE_TYPE_2H_2L_NIBBLE[high] ?? DEVICE_TYPE_INVALID_CHAR);
|
|
425
|
+
type.push(DEVICE_TYPE_2H_2L_NIBBLE[low] ?? DEVICE_TYPE_INVALID_CHAR);
|
|
426
|
+
type.push('.');
|
|
427
|
+
[high, low] = splitDeviceTypeByte(this.getUint8());
|
|
428
|
+
type.push(DEVICE_TYPE_3H_NIBBLE[high] ?? DEVICE_TYPE_INVALID_CHAR);
|
|
429
|
+
type.push(DEVICE_TYPE_3L_NIBBLE[low] ?? DEVICE_TYPE_INVALID_CHAR);
|
|
430
|
+
type.push('.');
|
|
431
|
+
[high, low] = splitDeviceTypeByte(this.getUint8());
|
|
432
|
+
type.push(DEVICE_TYPE_4H_NIBBLE[high] ?? DEVICE_TYPE_INVALID_CHAR);
|
|
433
|
+
type.push(DEVICE_TYPE_4L_NIBBLE[low] ?? DEVICE_TYPE_INVALID_CHAR);
|
|
434
|
+
[high, low] = splitDeviceTypeByte(this.getUint8());
|
|
435
|
+
type.push(DEVICE_TYPE_5L_NIBBLE[low] ?? DEVICE_TYPE_INVALID_CHAR);
|
|
436
|
+
const revision = high;
|
|
437
|
+
type.push('-');
|
|
438
|
+
const [upper6, lower6] = splitDeviceTypeByte(this.getUint8());
|
|
439
|
+
const [upper7, lower7] = splitDeviceTypeByte(this.getUint8());
|
|
440
|
+
let deviceProtocol;
|
|
441
|
+
if (upper7 === 0 && lower7 === 0) {
|
|
442
|
+
type.push(DEVICE_TYPE_N9[upper6] ?? DEVICE_TYPE_INVALID_CHAR);
|
|
443
|
+
deviceProtocol = DEVICE_TYPE_N11[lower6];
|
|
444
|
+
if (deviceProtocol && deviceProtocol !== '0') {
|
|
445
|
+
type.push(deviceProtocol);
|
|
446
|
+
}
|
|
447
|
+
}
|
|
448
|
+
else if (lower7 === 0) {
|
|
449
|
+
type.push(DEVICE_TYPE_N9[upper6] ?? DEVICE_TYPE_INVALID_CHAR);
|
|
450
|
+
type.push(DEVICE_TYPE_N9[lower6] ?? DEVICE_TYPE_INVALID_CHAR);
|
|
451
|
+
deviceProtocol = DEVICE_TYPE_N11[upper7];
|
|
452
|
+
if (deviceProtocol && deviceProtocol !== '0') {
|
|
453
|
+
type.push(deviceProtocol);
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
else {
|
|
457
|
+
type.push(DEVICE_TYPE_N9[upper6] ?? DEVICE_TYPE_INVALID_CHAR);
|
|
458
|
+
type.push(DEVICE_TYPE_N9[lower6] ?? DEVICE_TYPE_INVALID_CHAR);
|
|
459
|
+
type.push(DEVICE_TYPE_N9[upper7] ?? DEVICE_TYPE_INVALID_CHAR);
|
|
460
|
+
deviceProtocol = DEVICE_TYPE_N11[lower7];
|
|
461
|
+
if (deviceProtocol && deviceProtocol !== '0') {
|
|
462
|
+
type.push(deviceProtocol);
|
|
463
|
+
}
|
|
464
|
+
}
|
|
465
|
+
return {
|
|
466
|
+
type: type.join(''),
|
|
467
|
+
revision,
|
|
468
|
+
meterType: this.getUint8()
|
|
469
|
+
};
|
|
470
|
+
}
|
|
471
|
+
setDeviceType({ type, revision, meterType }) {
|
|
472
|
+
let high;
|
|
473
|
+
let low;
|
|
474
|
+
this.setUint8(0);
|
|
475
|
+
const cleanType = type.replace('MTX ', '');
|
|
476
|
+
high = DEVICE_TYPE_1H_NIBBLE.indexOf(cleanType[0]);
|
|
477
|
+
low = DEVICE_TYPE_1L_NIBBLE.indexOf(cleanType[1]);
|
|
478
|
+
this.setUint8((high << 4) | low);
|
|
479
|
+
high = DEVICE_TYPE_2H_2L_NIBBLE.indexOf(cleanType[2]);
|
|
480
|
+
low = DEVICE_TYPE_2H_2L_NIBBLE.indexOf(cleanType[3]);
|
|
481
|
+
this.setUint8((high << 4) | low);
|
|
482
|
+
high = DEVICE_TYPE_3H_NIBBLE.indexOf(cleanType[5]);
|
|
483
|
+
low = DEVICE_TYPE_3L_NIBBLE.indexOf(cleanType[6]);
|
|
484
|
+
this.setUint8((high << 4) | low);
|
|
485
|
+
high = DEVICE_TYPE_4H_NIBBLE.indexOf(cleanType[8]);
|
|
486
|
+
low = DEVICE_TYPE_4L_NIBBLE.indexOf(cleanType[9]);
|
|
487
|
+
this.setUint8((high << 4) | low);
|
|
488
|
+
high = revision;
|
|
489
|
+
low = DEVICE_TYPE_5L_NIBBLE.indexOf(cleanType[10]);
|
|
490
|
+
this.setUint8((high << 4) | low);
|
|
491
|
+
const [, typeLastPart] = cleanType.split('-');
|
|
492
|
+
if (typeLastPart.length === 1) {
|
|
493
|
+
high = DEVICE_TYPE_N9.indexOf(typeLastPart[0]);
|
|
494
|
+
low = 0;
|
|
495
|
+
this.setUint8((high << 4) | low);
|
|
496
|
+
this.setUint8(0);
|
|
497
|
+
}
|
|
498
|
+
else if (typeLastPart.length === 2) {
|
|
499
|
+
high = DEVICE_TYPE_N9.indexOf(typeLastPart[0]);
|
|
500
|
+
low = DEVICE_TYPE_N11.indexOf(typeLastPart[1]);
|
|
501
|
+
this.setUint8((high << 4) | low);
|
|
502
|
+
this.setUint8(0);
|
|
503
|
+
}
|
|
504
|
+
else if (typeLastPart.length === 3) {
|
|
505
|
+
high = DEVICE_TYPE_N9.indexOf(typeLastPart[0]);
|
|
506
|
+
low = DEVICE_TYPE_N9.indexOf(typeLastPart[1]);
|
|
507
|
+
this.setUint8((high << 4) | low);
|
|
508
|
+
high = DEVICE_TYPE_N11.indexOf(typeLastPart[2]);
|
|
509
|
+
low = 0;
|
|
510
|
+
this.setUint8((high << 4) | low);
|
|
511
|
+
}
|
|
512
|
+
else if (typeLastPart.length === 4) {
|
|
513
|
+
high = DEVICE_TYPE_N9.indexOf(typeLastPart[0]);
|
|
514
|
+
low = DEVICE_TYPE_N9.indexOf(typeLastPart[1]);
|
|
515
|
+
this.setUint8((high << 4) | low);
|
|
516
|
+
high = DEVICE_TYPE_N9.indexOf(typeLastPart[2]);
|
|
517
|
+
low = DEVICE_TYPE_N11.indexOf(typeLastPart[3]);
|
|
518
|
+
this.setUint8((high << 4) | low);
|
|
519
|
+
}
|
|
520
|
+
this.setUint8(meterType);
|
|
407
521
|
}
|
|
408
522
|
}
|
|
409
523
|
export default CommandBinaryBuffer;
|