openc3-cosmos-tool-docs 6.4.1 → 6.4.2

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 (248) hide show
  1. checksums.yaml +4 -4
  2. data/tools/staticdocs/404.html +4 -1
  3. data/tools/staticdocs/assets/css/styles.1a361da6.css +1 -0
  4. data/tools/staticdocs/assets/images/cmd-processing-f279f2a9798a3000e07540ec5d4eaf095a84b312cd673285b595eebf901f4663.png +0 -0
  5. data/tools/staticdocs/assets/images/docker-security-bb6d4bdd60a5cd7df87a572159c6369b67bee5735be5a501b25786cabdcd4228.png +0 -0
  6. data/tools/staticdocs/assets/images/tlm-processing-ce5d4cc16e4a19d9c4f799cc8af975e93eb1c54ba0d43acbc31cc048667b223d.png +0 -0
  7. data/tools/staticdocs/assets/js/019369f3.5dd06a57.js +1 -0
  8. data/tools/staticdocs/assets/js/058ffc22.ed3ac5fa.js +1 -0
  9. data/tools/staticdocs/assets/js/0686a885.ef66a55c.js +1 -0
  10. data/tools/staticdocs/assets/js/078dbab0.43788fd9.js +1 -0
  11. data/tools/staticdocs/assets/js/0f5d161c.7aacaf90.js +1 -0
  12. data/tools/staticdocs/assets/js/0ff569c9.7aa50138.js +1 -0
  13. data/tools/staticdocs/assets/js/103cc3be.ff33b528.js +1 -0
  14. data/tools/staticdocs/assets/js/13196248.14de6ce1.js +1 -0
  15. data/tools/staticdocs/assets/js/13c1b4e4.2dafa283.js +1 -0
  16. data/tools/staticdocs/assets/js/1602.502ef9b1.js +1 -0
  17. data/tools/staticdocs/assets/js/1e02e6a3.d99a363c.js +1 -0
  18. data/tools/staticdocs/assets/js/2047b354.d91543a5.js +1 -0
  19. data/tools/staticdocs/assets/js/2124.545702e0.js +1 -0
  20. data/tools/staticdocs/assets/js/22b3ac48.5eb8d876.js +1 -0
  21. data/tools/staticdocs/assets/js/2368.fd1bb46a.js +4 -0
  22. data/tools/staticdocs/assets/js/26b8abb2.021651f5.js +1 -0
  23. data/tools/staticdocs/assets/js/2bb7bf90.1eee5bcb.js +1 -0
  24. data/tools/staticdocs/assets/js/2c15ad40.7f30b517.js +1 -0
  25. data/tools/staticdocs/assets/js/35398c5c.4f30c5da.js +1 -0
  26. data/tools/staticdocs/assets/js/3687.8bc61ef3.js +101 -0
  27. data/tools/staticdocs/assets/js/3dd7ef3b.dfbe9bb7.js +1 -0
  28. data/tools/staticdocs/assets/js/40365d27.42b05c12.js +1 -0
  29. data/tools/staticdocs/assets/js/411898ad.e55efd5d.js +1 -0
  30. data/tools/staticdocs/assets/js/42170351.2de491d4.js +1 -0
  31. data/tools/staticdocs/assets/js/43652efd.f7c95691.js +1 -0
  32. data/tools/staticdocs/assets/js/53ca7c5b.2da36c11.js +1 -0
  33. data/tools/staticdocs/assets/js/54d0d530.7cc2c5cc.js +1 -0
  34. data/tools/staticdocs/assets/js/5b233ba7.29533a03.js +1 -0
  35. data/tools/staticdocs/assets/js/5bc719f6.62d9a8b8.js +1 -0
  36. data/tools/staticdocs/assets/js/5c6ce5ec.40e0caf8.js +1 -0
  37. data/tools/staticdocs/assets/js/5e3ed378.64ea5a52.js +1 -0
  38. data/tools/staticdocs/assets/js/5fe211ef.2d29f3fb.js +1 -0
  39. data/tools/staticdocs/assets/js/6831b732.ec0009ac.js +1 -0
  40. data/tools/staticdocs/assets/js/696b4199.1c205c60.js +1 -0
  41. data/tools/staticdocs/assets/js/6b210247.32ded6d5.js +1 -0
  42. data/tools/staticdocs/assets/js/6b65133b.b2a62736.js +1 -0
  43. data/tools/staticdocs/assets/js/6f92e431.7bd2a1f1.js +1 -0
  44. data/tools/staticdocs/assets/js/72c6d8a8.21321ecc.js +1 -0
  45. data/tools/staticdocs/assets/js/75e64983.e0eb7741.js +1 -0
  46. data/tools/staticdocs/assets/js/7690.fc05b8e6.js +1 -0
  47. data/tools/staticdocs/assets/js/7719.0d312792.js +1 -0
  48. data/tools/staticdocs/assets/js/80c97f38.a0dfbdf7.js +1 -0
  49. data/tools/staticdocs/assets/js/867640d5.32ca371f.js +1 -0
  50. data/tools/staticdocs/assets/js/{89e76475.e1b0dbdb.js → 89e76475.20b3a636.js} +1 -1
  51. data/tools/staticdocs/assets/js/8f7843ee.6d7c9cd4.js +1 -0
  52. data/tools/staticdocs/assets/js/9424f0b3.75b12400.js +1 -0
  53. data/tools/staticdocs/assets/js/964eb012.0eee94ba.js +1 -0
  54. data/tools/staticdocs/assets/js/97535711.630cee4d.js +1 -0
  55. data/tools/staticdocs/assets/js/99581c43.73b5cd90.js +1 -0
  56. data/tools/staticdocs/assets/js/9d6e81d0.6b6404ff.js +1 -0
  57. data/tools/staticdocs/assets/js/9fb6059a.715fc441.js +1 -0
  58. data/tools/staticdocs/assets/js/a677c089.76d13f14.js +1 -0
  59. data/tools/staticdocs/assets/js/a9987364.3b3e7379.js +1 -0
  60. data/tools/staticdocs/assets/js/a9b2dc27.da1da6f1.js +1 -0
  61. data/tools/staticdocs/assets/js/aa6b6c1b.bc122746.js +1 -0
  62. data/tools/staticdocs/assets/js/b062d239.4e8142cb.js +1 -0
  63. data/tools/staticdocs/assets/js/b38a6d74.4a10f506.js +1 -0
  64. data/tools/staticdocs/assets/js/b4596165.08749f15.js +1 -0
  65. data/tools/staticdocs/assets/js/b6d70f94.776bc00f.js +1 -0
  66. data/tools/staticdocs/assets/js/b9f60ba6.ce400445.js +1 -0
  67. data/tools/staticdocs/assets/js/bd0034eb.a201a4a7.js +1 -0
  68. data/tools/staticdocs/assets/js/c24eae19.77326c08.js +1 -0
  69. data/tools/staticdocs/assets/js/{c2598f55.812cdcd1.js → c2598f55.85419dc8.js} +1 -1
  70. data/tools/staticdocs/assets/js/cb8c3f08.73cefada.js +1 -0
  71. data/tools/staticdocs/assets/js/cd879be4.dc2adfcc.js +1 -0
  72. data/tools/staticdocs/assets/js/d1b923aa.57f5e162.js +1 -0
  73. data/tools/staticdocs/assets/js/d1bfc316.73bb876f.js +1 -0
  74. data/tools/staticdocs/assets/js/d24bf9b6.e348c06d.js +1 -0
  75. data/tools/staticdocs/assets/js/d57a4b5d.885590b1.js +1 -0
  76. data/tools/staticdocs/assets/js/d5d77c37.1143a9d4.js +1 -0
  77. data/tools/staticdocs/assets/js/d66bf9c0.0ffb9759.js +1 -0
  78. data/tools/staticdocs/assets/js/d8ca4191.fe602968.js +1 -0
  79. data/tools/staticdocs/assets/js/d9b92eba.a115a366.js +1 -0
  80. data/tools/staticdocs/assets/js/db8fa1d0.1aefa4e7.js +1 -0
  81. data/tools/staticdocs/assets/js/dbe31111.9c957b0c.js +1 -0
  82. data/tools/staticdocs/assets/js/dc5f7beb.ddc630ca.js +1 -0
  83. data/tools/staticdocs/assets/js/e501b0d1.f9c2d1fc.js +1 -0
  84. data/tools/staticdocs/assets/js/f15615f1.a4d98d69.js +1 -0
  85. data/tools/staticdocs/assets/js/fd886806.656b4fa3.js +1 -0
  86. data/tools/staticdocs/assets/js/main.ba1fa268.js +38 -0
  87. data/tools/staticdocs/assets/js/runtime~main.ca894d1e.js +1 -0
  88. data/tools/staticdocs/docs/configuration/accessors.html +21 -18
  89. data/tools/staticdocs/docs/configuration/command.html +35 -35
  90. data/tools/staticdocs/docs/configuration/conversions.html +156 -0
  91. data/tools/staticdocs/docs/configuration/format.html +18 -15
  92. data/tools/staticdocs/docs/configuration/interfaces.html +34 -31
  93. data/tools/staticdocs/docs/configuration/plugins.html +39 -36
  94. data/tools/staticdocs/docs/configuration/protocols.html +28 -25
  95. data/tools/staticdocs/docs/configuration/ssl-tls.html +10 -6
  96. data/tools/staticdocs/docs/configuration/table.html +19 -22
  97. data/tools/staticdocs/docs/configuration/target.html +11 -8
  98. data/tools/staticdocs/docs/configuration/telemetry-screens.html +72 -69
  99. data/tools/staticdocs/docs/configuration/telemetry.html +40 -40
  100. data/tools/staticdocs/docs/configuration.html +4 -1
  101. data/tools/staticdocs/docs/development/curl.html +12 -9
  102. data/tools/staticdocs/docs/development/developing.html +15 -12
  103. data/tools/staticdocs/docs/development/json-api.html +8 -5
  104. data/tools/staticdocs/docs/development/log-structure.html +5 -2
  105. data/tools/staticdocs/docs/development/roadmap.html +5 -2
  106. data/tools/staticdocs/docs/development/streaming-api.html +13 -10
  107. data/tools/staticdocs/docs/development/testing.html +15 -12
  108. data/tools/staticdocs/docs/development.html +4 -1
  109. data/tools/staticdocs/docs/getting-started/cli.html +16 -13
  110. data/tools/staticdocs/docs/getting-started/generators.html +19 -16
  111. data/tools/staticdocs/docs/getting-started/gettingstarted.html +15 -12
  112. data/tools/staticdocs/docs/getting-started/installation.html +7 -4
  113. data/tools/staticdocs/docs/getting-started/key-concepts.html +6 -3
  114. data/tools/staticdocs/docs/getting-started/podman.html +19 -16
  115. data/tools/staticdocs/docs/getting-started/requirements.html +7 -4
  116. data/tools/staticdocs/docs/getting-started/upgrading.html +23 -15
  117. data/tools/staticdocs/docs/getting-started.html +4 -1
  118. data/tools/staticdocs/docs/guides/bridges.html +7 -4
  119. data/tools/staticdocs/docs/guides/cfs.html +19 -16
  120. data/tools/staticdocs/docs/guides/custom-widgets.html +54 -16
  121. data/tools/staticdocs/docs/guides/dynamic-packets.html +9 -6
  122. data/tools/staticdocs/docs/guides/exposing-microservices.html +9 -6
  123. data/tools/staticdocs/docs/guides/little-endian-bitfields.html +6 -3
  124. data/tools/staticdocs/docs/guides/local-mode.html +6 -3
  125. data/tools/staticdocs/docs/guides/logging.html +5 -2
  126. data/tools/staticdocs/docs/guides/monitoring.html +11 -8
  127. data/tools/staticdocs/docs/guides/performance.html +6 -3
  128. data/tools/staticdocs/docs/guides/raspberrypi.html +6 -3
  129. data/tools/staticdocs/docs/guides/reference-architectures.html +35 -0
  130. data/tools/staticdocs/docs/guides/script-writing.html +46 -43
  131. data/tools/staticdocs/docs/guides/scripting-api.html +627 -433
  132. data/tools/staticdocs/docs/guides.html +4 -1
  133. data/tools/staticdocs/docs/meta/contributing.html +10 -7
  134. data/tools/staticdocs/docs/meta/licenses.html +6 -3
  135. data/tools/staticdocs/docs/meta/philosophy.html +5 -2
  136. data/tools/staticdocs/docs/meta/xtce.html +7 -4
  137. data/tools/staticdocs/docs/meta.html +4 -1
  138. data/tools/staticdocs/docs/privacy.html +5 -2
  139. data/tools/staticdocs/docs/tools/admin.html +5 -2
  140. data/tools/staticdocs/docs/tools/autonomic.html +5 -2
  141. data/tools/staticdocs/docs/tools/bucket-explorer.html +5 -2
  142. data/tools/staticdocs/docs/tools/calendar.html +5 -2
  143. data/tools/staticdocs/docs/tools/cmd-sender.html +5 -2
  144. data/tools/staticdocs/docs/tools/cmd-tlm-server.html +5 -2
  145. data/tools/staticdocs/docs/tools/command_history.html +5 -2
  146. data/tools/staticdocs/docs/tools/data-extractor.html +5 -2
  147. data/tools/staticdocs/docs/tools/data-viewer.html +5 -2
  148. data/tools/staticdocs/docs/tools/handbooks.html +5 -2
  149. data/tools/staticdocs/docs/tools/limits-monitor.html +5 -2
  150. data/tools/staticdocs/docs/tools/packet-viewer.html +5 -2
  151. data/tools/staticdocs/docs/tools/script-runner.html +9 -6
  152. data/tools/staticdocs/docs/tools/table-manager.html +6 -3
  153. data/tools/staticdocs/docs/tools/tlm-grapher.html +5 -2
  154. data/tools/staticdocs/docs/tools/tlm-viewer.html +5 -2
  155. data/tools/staticdocs/docs/tools.html +4 -1
  156. data/tools/staticdocs/docs.html +6 -8
  157. data/tools/staticdocs/img/cmd-processing.png +0 -0
  158. data/tools/staticdocs/img/docker-local-security.png +0 -0
  159. data/tools/staticdocs/img/docker-security.png +0 -0
  160. data/tools/staticdocs/img/tlm-processing.png +0 -0
  161. data/tools/staticdocs/index.html +4 -1
  162. data/tools/staticdocs/lunr-index-1748640055686.json +1 -0
  163. data/tools/staticdocs/lunr-index.json +1 -1
  164. data/tools/staticdocs/markdown-page.html +5 -2
  165. data/tools/staticdocs/search-doc-1748640055686.json +1 -0
  166. data/tools/staticdocs/search-doc.json +1 -1
  167. data/tools/staticdocs/sitemap.xml +1 -1
  168. metadata +94 -83
  169. data/tools/staticdocs/assets/css/styles.1de6b959.css +0 -1
  170. data/tools/staticdocs/assets/js/019369f3.43fd7635.js +0 -1
  171. data/tools/staticdocs/assets/js/058ffc22.5cfabd67.js +0 -1
  172. data/tools/staticdocs/assets/js/0686a885.0e2ea47d.js +0 -1
  173. data/tools/staticdocs/assets/js/078dbab0.5515d5e3.js +0 -1
  174. data/tools/staticdocs/assets/js/0f5d161c.7697df48.js +0 -1
  175. data/tools/staticdocs/assets/js/0ff569c9.f81b787b.js +0 -1
  176. data/tools/staticdocs/assets/js/103cc3be.e7943c80.js +0 -1
  177. data/tools/staticdocs/assets/js/13196248.ea83002e.js +0 -1
  178. data/tools/staticdocs/assets/js/13c1b4e4.eb5250f4.js +0 -1
  179. data/tools/staticdocs/assets/js/1e02e6a3.12bdc98d.js +0 -1
  180. data/tools/staticdocs/assets/js/2047b354.d91f6c3e.js +0 -1
  181. data/tools/staticdocs/assets/js/22b3ac48.0df9587b.js +0 -1
  182. data/tools/staticdocs/assets/js/26b8abb2.7f8d4cb0.js +0 -1
  183. data/tools/staticdocs/assets/js/2bb7bf90.1772f030.js +0 -1
  184. data/tools/staticdocs/assets/js/35398c5c.fcf47881.js +0 -1
  185. data/tools/staticdocs/assets/js/3969.afdd070b.js +0 -1
  186. data/tools/staticdocs/assets/js/3dd7ef3b.c3455b97.js +0 -1
  187. data/tools/staticdocs/assets/js/40365d27.5ed2e9b5.js +0 -1
  188. data/tools/staticdocs/assets/js/411898ad.f7b3ff17.js +0 -1
  189. data/tools/staticdocs/assets/js/42170351.fbc05869.js +0 -1
  190. data/tools/staticdocs/assets/js/43652efd.60fa883f.js +0 -1
  191. data/tools/staticdocs/assets/js/5205.c6f31e57.js +0 -1
  192. data/tools/staticdocs/assets/js/5328.3e2a53eb.js +0 -1
  193. data/tools/staticdocs/assets/js/53ca7c5b.fe331a71.js +0 -1
  194. data/tools/staticdocs/assets/js/54d0d530.ef91ba12.js +0 -1
  195. data/tools/staticdocs/assets/js/5761.e7fabbc9.js +0 -4
  196. data/tools/staticdocs/assets/js/5b233ba7.9d6ba314.js +0 -1
  197. data/tools/staticdocs/assets/js/5bc719f6.6d27292c.js +0 -1
  198. data/tools/staticdocs/assets/js/5c6ce5ec.652b922b.js +0 -1
  199. data/tools/staticdocs/assets/js/5e3ed378.8b51f7c0.js +0 -1
  200. data/tools/staticdocs/assets/js/5fe211ef.63b46202.js +0 -1
  201. data/tools/staticdocs/assets/js/651.a043d7b1.js +0 -1
  202. data/tools/staticdocs/assets/js/6831b732.1318b398.js +0 -1
  203. data/tools/staticdocs/assets/js/696b4199.1e950fcb.js +0 -1
  204. data/tools/staticdocs/assets/js/6b210247.6a77064a.js +0 -1
  205. data/tools/staticdocs/assets/js/6b65133b.0376a397.js +0 -1
  206. data/tools/staticdocs/assets/js/6f92e431.6439052e.js +0 -1
  207. data/tools/staticdocs/assets/js/72c6d8a8.b6fcfc30.js +0 -1
  208. data/tools/staticdocs/assets/js/75e64983.324643a8.js +0 -1
  209. data/tools/staticdocs/assets/js/80c97f38.607160d3.js +0 -1
  210. data/tools/staticdocs/assets/js/867640d5.27d9d599.js +0 -1
  211. data/tools/staticdocs/assets/js/8f7843ee.abe30983.js +0 -1
  212. data/tools/staticdocs/assets/js/9357.9a7e89b5.js +0 -101
  213. data/tools/staticdocs/assets/js/9424f0b3.3683501c.js +0 -1
  214. data/tools/staticdocs/assets/js/964eb012.0e04c58d.js +0 -1
  215. data/tools/staticdocs/assets/js/97535711.e595488c.js +0 -1
  216. data/tools/staticdocs/assets/js/99581c43.841b4a2e.js +0 -1
  217. data/tools/staticdocs/assets/js/9d6e81d0.36405219.js +0 -1
  218. data/tools/staticdocs/assets/js/9fb6059a.821f7504.js +0 -1
  219. data/tools/staticdocs/assets/js/a677c089.cfa50691.js +0 -1
  220. data/tools/staticdocs/assets/js/a9987364.b418f772.js +0 -1
  221. data/tools/staticdocs/assets/js/a9b2dc27.805dc1ba.js +0 -1
  222. data/tools/staticdocs/assets/js/aa6b6c1b.ef9b0f38.js +0 -1
  223. data/tools/staticdocs/assets/js/b062d239.57d6e194.js +0 -1
  224. data/tools/staticdocs/assets/js/b4596165.c648533a.js +0 -1
  225. data/tools/staticdocs/assets/js/b6d70f94.a9228642.js +0 -1
  226. data/tools/staticdocs/assets/js/b9f60ba6.4c0bb1dd.js +0 -1
  227. data/tools/staticdocs/assets/js/bd0034eb.8ad39448.js +0 -1
  228. data/tools/staticdocs/assets/js/c24eae19.0575c394.js +0 -1
  229. data/tools/staticdocs/assets/js/cb8c3f08.07d1c9e9.js +0 -1
  230. data/tools/staticdocs/assets/js/cd879be4.59af1749.js +0 -1
  231. data/tools/staticdocs/assets/js/d1b923aa.da892cde.js +0 -1
  232. data/tools/staticdocs/assets/js/d1bfc316.a58b9bbd.js +0 -1
  233. data/tools/staticdocs/assets/js/d24bf9b6.9fef8263.js +0 -1
  234. data/tools/staticdocs/assets/js/d57a4b5d.c74b62b1.js +0 -1
  235. data/tools/staticdocs/assets/js/d5d77c37.e812e6e7.js +0 -1
  236. data/tools/staticdocs/assets/js/d66bf9c0.80a50660.js +0 -1
  237. data/tools/staticdocs/assets/js/d8ca4191.8df86c99.js +0 -1
  238. data/tools/staticdocs/assets/js/d9b92eba.5db8667e.js +0 -1
  239. data/tools/staticdocs/assets/js/db8fa1d0.f1eed806.js +0 -1
  240. data/tools/staticdocs/assets/js/dbe31111.75e9fc53.js +0 -1
  241. data/tools/staticdocs/assets/js/dc5f7beb.9e4e6681.js +0 -1
  242. data/tools/staticdocs/assets/js/e501b0d1.d3a1e4bc.js +0 -1
  243. data/tools/staticdocs/assets/js/f15615f1.49804e96.js +0 -1
  244. data/tools/staticdocs/assets/js/fd886806.124ffe26.js +0 -1
  245. data/tools/staticdocs/assets/js/main.b1edeb65.js +0 -36
  246. data/tools/staticdocs/assets/js/runtime~main.3629ffb4.js +0 -1
  247. data/tools/staticdocs/lunr-index-1747245438937.json +0 -1
  248. data/tools/staticdocs/search-doc-1747245438937.json +0 -1
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkdocs_openc3_com=self.webpackChunkdocs_openc3_com||[]).push([["718"],{1226:function(e,i,r){r.r(i),r.d(i,{frontMatter:()=>s,default:()=>h,contentTitle:()=>c,assets:()=>a,toc:()=>l,metadata:()=>n});var n=JSON.parse('{"id":"guides/exposing-microservices","title":"Exposing Microservices","description":"Provide external accessibility to microservices","source":"@site/docs/guides/exposing-microservices.md","sourceDirName":"guides","slug":"/guides/exposing-microservices","permalink":"/tools/staticdocs/docs/guides/exposing-microservices","draft":false,"unlisted":false,"editUrl":"https://github.com/OpenC3/cosmos/tree/main/docs.openc3.com/docs/guides/exposing-microservices.md","tags":[],"version":"current","frontMatter":{"title":"Exposing Microservices","description":"Provide external accessibility to microservices","sidebar_custom_props":{"myEmoji":"\uD83D\uDEAA"}},"sidebar":"defaultSidebar","previous":{"title":"Dynamic Packets","permalink":"/tools/staticdocs/docs/guides/dynamic-packets"},"next":{"title":"Little Endian Bitfields","permalink":"/tools/staticdocs/docs/guides/little-endian-bitfields"}}'),t=r(2322),o=r(2840);let s={title:"Exposing Microservices",description:"Provide external accessibility to microservices",sidebar_custom_props:{myEmoji:"\uD83D\uDEAA"}},c=void 0,a={},l=[{value:"Expose microservices using the PORT and ROUTE_PREFIX keywords",id:"expose-microservices-using-the-port-and-route_prefix-keywords",level:2},{value:"Connecting to microservices from a different INTERFACE in plugin.txt",id:"connecting-to-microservices-from-a-different-interface-in-plugintxt",level:2}];function d(e){let i={a:"a",admonition:"admonition",code:"code",h2:"h2",li:"li",p:"p",pre:"pre",ul:"ul",...(0,o.a)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(i.p,{children:"COSMOS provides a simple method to add new APIs and make custom microservices and interfaces accessible to the network."}),"\n",(0,t.jsx)(i.admonition,{title:"Make sure anything you expose is secure",type:"warning",children:(0,t.jsx)(i.p,{children:"Make sure that any new apis you expose check for user credentials and authorize actions appropriately."})}),"\n",(0,t.jsx)(i.h2,{id:"expose-microservices-using-the-port-and-route_prefix-keywords",children:"Expose microservices using the PORT and ROUTE_PREFIX keywords"}),"\n",(0,t.jsxs)(i.p,{children:["In your plugin.txt file, both ",(0,t.jsx)(i.a,{href:"../configuration/plugins#interface-1",children:"INTERFACE"})," and ",(0,t.jsx)(i.a,{href:"../configuration/plugins#microservice-1",children:"MICROSERVICE"})," support the keywords ",(0,t.jsx)(i.a,{href:"../configuration/plugins#port-1",children:"PORT"})," and ",(0,t.jsx)(i.a,{href:"../configuration/plugins#route_prefix-1",children:"ROUTE_PREFIX"}),"."]}),"\n",(0,t.jsxs)(i.p,{children:[(0,t.jsx)(i.a,{href:"../configuration/plugins#port-1",children:"PORT"})," is used to declare the port(s) that your microservice is listening for connections on. This is used in combination with ",(0,t.jsx)(i.a,{href:"../configuration/plugins#route_prefix-1",children:"ROUTE_PREFIX"})," to create a dynamic traefik route to your microservice."]}),"\n",(0,t.jsx)(i.p,{children:"The following code is used internally to let traefik know where to connect to your microservice internally:"}),"\n",(0,t.jsx)(i.pre,{children:(0,t.jsx)(i.code,{className:"language-ruby",children:"if ENV['OPENC3_OPERATOR_HOSTNAME']\n url = \"http://#{ENV['OPENC3_OPERATOR_HOSTNAME']}:#{port}\"\nelse\n if ENV['KUBERNETES_SERVICE_HOST']\n url = \"http://#{microservice_name.downcase.gsub('__', '-').gsub('_', '-')}-service:#{port}\"\n else\n url = \"http://openc3-operator:#{port}\"\n end\nend\n"})}),"\n",(0,t.jsx)(i.p,{children:"Note that this is the internal route to your microservice. Determining this route checks two different environment variables."}),"\n",(0,t.jsx)(i.p,{children:'OPENC3_OPERATOR_HOSTNAME is used to override the default service name for our regular docker compose operator of "openc3-operator". Usually this is not set.'}),"\n",(0,t.jsx)(i.p,{children:"In OpenC3 Enterprise, KUBERNETES_SERVICE_HOST is used to detect if we are running in a Kubernetes environment (it will be set by Kubernetes), in which case the service is expected to have a Kubernetes service named scope-user-microservicename-service. For example, if you are using the DEFAULT scope and have a microservice named MYMICROSERVICE the service would be found at the hostname: default-user-mymicroservice-service. Double underscores or single underscores are replaced by a dash and the name is all lower case."}),"\n",(0,t.jsxs)(i.p,{children:[(0,t.jsx)(i.a,{href:"../configuration/plugins#route_prefix-1",children:"ROUTE_PREFIX"})," is used to define the external route. The external route will take the form of http(s)://YOURCOSMOSDOMAIN",":PORT","/ROUTE_PREFIX. So for example, if you set the ",(0,t.jsx)(i.a,{href:"../configuration/plugins#route_prefix-1",children:"ROUTE_PREFIX"})," to /mymicroservice then on a default local installation, it could be reached at ",(0,t.jsx)(i.code,{children:"http://localhost:2900/mymicroservice"}),". The ",(0,t.jsx)(i.code,{children:"http://localhost:2900"})," part should be substituted by whatever domain you are accessing COSMOS at."]}),"\n",(0,t.jsxs)(i.p,{children:["Here is a snippet of code showing ",(0,t.jsx)(i.a,{href:"../configuration/plugins#port-1",children:"PORT"})," and ",(0,t.jsx)(i.a,{href:"../configuration/plugins#route_prefix-1",children:"ROUTE_PREFIX"})," in use within a plugin.txt file:"]}),"\n",(0,t.jsx)(i.pre,{children:(0,t.jsx)(i.code,{className:"language-bash",children:"VARIABLE cfdp_microservice_name CFDP\nVARIABLE cfdp_route_prefix /cfdp\nVARIABLE cfdp_port 2905\n\nMICROSERVICE CFDP <%= cfdp_microservice_name %>\n WORK_DIR .\n ROUTE_PREFIX <%= cfdp_route_prefix %>\n PORT <%= cfdp_port %>\n"})}),"\n",(0,t.jsx)(i.p,{children:"Leaving the variables at their default values the following will occur:"}),"\n",(0,t.jsxs)(i.ul,{children:["\n",(0,t.jsxs)(i.li,{children:["The microservice will be exposed internally to Docker (Core or Enterprise) at: ",(0,t.jsx)(i.code,{children:"http://openc3-operator:2905"})]}),"\n",(0,t.jsxs)(i.li,{children:["The microservice will be exposed internally to Kubernetes (Enterprise) at: ",(0,t.jsx)(i.code,{children:"http://default-user-cfdp-service:2905"})]}),"\n",(0,t.jsxs)(i.li,{children:["The microservice will be exposed externally to the network at: ",(0,t.jsx)(i.code,{children:"http://localhost:2900/cfdp"})]}),"\n"]}),"\n",(0,t.jsxs)(i.p,{children:["The same can be done for ",(0,t.jsx)(i.a,{href:"../configuration/plugins#interface-1",children:"INTERFACE"})," but note that the Kubernetes service name will use the microservice name of the interface which takes the form of ",(0,t.jsx)(i.code,{children:"SCOPE__INTERFACE__INTERFACENAME"}),"."]}),"\n",(0,t.jsxs)(i.p,{children:["Here is an example using ",(0,t.jsx)(i.a,{href:"../configuration/plugins#port",children:"PORT"})," and ",(0,t.jsx)(i.a,{href:"../configuration/plugins#route_prefix",children:"ROUTE_PREFIX"})," with ",(0,t.jsx)(i.a,{href:"../configuration/plugins#interface-1",children:"INTERFACE"}),":"]}),"\n",(0,t.jsx)(i.pre,{children:(0,t.jsx)(i.code,{className:"language-bash",children:"VARIABLE my_interface_name MY_INT\nVARIABLE my_route_prefix /myint\nVARIABLE my_port 2910\n\nINTERFACE <%= my_interface_name %> http_server_interface.rb <%= my_port %>\n ROUTE_PREFIX <%= my_route_prefix %>\n PORT <%= my_port %>\n"})}),"\n",(0,t.jsxs)(i.ul,{children:["\n",(0,t.jsxs)(i.li,{children:["The interface will be exposed internally to Docker (Core or Enterprise) at: ",(0,t.jsx)(i.code,{children:"http://openc3-operator:2910"})]}),"\n",(0,t.jsxs)(i.li,{children:["The interface will be exposed internally to Kubernetes (Enterprise) at: ",(0,t.jsx)(i.code,{children:"http://default-interface-my-int-service:2905"})]}),"\n",(0,t.jsxs)(i.li,{children:["The interface will be exposed externally to the network at: ",(0,t.jsx)(i.code,{children:"http://localhost:2900/myint"})]}),"\n"]}),"\n",(0,t.jsx)(i.admonition,{title:"Sharded Operator on Kubernetes (Enterprise)",type:"warning",children:(0,t.jsx)(i.p,{children:"The sharded operator is expected to be used on Kubernetes whenever the Kubernetes Operator is not used. Typically this will be because the user does not have permission to use the Kubernetes API directly to spawn containers which is required for use of the Kubernetes Operator. In this case, Kubernetes services will NOT be automatically created, and will have to be manually created by a user with permissions in Kubernetes, or through some other authorized method (like a custom framework dashboard or config file)."})}),"\n",(0,t.jsx)(i.h2,{id:"connecting-to-microservices-from-a-different-interface-in-plugintxt",children:"Connecting to microservices from a different INTERFACE in plugin.txt"}),"\n",(0,t.jsx)(i.p,{children:"Sometimes you might want to have an INTERFACE connect to a microservice you are running. For this case, only the PORT keyword is required on the INTERFACE or MICROSERVICE because we are only connecting internally and ROUTE_PREFIX isn't used."}),"\n",(0,t.jsx)(i.p,{children:"The following code taken from our demo plugin provides an example of how to calculate the correct hostname across both Core and Enterprise versions of COSMOS in a plugin.txt file:"}),"\n",(0,t.jsx)(i.pre,{children:(0,t.jsx)(i.code,{children:" <% example_host = ENV['KUBERNETES_SERVICE_HOST'] ? \"#{scope}-user-#{example_microservice_name.downcase.gsub('__', '-').gsub('_', '-')}-service\" : \"openc3-operator\" %>\n INTERFACE <%= example_int_name %> example_interface.rb <%= example_host %> <%= example_port %>\n MAP_TARGET <%= example_target_name %>\n"})}),"\n",(0,t.jsx)(i.p,{children:"Note that the above code does not handle the OPENC3_OPERATOR_HOSTNAME environment variable which might change the default name of openc3-operator. Update as needed."})]})}function h(e={}){let{wrapper:i}={...(0,o.a)(),...e.components};return i?(0,t.jsx)(i,{...e,children:(0,t.jsx)(d,{...e})}):d(e)}},2840:function(e,i,r){r.d(i,{Z:()=>c,a:()=>s});var n=r(2784);let t={},o=n.createContext(t);function s(e){let i=n.useContext(o);return n.useMemo(function(){return"function"==typeof e?e(i):{...i,...e}},[i,e])}function c(e){let i;return i=e.disableParentContext?"function"==typeof e.components?e.components(t):e.components||t:s(e.components),n.createElement(o.Provider,{value:i},e.children)}}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkdocs_openc3_com=self.webpackChunkdocs_openc3_com||[]).push([["7481"],{2819:function(e,n,s){s.r(n),s.d(n,{frontMatter:()=>t,default:()=>h,contentTitle:()=>c,assets:()=>l,toc:()=>a,metadata:()=>i});var i=JSON.parse('{"id":"configuration/conversions","title":"Conversions","description":"Conversions to apply to command parameters and telemetry items","source":"@site/docs/configuration/conversions.md","sourceDirName":"configuration","slug":"/configuration/conversions","permalink":"/tools/staticdocs/docs/configuration/conversions","draft":false,"unlisted":false,"editUrl":"https://github.com/OpenC3/cosmos/tree/main/docs.openc3.com/docs/configuration/conversions.md","tags":[],"version":"current","sidebarPosition":9,"frontMatter":{"sidebar_position":9,"title":"Conversions","description":"Conversions to apply to command parameters and telemetry items","sidebar_custom_props":{"myEmoji":"\uD83D\uDD04"}},"sidebar":"defaultSidebar","previous":{"title":"Accessors","permalink":"/tools/staticdocs/docs/configuration/accessors"},"next":{"title":"Tables","permalink":"/tools/staticdocs/docs/configuration/table"}}'),r=s(2322),o=s(2840);let t={sidebar_position:9,title:"Conversions",description:"Conversions to apply to command parameters and telemetry items",sidebar_custom_props:{myEmoji:"\uD83D\uDD04"}},c="Overview",l={},a=[{value:"Custom Conversions",id:"custom-conversions",level:2},{value:"converted_type",id:"converted_type",level:3},{value:"converted_bit_size",id:"converted_bit_size",level:3},{value:"call",id:"call",level:3},{value:"Apply Conversion",id:"apply-conversion",level:3},{value:"BIT_REVERSE_CONVERSION",id:"bit_reverse_conversion",level:2},{value:"IP_READ_CONVERSION",id:"ip_read_conversion",level:2},{value:"IP_WRITE_CONVERSION",id:"ip_write_conversion",level:2},{value:"OBJECT_READ_CONVERSION",id:"object_read_conversion",level:2},{value:"OBJECT_WRITE_CONVERSION",id:"object_write_conversion",level:2},{value:"PACKET_TIME_FORMATTED_CONVERSION",id:"packet_time_formatted_conversion",level:2},{value:"PACKET_TIME_SECONDS_CONVERSION",id:"packet_time_seconds_conversion",level:2},{value:"POLYNOMIAL_CONVERSION",id:"polynomial_conversion",level:2},{value:"PROCESSOR_CONVERSION",id:"processor_conversion",level:2},{value:"RECEIVED_COUNT_CONVERSION",id:"received_count_conversion",level:2},{value:"RECEIVED_TIME_FORMATTED_CONVERSION",id:"received_time_formatted_conversion",level:2},{value:"RECEIVED_TIME_SECONDS_CONVERSION",id:"received_time_seconds_conversion",level:2},{value:"SEGMENTED_POLYNOMIAL_CONVERSION",id:"segmented_polynomial_conversion",level:2},{value:"UNIX_TIME_CONVERSION",id:"unix_time_conversion",level:2},{value:"UNIX_TIME_FORMATTED_CONVERSION",id:"unix_time_formatted_conversion",level:2},{value:"UNIX_TIME_SECONDS_CONVERSION",id:"unix_time_seconds_conversion",level:2}];function d(e){let n={a:"a",code:"code",h1:"h1",h2:"h2",h3:"h3",header:"header",p:"p",pre:"pre",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",...(0,o.a)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.header,{children:(0,r.jsx)(n.h1,{id:"overview",children:"Overview"})}),"\n",(0,r.jsxs)(n.p,{children:["Conversions can be applied to both command parameters and telemetry items to modify the values sent to and received from targets. To apply a conversion to a command you use the ",(0,r.jsx)(n.a,{href:"/docs/configuration/command#write_conversion",children:"WRITE_CONVERSION"})," keyword. To apply a conversion to a telemetry item you use the ",(0,r.jsx)(n.a,{href:"/docs/configuration/telemetry#read_conversion",children:"READ_CONVERSION"})," keyword."]}),"\n",(0,r.jsx)(n.h2,{id:"custom-conversions",children:"Custom Conversions"}),"\n",(0,r.jsxs)(n.p,{children:["You can easily create your own custom conversions by using the ",(0,r.jsx)(n.a,{href:"/docs/getting-started/generators#conversion-generator",children:"Conversion Code Generator"}),". To generate a telemetry conversion you must be inside an existing COSMOS plugin. The generator takes both a target name and the conversion name. For example if your plugin is called ",(0,r.jsx)(n.code,{children:"openc3-cosmos-gse"})," and you have an existing target named ",(0,r.jsx)(n.code,{children:"GSE"}),":"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",children:"openc3-cosmos-gse % openc3.sh cli generate conversion GSE double --python\nConversion targets/GSE/lib/double_conversion.py successfully generated!\nTo use the conversion add the following to a telemetry item:\n READ_CONVERSION double_conversion.py\n"})}),"\n",(0,r.jsxs)(n.p,{children:["To create a Ruby conversion simply replace ",(0,r.jsx)(n.code,{children:"--python"})," with ",(0,r.jsx)(n.code,{children:"--ruby"}),". This creates a conversion called ",(0,r.jsx)(n.code,{children:"double_conversion.py"})," at ",(0,r.jsx)(n.code,{children:"targets/GSE/lib/double_conversion.py"}),". The code which is generated looks like the following:"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-python",children:"from openc3.conversions.conversion import Conversion\n# Using tlm() requires the following:\n# from openc3.api.tlm_api import tlm\n\n# Custom conversion class\n# See https://docs.openc3.com/docs/configuration/telemetry#read_conversion\nclass DoubleConversion(Conversion):\n def __init__(self):\n super().__init__()\n # Should be one of 'INT', 'UINT', 'FLOAT', 'STRING', 'BLOCK'\n self.converted_type = 'STRING'\n # Size of the converted type in bits\n # Use 0 for 'STRING' or 'BLOCK' where the size can be variable\n self.converted_bit_size = 0\n\n # @param value [Object] Value based on the item definition. This could be\n # a string, integer, float, or array of values.\n # @param packet [Packet] The packet object where the conversion is defined\n # @param buffer [String] The raw packet buffer\n def call(self, value, packet, buffer):\n # Read values from the packet and do a conversion\n # Used for DERIVED items that don't have a value\n # item1 = packet.read(\"ITEM1\") # returns CONVERTED value (default)\n # item2 = packet.read(\"ITEM2\", 'RAW') # returns RAW value\n # return (item1 + item2) / 2\n #\n # Perform conversion logic directly on value\n # Used when conversion is applied to a regular (not DERIVED) item\n # NOTE: You can also use packet.read(\"ITEM\") to get additional values\n # return value / 2 * packet.read(\"OTHER_ITEM\")\n return value\n"})}),"\n",(0,r.jsxs)(n.p,{children:["There are a lot of comments to help you know what to do. The primary things to modify are the ",(0,r.jsx)(n.code,{children:"converted_type"}),", ",(0,r.jsx)(n.code,{children:"converted_bit_size"}),", and ",(0,r.jsx)(n.code,{children:"call"})," method."]}),"\n",(0,r.jsx)(n.h3,{id:"converted_type",children:"converted_type"}),"\n",(0,r.jsxs)(n.p,{children:["The ",(0,r.jsx)(n.code,{children:"converted_type"})," is the resulting type of the converted value. It lets consumers of the converted value know the resulting type. In our case we're doubling the input value and since this could be applied to an unsigned integer as well as a floating point value we'll choose ",(0,r.jsx)(n.code,{children:"FLOAT"}),"."]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-python",children:" self.converted_type = 'FLOAT'\n"})}),"\n",(0,r.jsx)(n.h3,{id:"converted_bit_size",children:"converted_bit_size"}),"\n",(0,r.jsxs)(n.p,{children:["The ",(0,r.jsx)(n.code,{children:"converted_bit_size"})," is the resulting size of the converted value. It lets consumers of the converted value know the resulting size. Since we chose ",(0,r.jsx)(n.code,{children:"FLOAT"})," as the type we'll choose ",(0,r.jsx)(n.code,{children:"32"})," as the bit size. We could have also chosen ",(0,r.jsx)(n.code,{children:"64"})," bits. Sometimes you know the type and size of the resulting conversion and can simply hard code them. Other times you need to pass them in as parameters and let the user decide."]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-python",children:" self.converted_bit_size = 32\n"})}),"\n",(0,r.jsx)(n.h3,{id:"call",children:"call"}),"\n",(0,r.jsx)(n.p,{children:"The call method is where the actual conversion logic is implemented. In our case we want to double the input value so we simply return the value multiplied by 2. The final result with comments removed looks like the following:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-python",children:"from openc3.conversions.conversion import Conversion\nclass DoubleConversion(Conversion):\n def __init__(self):\n super().__init__()\n self.converted_type = 'FLOAT'\n self.converted_bit_size = 32\n\n def call(self, value, packet, buffer):\n return value * 2\n"})}),"\n",(0,r.jsx)(n.h3,{id:"apply-conversion",children:"Apply Conversion"}),"\n",(0,r.jsxs)(n.p,{children:["Now that we have implemented the conversion logic we need to apply it to a telemetry item by adding the line ",(0,r.jsx)(n.code,{children:"READ_CONVERSION double_conversion.rb"})," in the ",(0,r.jsx)(n.a,{href:"/docs/configuration/telemetry",children:"telemetry"})," definition file. This could look something like this:"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",children:'TELEMETRY GSE DATA BIG_ENDIAN "Data packet"\n ... # Header items\n APPEND_ITEM VALUE 16 UINT "Value I want to double"\n READ_CONVERSION double_conversion.rb\n'})}),"\n",(0,r.jsx)(n.h1,{id:"built-in-conversions",children:"Built-in Conversions"}),"\n",(0,r.jsx)(n.h2,{id:"bit_reverse_conversion",children:"BIT_REVERSE_CONVERSION"}),"\n",(0,r.jsx)(n.p,{children:(0,r.jsx)(n.strong,{children:"Reverses the bits of the current telemetry item. Can be used as both a read and write conversion."})}),"\n",(0,r.jsx)(n.p,{children:"Ruby Example:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-ruby",children:"READ_CONVERSION bit_reverse_conversion.rb\nWRITE_CONVERSION bit_reverse_conversion.rb\n"})}),"\n",(0,r.jsx)(n.p,{children:"Python Example:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-python",children:"READ_CONVERSION openc3/conversions/bit_reverse_conversion.py\nWRITE_CONVERSION openc3/conversions/bit_reverse_conversion.py\n"})}),"\n",(0,r.jsx)(n.h2,{id:"ip_read_conversion",children:"IP_READ_CONVERSION"}),"\n",(0,r.jsx)(n.p,{children:(0,r.jsx)(n.strong,{children:"Reads a packed 32 bit integer into an IP address string"})}),"\n",(0,r.jsx)(n.p,{children:"This command reads a packed 32 bit integer into an IP address string.\nFor example, 0xFFFF8000 would be converted to '255.255.128.0'."}),"\n",(0,r.jsx)(n.p,{children:"Ruby Example:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-ruby",children:"READ_CONVERSION ip_read_conversion.rb\n"})}),"\n",(0,r.jsx)(n.p,{children:"Python Example:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-python",children:"READ_CONVERSION openc3/conversions/ip_read_conversion.py\n"})}),"\n",(0,r.jsx)(n.h2,{id:"ip_write_conversion",children:"IP_WRITE_CONVERSION"}),"\n",(0,r.jsx)(n.p,{children:(0,r.jsx)(n.strong,{children:"Write an ip address string into a packed 32 bit integer"})}),"\n",(0,r.jsx)(n.p,{children:"This command writes an IP address string into a packed 32 bit integer. The IP address\nstring should be in the format 'x.x.x.x' where x is a number between 0 and 255.\nFor example, '255.255.128.0' would be converted to 0xFFFF8000."}),"\n",(0,r.jsx)(n.p,{children:"Ruby Example:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-ruby",children:"WRITE_CONVERSION ip_write_conversion.rb\n"})}),"\n",(0,r.jsx)(n.p,{children:"Python Example:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-python",children:"WRITE_CONVERSION openc3/conversions/ip_write_conversion.py\n"})}),"\n",(0,r.jsx)(n.h2,{id:"object_read_conversion",children:"OBJECT_READ_CONVERSION"}),"\n",(0,r.jsx)(n.p,{children:(0,r.jsx)(n.strong,{children:"Reads values from the given packet object"})}),"\n",(0,r.jsx)(n.p,{children:"This command reads all the values from the given packet object. The values are\nreturned as a Ruby hash or Python dict. The packet object must be defined in the target's configuration."}),"\n",(0,r.jsxs)(n.table,{children:[(0,r.jsx)(n.thead,{children:(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.th,{children:"Parameter"}),(0,r.jsx)(n.th,{children:"Description"}),(0,r.jsx)(n.th,{children:"Required"})]})}),(0,r.jsxs)(n.tbody,{children:[(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"Command or Telemetry"}),(0,r.jsxs)(n.td,{children:["Whether the packet is a command or telemetry",(0,r.jsx)("br",{}),(0,r.jsx)("br",{}),"Valid Values: ",(0,r.jsx)("span",{class:"values",children:"CMD, TLM"})]}),(0,r.jsx)(n.td,{children:"True"})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"Target Name"}),(0,r.jsx)(n.td,{children:"Name of the target"}),(0,r.jsx)(n.td,{children:"True"})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"Packet Name"}),(0,r.jsx)(n.td,{children:"Name of the packet"}),(0,r.jsx)(n.td,{children:"True"})]})]})]}),"\n",(0,r.jsx)(n.p,{children:"Ruby Example:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-ruby",children:"READ_CONVERSION object_read_conversion.rb CMD INST COLLECT\n"})}),"\n",(0,r.jsx)(n.p,{children:"Python Example:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-python",children:"READ_CONVERSION openc3/conversions/object_read_conversion.py CMD INST COLLECT\n"})}),"\n",(0,r.jsx)(n.h2,{id:"object_write_conversion",children:"OBJECT_WRITE_CONVERSION"}),"\n",(0,r.jsx)(n.p,{children:(0,r.jsx)(n.strong,{children:"Writes values into the given packet object"})}),"\n",(0,r.jsx)(n.p,{children:"This command writes values into the given packet object. The values are specified\nin a hash format where the keys are the field names in the packet and the values\nare the values to write. The packet object must be defined in the target's configuration."}),"\n",(0,r.jsxs)(n.table,{children:[(0,r.jsx)(n.thead,{children:(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.th,{children:"Parameter"}),(0,r.jsx)(n.th,{children:"Description"}),(0,r.jsx)(n.th,{children:"Required"})]})}),(0,r.jsxs)(n.tbody,{children:[(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"Command or Telemetry"}),(0,r.jsxs)(n.td,{children:["Whether the packet is a command or telemetry",(0,r.jsx)("br",{}),(0,r.jsx)("br",{}),"Valid Values: ",(0,r.jsx)("span",{class:"values",children:"CMD, TLM"})]}),(0,r.jsx)(n.td,{children:"True"})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"Target Name"}),(0,r.jsx)(n.td,{children:"Name of the target"}),(0,r.jsx)(n.td,{children:"True"})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"Packet Name"}),(0,r.jsx)(n.td,{children:"Name of the packet"}),(0,r.jsx)(n.td,{children:"True"})]})]})]}),"\n",(0,r.jsx)(n.p,{children:"Ruby Example:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-ruby",children:"WRITE_CONVERSION object_write_conversion.rb CMD INST COLLECT\n"})}),"\n",(0,r.jsx)(n.p,{children:"Python Example:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-python",children:"WRITE_CONVERSION openc3/conversions/object_write_conversion.py CMD INST COLLECT\n"})}),"\n",(0,r.jsx)(n.h2,{id:"packet_time_formatted_conversion",children:"PACKET_TIME_FORMATTED_CONVERSION"}),"\n",(0,r.jsx)(n.p,{children:(0,r.jsxs)(n.strong,{children:['Converts the packet time to a formatted string like "YYYY/MM/DD HH:MM',":SS",'.US"']})}),"\n",(0,r.jsxs)(n.p,{children:["This in an internal conversion which is automatically applied to the\n'PACKET_TIMEFORMATTED' derived telemetry item. It is typically not explicitly used.\nFor more information see the ",(0,r.jsx)(n.a,{href:"/docs/configuration/telemetry#received-time-and-packet-time",children:"Received Time and Packet Time"})," documentation."]}),"\n",(0,r.jsx)(n.p,{children:"Ruby Example:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-ruby",children:"READ_CONVERSION packet_time_formatted_conversion.rb\n"})}),"\n",(0,r.jsx)(n.p,{children:"Python Example:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-python",children:"READ_CONVERSION openc3/conversions/packet_time_formatted_conversion.py\n"})}),"\n",(0,r.jsx)(n.h2,{id:"packet_time_seconds_conversion",children:"PACKET_TIME_SECONDS_CONVERSION"}),"\n",(0,r.jsx)(n.p,{children:(0,r.jsx)(n.strong,{children:"Converts the packet time to a floating point number of seconds since the epoch"})}),"\n",(0,r.jsxs)(n.p,{children:["This in an internal conversion which is automatically applied to the\n'PACKET_TIMESECONDS' derived telemetry item. It is typically not explicitly used.\nFor more information see the ",(0,r.jsx)(n.a,{href:"/docs/configuration/telemetry#received-time-and-packet-time",children:"Received Time and Packet Time"})," documentation."]}),"\n",(0,r.jsx)(n.p,{children:"Ruby Example:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-ruby",children:"READ_CONVERSION packet_time_seconds_conversion.rb\n"})}),"\n",(0,r.jsx)(n.p,{children:"Python Example:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-python",children:"READ_CONVERSION openc3/conversions/packet_time_seconds_conversion.py\n"})}),"\n",(0,r.jsx)(n.h2,{id:"polynomial_conversion",children:"POLYNOMIAL_CONVERSION"}),"\n",(0,r.jsx)(n.p,{children:(0,r.jsx)(n.strong,{children:"Adds a polynomial conversion factor to the current item. Can be used as both a read and write conversion."})}),"\n",(0,r.jsx)(n.p,{children:"For commands, the conversion factor is applied to raw value set by the user (via tool or script) before it is written into the binary command packet and sent. For telemetry, the conversion factor is applied to the raw value in the telemetry packet before it is displayed to the user. The user still has the ability to see the raw unconverted value in a details dialog."}),"\n",(0,r.jsxs)(n.table,{children:[(0,r.jsx)(n.thead,{children:(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.th,{children:"Parameter"}),(0,r.jsx)(n.th,{children:"Description"}),(0,r.jsx)(n.th,{children:"Required"})]})}),(0,r.jsxs)(n.tbody,{children:[(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"C0"}),(0,r.jsx)(n.td,{children:"Coefficient"}),(0,r.jsx)(n.td,{children:"True"})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"Cx"}),(0,r.jsx)(n.td,{children:"Additional coefficient values for the conversion. Any order polynomial conversion may be used so the value of 'x' will vary with the order of the polynomial. Note that larger order polynomials take longer to process than shorter order polynomials, but are sometimes more accurate."}),(0,r.jsx)(n.td,{children:"False"})]})]})]}),"\n",(0,r.jsx)(n.p,{children:"Ruby Example:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-ruby",children:"READ_CONVERSION polynomial_conversion.rb 10 0.5 0.25\n# Since this is a common conversion it has an alias:\nPOLY_READ_CONVERSION 10 0.5 0.25\n\nWRITE_CONVERSION polynomial_conversion.rb 10 0.5 0.25\n# Since this is a common conversion it has an alias:\nPOLY_WRITE_CONVERSION 10 0.5 0.25\n"})}),"\n",(0,r.jsx)(n.p,{children:"Python Example:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-python",children:"READ_CONVERSION openc3/conversions/polynomial_conversion.py 10 0.5 0.25\n# Since this is a common conversion it has an alias:\nPOLY_READ_CONVERSION 10 0.5 0.25\n\nWRITE_CONVERSION openc3/conversions/polynomial_conversion.py 10 0.5 0.25\n# Since this is a common conversion it has an alias:\nPOLY_WRITE_CONVERSION 10 0.5 0.25\n"})}),"\n",(0,r.jsx)(n.h2,{id:"processor_conversion",children:"PROCESSOR_CONVERSION"}),"\n",(0,r.jsx)(n.p,{children:(0,r.jsx)(n.strong,{children:"Read a value from a processor"})}),"\n",(0,r.jsx)(n.p,{children:"This command reads a value from a processor. The value is read from the\nprocessor's available values. The processor must be defined in the target's configuration."}),"\n",(0,r.jsxs)(n.table,{children:[(0,r.jsx)(n.thead,{children:(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.th,{children:"Parameter"}),(0,r.jsx)(n.th,{children:"Description"}),(0,r.jsx)(n.th,{children:"Required"})]})}),(0,r.jsxs)(n.tbody,{children:[(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"Processor Name"}),(0,r.jsx)(n.td,{children:"Name of the processor"}),(0,r.jsx)(n.td,{children:"True"})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"Processor Value"}),(0,r.jsx)(n.td,{children:"Published processor value"}),(0,r.jsx)(n.td,{children:"True"})]})]})]}),"\n",(0,r.jsx)(n.p,{children:"Ruby Example:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-ruby",children:'PROCESSOR TEMP1WATER watermark_processor.rb TEMP1\nITEM TEMP1HIGH 0 0 DERIVED "High-water mark for TEMP1"\n READ_CONVERSION processor_conversion.rb TEMP1WATER HIGH_WATER\n'})}),"\n",(0,r.jsx)(n.p,{children:"Python Example:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-python",children:'PROCESSOR TEMP1WATER watermark_processor.rb TEMP1\nITEM TEMP1HIGH 0 0 DERIVED "High-water mark for TEMP1"\n READ_CONVERSION openc3/conversions/processor_conversion.py TEMP1WATER HIGH_WATER\n'})}),"\n",(0,r.jsx)(n.h2,{id:"received_count_conversion",children:"RECEIVED_COUNT_CONVERSION"}),"\n",(0,r.jsx)(n.p,{children:(0,r.jsx)(n.strong,{children:"Converts the packet received count to a UINT 32 value"})}),"\n",(0,r.jsx)(n.p,{children:"This in an internal conversion which is automatically applied to the\n'RECEIVED_COUNT' derived telemetry item. It is typically not explicitly used."}),"\n",(0,r.jsx)(n.p,{children:"Ruby Example:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-ruby",children:"READ_CONVERSION received_count_conversion.rb\n"})}),"\n",(0,r.jsx)(n.p,{children:"Python Example:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-python",children:"READ_CONVERSION openc3/conversions/received_count_conversion.py\n"})}),"\n",(0,r.jsx)(n.h2,{id:"received_time_formatted_conversion",children:"RECEIVED_TIME_FORMATTED_CONVERSION"}),"\n",(0,r.jsx)(n.p,{children:(0,r.jsxs)(n.strong,{children:['Converts the packet received time to a formatted string like "YYYY/MM/DD HH:MM',":SS",'.US"']})}),"\n",(0,r.jsxs)(n.p,{children:["This in an internal conversion which is automatically applied to the\n'RECEIVED_TIMEFORMATTED' derived telemetry item. It is typically not explicitly used.\nFor more information see the ",(0,r.jsx)(n.a,{href:"/docs/configuration/telemetry#received-time-and-packet-time",children:"Received Time and Packet Time"})," documentation."]}),"\n",(0,r.jsx)(n.p,{children:"Ruby Example:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-ruby",children:"READ_CONVERSION received_time_formatted_conversion.rb\n"})}),"\n",(0,r.jsx)(n.p,{children:"Python Example:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-python",children:"READ_CONVERSION openc3/conversions/received_time_formatted_conversion.py\n"})}),"\n",(0,r.jsx)(n.h2,{id:"received_time_seconds_conversion",children:"RECEIVED_TIME_SECONDS_CONVERSION"}),"\n",(0,r.jsx)(n.p,{children:(0,r.jsx)(n.strong,{children:"Converts the packet received to a floating point number of seconds since the epoch"})}),"\n",(0,r.jsxs)(n.p,{children:["This in an internal conversion which is automatically applied to the\n'RECEIVED_TIMESECONDS' derived telemetry item. It is typically not explicitly used.\nFor more information see the ",(0,r.jsx)(n.a,{href:"/docs/configuration/telemetry#received-time-and-packet-time",children:"Received Time and Packet Time"})," documentation."]}),"\n",(0,r.jsx)(n.p,{children:"Ruby Example:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-ruby",children:"READ_CONVERSION received_time_formatted_conversion.rb\n"})}),"\n",(0,r.jsx)(n.p,{children:"Python Example:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-python",children:"READ_CONVERSION openc3/conversions/received_time_formatted_conversion.py\n"})}),"\n",(0,r.jsx)(n.h2,{id:"segmented_polynomial_conversion",children:"SEGMENTED_POLYNOMIAL_CONVERSION"}),"\n",(0,r.jsx)(n.p,{children:(0,r.jsx)(n.strong,{children:"Adds a segmented polynomial conversion factor to the current item. Can be used as both a read and write conversion."})}),"\n",(0,r.jsx)(n.p,{children:"For commands, this conversion factor is applied to the raw value set by the user (via tool or script) before it is written into the binary command packet and sent. For telemetry, the conversion factor is applied to the raw value in the telemetry packet before it is displayed to the user. The user still has the ability to see the raw unconverted value in a details dialog."}),"\n",(0,r.jsxs)(n.table,{children:[(0,r.jsx)(n.thead,{children:(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.th,{children:"Parameter"}),(0,r.jsx)(n.th,{children:"Description"}),(0,r.jsx)(n.th,{children:"Required"})]})}),(0,r.jsxs)(n.tbody,{children:[(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"Lower Bound"}),(0,r.jsx)(n.td,{children:"Defines the lower bound of the range of values that this segmented polynomial applies to. Is ignored for the segment with the smallest lower bound."}),(0,r.jsx)(n.td,{children:"True"})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"C0"}),(0,r.jsx)(n.td,{children:"Coefficient"}),(0,r.jsx)(n.td,{children:"True"})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"Cx"}),(0,r.jsx)(n.td,{children:"Additional coefficient values for the conversion. Any order polynomial conversion may be used so the value of 'x' will vary with the order of the polynomial. Note that larger order polynomials take longer to process than shorter order polynomials, but are sometimes more accurate."}),(0,r.jsx)(n.td,{children:"False"})]})]})]}),"\n",(0,r.jsx)(n.p,{children:"Ruby Example:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-ruby",children:"READ_CONVERSION segmented_polynomial_conversion.rb 0 10 0.5 0.25 # Apply the conversion to all values < 50\n# Since this is a common conversion it has an alias:\nSEG_POLY_READ_CONVERSION 10 0.5 0.25 0 10 0.5 0.25 # Apply the conversion to all values < 50\nSEG_POLY_READ_CONVERSION 50 11 0.5 0.275 # Apply the conversion to all values >= 50 and < 100\nSEG_POLY_READ_CONVERSION 100 12 0.5 0.3 # Apply the conversion to all values >= 100\n\nWRITE_CONVERSION segmented_polynomial_conversion.rb 0 10 0.5 0.25 # Apply the conversion to all values < 50\n# Since this is a common conversion it has an alias:\nSEG_POLY_WRITE_CONVERSION 10 0.5 0.25 0 10 0.5 0.25 # Apply the conversion to all values < 50\nSEG_POLY_WRITE_CONVERSION 50 11 0.5 0.275 # Apply the conversion to all values >= 50 and < 100\nSEG_POLY_WRITE_CONVERSION 100 12 0.5 0.3 # Apply the conversion to all values >= 100\n"})}),"\n",(0,r.jsx)(n.p,{children:"Python Example:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-python",children:"READ_CONVERSION openc3/conversions/segmented_polynomial_conversion.py 0 10 0.5 0.25 # Apply the conversion to all values < 50\n# Since this is a common conversion it has an alias:\nSEG_POLY_READ_CONVERSION 10 0.5 0.25 0 10 0.5 0.25 # Apply the conversion to all values < 50\nSEG_POLY_READ_CONVERSION 50 11 0.5 0.275 # Apply the conversion to all values >= 50 and < 100\nSEG_POLY_READ_CONVERSION 100 12 0.5 0.3 # Apply the conversion to all values >= 100\n\nWRITE_CONVERSION openc3/conversions/segmented_polynomial_conversion.py 0 10 0.5 0.25 # Apply the conversion to all values < 50\n# Since this is a common conversion it has an alias:\nSEG_POLY_WRITE_CONVERSION 10 0.5 0.25 0 10 0.5 0.25 # Apply the conversion to all values < 50\nSEG_POLY_WRITE_CONVERSION 50 11 0.5 0.275 # Apply the conversion to all values >= 50 and < 100\nSEG_POLY_WRITE_CONVERSION 100 12 0.5 0.3 # Apply the conversion to all values >= 100\n"})}),"\n",(0,r.jsx)(n.h2,{id:"unix_time_conversion",children:"UNIX_TIME_CONVERSION"}),"\n",(0,r.jsx)(n.p,{children:(0,r.jsx)(n.strong,{children:"Converts values to a native Ruby or Python time object"})}),"\n",(0,r.jsxs)(n.table,{children:[(0,r.jsx)(n.thead,{children:(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.th,{children:"Parameter"}),(0,r.jsx)(n.th,{children:"Description"}),(0,r.jsx)(n.th,{children:"Required"})]})}),(0,r.jsxs)(n.tbody,{children:[(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"Seconds Item Name"}),(0,r.jsx)(n.td,{children:"The name of the item which contains the seconds since the epoch."}),(0,r.jsx)(n.td,{children:"True"})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"Microseconds Item Name"}),(0,r.jsx)(n.td,{children:"The name of the item which contains the microseconds since the epoch."}),(0,r.jsx)(n.td,{children:"False"})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"Seconds Type"}),(0,r.jsxs)(n.td,{children:["How to read the seconds item. Defaults to 'RAW'.",(0,r.jsx)("br",{}),(0,r.jsx)("br",{}),"Valid Values: ",(0,r.jsx)("span",{class:"values",children:"RAW, CONVERTED"})]}),(0,r.jsx)(n.td,{children:"False"})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"Microseconds Type"}),(0,r.jsxs)(n.td,{children:["How to read the microseconds item. Defaults to 'RAW'.",(0,r.jsx)("br",{}),(0,r.jsx)("br",{}),"Valid Values: ",(0,r.jsx)("span",{class:"values",children:"RAW, CONVERTED"})]}),(0,r.jsx)(n.td,{children:"False"})]})]})]}),"\n",(0,r.jsx)(n.p,{children:"Ruby Example:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-ruby",children:"READ_CONVERSION unix_time_conversion.rb TIMESEC TIMEUS\n"})}),"\n",(0,r.jsx)(n.p,{children:"Python Example:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-python",children:"READ_CONVERSION openc3/conversions/unix_time_conversion.py TIMESEC TIMEUS\n"})}),"\n",(0,r.jsx)(n.h2,{id:"unix_time_formatted_conversion",children:"UNIX_TIME_FORMATTED_CONVERSION"}),"\n",(0,r.jsx)(n.p,{children:(0,r.jsxs)(n.strong,{children:['Converts values to a formatted time string like "YYYY/MM/DD HH:MM',":SS",'.US"']})}),"\n",(0,r.jsxs)(n.table,{children:[(0,r.jsx)(n.thead,{children:(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.th,{children:"Parameter"}),(0,r.jsx)(n.th,{children:"Description"}),(0,r.jsx)(n.th,{children:"Required"})]})}),(0,r.jsxs)(n.tbody,{children:[(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"Seconds Item Name"}),(0,r.jsx)(n.td,{children:"The name of the item which contains the seconds since the epoch."}),(0,r.jsx)(n.td,{children:"True"})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"Microseconds Item Name"}),(0,r.jsx)(n.td,{children:"The name of the item which contains the microseconds since the epoch."}),(0,r.jsx)(n.td,{children:"False"})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"Seconds Type"}),(0,r.jsxs)(n.td,{children:["How to read the seconds item. Defaults to 'RAW'.",(0,r.jsx)("br",{}),(0,r.jsx)("br",{}),"Valid Values: ",(0,r.jsx)("span",{class:"values",children:"RAW, CONVERTED"})]}),(0,r.jsx)(n.td,{children:"False"})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"Microseconds Type"}),(0,r.jsxs)(n.td,{children:["How to read the microseconds item. Defaults to 'RAW'.",(0,r.jsx)("br",{}),(0,r.jsx)("br",{}),"Valid Values: ",(0,r.jsx)("span",{class:"values",children:"RAW, CONVERTED"})]}),(0,r.jsx)(n.td,{children:"False"})]})]})]}),"\n",(0,r.jsx)(n.p,{children:"Ruby Example:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-ruby",children:"READ_CONVERSION unix_time_formatted_conversion.rb TIMESEC TIMEUS\n"})}),"\n",(0,r.jsx)(n.p,{children:"Python Example:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-python",children:"READ_CONVERSION openc3/conversions/unix_time_formatted_conversion.py TIMESEC TIMEUS\n"})}),"\n",(0,r.jsx)(n.h2,{id:"unix_time_seconds_conversion",children:"UNIX_TIME_SECONDS_CONVERSION"}),"\n",(0,r.jsx)(n.p,{children:(0,r.jsx)(n.strong,{children:"Converts values to a floating point number of seconds since the epoch"})}),"\n",(0,r.jsxs)(n.table,{children:[(0,r.jsx)(n.thead,{children:(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.th,{children:"Parameter"}),(0,r.jsx)(n.th,{children:"Description"}),(0,r.jsx)(n.th,{children:"Required"})]})}),(0,r.jsxs)(n.tbody,{children:[(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"Seconds Item Name"}),(0,r.jsx)(n.td,{children:"The name of the item which contains the seconds since the epoch."}),(0,r.jsx)(n.td,{children:"True"})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"Microseconds Item Name"}),(0,r.jsx)(n.td,{children:"The name of the item which contains the microseconds since the epoch."}),(0,r.jsx)(n.td,{children:"False"})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"Seconds Type"}),(0,r.jsxs)(n.td,{children:["How to read the seconds item. Defaults to 'RAW'.",(0,r.jsx)("br",{}),(0,r.jsx)("br",{}),"Valid Values: ",(0,r.jsx)("span",{class:"values",children:"RAW, CONVERTED"})]}),(0,r.jsx)(n.td,{children:"False"})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"Microseconds Type"}),(0,r.jsxs)(n.td,{children:["How to read the microseconds item. Defaults to 'RAW'.",(0,r.jsx)("br",{}),(0,r.jsx)("br",{}),"Valid Values: ",(0,r.jsx)("span",{class:"values",children:"RAW, CONVERTED"})]}),(0,r.jsx)(n.td,{children:"False"})]})]})]}),"\n",(0,r.jsx)(n.p,{children:"Ruby Example:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-ruby",children:"READ_CONVERSION unix_time_seconds_conversion.rb TIMESEC TIMEUS\n"})}),"\n",(0,r.jsx)(n.p,{children:"Python Example:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-python",children:"READ_CONVERSION openc3/conversions/unix_time_seconds_conversion.py TIMESEC TIMEUS\n"})})]})}function h(e={}){let{wrapper:n}={...(0,o.a)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(d,{...e})}):d(e)}},2840:function(e,n,s){s.d(n,{Z:()=>c,a:()=>t});var i=s(2784);let r={},o=i.createContext(r);function t(e){let n=i.useContext(o);return i.useMemo(function(){return"function"==typeof e?e(n):{...n,...e}},[n,e])}function c(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:t(e.components),i.createElement(o.Provider,{value:n},e.children)}}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkdocs_openc3_com=self.webpackChunkdocs_openc3_com||[]).push([["2358"],{2233:function(e,t,n){n.r(t),n.d(t,{frontMatter:()=>l,default:()=>h,contentTitle:()=>d,assets:()=>s,toc:()=>r,metadata:()=>i});var i=JSON.parse('{"id":"tools/table-manager","title":"Table Manager","description":"Binary file editor with upload / download","source":"@site/docs/tools/table-manager.md","sourceDirName":"tools","slug":"/tools/table-manager","permalink":"/tools/staticdocs/docs/tools/table-manager","draft":false,"unlisted":false,"editUrl":"https://github.com/OpenC3/cosmos/tree/main/docs.openc3.com/docs/tools/table-manager.md","tags":[],"version":"current","frontMatter":{"title":"Table Manager","description":"Binary file editor with upload / download","sidebar_custom_props":{"myEmoji":"\uD83D\uDEE0\uFE0F"}},"sidebar":"defaultSidebar","previous":{"title":"Script Runner","permalink":"/tools/staticdocs/docs/tools/script-runner"},"next":{"title":"Telemetry Grapher","permalink":"/tools/staticdocs/docs/tools/tlm-grapher"}}'),o=n(2322),a=n(2840);let l={title:"Table Manager",description:"Binary file editor with upload / download",sidebar_custom_props:{myEmoji:"\uD83D\uDEE0\uFE0F"}},d=void 0,s={},r=[{value:"Introduction",id:"introduction",level:2},{value:"File Menu Items",id:"file-menu-items",level:3},{value:"File Download",id:"file-download",level:2},{value:"Upload / Download",id:"upload--download",level:2},{value:"upload.rb",id:"uploadrb",level:3},{value:"download.rb",id:"downloadrb",level:3}];function c(e){let t={a:"a",code:"code",h2:"h2",h3:"h3",img:"img",li:"li",p:"p",pre:"pre",ul:"ul",...(0,a.a)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(t.h2,{id:"introduction",children:"Introduction"}),"\n",(0,o.jsxs)(t.p,{children:["Table Manager is a binary file editor. It takes binary file ",(0,o.jsx)(t.a,{href:"/tools/staticdocs/docs/configuration/table",children:"definitions"})," similar to the COSMOS command packet definitions and builds a GUI to edit the fields in the binary file."]}),"\n",(0,o.jsx)(t.p,{children:(0,o.jsx)(t.img,{alt:"Table Manager",src:n(5464).Z+"",width:"1272",height:"849"})}),"\n",(0,o.jsx)(t.h3,{id:"file-menu-items",children:"File Menu Items"}),"\n",(0,o.jsx)("img",{src:n(5360).Z,alt:"File Menu",style:{float:"left","margin-right":"50px",height:"150px"}}),"\n",(0,o.jsxs)(t.ul,{children:["\n",(0,o.jsxs)(t.li,{children:["Create a new binary based on ",(0,o.jsx)(t.a,{href:"/tools/staticdocs/docs/configuration/table",children:"definition"})]}),"\n",(0,o.jsx)(t.li,{children:"Open an existing binary"}),"\n",(0,o.jsx)(t.li,{children:"Save the current binary"}),"\n",(0,o.jsx)(t.li,{children:"Rename the current binary"}),"\n",(0,o.jsx)(t.li,{children:"Delete the current binary"}),"\n"]}),"\n",(0,o.jsx)(t.h2,{id:"file-download",children:"File Download"}),"\n",(0,o.jsxs)(t.p,{children:["The three buttons next to File Download download the binary file, the ",(0,o.jsx)(t.a,{href:"/tools/staticdocs/docs/configuration/table",children:"definition"})," file, and the report file. The binary is the raw bits defined by the table. The ",(0,o.jsx)(t.a,{href:"/tools/staticdocs/docs/configuration/table",children:"definition"})," is the structure definition of those raw bits. The report file is a Table Manager generated CSV that shows all the table values in the binary."]}),"\n",(0,o.jsx)(t.h2,{id:"upload--download",children:"Upload / Download"}),"\n",(0,o.jsxs)(t.p,{children:["Table Manager has the ability to directly call a COSMOS script to upload a binary file to a target or download a file into Table Manager. If a file called ",(0,o.jsx)(t.code,{children:"upload.rb"})," is found in the Target's procedures directory then the Upload button becomes active. If a file called ",(0,o.jsx)(t.code,{children:"download.rb"})," is found in the Target's procedures directory then the Download button becomes active. The B/G button indicates whether to run the upload / download scripts in the background. If you uncheck this box a new Script Runner window will show the line by line execution of the script."]}),"\n",(0,o.jsx)(t.h3,{id:"uploadrb",children:"upload.rb"}),"\n",(0,o.jsxs)(t.p,{children:["The COSMOS demo creates the following ",(0,o.jsx)(t.code,{children:"upload.rb"})," script. Note that the ",(0,o.jsx)(t.code,{children:"ENV['TBL_FILENAME']"})," is set to the name of the table file and the script uses ",(0,o.jsx)(t.code,{children:"get_target_file"})," to get access to the file. At this point the logic to upload the file to the target is specific to the commanding defined by the target but an example script is given."]}),"\n",(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{className:"language-ruby",children:'# TBL_FILENAME is set to the name of the table file\nputs "file:#{ENV[\'TBL_FILENAME\']}"\n# Open the file\nfile = get_target_file(ENV[\'TBL_FILENAME\'])\nbuffer = file.read\n# puts buffer.formatted\n# Implement custom commanding logic to upload the table\n# Note that buffer is a Ruby string of bytes\n# You probably want to do something like:\n# buf_size = 512 # Size of a buffer in the upload command\n# i = 0\n# while i < buffer.length\n# # Send a part of the buffer\n# # NOTE: triple dots means start index, up to but not including, end index\n# # while double dots means start index, up to AND including, end index\n# cmd("TGT", "UPLOAD", "DATA" => buffer[i...(i + buf_size)])\n# i += buf_size\n# end\nfile.delete\n'})}),"\n",(0,o.jsx)(t.h3,{id:"downloadrb",children:"download.rb"}),"\n",(0,o.jsxs)(t.p,{children:["The COSMOS demo creates the following ",(0,o.jsx)(t.code,{children:"download.rb"})," script. Note that the ",(0,o.jsx)(t.code,{children:"ENV['TBL_FILENAME']"})," is set to the name of the table file to OVERWRITE and the script uses ",(0,o.jsx)(t.code,{children:"put_target_file"})," to get access to the file. At this point the logic to download the file from the target is specific to the commanding defined by the target but an example script is given."]}),"\n",(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{className:"language-ruby",children:"# TBL_FILENAME is set to the name of the table file to overwrite\nputs \"file:#{ENV['TBL_FILENAME']}\"\n# Download the file\n# Implement custom commanding logic to download the table\n# You probably want to do something like:\nbuffer = ''\n# i = 1\n# num_segments = 5 # calculate based on TBL_FILENAME\n# table_id = 1 # calculate based on TBL_FILENAME\n# while i < num_segments\n# # Request a part of the table buffer\n# cmd(\"TGT DUMP with TABLE_ID #{table_id}, SEGMENT #{i}\")\n# buffer += tlm(\"TGT DUMP_PKT DATA\")\n# i += 1\n# end\nput_target_file(ENV['TBL_FILENAME'], buffer)\n"})})]})}function h(e={}){let{wrapper:t}={...(0,a.a)(),...e.components};return t?(0,o.jsx)(t,{...e,children:(0,o.jsx)(c,{...e})}):c(e)}},2840:function(e,t,n){n.d(t,{Z:()=>d,a:()=>l});var i=n(2784);let o={},a=i.createContext(o);function l(e){let t=i.useContext(a);return i.useMemo(function(){return"function"==typeof e?e(t):{...t,...e}},[t,e])}function d(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(o):e.components||o:l(e.components),i.createElement(a.Provider,{value:t},e.children)}},5360:function(e,t,n){n.d(t,{Z:()=>i});let i=n.p+"assets/images/file_menu-d672c1f8064e5f847a2464397c1e75ee423452f1ba4a7d0861319bc7c7891196.png"},5464:function(e,t,n){n.d(t,{Z:()=>i});let i=n.p+"assets/images/table_manager-816d7a683e6883cb8049e5ec8ffef3076b37a489edcc0e5331bc5d81ab506da2.png"}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkdocs_openc3_com=self.webpackChunkdocs_openc3_com||[]).push([["8197"],{1188:function(e,t,n){n.d(t,{Z:()=>s});let s=n.p+"assets/images/interface_read_logic-0deef27c1d2fec9de2a3720a3c9ecedb21a00dca7aabd13da0b8815c037e4c26.png"},2840:function(e,t,n){n.d(t,{Z:()=>o,a:()=>a});var s=n(2784);let r={},i=s.createContext(r);function a(e){let t=s.useContext(i);return s.useMemo(function(){return"function"==typeof e?e(t):{...t,...e}},[t,e])}function o(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:a(e.components),s.createElement(i.Provider,{value:t},e.children)}},3756:function(e,t,n){n.d(t,{Z:()=>s});let s=n.p+"assets/images/interface_write_logic-3360afe1b4af20b10dafba848a21e09baccaacc06e2ec8b6c132ac7a3c99e994.png"},4229:function(e,t,n){n.r(t),n.d(t,{frontMatter:()=>a,default:()=>h,contentTitle:()=>o,assets:()=>d,toc:()=>c,metadata:()=>s});var s=JSON.parse('{"id":"configuration/protocols","title":"Protocols","description":"Built-in COSMOS protocols including how to create one","source":"@site/docs/configuration/protocols.md","sourceDirName":"configuration","slug":"/configuration/protocols","permalink":"/tools/staticdocs/docs/configuration/protocols","draft":false,"unlisted":false,"editUrl":"https://github.com/OpenC3/cosmos/tree/main/docs.openc3.com/docs/configuration/protocols.md","tags":[],"version":"current","sidebarPosition":7,"frontMatter":{"sidebar_position":7,"title":"Protocols","description":"Built-in COSMOS protocols including how to create one","sidebar_custom_props":{"myEmoji":"\uD83D\uDCA1"}},"sidebar":"defaultSidebar","previous":{"title":"Interfaces","permalink":"/tools/staticdocs/docs/configuration/interfaces"},"next":{"title":"Accessors","permalink":"/tools/staticdocs/docs/configuration/accessors"}}'),r=n(2322),i=n(2840);let a={sidebar_position:7,title:"Protocols",description:"Built-in COSMOS protocols including how to create one",sidebar_custom_props:{myEmoji:"\uD83D\uDCA1"}},o=void 0,d={},c=[{value:"Packet Delineation Protocols",id:"packet-delineation-protocols",level:2},{value:"COBS Protocol",id:"cobs-protocol",level:3},{value:"SLIP Protocol",id:"slip-protocol",level:3},{value:"Burst Protocol",id:"burst-protocol",level:3},{value:"Fixed Protocol",id:"fixed-protocol",level:3},{value:"Length Protocol",id:"length-protocol",level:3},{value:"Terminated Protocol",id:"terminated-protocol",level:3},{value:"GEMS Protocol (Enterprise)",id:"gems-protocol-enterprise",level:3},{value:"CCSDS CLTU Protocol (Enterprise)",id:"ccsds-cltu-protocol-enterprise",level:3},{value:"CCSDS TCTF Protocol (Enterprise)",id:"ccsds-tctf-protocol-enterprise",level:3},{value:"CCSDS TMTF Protocol (Enterprise)",id:"ccsds-tmtf-protocol-enterprise",level:3},{value:"Template Protocol (Deprecated)",id:"template-protocol-deprecated",level:3},{value:"Preidentified Protocol",id:"preidentified-protocol",level:3},{value:"Helper Protocols",id:"helper-protocols",level:2},{value:"CmdResponse Protocol",id:"cmdresponse-protocol",level:3},{value:"Packet Definitions",id:"packet-definitions",level:4},{value:"CRC Protocol",id:"crc-protocol",level:3},{value:"Ignore Packet Protocol",id:"ignore-packet-protocol",level:3},{value:"Custom Protocols",id:"custom-protocols",level:2},{value:"Method discussions",id:"method-discussions",level:2},{value:"initialize or <strong>init</strong>",id:"initialize-or-init",level:3},{value:"reset",id:"reset",level:3},{value:"connect_reset",id:"connect_reset",level:3},{value:"disconnect_reset",id:"disconnect_reset",level:3},{value:"read_data",id:"read_data",level:3},{value:"read_packet",id:"read_packet",level:3},{value:"write_packet",id:"write_packet",level:3},{value:"write_data",id:"write_data",level:3},{value:"post_write_interface",id:"post_write_interface",level:3},{value:"protocol_cmd",id:"protocol_cmd",level:3},{value:"Examples",id:"examples",level:2}];function l(e){let t={a:"a",admonition:"admonition",code:"code",em:"em",h2:"h2",h3:"h3",h4:"h4",img:"img",p:"p",pre:"pre",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",...(0,i.a)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(t.p,{children:["Protocols process data on behalf of an ",(0,r.jsx)(t.a,{href:"interfaces",children:"Interface"}),". They can modify the data being written, data being read, or both. Protocols can also mark a packet as stored instead of real-time which means COSMOS will not update the current value table with the packet data. Protocols can be layered and will be processed in order. For example, if you have a low-level encryption layer that must be first removed before processing a higher level buffer length protocol."]}),"\n",(0,r.jsx)(t.admonition,{title:"Protocol Run Order",type:"info",children:(0,r.jsx)(t.p,{children:"Read protocols execute in the order specified (First specified runs first). Write protocols execute in the reverse order (Last specified executes first)."})}),"\n",(0,r.jsx)(t.p,{children:"Protocols are typically used to define the logic to delineate packets and manipulate data as it written to and read from Interfaces. COSMOS includes Interfaces for TCP/IP Client, TCP/IP Server, Udp Client / Server, and Serial connections. For 99% of use cases these Interfaces should not require any changes as they universally handle the low-level details of reading and writing from these types of connections. All unique behavior should now be defined in Protocols."}),"\n",(0,r.jsx)(t.p,{children:"At a minimum, any byte stream based Interface will require a Protocol to delineate packets. TCP/IP and Serial are examples of byte stream based Interfaces. A byte stream is just a simple stream of bytes and thus you need some way to know where packets begin and end within the stream."}),"\n",(0,r.jsx)(t.p,{children:"TCP/IP is a friendly byte stream. Unless you are dealing with a very poorly written system, the first byte received on a TCP/IP connection will always be the start of a packet. Also, TCP/IP is a reliable connection in that it ensures that all data is received in the correct order, that no data is lost, and that the data is not corrupted (TCP/IP is protected by a CRC32 which is pretty good for avoiding unrecognized data corruption)."}),"\n",(0,r.jsx)(t.p,{children:"Serial is a much less friendly byte stream. With serial connections, it is very likely that when you open a serial port and start receiving data you will receive the middle of a message. (This problem is only avoided when interfacing with a system that only writes to the serial port in response to a command). For this reason, sync patterns are highly beneficial for serial interfaces. Additionally, serial interfaces may use some method to protect against unrecognized data corruption (Checksums, CRCs, etc.)"}),"\n",(0,r.jsx)(t.p,{children:"UDP is an inherently packet based connection. If you read from a UDP socket, you will always receive back an entire packet. The best UDP based Protocols take advantage of this fact. Some implementations try to make UDP act like a byte stream, but this is a misuse of the protocol because it is highly likely that you will lose data and have no way to recover."}),"\n",(0,r.jsxs)(t.p,{children:["For more information about how Protocols fit with Interfaces and Accessors see ",(0,r.jsx)(t.a,{href:"https://www.openc3.com/news/interoperability-without-standards",children:"Interoperability Without Standards"}),"."]}),"\n",(0,r.jsx)(t.h2,{id:"packet-delineation-protocols",children:"Packet Delineation Protocols"}),"\n",(0,r.jsx)(t.p,{children:"COSMOS provides the following packet delineation protocols: COBS, SLIP, Burst, Fixed, Length, Template (deprecated), Terminated and Preidentified. Each of these protocols has the primary purpose of separating out packets from a byte stream."}),"\n",(0,r.jsx)(t.p,{children:"COSMOS Enterprise provides the following packet delineation protocols: CCSDS CLTU (with BCH Encoding), CCSDS TCTF (with Randomizer), CCSDS TMTF (with Randomizer), and GEMS."}),"\n",(0,r.jsxs)(t.p,{children:['Note that all protocols take a final parameter called "Allow Empty Data". This indicates whether the protocol will allow an empty string to be passed down to later Protocols (instead of returning ',":STOP","). Can be true, false, or nil, where nil is interpreted as true unless the Protocol is the last Protocol of the chain. End users of a protocol will almost always simply leave off this parameter. For more information read the ",(0,r.jsx)(t.a,{href:"/tools/staticdocs/docs/configuration/protocols#custom-protocols",children:"Custom Protocols"})," documentation."]}),"\n",(0,r.jsx)(t.p,{children:"Note the first parameter after the PROTOCOL keyword is how to apply the protocol: READ, WRITE, or READ_WRITE. Read applies the protocol on incoming packets (telemetry) and write on outgoing packets (commands). The next parameter is the protocol filename or class name. All other parameters are protocol specific."}),"\n",(0,r.jsx)(t.h3,{id:"cobs-protocol",children:"COBS Protocol"}),"\n",(0,r.jsxs)(t.p,{children:["The Consistent Overhead Byte Stuffing (COBS) Protocol is an algorithm for encoding data bytes that results in efficient, reliable, unambiguous packet framing regardless of packet content, thus making it easy for receiving applications to recover from malformed packets. It employs the zero byte value to serve as a packet delimiter (a special value that indicates the boundary between packets). The algorithm replaces each zero data byte with a non-zero value so that no zero data bytes will appear in the packet and thus be misinterpreted as packet boundaries (See ",(0,r.jsx)(t.a,{href:"https://en.wikipedia.org/wiki/Consistent_Overhead_Byte_Stuffing",children:"https://en.wikipedia.org/wiki/Consistent_Overhead_Byte_Stuffing"})," for more)."]}),"\n",(0,r.jsx)(t.h3,{id:"slip-protocol",children:"SLIP Protocol"}),"\n",(0,r.jsxs)(t.p,{children:["The Serial Line IP (SLIP) Protocol defines a sequence of characters that frame IP packets on a serial line. It defines two special characters: END and ESC. END is 0xC0 and ESC is 0xDB. To send a packet, a SLIP host simply starts sending the data in the packet. If a data byte is the same code as END character, a two byte sequence of ESC and 0xDC is sent instead. If a data bytes is the same as an ESC character, an two byte sequence of ESC and 0xDD is sent instead. When the last byte in the packet has been sent, an END character is then transmitted (See ",(0,r.jsx)(t.a,{href:"https://datatracker.ietf.org/doc/html/rfc1055",children:"https://datatracker.ietf.org/doc/html/rfc1055"})," for more)."]}),"\n",(0,r.jsxs)(t.table,{children:[(0,r.jsx)(t.thead,{children:(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.th,{children:"Parameter"}),(0,r.jsx)(t.th,{children:"Description"}),(0,r.jsx)(t.th,{children:"Required"}),(0,r.jsx)(t.th,{children:"Default"})]})}),(0,r.jsxs)(t.tbody,{children:[(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Start Char"}),(0,r.jsx)(t.td,{children:"Character to place at the start of frames"}),(0,r.jsx)(t.td,{children:"No"}),(0,r.jsx)(t.td,{children:"nil (no character)"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Read Strip Characters"}),(0,r.jsx)(t.td,{children:"Strip off start_char and end_char from reads"}),(0,r.jsx)(t.td,{children:"No"}),(0,r.jsx)(t.td,{children:"true"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Read Enable Escaping"}),(0,r.jsx)(t.td,{children:"Whether to enable character escaping on reads"}),(0,r.jsx)(t.td,{children:"No"}),(0,r.jsx)(t.td,{children:"true"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Write Enable Escaping"}),(0,r.jsx)(t.td,{children:"Whether to enable character escaping on writes"}),(0,r.jsx)(t.td,{children:"No"}),(0,r.jsx)(t.td,{children:"true"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"End Char"}),(0,r.jsx)(t.td,{children:"Character to place at the end of frames"}),(0,r.jsx)(t.td,{children:"No"}),(0,r.jsx)(t.td,{children:"0xC0"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Esc Char"}),(0,r.jsx)(t.td,{children:"Escape character"}),(0,r.jsx)(t.td,{children:"No"}),(0,r.jsx)(t.td,{children:"0xDB"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Escape End Char"}),(0,r.jsx)(t.td,{children:"Character to escape End character"}),(0,r.jsx)(t.td,{children:"No"}),(0,r.jsx)(t.td,{children:"0xDC"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Escape Esc Char"}),(0,r.jsx)(t.td,{children:"Character to escape Esc character"}),(0,r.jsx)(t.td,{children:"No"}),(0,r.jsx)(t.td,{children:"0xDD"})]})]})]}),"\n",(0,r.jsx)(t.h3,{id:"burst-protocol",children:"Burst Protocol"}),"\n",(0,r.jsx)(t.p,{children:"The Burst Protocol simply reads as much data as it can from the interface before returning the data as a COSMOS Packet (It returns a packet for each burst of data read). This Protocol relies on regular bursts of data delimited by time and thus is not very robust. However, it can utilize a sync pattern which does allow it to re-sync if necessary. It can also discard bytes from the incoming data to remove the sync pattern. Finally, it can add sync patterns to data being written out of the Interface."}),"\n",(0,r.jsxs)(t.table,{children:[(0,r.jsx)(t.thead,{children:(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.th,{children:"Parameter"}),(0,r.jsx)(t.th,{children:"Description"}),(0,r.jsx)(t.th,{children:"Required"}),(0,r.jsx)(t.th,{children:"Default"})]})}),(0,r.jsxs)(t.tbody,{children:[(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Discard Leading Bytes"}),(0,r.jsx)(t.td,{children:"The number of bytes to discard from the binary data after reading. Note that this applies to bytes starting with the sync pattern if the sync pattern is being used."}),(0,r.jsx)(t.td,{children:"No"}),(0,r.jsx)(t.td,{children:"0 (do not discard bytes)"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Sync Pattern"}),(0,r.jsx)(t.td,{children:"Hex string representing a byte pattern that will be searched for in the raw data. This pattern represents a packet delimiter and all data found including the sync pattern will be returned"}),(0,r.jsx)(t.td,{children:"No"}),(0,r.jsx)(t.td,{children:"nil (no sync pattern)"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Fill Fields"}),(0,r.jsx)(t.td,{children:"Whether to fill in the sync pattern on outgoing packets"}),(0,r.jsx)(t.td,{children:"No"}),(0,r.jsx)(t.td,{children:"false"})]})]})]}),"\n",(0,r.jsx)(t.h3,{id:"fixed-protocol",children:"Fixed Protocol"}),"\n",(0,r.jsx)(t.p,{children:"The Fixed Protocol reads a preset minimum amount of data which is necessary to properly identify all the defined packets using the interface. It then identifies the packet and proceeds to read as much data from the interface as necessary to create the packet which it then returns. This protocol relies on all the packets on the interface being fixed in length. For example, all the packets using the interface are a fixed size and contain a simple header with a 32-bit sync pattern followed by a 16 bit ID. The Fixed Protocol would elegantly handle this case with a minimum read size of 6 bytes. The Fixed Protocol also supports a sync pattern, discarding leading bytes, and filling the sync pattern similar to the Burst Protocol."}),"\n",(0,r.jsxs)(t.table,{children:[(0,r.jsx)(t.thead,{children:(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.th,{children:"Parameter"}),(0,r.jsx)(t.th,{children:"Description"}),(0,r.jsx)(t.th,{children:"Required"}),(0,r.jsx)(t.th,{children:"Default"})]})}),(0,r.jsxs)(t.tbody,{children:[(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Minimum ID Size"}),(0,r.jsx)(t.td,{children:"The minimum number of bytes needed to identify a packet. All the packet definitions must declare their ID_ITEM(s) within this given number of bytes."}),(0,r.jsx)(t.td,{children:"Yes"}),(0,r.jsx)(t.td,{})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Discard Leading Bytes"}),(0,r.jsx)(t.td,{children:"The number of bytes to discard from the binary data after reading. Note that this applies to bytes starting with the sync pattern if the sync pattern is being used."}),(0,r.jsx)(t.td,{children:"No"}),(0,r.jsx)(t.td,{children:"0 (do not discard bytes)"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Sync Pattern"}),(0,r.jsx)(t.td,{children:"Hex string representing a byte pattern that will be searched for in the raw data. This pattern represents a packet delimiter and all data found including the sync pattern will be returned."}),(0,r.jsx)(t.td,{children:"No"}),(0,r.jsx)(t.td,{children:"nil (no sync pattern)"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Telemetry"}),(0,r.jsx)(t.td,{children:"Whether the data is telemetry"}),(0,r.jsx)(t.td,{children:"No"}),(0,r.jsx)(t.td,{children:"true (false means command)"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Fill Fields"}),(0,r.jsx)(t.td,{children:"Whether to fill in the sync pattern on outgoing packets"}),(0,r.jsx)(t.td,{children:"No"}),(0,r.jsx)(t.td,{children:"false"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Unknown Raise"}),(0,r.jsx)(t.td,{children:"Whether to raise an exception for an unknown packet"}),(0,r.jsx)(t.td,{children:"No"}),(0,r.jsx)(t.td,{children:"false"})]})]})]}),"\n",(0,r.jsx)(t.h3,{id:"length-protocol",children:"Length Protocol"}),"\n",(0,r.jsx)(t.p,{children:"The Length Protocol depends on a length field at a fixed location in the defined packets using the interface. It then reads enough data to grab the length field, decodes it, and reads the remaining length of the packet. For example, all the packets using the interface contain a CCSDS header with a length field. The Length Protocol can be set up to handle the length field and even the length offset CCSDS uses. The Length Protocol also supports a sync pattern, discarding leading bytes, and filling the length and sync pattern similar to the Burst Protocol."}),"\n",(0,r.jsxs)(t.table,{children:[(0,r.jsx)(t.thead,{children:(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.th,{children:"Parameter"}),(0,r.jsx)(t.th,{children:"Description"}),(0,r.jsx)(t.th,{children:"Required"}),(0,r.jsx)(t.th,{children:"Default"})]})}),(0,r.jsxs)(t.tbody,{children:[(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Length Bit Offset"}),(0,r.jsx)(t.td,{children:"The bit offset from the start of the packet to the length field. Every packet using this interface must have the same structure such that the length field is the same size at the same location. Be sure to account for the length of the Sync Pattern in this value (if present)."}),(0,r.jsx)(t.td,{children:"No"}),(0,r.jsx)(t.td,{children:"0 bits"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Length Bit Size"}),(0,r.jsx)(t.td,{children:"The size in bits of the length field"}),(0,r.jsx)(t.td,{children:"No"}),(0,r.jsx)(t.td,{children:"16 bits"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Length Value Offset"}),(0,r.jsx)(t.td,{children:"The offset to apply to the length field value. The actual value of the length field plus this offset should equal the exact number of bytes required to read all data for the packet (including the length field itself, sync pattern, etc). For example, if the length field indicates packet length minus one, this value should be one. Be sure to account for the length of the Sync Pattern in this value (if present)."}),(0,r.jsx)(t.td,{children:"No"}),(0,r.jsx)(t.td,{children:"0"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Bytes per Count"}),(0,r.jsx)(t.td,{children:"The number of bytes per each length field 'count'. This is used if the units of the length field is something other than bytes, e.g. if the length field count is in words."}),(0,r.jsx)(t.td,{children:"No"}),(0,r.jsx)(t.td,{children:"1 byte"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Length Endianness"}),(0,r.jsx)(t.td,{children:"The endianness of the length field. Must be either 'BIG_ENDIAN' or 'LITTLE_ENDIAN'."}),(0,r.jsx)(t.td,{children:"No"}),(0,r.jsx)(t.td,{children:"'BIG_ENDIAN'"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Discard Leading Bytes"}),(0,r.jsx)(t.td,{children:"The number of bytes to discard from the binary data after reading. Note that this applies to bytes including the sync pattern if the sync pattern is being used. Discarding is one of the very last steps so any size and offsets above need to account for all the data before discarding."}),(0,r.jsx)(t.td,{children:"No"}),(0,r.jsx)(t.td,{children:"0 (do not discard bytes)"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Sync Pattern"}),(0,r.jsx)(t.td,{children:"Hex string representing a byte pattern that will be searched for in the raw data. This pattern represents a packet delimiter and all data found including the sync pattern will be returned."}),(0,r.jsx)(t.td,{children:"No"}),(0,r.jsx)(t.td,{children:"nil (no sync pattern)"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Max Length"}),(0,r.jsx)(t.td,{children:"The maximum allowed value in the length field"}),(0,r.jsx)(t.td,{children:"No"}),(0,r.jsx)(t.td,{children:"nil (no maximum length)"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Fill Length and Sync Pattern"}),(0,r.jsx)(t.td,{children:"Setting this flag to true causes the length field and sync pattern (if present) to be filled automatically on outgoing packets."}),(0,r.jsx)(t.td,{children:"No"}),(0,r.jsx)(t.td,{children:"false"})]})]})]}),"\n",(0,r.jsx)(t.p,{children:"The most confusing aspect of the Length Protocol is calculating the Length Value Offset. This is especially true in the commonly used CCSDS Space Packet Protocol. The best way to illustrate this is with an example. Suppose you have CCSDS Space Packets prepended with a Sync Pattern of 0x1ACFFC1D. This would look like the following:"}),"\n",(0,r.jsxs)(t.table,{children:[(0,r.jsx)(t.thead,{children:(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.th,{children:"Sync (4 bytes)"}),(0,r.jsx)(t.th,{children:"Header (4 bytes)"}),(0,r.jsx)(t.th,{children:"Length (2 bytes)"}),(0,r.jsx)(t.th,{children:"Data (4 bytes)"})]})}),(0,r.jsx)(t.tbody,{children:(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"0x1ACFFC1D"}),(0,r.jsx)(t.td,{children:"0x0001CADB"}),(0,r.jsx)(t.td,{children:"0x0003"}),(0,r.jsx)(t.td,{children:"0xDEADBEEF"})]})})]}),"\n",(0,r.jsxs)(t.p,{children:["In this case the total length of the packet is 14 bytes: ",(0,r.jsx)(t.strong,{children:"4 + 4 + 2 + 4 = 14"}),". With 4 bytes of data, the length field is 3 because in CCSDS the length field is calculated as (data length - 1). So how would we calculate the Length Value Offset? COSMOS reads all the bytes in the packet (including the Sync Pattern) so the total length is 14 bytes. The length field is 3 so the Length Value Offset (offset to apply to the length field value) should be 11 (",(0,r.jsx)(t.strong,{children:"3 + 11 = 14"}),")."]}),"\n",(0,r.jsx)(t.h3,{id:"terminated-protocol",children:"Terminated Protocol"}),"\n",(0,r.jsx)(t.p,{children:"The Terminated Protocol delineates packets using termination characters found at the end of every packet. It continuously reads data until the termination characters are found at which point it returns the packet data. For example, all the packets using the interface are followed by 0xABCD. This data can either be a part of each packet that is kept or something which is known only by the Terminated Protocol and simply thrown away."}),"\n",(0,r.jsxs)(t.table,{children:[(0,r.jsx)(t.thead,{children:(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.th,{children:"Parameter"}),(0,r.jsx)(t.th,{children:"Description"}),(0,r.jsx)(t.th,{children:"Required"}),(0,r.jsx)(t.th,{children:"Default"})]})}),(0,r.jsxs)(t.tbody,{children:[(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Write Termination Characters"}),(0,r.jsx)(t.td,{children:"The data to write after writing a command packet. Given as a hex string such as 0xABCD."}),(0,r.jsx)(t.td,{children:"Yes"}),(0,r.jsx)(t.td,{})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Read Termination Characters"}),(0,r.jsx)(t.td,{children:"The characters which delineate the end of a telemetry packet. Given as a hex string such as 0xABCD."}),(0,r.jsx)(t.td,{children:"Yes"}),(0,r.jsx)(t.td,{})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Strip Read Termination"}),(0,r.jsx)(t.td,{children:"Whether to remove the read termination characters before returning the telemetry packet"}),(0,r.jsx)(t.td,{children:"No"}),(0,r.jsx)(t.td,{children:"true"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Discard Leading Bytes"}),(0,r.jsx)(t.td,{children:"The number of bytes to discard from the binary data after reading. Note that this applies to bytes including the sync pattern if the sync pattern is being used."}),(0,r.jsx)(t.td,{children:"No"}),(0,r.jsx)(t.td,{children:"0 (do not discard bytes)"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Sync Pattern"}),(0,r.jsx)(t.td,{children:"Hex string representing a byte pattern that will be searched for in the raw data. This pattern represents a packet delimiter and all data found including the sync pattern will be returned."}),(0,r.jsx)(t.td,{children:"No"}),(0,r.jsx)(t.td,{children:"nil (no sync pattern)"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Fill Fields"}),(0,r.jsx)(t.td,{children:"Whether to fill in the sync pattern on outgoing packets"}),(0,r.jsx)(t.td,{children:"No"}),(0,r.jsx)(t.td,{children:"false"})]})]})]}),"\n",(0,r.jsx)(t.h3,{id:"gems-protocol-enterprise",children:"GEMS Protocol (Enterprise)"}),"\n",(0,r.jsx)(t.p,{children:"The GEMS Protocol implements the Ground Equipment Monitoring Service protocol. It is added along with the TerminatedProtocol which delineates packets using '|END'. The GEMS Interface is currently only implemented in Ruby."}),"\n",(0,r.jsx)(t.p,{children:"The GEMS protocol doesn't take any parameters but should be added to an interface after the TerminatedProtocol and CmdResponseProtocol."}),"\n",(0,r.jsx)(t.p,{children:"plugin.txt Ruby Example:"}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-ruby",children:"INTERFACE GEMS_INT tcpip_client_interface.rb openc3-operator 8080 8080 10.0 nil nil\n # TerminatedProtocol 0x7C454E44 0x7C454E44 false 0 0x7C47454D53 false ... means:\n # wtc rtc strip discard sync fill\n # where wtc = write termination characters, end of the gems protocol: 0x7C454E44 == '|END'\n # rtc = read termination characters, end of the gems protocol: 0x7C454E44 == '|END'\n # strip = strip read termination (false)\n # discard = 0 bytes\n # sync pattern = beginning of the GEMS protocol: 0x7C47454D53 == '|GEMS'\n # fill = whether to fill in the sync pattern (false as we specify fill in our cmd/tlm definitions)\n PROTOCOL READ TerminatedProtocol 0x7C454E44 0x7C454E44 false 0 0x7C47454D53 false\n # CmdResponseProtocol 5.0 0.2 true means:\n # 5 sec response timeout, 0.2 sec response polling,\n # and true to raise exceptions when protocol errors occur\n PROTOCOL READ_WRITE CmdResponseProtocol 5.0 0.2 true\n PROTOCOL READ_WRITE GemsProtocol\n"})}),"\n",(0,r.jsxs)(t.p,{children:["For a full example, please see the ",(0,r.jsx)(t.a,{href:"https://github.com/OpenC3/cosmos-enterprise-plugins/tree/main/openc3-cosmos-gems-interface",children:"openc3-cosmos-gems-interface"})," in the COSMOS Enterprise Plugins."]}),"\n",(0,r.jsx)(t.h3,{id:"ccsds-cltu-protocol-enterprise",children:"CCSDS CLTU Protocol (Enterprise)"}),"\n",(0,r.jsx)(t.p,{children:"The CCSDS CLTU Protocol handles the CLTU (Communicates Link Transfer Unit) for Command Streams. It encodes outgoing messages with a BCH encoding and then applies a header and footer to the data."}),"\n",(0,r.jsxs)(t.table,{children:[(0,r.jsx)(t.thead,{children:(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.th,{children:"Parameter"}),(0,r.jsx)(t.th,{children:"Description"}),(0,r.jsx)(t.th,{children:"Required"}),(0,r.jsx)(t.th,{children:"Default"})]})}),(0,r.jsxs)(t.tbody,{children:[(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Header"}),(0,r.jsx)(t.td,{children:"Header before BCH encoded data"}),(0,r.jsx)(t.td,{children:"No"}),(0,r.jsx)(t.td,{children:"0xEB90"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Footer"}),(0,r.jsx)(t.td,{children:"Footer after BCH encoded data"}),(0,r.jsx)(t.td,{children:"No"}),(0,r.jsx)(t.td,{children:"0xC5C5C5C5C5C5C579"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Fill Byte"}),(0,r.jsx)(t.td,{children:"BCH encoding fill byte"}),(0,r.jsx)(t.td,{children:"No"}),(0,r.jsx)(t.td,{children:"0x55"})]})]})]}),"\n",(0,r.jsxs)(t.p,{children:["For a full example, please see the ",(0,r.jsx)(t.a,{href:"https://github.com/OpenC3/cosmos-enterprise-plugins/tree/main/openc3-cosmos-ccsds-protocols",children:"openc3-cosmos-ccsds-protocols"})," in the COSMOS Enterprise Plugins."]}),"\n",(0,r.jsx)(t.h3,{id:"ccsds-tctf-protocol-enterprise",children:"CCSDS TCTF Protocol (Enterprise)"}),"\n",(0,r.jsx)(t.p,{children:"The CCSDS TCTF Protocol handles the Telecommand Transfer Frame for Command Streams."}),"\n",(0,r.jsxs)(t.table,{children:[(0,r.jsx)(t.thead,{children:(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.th,{children:"Parameter"}),(0,r.jsx)(t.th,{children:"Description"}),(0,r.jsx)(t.th,{children:"Required"}),(0,r.jsx)(t.th,{children:"Default"})]})}),(0,r.jsxs)(t.tbody,{children:[(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Randomization"}),(0,r.jsx)(t.td,{children:"Whether to encode and randomize the transfer frame"}),(0,r.jsx)(t.td,{children:"No"}),(0,r.jsx)(t.td,{children:"true"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Error Control"}),(0,r.jsx)(t.td,{children:"Whether to use the Frame Error Control Field and apply a 16 bit CRC"}),(0,r.jsx)(t.td,{children:"No"}),(0,r.jsx)(t.td,{children:"false"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Bypass"}),(0,r.jsx)(t.td,{children:"Bypass bit where 0 is Type-A and 1 is Type-B (bypass frame acceptance checks)"}),(0,r.jsx)(t.td,{children:"No"}),(0,r.jsx)(t.td,{children:"1"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"SCID"}),(0,r.jsx)(t.td,{children:"Spacecraft Identifier (10 bits)"}),(0,r.jsx)(t.td,{children:"No"}),(0,r.jsx)(t.td,{children:"0"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"VCID"}),(0,r.jsx)(t.td,{children:"Virtual Channel Identifier (6 bits)"}),(0,r.jsx)(t.td,{children:"No"}),(0,r.jsx)(t.td,{children:"0"})]})]})]}),"\n",(0,r.jsxs)(t.p,{children:["For a full example, please see the ",(0,r.jsx)(t.a,{href:"https://github.com/OpenC3/cosmos-enterprise-plugins/tree/main/openc3-cosmos-ccsds-protocols",children:"openc3-cosmos-ccsds-protocols"})," in the COSMOS Enterprise Plugins."]}),"\n",(0,r.jsx)(t.h3,{id:"ccsds-tmtf-protocol-enterprise",children:"CCSDS TMTF Protocol (Enterprise)"}),"\n",(0,r.jsx)(t.p,{children:"The CCSDS TMTF Protocol handles the Telemetry Transfer Frame for Telemetry Streams. It adds VCID, MC_FRM_CNT, VC_FRM_CNT to extra which will be included in the Decom data."}),"\n",(0,r.jsxs)(t.table,{children:[(0,r.jsx)(t.thead,{children:(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.th,{children:"Parameter"}),(0,r.jsx)(t.th,{children:"Description"}),(0,r.jsx)(t.th,{children:"Required"}),(0,r.jsx)(t.th,{children:"Default"})]})}),(0,r.jsxs)(t.tbody,{children:[(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"SCID"}),(0,r.jsx)(t.td,{children:"Spacecraft Identifier (10 bits)"}),(0,r.jsx)(t.td,{children:"Yes"}),(0,r.jsx)(t.td,{})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Frame Length"}),(0,r.jsx)(t.td,{}),(0,r.jsx)(t.td,{children:"No"}),(0,r.jsx)(t.td,{children:"2048"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Randomization"}),(0,r.jsx)(t.td,{children:"Whether the transfer frame was encoded and randomized"}),(0,r.jsx)(t.td,{children:"No"}),(0,r.jsx)(t.td,{children:"true"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Discard Leading Bytes"}),(0,r.jsx)(t.td,{children:"The number of bytes to discard from the binary data after reading. Note that this applies to bytes including the sync pattern if the sync pattern is being used."}),(0,r.jsx)(t.td,{children:"No"}),(0,r.jsx)(t.td,{children:"0 (do not discard bytes)"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Sync Pattern"}),(0,r.jsx)(t.td,{children:"Hex string representing a byte pattern that will be searched for in the raw data. This pattern represents a packet delimiter and all data found including the sync pattern will be returned."}),(0,r.jsx)(t.td,{children:"No"}),(0,r.jsx)(t.td,{children:"0x1ACFFC1D"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Fill Fields"}),(0,r.jsx)(t.td,{children:"Whether to fill in the sync pattern on outgoing packets"}),(0,r.jsx)(t.td,{children:"No"}),(0,r.jsx)(t.td,{children:"true"})]})]})]}),"\n",(0,r.jsxs)(t.p,{children:["For a full example, please see the ",(0,r.jsx)(t.a,{href:"https://github.com/OpenC3/cosmos-enterprise-plugins/tree/main/openc3-cosmos-ccsds-protocols",children:"openc3-cosmos-ccsds-protocols"})," in the COSMOS Enterprise Plugins."]}),"\n",(0,r.jsx)(t.h3,{id:"template-protocol-deprecated",children:"Template Protocol (Deprecated)"}),"\n",(0,r.jsx)(t.p,{children:"This protocol is now deprecated because it is not able to capture the original SCPI messages in COSMOS raw logging. Please use the TemplateAccessor with the CmdResponseProtocol instead."}),"\n",(0,r.jsxs)(t.p,{children:["The Template Protocol works much like the Terminated Protocol except it is designed for text-based command and response type interfaces such as SCPI (Standard Commands for Programmable Instruments). It delineates packets in the same way as the Terminated Protocol except each packet is referred to as a line (because each usually contains a line of text). For outgoing packets, a CMD_TEMPLATE field is expected to exist in the packet. This field contains a template string with items to be filled in delineated within HTML tag style brackets ",(0,r.jsx)(t.code,{children:'"<EXAMPLE>"'}),". The Template Protocol will read the named items from within the packet and fill in the CMD_TEMPLATE. This filled in string is then sent out rather than the originally passed in packet. Correspondingly, if a response is expected the outgoing packet should include a RSP_TEMPLATE and RSP_PACKET field. The RSP_TEMPLATE is used to extract data from the response string and build a corresponding RSP_PACKET. See the TEMPLATE target within the COSMOS Demo configuration for an example of usage."]}),"\n",(0,r.jsxs)(t.table,{children:[(0,r.jsx)(t.thead,{children:(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.th,{children:"Parameter"}),(0,r.jsx)(t.th,{children:"Description"}),(0,r.jsx)(t.th,{children:"Required"}),(0,r.jsx)(t.th,{children:"Default"})]})}),(0,r.jsxs)(t.tbody,{children:[(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Write Termination Characters"}),(0,r.jsx)(t.td,{children:"The data to write after writing a command packet. Given as a hex string such as 0xABCD."}),(0,r.jsx)(t.td,{children:"Yes"}),(0,r.jsx)(t.td,{})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Read Termination Characters"}),(0,r.jsx)(t.td,{children:"The characters which delineate the end of a telemetry packet. Given as a hex string such as 0xABCD."}),(0,r.jsx)(t.td,{children:"Yes"}),(0,r.jsx)(t.td,{})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Ignore Lines"}),(0,r.jsx)(t.td,{children:"Number of response lines to ignore (completely drop)"}),(0,r.jsx)(t.td,{children:"No"}),(0,r.jsx)(t.td,{children:"0 lines"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Initial Read Delay"}),(0,r.jsx)(t.td,{children:"An initial delay after connecting after which the interface will be read till empty and data dropped. Useful for discarding connect headers and initial prompts."}),(0,r.jsx)(t.td,{children:"No"}),(0,r.jsx)(t.td,{children:"nil (no initial read)"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Response Lines"}),(0,r.jsx)(t.td,{children:"The number of lines that make up expected responses"}),(0,r.jsx)(t.td,{children:"No"}),(0,r.jsx)(t.td,{children:"1 line"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Strip Read Termination"}),(0,r.jsx)(t.td,{children:"Whether to remove the read termination characters before returning the telemetry packet"}),(0,r.jsx)(t.td,{children:"No"}),(0,r.jsx)(t.td,{children:"true"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Discard Leading Bytes"}),(0,r.jsx)(t.td,{children:"The number of bytes to discard from the binary data after reading. Note that this applies to bytes including the sync pattern if the sync pattern is being used."}),(0,r.jsx)(t.td,{children:"No"}),(0,r.jsx)(t.td,{children:"0 (do not discard bytes)"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Sync Pattern"}),(0,r.jsx)(t.td,{children:"Hex string representing a byte pattern that will be searched for in the raw data. This pattern represents a packet delimiter and all data found including the sync pattern will be returned."}),(0,r.jsx)(t.td,{children:"No"}),(0,r.jsx)(t.td,{children:"nil (no sync pattern)"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Fill Fields"}),(0,r.jsx)(t.td,{children:"Whether to fill in the sync pattern on outgoing packets"}),(0,r.jsx)(t.td,{children:"No"}),(0,r.jsx)(t.td,{children:"false"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Response Timeout"}),(0,r.jsx)(t.td,{children:"Number of seconds to wait for a response before timing out"}),(0,r.jsx)(t.td,{children:"No"}),(0,r.jsx)(t.td,{children:"5.0"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Response Polling Period"}),(0,r.jsx)(t.td,{children:"Number of seconds to wait between polling for a response"}),(0,r.jsx)(t.td,{children:"No"}),(0,r.jsx)(t.td,{children:"0.02"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Raise Exceptions"}),(0,r.jsx)(t.td,{children:"Whether to raise exceptions when errors occur like timeouts or unexpected responses"}),(0,r.jsx)(t.td,{children:"No"}),(0,r.jsx)(t.td,{children:"false"})]})]})]}),"\n",(0,r.jsx)(t.h3,{id:"preidentified-protocol",children:"Preidentified Protocol"}),"\n",(0,r.jsxs)(t.p,{children:["The Preidentified Protocol delineates packets using the COSMOS header. This Protocol was created to allow tools to connect and receive the entire packet stream. It can be used with the ",(0,r.jsx)(t.a,{href:"/docs/configuration/interfaces#file-interface",children:"FileInterface"})," to process COSMOS 4 log files. It can also be used to chain COSMOS instances together although that should rarely be needed with the new web native implementation."]}),"\n",(0,r.jsxs)(t.table,{children:[(0,r.jsx)(t.thead,{children:(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.th,{children:"Parameter"}),(0,r.jsx)(t.th,{children:"Description"}),(0,r.jsx)(t.th,{children:"Required"}),(0,r.jsx)(t.th,{children:"Default"})]})}),(0,r.jsxs)(t.tbody,{children:[(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Sync Pattern"}),(0,r.jsx)(t.td,{children:"Hex string representing a byte pattern that will be searched for in the raw data. This pattern represents a packet delimiter and all data found AFTER the sync pattern will be returned. The sync pattern itself is discarded."}),(0,r.jsx)(t.td,{children:"No"}),(0,r.jsx)(t.td,{children:"nil (no sync pattern)"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Max Length"}),(0,r.jsx)(t.td,{children:"The maximum allowed value in the length field"}),(0,r.jsx)(t.td,{children:"No"}),(0,r.jsx)(t.td,{children:"nil (no maximum length)"})]})]})]}),"\n",(0,r.jsxs)(t.p,{children:["For an example of using Preidentified Protocol see ",(0,r.jsx)(t.a,{href:"/docs/configuration/interfaces#file-interface",children:"FileInterface"}),"."]}),"\n",(0,r.jsx)(t.h2,{id:"helper-protocols",children:"Helper Protocols"}),"\n",(0,r.jsx)(t.p,{children:"COSMOS provides the following helper protocols: CmdResponse, Crc and Ignore. These protocols provide helper functionality to Interfaces."}),"\n",(0,r.jsx)(t.h3,{id:"cmdresponse-protocol",children:"CmdResponse Protocol"}),"\n",(0,r.jsx)(t.p,{children:"The CmdResponse Protocol waits for a response for any commands with a defined response packet."}),"\n",(0,r.jsxs)(t.table,{children:[(0,r.jsx)(t.thead,{children:(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.th,{children:"Parameter"}),(0,r.jsx)(t.th,{children:"Description"}),(0,r.jsx)(t.th,{children:"Required"}),(0,r.jsx)(t.th,{children:"Default"})]})}),(0,r.jsxs)(t.tbody,{children:[(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Response Timeout"}),(0,r.jsx)(t.td,{children:"Number of seconds to wait before timing out when waiting for a response"}),(0,r.jsx)(t.td,{children:"No"}),(0,r.jsx)(t.td,{children:"5"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Response Polling Period"}),(0,r.jsx)(t.td,{children:"Number of seconds to wait between polling for a response"}),(0,r.jsx)(t.td,{children:"No"}),(0,r.jsx)(t.td,{children:"0.02"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Raise Exceptions"}),(0,r.jsx)(t.td,{children:"Whether to raise exceptions when errors occur in the protocol like unexpected responses or response timeouts"}),(0,r.jsx)(t.td,{children:"No"}),(0,r.jsx)(t.td,{children:"false"})]})]})]}),"\n",(0,r.jsx)(t.h4,{id:"packet-definitions",children:"Packet Definitions"}),"\n",(0,r.jsxs)(t.p,{children:["The CmdResponseProtocol utilizes the ",(0,r.jsx)(t.a,{href:"../configuration/command#response",children:"RESPONSE"})," keyword in the command definition to determine which telemetry packet should be expected when the given command is sent."]}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{children:'COMMAND SCPI_PS GET_STATUS BIG_ENDIAN "Gets status"\n ACCESSOR TemplateAccessor\n TEMPLATE ":MEAS:VOLT? (@1:2)"\n RESPONSE SCPI_PS STATUS\n'})}),"\n",(0,r.jsx)(t.p,{children:"The Response packet (STATUS) should be defined to contain the response data."}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{children:'TELEMETRY SCPI_PS STATUS BIG_ENDIAN "Status"\n ACCESSOR TemplateAccessor\n TEMPLATE "<MEAS_VOLTAGE_1>,<MEAS_VOLTAGE_2>"\n APPEND_ITEM MEAS_VOLTAGE_1 32 FLOAT "Voltage Reading for Channel 1"\n UNITS VOLTS V\n FORMAT_STRING %0.3f\n APPEND_ITEM MEAS_VOLTAGE_2 32 FLOAT "Voltage Reading for Channel 2"\n UNITS VOLTS V\n FORMAT_STRING %0.3f\n'})}),"\n",(0,r.jsxs)(t.p,{children:["For a full example, please see the ",(0,r.jsx)(t.a,{href:"https://github.com/OpenC3/cosmos-enterprise-plugins/tree/main/openc3-cosmos-scpi-power-supply",children:"openc3-cosmos-scpi-power-supply"})," in the COSMOS Enterprise Plugins."]}),"\n",(0,r.jsx)(t.h3,{id:"crc-protocol",children:"CRC Protocol"}),"\n",(0,r.jsx)(t.p,{children:"The CRC protocol can add CRCs to outgoing commands and verify CRCs on incoming telemetry packets."}),"\n",(0,r.jsxs)(t.table,{children:[(0,r.jsx)(t.thead,{children:(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.th,{children:"Parameter"}),(0,r.jsx)(t.th,{children:"Description"}),(0,r.jsx)(t.th,{children:"Required"}),(0,r.jsx)(t.th,{children:"Default"})]})}),(0,r.jsxs)(t.tbody,{children:[(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Write Item Name"}),(0,r.jsx)(t.td,{children:"Item to fill with calculated CRC value for outgoing packets (nil = don't fill)"}),(0,r.jsx)(t.td,{children:"No"}),(0,r.jsx)(t.td,{children:"nil"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Strip CRC"}),(0,r.jsx)(t.td,{children:"Whether to remove the CRC from incoming packets"}),(0,r.jsx)(t.td,{children:"No"}),(0,r.jsx)(t.td,{children:"false"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Bad Strategy"}),(0,r.jsx)(t.td,{children:"How to handle CRC errors on incoming packets. ERROR = Just log the error, DISCONNECT = Disconnect interface"}),(0,r.jsx)(t.td,{children:"No"}),(0,r.jsx)(t.td,{children:'"ERROR"'})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Bit Offset"}),(0,r.jsx)(t.td,{children:"Bit offset of the CRC in the data. Can be negative to indicate distance from end of packet"}),(0,r.jsx)(t.td,{children:"No"}),(0,r.jsx)(t.td,{children:"-32"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Bit Size"}),(0,r.jsx)(t.td,{children:"Bit size of the CRC - Must be 16, 32, or 64"}),(0,r.jsx)(t.td,{children:"No"}),(0,r.jsx)(t.td,{children:"32"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Endianness"}),(0,r.jsx)(t.td,{children:"Endianness of the CRC (BIG_ENDIAN/LITTLE_ENDIAN)"}),(0,r.jsx)(t.td,{children:"No"}),(0,r.jsx)(t.td,{children:'"BIG_ENDIAN"'})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Poly"}),(0,r.jsx)(t.td,{children:"Polynomial to use when calculating the CRC expressed as an integer"}),(0,r.jsx)(t.td,{children:"No"}),(0,r.jsx)(t.td,{children:"nil (use default polynomial - 16-bit=0x1021, 32-bit=0x04C11DB7, 64-bit=0x42F0E1EBA9EA3693)"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Seed"}),(0,r.jsx)(t.td,{children:"Seed value to start the calculation"}),(0,r.jsx)(t.td,{children:"No"}),(0,r.jsx)(t.td,{children:"nil (use default seed - 16-bit=0xFFFF, 32-bit=0xFFFFFFFF, 64-bit=0xFFFFFFFFFFFFFFFF)"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Xor"}),(0,r.jsx)(t.td,{children:"Whether to XOR the CRC result with 0xFFFF"}),(0,r.jsx)(t.td,{children:"No"}),(0,r.jsx)(t.td,{children:"nil (use default value - 16-bit=false, 32-bit=true, 64-bit=true)"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Reflect"}),(0,r.jsx)(t.td,{children:"Whether to bit reverse each byte of data before calculating the CRC"}),(0,r.jsx)(t.td,{children:"No"}),(0,r.jsx)(t.td,{children:"nil (use default value - 16-bit=false, 32-bit=true, 64-bit=true)"})]})]})]}),"\n",(0,r.jsx)(t.h3,{id:"ignore-packet-protocol",children:"Ignore Packet Protocol"}),"\n",(0,r.jsx)(t.p,{children:"The Ignore Packet protocol drops specified command packets sent by COSMOS or drops incoming telemetry packets."}),"\n",(0,r.jsxs)(t.table,{children:[(0,r.jsx)(t.thead,{children:(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.th,{children:"Parameter"}),(0,r.jsx)(t.th,{children:"Description"}),(0,r.jsx)(t.th,{children:"Required"}),(0,r.jsx)(t.th,{children:"Default"})]})}),(0,r.jsxs)(t.tbody,{children:[(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Target Name"}),(0,r.jsx)(t.td,{children:"Target name of the packet to ignore"}),(0,r.jsx)(t.td,{children:"Yes"}),(0,r.jsx)(t.td,{children:"nil"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Packet Name"}),(0,r.jsx)(t.td,{children:"Packet name of the packet to ignore"}),(0,r.jsx)(t.td,{children:"Yes"}),(0,r.jsx)(t.td,{children:"nil"})]})]})]}),"\n",(0,r.jsx)(t.h2,{id:"custom-protocols",children:"Custom Protocols"}),"\n",(0,r.jsx)(t.p,{children:"Creating a custom protocol is easy and should be the default solution for customizing COSMOS Interfaces (rather than creating a new Interface class). However, creating custom Interfaces is still useful for defaulting parameters to values that always are fixed for your target and for including the necessary Protocols. The COSMOS Interfaces take a lot of parameters that can be confusing to your end users. Thus you may want to create a custom Interface just to hard coded these values and cut the available parameters down to something like the hostname and port to connect to."}),"\n",(0,r.jsxs)(t.p,{children:["All custom Protocols should derive from the Protocol class ",(0,r.jsx)(t.a,{href:"https://github.com/OpenC3/cosmos/blob/main/openc3/lib/openc3/interfaces/protocols/protocol.rb",children:"openc3/interfaces/protocols/protocol.rb"})," (Ruby) and ",(0,r.jsx)(t.a,{href:"https://github.com/OpenC3/cosmos/blob/main/openc3/python/openc3/interfaces/protocols/protocol.py",children:"openc3/interfaces/protocols/protocol.py"})," (Python). This class defines the 9 methods that are relevant to writing your own protocol. The base class implementation for each method is included below as well as a discussion as to how the methods should be overridden and used in your own Protocols."]}),"\n",(0,r.jsx)(t.admonition,{title:"Ruby Protocol APIs",type:"info",children:(0,r.jsxs)(t.p,{children:["Protocols should not ",(0,r.jsx)(t.code,{children:"require 'openc3/script'"})," since they are part of a COSMOS interface. They should use the COSMOS library code directly like ",(0,r.jsx)(t.a,{href:"https://github.com/OpenC3/cosmos/blob/main/openc3/lib/openc3/system/system.rb",children:"System"}),", ",(0,r.jsx)(t.a,{href:"https://github.com/OpenC3/cosmos/blob/main/openc3/lib/openc3/packets/packet.rb",children:"Packet"}),", ",(0,r.jsx)(t.a,{href:"https://github.com/OpenC3/cosmos/blob/main/openc3/lib/openc3/utilities/bucket.rb",children:"Bucket"}),", ",(0,r.jsx)(t.a,{href:"https://github.com/OpenC3/cosmos/blob/main/openc3/lib/openc3/accessors/binary_accessor.rb",children:"BinaryAccessor"}),", etc. When in doubt, consult the existing COSMOS ",(0,r.jsx)(t.a,{href:"https://github.com/OpenC3/cosmos/tree/main/openc3/lib/openc3/interfaces/protocols",children:"protocol"})," classes."]})}),"\n",(0,r.jsx)(t.admonition,{title:"Python Protocol APIs",type:"info",children:(0,r.jsxs)(t.p,{children:["Protocols should not ",(0,r.jsx)(t.code,{children:"from openc3.script import *"})," since they are part of a COSMOS interface. They should use the COSMOS library code directly like ",(0,r.jsx)(t.a,{href:"https://github.com/OpenC3/cosmos/blob/main/openc3/python/openc3/system/system.py",children:"System"}),", ",(0,r.jsx)(t.a,{href:"https://github.com/OpenC3/cosmos/blob/main/openc3/python/openc3/packets/packet.py",children:"Packet"}),", ",(0,r.jsx)(t.a,{href:"https://github.com/OpenC3/cosmos/blob/main/openc3/python/openc3/utilities/bucket.py",children:"Bucket"}),", ",(0,r.jsx)(t.a,{href:"https://github.com/OpenC3/cosmos/blob/main/openc3/python/openc3/accessors/binary_accessor.py",children:"BinaryAccessor"}),", etc. When in doubt, consult the existing COSMOS ",(0,r.jsx)(t.a,{href:"https://github.com/OpenC3/cosmos/tree/main/openc3/python/openc3/interfaces/protocols",children:"protocol"})," classes."]})}),"\n",(0,r.jsx)(t.p,{children:"To really understand how Protocols work, you first must understand the logic within the base Interface class read and write methods."}),"\n",(0,r.jsx)(t.p,{children:"Let's first discuss the read method."}),"\n",(0,r.jsx)(t.admonition,{title:"Ruby Symbols, Python Strings",type:"info",children:(0,r.jsxs)(t.p,{children:["In the following discussions an all caps word is a symbol in Ruby and a string in Python. So a reference to STOP means ",":STOP",' in Ruby and "STOP" in Python.']})}),"\n",(0,r.jsx)(t.p,{children:(0,r.jsx)(t.img,{alt:"Interface Read Logic",src:n(1188).Z+"",width:"1063",height:"542"})}),"\n",(0,r.jsxs)(t.p,{children:["On ",(0,r.jsx)(t.em,{children:"every"}),' call to read, an empty string "" is first passed down to each of the read Protocol\'s ',(0,r.jsx)(t.code,{children:"read_data()"})," method ",(0,r.jsx)(t.em,{children:"before"})," new raw data is attempted to be read using the Interface's ",(0,r.jsx)(t.code,{children:"read_interface()"})," method. This is a signal to Protocols that have cached up more than one packet worth of data to output those cached packets before any new data is read from the Interface. Typically no data will be cached up and one of the Protocols ",(0,r.jsx)(t.code,{children:"read_data()"})," methods will return STOP in response to the empty string, indicating that more data is required to generate a packet. Each Protocol's ",(0,r.jsx)(t.code,{children:"read_data()"})," method can return one of three things: data that will be passed down to any additional Protocols or turned into a Packet, STOP which means more data is required from the Interface for the Protocol to continue, or DISCONNECT which means that something has happened that requires disconnecting the Interface (and by default trying to reconnect). Each Protocol's ",(0,r.jsx)(t.code,{children:"read_data()"})," method is passed the data that will eventually be turned into a packet and returns a possibly modified set of data. If the data passes through all Protocol's ",(0,r.jsx)(t.code,{children:"read_data()"})," methods it is then converted into a COSMOS packet using the Interface's convert_data_to_packet() method. This packet is then run in a similar fashion through each Read Protocol's read_packet() method. This method has essentially the same return possibilities: a Packet (instead of data as in ",(0,r.jsx)(t.code,{children:"read_data()"}),"), STOP, or DISCONNECT. If the Packet makes it through all read_packet() methods then the Interface packet read counter is incremented and the Packet is returned to the Interface."]}),"\n",(0,r.jsx)(t.p,{children:(0,r.jsx)(t.img,{alt:"Interface Write Logic",src:n(3756).Z+"",width:"931",height:"944"})}),"\n",(0,r.jsx)(t.p,{children:"The Interface write() method works very similarly to read. (It should be mentioned that by default write protocols run in the reverse order of read protocols. This makes sense because when reading you're typically stripping layers of data and when writing you're typically adding on layers in reverse order.)"}),"\n",(0,r.jsx)(t.p,{children:"First, the packet write counter is incremented. Then each write Protocol is given a chance to modify the packet by its write_packet() method being called. This method can either return a potentially modified packet, STOP, or DISCONNECT. If a write Protocol returns STOP no data will be written out the Interface and it is assumed that more packets are necessary before a final packet can be output. DISCONNECT will disconnect the Interface. If the packet makes it through all the write Protocol's write_packet() methods, then it is converted to binary data using the Interface's convert_packet_to_data() method. Next the write_data() method is called for each write Protocol giving it a chance to modify the lower level data. The same return options are available except a Ruby string of data is returned instead of a COSMOS packet. If the data makes it through all write_data() methods, then it is written out on the Interface using the write_interface() method. Afterwards, each Protocol's post_write_interface() method is called with both the final modified Packet, and the actual data written out to the Interface. This method allows follow-up such as waiting for a response after writing out a message."}),"\n",(0,r.jsx)(t.h2,{id:"method-discussions",children:"Method discussions"}),"\n",(0,r.jsxs)(t.h3,{id:"initialize-or-init",children:["initialize or ",(0,r.jsx)(t.strong,{children:"init"})]}),"\n",(0,r.jsx)(t.p,{children:"This is the constructor for your custom Protocol. It should always call super(allow_empty_data) to initialize the base Protocol class."}),"\n",(0,r.jsx)(t.p,{children:"Base class Ruby implementation:"}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-ruby",children:"# @param allow_empty_data [true/false] Whether STOP should be returned on empty data\ndef initialize(allow_empty_data = false)\n @interface = nil\n @allow_empty_data = ConfigParser.handle_true_false(allow_empty_data)\n reset()\nend\n"})}),"\n",(0,r.jsx)(t.p,{children:"Base class Python implementation:"}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-python",children:"def __init__(self, allow_empty_data=None):\n self.interface = None\n self.allow_empty_data = ConfigParser.handle_true_false_none(allow_empty_data)\n self.reset()\n"})}),"\n",(0,r.jsxs)(t.p,{children:["As you can see, every Protocol maintains state on at least two items. The interface variable holds the Interface class instance that the protocol is associated with. This is sometimes necessary to introspect details that only the Interface knows. allow_empty_data is a flag used by the ",(0,r.jsx)(t.code,{children:"read_data(data)"})," method that is discussed later in this document."]}),"\n",(0,r.jsx)(t.h3,{id:"reset",children:"reset"}),"\n",(0,r.jsx)(t.p,{children:"The reset method is used to reset internal protocol state when the Interface is connected and/or disconnected. This method should be used for common resetting logic. Connect and Disconnect specific logic are handled in the next two methods."}),"\n",(0,r.jsx)(t.p,{children:"Base class Ruby implementation:"}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-ruby",children:"def reset\nend\n"})}),"\n",(0,r.jsx)(t.p,{children:"Base class Python implementation:"}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-python",children:"def reset(self):\n pass\n"})}),"\n",(0,r.jsx)(t.p,{children:"As you can see, the base class reset implementation doesn't do anything."}),"\n",(0,r.jsx)(t.h3,{id:"connect_reset",children:"connect_reset"}),"\n",(0,r.jsx)(t.p,{children:"The connect_reset method is used to reset internal Protocol state each time the Interface is connected."}),"\n",(0,r.jsx)(t.p,{children:"Base class Ruby implementation:"}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-ruby",children:"def connect_reset\n reset()\nend\n"})}),"\n",(0,r.jsx)(t.p,{children:"Base class Python implementation:"}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-python",children:"def connect_reset(self):\n self.reset()\n"})}),"\n",(0,r.jsx)(t.p,{children:"The base class connect_reset implementation just calls the reset method to ensure common reset logic is run."}),"\n",(0,r.jsx)(t.h3,{id:"disconnect_reset",children:"disconnect_reset"}),"\n",(0,r.jsx)(t.p,{children:"The disconnect_reset method is used to reset internal Protocol state each time the Interface is disconnected."}),"\n",(0,r.jsx)(t.p,{children:"Base class Ruby implementation:"}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-ruby",children:"def disconnect_reset\n reset()\nend\n"})}),"\n",(0,r.jsx)(t.p,{children:"Base class Python implementation:"}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-python",children:"def disconnect_reset(self):\n self.reset()\n"})}),"\n",(0,r.jsx)(t.p,{children:"The base class disconnect_reset implementation just calls the reset method to ensure common reset logic is run."}),"\n",(0,r.jsx)(t.h3,{id:"read_data",children:"read_data"}),"\n",(0,r.jsx)(t.p,{children:"The read_data method is used to analyze and potentially modify any raw data read by an Interface. It takes one parameter as the current state of the data to be analyzed. It can return either a string of data, STOP, or DISCONNECT. If it returns a string, then it believes that data may be ready to be a full packet, and is ready for processing by any following Protocols. If STOP is returned then the Protocol believes it needs more data to complete a full packet. If DISCONNECT is returned then the Protocol believes the Interface should be disconnected (and typically automatically reconnected)."}),"\n",(0,r.jsx)(t.p,{children:"Base class Ruby implementation:"}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-ruby",children:"def read_data(data)\n if (data.length <= 0)\n if @allow_empty_data.nil?\n if @interface and @interface.read_protocols[-1] == self # Last read interface in chain with auto @allow_empty_data\n return :STOP\n end\n elsif !@allow_empty_data # Don't @allow_empty_data means STOP\n return :STOP\n end\n end\n data\nend\n"})}),"\n",(0,r.jsx)(t.p,{children:"Base class Python implementation:"}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-python",children:'def read_data(self, data, extra=None):\n if len(data) <= 0:\n if self.allow_empty_data is None:\n if self.interface and self.interface.read_protocols[-1] == self:\n # Last read interface in chain with auto self.allow_empty_data\n return ("STOP", extra)\n elif self.allow_empty_data:\n # Don\'t self.allow_empty_data means STOP\n return ("STOP", extra)\n return (data, extra)\n'})}),"\n",(0,r.jsxs)(t.p,{children:["The base class implementation does nothing except return the data it was given. The only exception to this is when handling an empty string. If the allow_empty_data flag is false / False or if it is nil / None and the Protocol is the last in the chain, then the base implementation will return STOP to indicate that it is time to call the Interface ",(0,r.jsx)(t.code,{children:"read_interface()"})," method to get more data. Blank strings are used to signal Protocols that they have an opportunity to return a cached packet."]}),"\n",(0,r.jsx)(t.h3,{id:"read_packet",children:"read_packet"}),"\n",(0,r.jsx)(t.p,{children:"The read_packet method is used to analyze and potentially modify a COSMOS packet before it is returned by the Interface. It takes one parameter as the current state of the packet to be analyzed. It can return either a COSMOS packet, STOP, or DISCONNECT. If it returns a COSMOS packet, then it believes that the packet is valid, should be returned, and is ready for processing by any following Protocols. If STOP is returned then the Protocol believes the packet should be silently dropped. If DISCONNECT is returned then the Protocol believes the Interface should be disconnected (and typically automatically reconnected). This method is where a Protocol would set the stored flag on a packet if it determines that the packet is stored telemetry instead of real-time telemetry."}),"\n",(0,r.jsx)(t.p,{children:"Base class Ruby implementation:"}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-ruby",children:"def read_packet(packet)\n return packet\nend\n"})}),"\n",(0,r.jsx)(t.p,{children:"Base class Python implementation:"}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-python",children:"def read_packet(self, packet):\n return packet\n"})}),"\n",(0,r.jsx)(t.p,{children:"The base class always just returns the packet given."}),"\n",(0,r.jsx)(t.h3,{id:"write_packet",children:"write_packet"}),"\n",(0,r.jsx)(t.p,{children:"The write_packet method is used to analyze and potentially modify a COSMOS packet before it is output by the Interface. It takes one parameter as the current state of the packet to be analyzed. It can return either a COSMOS packet, STOP, or DISCONNECT. If it returns a COSMOS packet, then it believes that the packet is valid, should be written out the Interface, and is ready for processing by any following Protocols. If STOP is returned then the Protocol believes the packet should be silently dropped. If DISCONNECT is returned then the Protocol believes the Interface should be disconnected (and typically automatically reconnected)."}),"\n",(0,r.jsx)(t.p,{children:"Base class Ruby implementation:"}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-ruby",children:"def write_packet(packet)\n return packet\nend\n"})}),"\n",(0,r.jsx)(t.p,{children:"Base class Python implementation:"}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-python",children:"def write_packet(self, packet):\n return packet\n"})}),"\n",(0,r.jsx)(t.p,{children:"The base class always just returns the packet given."}),"\n",(0,r.jsx)(t.h3,{id:"write_data",children:"write_data"}),"\n",(0,r.jsx)(t.p,{children:"The write_data method is used to analyze and potentially modify data before it is written out by the Interface. It takes one parameter as the current state of the data to be analyzed and sent. It can return either a string of data, STOP, or DISCONNECT. If it returns a string of data, then it believes that the data is valid, should be written out the Interface, and is ready for processing by any following Protocols. If STOP is returned then the Protocol believes the data should be silently dropped. If DISCONNECT is returned then the Protocol believes the Interface should be disconnected (and typically automatically reconnected)."}),"\n",(0,r.jsx)(t.p,{children:"Base class Ruby implementation:"}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-ruby",children:"def write_data(data)\n return data\nend\n"})}),"\n",(0,r.jsx)(t.p,{children:"Base class Python implementation:"}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-python",children:"def write_data(self, data, extra=None):\n return (data, extra)\n"})}),"\n",(0,r.jsx)(t.p,{children:"The base class always just returns the data given."}),"\n",(0,r.jsx)(t.h3,{id:"post_write_interface",children:"post_write_interface"}),"\n",(0,r.jsxs)(t.p,{children:["The post_write_interface method is called after data has been written out the Interface. The typical use of this method is to provide a hook to implement command/response type interfaces where a response is always immediately expected in response to a command. It takes two parameters, the packet after all modifications by ",(0,r.jsx)(t.code,{children:"write_packet()"})," and the data that was actually written out the Interface. It can return either the same pair of packet/data, STOP, or DISCONNECT. If it returns a packet/data pair then they are passed on to any other Protocols. If STOP is returned then the Interface write() call completes and no further Protocols ",(0,r.jsx)(t.code,{children:"post_write_interface()"}),' methods are called. If DISCONNECT is returned then the Protocol believes the Interface should be disconnected (and typically automatically reconnected). Note that only the first parameter "packet", is checked to be STOP, or DISCONNECT on the return.']}),"\n",(0,r.jsx)(t.p,{children:"Base class Ruby implementation:"}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-ruby",children:"def post_write_interface(packet, data)\n return packet, data\nend\n"})}),"\n",(0,r.jsx)(t.p,{children:"Base class Python implementation:"}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-python",children:"def post_write_interface(self, packet, data, extra=None):\n return (packet, data, extra)\n"})}),"\n",(0,r.jsx)(t.p,{children:"The base class always just returns the packet/data given."}),"\n",(0,r.jsx)(t.h3,{id:"protocol_cmd",children:"protocol_cmd"}),"\n",(0,r.jsxs)(t.p,{children:["The protocol_cmd method is used to send commands to the protocol itself. This is useful to change protocol behavior during runtime. See ",(0,r.jsx)(t.a,{href:"../guides/scripting-api#interface_protocol_cmd",children:"interface_protocol_cmd"})," for more information."]}),"\n",(0,r.jsx)(t.p,{children:"Base class Ruby implementation:"}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-ruby",children:"def protocol_cmd(cmd_name, *cmd_args)\n # Default do nothing - Implemented by subclasses\n return false\nend\n"})}),"\n",(0,r.jsx)(t.p,{children:"Base class Python implementation:"}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-python",children:"def protocol_cmd(self, cmd_name, *cmd_args):\n # Default do nothing - Implemented by subclasses\n return False\n"})}),"\n",(0,r.jsx)(t.p,{children:"The base class does nothing as this is special functionality implemented by subclasses."}),"\n",(0,r.jsx)(t.h2,{id:"examples",children:"Examples"}),"\n",(0,r.jsxs)(t.p,{children:["Please see the linked ",(0,r.jsx)(t.a,{href:"https://github.com/OpenC3/cosmos/blob/main/openc3/lib/openc3/interfaces/protocols",children:"Ruby Protocol"})," and ",(0,r.jsx)(t.a,{href:"https://github.com/OpenC3/cosmos/blob/main/openc3/python/openc3/interfaces/protocols",children:"Python Protocol"})," code for examples of the above methods in action."]})]})}function h(e={}){let{wrapper:t}={...(0,i.a)(),...e.components};return t?(0,r.jsx)(t,{...e,children:(0,r.jsx)(l,{...e})}):l(e)}}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkdocs_openc3_com=self.webpackChunkdocs_openc3_com||[]).push([["9474"],{2840:function(e,t,i){i.d(t,{Z:()=>l,a:()=>d});var n=i(2784);let r={},s=n.createContext(r);function d(e){let t=n.useContext(s);return n.useMemo(function(){return"function"==typeof e?e(t):{...t,...e}},[t,e])}function l(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:d(e.components),n.createElement(s.Provider,{value:t},e.children)}},8131:function(e,t,i){i.r(t),i.d(t,{frontMatter:()=>d,default:()=>h,contentTitle:()=>l,assets:()=>a,toc:()=>o,metadata:()=>n});var n=JSON.parse('{"id":"configuration/target","title":"Targets","description":"Target definition file format and keywords","source":"@site/docs/configuration/target.md","sourceDirName":"configuration","slug":"/configuration/target","permalink":"/tools/staticdocs/docs/configuration/target","draft":false,"unlisted":false,"editUrl":"https://github.com/OpenC3/cosmos/tree/main/docs.openc3.com/docs/configuration/target.md","tags":[],"version":"current","sidebarPosition":3,"frontMatter":{"sidebar_position":3,"title":"Targets","description":"Target definition file format and keywords","sidebar_custom_props":{"myEmoji":"\uD83D\uDEF0\uFE0F"}},"sidebar":"defaultSidebar","previous":{"title":"Plugins","permalink":"/tools/staticdocs/docs/configuration/plugins"},"next":{"title":"Commands","permalink":"/tools/staticdocs/docs/configuration/command"}}'),r=i(2322),s=i(2840);let d={sidebar_position:3,title:"Targets",description:"Target definition file format and keywords",sidebar_custom_props:{myEmoji:"\uD83D\uDEF0\uFE0F"}},l="target.txt Keywords",a={},o=[{value:"LANGUAGE",id:"language",level:2},{value:"REQUIRE",id:"require",level:2},{value:"IGNORE_PARAMETER",id:"ignore_parameter",level:2},{value:"IGNORE_ITEM",id:"ignore_item",level:2},{value:"COMMANDS",id:"commands",level:2},{value:"TELEMETRY",id:"telemetry",level:2},{value:"CMD_UNIQUE_ID_MODE",id:"cmd_unique_id_mode",level:2},{value:"TLM_UNIQUE_ID_MODE",id:"tlm_unique_id_mode",level:2}];function c(e){let t={a:"a",admonition:"admonition",code:"code",h1:"h1",h2:"h2",header:"header",p:"p",pre:"pre",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",...(0,s.a)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(t.p,{children:["Targets are the external embedded systems that COSMOS connects to. Targets are defined by the top level ",(0,r.jsx)(t.a,{href:"/tools/staticdocs/docs/configuration/plugins#target-1",children:"TARGET"})," keyword in the plugin.txt file. Each target is self contained in a target directory named after the target. In the root of the target directory there is a configuration file named target.txt which configures the individual target."]}),"\n",(0,r.jsx)(t.header,{children:(0,r.jsx)(t.h1,{id:"targettxt-keywords",children:"target.txt Keywords"})}),"\n",(0,r.jsx)(t.h2,{id:"language",children:"LANGUAGE"}),"\n",(0,r.jsxs)(t.p,{children:[(0,r.jsx)("div",{class:"right",children:"(Since 5.11.1)"}),(0,r.jsx)(t.strong,{children:"Programming language of the target interfaces and microservices"})]}),"\n",(0,r.jsx)(t.p,{children:"The target language must be either Ruby or Python. The language determines how the target's interfaces and microservices are run. Note that both Ruby and Python still use ERB to perform templating."}),"\n",(0,r.jsxs)(t.table,{children:[(0,r.jsx)(t.thead,{children:(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.th,{children:"Parameter"}),(0,r.jsx)(t.th,{children:"Description"}),(0,r.jsx)(t.th,{children:"Required"})]})}),(0,r.jsx)(t.tbody,{children:(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{}),(0,r.jsxs)(t.td,{children:["Ruby or Python",(0,r.jsx)("br",{}),(0,r.jsx)("br",{}),"Valid Values: ",(0,r.jsx)("span",{class:"values",children:"ruby, python"})]}),(0,r.jsx)(t.td,{children:"True"})]})})]}),"\n",(0,r.jsx)(t.p,{children:"Example Usage:"}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-ruby",children:"LANGUAGE python\n"})}),"\n",(0,r.jsx)(t.h2,{id:"require",children:"REQUIRE"}),"\n",(0,r.jsx)(t.p,{children:(0,r.jsx)(t.strong,{children:"Requires a Ruby file"})}),"\n",(0,r.jsx)(t.p,{children:"List the Ruby files required to explicitly declare dependencies. This is now completely optional."}),"\n",(0,r.jsxs)(t.table,{children:[(0,r.jsx)(t.thead,{children:(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.th,{children:"Parameter"}),(0,r.jsx)(t.th,{children:"Description"}),(0,r.jsx)(t.th,{children:"Required"})]})}),(0,r.jsx)(t.tbody,{children:(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Filename"}),(0,r.jsx)(t.td,{children:'Filename to require. For files in the target\'s lib directory simply supply the filename, e.g. "REQUIRE my_file". Files in the base OpenC3 lib directory also should just list the filename. If a file is in a folder under the lib directory then you must specify the folder name, e.g. "REQUIRE folder/my_file". Note the ".rb" extension is optional when specifying the filename.'}),(0,r.jsx)(t.td,{children:"True"})]})})]}),"\n",(0,r.jsx)(t.p,{children:"Example Usage:"}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-ruby",children:"REQUIRE limits_response.rb\n"})}),"\n",(0,r.jsx)(t.h2,{id:"ignore_parameter",children:"IGNORE_PARAMETER"}),"\n",(0,r.jsx)(t.p,{children:(0,r.jsx)(t.strong,{children:"Ignore the given command parameter"})}),"\n",(0,r.jsx)(t.p,{children:"Hint to other OpenC3 tools to hide or ignore this command parameter when processing the command. For example, Command Sender and Command Sequence will not display the parameter (by default) when showing the command and Script Runner code completion will not display the parameter."}),"\n",(0,r.jsxs)(t.table,{children:[(0,r.jsx)(t.thead,{children:(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.th,{children:"Parameter"}),(0,r.jsx)(t.th,{children:"Description"}),(0,r.jsx)(t.th,{children:"Required"})]})}),(0,r.jsx)(t.tbody,{children:(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Parameter Name"}),(0,r.jsx)(t.td,{children:"The name of a command parameter. Note that this parameter will be ignored in ALL the commands it appears in."}),(0,r.jsx)(t.td,{children:"True"})]})})]}),"\n",(0,r.jsx)(t.p,{children:"Example Usage:"}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-ruby",children:"IGNORE_PARAMETER CCSDS_VERSION\n"})}),"\n",(0,r.jsx)(t.h2,{id:"ignore_item",children:"IGNORE_ITEM"}),"\n",(0,r.jsx)(t.p,{children:(0,r.jsx)(t.strong,{children:"Ignore the given telemetry item"})}),"\n",(0,r.jsx)(t.p,{children:"Hint to other OpenC3 tools to hide or ignore this telemetry item when processing the telemetry. For example, Packet Viewer will not display the item (by default) when showing the packet."}),"\n",(0,r.jsxs)(t.table,{children:[(0,r.jsx)(t.thead,{children:(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.th,{children:"Parameter"}),(0,r.jsx)(t.th,{children:"Description"}),(0,r.jsx)(t.th,{children:"Required"})]})}),(0,r.jsx)(t.tbody,{children:(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Item name"}),(0,r.jsx)(t.td,{children:"The name of a telemetry item. Note that this item will be ignored in ALL the telemetry it appears in."}),(0,r.jsx)(t.td,{children:"True"})]})})]}),"\n",(0,r.jsx)(t.p,{children:"Example Usage:"}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-ruby",children:"IGNORE_ITEM CCSDS_VERSION\n"})}),"\n",(0,r.jsx)(t.h2,{id:"commands",children:"COMMANDS"}),"\n",(0,r.jsx)(t.p,{children:(0,r.jsx)(t.strong,{children:"Process the given command definition file"})}),"\n",(0,r.jsx)(t.p,{children:"This keyword is used to explicitly add the command definition file to the list of command and telemetry files to process."}),"\n",(0,r.jsx)(t.admonition,{type:"warning",children:(0,r.jsx)(t.p,{children:"Usage of this keyword overrides automatic command and telemetry file discovery. If this keyword is used, you must also use the TELEMETRY keyword to specify the telemetry files to process."})}),"\n",(0,r.jsxs)(t.table,{children:[(0,r.jsx)(t.thead,{children:(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.th,{children:"Parameter"}),(0,r.jsx)(t.th,{children:"Description"}),(0,r.jsx)(t.th,{children:"Required"})]})}),(0,r.jsx)(t.tbody,{children:(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Filename"}),(0,r.jsx)(t.td,{children:'Name of a command definition file in the target\'s cmd_tlm directory, e.g. "cmd.txt".'}),(0,r.jsx)(t.td,{children:"True"})]})})]}),"\n",(0,r.jsx)(t.p,{children:"Example Usage:"}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-ruby",children:"COMMANDS inst_cmds_v2.txt\nTELEMETRY inst_tlm_v2.txt\n"})}),"\n",(0,r.jsx)(t.h2,{id:"telemetry",children:"TELEMETRY"}),"\n",(0,r.jsx)(t.p,{children:(0,r.jsx)(t.strong,{children:"Process the given telemetry definition file"})}),"\n",(0,r.jsx)(t.p,{children:"This keyword is used to explicitly add the telemetry definition file to the list of command and telemetry files to process."}),"\n",(0,r.jsx)(t.admonition,{type:"warning",children:(0,r.jsx)(t.p,{children:"Usage of this keyword overrides automatic command and telemetry file discovery. If this keyword is used, you must also use the COMMAND keyword to specify the command files to process."})}),"\n",(0,r.jsxs)(t.table,{children:[(0,r.jsx)(t.thead,{children:(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.th,{children:"Parameter"}),(0,r.jsx)(t.th,{children:"Description"}),(0,r.jsx)(t.th,{children:"Required"})]})}),(0,r.jsx)(t.tbody,{children:(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Filename"}),(0,r.jsx)(t.td,{children:'Name of a telemetry definition file in the target\'s cmd_tlm directory, e.g. "tlm.txt".'}),(0,r.jsx)(t.td,{children:"True"})]})})]}),"\n",(0,r.jsx)(t.p,{children:"Example Usage:"}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-ruby",children:"COMMANDS inst_cmds_v2.txt\nTELEMETRY inst_tlm_v2.txt\n"})}),"\n",(0,r.jsx)(t.h2,{id:"cmd_unique_id_mode",children:"CMD_UNIQUE_ID_MODE"}),"\n",(0,r.jsxs)(t.p,{children:[(0,r.jsx)("div",{class:"right",children:"(Since 4.4.0)"}),(0,r.jsx)(t.strong,{children:"Command packet identifiers don't all share the same bit offset, size, and type"})]}),"\n",(0,r.jsx)(t.p,{children:"Ideally all commands for a target are identified using the exact same bit offset, size, and type field in each command. If ANY command identifiers differ then this flag must be set to force a brute force identification method."}),"\n",(0,r.jsx)(t.admonition,{type:"warning",children:(0,r.jsx)(t.p,{children:"Using this mode significantly slows packet identification"})}),"\n",(0,r.jsx)(t.h2,{id:"tlm_unique_id_mode",children:"TLM_UNIQUE_ID_MODE"}),"\n",(0,r.jsxs)(t.p,{children:[(0,r.jsx)("div",{class:"right",children:"(Since 4.4.0)"}),(0,r.jsx)(t.strong,{children:"Telemetry packets identifiers don't all share the same bit offset, size, and type"})]}),"\n",(0,r.jsx)(t.p,{children:"Ideally all telemetry for a target are identified using the exact same bit offset, size, and type field in each packet. If ANY telemetry identifiers differ then this flag must be set to force a brute force identification method."}),"\n",(0,r.jsx)(t.admonition,{type:"warning",children:(0,r.jsx)(t.p,{children:"Using this mode significantly slows packet identification"})})]})}function h(e={}){let{wrapper:t}={...(0,s.a)(),...e.components};return t?(0,r.jsx)(t,{...e,children:(0,r.jsx)(c,{...e})}):c(e)}}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkdocs_openc3_com=self.webpackChunkdocs_openc3_com||[]).push([["314"],{1599:function(e,n,t){t.r(n),t.d(n,{frontMatter:()=>o,default:()=>u,contentTitle:()=>a,assets:()=>d,toc:()=>l,metadata:()=>i});var i=JSON.parse('{"id":"guides/bridges","title":"Bridges","description":"Bridge data into COSMOS from serial ports, PCI, etc","source":"@site/docs/guides/bridges.md","sourceDirName":"guides","slug":"/guides/bridges","permalink":"/tools/staticdocs/docs/guides/bridges","draft":false,"unlisted":false,"editUrl":"https://github.com/OpenC3/cosmos/tree/main/docs.openc3.com/docs/guides/bridges.md","tags":[],"version":"current","frontMatter":{"title":"Bridges","description":"Bridge data into COSMOS from serial ports, PCI, etc","sidebar_custom_props":{"myEmoji":"\uD83C\uDF09"}},"sidebar":"defaultSidebar","previous":{"title":"Guides","permalink":"/tools/staticdocs/docs/guides"},"next":{"title":"COSMOS and NASA cFS","permalink":"/tools/staticdocs/docs/guides/cfs"}}'),r=t(2322),s=t(2840);let o={title:"Bridges",description:"Bridge data into COSMOS from serial ports, PCI, etc",sidebar_custom_props:{myEmoji:"\uD83C\uDF09"}},a=void 0,d={},l=[{value:"Bridges are Generally Just an Interface and Router",id:"bridges-are-generally-just-an-interface-and-router",level:2},{value:"Host Requirements for Running Bridges",id:"host-requirements-for-running-bridges",level:2},{value:"Bridge Configuration: bridge.txt",id:"bridge-configuration-bridgetxt",level:2},{value:"Bridge Commands: openc3cli",id:"bridge-commands-openc3cli",level:2},{value:"Example Bridge Gems",id:"example-bridge-gems",level:2},{value:"Note on Serial Ports",id:"note-on-serial-ports",level:2}];function c(e){let n={a:"a",admonition:"admonition",code:"code",h2:"h2",li:"li",p:"p",pre:"pre",ul:"ul",...(0,s.a)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.p,{children:"COSMOS Bridges provide an easy solution for getting data from devices that don't speak Ethernet into COSMOS.\nSerial ports are the most common, but other devices such as USB, PCI cards, and Bluetooth devices can also be\nsupported by using bridges to convert from a host computer accessible device, into an Ethernet byte stream that COSMOS can process from inside of containers."}),"\n",(0,r.jsx)(n.admonition,{title:"Bridges are Meant to be Dumb",type:"warning",children:(0,r.jsx)(n.p,{children:"The purpose of bridges is to get bytes into COSMOS. Processing should be done in COSMOS itself, including details such as\npacket delineation."})}),"\n",(0,r.jsx)(n.h2,{id:"bridges-are-generally-just-an-interface-and-router",children:"Bridges are Generally Just an Interface and Router"}),"\n",(0,r.jsx)(n.p,{children:"Bridges are generally made up of a COSMOS Interface class that pull data from a host connected device, and a Router that forwards that data to\nCOSMOS over TCP/IP. In most cases, data can be safely sent to COSMOS using the BURST protocol, and let the COSMOS side use the correct packet delineation\nprotocol like LENGTH."}),"\n",(0,r.jsx)(n.h2,{id:"host-requirements-for-running-bridges",children:"Host Requirements for Running Bridges"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:"Requires a host Ruby installation (Ruby 3)"}),"\n",(0,r.jsxs)(n.li,{children:["Install the OpenC3 gem","\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:"gem install openc3"}),"\n"]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["Make sure the Ruby gem executable path is in your PATH environment variable","\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:["You can find this path by running ",(0,r.jsx)(n.code,{children:"gem environment"})," and looking for EXECUTABLE DIRECTORY"]}),"\n"]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["If successful, you should be able to run ",(0,r.jsx)(n.code,{children:"openc3cli"})," from a terminal"]}),"\n"]}),"\n",(0,r.jsx)(n.h2,{id:"bridge-configuration-bridgetxt",children:"Bridge Configuration: bridge.txt"}),"\n",(0,r.jsx)(n.p,{children:"Bridges are run using an configuration file named bridge.txt. This file is a subset of the plugin.txt configuration syntax supporting VARIABLE, INTERFACE, ROUTER, and associated modifier keywords. However, BRIDGES HAVE NO KNOWLEDGE OF TARGETS. So instead of MAP_TARGETS, the INTERFACE is associated with the ROUTER using the ROUTE keyword."}),"\n",(0,r.jsxs)(n.p,{children:["The following is the default bridge.txt that is generated by running ",(0,r.jsx)(n.code,{children:"openc3cli bridgesetup"})]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-ruby",children:"# Write serial port name\nVARIABLE write_port_name COM1\n\n# Read serial port name\nVARIABLE read_port_name COM1\n\n# Baud Rate\nVARIABLE baud_rate 115200\n\n# Parity - NONE, ODD, or EVEN\nVARIABLE parity NONE\n\n# Stop bits - 0, 1, or 2\nVARIABLE stop_bits 1\n\n# Write Timeout\nVARIABLE write_timeout 10.0\n\n# Read Timeout\nVARIABLE read_timeout nil\n\n# Flow Control - NONE, or RTSCTS\nVARIABLE flow_control NONE\n\n# Data bits per word - Typically 8\nVARIABLE data_bits 8\n\n# Port to listen for connections from COSMOS - Plugin must match\nVARIABLE router_port 2950\n\n# Port to listen on for connections from COSMOS. Defaults to localhost for security. Will need to be opened\n# if COSMOS is on another machine.\nVARIABLE router_listen_address 127.0.0.1\n\nINTERFACE SERIAL_INT serial_interface.rb <%= write_port_name %> <%= read_port_name %> <%= baud_rate %> <%= parity %> <%= stop_bits %> <%= write_timeout %> <%= read_timeout %>\n OPTION FLOW_CONTROL <%= flow_control %>\n OPTION DATA_BITS <%= data_bits %>\n\nROUTER SERIAL_ROUTER tcpip_server_interface.rb <%= router_port %> <%= router_port %> 10.0 nil BURST\n ROUTE SERIAL_INT\n OPTION LISTEN_ADDRESS <%= router_listen_address %>\n"})}),"\n",(0,r.jsx)(n.p,{children:"VARIABLE provides default values to variables that can be changed when the bridge is started. This example shows an INTERFACE that is configured to use the serial_interface.rb class. It also includes a standard ROUTER using tcpip_server_interface.rb that COSMOS can connect to and get the data from the serial port. The LISTEN_ADDRESS is set to 127.0.0.1 in this example to prevent access from outside of the host system. Docker running on the same machine can access\nthis server using the host.docker.internal hostname and the configured port (2950 in this example)."}),"\n",(0,r.jsx)(n.h2,{id:"bridge-commands-openc3cli",children:"Bridge Commands: openc3cli"}),"\n",(0,r.jsx)(n.p,{children:(0,r.jsx)(n.code,{children:"openc3cli bridgesetup"})}),"\n",(0,r.jsx)(n.p,{children:"Generates a bridge.txt example file"}),"\n",(0,r.jsx)(n.p,{children:(0,r.jsx)(n.code,{children:"openc3cli bridge [filename] [variable1=value1] [variable2=value2]"})}),"\n",(0,r.jsx)(n.p,{children:"Runs a bridge from a given configuration file. Defaults to bridge.txt in the current directory. Variables can also be passed into to override VARIABLE defaults."}),"\n",(0,r.jsx)(n.p,{children:(0,r.jsx)(n.code,{children:"openc3cli bridgegem [gem_name] [variable1=value1] [variable2=value2]"})}),"\n",(0,r.jsx)(n.p,{children:"Runs a bridge using the bridge.txt provided in a bridge gem. Variables can also be passed into to override VARIABLE defaults."}),"\n",(0,r.jsx)(n.h2,{id:"example-bridge-gems",children:"Example Bridge Gems"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:["Serial Port: ",(0,r.jsx)(n.a,{href:"https://github.com/OpenC3/openc3-cosmos-bridge-serial",children:"openc3-cosmos-bridge-serial"})]}),"\n",(0,r.jsxs)(n.li,{children:["Host: ",(0,r.jsx)(n.a,{href:"https://github.com/OpenC3/openc3-cosmos-bridge-host",children:"openc3-cosmos-bridge-host"})]}),"\n",(0,r.jsxs)(n.li,{children:["HIDAPI: ",(0,r.jsx)(n.a,{href:"https://github.com/OpenC3/openc3-cosmos-bridge-hidapi",children:"openc3-cosmos-bridge-hidapi"})]}),"\n",(0,r.jsxs)(n.li,{children:["PS5 Dual Sense Controller: ",(0,r.jsx)(n.a,{href:"https://github.com/OpenC3/openc3-cosmos-bridge-dualsense",children:"openc3-cosmos-bridge-dualsense"})]}),"\n"]}),"\n",(0,r.jsx)(n.h2,{id:"note-on-serial-ports",children:"Note on Serial Ports"}),"\n",(0,r.jsx)(n.p,{children:"Serial ports can be used directly without bridges on Linux Docker installations."}),"\n",(0,r.jsx)(n.p,{children:"Add the following to the operator service in compose.yaml:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{children:' devices:\n - "/dev/ttyUSB0:/dev/ttyUSB0"\n'})}),"\n",(0,r.jsx)(n.p,{children:"Make sure the serial device has permissions for the user running Docker to access:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{children:"sudo chmod 666 /dev/ttyUSB0\n"})})]})}function u(e={}){let{wrapper:n}={...(0,s.a)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(c,{...e})}):c(e)}},2840:function(e,n,t){t.d(n,{Z:()=>a,a:()=>o});var i=t(2784);let r={},s=i.createContext(r);function o(e){let n=i.useContext(s);return i.useMemo(function(){return"function"==typeof e?e(n):{...n,...e}},[n,e])}function a(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:o(e.components),i.createElement(s.Provider,{value:n},e.children)}}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkdocs_openc3_com=self.webpackChunkdocs_openc3_com||[]).push([["7306"],{2840:function(e,n,o){o.d(n,{Z:()=>r,a:()=>c});var s=o(2784);let t={},i=s.createContext(t);function c(e){let n=s.useContext(i);return s.useMemo(function(){return"function"==typeof e?e(n):{...n,...e}},[n,e])}function r(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(t):e.components||t:c(e.components),s.createElement(i.Provider,{value:n},e.children)}},4804:function(e,n,o){o.r(n),o.d(n,{frontMatter:()=>c,default:()=>p,contentTitle:()=>r,assets:()=>l,toc:()=>a,metadata:()=>s});var s=JSON.parse('{"id":"development/developing","title":"Developing COSMOS","description":"Building COSMOS and developing the frontend and backend","source":"@site/docs/development/developing.md","sourceDirName":"development","slug":"/development/developing","permalink":"/tools/staticdocs/docs/development/developing","draft":false,"unlisted":false,"editUrl":"https://github.com/OpenC3/cosmos/tree/main/docs.openc3.com/docs/development/developing.md","tags":[],"version":"current","frontMatter":{"title":"Developing COSMOS","description":"Building COSMOS and developing the frontend and backend","sidebar_custom_props":{"myEmoji":"\uD83D\uDCBB"}},"sidebar":"defaultSidebar","previous":{"title":"Testing with Curl","permalink":"/tools/staticdocs/docs/development/curl"},"next":{"title":"JSON API","permalink":"/tools/staticdocs/docs/development/json-api"}}'),t=o(2322),i=o(2840);let c={title:"Developing COSMOS",description:"Building COSMOS and developing the frontend and backend",sidebar_custom_props:{myEmoji:"\uD83D\uDCBB"}},r="Developing COSMOS",l={},a=[{value:"Development Tools",id:"development-tools",level:2},{value:"Running a Frontend Application",id:"running-a-frontend-application",level:2},{value:"Running a Backend Server",id:"running-a-backend-server",level:2}];function d(e){let n={a:"a",admonition:"admonition",code:"code",h1:"h1",h2:"h2",header:"header",li:"li",ol:"ol",p:"p",pre:"pre",...(0,i.a)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.header,{children:(0,t.jsx)(n.h1,{id:"developing-cosmos",children:"Developing COSMOS"})}),"\n",(0,t.jsxs)(n.p,{children:["So you want to help develop COSMOS? All of our COSMOS Core code is on ",(0,t.jsx)(n.a,{href:"https://github.com/",children:"Github"})," so the first thing to do is get an ",(0,t.jsx)(n.a,{href:"https://github.com/join",children:"account"}),". Next ",(0,t.jsx)(n.a,{href:"https://docs.github.com/en/repositories/creating-and-managing-repositories/cloning-a-repository",children:"clone"})," the ",(0,t.jsx)(n.a,{href:"https://github.com/openc3/cosmos",children:"COSMOS"})," repository. We accept contributions from others as ",(0,t.jsx)(n.a,{href:"https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-pull-requests",children:"Pull Requests"}),"."]}),"\n",(0,t.jsx)(n.h2,{id:"development-tools",children:"Development Tools"}),"\n",(0,t.jsxs)(n.p,{children:["The OpenC3 team develops with the ",(0,t.jsx)(n.a,{href:"https://code.visualstudio.com/",children:"Visual Studio Code"})," editor and we highly recommend it. We also utilize a number of extensions including docker, kubernetes, gitlens, prettier, eslint, python, vetur, and ruby. We commit our ",(0,t.jsx)(n.code,{children:"openc3.code-workspace"})," configuration for VSCode to help configure these plugins. You also need ",(0,t.jsx)(n.a,{href:"https://www.docker.com/products/docker-desktop",children:"Docker Desktop"})," which you should already have as it is a requirement to run COSMOS. You'll also need ",(0,t.jsx)(n.a,{href:"https://nodejs.org/en/download/",children:"NodeJS"})," and ",(0,t.jsx)(n.a,{href:"https://yarnpkg.com/getting-started/install",children:"yarn"})," installed."]}),"\n",(0,t.jsx)(n.h1,{id:"building-cosmos",children:"Building COSMOS"}),"\n",(0,t.jsx)(n.p,{children:"Note: We primarily develop COSMOS in MacOS so the commands here will reference bash scripts but the same files exist in Windows as batch scripts."}),"\n",(0,t.jsxs)(n.p,{children:["Build COSMOS using the ",(0,t.jsx)(n.code,{children:"openc3.sh"})," script:"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"% ./openc3.sh build\n"})}),"\n",(0,t.jsx)(n.p,{children:"This will pull all the COSMOS container dependencies and build our local containers. Note: This can take a long time especially for your first build!"}),"\n",(0,t.jsx)(n.p,{children:"Once the build completes you can see the built images with the following command:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:'% docker image ls | grep "openc3"\nopenc3inc/openc3-cosmos-init latest 4cac7a3ea9d3 29 hours ago 446MB\nopenc3inc/openc3-cosmos-script-runner-api latest 4aacbaf49f7a 29 hours ago 431MB\nopenc3inc/openc3-cosmos-cmd-tlm-api latest 9a8806bd4be3 3 days ago 432MB\nopenc3inc/openc3-operator latest 223e98129fe9 3 days ago 405MB\nopenc3inc/openc3-base latest 98df5c0378c2 3 days ago 405MB\nopenc3inc/openc3-redis latest 5a3003a49199 8 days ago 111MB\nopenc3inc/openc3-traefik latest ec13a8d16a2f 8 days ago 104MB\nopenc3inc/openc3-minio latest 787f6e3fc0be 8 days ago 238MB\nopenc3inc/openc3-node latest b3ee86d3620a 8 days ago 372MB\nopenc3inc/openc3-ruby latest aa158bbb9539 8 days ago 326MB\n'})}),"\n",(0,t.jsxs)(n.admonition,{title:"Offline Building",type:"info",children:[(0,t.jsxs)(n.p,{children:["If you're building in a offline environment or want to use a private Rubygems, NPM or APK server (e.g. Nexus), you can update the following environment variables: RUBYGEMS_URL, NPM_URL, APK_URL, and more in the ",(0,t.jsx)(n.a,{href:"https://github.com/openc3/cosmos/blob/main/.env",children:".env"})," file. Example values:"]}),(0,t.jsxs)(n.p,{children:["ALPINE_VERSION=3.19",(0,t.jsx)("br",{}),"\nALPINE_BUILD=7",(0,t.jsx)("br",{}),"\nRUBYGEMS_URL=",(0,t.jsx)(n.a,{href:"https://rubygems.org",children:"https://rubygems.org"}),(0,t.jsx)("br",{}),"\nNPM_URL=",(0,t.jsx)(n.a,{href:"https://registry.npmjs.org",children:"https://registry.npmjs.org"}),(0,t.jsx)("br",{}),"\nAPK_URL=",(0,t.jsx)(n.a,{href:"http://dl-cdn.alpinelinux.org",children:"http://dl-cdn.alpinelinux.org"}),(0,t.jsx)("br",{})]})]}),"\n",(0,t.jsx)(n.h1,{id:"running-cosmos",children:"Running COSMOS"}),"\n",(0,t.jsxs)(n.p,{children:["Running COSMOS in development mode enables localhost access to internal API ports as well as sets ",(0,t.jsx)(n.code,{children:"RAILS_ENV=development"})," in the cmd-tlm-api and script-runner-api Rails servers. To run in development mode:"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"% ./openc3.sh run\n"})}),"\n",(0,t.jsx)(n.p,{children:"You can now see the running containers (I removed CONTAINER ID, CREATED and STATUS to save space):"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:'% docker ps\nIMAGE COMMAND PORTS NAMES\nopenc3/openc3-cmd-tlm-api:latest "/sbin/tini -- rails\u2026" 127.0.0.1:2901->2901/tcp cosmos-openc3-cmd-tlm-api-1\nopenc3/openc3-script-runner-api:latest "/sbin/tini -- rails\u2026" 127.0.0.1:2902->2902/tcp cosmos-openc3-script-runner-api-1\nopenc3/openc3-traefik:latest "/entrypoint.sh trae\u2026" 0.0.0.0:2900->80/tcp cosmos-openc3-traefik-1\nopenc3/openc3-operator:latest "/sbin/tini -- ruby \u2026" cosmos-openc3-operator-1\nopenc3/openc3-minio:latest "/usr/bin/docker-ent\u2026" 127.0.0.1:9000->9000/tcp cosmos-openc3-minio-1\nopenc3/openc3-redis:latest "docker-entrypoint.s\u2026" 127.0.0.1:6379->6379/tcp cosmos-openc3-redis-1\n'})}),"\n",(0,t.jsx)(n.p,{children:"If you go to localhost:2900 you should see COSMOS up and running!"}),"\n",(0,t.jsx)(n.h2,{id:"running-a-frontend-application",children:"Running a Frontend Application"}),"\n",(0,t.jsx)(n.p,{children:"So now that you have COSMOS up and running how do you develop an individual COSMOS application?"}),"\n",(0,t.jsxs)(n.ol,{children:["\n",(0,t.jsx)(n.li,{children:"Bootstrap the frontend with yarn"}),"\n"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"openc3-init/plugins % yarn\nopenc3-init/plugins % yarn build:common\n"})}),"\n",(0,t.jsxs)(n.ol,{children:["\n",(0,t.jsx)(n.li,{children:"Serve a local COSMOS application (CmdTlmServer, ScriptRunner, etc)"}),"\n"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"openc3-init % cd plugins/packages/openc3-tool-scriptrunner\nopenc3-tool-scriptrunner % yarn serve\nbuilt in 128722ms\n"})}),"\n",(0,t.jsxs)(n.ol,{children:["\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsxs)(n.p,{children:["Set the ",(0,t.jsx)(n.a,{href:"https://single-spa.js.org/",children:"single SPA"})," override for the application"]}),"\n",(0,t.jsxs)(n.p,{children:["Visit localhost:2900 and Right-click 'Inspect'",(0,t.jsx)("br",{}),"\nIn the console paste:"]}),"\n"]}),"\n"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-javascript",children:'localStorage.setItem("devtools", true);\n'})}),"\n",(0,t.jsxs)(n.p,{children:["Refresh and you should see ",(0,t.jsx)(n.code,{children:"{...}"})," in the bottom right",(0,t.jsx)("br",{}),"\nClick the Default button next to the application (@openc3/tool-scriptrunner)",(0,t.jsx)("br",{}),"\nPaste in the development path which is dependent on the port returned by the local yarn serve and the tool name (scriptrunner)"]}),"\n",(0,t.jsx)(n.p,{children:(0,t.jsx)(n.a,{href:"http://localhost:2914/tools/scriptrunner/main.js",children:"http://localhost:2914/tools/scriptrunner/main.js"})}),"\n",(0,t.jsxs)(n.ol,{children:["\n",(0,t.jsxs)(n.li,{children:["Refresh the page and you should see your local copy of the application (Script Runner in this example). If you dynamically add code (like ",(0,t.jsx)(n.code,{children:"console.log"}),") the yarn window should re-compile and the browser should refresh displaying your new code. It is highly recommended to get familiar with your browser's ",(0,t.jsx)(n.a,{href:"https://developer.chrome.com/docs/devtools/overview/",children:"development tools"})," if you plan to do frontend development."]}),"\n"]}),"\n",(0,t.jsx)(n.h2,{id:"running-a-backend-server",children:"Running a Backend Server"}),"\n",(0,t.jsx)(n.p,{children:"If the code you want to develop is the cmd-tlm-api or script-runner-api backend servers there are several steps to enable access to a development copy."}),"\n",(0,t.jsxs)(n.ol,{children:["\n",(0,t.jsx)(n.li,{children:"Run a development version of traefik. COSMOS uses traefik to direct API requests to the correct locations."}),"\n"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"% cd openc3-traefik\nopenc3-traefik % docker ps\n# Look for the container with name including traefik\nopenc3-traefik % docker stop cosmos-openc3-traefik-1\nopenc3-traefik % docker build --build-arg TRAEFIK_CONFIG=traefik-dev.yaml -t openc3-traefik-dev .\nopenc3-traefik % docker run --network=openc3-cosmos-network -p 2900:2900 -it --rm openc3-traefik-dev\n"})}),"\n",(0,t.jsxs)(n.ol,{children:["\n",(0,t.jsx)(n.li,{children:"Run a local copy of the cmd-tlm-api or script-runner-api"}),"\n"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"% cd openc3-cosmos-cmd-tlm-api\nopenc3-cosmos-cmd-tlm-api % docker ps\n# Look for the container with name including cmd-tlm-api\nopenc3-cosmos-cmd-tlm-api % docker stop cosmos-openc3-cosmos-cmd-tlm-api-1\n# Run the following on Windows:\nopenc3-cosmos-cmd-tlm-api> dev_server.bat\n# In Linux, set all the environment variables in the .env file, but override REDIS to be local\nopenc3-cosmos-cmd-tlm-api % set -a; source ../.env; set +a\nopenc3-cosmos-cmd-tlm-api % export OPENC3_REDIS_HOSTNAME=127.0.0.1\nopenc3-cosmos-cmd-tlm-api % export OPENC3_REDIS_EPHEMERAL_HOSTNAME=127.0.0.1\nopenc3-cosmos-cmd-tlm-api % bundle install\nopenc3-cosmos-cmd-tlm-api % bundle exec rails s\n"})}),"\n",(0,t.jsxs)(n.ol,{children:["\n",(0,t.jsxs)(n.li,{children:["Once the ",(0,t.jsx)(n.code,{children:"bundle exec rails s"})," command returns you should see API requests coming from interactions in the frontend code. If you add code (like Ruby debugging statements) to the cmd-tlm-api code you need to stop the server (CTRL-C) and restart it to see the effect."]}),"\n"]})]})}function p(e={}){let{wrapper:n}={...(0,i.a)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(d,{...e})}):d(e)}}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkdocs_openc3_com=self.webpackChunkdocs_openc3_com||[]).push([["1536"],{8138:function(t){t.exports=JSON.parse('{"categoryGeneratedIndex":{"title":"Meta","slug":"/meta","permalink":"/tools/staticdocs/docs/meta","sidebar":"defaultSidebar","navigation":{"previous":{"title":"Testing COSMOS","permalink":"/tools/staticdocs/docs/development/testing"},"next":{"title":"Contributing","permalink":"/tools/staticdocs/docs/meta/contributing"}}}}')}}]);
1
+ "use strict";(self.webpackChunkdocs_openc3_com=self.webpackChunkdocs_openc3_com||[]).push([["1536"],{6128:function(t){t.exports=JSON.parse('{"categoryGeneratedIndex":{"title":"Meta","slug":"/meta","permalink":"/tools/staticdocs/docs/meta","sidebar":"defaultSidebar","navigation":{"previous":{"title":"Testing COSMOS","permalink":"/tools/staticdocs/docs/development/testing"},"next":{"title":"Contributing","permalink":"/tools/staticdocs/docs/meta/contributing"}}}}')}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkdocs_openc3_com=self.webpackChunkdocs_openc3_com||[]).push([["4986"],{1041:function(e,t,n){n.d(t,{Z:()=>s});let s=n.p+"assets/images/history-04aebef1a0fdaaacc5042e5b835f850b48ea04f4fe50271d9bb57803b442d6cd.png"},1454:function(e,t,n){n.d(t,{Z:()=>s});let s=n.p+"assets/images/inst_collect-ef36e8a1e97fde625cde7a9c300c3db61aca30140f5431f089ce6a3e5da9d7f4.png"},146:function(e,t,n){n.d(t,{Z:()=>s});let s=n.p+"assets/images/collect_states-5418d5b4cb901577f2cbdeccceb254dd2e5b81b1f2c975fb15b5fc679cf23dbf.png"},2840:function(e,t,n){n.d(t,{Z:()=>o,a:()=>i});var s=n(2784);let a={},d=s.createContext(a);function i(e){let t=s.useContext(d);return s.useMemo(function(){return"function"==typeof e?e(t):{...t,...e}},[t,e])}function o(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(a):e.components||a:i(e.components),s.createElement(d.Provider,{value:t},e.children)}},3848:function(e,t,n){n.r(t),n.d(t,{frontMatter:()=>i,default:()=>m,contentTitle:()=>o,assets:()=>c,toc:()=>r,metadata:()=>s});var s=JSON.parse('{"id":"tools/cmd-sender","title":"Command Sender","description":"Send individual commands","source":"@site/docs/tools/cmd-sender.md","sourceDirName":"tools","slug":"/tools/cmd-sender","permalink":"/tools/staticdocs/docs/tools/cmd-sender","draft":false,"unlisted":false,"editUrl":"https://github.com/OpenC3/cosmos/tree/main/docs.openc3.com/docs/tools/cmd-sender.md","tags":[],"version":"current","frontMatter":{"title":"Command Sender","description":"Send individual commands","sidebar_custom_props":{"myEmoji":"\uD83D\uDEE0\uFE0F"}},"sidebar":"defaultSidebar","previous":{"title":"Calendar (Enterprise)","permalink":"/tools/staticdocs/docs/tools/calendar"},"next":{"title":"Command and Telemetry Server","permalink":"/tools/staticdocs/docs/tools/cmd-tlm-server"}}'),a=n(2322),d=n(2840);let i={title:"Command Sender",description:"Send individual commands",sidebar_custom_props:{myEmoji:"\uD83D\uDEE0\uFE0F"}},o=void 0,c={},r=[{value:"Introduction",id:"introduction",level:2},{value:"Command Sender Menus",id:"command-sender-menus",level:2},{value:"Mode Menu Items",id:"mode-menu-items",level:3},{value:"Sending Commands",id:"sending-commands",level:2},{value:"Hazardous Commands",id:"hazardous-commands",level:3}];function l(e){let t={a:"a",h2:"h2",h3:"h3",img:"img",li:"li",p:"p",ul:"ul",...(0,d.a)(),...e.components};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(t.h2,{id:"introduction",children:"Introduction"}),"\n",(0,a.jsx)(t.p,{children:"Command Sender provides the ability to send any command defined by COSMOS. Commands are selected using the Target and Packet drop down fields which populate the command parameter (if any). A command history is stored which is also editable. Commands in the command history can be re-executed by pressing Enter. Related telemetry or screens are displayed in the bottom right next to the command history."}),"\n",(0,a.jsx)(t.p,{children:(0,a.jsx)(t.img,{alt:"Command Sender",src:n(6011).Z+"",width:"2578",height:"1436"})}),"\n",(0,a.jsx)(t.h2,{id:"command-sender-menus",children:"Command Sender Menus"}),"\n",(0,a.jsx)(t.h3,{id:"mode-menu-items",children:"Mode Menu Items"}),"\n",(0,a.jsx)("img",{src:n(8579).Z,alt:"Mode Menu",style:{float:"left","margin-right":"50px",height:"120px"}}),"\n",(0,a.jsxs)(t.ul,{children:["\n",(0,a.jsx)(t.li,{children:"Ignores parameter range checking"}),"\n",(0,a.jsx)(t.li,{children:"Displays parameter state values in hex"}),"\n",(0,a.jsx)(t.li,{children:"Shows ignored parameters"}),"\n",(0,a.jsx)(t.li,{children:"Disables all parameter conversions"}),"\n"]}),"\n",(0,a.jsx)(t.h2,{id:"sending-commands",children:"Sending Commands"}),"\n",(0,a.jsx)(t.p,{children:"Select a command by first selecting the target from the Select Target drop down. Changing the target automatically updates the Select Packet options to only display commands from that target. If the command has parameters a table is generated with all the parameters."}),"\n",(0,a.jsx)(t.p,{children:(0,a.jsx)(t.img,{alt:"INST COLLECT",src:n(1454).Z+"",width:"2576",height:"1446"})}),"\n",(0,a.jsx)(t.p,{children:"Clicking on a parameter with States (like TYPE in the above example) brings up a drop down to select a state. Selecting a state populates the value field next to it. Sending a command updates the Status text and the Command History."}),"\n",(0,a.jsx)(t.p,{children:(0,a.jsx)(t.img,{alt:"States",src:n(146).Z+"",width:"2576",height:"1446"})}),"\n",(0,a.jsx)(t.p,{children:"You can directly edit the Command History to change a parameter value. Pressing Enter on the line will then execute the command. If the command has changed a new line will be entered in the Command History. Pressing Enter several times on the same line updates the Status text with the number of commands sent (3 in the next example)."}),"\n",(0,a.jsx)(t.p,{children:(0,a.jsx)(t.img,{alt:"History",src:n(1041).Z+"",width:"2576",height:"1446"})}),"\n",(0,a.jsx)(t.h3,{id:"hazardous-commands",children:"Hazardous Commands"}),"\n",(0,a.jsxs)(t.p,{children:["Sending ",(0,a.jsx)(t.a,{href:"/tools/staticdocs/docs/configuration/command#hazardous",children:"hazardous"})," commands will prompt the user whether to send the command."]}),"\n",(0,a.jsx)(t.p,{children:(0,a.jsx)(t.img,{alt:"INST CLEAR",src:n(6872).Z+"",width:"2576",height:"1512"})}),"\n",(0,a.jsxs)(t.p,{children:["Commands can also have hazardous ",(0,a.jsx)(t.a,{href:"/tools/staticdocs/docs/configuration/command#state",children:"states"})," (INST COLLECT with TYPE SPECIAL) which also prompt the user. In this example, we've also checked all the menu options to show ignored parameters, display state values in hex (see SPECIAL, 0x1), disabled range checking (DURATION 1000), and disabled parameter conversions."]}),"\n",(0,a.jsx)(t.p,{children:(0,a.jsx)(t.img,{alt:"INST COLLECT Hazardous",src:n(8331).Z+"",width:"2632",height:"2016"})}),"\n",(0,a.jsxs)(t.p,{children:["Selecting Yes will send the command and update the history with all the parameters shown. Note that when writing Scripts all parameters are optional unless explicitly marked ",(0,a.jsx)(t.a,{href:"/tools/staticdocs/docs/configuration/command#required",children:"required"}),"."]})]})}function m(e={}){let{wrapper:t}={...(0,d.a)(),...e.components};return t?(0,a.jsx)(t,{...e,children:(0,a.jsx)(l,{...e})}):l(e)}},6011:function(e,t,n){n.d(t,{Z:()=>s});let s=n.p+"assets/images/command_sender-83cf2e2343133c2883c405abd0b322f6d3d4a095c6ee800158a04c8eefe474ed.png"},6872:function(e,t,n){n.d(t,{Z:()=>s});let s=n.p+"assets/images/inst_clear-48f37464d774363be4a5c1d30a48d4bc7803cb806a15d80dcd3741d7a9a37811.png"},8331:function(e,t,n){n.d(t,{Z:()=>s});let s=n.p+"assets/images/inst_collect_hazardous-02857bda2b5e7e821d3f42d3301962ede2bb4379c469a9d62f4a0e686336f0c4.png"},8579:function(e,t,n){n.d(t,{Z:()=>s});let s=n.p+"assets/images/mode_menu-04b9187b57a09ed12481a2699a86c7504fdc1c822579b4f762865ea90cb52dd3.png"}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkdocs_openc3_com=self.webpackChunkdocs_openc3_com||[]).push([["2415"],{2840:function(t,o,e){e.d(o,{Z:()=>r,a:()=>i});var n=e(2784);let s={},a=n.createContext(s);function i(t){let o=n.useContext(a);return n.useMemo(function(){return"function"==typeof t?t(o):{...o,...t}},[o,t])}function r(t){let o;return o=t.disableParentContext?"function"==typeof t.components?t.components(s):t.components||s:i(t.components),n.createElement(a.Provider,{value:o},t.children)}},2897:function(t,o,e){e.r(o),e.d(o,{frontMatter:()=>i,default:()=>m,contentTitle:()=>r,assets:()=>c,toc:()=>d,metadata:()=>n});var n=JSON.parse('{"id":"tools/handbooks","title":"Handbooks","description":"Format the command and telemetry definition into a webpage","source":"@site/docs/tools/handbooks.md","sourceDirName":"tools","slug":"/tools/handbooks","permalink":"/tools/staticdocs/docs/tools/handbooks","draft":false,"unlisted":false,"editUrl":"https://github.com/OpenC3/cosmos/tree/main/docs.openc3.com/docs/tools/handbooks.md","tags":[],"version":"current","frontMatter":{"title":"Handbooks","description":"Format the command and telemetry definition into a webpage","sidebar_custom_props":{"myEmoji":"\uD83D\uDEE0\uFE0F"}},"sidebar":"defaultSidebar","previous":{"title":"Data Viewer","permalink":"/tools/staticdocs/docs/tools/data-viewer"},"next":{"title":"Limits Monitor","permalink":"/tools/staticdocs/docs/tools/limits-monitor"}}'),s=e(2322),a=e(2840);let i={title:"Handbooks",description:"Format the command and telemetry definition into a webpage",sidebar_custom_props:{myEmoji:"\uD83D\uDEE0\uFE0F"}},r=void 0,c={},d=[{value:"Introduction",id:"introduction",level:2}];function l(t){let o={a:"a",h2:"h2",img:"img",p:"p",...(0,a.a)(),...t.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(o.h2,{id:"introduction",children:"Introduction"}),"\n",(0,s.jsxs)(o.p,{children:["Handbooks formats the COSMOS ",(0,s.jsx)(o.a,{href:"/tools/staticdocs/docs/configuration/command",children:"command"})," and ",(0,s.jsx)(o.a,{href:"/tools/staticdocs/docs/configuration/telemetry",children:"telemetry"})," definitions into a nicely formatted webpage that can be exported to a PDF."]}),"\n",(0,s.jsx)(o.p,{children:(0,s.jsx)(o.img,{alt:"Handbooks",src:e(6208).Z+"",width:"1270",height:"710"})}),"\n",(0,s.jsx)(o.p,{children:"You can select the targets you want to display and the number of columns to display on the page. You can then use the browser to Print the page. Most browsers have the capability to Save as PDF rather than print to save the resulting page as PDF."})]})}function m(t={}){let{wrapper:o}={...(0,a.a)(),...t.components};return o?(0,s.jsx)(o,{...t,children:(0,s.jsx)(l,{...t})}):l(t)}},6208:function(t,o,e){e.d(o,{Z:()=>n});let n=e.p+"assets/images/handbooks-948da6f5aad7a4175441235f2aac82668f9233c60412e412439b2e2af0bd1a45.png"}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkdocs_openc3_com=self.webpackChunkdocs_openc3_com||[]).push([["4706"],{2840:function(e,t,s){s.d(t,{Z:()=>d,a:()=>l});var n=s(2784);let r={},i=n.createContext(r);function l(e){let t=n.useContext(i);return n.useMemo(function(){return"function"==typeof e?e(t):{...t,...e}},[t,e])}function d(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:l(e.components),n.createElement(i.Provider,{value:t},e.children)}},7045:function(e,t,s){s.r(t),s.d(t,{frontMatter:()=>l,default:()=>a,contentTitle:()=>d,assets:()=>o,toc:()=>c,metadata:()=>n});var n=JSON.parse('{"id":"guides/performance","title":"Performance","description":"Hardware requirements like memory and CPU","source":"@site/docs/guides/performance.md","sourceDirName":"guides","slug":"/guides/performance","permalink":"/tools/staticdocs/docs/guides/performance","draft":false,"unlisted":false,"editUrl":"https://github.com/OpenC3/cosmos/tree/main/docs.openc3.com/docs/guides/performance.md","tags":[],"version":"current","frontMatter":{"title":"Performance","description":"Hardware requirements like memory and CPU","sidebar_custom_props":{"myEmoji":"\uD83D\uDCCA"}},"sidebar":"defaultSidebar","previous":{"title":"Monitoring","permalink":"/tools/staticdocs/docs/guides/monitoring"},"next":{"title":"Raspberry Pi","permalink":"/tools/staticdocs/docs/guides/raspberrypi"}}'),r=s(2322),i=s(2840);let l={title:"Performance",description:"Hardware requirements like memory and CPU",sidebar_custom_props:{myEmoji:"\uD83D\uDCCA"}},d="COSMOS Hardware Requirements",o={},c=[{value:"Memory",id:"memory",level:2},{value:"CPU",id:"cpu",level:2},{value:"Performance Comparison",id:"performance-comparison",level:2}];function h(e){let t={a:"a",code:"code",h1:"h1",h2:"h2",header:"header",li:"li",ol:"ol",p:"p",pre:"pre",section:"section",sup:"sup",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,i.a)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(t.p,{children:["The COSMOS architecture was created with scalability in mind. Our goal is to support an unlimited number of connections and use cloud technologies to scale. Only ",(0,r.jsx)(t.a,{href:"https://openc3.com/enterprise",children:"COSMOS Enterprise"})," supports Kubernetes and the various cloud platforms which allow this level of scalability. While true scalability is only achieved in COSMOS Enterprise, both Core and Enterprise have various levels of observability and configuration settings which can affect performance."]}),"\n",(0,r.jsx)(t.header,{children:(0,r.jsx)(t.h1,{id:"cosmos-hardware-requirements",children:"COSMOS Hardware Requirements"})}),"\n",(0,r.jsx)(t.h2,{id:"memory",children:"Memory"}),"\n",(0,r.jsx)(t.p,{children:"COSMOS can run on a Raspberry Pi up to a Kubernetes cluster in the cloud. On all platforms the key performance factor is the number and complexity of the targets and their defined packets. Targets can vary from simple targets taking 100 MB of RAM to complex targets taking 400 MB. The COSMOS Core containers require about 800 MB of RAM. A good rule of thumb is to average about 300 MB of RAM for targets. As an example data point, the COSMOS Demo has 4 targets, two complex (INST & INST2) and two relatively simple (EXAMPLE & TEMPLATED), and requires 800 MB of RAM (on top of the 800 MB of base container RAM)."}),"\n",(0,r.jsxs)(t.ul,{children:["\n",(0,r.jsx)(t.li,{children:"Base RAM MB Calculator = 800 + (num targets) * 300"}),"\n"]}),"\n",(0,r.jsxs)(t.p,{children:["In addition, the Redis streams contain the last 10 min of both raw and decommutated data from all targets. Thus you must wait ~15min to truly see what the high water memory mark will be. In the COSMOS Demo the INST & INST2 targets are fairly simple with four 1Hz packet of ~15 items and one 10Hz packet with 20 items. This only causes 50 MiB of redis RAM usage according to ",(0,r.jsx)(t.code,{children:"docker stats"}),". Installing the COSMOS ",(0,r.jsx)(t.a,{href:"https://github.com/OpenC3/openc3-cosmos-load-sim",children:"LoadSim"})," with 10 packets with 1000 items each at 10Hz pushed the redis memory usage to about 350 MiB."]}),"\n",(0,r.jsx)(t.h2,{id:"cpu",children:"CPU"}),"\n",(0,r.jsx)(t.p,{children:"Another consideration is the CPU performance. In COSMOS Core, by default COSMOS spawns off 2 microservices per target. One combines packet logging and decommutation of the data and the other performs data reduction. In COSMOS Enterprise on Kubernetes, each process becomes an independent container that is deployed on the cluster allowing horizontal scaling."}),"\n",(0,r.jsxs)(t.p,{children:["The COSMOS command and telemetry API and script running API servers should have a dedicated core while targets can generally share cores. It's hard to provide a general rule of thumb with the wide variety of architectures, clock speeds, and core counts. The best practice is to install COSMOS with the expected load and do some monitoring with ",(0,r.jsx)(t.code,{children:"htop"})," to visualize the load on the various cores. Any time a single core gets overloaded (100%) this is a concern and system slowdown can occur."]}),"\n",(0,r.jsx)(t.h2,{id:"performance-comparison",children:"Performance Comparison"}),"\n",(0,r.jsxs)(t.p,{children:["Performance characterization was performed in Azure on a Standard D4s v5 (4 vcpus, 16 GiB memory) chosen to allow virtualization per ",(0,r.jsx)(t.a,{href:"https://docs.docker.com/desktop/vm-vdi/#turn-on-nested-virtualization-on-microsoft-hyper-v",children:"Docker"}),". COSMOS ",(0,r.jsx)(t.a,{href:"https://github.com/OpenC3/cosmos-enterprise/releases/tag/v5.9.1",children:"5.9.1"})," Enterprise was installed on both Windows 11 Pro ",(0,r.jsx)(t.sup,{children:(0,r.jsx)(t.a,{href:"#user-content-fn-1",id:"user-content-fnref-1","data-footnote-ref":!0,"aria-describedby":"footnote-label",children:"1"})})," and Ubuntu 22. Note: Enterprise was not utilizing Kubernetes, just Docker. Testing involved starting the COSMOS Demo, connecting all targets (EXAMPLE, INST, INST2, TEMPLATED), opening the following TlmViewer screens (ADCS, ARRAY, BLOCK, COMMANDING, HS, LATEST, LIMITS, OTHER, PARAMS, SIMPLE, TABS) and creating two TlmGrapher graphs consisting of INST HEALTH_STATUS TEMP[1-4] and INST ADCS POS[X,Y,Z] and INST ADCS VEL[X,Y,Z]. This was allowed to run for 1hr and results were collected using ",(0,r.jsx)(t.code,{children:"htop"}),":"]}),"\n",(0,r.jsxs)(t.table,{children:[(0,r.jsx)(t.thead,{children:(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.th,{style:{textAlign:"left"},children:"Platform"}),(0,r.jsx)(t.th,{style:{textAlign:"left"},children:"Core CPU %"}),(0,r.jsx)(t.th,{style:{textAlign:"left"},children:"RAM"})]})}),(0,r.jsxs)(t.tbody,{children:[(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"Windows 11 Pro"}),(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"12% 12% 10% 10%"}),(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"3.9G / 7.7G"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"Headless Ubuntu 22"}),(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"7% 7% 8% 6%"}),(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"3.2G / 15.6G"})]})]})]}),"\n",(0,r.jsxs)(t.ul,{children:["\n",(0,r.jsxs)(t.li,{children:["Windows was only allocated 8 GB of RAM due to the ",(0,r.jsx)(t.a,{href:"https://learn.microsoft.com/en-us/windows/wsl/wsl-config#configuration-setting-for-wslconfig",children:".wslconfig"})," settings."]}),"\n",(0,r.jsx)(t.li,{children:"Since Ubuntu was running headless, the screens and graphs were brought up on another machine."}),"\n"]}),"\n",(0,r.jsxs)(t.p,{children:[(0,r.jsx)(t.code,{children:"docker stats"})," was also run to show individual container cpu and memory usage:"]}),"\n",(0,r.jsxs)(t.table,{children:[(0,r.jsx)(t.thead,{children:(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.th,{style:{textAlign:"left"},children:"NAME"}),(0,r.jsx)(t.th,{style:{textAlign:"left"},children:"Windows CPU %"}),(0,r.jsx)(t.th,{children:"Ubuntu CPU %"}),(0,r.jsx)(t.th,{style:{textAlign:"left"},children:"Windows MEM"}),(0,r.jsx)(t.th,{children:"Ubuntu MEM"})]})}),(0,r.jsxs)(t.tbody,{children:[(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"cosmos-enterprise-project-openc3-traefik-1"}),(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"4.16%"}),(0,r.jsx)(t.td,{children:"1.32%"}),(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"43.54MiB"}),(0,r.jsx)(t.td,{children:"51.38MiB"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"cosmos-enterprise-project-openc3-cosmos-cmd-tlm-api-1"}),(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"10.16%"}),(0,r.jsx)(t.td,{children:"6.14%"}),(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"401.6MiB"}),(0,r.jsx)(t.td,{children:"392MiB"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"cosmos-enterprise-project-openc3-keycloak-1"}),(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"0.17%"}),(0,r.jsx)(t.td,{children:"0.13%"}),(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"476.8MiB"}),(0,r.jsx)(t.td,{children:"476.8MiB"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"cosmos-enterprise-project-openc3-operator-1"}),(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"21.27%"}),(0,r.jsx)(t.td,{children:"13.91%"}),(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"1.214GiB"}),(0,r.jsx)(t.td,{children:"1.207GiB"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"cosmos-enterprise-project-openc3-cosmos-script-runner-api-1"}),(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"0.01%"}),(0,r.jsx)(t.td,{children:"0.01%"}),(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"127.4MiB"}),(0,r.jsx)(t.td,{children:"117.1MiB"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"cosmos-enterprise-project-openc3-metrics-1"}),(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"0.01%"}),(0,r.jsx)(t.td,{children:"0.00%"}),(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"105.2MiB"}),(0,r.jsx)(t.td,{children:"83.87MiB"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"cosmos-enterprise-project-openc3-redis-ephemeral-1"}),(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"4.05%"}),(0,r.jsx)(t.td,{children:"1.89%"}),(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"46.22MiB"}),(0,r.jsx)(t.td,{children:"69.84MiB"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"cosmos-enterprise-project-openc3-redis-1"}),(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"1.56%"}),(0,r.jsx)(t.td,{children:"0.72%"}),(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"12.82MiB"}),(0,r.jsx)(t.td,{children:"9.484MiB"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"cosmos-enterprise-project-openc3-minio-1"}),(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"0.01%"}),(0,r.jsx)(t.td,{children:"0.00%"}),(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"152.9MiB"}),(0,r.jsx)(t.td,{children:"169.8MiB"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"cosmos-enterprise-project-openc3-postgresql-1"}),(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"0.00%"}),(0,r.jsx)(t.td,{children:"0.39%"}),(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"37.33MiB"}),(0,r.jsx)(t.td,{children:"41.02MiB"})]})]})]}),"\n",(0,r.jsxs)(t.ul,{children:["\n",(0,r.jsx)(t.li,{children:"memory profiles are similar between the two platforms"}),"\n",(0,r.jsx)(t.li,{children:"redis-ephemeral isn't using much memory on the Core Demo with its small packets"}),"\n"]}),"\n",(0,r.jsxs)(t.p,{children:["At this point the COSMOS ",(0,r.jsx)(t.a,{href:"https://github.com/OpenC3/openc3-cosmos-load-sim",children:"LoadSim"})," was installed with default settings which creates 10 packets with 1000 items each at 10Hz (110kB/s). After a 1 hr soak, htop now indicated:"]}),"\n",(0,r.jsxs)(t.table,{children:[(0,r.jsx)(t.thead,{children:(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.th,{style:{textAlign:"left"},children:"Platform"}),(0,r.jsx)(t.th,{style:{textAlign:"left"},children:"Core CPU %"}),(0,r.jsx)(t.th,{style:{textAlign:"left"},children:"RAM"})]})}),(0,r.jsxs)(t.tbody,{children:[(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"Windows 11 Pro"}),(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"40% 35% 39% 42%"}),(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"4.64G / 7.7G"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"Headless Ubuntu 22"}),(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"17% 20% 16% 18%"}),(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"3.74G / 15.6G"})]})]})]}),"\n",(0,r.jsx)(t.p,{children:"The larger packets and data rate of the LoadSim target caused both platforms to dramatically increase CPU utilization but the Linux machine stays quite performant."}),"\n",(0,r.jsxs)(t.p,{children:[(0,r.jsx)(t.code,{children:"docker stats"})," was also run to show individual container cpu and memory usage:"]}),"\n",(0,r.jsxs)(t.table,{children:[(0,r.jsx)(t.thead,{children:(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.th,{style:{textAlign:"left"},children:"NAME"}),(0,r.jsx)(t.th,{style:{textAlign:"left"},children:"Windows CPU %"}),(0,r.jsx)(t.th,{children:"Ubuntu CPU %"}),(0,r.jsx)(t.th,{style:{textAlign:"left"},children:"Windows MEM"}),(0,r.jsx)(t.th,{children:"Ubuntu MEM"})]})}),(0,r.jsxs)(t.tbody,{children:[(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"cosmos-enterprise-project-openc3-traefik-1"}),(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"4.09%"}),(0,r.jsx)(t.td,{children:"0.01%"}),(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"44.3MiB"}),(0,r.jsx)(t.td,{children:"0.34MiB"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"cosmos-enterprise-project-openc3-cosmos-cmd-tlm-api-1"}),(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"17.78%"}),(0,r.jsx)(t.td,{children:"6.18%"}),(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"407.9MiB"}),(0,r.jsx)(t.td,{children:"405.8MiB"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"cosmos-enterprise-project-openc3-keycloak-1"}),(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"0.20%"}),(0,r.jsx)(t.td,{children:"0.12%"}),(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"480.2MiB"}),(0,r.jsx)(t.td,{children:"481.5MiB"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"cosmos-enterprise-project-openc3-operator-1"}),(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"221.15%"}),(0,r.jsx)(t.td,{children:"66.72%"}),(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"1.6GiB"}),(0,r.jsx)(t.td,{children:"1.512GiB"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"cosmos-enterprise-project-openc3-cosmos-script-runner-api-1"}),(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"0.01%"}),(0,r.jsx)(t.td,{children:"0.01%"}),(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"136.6MiB"}),(0,r.jsx)(t.td,{children:"127.5MiB"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"cosmos-enterprise-project-openc3-metrics-1"}),(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"0.01%"}),(0,r.jsx)(t.td,{children:"0.01%"}),(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"106.3MiB"}),(0,r.jsx)(t.td,{children:"84.87MiB"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"cosmos-enterprise-project-openc3-redis-ephemeral-1"}),(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"19.63%"}),(0,r.jsx)(t.td,{children:"3.91%"}),(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"333.8MiB"}),(0,r.jsx)(t.td,{children:"370.8MiB"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"cosmos-enterprise-project-openc3-redis-1"}),(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"7.42%"}),(0,r.jsx)(t.td,{children:"1.49%"}),(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"15.87MiB"}),(0,r.jsx)(t.td,{children:"11.81MiB"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"cosmos-enterprise-project-openc3-minio-1"}),(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"0.10%"}),(0,r.jsx)(t.td,{children:"0.02%"}),(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"167.8MiB"}),(0,r.jsx)(t.td,{children:"179.2MiB"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"cosmos-enterprise-project-openc3-postgresql-1"}),(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"0.00%"}),(0,r.jsx)(t.td,{children:"0.00%"}),(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"35.4MiB"}),(0,r.jsx)(t.td,{children:"42.93MiB"})]})]})]}),"\n",(0,r.jsxs)(t.ul,{children:["\n",(0,r.jsx)(t.li,{children:"memory profiles are similar between the two platforms"}),"\n",(0,r.jsx)(t.li,{children:"redis-ephemeral is now using much more RAM as it is storing the large LoadSim packets"}),"\n",(0,r.jsx)(t.li,{children:"Windows is using much more CPU power running the operator, cmd-tlm, and redis"}),"\n"]}),"\n",(0,r.jsx)(t.h1,{id:"conclusions",children:"Conclusions"}),"\n",(0,r.jsxs)(t.p,{children:["While it is easy to run COSMOS on any Docker platform, increasing the number and complexity of the targets requires choosing the correct hardware. Sizing can be approximated but the best solution is to install representative targets and use ",(0,r.jsx)(t.code,{children:"docker stats"})," and ",(0,r.jsx)(t.code,{children:"htop"})," to judge the CPU and memory pressure on the given hardware."]}),"\n",(0,r.jsxs)(t.p,{children:[(0,r.jsx)(t.a,{href:"https://openc3.com/enterprise",children:"COSMOS Enterprise"})," on Kubernetes helps to eliminate the hardware sizing issue by scaling the cluster to meet the needs of the system. Check out ",(0,r.jsx)(t.a,{href:"https://openc3.com/news/scaling",children:"this recent talk"})," Ryan gave at GSAW showing how we scaled to over 160 satellites on a 4 node kubernetes cluster on EKS."]}),"\n",(0,r.jsx)("hr",{}),"\n","\n",(0,r.jsxs)(t.section,{"data-footnotes":!0,className:"footnotes",children:[(0,r.jsx)(t.h2,{className:"sr-only",id:"footnote-label",children:"Footnotes"}),"\n",(0,r.jsxs)(t.ol,{children:["\n",(0,r.jsxs)(t.li,{id:"user-content-fn-1",children:["\n",(0,r.jsx)(t.p,{children:"Full specs of the Windows Platform:"}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{children:"Windows 11 Pro\nDocker Desktop 4.22.0\nWSL version: 1.2.5.0\nKernel version: 5.15.90.1\nWSLg version: 1.0.51\nMSRDC version: 1.2.3770\nDirect3D version: 1.608.2-61064218\nDXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp\nWindows version: 10.0.22621.2134\n"})}),"\n",(0,r.jsx)(t.a,{href:"#user-content-fnref-1","data-footnote-backref":"","aria-label":"Back to reference 1",className:"data-footnote-backref",children:"\u21A9"}),"\n"]}),"\n"]}),"\n"]})]})}function a(e={}){let{wrapper:t}={...(0,i.a)(),...e.components};return t?(0,r.jsx)(t,{...e,children:(0,r.jsx)(h,{...e})}):h(e)}}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkdocs_openc3_com=self.webpackChunkdocs_openc3_com||[]).push([["9997"],{2941:function(e,t,n){n.d(t,{Z:()=>l});var a=n(2322);n(2784);var i=n(7239),o=n(6117),r=n(4126);function l(e){let{className:t}=e;return(0,a.jsx)("main",{className:(0,i.Z)("container margin-vert--xl",t),children:(0,a.jsx)("div",{className:"row",children:(0,a.jsxs)("div",{className:"col col--6 col--offset-3",children:[(0,a.jsx)(r.Z,{as:"h1",className:"hero__title",children:(0,a.jsx)(o.Z,{id:"theme.NotFound.title",description:"The title of the 404 page",children:"Page Not Found"})}),(0,a.jsx)("p",{children:(0,a.jsx)(o.Z,{id:"theme.NotFound.p1",description:"The first paragraph of the 404 page",children:"We could not find what you were looking for."})}),(0,a.jsx)("p",{children:(0,a.jsx)(o.Z,{id:"theme.NotFound.p2",description:"The 2nd paragraph of the 404 page",children:"Please contact the owner of the site that linked you to the original URL and let them know their link is broken."})})]})})})}},5420:function(e,t,n){n.r(t),n.d(t,{default:()=>ei});var a=n(2322),i=n(2784),o=n(7239),r=n(1904),l=n(6460),s=n(606),d=n(5322),c=n(6117),u=n(4813),m=n(520);let b={backToTopButton:"backToTopButton_z1FD",backToTopButtonShow:"backToTopButtonShow_w1wE"};function h(){let{shown:e,scrollToTop:t}=function(e){let{threshold:t}=e,[n,a]=(0,i.useState)(!1),o=(0,i.useRef)(!1),{startScroll:r,cancelScroll:l}=(0,u.Ct)();return(0,u.RF)((e,n)=>{let{scrollY:i}=e,r=n?.scrollY;r&&(o.current?o.current=!1:i>=r?(l(),a(!1)):i<t?a(!1):i+window.innerHeight<document.documentElement.scrollHeight&&a(!0))}),(0,m.S)(e=>{e.location.hash&&(o.current=!0,a(!1))}),{shown:n,scrollToTop:()=>r(0)}}({threshold:300});return(0,a.jsx)("button",{"aria-label":(0,c.I)({id:"theme.BackToTopButton.buttonAriaLabel",message:"Scroll back to top",description:"The ARIA label for the back to top button"}),className:(0,o.Z)("clean-btn",l.k.common.backToTopButton,b.backToTopButton,e&&b.backToTopButtonShow),type:"button",onClick:t})}var p=n(188),x=n(7267),f=n(4755),j=n(6092),_=n(6741);function v(e){return(0,a.jsx)("svg",{width:"20",height:"20","aria-hidden":"true",...e,children:(0,a.jsxs)("g",{fill:"#7a7a7a",children:[(0,a.jsx)("path",{d:"M9.992 10.023c0 .2-.062.399-.172.547l-4.996 7.492a.982.982 0 01-.828.454H1c-.55 0-1-.453-1-1 0-.2.059-.403.168-.551l4.629-6.942L.168 3.078A.939.939 0 010 2.528c0-.548.45-.997 1-.997h2.996c.352 0 .649.18.828.45L9.82 9.472c.11.148.172.347.172.55zm0 0"}),(0,a.jsx)("path",{d:"M19.98 10.023c0 .2-.058.399-.168.547l-4.996 7.492a.987.987 0 01-.828.454h-3c-.547 0-.996-.453-.996-1 0-.2.059-.403.168-.551l4.625-6.942-4.625-6.945a.939.939 0 01-.168-.55 1 1 0 01.996-.997h3c.348 0 .649.18.828.45l4.996 7.492c.11.148.168.347.168.55zm0 0"})]})})}function g(e){let{onClick:t}=e;return(0,a.jsx)("button",{type:"button",title:(0,c.I)({id:"theme.docs.sidebar.collapseButtonTitle",message:"Collapse sidebar",description:"The title attribute for collapse button of doc sidebar"}),"aria-label":(0,c.I)({id:"theme.docs.sidebar.collapseButtonAriaLabel",message:"Collapse sidebar",description:"The title attribute for collapse button of doc sidebar"}),className:(0,o.Z)("button button--secondary button--outline","collapseSidebarButton_Ftvb"),onClick:t,children:(0,a.jsx)(v,{className:"collapseSidebarButtonIcon_c4WT"})})}var k=n(9770),C=n(3972);let S=Symbol("EmptyContext"),I=i.createContext(S);function N(e){let{children:t}=e,[n,o]=(0,i.useState)(null),r=(0,i.useMemo)(()=>({expandedItem:n,setExpandedItem:o}),[n]);return(0,a.jsx)(I.Provider,{value:r,children:t})}var T=n(8859),Z=n(3422),L=n(5819),y=n(9761);function w(e){let{collapsed:t,categoryLabel:n,onClick:i}=e;return(0,a.jsx)("button",{"aria-label":t?(0,c.I)({id:"theme.DocSidebarItem.expandCategoryAriaLabel",message:"Expand sidebar category '{label}'",description:"The ARIA label to expand the sidebar category"},{label:n}):(0,c.I)({id:"theme.DocSidebarItem.collapseCategoryAriaLabel",message:"Collapse sidebar category '{label}'",description:"The ARIA label to collapse the sidebar category"},{label:n}),"aria-expanded":!t,type:"button",className:"clean-btn menu__caret",onClick:i})}function A(e){let{item:t,onItemClick:n,activePath:r,level:d,index:c,...u}=e,{items:m,label:b,collapsible:h,className:p,href:x}=t,{docs:{sidebar:{autoCollapseCategories:f}}}=(0,j.L)(),_=function(e){let t=(0,y.Z)();return(0,i.useMemo)(()=>e.href&&!e.linkUnlisted?e.href:!t&&e.collapsible?(0,s.LM)(e):void 0,[e,t])}(t),v=(0,s._F)(t,r),g=(0,Z.Mg)(x,r),{collapsed:k,setCollapsed:N}=(0,T.u)({initialState:()=>!!h&&!v&&t.collapsed}),{expandedItem:A,setExpandedItem:B}=function(){let e=(0,i.useContext)(I);if(e===S)throw new C.i6("DocSidebarItemsExpandedStateProvider");return e}(),E=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:!k;B(e?null:c),N(e)};return!function(e){let{isActive:t,collapsed:n,updateCollapsed:a}=e,o=(0,C.D9)(t);(0,i.useEffect)(()=>{t&&!o&&n&&a(!1)},[t,o,n,a])}({isActive:v,collapsed:k,updateCollapsed:E}),(0,i.useEffect)(()=>{h&&null!=A&&A!==c&&f&&N(!0)},[h,A,c,N,f]),(0,a.jsxs)("li",{className:(0,o.Z)(l.k.docs.docSidebarItemCategory,l.k.docs.docSidebarItemCategoryLevel(d),"menu__list-item",{"menu__list-item--collapsed":k},p),children:[(0,a.jsxs)("div",{className:(0,o.Z)("menu__list-item-collapsible",{"menu__list-item-collapsible--active":g}),children:[(0,a.jsx)(L.Z,{className:(0,o.Z)("menu__link",{"menu__link--sublist":h,"menu__link--sublist-caret":!x&&h,"menu__link--active":v}),onClick:h?e=>{n?.(t),x?v?(e.preventDefault(),E()):E(!1):(e.preventDefault(),E())}:()=>{n?.(t)},"aria-current":g?"page":void 0,role:h&&!x?"button":void 0,"aria-expanded":h&&!x?!k:void 0,href:h?_??"#":_,...u,children:b}),x&&h&&(0,a.jsx)(w,{collapsed:k,categoryLabel:b,onClick:e=>{e.preventDefault(),E()}})]}),(0,a.jsx)(T.z,{lazy:!0,as:"ul",className:"menu__list",collapsed:k,children:(0,a.jsx)(D,{items:m,tabIndex:k?-1:0,onItemClick:n,activePath:r,level:d+1})})]})}var B=n(572),E=n(4878);let H={menuExternalLink:"menuExternalLink_xK2O"};function M(e){let{item:t,onItemClick:n,activePath:i,level:r,index:d,...c}=e,{href:u,label:m,className:b,autoAddBaseUrl:h}=t,p=(0,s._F)(t,i),x=(0,B.Z)(u);return(0,a.jsx)("li",{className:(0,o.Z)(l.k.docs.docSidebarItemLink,l.k.docs.docSidebarItemLinkLevel(r),"menu__list-item",b),children:(0,a.jsxs)(L.Z,{className:(0,o.Z)("menu__link",!x&&H.menuExternalLink,{"menu__link--active":p}),autoAddBaseUrl:h,"aria-current":p?"page":void 0,to:u,...x&&{onClick:n?()=>n(t):void 0},...c,children:[m,!x&&(0,a.jsx)(E.Z,{})]})},m)}let F={menuHtmlItem:"menuHtmlItem_anEq"};function R(e){let{item:t,level:n,index:i}=e,{value:r,defaultStyle:s,className:d}=t;return(0,a.jsx)("li",{className:(0,o.Z)(l.k.docs.docSidebarItemLink,l.k.docs.docSidebarItemLinkLevel(n),s&&[F.menuHtmlItem,"menu__list-item"],d),dangerouslySetInnerHTML:{__html:r}},i)}function W(e){let{item:t,...n}=e;switch(t.type){case"category":return(0,a.jsx)(A,{item:t,...n});case"html":return(0,a.jsx)(R,{item:t,...n});default:return(0,a.jsx)(M,{item:t,...n})}}let D=(0,i.memo)(function(e){let{items:t,...n}=e,i=(0,s.f)(t,n.activePath);return(0,a.jsx)(N,{children:i.map((e,t)=>(0,a.jsx)(W,{item:e,index:t,...n},t))})}),P={menu:"menu_qiME",menuWithAnnouncementBar:"menuWithAnnouncementBar_hRfJ"};function V(e){let{path:t,sidebar:n,className:r}=e,s=function(){let{isActive:e}=(0,k.n)(),[t,n]=(0,i.useState)(e);return(0,u.RF)(t=>{let{scrollY:a}=t;e&&n(0===a)},[e]),e&&t}();return(0,a.jsx)("nav",{"aria-label":(0,c.I)({id:"theme.docs.sidebar.navAriaLabel",message:"Docs sidebar",description:"The ARIA label for the sidebar navigation"}),className:(0,o.Z)("menu thin-scrollbar",P.menu,s&&P.menuWithAnnouncementBar,r),children:(0,a.jsx)("ul",{className:(0,o.Z)(l.k.docs.docSidebarMenu,"menu__list"),children:(0,a.jsx)(D,{items:n,activePath:t,level:1})})})}let z={sidebar:"sidebar_vJCc",sidebarWithHideableNavbar:"sidebarWithHideableNavbar_Fo4g",sidebarHidden:"sidebarHidden_vBKa",sidebarLogo:"sidebarLogo_nlll"},K=i.memo(function(e){let{path:t,sidebar:n,onCollapse:i,isHidden:r}=e,{navbar:{hideOnScroll:l},docs:{sidebar:{hideable:s}}}=(0,j.L)();return(0,a.jsxs)("div",{className:(0,o.Z)(z.sidebar,l&&z.sidebarWithHideableNavbar,r&&z.sidebarHidden),children:[l&&(0,a.jsx)(_.Z,{tabIndex:-1,className:z.sidebarLogo}),(0,a.jsx)(V,{path:t,sidebar:n}),s&&(0,a.jsx)(g,{onClick:i})]})});var q=n(1593),U=n(4969);let Y=e=>{let{sidebar:t,path:n}=e,i=(0,U.e)();return(0,a.jsx)("ul",{className:(0,o.Z)(l.k.docs.docSidebarMenu,"menu__list"),children:(0,a.jsx)(D,{items:t,activePath:n,onItemClick:e=>{"category"===e.type&&e.href&&i.toggle(),"link"===e.type&&i.toggle()},level:1})})},J=i.memo(function(e){return(0,a.jsx)(q.Zo,{component:Y,props:e})});function X(e){let t=(0,f.i)();return(0,a.jsxs)(a.Fragment,{children:[("desktop"===t||"ssr"===t)&&(0,a.jsx)(K,{...e}),"mobile"===t&&(0,a.jsx)(J,{...e})]})}function G(e){let{toggleSidebar:t}=e;return(0,a.jsx)("div",{className:"expandButton_SZY_",title:(0,c.I)({id:"theme.docs.sidebar.expandButtonTitle",message:"Expand sidebar",description:"The ARIA label and title attribute for expand button of doc sidebar"}),"aria-label":(0,c.I)({id:"theme.docs.sidebar.expandButtonAriaLabel",message:"Expand sidebar",description:"The ARIA label and title attribute for expand button of doc sidebar"}),tabIndex:0,role:"button",onKeyDown:t,onClick:t,children:(0,a.jsx)(v,{className:"expandButtonIcon_CMLm"})})}let O={docSidebarContainer:"docSidebarContainer_e5ai",docSidebarContainerHidden:"docSidebarContainerHidden_vqQo",sidebarViewport:"sidebarViewport_N8x0"};function Q(e){let{children:t}=e,n=(0,d.V)();return(0,a.jsx)(i.Fragment,{children:t},n?.name??"noSidebar")}function $(e){let{sidebar:t,hiddenSidebarContainer:n,setHiddenSidebarContainer:r}=e,{pathname:s}=(0,x.TH)(),[d,c]=(0,i.useState)(!1),u=(0,i.useCallback)(()=>{d&&c(!1),!d&&(0,p.n)()&&c(!0),r(e=>!e)},[r,d]);return(0,a.jsx)("aside",{className:(0,o.Z)(l.k.docs.docSidebarContainer,O.docSidebarContainer,n&&O.docSidebarContainerHidden),onTransitionEnd:e=>{e.currentTarget.classList.contains(O.docSidebarContainer)&&n&&c(!0)},children:(0,a.jsx)(Q,{children:(0,a.jsxs)("div",{className:(0,o.Z)(O.sidebarViewport,d&&O.sidebarViewportHidden),children:[(0,a.jsx)(X,{sidebar:t,path:s,onCollapse:u,isHidden:d}),d&&(0,a.jsx)(G,{toggleSidebar:u})]})})})}let ee={docMainContainer:"docMainContainer_namt",docMainContainerEnhanced:"docMainContainerEnhanced_sRjM",docItemWrapperEnhanced:"docItemWrapperEnhanced_TX_6"};function et(e){let{hiddenSidebarContainer:t,children:n}=e,i=(0,d.V)();return(0,a.jsx)("main",{className:(0,o.Z)(ee.docMainContainer,(t||!i)&&ee.docMainContainerEnhanced),children:(0,a.jsx)("div",{className:(0,o.Z)("container padding-top--md padding-bottom--lg",ee.docItemWrapper,t&&ee.docItemWrapperEnhanced),children:n})})}function en(e){let{children:t}=e,n=(0,d.V)(),[o,r]=(0,i.useState)(!1);return(0,a.jsxs)("div",{className:"docsWrapper_XLvK",children:[(0,a.jsx)(h,{}),(0,a.jsxs)("div",{className:"docRoot_HciC",children:[n&&(0,a.jsx)($,{sidebar:n.items,hiddenSidebarContainer:o,setHiddenSidebarContainer:r}),(0,a.jsx)(et,{hiddenSidebarContainer:o,children:t})]})]})}var ea=n(2941);function ei(e){let t=(0,s.SN)(e);if(!t)return(0,a.jsx)(ea.Z,{});let{docElement:n,sidebarName:i,sidebarItems:c}=t;return(0,a.jsx)(r.FG,{className:(0,o.Z)(l.k.page.docsDocPage),children:(0,a.jsx)(d.b,{name:i,items:c,children:(0,a.jsx)(en,{children:n})})})}}}]);