jooby-codec 1.14.0 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (396) hide show
  1. package/dist/analog/Command.d.ts +29 -0
  2. package/dist/analog/Command.js +34 -0
  3. package/dist/analog/Command.js.map +1 -0
  4. package/dist/{CommandBinaryBuffer.d.ts → analog/CommandBinaryBuffer.d.ts} +3 -208
  5. package/dist/{CommandBinaryBuffer.js → analog/CommandBinaryBuffer.js} +8 -80
  6. package/dist/analog/CommandBinaryBuffer.js.map +1 -0
  7. package/dist/{UnknownCommand.d.ts → analog/UnknownCommand.d.ts} +0 -8
  8. package/dist/{UnknownCommand.js → analog/UnknownCommand.js} +0 -5
  9. package/dist/analog/UnknownCommand.js.map +1 -0
  10. package/dist/analog/commands/downlink/CorrectTime2000.d.ts +16 -0
  11. package/dist/{commands → analog/commands}/downlink/CorrectTime2000.js +3 -23
  12. package/dist/analog/commands/downlink/CorrectTime2000.js.map +1 -0
  13. package/dist/analog/commands/downlink/GetArchiveDaysMC.d.ts +18 -0
  14. package/dist/{commands → analog/commands}/downlink/GetArchiveDaysMC.js +3 -27
  15. package/dist/analog/commands/downlink/GetArchiveDaysMC.js.map +1 -0
  16. package/dist/analog/commands/downlink/GetArchiveEvents.d.ts +17 -0
  17. package/dist/{commands → analog/commands}/downlink/GetArchiveEvents.js +0 -19
  18. package/dist/analog/commands/downlink/GetArchiveEvents.js.map +1 -0
  19. package/dist/analog/commands/downlink/GetArchiveHoursMC.d.ts +18 -0
  20. package/dist/{commands → analog/commands}/downlink/GetArchiveHoursMC.js +3 -22
  21. package/dist/analog/commands/downlink/GetArchiveHoursMC.js.map +1 -0
  22. package/dist/analog/commands/downlink/GetCurrentMC.d.ts +10 -0
  23. package/dist/analog/commands/downlink/GetCurrentMC.js +23 -0
  24. package/dist/analog/commands/downlink/GetCurrentMC.js.map +1 -0
  25. package/dist/analog/commands/downlink/GetExAbsArchiveDaysMC.d.ts +18 -0
  26. package/dist/{commands → analog/commands}/downlink/GetExAbsArchiveDaysMC.js +3 -24
  27. package/dist/analog/commands/downlink/GetExAbsArchiveDaysMC.js.map +1 -0
  28. package/dist/analog/commands/downlink/GetExAbsArchiveHoursMC.d.ts +18 -0
  29. package/dist/{commands → analog/commands}/downlink/GetExAbsArchiveHoursMC.js +3 -23
  30. package/dist/analog/commands/downlink/GetExAbsArchiveHoursMC.js.map +1 -0
  31. package/dist/analog/commands/downlink/GetExAbsCurrentMC.d.ts +11 -0
  32. package/dist/{commands → analog/commands}/downlink/GetExAbsCurrentMC.js +0 -20
  33. package/dist/analog/commands/downlink/GetExAbsCurrentMC.js.map +1 -0
  34. package/dist/analog/commands/downlink/GetLmicInfo.d.ts +10 -0
  35. package/dist/analog/commands/downlink/GetLmicInfo.js +23 -0
  36. package/dist/analog/commands/downlink/GetLmicInfo.js.map +1 -0
  37. package/dist/analog/commands/downlink/GetParameter.d.ts +15 -0
  38. package/dist/{commands → analog/commands}/downlink/GetParameter.js +0 -20
  39. package/dist/analog/commands/downlink/GetParameter.js.map +1 -0
  40. package/dist/analog/commands/downlink/GetStatus.d.ts +11 -0
  41. package/dist/{commands → analog/commands}/downlink/GetStatus.js +0 -19
  42. package/dist/analog/commands/downlink/GetStatus.js.map +1 -0
  43. package/dist/analog/commands/downlink/SetParameter.d.ts +13 -0
  44. package/dist/{commands → analog/commands}/downlink/SetParameter.js +2 -21
  45. package/dist/analog/commands/downlink/SetParameter.js.map +1 -0
  46. package/dist/analog/commands/downlink/SetTime2000.d.ts +16 -0
  47. package/dist/{commands → analog/commands}/downlink/SetTime2000.js +3 -22
  48. package/dist/analog/commands/downlink/SetTime2000.js.map +1 -0
  49. package/dist/analog/commands/downlink/SoftRestart.d.ts +10 -0
  50. package/dist/analog/commands/downlink/SoftRestart.js +23 -0
  51. package/dist/analog/commands/downlink/SoftRestart.js.map +1 -0
  52. package/dist/{commands → analog/commands}/downlink/index.d.ts +0 -5
  53. package/dist/{commands → analog/commands}/downlink/index.js +0 -5
  54. package/dist/analog/commands/downlink/index.js.map +1 -0
  55. package/dist/{commands → analog/commands}/index.d.ts +0 -5
  56. package/dist/{commands → analog/commands}/index.js +0 -5
  57. package/dist/analog/commands/index.js.map +1 -0
  58. package/dist/analog/commands/uplink/CorrectTime2000Response.d.ts +15 -0
  59. package/dist/{commands → analog/commands}/uplink/CorrectTime2000Response.js +3 -23
  60. package/dist/analog/commands/uplink/CorrectTime2000Response.js.map +1 -0
  61. package/dist/{commands → analog/commands}/uplink/CurrentMC.d.ts +0 -24
  62. package/dist/{commands → analog/commands}/uplink/CurrentMC.js +0 -24
  63. package/dist/analog/commands/uplink/CurrentMC.js.map +1 -0
  64. package/dist/analog/commands/uplink/DayMC.d.ts +17 -0
  65. package/dist/{commands → analog/commands}/uplink/DayMC.js +1 -33
  66. package/dist/analog/commands/uplink/DayMC.js.map +1 -0
  67. package/dist/analog/commands/uplink/ExAbsCurrentMC.d.ts +16 -0
  68. package/dist/{commands → analog/commands}/uplink/ExAbsCurrentMC.js +0 -29
  69. package/dist/analog/commands/uplink/ExAbsCurrentMC.js.map +1 -0
  70. package/dist/analog/commands/uplink/ExAbsDayMC.d.ts +19 -0
  71. package/dist/{commands → analog/commands}/uplink/ExAbsDayMC.js +1 -31
  72. package/dist/analog/commands/uplink/ExAbsDayMC.js.map +1 -0
  73. package/dist/analog/commands/uplink/ExAbsHourMC.d.ts +19 -0
  74. package/dist/{commands → analog/commands}/uplink/ExAbsHourMC.js +1 -36
  75. package/dist/analog/commands/uplink/ExAbsHourMC.js.map +1 -0
  76. package/dist/analog/commands/uplink/GetArchiveDaysMCResponse.d.ts +19 -0
  77. package/dist/{commands → analog/commands}/uplink/GetArchiveDaysMCResponse.js +1 -33
  78. package/dist/analog/commands/uplink/GetArchiveDaysMCResponse.js.map +1 -0
  79. package/dist/analog/commands/uplink/GetArchiveEventsResponse.d.ts +21 -0
  80. package/dist/{commands → analog/commands}/uplink/GetArchiveEventsResponse.js +0 -26
  81. package/dist/analog/commands/uplink/GetArchiveEventsResponse.js.map +1 -0
  82. package/dist/analog/commands/uplink/GetArchiveHoursMCResponse.d.ts +19 -0
  83. package/dist/{commands → analog/commands}/uplink/GetArchiveHoursMCResponse.js +0 -33
  84. package/dist/analog/commands/uplink/GetArchiveHoursMCResponse.js.map +1 -0
  85. package/dist/analog/commands/uplink/GetExAbsArchiveDaysMCResponse.d.ts +19 -0
  86. package/dist/{commands → analog/commands}/uplink/GetExAbsArchiveDaysMCResponse.js +1 -33
  87. package/dist/analog/commands/uplink/GetExAbsArchiveDaysMCResponse.js.map +1 -0
  88. package/dist/{commands → analog/commands}/uplink/GetExAbsArchiveHoursMCResponse.d.ts +1 -26
  89. package/dist/{commands → analog/commands}/uplink/GetExAbsArchiveHoursMCResponse.js +1 -31
  90. package/dist/analog/commands/uplink/GetExAbsArchiveHoursMCResponse.js.map +1 -0
  91. package/dist/analog/commands/uplink/GetLmicInfoResponse.d.ts +21 -0
  92. package/dist/{commands → analog/commands}/uplink/GetLmicInfoResponse.js +4 -29
  93. package/dist/analog/commands/uplink/GetLmicInfoResponse.js.map +1 -0
  94. package/dist/analog/commands/uplink/GetParameterResponse.d.ts +13 -0
  95. package/dist/{commands → analog/commands}/uplink/GetParameterResponse.js +0 -24
  96. package/dist/analog/commands/uplink/GetParameterResponse.js.map +1 -0
  97. package/dist/analog/commands/uplink/HourMC.d.ts +20 -0
  98. package/dist/{commands → analog/commands}/uplink/HourMC.js +1 -35
  99. package/dist/analog/commands/uplink/HourMC.js.map +1 -0
  100. package/dist/analog/commands/uplink/LastEvent.d.ts +21 -0
  101. package/dist/{commands → analog/commands}/uplink/LastEvent.js +22 -48
  102. package/dist/analog/commands/uplink/LastEvent.js.map +1 -0
  103. package/dist/{commands → analog/commands}/uplink/NewEvent.d.ts +1 -42
  104. package/dist/{commands → analog/commands}/uplink/NewEvent.js +2 -32
  105. package/dist/analog/commands/uplink/NewEvent.js.map +1 -0
  106. package/dist/analog/commands/uplink/SetTime2000Response.d.ts +15 -0
  107. package/dist/{commands → analog/commands}/uplink/SetTime2000Response.js +3 -22
  108. package/dist/analog/commands/uplink/SetTime2000Response.js.map +1 -0
  109. package/dist/analog/commands/uplink/SoftRestartResponse.d.ts +10 -0
  110. package/dist/analog/commands/uplink/SoftRestartResponse.js +23 -0
  111. package/dist/analog/commands/uplink/SoftRestartResponse.js.map +1 -0
  112. package/dist/analog/commands/uplink/Status.d.ts +23 -0
  113. package/dist/{commands → analog/commands}/uplink/Status.js +1 -33
  114. package/dist/analog/commands/uplink/Status.js.map +1 -0
  115. package/dist/analog/commands/uplink/Time2000.d.ts +17 -0
  116. package/dist/{commands → analog/commands}/uplink/Time2000.js +2 -22
  117. package/dist/analog/commands/uplink/Time2000.js.map +1 -0
  118. package/dist/{commands → analog/commands}/uplink/index.d.ts +0 -5
  119. package/dist/{commands → analog/commands}/uplink/index.js +0 -5
  120. package/dist/analog/commands/uplink/index.js.map +1 -0
  121. package/dist/analog/constants/deviceParameters.d.ts +18 -0
  122. package/dist/analog/constants/deviceParameters.js +19 -0
  123. package/dist/analog/constants/deviceParameters.js.map +1 -0
  124. package/dist/analog/constants/directions.js.map +1 -0
  125. package/dist/analog/constants/events.d.ts +21 -0
  126. package/dist/analog/constants/events.js +22 -0
  127. package/dist/analog/constants/events.js.map +1 -0
  128. package/dist/analog/constants/hardwareTypes.d.ts +13 -0
  129. package/dist/analog/constants/hardwareTypes.js +14 -0
  130. package/dist/analog/constants/hardwareTypes.js.map +1 -0
  131. package/dist/analog/constants/index.js.map +1 -0
  132. package/dist/{constants → analog/constants}/rx2SpreadFactors.d.ts +0 -5
  133. package/dist/{constants → analog/constants}/rx2SpreadFactors.js +0 -5
  134. package/dist/analog/constants/rx2SpreadFactors.js.map +1 -0
  135. package/dist/{utils → analog}/header.d.ts +1 -1
  136. package/dist/{utils → analog}/header.js +2 -4
  137. package/dist/analog/header.js.map +1 -0
  138. package/dist/analog/index.d.ts +3 -0
  139. package/dist/analog/index.js +4 -0
  140. package/dist/analog/index.js.map +1 -0
  141. package/dist/{utils → analog}/message.d.ts +8 -13
  142. package/dist/{utils → analog}/message.js +13 -32
  143. package/dist/analog/message.js.map +1 -0
  144. package/dist/config.d.ts +5 -0
  145. package/dist/config.js +5 -0
  146. package/dist/config.js.map +1 -0
  147. package/dist/index.d.ts +3 -3
  148. package/dist/index.js +3 -3
  149. package/dist/index.js.map +1 -1
  150. package/dist/{Command.d.ts → obis-observer/Command.d.ts} +2 -27
  151. package/dist/obis-observer/Command.js +33 -0
  152. package/dist/obis-observer/Command.js.map +1 -0
  153. package/dist/obis-observer/CommandBinaryBuffer.d.ts +56 -0
  154. package/dist/obis-observer/CommandBinaryBuffer.js +138 -0
  155. package/dist/obis-observer/CommandBinaryBuffer.js.map +1 -0
  156. package/dist/obis-observer/UnknownCommand.d.ts +12 -0
  157. package/dist/obis-observer/UnknownCommand.js +17 -0
  158. package/dist/obis-observer/UnknownCommand.js.map +1 -0
  159. package/dist/obis-observer/commands/downlink/AddShortNameProfile.d.ts +17 -0
  160. package/dist/obis-observer/commands/downlink/AddShortNameProfile.js +55 -0
  161. package/dist/obis-observer/commands/downlink/AddShortNameProfile.js.map +1 -0
  162. package/dist/obis-observer/commands/downlink/GetArchiveProfile.d.ts +13 -0
  163. package/dist/obis-observer/commands/downlink/GetArchiveProfile.js +39 -0
  164. package/dist/obis-observer/commands/downlink/GetArchiveProfile.js.map +1 -0
  165. package/dist/obis-observer/commands/downlink/GetContentByObis.d.ts +16 -0
  166. package/dist/obis-observer/commands/downlink/GetContentByObis.js +48 -0
  167. package/dist/obis-observer/commands/downlink/GetContentByObis.js.map +1 -0
  168. package/dist/obis-observer/commands/downlink/GetContentByShortName.d.ts +17 -0
  169. package/dist/obis-observer/commands/downlink/GetContentByShortName.js +44 -0
  170. package/dist/obis-observer/commands/downlink/GetContentByShortName.js.map +1 -0
  171. package/dist/obis-observer/commands/downlink/GetShortNameInfo.d.ts +17 -0
  172. package/dist/obis-observer/commands/downlink/GetShortNameInfo.js +44 -0
  173. package/dist/obis-observer/commands/downlink/GetShortNameInfo.js.map +1 -0
  174. package/dist/obis-observer/commands/downlink/GetShortNameProfile.d.ts +16 -0
  175. package/dist/obis-observer/commands/downlink/GetShortNameProfile.js +45 -0
  176. package/dist/obis-observer/commands/downlink/GetShortNameProfile.js.map +1 -0
  177. package/dist/obis-observer/commands/downlink/GetShortNames.d.ts +16 -0
  178. package/dist/obis-observer/commands/downlink/GetShortNames.js +48 -0
  179. package/dist/obis-observer/commands/downlink/GetShortNames.js.map +1 -0
  180. package/dist/obis-observer/commands/downlink/ReadArchive.d.ts +17 -0
  181. package/dist/obis-observer/commands/downlink/ReadArchive.js +58 -0
  182. package/dist/obis-observer/commands/downlink/ReadArchive.js.map +1 -0
  183. package/dist/obis-observer/commands/downlink/Reboot.d.ts +13 -0
  184. package/dist/obis-observer/commands/downlink/Reboot.js +39 -0
  185. package/dist/obis-observer/commands/downlink/Reboot.js.map +1 -0
  186. package/dist/obis-observer/commands/downlink/RemoveShortNameProfile.d.ts +16 -0
  187. package/dist/obis-observer/commands/downlink/RemoveShortNameProfile.js +42 -0
  188. package/dist/obis-observer/commands/downlink/RemoveShortNameProfile.js.map +1 -0
  189. package/dist/obis-observer/commands/downlink/SetArchiveProfile.d.ts +17 -0
  190. package/dist/obis-observer/commands/downlink/SetArchiveProfile.js +45 -0
  191. package/dist/obis-observer/commands/downlink/SetArchiveProfile.js.map +1 -0
  192. package/dist/obis-observer/commands/downlink/SetSerialPort.d.ts +19 -0
  193. package/dist/obis-observer/commands/downlink/SetSerialPort.js +61 -0
  194. package/dist/obis-observer/commands/downlink/SetSerialPort.js.map +1 -0
  195. package/dist/obis-observer/commands/downlink/SetShortName.d.ts +17 -0
  196. package/dist/obis-observer/commands/downlink/SetShortName.js +51 -0
  197. package/dist/obis-observer/commands/downlink/SetShortName.js.map +1 -0
  198. package/dist/obis-observer/commands/downlink/index.d.ts +13 -0
  199. package/dist/obis-observer/commands/downlink/index.js +14 -0
  200. package/dist/obis-observer/commands/downlink/index.js.map +1 -0
  201. package/dist/obis-observer/commands/index.d.ts +2 -0
  202. package/dist/obis-observer/commands/index.js +3 -0
  203. package/dist/obis-observer/commands/index.js.map +1 -0
  204. package/dist/obis-observer/commands/uplink/AddShortNameProfileResponse.d.ts +16 -0
  205. package/dist/obis-observer/commands/uplink/AddShortNameProfileResponse.js +43 -0
  206. package/dist/obis-observer/commands/uplink/AddShortNameProfileResponse.js.map +1 -0
  207. package/dist/obis-observer/commands/uplink/GetArchiveProfileResponse.d.ts +17 -0
  208. package/dist/obis-observer/commands/uplink/GetArchiveProfileResponse.js +45 -0
  209. package/dist/obis-observer/commands/uplink/GetArchiveProfileResponse.js.map +1 -0
  210. package/dist/obis-observer/commands/uplink/GetContentByObisResponse.d.ts +16 -0
  211. package/dist/obis-observer/commands/uplink/GetContentByObisResponse.js +45 -0
  212. package/dist/obis-observer/commands/uplink/GetContentByObisResponse.js.map +1 -0
  213. package/dist/obis-observer/commands/uplink/GetContentByShortNameResponse.d.ts +16 -0
  214. package/dist/obis-observer/commands/uplink/GetContentByShortNameResponse.js +44 -0
  215. package/dist/obis-observer/commands/uplink/GetContentByShortNameResponse.js.map +1 -0
  216. package/dist/obis-observer/commands/uplink/GetContentByShortNameStringResponse.d.ts +16 -0
  217. package/dist/obis-observer/commands/uplink/GetContentByShortNameStringResponse.js +45 -0
  218. package/dist/obis-observer/commands/uplink/GetContentByShortNameStringResponse.js.map +1 -0
  219. package/dist/obis-observer/commands/uplink/GetShortNameInfoResponse.d.ts +17 -0
  220. package/dist/obis-observer/commands/uplink/GetShortNameInfoResponse.js +74 -0
  221. package/dist/obis-observer/commands/uplink/GetShortNameInfoResponse.js.map +1 -0
  222. package/dist/obis-observer/commands/uplink/GetShortNameProfileResponse.d.ts +16 -0
  223. package/dist/obis-observer/commands/uplink/GetShortNameProfileResponse.js +54 -0
  224. package/dist/obis-observer/commands/uplink/GetShortNameProfileResponse.js.map +1 -0
  225. package/dist/obis-observer/commands/uplink/GetShortNamesResponse.d.ts +16 -0
  226. package/dist/obis-observer/commands/uplink/GetShortNamesResponse.js +45 -0
  227. package/dist/obis-observer/commands/uplink/GetShortNamesResponse.js.map +1 -0
  228. package/dist/obis-observer/commands/uplink/ObservationReport.d.ts +17 -0
  229. package/dist/obis-observer/commands/uplink/ObservationReport.js +57 -0
  230. package/dist/obis-observer/commands/uplink/ObservationReport.js.map +1 -0
  231. package/dist/obis-observer/commands/uplink/ObservationReportString.d.ts +17 -0
  232. package/dist/obis-observer/commands/uplink/ObservationReportString.js +62 -0
  233. package/dist/obis-observer/commands/uplink/ObservationReportString.js.map +1 -0
  234. package/dist/obis-observer/commands/uplink/ReadArchiveResponse.d.ts +17 -0
  235. package/dist/obis-observer/commands/uplink/ReadArchiveResponse.js +61 -0
  236. package/dist/obis-observer/commands/uplink/ReadArchiveResponse.js.map +1 -0
  237. package/dist/obis-observer/commands/uplink/RebootResponse.d.ts +13 -0
  238. package/dist/obis-observer/commands/uplink/RebootResponse.js +36 -0
  239. package/dist/obis-observer/commands/uplink/RebootResponse.js.map +1 -0
  240. package/dist/obis-observer/commands/uplink/RemoveShortNameProfileResponse.d.ts +16 -0
  241. package/dist/obis-observer/commands/uplink/RemoveShortNameProfileResponse.js +43 -0
  242. package/dist/obis-observer/commands/uplink/RemoveShortNameProfileResponse.js.map +1 -0
  243. package/dist/obis-observer/commands/uplink/SetArchiveProfileResponse.d.ts +16 -0
  244. package/dist/obis-observer/commands/uplink/SetArchiveProfileResponse.js +51 -0
  245. package/dist/obis-observer/commands/uplink/SetArchiveProfileResponse.js.map +1 -0
  246. package/dist/obis-observer/commands/uplink/SetSerialPortResponse.d.ts +16 -0
  247. package/dist/obis-observer/commands/uplink/SetSerialPortResponse.js +51 -0
  248. package/dist/obis-observer/commands/uplink/SetSerialPortResponse.js.map +1 -0
  249. package/dist/obis-observer/commands/uplink/SetShortNameResponse.d.ts +16 -0
  250. package/dist/obis-observer/commands/uplink/SetShortNameResponse.js +43 -0
  251. package/dist/obis-observer/commands/uplink/SetShortNameResponse.js.map +1 -0
  252. package/dist/obis-observer/commands/uplink/index.d.ts +16 -0
  253. package/dist/obis-observer/commands/uplink/index.js +17 -0
  254. package/dist/obis-observer/commands/uplink/index.js.map +1 -0
  255. package/dist/obis-observer/constants/archiveTypes.d.ts +3 -0
  256. package/dist/obis-observer/constants/archiveTypes.js +4 -0
  257. package/dist/obis-observer/constants/archiveTypes.js.map +1 -0
  258. package/dist/obis-observer/constants/contentTypes.d.ts +3 -0
  259. package/dist/obis-observer/constants/contentTypes.js +4 -0
  260. package/dist/obis-observer/constants/contentTypes.js.map +1 -0
  261. package/dist/obis-observer/constants/directions.d.ts +2 -0
  262. package/dist/obis-observer/constants/directions.js +3 -0
  263. package/dist/obis-observer/constants/directions.js.map +1 -0
  264. package/dist/obis-observer/constants/index.d.ts +5 -0
  265. package/dist/obis-observer/constants/index.js +6 -0
  266. package/dist/obis-observer/constants/index.js.map +1 -0
  267. package/dist/obis-observer/constants/parityTypes.d.ts +3 -0
  268. package/dist/obis-observer/constants/parityTypes.js +4 -0
  269. package/dist/obis-observer/constants/parityTypes.js.map +1 -0
  270. package/dist/obis-observer/constants/resultCodes.d.ts +6 -0
  271. package/dist/obis-observer/constants/resultCodes.js +7 -0
  272. package/dist/obis-observer/constants/resultCodes.js.map +1 -0
  273. package/dist/obis-observer/index.d.ts +3 -0
  274. package/dist/obis-observer/index.js +4 -0
  275. package/dist/obis-observer/index.js.map +1 -0
  276. package/dist/obis-observer/message.d.ts +18 -0
  277. package/dist/obis-observer/message.js +58 -0
  278. package/dist/obis-observer/message.js.map +1 -0
  279. package/dist/{BinaryBuffer.d.ts → utils/BinaryBuffer.d.ts} +3 -17
  280. package/dist/{BinaryBuffer.js → utils/BinaryBuffer.js} +17 -19
  281. package/dist/utils/BinaryBuffer.js.map +1 -0
  282. package/dist/utils/bitSet.d.ts +2 -36
  283. package/dist/utils/bitSet.js +10 -36
  284. package/dist/utils/bitSet.js.map +1 -1
  285. package/dist/utils/getBytesFromHex.d.ts +0 -9
  286. package/dist/utils/getBytesFromHex.js +0 -10
  287. package/dist/utils/getBytesFromHex.js.map +1 -1
  288. package/dist/utils/getHexFromBytes.d.ts +1 -25
  289. package/dist/utils/getHexFromBytes.js +2 -16
  290. package/dist/utils/getHexFromBytes.js.map +1 -1
  291. package/dist/utils/getHexFromNumber.d.ts +3 -0
  292. package/dist/utils/getHexFromNumber.js +20 -0
  293. package/dist/utils/getHexFromNumber.js.map +1 -0
  294. package/dist/utils/index.d.ts +3 -1
  295. package/dist/utils/index.js +2 -0
  296. package/dist/utils/index.js.map +1 -1
  297. package/dist/utils/time.d.ts +0 -24
  298. package/dist/utils/time.js +0 -12
  299. package/dist/utils/time.js.map +1 -1
  300. package/package.json +13 -9
  301. package/readme.md +19 -12
  302. package/dist/BinaryBuffer.js.map +0 -1
  303. package/dist/Command.js +0 -89
  304. package/dist/Command.js.map +0 -1
  305. package/dist/CommandBinaryBuffer.js.map +0 -1
  306. package/dist/UnknownCommand.js.map +0 -1
  307. package/dist/commands/downlink/CorrectTime2000.d.ts +0 -46
  308. package/dist/commands/downlink/CorrectTime2000.js.map +0 -1
  309. package/dist/commands/downlink/GetArchiveDaysMC.d.ts +0 -45
  310. package/dist/commands/downlink/GetArchiveDaysMC.js.map +0 -1
  311. package/dist/commands/downlink/GetArchiveEvents.d.ts +0 -40
  312. package/dist/commands/downlink/GetArchiveEvents.js.map +0 -1
  313. package/dist/commands/downlink/GetArchiveHoursMC.d.ts +0 -40
  314. package/dist/commands/downlink/GetArchiveHoursMC.js.map +0 -1
  315. package/dist/commands/downlink/GetCurrentMC.d.ts +0 -26
  316. package/dist/commands/downlink/GetCurrentMC.js +0 -42
  317. package/dist/commands/downlink/GetCurrentMC.js.map +0 -1
  318. package/dist/commands/downlink/GetExAbsArchiveDaysMC.d.ts +0 -41
  319. package/dist/commands/downlink/GetExAbsArchiveDaysMC.js.map +0 -1
  320. package/dist/commands/downlink/GetExAbsArchiveHoursMC.d.ts +0 -40
  321. package/dist/commands/downlink/GetExAbsArchiveHoursMC.js.map +0 -1
  322. package/dist/commands/downlink/GetExAbsCurrentMC.d.ts +0 -27
  323. package/dist/commands/downlink/GetExAbsCurrentMC.js.map +0 -1
  324. package/dist/commands/downlink/GetLmicInfo.d.ts +0 -26
  325. package/dist/commands/downlink/GetLmicInfo.js +0 -42
  326. package/dist/commands/downlink/GetLmicInfo.js.map +0 -1
  327. package/dist/commands/downlink/GetParameter.d.ts +0 -38
  328. package/dist/commands/downlink/GetParameter.js.map +0 -1
  329. package/dist/commands/downlink/GetStatus.d.ts +0 -27
  330. package/dist/commands/downlink/GetStatus.js.map +0 -1
  331. package/dist/commands/downlink/SetParameter.d.ts +0 -30
  332. package/dist/commands/downlink/SetParameter.js.map +0 -1
  333. package/dist/commands/downlink/SetTime2000.d.ts +0 -42
  334. package/dist/commands/downlink/SetTime2000.js.map +0 -1
  335. package/dist/commands/downlink/SoftRestart.d.ts +0 -26
  336. package/dist/commands/downlink/SoftRestart.js +0 -42
  337. package/dist/commands/downlink/SoftRestart.js.map +0 -1
  338. package/dist/commands/downlink/index.js.map +0 -1
  339. package/dist/commands/index.js.map +0 -1
  340. package/dist/commands/uplink/CorrectTime2000Response.d.ts +0 -39
  341. package/dist/commands/uplink/CorrectTime2000Response.js.map +0 -1
  342. package/dist/commands/uplink/CurrentMC.js.map +0 -1
  343. package/dist/commands/uplink/DayMC.d.ts +0 -47
  344. package/dist/commands/uplink/DayMC.js.map +0 -1
  345. package/dist/commands/uplink/ExAbsCurrentMC.d.ts +0 -41
  346. package/dist/commands/uplink/ExAbsCurrentMC.js.map +0 -1
  347. package/dist/commands/uplink/ExAbsDayMC.d.ts +0 -45
  348. package/dist/commands/uplink/ExAbsDayMC.js.map +0 -1
  349. package/dist/commands/uplink/ExAbsHourMC.d.ts +0 -69
  350. package/dist/commands/uplink/ExAbsHourMC.js.map +0 -1
  351. package/dist/commands/uplink/GetArchiveDaysMCResponse.d.ts +0 -58
  352. package/dist/commands/uplink/GetArchiveDaysMCResponse.js.map +0 -1
  353. package/dist/commands/uplink/GetArchiveEventsResponse.d.ts +0 -54
  354. package/dist/commands/uplink/GetArchiveEventsResponse.js.map +0 -1
  355. package/dist/commands/uplink/GetArchiveHoursMCResponse.d.ts +0 -50
  356. package/dist/commands/uplink/GetArchiveHoursMCResponse.js.map +0 -1
  357. package/dist/commands/uplink/GetExAbsArchiveDaysMCResponse.d.ts +0 -47
  358. package/dist/commands/uplink/GetExAbsArchiveDaysMCResponse.js.map +0 -1
  359. package/dist/commands/uplink/GetExAbsArchiveHoursMCResponse.js.map +0 -1
  360. package/dist/commands/uplink/GetLmicInfoResponse.d.ts +0 -52
  361. package/dist/commands/uplink/GetLmicInfoResponse.js.map +0 -1
  362. package/dist/commands/uplink/GetParameterResponse.d.ts +0 -35
  363. package/dist/commands/uplink/GetParameterResponse.js.map +0 -1
  364. package/dist/commands/uplink/HourMC.d.ts +0 -48
  365. package/dist/commands/uplink/HourMC.js.map +0 -1
  366. package/dist/commands/uplink/LastEvent.d.ts +0 -54
  367. package/dist/commands/uplink/LastEvent.js.map +0 -1
  368. package/dist/commands/uplink/NewEvent.js.map +0 -1
  369. package/dist/commands/uplink/SetTime2000Response.d.ts +0 -38
  370. package/dist/commands/uplink/SetTime2000Response.js.map +0 -1
  371. package/dist/commands/uplink/SoftRestartResponse.d.ts +0 -28
  372. package/dist/commands/uplink/SoftRestartResponse.js +0 -44
  373. package/dist/commands/uplink/SoftRestartResponse.js.map +0 -1
  374. package/dist/commands/uplink/Status.d.ts +0 -55
  375. package/dist/commands/uplink/Status.js.map +0 -1
  376. package/dist/commands/uplink/Time2000.d.ts +0 -43
  377. package/dist/commands/uplink/Time2000.js.map +0 -1
  378. package/dist/commands/uplink/index.js.map +0 -1
  379. package/dist/constants/deviceParameters.d.ts +0 -53
  380. package/dist/constants/deviceParameters.js +0 -54
  381. package/dist/constants/deviceParameters.js.map +0 -1
  382. package/dist/constants/directions.js.map +0 -1
  383. package/dist/constants/events.d.ts +0 -42
  384. package/dist/constants/events.js +0 -43
  385. package/dist/constants/events.js.map +0 -1
  386. package/dist/constants/hardwareTypes.d.ts +0 -108
  387. package/dist/constants/hardwareTypes.js +0 -109
  388. package/dist/constants/hardwareTypes.js.map +0 -1
  389. package/dist/constants/index.js.map +0 -1
  390. package/dist/constants/rx2SpreadFactors.js.map +0 -1
  391. package/dist/utils/header.js.map +0 -1
  392. package/dist/utils/message.js.map +0 -1
  393. /package/dist/{constants → analog/constants}/directions.d.ts +0 -0
  394. /package/dist/{constants → analog/constants}/directions.js +0 -0
  395. /package/dist/{constants → analog/constants}/index.d.ts +0 -0
  396. /package/dist/{constants → analog/constants}/index.js +0 -0
@@ -1,12 +1,9 @@
1
- /* eslint-disable @typescript-eslint/no-unsafe-assignment */
2
1
  import Command from '../../Command.js';
3
2
  import CommandBinaryBuffer from '../../CommandBinaryBuffer.js';
4
- import { getSecondsFromDate } from '../../utils/time.js';
3
+ import { getSecondsFromDate } from '../../../utils/time.js';
5
4
  import CurrentMC from './CurrentMC.js';
6
5
  import { UPLINK } from '../../constants/directions.js';
7
6
  const COMMAND_ID = 0x16;
8
- // 2 byte for date + 2 for channels (max channels: 7)
9
- // 4 + (7 * 4)
10
7
  const COMMAND_BODY_MAX_SIZE = 32;
11
8
  const examples = [
12
9
  {
@@ -23,39 +20,11 @@ const examples = [
23
20
  hex: { header: '16 08', body: '2f 97 55 0c 83 01 08 0a' }
24
21
  }
25
22
  ];
26
- /**
27
- * Uplink command.
28
- *
29
- * @example create command instance from command body hex dump
30
- * ```js
31
- * import DayMC from 'jooby-codec/commands/uplink/DayMC';
32
- *
33
- * const commandBody = new Uint8Array([
34
- * 0x2f, 0x97, 0x55, 0x0c, 0x83, 0x01, 0x08, 0x0a
35
- * ]);
36
- * const command = DayMC.fromBytes(commandBody);
37
- *
38
- * console.log(command.parameters);
39
- * // output:
40
- * {
41
- * startTime: 756604800,
42
- * channelList: [,
43
- * {value: 12, index: 1}
44
- * {value: 131, index: 3},
45
- * {value: 8, index: 5},
46
- * {value: 10, index: 7}
47
- * ]
48
- * }
49
- * ```
50
- *
51
- * [Command format documentation](https://github.com/jooby-dev/jooby-docs/blob/main/docs/commands/uplink/DayMC.md)
52
- */
53
23
  class DayMC extends CurrentMC {
54
24
  constructor(parameters) {
55
25
  super(parameters);
56
26
  this.parameters = parameters;
57
27
  }
58
- // data - only body (without header)
59
28
  static fromBytes(data) {
60
29
  const parameters = { channelList: [], startTime: 0 };
61
30
  const buffer = new CommandBinaryBuffer(data);
@@ -68,7 +37,6 @@ class DayMC extends CurrentMC {
68
37
  parameters.startTime = getSecondsFromDate(date);
69
38
  return new DayMC(parameters);
70
39
  }
71
- // returns full message - header with body
72
40
  toBytes() {
73
41
  const buffer = new CommandBinaryBuffer(COMMAND_BODY_MAX_SIZE);
74
42
  const { channelList, startTime } = this.parameters;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DayMC.js","sourceRoot":"","sources":["../../../../src/analog/commands/uplink/DayMC.ts"],"names":[],"mappings":"AAEA,OAAO,OAA8B,MAAM,kBAAkB,CAAC;AAC9D,OAAO,mBAAoC,MAAM,8BAA8B,CAAC;AAChF,OAAO,EAAC,kBAAkB,EAAY,MAAM,wBAAwB,CAAC;AACrE,OAAO,SAAiC,MAAM,gBAAgB,CAAC;AAC/D,OAAO,EAAC,MAAM,EAAC,MAAM,+BAA+B,CAAC;AAWrD,MAAM,UAAU,GAAG,IAAI,CAAC;AAIxB,MAAM,qBAAqB,GAAG,EAAE,CAAC;AAEjC,MAAM,QAAQ,GAAwB;IAClC;QACI,IAAI,EAAE,uCAAuC;QAC7C,UAAU,EAAE;YACR,SAAS,EAAE,SAAS;YACpB,WAAW,EAAE;gBACT,EAAC,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,GAAG,EAAC;gBACtB,EAAC,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAC;gBACpB,EAAC,KAAK,EAAE,CAAC,EA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AE,EAAE,CAAC,MAAM,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC,CAAC;QAEjE,OAAO,OAAO,CAAC,OAAO,CAAC,UAAU,EAAE,MAAM,CAAC,gBAAgB,EAAE,CAAC,CAAC;IAClE,CAAC;;AApCe,QAAE,GAAG,UAAU,CAAC;AAEhB,mBAAa,GAAG,MAAM,CAAC;AAEvB,cAAQ,GAAG,QAAQ,CAAC;AAEpB,mBAAa,GAAG,IAAI,CAAC;AAkCzC,eAAe,KAAK,CAAC"}
@@ -0,0 +1,16 @@
1
+ import Command, { TCommandExampleList } from '../../Command.js';
2
+ import { IChannelAbsoluteValue } from '../../CommandBinaryBuffer.js';
3
+ interface IExAbsCurrentMCParameters {
4
+ channelList: Array<IChannelAbsoluteValue>;
5
+ }
6
+ declare class ExAbsCurrentMC extends Command {
7
+ parameters: IExAbsCurrentMCParameters;
8
+ constructor(parameters: IExAbsCurrentMCParameters);
9
+ static id: number;
10
+ static readonly directionType = 2;
11
+ static readonly examples: TCommandExampleList;
12
+ static readonly hasParameters = true;
13
+ static fromBytes(data: Uint8Array): ExAbsCurrentMC;
14
+ toBytes(): Uint8Array;
15
+ }
16
+ export default ExAbsCurrentMC;
@@ -2,8 +2,6 @@ import Command from '../../Command.js';
2
2
  import CommandBinaryBuffer from '../../CommandBinaryBuffer.js';
3
3
  import { UPLINK } from '../../constants/directions.js';
4
4
  const COMMAND_ID = 0x0f1f;
5
- // channelList 3 byte (max channelList: 14)
6
- // 3 + (14 * (1 byte pulse coefficient + 5 bytes of day values))
7
5
  const COMMAND_BODY_MAX_SIZE = 87;
8
6
  const examples = [
9
7
  {
@@ -16,43 +14,16 @@ const examples = [
16
14
  hex: { header: '1f 0f 04', body: '04 83 d6 02' }
17
15
  }
18
16
  ];
19
- /**
20
- * Uplink command.
21
- *
22
- * @example create command instance from command body hex dump
23
- * ```js
24
- * import ExAbsCurrentMC from 'jooby-codec/commands/uplink/ExAbsCurrentMC';
25
- *
26
- * const commandBody = new Uint8Array([0x04, 0x82, 0xd6, 0x02']);
27
- * const command = ExAbsCurrentMC.fromBytes(commandBody);
28
- *
29
- * console.log(command.parameters);
30
- * // output:
31
- * {
32
- * channelList: [
33
- * {
34
- * pulseCoefficient: 100,
35
- * index: 3,
36
- * value: 342
37
- * }
38
- * ]
39
- * }
40
- * ```
41
- *
42
- * [Command format documentation](https://github.com/jooby-dev/jooby-docs/blob/main/docs/commands/uplink/ExAbsCurrentMC.md)
43
- */
44
17
  class ExAbsCurrentMC extends Command {
45
18
  constructor(parameters) {
46
19
  super();
47
20
  this.parameters = parameters;
48
21
  this.parameters.channelList = this.parameters.channelList.sort((a, b) => a.index - b.index);
49
22
  }
50
- // data - only body (without header)
51
23
  static fromBytes(data) {
52
24
  const buffer = new CommandBinaryBuffer(data);
53
25
  return new ExAbsCurrentMC({ channelList: buffer.getChannelsWithAbsoluteValues() });
54
26
  }
55
- // returns full message - header with body
56
27
  toBytes() {
57
28
  const buffer = new CommandBinaryBuffer(COMMAND_BODY_MAX_SIZE);
58
29
  const { channelList } = this.parameters;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExAbsCurrentMC.js","sourceRoot":"","sources":["../../../../src/analog/commands/uplink/ExAbsCurrentMC.ts"],"names":[],"mappings":"AAAA,OAAO,OAA8B,MAAM,kBAAkB,CAAC;AAC9D,OAAO,mBAA4C,MAAM,8BAA8B,CAAC;AACxF,OAAO,EAAC,MAAM,EAAC,MAAM,+BAA+B,CAAC;AAOrD,MAAM,UAAU,GAAG,MAAM,CAAC;AAI1B,MAAM,qBAAqB,GAAG,EAAE,CAAC;AAEjC,MAAM,QAAQ,GAAwB;IAClC;QACI,IAAI,EAAE,uCAAuC;QAC7C,UAAU,EAAE;YACR,WAAW,EAAE;gBACT,EAAC,gBAAgB,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,GAAG,EAAC;aAChD;SACJ;QACD,GAAG,EAAE,EAAC,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE,aAAa,EAAC;KACjD;CACJ,CAAC;AA4BF,MAAM,cAAe,SAAQ,OAAO;IAChC,YAAqB,UAAqC;QACtD,KAAK,EAAE,CAAC;QADS,eAAU,GAAV,UAAU,CAA2B;QAGtD,IAAI,CAAC,UAAU,CAAC,WAAW,GAAG,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC;IAChG,CAAC;IAaD,MAAM,CAAC,SAAS,CAAG,IAAgB;QAC/B,MAAM,MAAM,GAAG,IAAI,mBAAmB,CAAC,IAAI,CAAC,CAAC;QAE7C,OAAO,IAAI,cAAc,CAAC,EAAC,WAAW,EAAE,MAAM,CAAC,6BAA6B,EAAE,EAAC,CAAC,CAAC;IACrF,CAAC;IAGD,OAAO;QACH,MAAM,MAAM,GAAG,IAAI,mBAAmB,CAAC,qBAAqB,CAAC,CAAC;QAC9D,MAAM,EAAC,WAAW,EAAC,GAAG,IAAI,CAAC,UAAU,CAAC;QAEtC,MAAM,CAAC,6BAA6B,CAAC,WAAW,CAAC,CAAC;QAElD,OAAO,OAAO,CAAC,OAAO,CAAC,UAAU,EAAE,MAAM,CAAC,gBAAgB,EAAE,CAAC,CAAC;IAClE,CAAC;;AAxBM,iBAAE,GAAG,UAAU,CAAC;AAEP,4BAAa,GAAG,MAAM,CAAC;AAEvB,uBAAQ,GAAG,QAAQ,CAAC;AAEpB,4BAAa,GAAG,IAAI,CAAC;AAsBzC,eAAe,cAAc,CAAC"}
@@ -0,0 +1,19 @@
1
+ import { TCommandExampleList } from '../../Command.js';
2
+ import CurrentMC from './CurrentMC.js';
3
+ import { IChannelAbsoluteValue } from '../../CommandBinaryBuffer.js';
4
+ import { TTime2000 } from '../../../utils/time.js';
5
+ interface IExAbsDayMCParameters {
6
+ channelList: Array<IChannelAbsoluteValue>;
7
+ startTime: TTime2000;
8
+ }
9
+ declare class ExAbsDayMC extends CurrentMC {
10
+ parameters: IExAbsDayMCParameters;
11
+ constructor(parameters: IExAbsDayMCParameters);
12
+ static id: number;
13
+ static readonly directionType = 2;
14
+ static readonly examples: TCommandExampleList;
15
+ static readonly hasParameters = true;
16
+ static fromBytes(data: Uint8Array): ExAbsDayMC;
17
+ toBytes(): Uint8Array;
18
+ }
19
+ export default ExAbsDayMC;
@@ -2,10 +2,8 @@ import Command from '../../Command.js';
2
2
  import CurrentMC from './CurrentMC.js';
3
3
  import CommandBinaryBuffer from '../../CommandBinaryBuffer.js';
4
4
  import { UPLINK } from '../../constants/directions.js';
5
- import { getSecondsFromDate } from '../../utils/time.js';
5
+ import { getSecondsFromDate } from '../../../utils/time.js';
6
6
  const COMMAND_ID = 0x0b1f;
7
- // date 2 bytes, channelList 3 bytes (max channelList: 14)
8
- // 5 + (14 channelList * (1 byte pulse coefficient + 5 bytes of day values))
9
7
  const COMMAND_BODY_MAX_SIZE = 89;
10
8
  const examples = [
11
9
  {
@@ -19,45 +17,17 @@ const examples = [
19
17
  hex: { header: '1f 0b 06', body: '2e 6a 01 83 d6 02' }
20
18
  }
21
19
  ];
22
- /**
23
- * Uplink command.
24
- *
25
- * @example create command instance from command body hex dump
26
- * ```js
27
- * import ExAbsDayMC from 'jooby-codec/commands/uplink/ExAbsDayMC';
28
- *
29
- * const commandBody = new Uint8Array([0x2e, 0x6a, 0x01, 0x82, 0xd6, 0x02']);
30
- * const command = ExAbsDayMC.fromBytes(commandBody);
31
- *
32
- * console.log(command.parameters);
33
- * // output:
34
- * {
35
- * startTime: 731721600,
36
- * channelList: [
37
- * {
38
- * pulseCoefficient: 100,
39
- * index: 1,
40
- * value: 342
41
- * }
42
- * ]
43
- * }
44
- * ```
45
- *
46
- * [Command format documentation](https://github.com/jooby-dev/jooby-docs/blob/main/docs/commands/uplink/ExAbsDayMC.md)
47
- */
48
20
  class ExAbsDayMC extends CurrentMC {
49
21
  constructor(parameters) {
50
22
  super(parameters);
51
23
  this.parameters = parameters;
52
24
  }
53
- // data - only body (without header)
54
25
  static fromBytes(data) {
55
26
  const buffer = new CommandBinaryBuffer(data);
56
27
  const date = buffer.getDate();
57
28
  const channelList = buffer.getChannelsWithAbsoluteValues();
58
29
  return new ExAbsDayMC({ channelList, startTime: getSecondsFromDate(date) });
59
30
  }
60
- // returns full message - header with body
61
31
  toBytes() {
62
32
  const buffer = new CommandBinaryBuffer(COMMAND_BODY_MAX_SIZE);
63
33
  const { channelList, startTime } = this.parameters;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExAbsDayMC.js","sourceRoot":"","sources":["../../../../src/analog/commands/uplink/ExAbsDayMC.ts"],"names":[],"mappings":"AAAA,OAAO,OAA8B,MAAM,kBAAkB,CAAC;AAC9D,OAAO,SAAS,MAAM,gBAAgB,CAAC;AACvC,OAAO,mBAA4C,MAAM,8BAA8B,CAAC;AACxF,OAAO,EAAC,MAAM,EAAC,MAAM,+BAA+B,CAAC;AACrD,OAAO,EAAC,kBAAkB,EAAY,MAAM,wBAAwB,CAAC;AASrE,MAAM,UAAU,GAAG,MAAM,CAAC;AAI1B,MAAM,qBAAqB,GAAG,EAAE,CAAC;AAEjC,MAAM,QAAQ,GAAwB;IAClC;QACI,IAAI,EAAE,gDAAgD;QACtD,UAAU,EAAE;YACR,SAAS,EAAE,SAAS;YACpB,WAAW,EAAE;gBACT,EAAC,gBAAgB,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,GAAG,EAAC;aAChD;SACJ;QACD,GAAG,EAAE,EAAC,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE,mBAAmB,EAAC;KACvD;CACJ,CAAC;AA6BF,MAAM,UAAW,SAAQ,SAAS;IAC9B,YAAqB,UAAiC;QAClD,KAAK,CAAC,UAAU,CAAC,CAAC;QADD,eAAU,GAAV,UAAU,CAAuB;IAEtD,CAAC;IAaD,MAAM,CAAC,SAAS,CAAG,IAAgB;QAC/B,MAAM,MAAM,GAAG,IAAI,mBAAmB,CAAC,IAAI,CAAC,CAAC;QAC7C,MAAM,IAAI,GAAG,MAAM,CAAC,OAAO,EAAE,CAAC;QAC9B,MAAM,WAAW,GAAG,MAAM,CAAC,6BAA6B,EAAE,CAAC;QAE3D,OAAO,IAAI,UAAU,CAAC,EAAC,WAAW,EAAE,SAAS,EAAE,kBAAkB,CAAC,IAAI,CAAC,EAAC,CAAC,CAAC;IAC9E,CAAC;IAGD,OAAO;QACH,MAAM,MAAM,GAAG,IAAI,mBAAmB,CAAC,qBAAqB,CAAC,CAAC;QAC9D,MAAM,EAAC,WAAW,EAAE,SAAS,EAAC,GAAG,IAAI,CAAC,UAAU,CAAC;QAEjD,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;QAC1B,MAAM,CAAC,6BAA6B,CAAC,WAAW,CAAC,CAAC;QAElD,OAAO,OAAO,CAAC,OAAO,CAAC,UAAU,EAAE,MAAM,CAAC,gBAAgB,EAAE,CAAC,CAAC;IAClE,CAAC;;AA3BM,aAAE,GAAG,UAAU,CAAC;AAEP,wBAAa,GAAG,MAAM,CAAC;AAEvB,mBAAQ,GAAG,QAAQ,CAAC;AAEpB,wBAAa,GAAG,IAAI,CAAC;AAyBzC,eAAe,UAAU,CAAC"}
@@ -0,0 +1,19 @@
1
+ import Command, { TCommandExampleList } from '../../Command.js';
2
+ import { TTime2000 } from '../../../utils/time.js';
3
+ import { IChannelHourAbsoluteValue } from '../../CommandBinaryBuffer.js';
4
+ interface IUplinkExAbsHourMCParameters {
5
+ channelList: Array<IChannelHourAbsoluteValue>;
6
+ startTime: TTime2000;
7
+ hours: number;
8
+ }
9
+ declare class ExAbsHourMC extends Command {
10
+ parameters: IUplinkExAbsHourMCParameters;
11
+ constructor(parameters: IUplinkExAbsHourMCParameters);
12
+ static readonly id = 2591;
13
+ static readonly directionType = 2;
14
+ static readonly examples: TCommandExampleList;
15
+ static readonly hasParameters = true;
16
+ static fromBytes(data: Uint8Array): ExAbsHourMC;
17
+ toBytes(): Uint8Array;
18
+ }
19
+ export default ExAbsHourMC;
@@ -1,11 +1,8 @@
1
1
  import Command from '../../Command.js';
2
- import { getSecondsFromDate, getDateFromSeconds } from '../../utils/time.js';
2
+ import { getSecondsFromDate, getDateFromSeconds } from '../../../utils/time.js';
3
3
  import CommandBinaryBuffer from '../../CommandBinaryBuffer.js';
4
4
  import { UPLINK } from '../../constants/directions.js';
5
5
  const COMMAND_ID = 0x0a1f;
6
- // date 2 bytes, hour 1 byte, channelList - 1 byte (max channelList: 4)
7
- // max hours diff - 7 (3 bit value)
8
- // 4 + (4 channelList * (1 byte pulse coefficient + 5 bytes of hour value)) + (4 * 2 bytes of diff * 7 max hours diff)
9
6
  const COMMAND_BODY_MAX_SIZE = 84;
10
7
  const examples = [
11
8
  {
@@ -25,43 +22,12 @@ const examples = [
25
22
  hex: { header: '1f 0a 0a', body: '2e 6a 0c 01 83 b9 f3 14 80 01' }
26
23
  }
27
24
  ];
28
- /**
29
- * Uplink command.
30
- *
31
- * @example create command instance from command body hex dump
32
- * ```js
33
- * import ExAbsHourMC from 'jooby-codec/commands/uplink/ExAbsHourMC';
34
- *
35
- * const commandBody = new Uint8Array([
36
- * 0x2e, 0x6a, 0x0c, 0x01, 0x82, 0xb9, 0xf3, 0x14, 0x80, 0x01
37
- * ]);
38
- * const command = ExAbsHourMC.fromBytes(commandBody);
39
- *
40
- * console.log(command.parameters);
41
- * // output:
42
- * {
43
- * startTime: 731764800,
44
- * hours: 1,
45
- * channelList: [
46
- * {
47
- * pulseCoefficient: 100,
48
- * index: 1,
49
- * value: 342457,
50
- * diff: [128]
51
- * }
52
- * ]
53
- * }
54
- * ```
55
- *
56
- * [Command format documentation](https://github.com/jooby-dev/jooby-docs/blob/main/docs/commands/uplink/ExAbsHourMC.md)
57
- */
58
25
  class ExAbsHourMC extends Command {
59
26
  constructor(parameters) {
60
27
  super();
61
28
  this.parameters = parameters;
62
29
  this.parameters.channelList = this.parameters.channelList.sort((a, b) => a.index - b.index);
63
30
  }
64
- // data - only body (without header)
65
31
  static fromBytes(data) {
66
32
  const buffer = new CommandBinaryBuffer(data);
67
33
  const date = buffer.getDate();
@@ -86,7 +52,6 @@ class ExAbsHourMC extends Command {
86
52
  });
87
53
  return new ExAbsHourMC({ channelList, hours: hourAmount, startTime: getSecondsFromDate(date) });
88
54
  }
89
- // returns full message - header with body
90
55
  toBytes() {
91
56
  const buffer = new CommandBinaryBuffer(COMMAND_BODY_MAX_SIZE);
92
57
  const { hours, startTime, channelList } = this.parameters;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExAbsHourMC.js","sourceRoot":"","sources":["../../../../src/analog/commands/uplink/ExAbsHourMC.ts"],"names":[],"mappings":"AAAA,OAAO,OAA8B,MAAM,kBAAkB,CAAC;AAC9D,OAAO,EAAC,kBAAkB,EAAE,kBAAkB,EAAY,MAAM,wBAAwB,CAAC;AACzF,OAAO,mBAAgD,MAAM,8BAA8B,CAAC;AAC5F,OAAO,EAAC,MAAM,EAAC,MAAM,+BAA+B,CAAC;AA8BrD,MAAM,UAAU,GAAG,MAAM,CAAC;AAK1B,MAAM,qBAAqB,GAAG,EAAE,CAAC;AAEjC,MAAM,QAAQ,GAAwB;IAClC;QACI,IAAI,EAAE,sCAAsC;QAC5C,UAAU,EAAE;YACR,SAAS,EAAE,SAAS;YACpB,KAAK,EAAE,CAAC;YACR,WAAW,EAAE;gBACT;oBACI,gBAAgB,EAAE,GAAG;oBACrB,KAAK,EAAE,CAAC;oBACR,KAAK,EAAE,MAAM;oBACb,IAAI,EAAE,CAAC,GAAG,CAAC;iBACd;aACJ;SACJ;QACD,GAAG,EAAE,EAAC,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE,+BAA+B,EAAC;KACnE;CACJ,CAAC;AAiCF,MAAM,WAAY,SAAQ,OAAO;IAC7B,YAAqB,UAAwC;QACzD,KAAK,EAAE,CAAC;QADS,eAAU,GAAV,UAAU,CAA8B;QAGzD,IAAI,CAAC,UAAU,CAAC,WAA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B,CAAC,IAAI,CAAC,EAAC,CAAC,CAAC;IAClG,CAAC;IAGD,OAAO;QACH,MAAM,MAAM,GAAG,IAAI,mBAAmB,CAAC,qBAAqB,CAAC,CAAC;QAC9D,MAAM,EAAC,KAAK,EAAE,SAAS,EAAE,WAAW,EAAC,GAAG,IAAI,CAAC,UAAU,CAAC;QAExD,MAAM,IAAI,GAAG,kBAAkB,CAAC,SAAS,CAAC,CAAC;QAC3C,MAAM,IAAI,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC;QAEhC,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;QAC1B,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;QAC7B,MAAM,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC;QAEhC,KAAM,MAAM,EAAC,KAAK,EAAE,IAAI,EAAE,gBAAgB,EAAC,IAAI,WAAW,EAAG;YACzD,MAAM,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,CAAC;YAC7C,MAAM,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC;YAC/B,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,CAAC,MAAM,CAAC,gBAAgB,CAAC,SAAS,CAAC,CAAC,CAAC;SACjE;QAED,OAAO,OAAO,CAAC,OAAO,CAAC,UAAU,EAAE,MAAM,CAAC,gBAAgB,EAAE,CAAC,CAAC;IAClE,CAAC;;AA3De,cAAE,GAAG,UAAU,CAAC;AAEhB,yBAAa,GAAG,MAAM,CAAC;AAEvB,oBAAQ,GAAG,QAAQ,CAAC;AAEpB,yBAAa,GAAG,IAAI,CAAC;AAyDzC,eAAe,WAAW,CAAC"}
@@ -0,0 +1,19 @@
1
+ import Command, { TCommandExampleList } from '../../Command.js';
2
+ import { IChannelDays } from '../../CommandBinaryBuffer.js';
3
+ import { TTime2000 } from '../../../utils/time.js';
4
+ interface IGetArchiveDaysMCResponseParameters {
5
+ channelList: Array<IChannelDays>;
6
+ startTime: TTime2000;
7
+ days: number;
8
+ }
9
+ declare class GetArchiveDaysMCResponse extends Command {
10
+ parameters: IGetArchiveDaysMCResponseParameters;
11
+ constructor(parameters: IGetArchiveDaysMCResponseParameters);
12
+ static readonly id = 27;
13
+ static readonly directionType = 2;
14
+ static readonly examples: TCommandExampleList;
15
+ static readonly hasParameters = true;
16
+ static fromBytes(data: Uint8Array): GetArchiveDaysMCResponse;
17
+ toBytes(): Uint8Array;
18
+ }
19
+ export default GetArchiveDaysMCResponse;
@@ -1,10 +1,8 @@
1
1
  import Command from '../../Command.js';
2
2
  import CommandBinaryBuffer from '../../CommandBinaryBuffer.js';
3
3
  import { UPLINK } from '../../constants/directions.js';
4
- import { getSecondsFromDate } from '../../utils/time.js';
4
+ import { getSecondsFromDate } from '../../../utils/time.js';
5
5
  const COMMAND_ID = 0x1b;
6
- // date 2 bytes, channelList 1 byte (max channelList: 4), days 1 byte (max days - 255)
7
- // 4 + (4 channelList * 5 bytes of day values * 255 max days)
8
6
  const COMMAND_BODY_MAX_SIZE = 5104;
9
7
  const examples = [
10
8
  {
@@ -22,41 +20,12 @@ const examples = [
22
20
  hex: { header: '1b 08', body: 'a9 6d 01 02 ea 01 cc 02' }
23
21
  }
24
22
  ];
25
- /**
26
- * Uplink command.
27
- *
28
- * @example create command instance from command body hex dump
29
- * ```js
30
- * import GetArchiveDaysMCResponse from 'jooby-codec/commands/uplink/GetArchiveDaysMCResponse';
31
- *
32
- * const commandBody = new Uint8Array([
33
- * 0xa9, 0x6d, 0x01, 0x02, 0xea, 0x01, 0xcc, 0x02
34
- * ]);
35
- * const command = GetArchiveDaysMCResponse.fromBytes(commandBody);
36
- *
37
- * console.log(command.parameters);
38
- * // output:
39
- * {
40
- * startTime: 2678227200,
41
- * days: 2,
42
- * channelList: [
43
- * {
44
- * index: 1,
45
- * dayList: [234, 332]
46
- * }
47
- * ]
48
- * }
49
- * ```
50
- *
51
- * [Command format documentation](https://github.com/jooby-dev/jooby-docs/blob/main/docs/commands/GetArchiveDaysMC.md#response)
52
- */
53
23
  class GetArchiveDaysMCResponse extends Command {
54
24
  constructor(parameters) {
55
25
  super();
56
26
  this.parameters = parameters;
57
27
  this.parameters.channelList = this.parameters.channelList.sort((a, b) => a.index - b.index);
58
28
  }
59
- // data - only body (without header)
60
29
  static fromBytes(data) {
61
30
  const buffer = new CommandBinaryBuffer(data);
62
31
  const date = buffer.getDate();
@@ -75,7 +44,6 @@ class GetArchiveDaysMCResponse extends Command {
75
44
  });
76
45
  return new GetArchiveDaysMCResponse({ channelList, days, startTime: getSecondsFromDate(date) });
77
46
  }
78
- // returns full message - header with body
79
47
  toBytes() {
80
48
  const buffer = new CommandBinaryBuffer(COMMAND_BODY_MAX_SIZE);
81
49
  const { days, startTime, channelList } = this.parameters;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GetArchiveDaysMCResponse.js","sourceRoot":"","sources":["../../../../src/analog/commands/uplink/GetArchiveDaysMCResponse.ts"],"names":[],"mappings":"AAAA,OAAO,OAA8B,MAAM,kBAAkB,CAAC;AAC9D,OAAO,mBAAmC,MAAM,8BAA8B,CAAC;AAC/E,OAAO,EAAC,MAAM,EAAC,MAAM,+BAA+B,CAAC;AACrD,OAAO,EAAC,kBAAkB,EAAY,MAAM,wBAAwB,CAAC;AAqBrE,MAAM,UAAU,GAAG,IAAI,CAAC;AAIxB,MAAM,qBAAqB,GAAG,IAAI,CAAC;AAEnC,MAAM,QAAQ,GAAwB;IAClC;QACI,IAAI,EAAE,2DAA2D;QACjE,UAAU,EAAE;YACR,SAAS,EAAE,UAAU;YACrB,IAAI,EAAE,CAAC;YACP,WAAW,EAAE;gBACT;oBACI,KAAK,EAAE,CAAC;oBACR,OAAO,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC;iBACtB;aACJ;SACJ;QACD,GAAG,EAAE,EAAC,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,yBAAyB,EAAC;KAC1D;CACJ,CAAC;AA+BF,MAAM,wBAAyB,SAAQ,OAAO;I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AEvD,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;QAC1B,MAAM,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC;QAChC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;QAEtB,WAAW,CAAC,OAAO,CAAC,CAAC,EAAC,OAAO,EAAC,EAAE,EAAE;YAC9B,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,MAAM,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC,CAAC;QAC7D,CAAC,CAAC,CAAC;QAEH,OAAO,OAAO,CAAC,OAAO,CAAC,UAAU,EAAE,MAAM,CAAC,gBAAgB,EAAE,CAAC,CAAC;IAClE,CAAC;;AA/Ce,2BAAE,GAAG,UAAU,CAAC;AAEhB,sCAAa,GAAG,MAAM,CAAC;AAEvB,iCAAQ,GAAG,QAAQ,CAAC;AAEpB,sCAAa,GAAG,IAAI,CAAC;AA6CzC,eAAe,wBAAwB,CAAC"}
@@ -0,0 +1,21 @@
1
+ import Command, { TCommandExampleList } from '../../Command.js';
2
+ import { TTime2000 } from '../../../utils/time.js';
3
+ interface IArchiveEvent {
4
+ time: TTime2000;
5
+ id: number;
6
+ sequenceNumber: number;
7
+ }
8
+ interface IGetArchiveEventsResponseParameters {
9
+ eventList: Array<IArchiveEvent>;
10
+ }
11
+ declare class GetArchiveEventsResponse extends Command {
12
+ parameters: IGetArchiveEventsResponseParameters;
13
+ constructor(parameters: IGetArchiveEventsResponseParameters);
14
+ static readonly id = 11;
15
+ static readonly directionType = 2;
16
+ static readonly examples: TCommandExampleList;
17
+ static readonly hasParameters = true;
18
+ static fromBytes(data: Uint8Array): GetArchiveEventsResponse;
19
+ toBytes(): Uint8Array;
20
+ }
21
+ export default GetArchiveEventsResponse;
@@ -3,7 +3,6 @@ import CommandBinaryBuffer from '../../CommandBinaryBuffer.js';
3
3
  import { UPLINK } from '../../constants/directions.js';
4
4
  import * as events from '../../constants/events.js';
5
5
  const COMMAND_ID = 0x0b;
6
- // 4 bytes for event seconds, 1 byte for event id, 1 byte for sequence number
7
6
  const COMMAND_BODY_MIN_SIZE = 4 + 1 + 1;
8
7
  const examples = [
9
8
  {
@@ -58,35 +57,11 @@ const setEvent = (buffer, event) => {
58
57
  buffer.setUint8(event.id);
59
58
  buffer.setUint8(event.sequenceNumber);
60
59
  };
61
- /**
62
- * Uplink command.
63
- *
64
- * @example create command instance from command body hex dump
65
- * ```js
66
- * import GetArchiveEventsResponse from 'jooby-codec/commands/uplink/GetArchiveEventsResponse';
67
- *
68
- * const commandBody = new Uint8Array([
69
- * 0x2b, 0xc0, 0x31, 0x60, 0x01, 0x01
70
- * ]);
71
- * const command = GetArchiveEventsResponse.fromBytes(commandBody);
72
- *
73
- * console.log(command.parameters);
74
- * // output:
75
- * {
76
- * eventList: [
77
- * {time: 734015840, id: 1, sequenceNumber: 1}
78
- * ]
79
- * }
80
- * ```
81
- *
82
- * [Command format documentation](https://github.com/jooby-dev/jooby-docs/blob/main/docs/commands/GetArchiveEvents.md#response)
83
- */
84
60
  class GetArchiveEventsResponse extends Command {
85
61
  constructor(parameters) {
86
62
  super();
87
63
  this.parameters = parameters;
88
64
  }
89
- // data - only body (without header)
90
65
  static fromBytes(data) {
91
66
  const buffer = new CommandBinaryBuffer(data);
92
67
  const eventList = [];
@@ -95,7 +70,6 @@ class GetArchiveEventsResponse extends Command {
95
70
  }
96
71
  return new GetArchiveEventsResponse({ eventList });
97
72
  }
98
- // returns full message - header with body
99
73
  toBytes() {
100
74
  const { eventList } = this.parameters;
101
75
  const buffer = new CommandBinaryBuffer(eventList.length * COMMAND_BODY_MIN_SIZE);
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GetArchiveEventsResponse.js","sourceRoot":"","sources":["../../../../src/analog/commands/uplink/GetArchiveEventsResponse.ts"],"names":[],"mappings":"AAAA,OAAO,OAA8B,MAAM,kBAAkB,CAAC;AAC9D,OAAO,mBAAmB,MAAM,8BAA8B,CAAC;AAC/D,OAAO,E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AAC;AA2BzC,eAAe,wBAAwB,CAAC"}
@@ -0,0 +1,19 @@
1
+ import Command, { TCommandExampleList } from '../../Command.js';
2
+ import { IChannelHours } from '../../CommandBinaryBuffer.js';
3
+ import { TTime2000 } from '../../../utils/time.js';
4
+ interface IGetArchiveHoursMCResponseParameters {
5
+ channelList: Array<IChannelHours>;
6
+ startTime: TTime2000;
7
+ hours: number;
8
+ }
9
+ declare class GetArchiveHoursMCResponse extends Command {
10
+ parameters: IGetArchiveHoursMCResponseParameters;
11
+ constructor(parameters: IGetArchiveHoursMCResponseParameters);
12
+ static readonly id = 26;
13
+ static readonly directionType = 2;
14
+ static readonly examples: TCommandExampleList;
15
+ static readonly hasParameters = true;
16
+ static fromBytes(data: Uint8Array): GetArchiveHoursMCResponse;
17
+ toBytes(): Uint8Array;
18
+ }
19
+ export default GetArchiveHoursMCResponse;
@@ -2,9 +2,6 @@ import Command from '../../Command.js';
2
2
  import CommandBinaryBuffer from '../../CommandBinaryBuffer.js';
3
3
  import { UPLINK } from '../../constants/directions.js';
4
4
  const COMMAND_ID = 0x1a;
5
- // date 2 bytes, hour 1 byte, channelList - 1 byte, so max channelList = 4
6
- // max hours diff - 7 (3 bit value)
7
- // 4 + (4 channelList * 5 bytes of hour values) + (4 * 5 bytes of diff * 7 max hours diff)
8
5
  const COMMAND_BODY_MAX_SIZE = 164;
9
6
  const examples = [
10
7
  {
@@ -22,46 +19,16 @@ const examples = [
22
19
  hex: { header: '1a 0d', body: '2f 97 0c 0f 83 01 0a 08 0a 08 0a 0c 0a' }
23
20
  }
24
21
  ];
25
- /**
26
- * Uplink command.
27
- *
28
- * @example create command instance from command body hex dump
29
- * ```js
30
- * import GetArchiveHoursMCResponse from 'jooby-codec/commands/uplink/GetArchiveHoursMCResponse';
31
- *
32
- * const commandBody = new Uint8Array([
33
- * 0x2f, 0x97, 0x0c, 0x0f, 0x83, 0x01, 0x0a, 0x08, 0x0a, 0x08, 0x0a, 0x0c, 0x0a
34
- * ]);
35
- * const command = GetArchiveHoursMCResponse.fromBytes(commandBody);
36
- *
37
- * console.log(command.parameters);
38
- * // output:
39
- * {
40
- * startTime: 756648000,
41
- * hours: 1,
42
- * channelList: [
43
- * {index: 1, value: 131, diff: [10]},
44
- * {index: 2, value: 8, diff: [10]},
45
- * {index: 3, value: 8, diff: [10]},
46
- * {index: 4, value: 12, diff: [10]}
47
- * ]
48
- * }
49
- * ```
50
- *
51
- * [Command format documentation](https://github.com/jooby-dev/jooby-docs/blob/main/docs/commands/GetArchiveHoursMC.md#response)
52
- */
53
22
  class GetArchiveHoursMCResponse extends Command {
54
23
  constructor(parameters) {
55
24
  super();
56
25
  this.parameters = parameters;
57
26
  this.parameters.channelList = this.parameters.channelList.sort((a, b) => a.index - b.index);
58
27
  }
59
- // data - only body (without header)
60
28
  static fromBytes(data) {
61
29
  const buffer = new CommandBinaryBuffer(data);
62
30
  return new GetArchiveHoursMCResponse(buffer.getChannelsValuesWithHourDiff());
63
31
  }
64
- // returns full message - header with body
65
32
  toBytes() {
66
33
  const buffer = new CommandBinaryBuffer(COMMAND_BODY_MAX_SIZE);
67
34
  const { hours, startTime, channelList } = this.parameters;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GetArchiveHoursMCResponse.js","sourceRoot":"","sources":["../../../../src/analog/commands/uplink/GetArchiveHoursMCResponse.ts"],"names":[],"mappings":"AAAA,OAAO,OAA8B,MAAM,kBAAkB,CAAC;AAC9D,OAAO,mBAAoC,MAAM,8BAA8B,CAAC;AAChF,OAAO,EAAC,MAAM,EAAC,MAAM,+BAA+B,CAAC;AAcrD,MAAM,UAAU,GAAG,IAAI,CAAC;AAKxB,MAAM,qBAAqB,GAAG,GAAG,CAAC;AAElC,MAAM,QAAQ,GAAwB;IAClC;QACI,IAAI,EAAE,uCAAuC;QAC7C,UAAU,EAAE;YACR,SAAS,EAAE,SAAS;YACpB,KAAK,EAAE,CAAC;YACR,WAAW,EAAE;gBACT,EAAC,KAAK,EAAE,CAAC,EAAE,KAAK,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AAM,CAAC,gBAAgB,EAAE,CAAC,CAAC;IAClE,CAAC;;AAxBe,4BAAE,GAAG,UAAU,CAAC;AAEhB,uCAAa,GAAG,MAAM,CAAC;AAEvB,kCAAQ,GAAG,QAAQ,CAAC;AAEpB,uCAAa,GAAG,IAAI,CAAC;AAsBzC,eAAe,yBAAyB,CAAC"}
@@ -0,0 +1,19 @@
1
+ import Command, { TCommandExampleList } from '../../Command.js';
2
+ import { IChannelArchiveDays } from '../../CommandBinaryBuffer.js';
3
+ import { TTime2000 } from '../../../utils/time.js';
4
+ interface IGetExAbsArchiveDaysMCResponseParameters {
5
+ channelList: Array<IChannelArchiveDays>;
6
+ startTime: TTime2000;
7
+ days: number;
8
+ }
9
+ declare class GetExAbsArchiveDaysMCResponse extends Command {
10
+ parameters: IGetExAbsArchiveDaysMCResponseParameters;
11
+ constructor(parameters: IGetExAbsArchiveDaysMCResponseParameters);
12
+ static id: number;
13
+ static readonly directionType = 2;
14
+ static readonly examples: TCommandExampleList;
15
+ static readonly hasParameters = true;
16
+ static fromBytes(data: Uint8Array): GetExAbsArchiveDaysMCResponse;
17
+ toBytes(): Uint8Array;
18
+ }
19
+ export default GetExAbsArchiveDaysMCResponse;
@@ -1,10 +1,8 @@
1
1
  import Command from '../../Command.js';
2
2
  import CommandBinaryBuffer from '../../CommandBinaryBuffer.js';
3
- import { getSecondsFromDate } from '../../utils/time.js';
3
+ import { getSecondsFromDate } from '../../../utils/time.js';
4
4
  import { UPLINK } from '../../constants/directions.js';
5
5
  const COMMAND_ID = 0x0d1f;
6
- // date 2 bytes, channelList 1 byte (max channelList: 4), days 1 byte (max days - 255)
7
- // 4 + (4 channelList * (1 byte pulse coefficient + 5 bytes of day values) * 255 max days)
8
6
  const COMMAND_BODY_MAX_SIZE = 6124;
9
7
  const examples = [
10
8
  {
@@ -22,41 +20,12 @@ const examples = [
22
20
  hex: { header: '1f 0d 08', body: '2e 6a 08 02 94 2b aa 2c' }
23
21
  }
24
22
  ];
25
- /**
26
- * Uplink command.
27
- *
28
- * @example create command instance from command body hex dump
29
- * ```js
30
- * import GetExAbsArchiveDaysMCResponse from 'jooby-codec/commands/uplink/GetExAbsArchiveDaysMCResponse';
31
- *
32
- * const commandBody = new Uint8Array([
33
- * 0x2e, 0x6a, 0x08, 0x02, 0x94, 0x2b, 0xaa, 0x2c
34
- * ]);
35
- * const command = GetExAbsArchiveDaysMCResponse.fromBytes(commandBody);
36
- *
37
- * console.log(command.parameters);
38
- * // output:
39
- * {
40
- * startTime: 731721600,
41
- * days: 2,
42
- * channelList: [
43
- * {
44
- * index: 4,
45
- * dayList: [5524, 5674]
46
- * }
47
- * ]
48
- * }
49
- * ```
50
- *
51
- * [Command format documentation](https://github.com/jooby-dev/jooby-docs/blob/main/docs/commands/GetExAbsArchiveDaysMC.md#response)
52
- */
53
23
  class GetExAbsArchiveDaysMCResponse extends Command {
54
24
  constructor(parameters) {
55
25
  super();
56
26
  this.parameters = parameters;
57
27
  this.parameters.channelList = this.parameters.channelList.sort((a, b) => a.index - b.index);
58
28
  }
59
- // data - only body (without header)
60
29
  static fromBytes(data) {
61
30
  const buffer = new CommandBinaryBuffer(data);
62
31
  const date = buffer.getDate();
@@ -75,7 +44,6 @@ class GetExAbsArchiveDaysMCResponse extends Command {
75
44
  });
76
45
  return new GetExAbsArchiveDaysMCResponse({ channelList, days, startTime: getSecondsFromDate(date) });
77
46
  }
78
- // returns full message - header with body
79
47
  toBytes() {
80
48
  const buffer = new CommandBinaryBuffer(COMMAND_BODY_MAX_SIZE);
81
49
  const { channelList, startTime, days } = this.parameters;