jooby-codec 1.15.0 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (397) 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} +4 -213
  5. package/dist/{CommandBinaryBuffer.js → analog/CommandBinaryBuffer.js} +10 -84
  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 +7 -31
  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 +5 -24
  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 +7 -26
  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 +7 -28
  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 +7 -27
  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 +0 -19
  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 +6 -38
  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 +5 -35
  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 +6 -41
  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 +5 -37
  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 +7 -33
  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 +3 -36
  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 +5 -37
  87. package/dist/analog/commands/uplink/GetExAbsArchiveDaysMCResponse.js.map +1 -0
  88. package/dist/analog/commands/uplink/GetExAbsArchiveHoursMCResponse.d.ts +19 -0
  89. package/dist/{commands → analog/commands}/uplink/GetExAbsArchiveHoursMCResponse.js +5 -35
  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 +5 -39
  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 +2 -43
  104. package/dist/{commands → analog/commands}/uplink/NewEvent.js +8 -38
  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 +6 -26
  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 +18 -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 +18 -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 +18 -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 +18 -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 +2 -26
  298. package/dist/utils/time.js +2 -14
  299. package/dist/utils/time.js.map +1 -1
  300. package/package.json +13 -9
  301. package/readme.md +20 -13
  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.d.ts +0 -44
  360. package/dist/commands/uplink/GetExAbsArchiveHoursMCResponse.js.map +0 -1
  361. package/dist/commands/uplink/GetLmicInfoResponse.d.ts +0 -52
  362. package/dist/commands/uplink/GetLmicInfoResponse.js.map +0 -1
  363. package/dist/commands/uplink/GetParameterResponse.d.ts +0 -35
  364. package/dist/commands/uplink/GetParameterResponse.js.map +0 -1
  365. package/dist/commands/uplink/HourMC.d.ts +0 -48
  366. package/dist/commands/uplink/HourMC.js.map +0 -1
  367. package/dist/commands/uplink/LastEvent.d.ts +0 -54
  368. package/dist/commands/uplink/LastEvent.js.map +0 -1
  369. package/dist/commands/uplink/NewEvent.js.map +0 -1
  370. package/dist/commands/uplink/SetTime2000Response.d.ts +0 -38
  371. package/dist/commands/uplink/SetTime2000Response.js.map +0 -1
  372. package/dist/commands/uplink/SoftRestartResponse.d.ts +0 -28
  373. package/dist/commands/uplink/SoftRestartResponse.js +0 -44
  374. package/dist/commands/uplink/SoftRestartResponse.js.map +0 -1
  375. package/dist/commands/uplink/Status.d.ts +0 -55
  376. package/dist/commands/uplink/Status.js.map +0 -1
  377. package/dist/commands/uplink/Time2000.d.ts +0 -43
  378. package/dist/commands/uplink/Time2000.js.map +0 -1
  379. package/dist/commands/uplink/index.js.map +0 -1
  380. package/dist/constants/deviceParameters.d.ts +0 -53
  381. package/dist/constants/deviceParameters.js +0 -54
  382. package/dist/constants/deviceParameters.js.map +0 -1
  383. package/dist/constants/directions.js.map +0 -1
  384. package/dist/constants/events.d.ts +0 -42
  385. package/dist/constants/events.js +0 -43
  386. package/dist/constants/events.js.map +0 -1
  387. package/dist/constants/hardwareTypes.d.ts +0 -108
  388. package/dist/constants/hardwareTypes.js +0 -109
  389. package/dist/constants/hardwareTypes.js.map +0 -1
  390. package/dist/constants/index.js.map +0 -1
  391. package/dist/constants/rx2SpreadFactors.js.map +0 -1
  392. package/dist/utils/header.js.map +0 -1
  393. package/dist/utils/message.js.map +0 -1
  394. /package/dist/{constants → analog/constants}/directions.d.ts +0 -0
  395. /package/dist/{constants → analog/constants}/directions.js +0 -0
  396. /package/dist/{constants → analog/constants}/index.d.ts +0 -0
  397. /package/dist/{constants → analog/constants}/index.js +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SetTime2000.js","sourceRoot":"","sources":["../../../../src/analog/commands/downlink/SetTime2000.ts"],"names":[],"mappings":"AAAA,OAAO,OAA8B,MAAM,kBAAkB,CAAC;AAC9D,OAAO,YAAY,MAAM,gCAAgC,CAAC;AAC1D,OAAO,EAAC,QAAQ,EAAC,MAAM,+BAA+B,CAAC;AAkBvD,MAAM,UAAU,GAAG,IAAI,CAAC;AACxB,MAAM,iBAAiB,GAAG,CAAC,CAAC;AAE5B,MAAM,QAAQ,GAAwB;IAClC;QACI,IAAI,EAAE,qCAAqC;QAC3C,UAAU,EAAE,EAAC,cAAc,EAAE,EAAE,EAAE,OAAO,EAAE,SAAS,EAAC;QACpD,GAAG,EAAE,EAAC,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,gBAAgB,EAAC;KACjD;CACJ,CAAC;AAoBF,MAAM,WAAY,SAAQ,OAAO;IAC7B,YAAqB,UAAkC;QACnD,KAAK,EAAE,CAAC;QADS,eAAU,GAAV,UAAU,CAAwB;IAEvD,CAAC;IAaD,MAAM,CAAC,SAAS,CAAG,IAAgB;QAC/B,IAAK,IAAI,CAAC,UAAU,KAAK,iBAAiB,EAAG;YACzC,MAAM,IAAI,KAAK,CAAC,sBAAsB,IAAI,CAAC,UAAU,GAAG,CAAC,CAAC;SAC7D;QAED,MAAM,MAAM,GAAG,IAAI,YAAY,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;QAC7C,MAAM,UAAU,GAAG;YACf,cAAc,EAAE,MAAM,CAAC,QAAQ,EAAE;YACjC,OAAO,EAAE,MAAM,CAAC,QAAQ,EAAE;SAC7B,CAAC;QAEF,IAAK,CAAC,MAAM,CAAC,OAAO,EAAG;YACnB,MAAM,IAAI,KAAK,CAAC,4BAA4B,CAAC,CAAC;SACjD;QAED,OAAO,IAAI,WAAW,CAAC,UAAU,CAAC,CAAC;IACvC,CAAC;IAGD,OAAO;QACH,MAAM,EAAC,cAAc,EAAE,OAAO,EAAC,GAAG,IAAI,CAAC,UAAU,CAAC;QAClD,MAAM,MAAM,GAAG,IAAI,YAAY,CAAC,iBAAiB,EAAE,KAAK,CAAC,CAAC;QAE1D,MAAM,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAC;QAChC,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QAEzB,OAAO,OAAO,CAAC,OAAO,CAAC,UAAU,EAAE,MAAM,CAAC,YAAY,EAAE,CAAC,CAAC;IAC9D,CAAC;;AArCe,cAAE,GAAG,UAAU,CAAC;AAEhB,yBAAa,GAAG,QAAQ,CAAC;AAEzB,oBAAQ,GAAG,QAAQ,CAAC;AAEpB,yBAAa,GAAG,IAAI,CAAC;AAmCzC,eAAe,WAAW,CAAC"}
@@ -0,0 +1,10 @@
1
+ import Command, { TCommandExampleList } from '../../Command.js';
2
+ declare class SoftRestart extends Command {
3
+ static readonly id = 25;
4
+ static readonly directionType = 1;
5
+ static readonly examples: TCommandExampleList;
6
+ static readonly hasParameters = false;
7
+ static fromBytes(): SoftRestart;
8
+ toBytes(): Uint8Array;
9
+ }
10
+ export default SoftRestart;
@@ -0,0 +1,23 @@
1
+ import Command from '../../Command.js';
2
+ import { DOWNLINK } from '../../constants/directions.js';
3
+ const COMMAND_ID = 0x19;
4
+ const examples = [
5
+ {
6
+ name: 'simple request',
7
+ hex: { header: '19 00', body: '' }
8
+ }
9
+ ];
10
+ class SoftRestart extends Command {
11
+ static fromBytes() {
12
+ return new SoftRestart();
13
+ }
14
+ toBytes() {
15
+ return Command.toBytes(COMMAND_ID);
16
+ }
17
+ }
18
+ SoftRestart.id = COMMAND_ID;
19
+ SoftRestart.directionType = DOWNLINK;
20
+ SoftRestart.examples = examples;
21
+ SoftRestart.hasParameters = false;
22
+ export default SoftRestart;
23
+ //# sourceMappingURL=SoftRestart.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SoftRestart.js","sourceRoot":"","sources":["../../../../src/analog/commands/downlink/SoftRestart.ts"],"names":[],"mappings":"AAAA,OAAO,OAA8B,MAAM,kBAAkB,CAAC;AAC9D,OAAO,EAAC,QAAQ,EAAC,MAAM,+BAA+B,CAAC;AAGvD,MAAM,UAAU,GAAG,IAAI,CAAC;AAExB,MAAM,QAAQ,GAAwB;IAClC;QACI,IAAI,EAAE,gBAAgB;QACtB,GAAG,EAAE,EAAC,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,EAAC;KACnC;CACJ,CAAC;AAmBF,MAAM,WAAY,SAAQ,OAAO;IAW7B,MAAM,CAAC,SAAS;QACZ,OAAO,IAAI,WAAW,EAAE,CAAC;IAC7B,CAAC;IAID,OAAO;QACH,OAAO,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;IACvC,CAAC;;AAlBe,cAAE,GAAG,UAAU,CAAC;AAEhB,yBAAa,GAAG,QAAQ,CAAC;AAEzB,oBAAQ,GAAG,QAAQ,CAAC;AAEpB,yBAAa,GAAG,KAAK,CAAC;AAgB1C,eAAe,WAAW,CAAC"}
@@ -1,8 +1,3 @@
1
- /**
2
- * All downlink commands.
3
- *
4
- * @packageDocumentation
5
- */
6
1
  export { default as CorrectTime2000 } from './CorrectTime2000.js';
7
2
  export { default as GetArchiveDaysMC } from './GetArchiveDaysMC.js';
8
3
  export { default as GetArchiveEvents } from './GetArchiveEvents.js';
@@ -1,8 +1,3 @@
1
- /**
2
- * All downlink commands.
3
- *
4
- * @packageDocumentation
5
- */
6
1
  export { default as CorrectTime2000 } from './CorrectTime2000.js';
7
2
  export { default as GetArchiveDaysMC } from './GetArchiveDaysMC.js';
8
3
  export { default as GetArchiveEvents } from './GetArchiveEvents.js';
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/analog/commands/downlink/index.ts"],"names":[],"mappings":"AAMA,OAAO,EAAC,OAAO,IAAI,eAAe,EAAC,MAAM,sBAAsB,CAAC;AAChE,OAAO,EAAC,OAAO,IAAI,gBAAgB,EAAC,MAAM,uBAAuB,CAAC;AAClE,OAAO,EAAC,OAAO,IAAI,gBAAgB,EAAC,MAAM,uBAAuB,CAAC;AAClE,OAAO,EAAC,OAAO,IAAI,iBAAiB,EAAC,MAAM,wBAAwB,CAAC;AACpE,OAAO,EAAC,OAAO,IAAI,YAAY,EAAC,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EAAC,OAAO,IAAI,qBAAqB,EAAC,MAAM,4BAA4B,CAAC;AAC5E,OAAO,EAAC,OAAO,IAAI,sBAAsB,EAAC,MAAM,6BAA6B,CAAC;AAC9E,OAAO,EAAC,OAAO,IAAI,iBAAiB,EAAC,MAAM,wBAAwB,CAAC;AACpE,OAAO,EAAC,OAAO,IAAI,WAAW,EAAC,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAC,OAAO,IAAI,YAAY,EAAC,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EAAC,OAAO,IAAI,SAAS,EAAC,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAC,OAAO,IAAI,YAAY,EAAC,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EAAC,OAAO,IAAI,WAAW,EAAC,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAC,OAAO,IAAI,WAAW,EAAC,MAAM,kBAAkB,CAAC"}
@@ -1,7 +1,2 @@
1
- /**
2
- * All commands.
3
- *
4
- * @packageDocumentation
5
- */
6
1
  export * as downlink from './downlink/index.js';
7
2
  export * as uplink from './uplink/index.js';
@@ -1,8 +1,3 @@
1
- /**
2
- * All commands.
3
- *
4
- * @packageDocumentation
5
- */
6
1
  export * as downlink from './downlink/index.js';
7
2
  export * as uplink from './uplink/index.js';
8
3
  //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/analog/commands/index.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,QAAQ,MAAM,qBAAqB,CAAC;AAChD,OAAO,KAAK,MAAM,MAAM,mBAAmB,CAAC"}
@@ -0,0 +1,15 @@
1
+ import Command, { TCommandExampleList } from '../../Command.js';
2
+ interface ICorrectTime2000ResponseParameters {
3
+ status: number;
4
+ }
5
+ declare class CorrectTime2000Response extends Command {
6
+ parameters: ICorrectTime2000ResponseParameters;
7
+ constructor(parameters: ICorrectTime2000ResponseParameters);
8
+ static readonly id = 12;
9
+ static readonly directionType = 2;
10
+ static readonly examples: TCommandExampleList;
11
+ static readonly hasParameters = true;
12
+ static fromBytes(data: Uint8Array): CorrectTime2000Response;
13
+ toBytes(): Uint8Array;
14
+ }
15
+ export default CorrectTime2000Response;
@@ -1,5 +1,5 @@
1
1
  import Command from '../../Command.js';
2
- import BinaryBuffer from '../../BinaryBuffer.js';
2
+ import BinaryBuffer from '../../../utils/BinaryBuffer.js';
3
3
  import { UPLINK } from '../../constants/directions.js';
4
4
  const COMMAND_ID = 0x0c;
5
5
  const COMMAND_BODY_SIZE = 1;
@@ -10,44 +10,24 @@ const examples = [
10
10
  hex: { header: '0c 01', body: '00' }
11
11
  }
12
12
  ];
13
- /**
14
- * Uplink command.
15
- *
16
- * @example create command instance from command body hex dump
17
- * ```js
18
- * import CorrectTime2000Response from 'jooby-codec/commands/uplink/CorrectTime2000Response';
19
- *
20
- * // failure
21
- * const commandBody = new Uint8Array([0x00]);
22
- * const command = CorrectTime2000Response.fromBytes(commandBody);
23
- *
24
- * console.log(command.parameters);
25
- * // output:
26
- * {status: 0}
27
- * ```
28
- *
29
- * [Command format documentation](https://github.com/jooby-dev/jooby-docs/blob/main/docs/commands/CorrectTime2000.md#response)
30
- */
31
13
  class CorrectTime2000Response extends Command {
32
14
  constructor(parameters) {
33
15
  super();
34
16
  this.parameters = parameters;
35
17
  }
36
- // data - only body (without header)
37
18
  static fromBytes(data) {
38
19
  if (data.byteLength !== COMMAND_BODY_SIZE) {
39
- throw new Error(`${this.getName()}. Wrong buffer size: ${data.byteLength}.`);
20
+ throw new Error(`Wrong buffer size: ${data.byteLength}.`);
40
21
  }
41
22
  const buffer = new BinaryBuffer(data, false);
42
23
  const parameters = {
43
24
  status: buffer.getUint8()
44
25
  };
45
26
  if (!buffer.isEmpty) {
46
- throw new Error(`${this.getName()}. BinaryBuffer is not empty.`);
27
+ throw new Error('BinaryBuffer is not empty.');
47
28
  }
48
29
  return new CorrectTime2000Response(parameters);
49
30
  }
50
- // returns full message - header with body
51
31
  toBytes() {
52
32
  const { status } = this.parameters;
53
33
  const buffer = new BinaryBuffer(COMMAND_BODY_SIZE, false);
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CorrectTime2000Response.js","sourceRoot":"","sources":["../../../../src/analog/commands/uplink/CorrectTime2000Response.ts"],"names":[],"mappings":"AAAA,OAAO,OAA8B,MAAM,kBAAkB,CAAC;AAC9D,OAAO,YAAY,MAAM,gCAAgC,CAAC;AAC1D,OAAO,EAAC,MAAM,EAAC,MAAM,+BAA+B,CAAC;AAcrD,MAAM,UAAU,GAAG,IAAI,CAAC;AACxB,MAAM,iBAAiB,GAAG,CAAC,CAAC;AAE5B,MAAM,QAAQ,GAAwB;IAClC;QACI,IAAI,EAAE,SAAS;QACf,UAAU,EAAE,EAAC,MAAM,EAAE,CAAC,EAAC;QACvB,GAAG,EAAE,EAAC,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAC;KACrC;CACJ,CAAC;AAoBF,MAAM,uBAAwB,SAAQ,OAAO;IACzC,YAAqB,UAA8C;QAC/D,KAAK,EAAE,CAAC;QADS,eAAU,GAAV,UAAU,CAAoC;IAEnE,CAAC;IAaD,MAAM,CAAC,SAAS,CAAG,IAAgB;QAC/B,IAAK,IAAI,CAAC,UAAU,KAAK,iBAAiB,EAAG;YACzC,MAAM,IAAI,KAAK,CAAC,sBAAsB,IAAI,CAAC,UAAU,GAAG,CAAC,CAAC;SAC7D;QAED,MAAM,MAAM,GAAG,IAAI,YAAY,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;QAC7C,MAAM,UAAU,GAAG;YACf,MAAM,EAAE,MAAM,CAAC,QAAQ,EAAE;SAC5B,CAAC;QAEF,IAAK,CAAC,MAAM,CAAC,OAAO,EAAG;YACnB,MAAM,IAAI,KAAK,CAAC,4BAA4B,CAAC,CAAC;SACjD;QAED,OAAO,IAAI,uBAAuB,CAAC,UAAU,CAAC,CAAC;IACnD,CAAC;IAGD,OAAO;QACH,MAAM,EAAC,MAAM,EAAC,GAAG,IAAI,CAAC,UAAU,CAAC;QACjC,MAAM,MAAM,GAAG,IAAI,YAAY,CAAC,iBAAiB,EAAE,KAAK,CAAC,CAAC;QAE1D,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;QAExB,OAAO,OAAO,CAAC,OAAO,CAAC,UAAU,EAAE,MAAM,CAAC,YAAY,EAAE,CAAC,CAAC;IAC9D,CAAC;;AAnCe,0BAAE,GAAG,UAAU,CAAC;AAEhB,qCAAa,GAAG,MAAM,CAAC;AAEvB,gCAAQ,GAAG,QAAQ,CAAC;AAEpB,qCAAa,GAAG,IAAI,CAAC;AAiCzC,eAAe,uBAAuB,CAAC"}
@@ -1,32 +1,8 @@
1
1
  import Command, { TCommandExampleList } from '../../Command.js';
2
2
  import { IChannelValue } from '../../CommandBinaryBuffer.js';
3
- /**
4
- * CurrentMC command parameters.
5
- */
6
3
  export interface ICurrentMCParameters {
7
4
  channelList: Array<IChannelValue>;
8
5
  }
9
- /**
10
- * Uplink command.
11
- *
12
- * @example create command instance from command body hex dump
13
- * ```js
14
- * import CurrentMC from 'jooby-codec/commands/uplink/CurrentMC';
15
- *
16
- * const commandBody = new Uint8Array([0x01, 0x32]);
17
- * const command = CurrentMC.fromBytes(commandBody);
18
- *
19
- * console.log(command.parameters);
20
- * // output:
21
- * {
22
- * channelList: [
23
- * {index: 1, value: 50}
24
- * ]
25
- * }
26
- * ```
27
- *
28
- * [Command format documentation](https://github.com/jooby-dev/jooby-docs/blob/main/docs/commands/GetCurrentMC.md#response)
29
- */
30
6
  declare class CurrentMC extends Command {
31
7
  parameters: ICurrentMCParameters;
32
8
  constructor(parameters: ICurrentMCParameters);
@@ -2,7 +2,6 @@ import Command from '../../Command.js';
2
2
  import CommandBinaryBuffer from '../../CommandBinaryBuffer.js';
3
3
  import { UPLINK } from '../../constants/directions.js';
4
4
  const COMMAND_ID = 0x18;
5
- // 2 bytes for 7 channelList + (7 channelList * 5 byte for current value of channel)
6
5
  const COMMAND_BODY_MAX_SIZE = 37;
7
6
  const examples = [
8
7
  {
@@ -38,34 +37,12 @@ const examples = [
38
37
  hex: { header: '18 07', body: 'b0 10 d2 3f a4 01 4b' }
39
38
  }
40
39
  ];
41
- /**
42
- * Uplink command.
43
- *
44
- * @example create command instance from command body hex dump
45
- * ```js
46
- * import CurrentMC from 'jooby-codec/commands/uplink/CurrentMC';
47
- *
48
- * const commandBody = new Uint8Array([0x01, 0x32]);
49
- * const command = CurrentMC.fromBytes(commandBody);
50
- *
51
- * console.log(command.parameters);
52
- * // output:
53
- * {
54
- * channelList: [
55
- * {index: 1, value: 50}
56
- * ]
57
- * }
58
- * ```
59
- *
60
- * [Command format documentation](https://github.com/jooby-dev/jooby-docs/blob/main/docs/commands/GetCurrentMC.md#response)
61
- */
62
40
  class CurrentMC extends Command {
63
41
  constructor(parameters) {
64
42
  super();
65
43
  this.parameters = parameters;
66
44
  this.parameters.channelList = this.parameters.channelList.sort((a, b) => a.index - b.index);
67
45
  }
68
- // data - only body (without header)
69
46
  static fromBytes(data) {
70
47
  const parameters = { channelList: [] };
71
48
  const buffer = new CommandBinaryBuffer(data);
@@ -76,7 +53,6 @@ class CurrentMC extends Command {
76
53
  }));
77
54
  return new CurrentMC(parameters);
78
55
  }
79
- // returns full message - header with body
80
56
  toBytes() {
81
57
  const buffer = new CommandBinaryBuffer(COMMAND_BODY_MAX_SIZE);
82
58
  const { channelList } = this.parameters;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CurrentMC.js","sourceRoot":"","sources":["../../../../src/analog/commands/uplink/CurrentMC.ts"],"names":[],"mappings":"AAAA,OAAO,OAA8B,MAAM,kBAAkB,CAAC;AAC9D,OAAO,mBAAoC,MAAM,8BAA8B,CAAC;AAChF,OAAO,EAAC,MAAM,EAAC,MAAM,+BAA+B,CAAC;AAUrD,MAAM,UAAU,GAAG,IAAI,CAAC;AAGxB,MAAM,qBAAqB,GAAG,EAAE,CAAC;AAEjC,MAAM,QAAQ,GAAwB;IAClC;QACI,IAAI,EAAE,kBAAkB;QACxB,UAAU,EAAE;YACR,WAAW,EAAE;gBACT,EAAC,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,GAAG,EAAC;gBACtB,EAAC,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAC;gBACpB,EAAC,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,EAAE,EAAC;gBACrB,EAAC,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,EAAE,EAAC;aACxB;SACJ;QACD,GAAG,EAAE,EAAC,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,mBAAmB,EAAC;KACpD;IACD;QACI,IAAI,EAAE,kBAAkB;QACxB,UAAU,EAAE;YACR,WAAW,EAAE;gBACT,EAAC,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,EAAE,EAAC;aACxB;SACJ;QACD,GAAG,EAAE,EAAC,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAC;KACxC;IACD;QACI,IAAI,EAAE,mBAAmB;QACzB,UAAU,EAAE;YACR,WAAW,EAAE;gBACT,EAAC,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,IAAI,EAAC;gBACvB,EAAC,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,GAAG,EAAC;gBACtB,EAAC,KAAK,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,EAAC;aACzB;SACJ;QACD,GAAG,EAAE,EAAC,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,sBAAsB,EAAC;KACvD;CACJ,CAAC;AAwBF,MAAM,SAAU,SAAQ,OAAO;IAC3B,YAAqB,UAAgC;QACjD,KAAK,EAAE,CAAC;QADS,eAAU,GAAV,UAAU,CAAsB;QAGjD,IAAI,CAAC,UAAU,CAAC,WAAW,GAAG,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAgB,EAAE,CAAgB,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC;IAC9H,CAAC;IAaD,MAAM,CAAC,SAAS,CAAG,IAAgB;QAC/B,MAAM,UAAU,GAAyB,EAAC,WAAW,EAAE,EAAE,EAAC,CAAC;QAC3D,MAAM,MAAM,GAAG,IAAI,mBAAmB,CAAC,IAAI,CAAC,CAAC;QAC7C,MAAM,WAAW,GAAG,MAAM,CAAC,WAAW,EAAE,CAAC;QAEzC,UAAU,CAAC,WAAW,GAAG,WAAW,CAAC,GAAG,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC;YACtD,KAAK,EAAE,MAAM,CAAC,gBAAgB,EAAE;YAChC,KAAK,EAAE,YAAY;SACtB,CAAkB,CAAC,CAAC;QAErB,OAAO,IAAI,SAAS,CAAC,UAAU,CAAC,CAAC;IACrC,CAAC;IAGD,OAAO;QACH,MAAM,MAAM,GAAG,IAAI,mBAAmB,CAAC,qBAAqB,CAAC,CAAC;QAC9D,MAAM,EAAC,WAAW,EAAC,GAAG,IAAI,CAAC,UAAU,CAAC;QAEtC,MAAM,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC;QAChC,WAAW,CAAC,OAAO,CAAC,CAAC,EAAC,KAAK,EAAC,EAAE,EAAE,CAAC,MAAM,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC,CAAC;QAEjE,OAAO,OAAO,CAAC,OAAO,CAAC,UAAU,EAAE,MAAM,CAAC,gBAAgB,EAAE,CAAC,CAAC;IAClE,CAAC;;AAhCM,YAAE,GAAG,UAAU,CAAC;AAEP,uBAAa,GAAG,MAAM,CAAC;AAEvB,kBAAQ,GAAG,QAAQ,CAAC;AAEpB,uBAAa,GAAG,IAAI,CAAC;AA8BzC,eAAe,SAAS,CAAC"}
@@ -0,0 +1,17 @@
1
+ import { TCommandExampleList } from '../../Command.js';
2
+ import { TTime2000 } from '../../../utils/time.js';
3
+ import CurrentMC, { ICurrentMCParameters } from './CurrentMC.js';
4
+ interface IDayMCParameters extends ICurrentMCParameters {
5
+ startTime2000: TTime2000;
6
+ }
7
+ declare class DayMC extends CurrentMC {
8
+ parameters: IDayMCParameters;
9
+ constructor(parameters: IDayMCParameters);
10
+ static readonly id = 22;
11
+ static readonly directionType = 2;
12
+ static readonly examples: TCommandExampleList;
13
+ static readonly hasParameters = true;
14
+ static fromBytes(data: Uint8Array): DayMC;
15
+ toBytes(): Uint8Array;
16
+ }
17
+ export default DayMC;
@@ -1,18 +1,15 @@
1
- /* eslint-disable @typescript-eslint/no-unsafe-assignment */
2
1
  import Command from '../../Command.js';
3
2
  import CommandBinaryBuffer from '../../CommandBinaryBuffer.js';
4
- import { getSecondsFromDate } from '../../utils/time.js';
3
+ import { getTime2000FromDate } from '../../../utils/time.js';
5
4
  import CurrentMC from './CurrentMC.js';
6
5
  import { UPLINK } from '../../constants/directions.js';
7
6
  const COMMAND_ID = 0x16;
8
- // 2 byte for date + 2 for channels (max channels: 7)
9
- // 4 + (7 * 4)
10
7
  const COMMAND_BODY_MAX_SIZE = 32;
11
8
  const examples = [
12
9
  {
13
10
  name: '4 channels at 2023.12.23 00:00:00 GMT',
14
11
  parameters: {
15
- startTime: 756604800,
12
+ startTime2000: 756604800,
16
13
  channelList: [
17
14
  { index: 3, value: 131 },
18
15
  { index: 5, value: 8 },
@@ -23,41 +20,13 @@ const examples = [
23
20
  hex: { header: '16 08', body: '2f 97 55 0c 83 01 08 0a' }
24
21
  }
25
22
  ];
26
- /**
27
- * Uplink command.
28
- *
29
- * @example create command instance from command body hex dump
30
- * ```js
31
- * import DayMC from 'jooby-codec/commands/uplink/DayMC';
32
- *
33
- * const commandBody = new Uint8Array([
34
- * 0x2f, 0x97, 0x55, 0x0c, 0x83, 0x01, 0x08, 0x0a
35
- * ]);
36
- * const command = DayMC.fromBytes(commandBody);
37
- *
38
- * console.log(command.parameters);
39
- * // output:
40
- * {
41
- * startTime: 756604800,
42
- * channelList: [,
43
- * {value: 12, index: 1}
44
- * {value: 131, index: 3},
45
- * {value: 8, index: 5},
46
- * {value: 10, index: 7}
47
- * ]
48
- * }
49
- * ```
50
- *
51
- * [Command format documentation](https://github.com/jooby-dev/jooby-docs/blob/main/docs/commands/uplink/DayMC.md)
52
- */
53
23
  class DayMC extends CurrentMC {
54
24
  constructor(parameters) {
55
25
  super(parameters);
56
26
  this.parameters = parameters;
57
27
  }
58
- // data - only body (without header)
59
28
  static fromBytes(data) {
60
- const parameters = { channelList: [], startTime: 0 };
29
+ const parameters = { channelList: [], startTime2000: 0 };
61
30
  const buffer = new CommandBinaryBuffer(data);
62
31
  const date = buffer.getDate();
63
32
  const channelList = buffer.getChannels();
@@ -65,14 +34,13 @@ class DayMC extends CurrentMC {
65
34
  value: buffer.getExtendedValue(),
66
35
  index: channelIndex
67
36
  }));
68
- parameters.startTime = getSecondsFromDate(date);
37
+ parameters.startTime2000 = getTime2000FromDate(date);
69
38
  return new DayMC(parameters);
70
39
  }
71
- // returns full message - header with body
72
40
  toBytes() {
73
41
  const buffer = new CommandBinaryBuffer(COMMAND_BODY_MAX_SIZE);
74
- const { channelList, startTime } = this.parameters;
75
- buffer.setDate(startTime);
42
+ const { channelList, startTime2000 } = this.parameters;
43
+ buffer.setDate(startTime2000);
76
44
  buffer.setChannels(channelList);
77
45
  channelList.forEach(({ value }) => buffer.setExtendedValue(value));
78
46
  return Command.toBytes(COMMAND_ID, buffer.getBytesToOffset());
@@ -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,mBAAmB,EAAY,MAAM,wBAAwB,CAAC;AACtE,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,aAAa,EAAE,SAAS;YACxB,WAAW,EAAE;gBACT,EAAC,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,GAAG,EAAC;gBACtB,EAAC,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAC;gBACpB,EAAC,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,EAAE,EAAC;gBACrB,EAAC,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,EAAE,EAAC;aACxB;SACJ;QACD,GAAG,EAAE,EAAC,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,yBAAyB,EAAC;KAC1D;CACJ,CAAC;AA8BF,MAAM,KAAM,SAAQ,SAAS;IACzB,YAAqB,UAA4B;QAC7C,KAAK,CAAC,UAAU,CAAC,CAAC;QADD,eAAU,GAAV,UAAU,CAAkB;IAEjD,CAAC;IAaD,MAAM,CAAC,SAAS,CAAG,IAAgB;QAC/B,MAAM,UAAU,GAAqB,EAAC,WAAW,EAAE,EAAE,EAAE,aAAa,EAAE,CAAC,EAAC,CAAC;QACzE,MAAM,MAAM,GAAG,IAAI,mBAAmB,CAAC,IAAI,CAAC,CAAC;QAC7C,MAAM,IAAI,GAAG,MAAM,CAAC,OAAO,EAAE,CAAC;QAC9B,MAAM,WAAW,GAAG,MAAM,CAAC,WAAW,EAAE,CAAC;QAEzC,UAAU,CAAC,WAAW,GAAG,WAAW,CAAC,GAAG,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC;YACtD,KAAK,EAAE,MAAM,CAAC,gBAAgB,EAAE;YAChC,KAAK,EAAE,YAAY;SACtB,CAAkB,CAAC,CAAC;QAErB,UAAU,CAAC,aAAa,GAAG,mBAAmB,CAAC,IAAI,CAAC,CAAC;QAErD,OAAO,IAAI,KAAK,CAAC,UAAU,CAAC,CAAC;IACjC,CAAC;IAGD,OAAO;QACH,MAAM,MAAM,GAAG,IAAI,mBAAmB,CAAC,qBAAqB,CAAC,CAAC;QAC9D,MAAM,EAAC,WAAW,EAAE,aAAa,EAAC,GAAG,IAAI,CAAC,UAAU,CAAC;QAErD,MAAM,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;QAC9B,MAAM,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC;QAChC,WAAW,CAAC,OAAO,CAAC,CAAC,EAAC,KAAK,EAAC,EAAE,EAAE,CAAC,MAAM,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC,CAAC;QAEjE,OAAO,OAAO,CAAC,OAAO,CAAC,UAAU,EAAE,MAAM,CAAC,gBAAgB,EAAE,CAAC,CAAC;IAClE,CAAC;;AApCe,QAAE,GAAG,UAAU,CAAC;AAEhB,mBAAa,GAAG,MAAM,CAAC;AAEvB,cAAQ,GAAG,QAAQ,CAAC;AAEpB,mBAAa,GAAG,IAAI,CAAC;AAkCzC,eAAe,KAAK,CAAC"}
@@ -0,0 +1,16 @@
1
+ import Command, { TCommandExampleList } from '../../Command.js';
2
+ import { IChannelAbsoluteValue } from '../../CommandBinaryBuffer.js';
3
+ interface IExAbsCurrentMCParameters {
4
+ channelList: Array<IChannelAbsoluteValue>;
5
+ }
6
+ declare class ExAbsCurrentMC extends Command {
7
+ parameters: IExAbsCurrentMCParameters;
8
+ constructor(parameters: IExAbsCurrentMCParameters);
9
+ static id: number;
10
+ static readonly directionType = 2;
11
+ static readonly examples: TCommandExampleList;
12
+ static readonly hasParameters = true;
13
+ static fromBytes(data: Uint8Array): ExAbsCurrentMC;
14
+ toBytes(): Uint8Array;
15
+ }
16
+ export default ExAbsCurrentMC;
@@ -2,8 +2,6 @@ import Command from '../../Command.js';
2
2
  import CommandBinaryBuffer from '../../CommandBinaryBuffer.js';
3
3
  import { UPLINK } from '../../constants/directions.js';
4
4
  const COMMAND_ID = 0x0f1f;
5
- // channelList 3 byte (max channelList: 14)
6
- // 3 + (14 * (1 byte pulse coefficient + 5 bytes of day values))
7
5
  const COMMAND_BODY_MAX_SIZE = 87;
8
6
  const examples = [
9
7
  {
@@ -16,43 +14,16 @@ const examples = [
16
14
  hex: { header: '1f 0f 04', body: '04 83 d6 02' }
17
15
  }
18
16
  ];
19
- /**
20
- * Uplink command.
21
- *
22
- * @example create command instance from command body hex dump
23
- * ```js
24
- * import ExAbsCurrentMC from 'jooby-codec/commands/uplink/ExAbsCurrentMC';
25
- *
26
- * const commandBody = new Uint8Array([0x04, 0x82, 0xd6, 0x02']);
27
- * const command = ExAbsCurrentMC.fromBytes(commandBody);
28
- *
29
- * console.log(command.parameters);
30
- * // output:
31
- * {
32
- * channelList: [
33
- * {
34
- * pulseCoefficient: 100,
35
- * index: 3,
36
- * value: 342
37
- * }
38
- * ]
39
- * }
40
- * ```
41
- *
42
- * [Command format documentation](https://github.com/jooby-dev/jooby-docs/blob/main/docs/commands/uplink/ExAbsCurrentMC.md)
43
- */
44
17
  class ExAbsCurrentMC extends Command {
45
18
  constructor(parameters) {
46
19
  super();
47
20
  this.parameters = parameters;
48
21
  this.parameters.channelList = this.parameters.channelList.sort((a, b) => a.index - b.index);
49
22
  }
50
- // data - only body (without header)
51
23
  static fromBytes(data) {
52
24
  const buffer = new CommandBinaryBuffer(data);
53
25
  return new ExAbsCurrentMC({ channelList: buffer.getChannelsWithAbsoluteValues() });
54
26
  }
55
- // returns full message - header with body
56
27
  toBytes() {
57
28
  const buffer = new CommandBinaryBuffer(COMMAND_BODY_MAX_SIZE);
58
29
  const { channelList } = this.parameters;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExAbsCurrentMC.js","sourceRoot":"","sources":["../../../../src/analog/commands/uplink/ExAbsCurrentMC.ts"],"names":[],"mappings":"AAAA,OAAO,OAA8B,MAAM,kBAAkB,CAAC;AAC9D,OAAO,mBAA4C,MAAM,8BAA8B,CAAC;AACxF,OAAO,EAAC,MAAM,EAAC,MAAM,+BAA+B,CAAC;AAOrD,MAAM,UAAU,GAAG,MAAM,CAAC;AAI1B,MAAM,qBAAqB,GAAG,EAAE,CAAC;AAEjC,MAAM,QAAQ,GAAwB;IAClC;QACI,IAAI,EAAE,uCAAuC;QAC7C,UAAU,EAAE;YACR,WAAW,EAAE;gBACT,EAAC,gBAAgB,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,GAAG,EAAC;aAChD;SACJ;QACD,GAAG,EAAE,EAAC,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE,aAAa,EAAC;KACjD;CACJ,CAAC;AA4BF,MAAM,cAAe,SAAQ,OAAO;IAChC,YAAqB,UAAqC;QACtD,KAAK,EAAE,CAAC;QADS,eAAU,GAAV,UAAU,CAA2B;QAGtD,IAAI,CAAC,UAAU,CAAC,WAAW,GAAG,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC;IAChG,CAAC;IAaD,MAAM,CAAC,SAAS,CAAG,IAAgB;QAC/B,MAAM,MAAM,GAAG,IAAI,mBAAmB,CAAC,IAAI,CAAC,CAAC;QAE7C,OAAO,IAAI,cAAc,CAAC,EAAC,WAAW,EAAE,MAAM,CAAC,6BAA6B,EAAE,EAAC,CAAC,CAAC;IACrF,CAAC;IAGD,OAAO;QACH,MAAM,MAAM,GAAG,IAAI,mBAAmB,CAAC,qBAAqB,CAAC,CAAC;QAC9D,MAAM,EAAC,WAAW,EAAC,GAAG,IAAI,CAAC,UAAU,CAAC;QAEtC,MAAM,CAAC,6BAA6B,CAAC,WAAW,CAAC,CAAC;QAElD,OAAO,OAAO,CAAC,OAAO,CAAC,UAAU,EAAE,MAAM,CAAC,gBAAgB,EAAE,CAAC,CAAC;IAClE,CAAC;;AAxBM,iBAAE,GAAG,UAAU,CAAC;AAEP,4BAAa,GAAG,MAAM,CAAC;AAEvB,uBAAQ,GAAG,QAAQ,CAAC;AAEpB,4BAAa,GAAG,IAAI,CAAC;AAsBzC,eAAe,cAAc,CAAC"}
@@ -0,0 +1,19 @@
1
+ import { TCommandExampleList } from '../../Command.js';
2
+ import CurrentMC from './CurrentMC.js';
3
+ import { IChannelAbsoluteValue } from '../../CommandBinaryBuffer.js';
4
+ import { TTime2000 } from '../../../utils/time.js';
5
+ interface IExAbsDayMCParameters {
6
+ channelList: Array<IChannelAbsoluteValue>;
7
+ startTime2000: TTime2000;
8
+ }
9
+ declare class ExAbsDayMC extends CurrentMC {
10
+ parameters: IExAbsDayMCParameters;
11
+ constructor(parameters: IExAbsDayMCParameters);
12
+ static id: number;
13
+ static readonly directionType = 2;
14
+ static readonly examples: TCommandExampleList;
15
+ static readonly hasParameters = true;
16
+ static fromBytes(data: Uint8Array): ExAbsDayMC;
17
+ toBytes(): Uint8Array;
18
+ }
19
+ export default ExAbsDayMC;
@@ -2,16 +2,14 @@ import Command from '../../Command.js';
2
2
  import CurrentMC from './CurrentMC.js';
3
3
  import CommandBinaryBuffer from '../../CommandBinaryBuffer.js';
4
4
  import { UPLINK } from '../../constants/directions.js';
5
- import { getSecondsFromDate } from '../../utils/time.js';
5
+ import { getTime2000FromDate } from '../../../utils/time.js';
6
6
  const COMMAND_ID = 0x0b1f;
7
- // date 2 bytes, channelList 3 bytes (max channelList: 14)
8
- // 5 + (14 channelList * (1 byte pulse coefficient + 5 bytes of day values))
9
7
  const COMMAND_BODY_MAX_SIZE = 89;
10
8
  const examples = [
11
9
  {
12
10
  name: 'absolute day value for 2023.03.10 00:00:00 GMT',
13
11
  parameters: {
14
- startTime: 731721600,
12
+ startTime2000: 731721600,
15
13
  channelList: [
16
14
  { pulseCoefficient: 100, index: 1, value: 342 }
17
15
  ]
@@ -19,49 +17,21 @@ const examples = [
19
17
  hex: { header: '1f 0b 06', body: '2e 6a 01 83 d6 02' }
20
18
  }
21
19
  ];
22
- /**
23
- * Uplink command.
24
- *
25
- * @example create command instance from command body hex dump
26
- * ```js
27
- * import ExAbsDayMC from 'jooby-codec/commands/uplink/ExAbsDayMC';
28
- *
29
- * const commandBody = new Uint8Array([0x2e, 0x6a, 0x01, 0x82, 0xd6, 0x02']);
30
- * const command = ExAbsDayMC.fromBytes(commandBody);
31
- *
32
- * console.log(command.parameters);
33
- * // output:
34
- * {
35
- * startTime: 731721600,
36
- * channelList: [
37
- * {
38
- * pulseCoefficient: 100,
39
- * index: 1,
40
- * value: 342
41
- * }
42
- * ]
43
- * }
44
- * ```
45
- *
46
- * [Command format documentation](https://github.com/jooby-dev/jooby-docs/blob/main/docs/commands/uplink/ExAbsDayMC.md)
47
- */
48
20
  class ExAbsDayMC extends CurrentMC {
49
21
  constructor(parameters) {
50
22
  super(parameters);
51
23
  this.parameters = parameters;
52
24
  }
53
- // data - only body (without header)
54
25
  static fromBytes(data) {
55
26
  const buffer = new CommandBinaryBuffer(data);
56
27
  const date = buffer.getDate();
57
28
  const channelList = buffer.getChannelsWithAbsoluteValues();
58
- return new ExAbsDayMC({ channelList, startTime: getSecondsFromDate(date) });
29
+ return new ExAbsDayMC({ channelList, startTime2000: getTime2000FromDate(date) });
59
30
  }
60
- // returns full message - header with body
61
31
  toBytes() {
62
32
  const buffer = new CommandBinaryBuffer(COMMAND_BODY_MAX_SIZE);
63
- const { channelList, startTime } = this.parameters;
64
- buffer.setDate(startTime);
33
+ const { channelList, startTime2000 } = this.parameters;
34
+ buffer.setDate(startTime2000);
65
35
  buffer.setChannelsWithAbsoluteValues(channelList);
66
36
  return Command.toBytes(COMMAND_ID, buffer.getBytesToOffset());
67
37
  }
@@ -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,mBAAmB,EAAY,MAAM,wBAAwB,CAAC;AAStE,MAAM,UAAU,GAAG,MAAM,CAAC;AAI1B,MAAM,qBAAqB,GAAG,EAAE,CAAC;AAEjC,MAAM,QAAQ,GAAwB;IAClC;QACI,IAAI,EAAE,gDAAgD;QACtD,UAAU,EAAE;YACR,aAAa,EAAE,SAAS;YACxB,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,aAAa,EAAE,mBAAmB,CAAC,IAAI,CAAC,EAAC,CAAC,CAAC;IACnF,CAAC;IAGD,OAAO;QACH,MAAM,MAAM,GAAG,IAAI,mBAAmB,CAAC,qBAAqB,CAAC,CAAC;QAC9D,MAAM,EAAC,WAAW,EAAE,aAAa,EAAC,GAAG,IAAI,CAAC,UAAU,CAAC;QAErD,MAAM,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;QAC9B,MAAM,CAAC,6BAA6B,CAAC,WAAW,CAAC,CAAC;QAElD,OAAO,OAAO,CAAC,OAAO,CAAC,UAAU,EAAE,MAAM,CAAC,gBAAgB,EAAE,CAAC,CAAC;IAClE,CAAC;;AA3BM,aAAE,GAAG,UAAU,CAAC;AAEP,wBAAa,GAAG,MAAM,CAAC;AAEvB,mBAAQ,GAAG,QAAQ,CAAC;AAEpB,wBAAa,GAAG,IAAI,CAAC;AAyBzC,eAAe,UAAU,CAAC"}
@@ -0,0 +1,19 @@
1
+ import Command, { TCommandExampleList } from '../../Command.js';
2
+ import { TTime2000 } from '../../../utils/time.js';
3
+ import { IChannelHourAbsoluteValue } from '../../CommandBinaryBuffer.js';
4
+ interface IUplinkExAbsHourMCParameters {
5
+ channelList: Array<IChannelHourAbsoluteValue>;
6
+ startTime2000: TTime2000;
7
+ hours: number;
8
+ }
9
+ declare class ExAbsHourMC extends Command {
10
+ parameters: IUplinkExAbsHourMCParameters;
11
+ constructor(parameters: IUplinkExAbsHourMCParameters);
12
+ static readonly id = 2591;
13
+ static readonly directionType = 2;
14
+ static readonly examples: TCommandExampleList;
15
+ static readonly hasParameters = true;
16
+ static fromBytes(data: Uint8Array): ExAbsHourMC;
17
+ toBytes(): Uint8Array;
18
+ }
19
+ export default ExAbsHourMC;
@@ -1,17 +1,14 @@
1
1
  import Command from '../../Command.js';
2
- import { getSecondsFromDate, getDateFromSeconds } from '../../utils/time.js';
2
+ import { getTime2000FromDate, getDateFromTime2000 } from '../../../utils/time.js';
3
3
  import CommandBinaryBuffer from '../../CommandBinaryBuffer.js';
4
4
  import { UPLINK } from '../../constants/directions.js';
5
5
  const COMMAND_ID = 0x0a1f;
6
- // date 2 bytes, hour 1 byte, channelList - 1 byte (max channelList: 4)
7
- // max hours diff - 7 (3 bit value)
8
- // 4 + (4 channelList * (1 byte pulse coefficient + 5 bytes of hour value)) + (4 * 2 bytes of diff * 7 max hours diff)
9
6
  const COMMAND_BODY_MAX_SIZE = 84;
10
7
  const examples = [
11
8
  {
12
9
  name: '1 channel at 2023.03.10 12:00:00 GMT',
13
10
  parameters: {
14
- startTime: 731764800,
11
+ startTime2000: 731764800,
15
12
  hours: 1,
16
13
  channelList: [
17
14
  {
@@ -25,43 +22,12 @@ const examples = [
25
22
  hex: { header: '1f 0a 0a', body: '2e 6a 0c 01 83 b9 f3 14 80 01' }
26
23
  }
27
24
  ];
28
- /**
29
- * Uplink command.
30
- *
31
- * @example create command instance from command body hex dump
32
- * ```js
33
- * import ExAbsHourMC from 'jooby-codec/commands/uplink/ExAbsHourMC';
34
- *
35
- * const commandBody = new Uint8Array([
36
- * 0x2e, 0x6a, 0x0c, 0x01, 0x82, 0xb9, 0xf3, 0x14, 0x80, 0x01
37
- * ]);
38
- * const command = ExAbsHourMC.fromBytes(commandBody);
39
- *
40
- * console.log(command.parameters);
41
- * // output:
42
- * {
43
- * startTime: 731764800,
44
- * hours: 1,
45
- * channelList: [
46
- * {
47
- * pulseCoefficient: 100,
48
- * index: 1,
49
- * value: 342457,
50
- * diff: [128]
51
- * }
52
- * ]
53
- * }
54
- * ```
55
- *
56
- * [Command format documentation](https://github.com/jooby-dev/jooby-docs/blob/main/docs/commands/uplink/ExAbsHourMC.md)
57
- */
58
25
  class ExAbsHourMC extends Command {
59
26
  constructor(parameters) {
60
27
  super();
61
28
  this.parameters = parameters;
62
29
  this.parameters.channelList = this.parameters.channelList.sort((a, b) => a.index - b.index);
63
30
  }
64
- // data - only body (without header)
65
31
  static fromBytes(data) {
66
32
  const buffer = new CommandBinaryBuffer(data);
67
33
  const date = buffer.getDate();
@@ -84,15 +50,14 @@ class ExAbsHourMC extends Command {
84
50
  index: channelIndex
85
51
  });
86
52
  });
87
- return new ExAbsHourMC({ channelList, hours: hourAmount, startTime: getSecondsFromDate(date) });
53
+ return new ExAbsHourMC({ channelList, hours: hourAmount, startTime2000: getTime2000FromDate(date) });
88
54
  }
89
- // returns full message - header with body
90
55
  toBytes() {
91
56
  const buffer = new CommandBinaryBuffer(COMMAND_BODY_MAX_SIZE);
92
- const { hours, startTime, channelList } = this.parameters;
93
- const date = getDateFromSeconds(startTime);
57
+ const { hours, startTime2000, channelList } = this.parameters;
58
+ const date = getDateFromTime2000(startTime2000);
94
59
  const hour = date.getUTCHours();
95
- buffer.setDate(startTime);
60
+ buffer.setDate(startTime2000);
96
61
  buffer.setHours(hour, hours);
97
62
  buffer.setChannels(channelList);
98
63
  for (const { value, diff, pulseCoefficient } of channelList) {