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.
Files changed (455) hide show
  1. package/dist/analog/CommandBinaryBuffer.d.ts +4 -5
  2. package/dist/analog/CommandBinaryBuffer.js +59 -18
  3. package/dist/analog/CommandBinaryBuffer.js.map +1 -1
  4. package/dist/analog/commands/downlink/CorrectTime2000.js +1 -1
  5. package/dist/analog/commands/downlink/CorrectTime2000.js.map +1 -1
  6. package/dist/analog/commands/downlink/GetArchiveDays.js +1 -1
  7. package/dist/analog/commands/downlink/GetArchiveDays.js.map +1 -1
  8. package/dist/analog/commands/downlink/GetArchiveDaysMC.js +1 -1
  9. package/dist/analog/commands/downlink/GetArchiveDaysMC.js.map +1 -1
  10. package/dist/analog/commands/downlink/GetArchiveEvents.js +1 -1
  11. package/dist/analog/commands/downlink/GetArchiveEvents.js.map +1 -1
  12. package/dist/analog/commands/downlink/GetArchiveHours.js +1 -1
  13. package/dist/analog/commands/downlink/GetArchiveHours.js.map +1 -1
  14. package/dist/analog/commands/downlink/GetArchiveHoursMC.js +1 -1
  15. package/dist/analog/commands/downlink/GetArchiveHoursMC.js.map +1 -1
  16. package/dist/analog/commands/downlink/GetBatteryStatus.d.ts +11 -0
  17. package/dist/analog/commands/downlink/GetBatteryStatus.js +26 -0
  18. package/dist/analog/commands/downlink/GetBatteryStatus.js.map +1 -0
  19. package/dist/analog/commands/downlink/GetCurrent.js +1 -1
  20. package/dist/analog/commands/downlink/GetCurrent.js.map +1 -1
  21. package/dist/analog/commands/downlink/GetCurrentMC.js +1 -1
  22. package/dist/analog/commands/downlink/GetCurrentMC.js.map +1 -1
  23. package/dist/analog/commands/downlink/GetExAbsArchiveDaysMC.js +1 -1
  24. package/dist/analog/commands/downlink/GetExAbsArchiveDaysMC.js.map +1 -1
  25. package/dist/analog/commands/downlink/GetExAbsArchiveHoursMC.js +1 -1
  26. package/dist/analog/commands/downlink/GetExAbsArchiveHoursMC.js.map +1 -1
  27. package/dist/analog/commands/downlink/GetExAbsCurrentMC.js +1 -1
  28. package/dist/analog/commands/downlink/GetExAbsCurrentMC.js.map +1 -1
  29. package/dist/analog/commands/downlink/GetLmicInfo.js +1 -1
  30. package/dist/analog/commands/downlink/GetLmicInfo.js.map +1 -1
  31. package/dist/analog/commands/downlink/GetParameter.js +1 -1
  32. package/dist/analog/commands/downlink/GetParameter.js.map +1 -1
  33. package/dist/analog/commands/downlink/GetStatus.js +1 -1
  34. package/dist/analog/commands/downlink/GetStatus.js.map +1 -1
  35. package/dist/analog/commands/downlink/GetTime2000.d.ts +11 -0
  36. package/dist/analog/commands/downlink/GetTime2000.js +26 -0
  37. package/dist/analog/commands/downlink/GetTime2000.js.map +1 -0
  38. package/dist/analog/commands/downlink/SetParameter.js +1 -1
  39. package/dist/analog/commands/downlink/SetParameter.js.map +1 -1
  40. package/dist/analog/commands/downlink/SetTime2000.js +1 -1
  41. package/dist/analog/commands/downlink/SetTime2000.js.map +1 -1
  42. package/dist/analog/commands/downlink/SoftRestart.js +1 -1
  43. package/dist/analog/commands/downlink/SoftRestart.js.map +1 -1
  44. package/dist/analog/commands/downlink/UpdateRun.d.ts +10 -0
  45. package/dist/analog/commands/downlink/UpdateRun.js +23 -0
  46. package/dist/analog/commands/downlink/UpdateRun.js.map +1 -0
  47. package/dist/analog/commands/downlink/VerifyImage.d.ts +10 -0
  48. package/dist/analog/commands/downlink/VerifyImage.js +23 -0
  49. package/dist/analog/commands/downlink/VerifyImage.js.map +1 -0
  50. package/dist/analog/commands/downlink/WriteImage.d.ts +16 -0
  51. package/dist/analog/commands/downlink/WriteImage.js +45 -0
  52. package/dist/analog/commands/downlink/WriteImage.js.map +1 -0
  53. package/dist/analog/commands/downlink/index.d.ts +8 -3
  54. package/dist/analog/commands/downlink/index.js +8 -3
  55. package/dist/analog/commands/downlink/index.js.map +1 -1
  56. package/dist/analog/commands/uplink/CorrectTime2000Response.js +1 -1
  57. package/dist/analog/commands/uplink/CorrectTime2000Response.js.map +1 -1
  58. package/dist/analog/commands/uplink/Current.js +1 -1
  59. package/dist/analog/commands/uplink/Current.js.map +1 -1
  60. package/dist/analog/commands/uplink/CurrentMC.js +1 -1
  61. package/dist/analog/commands/uplink/CurrentMC.js.map +1 -1
  62. package/dist/analog/commands/uplink/Day.js +1 -1
  63. package/dist/analog/commands/uplink/Day.js.map +1 -1
  64. package/dist/analog/commands/uplink/DayMC.js +1 -1
  65. package/dist/analog/commands/uplink/DayMC.js.map +1 -1
  66. package/dist/analog/commands/uplink/ExAbsCurrentMC.js +1 -1
  67. package/dist/analog/commands/uplink/ExAbsCurrentMC.js.map +1 -1
  68. package/dist/analog/commands/uplink/ExAbsDayMC.js +1 -1
  69. package/dist/analog/commands/uplink/ExAbsDayMC.js.map +1 -1
  70. package/dist/analog/commands/uplink/ExAbsHourMC.js +4 -24
  71. package/dist/analog/commands/uplink/ExAbsHourMC.js.map +1 -1
  72. package/dist/analog/commands/uplink/GetArchiveDaysMCResponse.js +15 -1
  73. package/dist/analog/commands/uplink/GetArchiveDaysMCResponse.js.map +1 -1
  74. package/dist/analog/commands/uplink/GetArchiveDaysResponse.js +1 -1
  75. package/dist/analog/commands/uplink/GetArchiveDaysResponse.js.map +1 -1
  76. package/dist/analog/commands/uplink/GetArchiveEventsResponse.js +1 -1
  77. package/dist/analog/commands/uplink/GetArchiveEventsResponse.js.map +1 -1
  78. package/dist/analog/commands/uplink/GetArchiveHoursMCResponse.js +10 -1
  79. package/dist/analog/commands/uplink/GetArchiveHoursMCResponse.js.map +1 -1
  80. package/dist/analog/commands/uplink/GetArchiveHoursResponse.js +1 -1
  81. package/dist/analog/commands/uplink/GetArchiveHoursResponse.js.map +1 -1
  82. package/dist/analog/commands/uplink/GetBatteryStatusResponse.d.ts +21 -0
  83. package/dist/analog/commands/uplink/GetBatteryStatusResponse.js +57 -0
  84. package/dist/analog/commands/uplink/GetBatteryStatusResponse.js.map +1 -0
  85. package/dist/analog/commands/uplink/GetExAbsArchiveDaysMCResponse.d.ts +2 -2
  86. package/dist/analog/commands/uplink/GetExAbsArchiveDaysMCResponse.js +7 -3
  87. package/dist/analog/commands/uplink/GetExAbsArchiveDaysMCResponse.js.map +1 -1
  88. package/dist/analog/commands/uplink/GetExAbsArchiveHoursMCResponse.d.ts +2 -2
  89. package/dist/analog/commands/uplink/GetExAbsArchiveHoursMCResponse.js +12 -24
  90. package/dist/analog/commands/uplink/GetExAbsArchiveHoursMCResponse.js.map +1 -1
  91. package/dist/analog/commands/uplink/GetLmicInfoResponse.js +1 -1
  92. package/dist/analog/commands/uplink/GetLmicInfoResponse.js.map +1 -1
  93. package/dist/analog/commands/uplink/GetParameterResponse.js +1 -1
  94. package/dist/analog/commands/uplink/GetParameterResponse.js.map +1 -1
  95. package/dist/analog/commands/uplink/Hour.js +1 -1
  96. package/dist/analog/commands/uplink/Hour.js.map +1 -1
  97. package/dist/analog/commands/uplink/HourMC.js +1 -1
  98. package/dist/analog/commands/uplink/HourMC.js.map +1 -1
  99. package/dist/analog/commands/uplink/LastEvent.js +1 -1
  100. package/dist/analog/commands/uplink/LastEvent.js.map +1 -1
  101. package/dist/analog/commands/uplink/NewEvent.js +1 -1
  102. package/dist/analog/commands/uplink/NewEvent.js.map +1 -1
  103. package/dist/analog/commands/uplink/SetParameterResponse.js +1 -1
  104. package/dist/analog/commands/uplink/SetParameterResponse.js.map +1 -1
  105. package/dist/analog/commands/uplink/SetTime2000Response.js +1 -1
  106. package/dist/analog/commands/uplink/SetTime2000Response.js.map +1 -1
  107. package/dist/analog/commands/uplink/SoftRestartResponse.js +1 -1
  108. package/dist/analog/commands/uplink/SoftRestartResponse.js.map +1 -1
  109. package/dist/analog/commands/uplink/Status.js +2 -2
  110. package/dist/analog/commands/uplink/Status.js.map +1 -1
  111. package/dist/analog/commands/uplink/Time2000.js +1 -1
  112. package/dist/analog/commands/uplink/Time2000.js.map +1 -1
  113. package/dist/analog/commands/uplink/UpdateRunResponse.d.ts +10 -0
  114. package/dist/analog/commands/uplink/UpdateRunResponse.js +23 -0
  115. package/dist/analog/commands/uplink/UpdateRunResponse.js.map +1 -0
  116. package/dist/analog/commands/uplink/VerifyImageResponse.d.ts +15 -0
  117. package/dist/analog/commands/uplink/VerifyImageResponse.js +29 -0
  118. package/dist/analog/commands/uplink/VerifyImageResponse.js.map +1 -0
  119. package/dist/analog/commands/uplink/WriteImageResponse.d.ts +16 -0
  120. package/dist/analog/commands/uplink/WriteImageResponse.js +41 -0
  121. package/dist/analog/commands/uplink/WriteImageResponse.js.map +1 -0
  122. package/dist/analog/commands/uplink/index.d.ts +5 -1
  123. package/dist/analog/commands/uplink/index.js +5 -1
  124. package/dist/analog/commands/uplink/index.js.map +1 -1
  125. package/dist/analog/constants/commandRelations.d.ts +6 -0
  126. package/dist/analog/constants/commandRelations.js +31 -0
  127. package/dist/analog/constants/commandRelations.js.map +1 -0
  128. package/dist/analog/constants/index.d.ts +0 -1
  129. package/dist/analog/constants/index.js +0 -1
  130. package/dist/analog/constants/index.js.map +1 -1
  131. package/dist/analog/message.d.ts +0 -9
  132. package/dist/analog/message.js +6 -15
  133. package/dist/analog/message.js.map +1 -1
  134. package/dist/constants/directions.js.map +1 -0
  135. package/dist/constants/frameAttributes.js.map +1 -0
  136. package/dist/constants/index.d.ts +2 -0
  137. package/dist/constants/index.js +3 -0
  138. package/dist/constants/index.js.map +1 -0
  139. package/dist/mtx/CommandBinaryBuffer.d.ts +8 -3
  140. package/dist/mtx/CommandBinaryBuffer.js +132 -18
  141. package/dist/mtx/CommandBinaryBuffer.js.map +1 -1
  142. package/dist/mtx/commands/downlink/ActivateRatePlan.js +1 -1
  143. package/dist/mtx/commands/downlink/ActivateRatePlan.js.map +1 -1
  144. package/dist/mtx/commands/downlink/GetDateTime.js +1 -1
  145. package/dist/mtx/commands/downlink/GetDateTime.js.map +1 -1
  146. package/dist/mtx/commands/downlink/GetDayProfile.d.ts +19 -0
  147. package/dist/mtx/commands/downlink/GetDayProfile.js +48 -0
  148. package/dist/mtx/commands/downlink/GetDayProfile.js.map +1 -0
  149. package/dist/mtx/commands/downlink/GetDeviceId.js +1 -1
  150. package/dist/mtx/commands/downlink/GetDeviceId.js.map +1 -1
  151. package/dist/mtx/commands/downlink/GetDeviceType.d.ts +13 -0
  152. package/dist/mtx/commands/downlink/GetDeviceType.js +31 -0
  153. package/dist/mtx/commands/downlink/GetDeviceType.js.map +1 -0
  154. package/dist/mtx/commands/downlink/GetDisplayParam.js +1 -1
  155. package/dist/mtx/commands/downlink/GetDisplayParam.js.map +1 -1
  156. package/dist/mtx/commands/downlink/GetOpParams.js +1 -1
  157. package/dist/mtx/commands/downlink/GetOpParams.js.map +1 -1
  158. package/dist/mtx/commands/downlink/GetRatePlanInfo.js +1 -1
  159. package/dist/mtx/commands/downlink/GetRatePlanInfo.js.map +1 -1
  160. package/dist/mtx/commands/downlink/GetSeasonProfile.d.ts +19 -0
  161. package/dist/mtx/commands/downlink/GetSeasonProfile.js +48 -0
  162. package/dist/mtx/commands/downlink/GetSeasonProfile.js.map +1 -0
  163. package/dist/mtx/commands/downlink/GetSpecialDay.d.ts +19 -0
  164. package/dist/mtx/commands/downlink/GetSpecialDay.js +48 -0
  165. package/dist/mtx/commands/downlink/GetSpecialDay.js.map +1 -0
  166. package/dist/mtx/commands/downlink/PrepareRatePlan.js +1 -1
  167. package/dist/mtx/commands/downlink/PrepareRatePlan.js.map +1 -1
  168. package/dist/mtx/commands/downlink/RunTariffPlan.js +1 -1
  169. package/dist/mtx/commands/downlink/RunTariffPlan.js.map +1 -1
  170. package/dist/mtx/commands/downlink/SetAccessKey.d.ts +18 -0
  171. package/dist/mtx/commands/downlink/SetAccessKey.js +51 -0
  172. package/dist/mtx/commands/downlink/SetAccessKey.js.map +1 -0
  173. package/dist/mtx/commands/downlink/SetCorrectDateTime.d.ts +17 -0
  174. package/dist/mtx/commands/downlink/SetCorrectDateTime.js +51 -0
  175. package/dist/mtx/commands/downlink/SetCorrectDateTime.js.map +1 -0
  176. package/dist/mtx/commands/downlink/SetDateTime.d.ts +15 -0
  177. package/dist/mtx/commands/downlink/SetDateTime.js +48 -0
  178. package/dist/mtx/commands/downlink/SetDateTime.js.map +1 -0
  179. package/dist/mtx/commands/downlink/SetDayProfile.js +1 -1
  180. package/dist/mtx/commands/downlink/SetDayProfile.js.map +1 -1
  181. package/dist/mtx/commands/downlink/SetDisplayParam.js +1 -1
  182. package/dist/mtx/commands/downlink/SetDisplayParam.js.map +1 -1
  183. package/dist/mtx/commands/downlink/SetOpParams.js +1 -1
  184. package/dist/mtx/commands/downlink/SetOpParams.js.map +1 -1
  185. package/dist/mtx/commands/downlink/SetSeasonProfile.js +1 -1
  186. package/dist/mtx/commands/downlink/SetSeasonProfile.js.map +1 -1
  187. package/dist/mtx/commands/downlink/SetSpecialDay.js +2 -2
  188. package/dist/mtx/commands/downlink/SetSpecialDay.js.map +1 -1
  189. package/dist/mtx/commands/downlink/TurnRelayOff.js +1 -1
  190. package/dist/mtx/commands/downlink/TurnRelayOff.js.map +1 -1
  191. package/dist/mtx/commands/downlink/TurnRelayOn.js +1 -1
  192. package/dist/mtx/commands/downlink/TurnRelayOn.js.map +1 -1
  193. package/dist/mtx/commands/downlink/index.d.ts +7 -0
  194. package/dist/mtx/commands/downlink/index.js +7 -0
  195. package/dist/mtx/commands/downlink/index.js.map +1 -1
  196. package/dist/mtx/commands/uplink/ActivateRatePlanResponse.js +1 -1
  197. package/dist/mtx/commands/uplink/ActivateRatePlanResponse.js.map +1 -1
  198. package/dist/mtx/commands/uplink/ErrorResponse.js +1 -1
  199. package/dist/mtx/commands/uplink/ErrorResponse.js.map +1 -1
  200. package/dist/mtx/commands/uplink/GetDateTimeResponse.js +3 -3
  201. package/dist/mtx/commands/uplink/GetDateTimeResponse.js.map +1 -1
  202. package/dist/mtx/commands/uplink/GetDayProfileResponse.d.ts +18 -0
  203. package/dist/mtx/commands/uplink/GetDayProfileResponse.js +74 -0
  204. package/dist/mtx/commands/uplink/GetDayProfileResponse.js.map +1 -0
  205. package/dist/mtx/commands/uplink/GetDeviceIdResponse.js +1 -1
  206. package/dist/mtx/commands/uplink/GetDeviceIdResponse.js.map +1 -1
  207. package/dist/mtx/commands/uplink/GetDeviceTypeResponse.d.ts +15 -0
  208. package/dist/mtx/commands/uplink/GetDeviceTypeResponse.js +54 -0
  209. package/dist/mtx/commands/uplink/GetDeviceTypeResponse.js.map +1 -0
  210. package/dist/mtx/commands/uplink/GetDisplayParamResponse.js +1 -1
  211. package/dist/mtx/commands/uplink/GetDisplayParamResponse.js.map +1 -1
  212. package/dist/mtx/commands/uplink/GetOpParamsResponse.js +1 -1
  213. package/dist/mtx/commands/uplink/GetOpParamsResponse.js.map +1 -1
  214. package/dist/mtx/commands/uplink/GetRatePlanInfoResponse.js +1 -1
  215. package/dist/mtx/commands/uplink/GetRatePlanInfoResponse.js.map +1 -1
  216. package/dist/mtx/commands/uplink/GetSeasonProfileResponse.d.ts +15 -0
  217. package/dist/mtx/commands/uplink/GetSeasonProfileResponse.js +44 -0
  218. package/dist/mtx/commands/uplink/GetSeasonProfileResponse.js.map +1 -0
  219. package/dist/mtx/commands/uplink/GetSpecialDayResponse.d.ts +15 -0
  220. package/dist/mtx/commands/uplink/GetSpecialDayResponse.js +45 -0
  221. package/dist/mtx/commands/uplink/GetSpecialDayResponse.js.map +1 -0
  222. package/dist/mtx/commands/uplink/PrepareRatePlanResponse.js +1 -1
  223. package/dist/mtx/commands/uplink/PrepareRatePlanResponse.js.map +1 -1
  224. package/dist/mtx/commands/uplink/RunTariffPlanResponse.js +1 -1
  225. package/dist/mtx/commands/uplink/RunTariffPlanResponse.js.map +1 -1
  226. package/dist/mtx/commands/uplink/SetAccessKeyResponse.d.ts +13 -0
  227. package/dist/mtx/commands/uplink/SetAccessKeyResponse.js +31 -0
  228. package/dist/mtx/commands/uplink/SetAccessKeyResponse.js.map +1 -0
  229. package/dist/mtx/commands/uplink/SetCorrectDateTimeResponse.d.ts +13 -0
  230. package/dist/mtx/commands/uplink/SetCorrectDateTimeResponse.js +31 -0
  231. package/dist/mtx/commands/uplink/SetCorrectDateTimeResponse.js.map +1 -0
  232. package/dist/mtx/commands/uplink/SetDateTimeResponse.d.ts +13 -0
  233. package/dist/mtx/commands/uplink/SetDateTimeResponse.js +31 -0
  234. package/dist/mtx/commands/uplink/SetDateTimeResponse.js.map +1 -0
  235. package/dist/mtx/commands/uplink/SetDayProfileResponse.js +1 -1
  236. package/dist/mtx/commands/uplink/SetDayProfileResponse.js.map +1 -1
  237. package/dist/mtx/commands/uplink/SetDisplayParamResponse.js +1 -1
  238. package/dist/mtx/commands/uplink/SetDisplayParamResponse.js.map +1 -1
  239. package/dist/mtx/commands/uplink/SetOpParamsResponse.js +1 -1
  240. package/dist/mtx/commands/uplink/SetOpParamsResponse.js.map +1 -1
  241. package/dist/mtx/commands/uplink/SetSeasonProfileResponse.js +1 -1
  242. package/dist/mtx/commands/uplink/SetSeasonProfileResponse.js.map +1 -1
  243. package/dist/mtx/commands/uplink/SetSpecialDayResponse.js +1 -1
  244. package/dist/mtx/commands/uplink/SetSpecialDayResponse.js.map +1 -1
  245. package/dist/mtx/commands/uplink/TurnRelayOffResponse.js +1 -1
  246. package/dist/mtx/commands/uplink/TurnRelayOffResponse.js.map +1 -1
  247. package/dist/mtx/commands/uplink/TurnRelayOnResponse.js +1 -1
  248. package/dist/mtx/commands/uplink/TurnRelayOnResponse.js.map +1 -1
  249. package/dist/mtx/commands/uplink/index.d.ts +7 -0
  250. package/dist/mtx/commands/uplink/index.js +7 -0
  251. package/dist/mtx/commands/uplink/index.js.map +1 -1
  252. package/dist/mtx/constants/commandRelations.d.ts +4 -2
  253. package/dist/mtx/constants/commandRelations.js +3 -4
  254. package/dist/mtx/constants/commandRelations.js.map +1 -1
  255. package/dist/mtx/constants/index.d.ts +1 -2
  256. package/dist/mtx/constants/index.js +1 -2
  257. package/dist/mtx/constants/index.js.map +1 -1
  258. package/dist/mtx/constants/meterTypes.d.ts +3 -0
  259. package/dist/mtx/constants/meterTypes.js +4 -0
  260. package/dist/mtx/constants/meterTypes.js.map +1 -0
  261. package/dist/mtx/constants/resultCodes.js +5 -5
  262. package/dist/mtx/constants/resultCodes.js.map +1 -1
  263. package/dist/mtx/message.d.ts +0 -8
  264. package/dist/mtx/message.js +8 -10
  265. package/dist/mtx/message.js.map +1 -1
  266. package/dist/mtx/utils/crypto.d.ts +0 -2
  267. package/dist/mtx/utils/crypto.js +2 -17
  268. package/dist/mtx/utils/crypto.js.map +1 -1
  269. package/dist/obis-observer/commands/downlink/GetArchiveState.js +1 -1
  270. package/dist/obis-observer/commands/downlink/GetArchiveState.js.map +1 -1
  271. package/dist/obis-observer/commands/downlink/GetLorawanInfo.js +1 -1
  272. package/dist/obis-observer/commands/downlink/GetLorawanInfo.js.map +1 -1
  273. package/dist/obis-observer/commands/downlink/GetLorawanState.js +1 -1
  274. package/dist/obis-observer/commands/downlink/GetLorawanState.js.map +1 -1
  275. package/dist/obis-observer/commands/downlink/GetMeterDate.js +1 -1
  276. package/dist/obis-observer/commands/downlink/GetMeterDate.js.map +1 -1
  277. package/dist/obis-observer/commands/downlink/GetMeterId.js +1 -1
  278. package/dist/obis-observer/commands/downlink/GetMeterId.js.map +1 -1
  279. package/dist/obis-observer/commands/downlink/GetMeterIdList.js +1 -1
  280. package/dist/obis-observer/commands/downlink/GetMeterIdList.js.map +1 -1
  281. package/dist/obis-observer/commands/downlink/GetMeterInfo.js +1 -1
  282. package/dist/obis-observer/commands/downlink/GetMeterInfo.js.map +1 -1
  283. package/dist/obis-observer/commands/downlink/GetMeterProfile.js +1 -1
  284. package/dist/obis-observer/commands/downlink/GetMeterProfile.js.map +1 -1
  285. package/dist/obis-observer/commands/downlink/GetMeterProfileIdList.js +1 -1
  286. package/dist/obis-observer/commands/downlink/GetMeterProfileIdList.js.map +1 -1
  287. package/dist/obis-observer/commands/downlink/GetMeterReadoutState.js +1 -1
  288. package/dist/obis-observer/commands/downlink/GetMeterReadoutState.js.map +1 -1
  289. package/dist/obis-observer/commands/downlink/GetObisContent.js +1 -1
  290. package/dist/obis-observer/commands/downlink/GetObisContent.js.map +1 -1
  291. package/dist/obis-observer/commands/downlink/GetObisContentById.js +1 -1
  292. package/dist/obis-observer/commands/downlink/GetObisContentById.js.map +1 -1
  293. package/dist/obis-observer/commands/downlink/GetObisIdList.js +1 -1
  294. package/dist/obis-observer/commands/downlink/GetObisIdList.js.map +1 -1
  295. package/dist/obis-observer/commands/downlink/GetObisInfo.js +1 -1
  296. package/dist/obis-observer/commands/downlink/GetObisInfo.js.map +1 -1
  297. package/dist/obis-observer/commands/downlink/GetObserverCapabilities.js +1 -1
  298. package/dist/obis-observer/commands/downlink/GetObserverCapabilities.js.map +1 -1
  299. package/dist/obis-observer/commands/downlink/GetObserverInfo.js +1 -1
  300. package/dist/obis-observer/commands/downlink/GetObserverInfo.js.map +1 -1
  301. package/dist/obis-observer/commands/downlink/GetObserverSingleMode.js +1 -1
  302. package/dist/obis-observer/commands/downlink/GetObserverSingleMode.js.map +1 -1
  303. package/dist/obis-observer/commands/downlink/GetObserverUptime.js +1 -1
  304. package/dist/obis-observer/commands/downlink/GetObserverUptime.js.map +1 -1
  305. package/dist/obis-observer/commands/downlink/ReadArchive.js +1 -1
  306. package/dist/obis-observer/commands/downlink/ReadArchive.js.map +1 -1
  307. package/dist/obis-observer/commands/downlink/ReadMeterArchive.js +1 -1
  308. package/dist/obis-observer/commands/downlink/ReadMeterArchive.js.map +1 -1
  309. package/dist/obis-observer/commands/downlink/ReadMeterArchiveWithDate.js +1 -1
  310. package/dist/obis-observer/commands/downlink/ReadMeterArchiveWithDate.js.map +1 -1
  311. package/dist/obis-observer/commands/downlink/Reboot.js +1 -1
  312. package/dist/obis-observer/commands/downlink/Reboot.js.map +1 -1
  313. package/dist/obis-observer/commands/downlink/RemoveMeter.js +1 -1
  314. package/dist/obis-observer/commands/downlink/RemoveMeter.js.map +1 -1
  315. package/dist/obis-observer/commands/downlink/RemoveMeterProfile.js +1 -1
  316. package/dist/obis-observer/commands/downlink/RemoveMeterProfile.js.map +1 -1
  317. package/dist/obis-observer/commands/downlink/RemoveObis.js +1 -1
  318. package/dist/obis-observer/commands/downlink/RemoveObis.js.map +1 -1
  319. package/dist/obis-observer/commands/downlink/SetLorawanActivationMethod.js +1 -1
  320. package/dist/obis-observer/commands/downlink/SetLorawanActivationMethod.js.map +1 -1
  321. package/dist/obis-observer/commands/downlink/SetObserverSingleMode.js +1 -1
  322. package/dist/obis-observer/commands/downlink/SetObserverSingleMode.js.map +1 -1
  323. package/dist/obis-observer/commands/downlink/SetSerialPort.js +1 -1
  324. package/dist/obis-observer/commands/downlink/SetSerialPort.js.map +1 -1
  325. package/dist/obis-observer/commands/downlink/SetupMeter.js +1 -1
  326. package/dist/obis-observer/commands/downlink/SetupMeter.js.map +1 -1
  327. package/dist/obis-observer/commands/downlink/SetupMeterProfile.js +1 -1
  328. package/dist/obis-observer/commands/downlink/SetupMeterProfile.js.map +1 -1
  329. package/dist/obis-observer/commands/downlink/SetupObis.js +1 -1
  330. package/dist/obis-observer/commands/downlink/SetupObis.js.map +1 -1
  331. package/dist/obis-observer/commands/downlink/UpdateImageVerify.js +1 -1
  332. package/dist/obis-observer/commands/downlink/UpdateImageVerify.js.map +1 -1
  333. package/dist/obis-observer/commands/downlink/UpdateImageWrite.js +1 -1
  334. package/dist/obis-observer/commands/downlink/UpdateImageWrite.js.map +1 -1
  335. package/dist/obis-observer/commands/downlink/UpdateRun.js +1 -1
  336. package/dist/obis-observer/commands/downlink/UpdateRun.js.map +1 -1
  337. package/dist/obis-observer/commands/uplink/ErrorResponse.js +1 -1
  338. package/dist/obis-observer/commands/uplink/ErrorResponse.js.map +1 -1
  339. package/dist/obis-observer/commands/uplink/GetArchiveStateResponse.js +1 -1
  340. package/dist/obis-observer/commands/uplink/GetArchiveStateResponse.js.map +1 -1
  341. package/dist/obis-observer/commands/uplink/GetLorawanInfoResponse.js +1 -1
  342. package/dist/obis-observer/commands/uplink/GetLorawanInfoResponse.js.map +1 -1
  343. package/dist/obis-observer/commands/uplink/GetLorawanStateResponse.js +1 -1
  344. package/dist/obis-observer/commands/uplink/GetLorawanStateResponse.js.map +1 -1
  345. package/dist/obis-observer/commands/uplink/GetMeterDateResponse.js +1 -1
  346. package/dist/obis-observer/commands/uplink/GetMeterDateResponse.js.map +1 -1
  347. package/dist/obis-observer/commands/uplink/GetMeterIdListResponse.js +1 -1
  348. package/dist/obis-observer/commands/uplink/GetMeterIdListResponse.js.map +1 -1
  349. package/dist/obis-observer/commands/uplink/GetMeterIdResponse.js +1 -1
  350. package/dist/obis-observer/commands/uplink/GetMeterIdResponse.js.map +1 -1
  351. package/dist/obis-observer/commands/uplink/GetMeterInfoResponse.js +1 -1
  352. package/dist/obis-observer/commands/uplink/GetMeterInfoResponse.js.map +1 -1
  353. package/dist/obis-observer/commands/uplink/GetMeterProfileIdListResponse.js +1 -1
  354. package/dist/obis-observer/commands/uplink/GetMeterProfileIdListResponse.js.map +1 -1
  355. package/dist/obis-observer/commands/uplink/GetMeterProfileResponse.js +1 -1
  356. package/dist/obis-observer/commands/uplink/GetMeterProfileResponse.js.map +1 -1
  357. package/dist/obis-observer/commands/uplink/GetMeterReadoutStateResponse.js +1 -1
  358. package/dist/obis-observer/commands/uplink/GetMeterReadoutStateResponse.js.map +1 -1
  359. package/dist/obis-observer/commands/uplink/GetObisContentByIdResponse.js +1 -1
  360. package/dist/obis-observer/commands/uplink/GetObisContentByIdResponse.js.map +1 -1
  361. package/dist/obis-observer/commands/uplink/GetObisContentByIdStringResponse.js +1 -1
  362. package/dist/obis-observer/commands/uplink/GetObisContentByIdStringResponse.js.map +1 -1
  363. package/dist/obis-observer/commands/uplink/GetObisContentResponse.js +1 -1
  364. package/dist/obis-observer/commands/uplink/GetObisContentResponse.js.map +1 -1
  365. package/dist/obis-observer/commands/uplink/GetObisIdListResponse.js +1 -1
  366. package/dist/obis-observer/commands/uplink/GetObisIdListResponse.js.map +1 -1
  367. package/dist/obis-observer/commands/uplink/GetObisInfoResponse.js +1 -1
  368. package/dist/obis-observer/commands/uplink/GetObisInfoResponse.js.map +1 -1
  369. package/dist/obis-observer/commands/uplink/GetObserverCapabilitiesResponse.js +1 -1
  370. package/dist/obis-observer/commands/uplink/GetObserverCapabilitiesResponse.js.map +1 -1
  371. package/dist/obis-observer/commands/uplink/GetObserverInfoResponse.js +1 -1
  372. package/dist/obis-observer/commands/uplink/GetObserverInfoResponse.js.map +1 -1
  373. package/dist/obis-observer/commands/uplink/GetObserverSingleModeResponse.js +1 -1
  374. package/dist/obis-observer/commands/uplink/GetObserverSingleModeResponse.js.map +1 -1
  375. package/dist/obis-observer/commands/uplink/GetObserverUptimeResponse.js +1 -1
  376. package/dist/obis-observer/commands/uplink/GetObserverUptimeResponse.js.map +1 -1
  377. package/dist/obis-observer/commands/uplink/ObservationReport.js +1 -1
  378. package/dist/obis-observer/commands/uplink/ObservationReport.js.map +1 -1
  379. package/dist/obis-observer/commands/uplink/ObservationReportString.js +1 -1
  380. package/dist/obis-observer/commands/uplink/ObservationReportString.js.map +1 -1
  381. package/dist/obis-observer/commands/uplink/ReadArchiveResponse.js +1 -1
  382. package/dist/obis-observer/commands/uplink/ReadArchiveResponse.js.map +1 -1
  383. package/dist/obis-observer/commands/uplink/ReadMeterArchiveResponse.js +1 -1
  384. package/dist/obis-observer/commands/uplink/ReadMeterArchiveResponse.js.map +1 -1
  385. package/dist/obis-observer/commands/uplink/ReadMeterArchiveWithDateResponse.js +1 -1
  386. package/dist/obis-observer/commands/uplink/ReadMeterArchiveWithDateResponse.js.map +1 -1
  387. package/dist/obis-observer/commands/uplink/RebootResponse.js +1 -1
  388. package/dist/obis-observer/commands/uplink/RebootResponse.js.map +1 -1
  389. package/dist/obis-observer/commands/uplink/RemoveMeterProfileResponse.js +1 -1
  390. package/dist/obis-observer/commands/uplink/RemoveMeterProfileResponse.js.map +1 -1
  391. package/dist/obis-observer/commands/uplink/RemoveMeterResponse.js +1 -1
  392. package/dist/obis-observer/commands/uplink/RemoveMeterResponse.js.map +1 -1
  393. package/dist/obis-observer/commands/uplink/RemoveObisResponse.js +1 -1
  394. package/dist/obis-observer/commands/uplink/RemoveObisResponse.js.map +1 -1
  395. package/dist/obis-observer/commands/uplink/SetLorawanActivationMethodResponse.js +1 -1
  396. package/dist/obis-observer/commands/uplink/SetLorawanActivationMethodResponse.js.map +1 -1
  397. package/dist/obis-observer/commands/uplink/SetObserverSingleModeResponse.js +1 -1
  398. package/dist/obis-observer/commands/uplink/SetObserverSingleModeResponse.js.map +1 -1
  399. package/dist/obis-observer/commands/uplink/SetSerialPortResponse.js +1 -1
  400. package/dist/obis-observer/commands/uplink/SetSerialPortResponse.js.map +1 -1
  401. package/dist/obis-observer/commands/uplink/SetupMeterProfileResponse.js +1 -1
  402. package/dist/obis-observer/commands/uplink/SetupMeterProfileResponse.js.map +1 -1
  403. package/dist/obis-observer/commands/uplink/SetupMeterResponse.js +1 -1
  404. package/dist/obis-observer/commands/uplink/SetupMeterResponse.js.map +1 -1
  405. package/dist/obis-observer/commands/uplink/SetupObisResponse.js +1 -1
  406. package/dist/obis-observer/commands/uplink/SetupObisResponse.js.map +1 -1
  407. package/dist/obis-observer/commands/uplink/UpdateImageVerifyResponse.js +1 -1
  408. package/dist/obis-observer/commands/uplink/UpdateImageVerifyResponse.js.map +1 -1
  409. package/dist/obis-observer/commands/uplink/UpdateImageWriteResponse.js +1 -1
  410. package/dist/obis-observer/commands/uplink/UpdateImageWriteResponse.js.map +1 -1
  411. package/dist/obis-observer/commands/uplink/UpdateRunResponse.js +1 -1
  412. package/dist/obis-observer/commands/uplink/UpdateRunResponse.js.map +1 -1
  413. package/dist/obis-observer/constants/commandRelations.d.ts +4 -2
  414. package/dist/obis-observer/constants/commandRelations.js +2 -4
  415. package/dist/obis-observer/constants/commandRelations.js.map +1 -1
  416. package/dist/obis-observer/constants/index.d.ts +0 -1
  417. package/dist/obis-observer/constants/index.js +0 -1
  418. package/dist/obis-observer/constants/index.js.map +1 -1
  419. package/dist/obis-observer/message.d.ts +0 -8
  420. package/dist/obis-observer/message.js +2 -5
  421. package/dist/obis-observer/message.js.map +1 -1
  422. package/dist/utils/BinaryBuffer.d.ts +2 -0
  423. package/dist/utils/BinaryBuffer.js +12 -1
  424. package/dist/utils/BinaryBuffer.js.map +1 -1
  425. package/dist/utils/calculateCrc16.d.ts +6 -0
  426. package/dist/utils/calculateCrc16.js +22 -0
  427. package/dist/utils/calculateCrc16.js.map +1 -0
  428. package/dist/utils/calculateCrc32.d.ts +5 -0
  429. package/dist/utils/calculateCrc32.js +28 -0
  430. package/dist/utils/calculateCrc32.js.map +1 -0
  431. package/dist/utils/calculateLrc.d.ts +2 -0
  432. package/dist/utils/calculateLrc.js +8 -0
  433. package/dist/utils/calculateLrc.js.map +1 -0
  434. package/dist/utils/frame.d.ts +14 -0
  435. package/dist/utils/frame.js +85 -0
  436. package/dist/utils/frame.js.map +1 -0
  437. package/dist/utils/frameCollector.d.ts +12 -0
  438. package/dist/utils/frameCollector.js +43 -0
  439. package/dist/utils/frameCollector.js.map +1 -0
  440. package/dist/utils/index.d.ts +1 -0
  441. package/dist/utils/index.js +1 -0
  442. package/dist/utils/index.js.map +1 -1
  443. package/package.json +1 -1
  444. package/dist/analog/constants/directions.js.map +0 -1
  445. package/dist/mtx/constants/directions.d.ts +0 -3
  446. package/dist/mtx/constants/directions.js +0 -4
  447. package/dist/mtx/constants/directions.js.map +0 -1
  448. package/dist/mtx/constants/frameAttributes.js.map +0 -1
  449. package/dist/obis-observer/constants/directions.d.ts +0 -2
  450. package/dist/obis-observer/constants/directions.js +0 -3
  451. package/dist/obis-observer/constants/directions.js.map +0 -1
  452. /package/dist/{analog/constants → constants}/directions.d.ts +0 -0
  453. /package/dist/{analog/constants → constants}/directions.js +0 -0
  454. /package/dist/{mtx/constants → constants}/frameAttributes.d.ts +0 -0
  455. /package/dist/{mtx/constants → constants}/frameAttributes.js +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"Time2000.js","sourceR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AAG,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,SAAS,EAAC,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAC,OAAO,IAAI,OAAO,EAAC,MAAM,cAAc,CAAC;AAChD,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,EAAC,MAAM,gCAAgC,CAAC;AACpF,OAAO,EAAC,OAAO,IAAI,uBAAuB,EAAC,MAAM,8BAA8B,CAAC;AAChF,OAAO,EAAC,OAAO,IAAI,6BAA6B,EAAC,MAAM,oCAAoC,CAAC;AAC5F,OAAO,EAAC,OAAO,IAAI,8BAA8B,EAAC,MAAM,qCAAqC,CAAC;AAC9F,OAAO,EA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AM,eAAe,CAAC;AAClD,OAAO,EAAC,OAAO,IAAI,iBAAiB,EAAC,MAAM,wBAAwB,CAAC;AACpE,OAAO,EAAC,OAAO,IAAI,mBAAmB,EAAC,MAAM,0BAA0B,CAAC;AACxE,OAAO,EAAC,OAAO,IAAI,kBAAkB,EAAC,MAAM,yBAAyB,CAAC"}
@@ -0,0 +1,6 @@
1
+ import * as downlinkCommands from '../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,gBAAgB,CAAC,CAAC,GAAG,CAAC,OAA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C,cAAc,CAAC,8BAA8B,EAAE,gBAAgB,CAAC,sBAAsB,CAAC,CAAC;AAC9G,iBAAiB,CAAC,GAAG,CAAC,cAAc,CAAC,mBAAmB,EAAE,gBAAgB,CAAC,WAAW,CAAC,CAAC;AACxF,iBAAiB,CAAC,GAAG,CAAC,cAAc,CAAC,oBAAoB,EAAE,gBAAgB,CAAC,YAAY,CAAC,CAAC;AAC1F,iBAAiB,CAAC,GAAG,CAAC,cAAc,CAAC,oBAAoB,EAAE,gBAAgB,CAAC,YAAY,CAAC,CAAC;AAC1F,iBAAiB,CAAC,GAAG,CAAC,cAAc,CAAC,mBAAmB,EAAE,gBAAgB,CAAC,WAAW,CAAC,CAAC;AACxF,iBAAiB,CAAC,GAAG,CAAC,cAAc,CAAC,mBAAmB,EAAE,gBAAgB,CAAC,WAAW,CAAC,CAAC;AACxF,iBAAiB,CAAC,GAAG,CAAC,cAAc,CAAC,MAAM,EAAE,gBAAgB,CAAC,SAAS,CAAC,CAAC;AACzE,iBAAiB,CAAC,GAAG,CAAC,cAAc,CAAC,QAAQ,EAAE,gBAAgB,CAAC,WAAW,CAAC,CAAC;AAC7E,iBAAiB,CAAC,GAAG,CAAC,cAAc,CAAC,iBAAiB,EAAE,gBAAgB,CAAC,SAAS,CAAC,CAAC;AACpF,iBAAiB,CAAC,GAAG,CAAC,cAAc,CAAC,mBAAmB,EAAE,gBAAgB,CAAC,WAAW,CAAC,CAAC;AACxF,iBAAiB,CAAC,GAAG,CAAC,cAAc,CAAC,kBAAkB,EAAE,gBAAgB,CAAC,UAAU,CAAC,CAAC;AAEtF,KAAM,MAAM,CAAC,QAAQ,EAAE,OAAO,CAAC,IAAI,iBAAiB,CAAC,OAAO,EAAE,EAAG;IAE7D,iBAAiB,CAAC,GAAG,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;CAC5C"}
@@ -1,4 +1,3 @@
1
1
  export * as deviceParameters from './deviceParameters.js';
2
- export * as directions from './directions.js';
3
2
  export * as events from './events.js';
4
3
  export * as hardwareTypes from './hardwareTypes.js';
@@ -1,5 +1,4 @@
1
1
  export * as deviceParameters from './deviceParameters.js';
2
- export * as directions from './directions.js';
3
2
  export * as events from './events.js';
4
3
  export * as hardwareTypes from './hardwareTypes.js';
5
4
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
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,UAAU,MAAM,iBAAiB,CAAC;AAC9C,OAAO,KAAK,MAAM,MAAM,aAAa,CAAC;AACtC,OAAO,KAAK,aAAa,MAAM,oBAAoB,CAAC"}
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"}
@@ -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;
@@ -1,9 +1,9 @@
1
1
  import UnknownCommand from './UnknownCommand.js';
2
- import * as downlinkCommands from './commands/downlink/index.js';
3
- import * as uplinkCommands from './commands/uplink/index.js';
4
- import * as directionTypes from './constants/directions.js';
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 = downlinkCommandsById[id];
28
- const uplinkCommand = uplinkCommandsById[id];
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":"AAGA,OAAO,cAAc,MAAM,qBAAqB,CAAC;AACjD,OAAO,KAAK,gBAAgB,MAAM,8BAA8B,CAAC;AACjE,OAAO,KAAK,cAAc,MAAM,4BAA4B,CAAC;AAE7D,OAAO,KAAK,cAAc,MAAM,2BAA2B,CAAC;AAC5D,OAAO,EAAC,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAC,MAAM,2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EF,MAAM,CAAC,MAAM,UAAU,GAAG,CAAE,IAAY,EAAG,EAAE,CAAC,CAC1C,SAAS,CAAC,kBAAkB,CAAC,IAAI,CAAC,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,2 @@
1
+ export * as frameAttributes from './frameAttributes.js';
2
+ export * as directions from './directions.js';
@@ -0,0 +1,3 @@
1
+ export * as frameAttributes from './frameAttributes.js';
2
+ export * as directions from './directions.js';
3
+ //# sourceMappingURL=index.js.map
@@ -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
- year: date.getFullYear() - 2000,
135
- month: date.getMonth() + 1,
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
- hours: date.getHours(),
139
- minutes: date.getMinutes(),
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.getHexString(3);
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.getHexString(3);
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.setHexString(manufacturer);
410
+ this.setBytes(getBytesFromHex(manufacturer));
404
411
  this.setUint8(type);
405
412
  this.setUint8(year - 2000);
406
- this.setHexString(serial);
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;