jooby-codec 1.15.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} +2 -211
  5. package/dist/{CommandBinaryBuffer.js → analog/CommandBinaryBuffer.js} +6 -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 +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 +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,6 +1,5 @@
1
1
  import Command from '../../Command.js';
2
2
  import { DOWNLINK } from '../../constants/directions.js';
3
- // TODO: rework extended headers detection
4
3
  const COMMAND_ID = 0x0f1f;
5
4
  const examples = [
6
5
  {
@@ -8,32 +7,13 @@ const examples = [
8
7
  hex: { header: '1f 0f 00', body: '' }
9
8
  }
10
9
  ];
11
- /**
12
- * Downlink command.
13
- *
14
- * @example
15
- * ```js
16
- * import GetExAbsCurrentMC from 'jooby-codec/commands/downlink/GetExAbsCurrentMC';
17
- *
18
- * const command = new GetExAbsCurrentMC();
19
- *
20
- * // output command binary in hex representation
21
- * console.log(command.toHex());
22
- * // 1f 0f 00
23
- * ```
24
- *
25
- * [Command format documentation](https://github.com/jooby-dev/jooby-docs/blob/main/docs/commands/GetExAbsCurrentMC.md#request)
26
- */
27
10
  class GetExAbsCurrentMC extends Command {
28
11
  constructor() {
29
12
  super();
30
13
  }
31
- // data - only body (without header)
32
14
  static fromBytes() {
33
15
  return new GetExAbsCurrentMC();
34
16
  }
35
- // returns full message - header with body
36
- // eslint-disable-next-line class-methods-use-this
37
17
  toBytes() {
38
18
  return Command.toBytes(COMMAND_ID);
39
19
  }
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GetExAbsCurrentMC.js","sourceRoot":"","sources":["../../../../src/analog/commands/downlink/GetExAbsCurrentMC.ts"],"names":[],"mappings":"AAAA,OAAO,OAA8B,MAAM,kBAAkB,CAAC;AAC9D,OAAO,EAAC,QAAQ,EAAC,MAAM,+BAA+B,CAAC;AAIvD,MAAM,UAAU,GAAG,MAAM,CAAC;AAE1B,MAAM,QAAQ,GAAwB;IAClC;QACI,IAAI,EAAE,gBAAgB;QACtB,GAAG,EAAE,EAAC,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE,EAAE,EAAC;KACtC;CACJ,CAAC;AAmBF,MAAM,iBAAkB,SAAQ,OAAO;IACnC;QACI,KAAK,EAAE,CAAC;IACZ,CAAC;IAaD,MAAM,CAAC,SAAS;QACZ,OAAO,IAAI,iBAAiB,EAAE,CAAC;IACnC,CAAC;IAID,OAAO;QACH,OAAO,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;IACvC,CAAC;;AAlBe,oBAAE,GAAG,UAAU,CAAC;AAEhB,+BAAa,GAAG,QAAQ,CAAC;AAEzB,0BAAQ,GAAG,QAAQ,CAAC;AAEpB,+BAAa,GAAG,KAAK,CAAC;AAgB1C,eAAe,iBAAiB,CAAC"}
@@ -0,0 +1,10 @@
1
+ import Command, { TCommandExampleList } from '../../Command.js';
2
+ declare class GetLmicInfo extends Command {
3
+ static readonly id = 543;
4
+ static readonly directionType = 1;
5
+ static readonly examples: TCommandExampleList;
6
+ static readonly hasParameters = false;
7
+ static fromBytes(): GetLmicInfo;
8
+ toBytes(): Uint8Array;
9
+ }
10
+ export default GetLmicInfo;
@@ -0,0 +1,23 @@
1
+ import Command from '../../Command.js';
2
+ import { DOWNLINK } from '../../constants/directions.js';
3
+ const COMMAND_ID = 0x021f;
4
+ const examples = [
5
+ {
6
+ name: 'simple request',
7
+ hex: { header: '1f 02 00', body: '' }
8
+ }
9
+ ];
10
+ class GetLmicInfo extends Command {
11
+ static fromBytes() {
12
+ return new GetLmicInfo();
13
+ }
14
+ toBytes() {
15
+ return Command.toBytes(COMMAND_ID);
16
+ }
17
+ }
18
+ GetLmicInfo.id = COMMAND_ID;
19
+ GetLmicInfo.directionType = DOWNLINK;
20
+ GetLmicInfo.examples = examples;
21
+ GetLmicInfo.hasParameters = false;
22
+ export default GetLmicInfo;
23
+ //# sourceMappingURL=GetLmicInfo.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GetLmicInfo.js","sourceRoot":"","sources":["../../../../src/analog/commands/downlink/GetLmicInfo.ts"],"names":[],"mappings":"AAAA,OAAO,OAA8B,MAAM,kBAAkB,CAAC;AAC9D,OAAO,EAAC,QAAQ,EAAC,MAAM,+BAA+B,CAAC;AAGvD,MAAM,UAAU,GAAG,MAAM,CAAC;AAE1B,MAAM,QAAQ,GAAwB;IAClC;QACI,IAAI,EAAE,gBAAgB;QACtB,GAAG,EAAE,EAAC,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE,EAAE,EAAC;KACtC;CACJ,CAAC;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"}
@@ -0,0 +1,15 @@
1
+ import Command, { TCommandExampleList } from '../../Command.js';
2
+ interface IGetParameterParameters {
3
+ id: number;
4
+ }
5
+ declare class GetParameter extends Command {
6
+ parameters: IGetParameterParameters;
7
+ constructor(parameters: IGetParameterParameters);
8
+ static readonly id = 4;
9
+ static readonly directionType = 1;
10
+ static readonly examples: TCommandExampleList;
11
+ static readonly hasParameters = true;
12
+ static fromBytes(data: Uint8Array): GetParameter;
13
+ toBytes(): Uint8Array;
14
+ }
15
+ export default GetParameter;
@@ -16,35 +16,15 @@ const examples = [
16
16
  hex: { header: '04 01', body: '18' }
17
17
  }
18
18
  ];
19
- /**
20
- * Downlink command.
21
- *
22
- * @example
23
- * ```js
24
- * import {constants} from 'jooby-codec';
25
- * import GetParameter from 'jooby-codec/commands/downlink/GetParameter';
26
- *
27
- * const command = new GetParameter({id: constants.deviceParameters.ABSOLUTE_DATA});
28
- *
29
- * // output command binary in hex representation
30
- * console.log(command.toHex());
31
- * // 04 01 17
32
- * ```
33
- *
34
- * [Command format documentation](https://github.com/jooby-dev/jooby-docs/blob/main/docs/commands/GetParameter.md#request)
35
- */
36
19
  class GetParameter extends Command {
37
20
  constructor(parameters) {
38
21
  super();
39
22
  this.parameters = parameters;
40
23
  }
41
- // data - only body (without header)
42
24
  static fromBytes(data) {
43
25
  const buffer = new CommandBinaryBuffer(data);
44
26
  return new GetParameter({ id: buffer.getUint8() });
45
27
  }
46
- // returns full message - header with body
47
- // eslint-disable-next-line class-methods-use-this
48
28
  toBytes() {
49
29
  const buffer = new CommandBinaryBuffer(COMMAND_BODY_SIZE);
50
30
  buffer.setUint8(this.parameters.id);
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GetParameter.js","sourceRoot":"","sources":["../../../../src/analog/commands/downlink/GetParameter.ts"],"names":[],"mappings":"AAAA,OAAO,OAA8B,MAAM,kBAAkB,CAAC;AAC9D,OAAO,mBAAmB,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAAC,QAAQ,EAAC,MAAM,+BAA+B,CAAC;AACvD,OAAO,KAAK,gBAAgB,MAAM,qCAAqC,CAAC;AAcxE,MAAM,UAAU,GAAG,IAAI,CAAC;AACxB,MAAM,iBAAiB,GAAG,CAAC,CAAC;AAE5B,MAAM,QAAQ,GAAwB;IAClC;QACI,IAAI,EAAE,iDAAiD;QACvD,UAAU,EAAE,EAAC,EAAE,EAAE,gBAAgB,CAAC,aAAa,EAAC;QAChD,GAAG,EAAE,EAAC,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAC;KACrC;IACD;QACI,IAAI,EAAE,8DAA8D;QACpE,UAAU,EAAE,EAAC,EAAE,EAAE,gBAAgB,CAAC,oBAAoB,EAAC;QACvD,GAAG,EAAE,EAAC,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAC;KACrC;CACJ,CAAC;AAoBF,MAAM,YAAa,SAAQ,OAAO;IAC9B,YAAqB,UAAmC;QACpD,KAAK,EAAE,CAAC;QADS,eAAU,GAAV,UAAU,CAAyB;IAExD,CAAC;IAaD,MAAM,CAAC,SAAS,CAAG,IAAgB;QAC/B,MAAM,MAAM,GAAG,IAAI,mBAAmB,CAAC,IAAI,CAAC,CAAC;QAE7C,OAAO,IAAI,YAAY,CAAC,EAAC,EAAE,EAAE,MAAM,CAAC,QAAQ,EAAE,EAAC,CAAC,CAAC;IACrD,CAAC;IAID,OAAO;QACH,MAAM,MAAM,GAAG,IAAI,mBAAmB,CAAC,iBAAiB,CAAC,CAAC;QAE1D,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC;QAEpC,OAAO,OAAO,CAAC,OAAO,CAAC,UAAU,EAAE,MAAM,CAAC,YAAY,EAAE,CAAC,CAAC;IAC9D,CAAC;;AAxBe,eAAE,GAAG,UAAU,CAAC;AAEhB,0BAAa,GAAG,QAAQ,CAAC;AAEzB,qBAAQ,GAAG,QAAQ,CAAC;AAEpB,0BAAa,GAAG,IAAI,CAAC;AAsBzC,eAAe,YAAY,CAAC"}
@@ -0,0 +1,11 @@
1
+ import Command, { TCommandExampleList } from '../../Command.js';
2
+ declare class GetStatus extends Command {
3
+ constructor();
4
+ static readonly id = 20;
5
+ static readonly directionType = 1;
6
+ static readonly examples: TCommandExampleList;
7
+ static readonly hasParameters = false;
8
+ static fromBytes(): GetStatus;
9
+ toBytes(): Uint8Array;
10
+ }
11
+ export default GetStatus;
@@ -7,32 +7,13 @@ const examples = [
7
7
  hex: { header: '14 00', body: '' }
8
8
  }
9
9
  ];
10
- /**
11
- * Downlink command.
12
- *
13
- * @example
14
- * ```js
15
- * import GetStatus from 'jooby-codec/commands/downlink/GetStatus';
16
- *
17
- * const command = new GetStatus();
18
- *
19
- * // output command binary in hex representation
20
- * console.log(command.toHex());
21
- * // 14 00
22
- * ```
23
- *
24
- * [Command format documentation](https://github.com/jooby-dev/jooby-docs/blob/main/docs/commands/GetStatus.md#request)
25
- */
26
10
  class GetStatus extends Command {
27
11
  constructor() {
28
12
  super();
29
13
  }
30
- // data - only body (without header)
31
14
  static fromBytes() {
32
15
  return new GetStatus();
33
16
  }
34
- // returns full message - header with body
35
- // eslint-disable-next-line class-methods-use-this
36
17
  toBytes() {
37
18
  return Command.toBytes(COMMAND_ID);
38
19
  }
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GetStatus.js","sourceRoot":"","sources":["../../../../src/analog/commands/downlink/GetStatus.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,SAAU,SAAQ,OAAO;IAC3B;QACI,KAAK,EAAE,CAAC;IACZ,CAAC;IAaD,MAAM,CAAC,SAAS;QACZ,OAAO,IAAI,SAAS,EAAE,CAAC;IAC3B,CAAC;IAID,OAAO;QACH,OAAO,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;IACvC,CAAC;;AAlBe,YAAE,GAAG,UAAU,CAAC;AAEhB,uBAAa,GAAG,QAAQ,CAAC;AAEzB,kBAAQ,GAAG,QAAQ,CAAC;AAEpB,uBAAa,GAAG,KAAK,CAAC;AAgB1C,eAAe,SAAS,CAAC"}
@@ -0,0 +1,13 @@
1
+ import Command, { TCommandExampleList } from '../../Command.js';
2
+ import { IParameter } from '../../CommandBinaryBuffer.js';
3
+ declare class SetParameter extends Command {
4
+ parameters: IParameter;
5
+ constructor(parameters: IParameter);
6
+ static readonly id = 3;
7
+ static readonly directionType = 1;
8
+ static readonly examples: TCommandExampleList;
9
+ static readonly hasParameters = true;
10
+ static fromBytes(data: Uint8Array): SetParameter;
11
+ toBytes(): Uint8Array;
12
+ }
13
+ export default SetParameter;
@@ -147,34 +147,15 @@ const examples = [
147
147
  hex: { header: '03 02', body: '20 03' }
148
148
  }
149
149
  ];
150
- /**
151
- * Downlink command.
152
- *
153
- * @example
154
- * ```js
155
- * import SetParameter from 'jooby-codec/commands/downlink/SetParameter';
156
- *
157
- * const parameters = {id: constants.deviceParameters.ABSOLUTE_DATA, data: {value: 2023, meterValue: 204, pulseCoefficient: 100}};
158
- * const command = new SetParameter(parameters);
159
- *
160
- * // output command binary in hex representation
161
- * console.log(command.toHex());
162
- * // 03 0a 17 00 00 00 cc 83 00 00 07 e7
163
- * ```
164
- *
165
- * [Command format documentation](https://github.com/jooby-dev/jooby-docs/blob/main/docs/commands/downlink/SetParameter.md)
166
- */
167
150
  class SetParameter extends Command {
168
151
  constructor(parameters) {
169
152
  super();
170
153
  this.parameters = parameters;
171
154
  }
172
- // data - only body (without header)
173
155
  static fromBytes(data) {
174
156
  const buffer = new CommandBinaryBuffer(data);
175
157
  return new SetParameter(buffer.getParameter());
176
158
  }
177
- // returns full message - header with body
178
159
  toBytes() {
179
160
  const buffer = new CommandBinaryBuffer(CommandBinaryBuffer.getParameterSize(this.parameters));
180
161
  buffer.setParameter(this.parameters);
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SetParameter.js","sourceRoot":"","sources":["../../../../src/analog/commands/downlink/SetParameter.ts"],"names":[],"mappings":"AAAA,OAAO,OAA8B,MAAM,kBAAkB,CAAC;AAC9D,OAAO,m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AAC,YAAY,EAAE,CAAC,CAAC;IACnD,CAAC;IAGD,OAAO;QACH,MAAM,MAAM,GAAG,IAAI,mBAAmB,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC;QAE9F,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QAErC,OAAO,OAAO,CAAC,OAAO,CAAC,UAAU,EAAE,MAAM,CAAC,gBAAgB,EAAE,CAAC,CAAC;IAClE,CAAC;;AAvBe,eAAE,GAAG,UAAU,CAAC;AAEhB,0BAAa,GAAG,QAAQ,CAAC;AAEzB,qBAAQ,GAAG,QAAQ,CAAC;AAEpB,0BAAa,GAAG,IAAI,CAAC;AAqBzC,eAAe,YAAY,CAAC"}
@@ -0,0 +1,16 @@
1
+ import Command, { TCommandExampleList } from '../../Command.js';
2
+ interface ISetTime2000Parameters {
3
+ sequenceNumber: number;
4
+ seconds: number;
5
+ }
6
+ declare class SetTime2000 extends Command {
7
+ parameters: ISetTime2000Parameters;
8
+ constructor(parameters: ISetTime2000Parameters);
9
+ static readonly id = 2;
10
+ static readonly directionType = 1;
11
+ static readonly examples: TCommandExampleList;
12
+ static readonly hasParameters = true;
13
+ static fromBytes(data: Uint8Array): SetTime2000;
14
+ toBytes(): Uint8Array;
15
+ }
16
+ export default SetTime2000;
@@ -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 { DOWNLINK } from '../../constants/directions.js';
4
4
  const COMMAND_ID = 0x02;
5
5
  const COMMAND_BODY_SIZE = 5;
@@ -10,32 +10,14 @@ const examples = [
10
10
  hex: { header: '02 05', body: '4e 2b bd 98 ad' }
11
11
  }
12
12
  ];
13
- /**
14
- * Downlink command.
15
- *
16
- * @example
17
- * ```js
18
- * import SetTime2000 from 'jooby-codec/commands/downlink/SetTime2000';
19
- *
20
- * const parameters = {sequenceNumber: 78, seconds: 123456};
21
- * const command = new SetTime2000(parameters);
22
- *
23
- * // output command binary in hex representation
24
- * console.log(command.toHex());
25
- * // 02 05 4e 00 01 e2 40
26
- * ```
27
- *
28
- * [Command format documentation](https://github.com/jooby-dev/jooby-docs/blob/main/docs/commands/SetTime2000.md#request)
29
- */
30
13
  class SetTime2000 extends Command {
31
14
  constructor(parameters) {
32
15
  super();
33
16
  this.parameters = parameters;
34
17
  }
35
- // data - only body (without header)
36
18
  static fromBytes(data) {
37
19
  if (data.byteLength !== COMMAND_BODY_SIZE) {
38
- throw new Error(`${this.getName()}. Wrong buffer size: ${data.byteLength}.`);
20
+ throw new Error(`Wrong buffer size: ${data.byteLength}.`);
39
21
  }
40
22
  const buffer = new BinaryBuffer(data, false);
41
23
  const parameters = {
@@ -43,11 +25,10 @@ class SetTime2000 extends Command {
43
25
  seconds: buffer.getInt32()
44
26
  };
45
27
  if (!buffer.isEmpty) {
46
- throw new Error(`${this.getName()}. BinaryBuffer is not empty.`);
28
+ throw new Error('BinaryBuffer is not empty.');
47
29
  }
48
30
  return new SetTime2000(parameters);
49
31
  }
50
- // returns full message - header with body
51
32
  toBytes() {
52
33
  const { sequenceNumber, seconds } = this.parameters;
53
34
  const buffer = new BinaryBuffer(COMMAND_BODY_SIZE, false);
@@ -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,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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,OAA8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E,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,C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7C,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
+ startTime: 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;