openc3-cosmos-tool-docs 5.17.1 → 5.18.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (160) hide show
  1. checksums.yaml +4 -4
  2. data/tools/staticdocs/404.html +4 -4
  3. data/tools/staticdocs/assets/css/{styles.8a0f1b26.css → styles.80ddca08.css} +1 -1
  4. data/tools/staticdocs/assets/js/{019369f3.34291acc.js → 019369f3.727d87f1.js} +1 -1
  5. data/tools/staticdocs/assets/js/{058ffc22.8d9049f4.js → 058ffc22.f2d69d72.js} +1 -1
  6. data/tools/staticdocs/assets/js/{0686a885.dde7b18b.js → 0686a885.83641127.js} +1 -1
  7. data/tools/staticdocs/assets/js/078dbab0.945c9f59.js +1 -0
  8. data/tools/staticdocs/assets/js/{0f5d161c.ca02c5b2.js → 0f5d161c.e26d88b8.js} +1 -1
  9. data/tools/staticdocs/assets/js/{0ff569c9.ad025a56.js → 0ff569c9.aa4daee5.js} +1 -1
  10. data/tools/staticdocs/assets/js/{103cc3be.6b6cd0fa.js → 103cc3be.78f97eb1.js} +1 -1
  11. data/tools/staticdocs/assets/js/{13196248.9e7794e3.js → 13196248.ca2e8950.js} +1 -1
  12. data/tools/staticdocs/assets/js/{13c1b4e4.cec67b9c.js → 13c1b4e4.22a0b1d4.js} +1 -1
  13. data/tools/staticdocs/assets/js/{2047b354.bdd2586a.js → 2047b354.25d11993.js} +1 -1
  14. data/tools/staticdocs/assets/js/22b3ac48.7a5ea984.js +1 -0
  15. data/tools/staticdocs/assets/js/{2bb7bf90.043455de.js → 2bb7bf90.fa05d998.js} +1 -1
  16. data/tools/staticdocs/assets/js/3917.1ec7d126.js +1 -0
  17. data/tools/staticdocs/assets/js/{3dd7ef3b.c7c1d93f.js → 3dd7ef3b.d55880a8.js} +1 -1
  18. data/tools/staticdocs/assets/js/{40365d27.7eb3f7b1.js → 40365d27.4b4b2ccd.js} +1 -1
  19. data/tools/staticdocs/assets/js/{411898ad.d5f62a27.js → 411898ad.1d6a609d.js} +1 -1
  20. data/tools/staticdocs/assets/js/{42170351.69a8ed02.js → 42170351.c68b85e1.js} +1 -1
  21. data/tools/staticdocs/assets/js/43652efd.d1e1add3.js +1 -0
  22. data/tools/staticdocs/assets/js/53ca7c5b.c3111020.js +1 -0
  23. data/tools/staticdocs/assets/js/{54d0d530.28ba5be7.js → 54d0d530.d3f9a4ac.js} +1 -1
  24. data/tools/staticdocs/assets/js/{5b233ba7.9c621552.js → 5b233ba7.6fdd6b6c.js} +1 -1
  25. data/tools/staticdocs/assets/js/{5bc719f6.7fa17221.js → 5bc719f6.daa2a049.js} +1 -1
  26. data/tools/staticdocs/assets/js/{5c6ce5ec.5e6ca46b.js → 5c6ce5ec.61a9cae2.js} +1 -1
  27. data/tools/staticdocs/assets/js/5e3ed378.2bee863a.js +1 -0
  28. data/tools/staticdocs/assets/js/5fe211ef.a9f21277.js +1 -0
  29. data/tools/staticdocs/assets/js/6831b732.185eb427.js +1 -0
  30. data/tools/staticdocs/assets/js/{696b4199.0335bd94.js → 696b4199.a5ae3d65.js} +1 -1
  31. data/tools/staticdocs/assets/js/{6b210247.2cbd59e6.js → 6b210247.e96f3982.js} +1 -1
  32. data/tools/staticdocs/assets/js/{6b65133b.87dc7da6.js → 6b65133b.4e84b1c2.js} +1 -1
  33. data/tools/staticdocs/assets/js/6f92e431.65aa0240.js +1 -0
  34. data/tools/staticdocs/assets/js/72c6d8a8.98daa27a.js +1 -0
  35. data/tools/staticdocs/assets/js/{75e64983.932fbc0e.js → 75e64983.6ef0928b.js} +1 -1
  36. data/tools/staticdocs/assets/js/{867640d5.ffd4cf4c.js → 867640d5.48133ad5.js} +1 -1
  37. data/tools/staticdocs/assets/js/{89e76475.97389cc5.js → 89e76475.13ce283b.js} +1 -1
  38. data/tools/staticdocs/assets/js/{8f7843ee.d1ffd5ee.js → 8f7843ee.7a68246a.js} +1 -1
  39. data/tools/staticdocs/assets/js/9424f0b3.61c6bd97.js +1 -0
  40. data/tools/staticdocs/assets/js/{97535711.fc45ced1.js → 97535711.5311ddd9.js} +1 -1
  41. data/tools/staticdocs/assets/js/{99581c43.8e571df8.js → 99581c43.527aab44.js} +1 -1
  42. data/tools/staticdocs/assets/js/{9fb6059a.42881e94.js → 9fb6059a.a5107afb.js} +1 -1
  43. data/tools/staticdocs/assets/js/{a507c363.04b98d2c.js → a507c363.d2cc5d72.js} +1 -1
  44. data/tools/staticdocs/assets/js/{a677c089.b2928bac.js → a677c089.abc52ace.js} +1 -1
  45. data/tools/staticdocs/assets/js/{a9987364.8f065f19.js → a9987364.5ef1644f.js} +1 -1
  46. data/tools/staticdocs/assets/js/{aa6b6c1b.d78e5212.js → aa6b6c1b.c51c044d.js} +1 -1
  47. data/tools/staticdocs/assets/js/{b4596165.6806d46b.js → b4596165.daa24b72.js} +1 -1
  48. data/tools/staticdocs/assets/js/b6d70f94.4923c793.js +1 -0
  49. data/tools/staticdocs/assets/js/b9f60ba6.e55cd937.js +1 -0
  50. data/tools/staticdocs/assets/js/{bd0034eb.b4e3d6c1.js → bd0034eb.6691ccc4.js} +1 -1
  51. data/tools/staticdocs/assets/js/c24eae19.251e0038.js +1 -0
  52. data/tools/staticdocs/assets/js/{cb8c3f08.a0ef4b5f.js → cb8c3f08.b82ad06f.js} +1 -1
  53. data/tools/staticdocs/assets/js/cd879be4.f956406f.js +1 -0
  54. data/tools/staticdocs/assets/js/d1b923aa.d6bafb72.js +1 -0
  55. data/tools/staticdocs/assets/js/{d1bfc316.2d823a88.js → d1bfc316.0a5ff560.js} +1 -1
  56. data/tools/staticdocs/assets/js/{d24bf9b6.53eca5e8.js → d24bf9b6.6c422113.js} +1 -1
  57. data/tools/staticdocs/assets/js/{d57a4b5d.aaa48891.js → d57a4b5d.8f23a506.js} +1 -1
  58. data/tools/staticdocs/assets/js/{d5d77c37.be6fe7b6.js → d5d77c37.70fdbbc6.js} +1 -1
  59. data/tools/staticdocs/assets/js/{d8ca4191.c6632184.js → d8ca4191.2349d796.js} +1 -1
  60. data/tools/staticdocs/assets/js/{d9b92eba.c6a2c7e5.js → d9b92eba.8f82360d.js} +1 -1
  61. data/tools/staticdocs/assets/js/{db8fa1d0.f078bc02.js → db8fa1d0.8f1b2c9f.js} +1 -1
  62. data/tools/staticdocs/assets/js/{dc5f7beb.a4afe7cd.js → dc5f7beb.e3a82d1e.js} +1 -1
  63. data/tools/staticdocs/assets/js/{e501b0d1.d108a8a9.js → e501b0d1.0b407477.js} +1 -1
  64. data/tools/staticdocs/assets/js/ebec1ccb.9bea92b0.js +1 -0
  65. data/tools/staticdocs/assets/js/f15615f1.5c433923.js +1 -0
  66. data/tools/staticdocs/assets/js/{fd886806.a21dd400.js → fd886806.4a41fa80.js} +1 -1
  67. data/tools/staticdocs/assets/js/main.b5390098.js +2 -0
  68. data/tools/staticdocs/assets/js/runtime~main.12d1e41d.js +1 -0
  69. data/tools/staticdocs/docs/configuration/command.html +96 -180
  70. data/tools/staticdocs/docs/configuration/format.html +25 -54
  71. data/tools/staticdocs/docs/configuration/interfaces.html +25 -80
  72. data/tools/staticdocs/docs/configuration/plugins.html +138 -178
  73. data/tools/staticdocs/docs/configuration/protocols.html +91 -110
  74. data/tools/staticdocs/docs/configuration/ssl-tls.html +33 -104
  75. data/tools/staticdocs/docs/configuration/table.html +67 -125
  76. data/tools/staticdocs/docs/configuration/target.html +23 -31
  77. data/tools/staticdocs/docs/configuration/telemetry-screens.html +194 -455
  78. data/tools/staticdocs/docs/configuration/telemetry.html +104 -187
  79. data/tools/staticdocs/docs/configuration.html +4 -4
  80. data/tools/staticdocs/docs/development/curl.html +17 -126
  81. data/tools/staticdocs/docs/development/developing.html +29 -80
  82. data/tools/staticdocs/docs/development/host-install.html +10 -23
  83. data/tools/staticdocs/docs/development/json-api.html +20 -32
  84. data/tools/staticdocs/docs/development/log-structure.html +14 -14
  85. data/tools/staticdocs/docs/development/roadmap.html +15 -15
  86. data/tools/staticdocs/docs/development/streaming-api.html +11 -83
  87. data/tools/staticdocs/docs/development/testing.html +17 -26
  88. data/tools/staticdocs/docs/development.html +4 -4
  89. data/tools/staticdocs/docs/getting-started/generators.html +35 -109
  90. data/tools/staticdocs/docs/getting-started/gettingstarted.html +26 -74
  91. data/tools/staticdocs/docs/getting-started/installation.html +24 -35
  92. data/tools/staticdocs/docs/getting-started/key_concepts.html +35 -35
  93. data/tools/staticdocs/docs/getting-started/podman.html +26 -57
  94. data/tools/staticdocs/docs/getting-started/requirements.html +21 -21
  95. data/tools/staticdocs/docs/getting-started/upgrading.html +12 -17
  96. data/tools/staticdocs/docs/getting-started.html +4 -4
  97. data/tools/staticdocs/docs/guides/bridges.html +19 -63
  98. data/tools/staticdocs/docs/guides/cfs.html +44 -184
  99. data/tools/staticdocs/docs/guides/custom-widgets.html +20 -47
  100. data/tools/staticdocs/docs/guides/little-endian-bitfields.html +5 -14
  101. data/tools/staticdocs/docs/guides/local-mode.html +16 -21
  102. data/tools/staticdocs/docs/guides/logging.html +12 -12
  103. data/tools/staticdocs/docs/guides/monitoring.html +22 -137
  104. data/tools/staticdocs/docs/guides/performance.html +18 -27
  105. data/tools/staticdocs/docs/guides/raspberrypi.html +10 -23
  106. data/tools/staticdocs/docs/guides/script-writing.html +85 -391
  107. data/tools/staticdocs/docs/guides/scripting-api.html +482 -1353
  108. data/tools/staticdocs/docs/guides.html +4 -4
  109. data/tools/staticdocs/docs/meta/contributing.html +14 -19
  110. data/tools/staticdocs/docs/meta/licenses.html +13 -31
  111. data/tools/staticdocs/docs/meta/philosophy.html +4 -4
  112. data/tools/staticdocs/docs/meta/xtce.html +15 -17
  113. data/tools/staticdocs/docs/meta.html +4 -4
  114. data/tools/staticdocs/docs/privacy.html +20 -20
  115. data/tools/staticdocs/docs/tools/autonomic.html +22 -22
  116. data/tools/staticdocs/docs/tools/bucket-explorer.html +13 -13
  117. data/tools/staticdocs/docs/tools/calendar.html +21 -21
  118. data/tools/staticdocs/docs/tools/cmd-sender.html +16 -16
  119. data/tools/staticdocs/docs/tools/cmd-tlm-server.html +23 -23
  120. data/tools/staticdocs/docs/tools/data-extractor.html +27 -27
  121. data/tools/staticdocs/docs/tools/data-viewer.html +13 -13
  122. data/tools/staticdocs/docs/tools/handbooks.html +7 -7
  123. data/tools/staticdocs/docs/tools/limits-monitor.html +19 -19
  124. data/tools/staticdocs/docs/tools/packet-viewer.html +16 -16
  125. data/tools/staticdocs/docs/tools/script-runner.html +36 -75
  126. data/tools/staticdocs/docs/tools/table-manager.html +13 -48
  127. data/tools/staticdocs/docs/tools/tlm-grapher.html +23 -23
  128. data/tools/staticdocs/docs/tools/tlm-viewer.html +18 -18
  129. data/tools/staticdocs/docs/tools.html +4 -4
  130. data/tools/staticdocs/docs.html +14 -14
  131. data/tools/staticdocs/index.html +4 -4
  132. data/tools/staticdocs/lunr-index-1724101625047.json +1 -0
  133. data/tools/staticdocs/lunr-index.json +1 -1
  134. data/tools/staticdocs/markdown-page.html +5 -5
  135. data/tools/staticdocs/search-doc-1724101625047.json +1 -0
  136. data/tools/staticdocs/search-doc.json +1 -1
  137. metadata +71 -71
  138. data/tools/staticdocs/assets/js/078dbab0.b275e04c.js +0 -1
  139. data/tools/staticdocs/assets/js/22b3ac48.0f4fbe9d.js +0 -1
  140. data/tools/staticdocs/assets/js/43652efd.be2c1d02.js +0 -1
  141. data/tools/staticdocs/assets/js/4650.292aca67.js +0 -1
  142. data/tools/staticdocs/assets/js/53ca7c5b.3f1245d5.js +0 -1
  143. data/tools/staticdocs/assets/js/5e3ed378.77db7b87.js +0 -1
  144. data/tools/staticdocs/assets/js/5fe211ef.71dc8326.js +0 -1
  145. data/tools/staticdocs/assets/js/6831b732.5714d508.js +0 -1
  146. data/tools/staticdocs/assets/js/6f92e431.300a9857.js +0 -1
  147. data/tools/staticdocs/assets/js/72c6d8a8.cfccace6.js +0 -1
  148. data/tools/staticdocs/assets/js/9424f0b3.29299bde.js +0 -1
  149. data/tools/staticdocs/assets/js/b6d70f94.f5514e8b.js +0 -1
  150. data/tools/staticdocs/assets/js/b9f60ba6.c3b3046d.js +0 -1
  151. data/tools/staticdocs/assets/js/c24eae19.6b084c7c.js +0 -1
  152. data/tools/staticdocs/assets/js/cd879be4.6f19050a.js +0 -1
  153. data/tools/staticdocs/assets/js/d1b923aa.3f3e186d.js +0 -1
  154. data/tools/staticdocs/assets/js/ebec1ccb.1ded1149.js +0 -1
  155. data/tools/staticdocs/assets/js/f15615f1.f9b655a6.js +0 -1
  156. data/tools/staticdocs/assets/js/main.c2e2b617.js +0 -2
  157. data/tools/staticdocs/assets/js/runtime~main.2bb31799.js +0 -1
  158. data/tools/staticdocs/lunr-index-1719505302032.json +0 -1
  159. data/tools/staticdocs/search-doc-1719505302032.json +0 -1
  160. /data/tools/staticdocs/assets/js/{main.c2e2b617.js.LICENSE.txt → main.b5390098.js.LICENSE.txt} +0 -0
@@ -2,165 +2,146 @@
2
2
  <html lang="en" dir="ltr" class="docs-wrapper plugin-docs plugin-id-default docs-version-current docs-doc-page docs-doc-id-configuration/protocols" data-has-hydrated="false">
3
3
  <head>
4
4
  <meta charset="UTF-8">
5
- <meta name="generator" content="Docusaurus v3.4.0">
6
- <title data-rh="true">Protocols | OpenC3 Docs</title><meta data-rh="true" name="viewport" content="width=device-width,initial-scale=1"><meta data-rh="true" name="twitter:card" content="summary_large_image"><meta data-rh="true" property="og:url" content="https://docs.openc3.com/tools/staticdocs/docs/configuration/protocols"><meta data-rh="true" property="og:locale" content="en"><meta data-rh="true" name="docusaurus_locale" content="en"><meta data-rh="true" name="docsearch:language" content="en"><meta data-rh="true" name="docusaurus_version" content="current"><meta data-rh="true" name="docusaurus_tag" content="docs-default-current"><meta data-rh="true" name="docsearch:version" content="current"><meta data-rh="true" name="docsearch:docusaurus_tag" content="docs-default-current"><meta data-rh="true" property="og:title" content="Protocols | OpenC3 Docs"><meta data-rh="true" name="description" content="Protocols process data on behalf of an 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."><meta data-rh="true" property="og:description" content="Protocols process data on behalf of an 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."><link data-rh="true" rel="icon" href="/tools/staticdocs/img/favicon.png"><link data-rh="true" rel="canonical" href="https://docs.openc3.com/tools/staticdocs/docs/configuration/protocols"><link data-rh="true" rel="alternate" href="https://docs.openc3.com/tools/staticdocs/docs/configuration/protocols" hreflang="en"><link data-rh="true" rel="alternate" href="https://docs.openc3.com/tools/staticdocs/docs/configuration/protocols" hreflang="x-default"><link rel="stylesheet" href="/tools/staticdocs/assets/css/styles.8a0f1b26.css">
7
- <script src="/tools/staticdocs/assets/js/runtime~main.2bb31799.js" defer="defer"></script>
8
- <script src="/tools/staticdocs/assets/js/main.c2e2b617.js" defer="defer"></script>
5
+ <meta name="generator" content="Docusaurus v3.5.2">
6
+ <title data-rh="true">Protocols | OpenC3 Docs</title><meta data-rh="true" name="viewport" content="width=device-width,initial-scale=1"><meta data-rh="true" name="twitter:card" content="summary_large_image"><meta data-rh="true" property="og:url" content="https://docs.openc3.com/tools/staticdocs/docs/configuration/protocols"><meta data-rh="true" property="og:locale" content="en"><meta data-rh="true" name="docusaurus_locale" content="en"><meta data-rh="true" name="docsearch:language" content="en"><meta data-rh="true" name="docusaurus_version" content="current"><meta data-rh="true" name="docusaurus_tag" content="docs-default-current"><meta data-rh="true" name="docsearch:version" content="current"><meta data-rh="true" name="docsearch:docusaurus_tag" content="docs-default-current"><meta data-rh="true" property="og:title" content="Protocols | OpenC3 Docs"><meta data-rh="true" name="description" content="Protocols process data on behalf of an 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."><meta data-rh="true" property="og:description" content="Protocols process data on behalf of an 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."><link data-rh="true" rel="icon" href="/tools/staticdocs/img/favicon.png"><link data-rh="true" rel="canonical" href="https://docs.openc3.com/tools/staticdocs/docs/configuration/protocols"><link data-rh="true" rel="alternate" href="https://docs.openc3.com/tools/staticdocs/docs/configuration/protocols" hreflang="en"><link data-rh="true" rel="alternate" href="https://docs.openc3.com/tools/staticdocs/docs/configuration/protocols" hreflang="x-default"><link rel="stylesheet" href="/tools/staticdocs/assets/css/styles.80ddca08.css">
7
+ <script src="/tools/staticdocs/assets/js/runtime~main.12d1e41d.js" defer="defer"></script>
8
+ <script src="/tools/staticdocs/assets/js/main.b5390098.js" defer="defer"></script>
9
9
  </head>
10
10
  <body class="navigation-with-keyboard">
11
11
  <script>!function(){function t(t){document.documentElement.setAttribute("data-theme",t)}var e=function(){try{return new URLSearchParams(window.location.search).get("docusaurus-theme")}catch(t){}}()||function(){try{return window.localStorage.getItem("theme")}catch(t){}}();t(null!==e?e:"dark")}(),function(){try{const n=new URLSearchParams(window.location.search).entries();for(var[t,e]of n)if(t.startsWith("docusaurus-data-")){var a=t.replace("docusaurus-data-","data-");document.documentElement.setAttribute(a,e)}}catch(t){}}()</script><div id="__docusaurus"><div role="region" aria-label="Skip to main content"><a class="skipToContent_G6ar" href="#__docusaurus_skipToContent_fallback">Skip to main content</a></div><nav aria-label="Main" class="navbar navbar--fixed-top"><div class="navbar__inner"><div class="navbar__items"><button aria-label="Toggle navigation bar" aria-expanded="false" class="navbar__toggle clean-btn" type="button"><svg width="30" height="30" viewBox="0 0 30 30" aria-hidden="true"><path stroke="currentColor" stroke-linecap="round" stroke-miterlimit="10" stroke-width="2" d="M4 7h22M4 15h22M4 23h22"></path></svg></button><a class="navbar__brand" href="/tools/staticdocs/"><div class="navbar__logo"><img src="/tools/staticdocs/img/logo.svg" alt="OpenC3 Logo" class="themedComponent_DHUr themedComponent--light_DIHH"><img src="/tools/staticdocs/img/logo.svg" alt="OpenC3 Logo" class="themedComponent_DHUr themedComponent--dark_Bv2M"></div><b class="navbar__title text--truncate">OpenC3 Docs</b></a><a aria-current="page" class="navbar__item navbar__link navbar__link--active" href="/tools/staticdocs/docs">Documentation</a><a href="https://openc3.com/enterprise/" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link">Enterprise</a></div><div class="navbar__items navbar__items--right"><div class="navbarSearchContainer_bmvg"><div class="navbar__search"><span aria-label="expand searchbar" role="button" class="search-icon" tabindex="0"></span><input id="search_input_react" type="search" placeholder="Loading..." aria-label="Search" class="navbar__search-input search-bar" disabled=""></div></div></div></div><div role="presentation" class="navbar-sidebar__backdrop"></div></nav><div id="__docusaurus_skipToContent_fallback" class="main-wrapper mainWrapper_UyTV"><div class="docsWrapper_XLvK"><button aria-label="Scroll back to top" class="clean-btn theme-back-to-top-button backToTopButton_z1FD" type="button"></button><div class="docRoot_HciC"><aside class="theme-doc-sidebar-container docSidebarContainer_e5ai"><div class="sidebarViewport_N8x0"><div class="sidebar_vJCc"><nav aria-label="Docs sidebar" class="menu thin-scrollbar menu_qiME"><ul class="theme-doc-sidebar-menu menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/tools/staticdocs/docs">Introduction</a></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" href="/tools/staticdocs/docs/getting-started">Getting Started</a><button aria-label="Expand sidebar category &#x27;Getting Started&#x27;" aria-expanded="false" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--active" href="/tools/staticdocs/docs/configuration">Configuration</a><button aria-label="Collapse sidebar category &#x27;Configuration&#x27;" aria-expanded="true" type="button" class="clean-btn menu__caret"></button></div><ul style="display:block;overflow:visible;height:auto" class="menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/tools/staticdocs/docs/configuration/format">File Format</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/tools/staticdocs/docs/configuration/plugins">Plugins</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/tools/staticdocs/docs/configuration/target">Targets</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/tools/staticdocs/docs/configuration/command">Commands</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/tools/staticdocs/docs/configuration/telemetry">Telemetry</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/tools/staticdocs/docs/configuration/interfaces">Interfaces</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link menu__link--active" aria-current="page" tabindex="0" href="/tools/staticdocs/docs/configuration/protocols">Protocols</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/tools/staticdocs/docs/configuration/table">Tables</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/tools/staticdocs/docs/configuration/telemetry-screens">Screens</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/tools/staticdocs/docs/configuration/ssl-tls">SSL-TLS</a></li></ul></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" href="/tools/staticdocs/docs/tools">Tools</a><button aria-label="Expand sidebar category &#x27;Tools&#x27;" aria-expanded="false" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" href="/tools/staticdocs/docs/guides">Guides</a><button aria-label="Expand sidebar category &#x27;Guides&#x27;" aria-expanded="false" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" href="/tools/staticdocs/docs/development">Development</a><button aria-label="Expand sidebar category &#x27;Development&#x27;" aria-expanded="false" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" href="/tools/staticdocs/docs/meta">Meta</a><button aria-label="Expand sidebar category &#x27;Meta&#x27;" aria-expanded="false" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/tools/staticdocs/docs/privacy">OpenC3, Inc. Privacy Policy</a></li></ul></nav></div></div></aside><main class="docMainContainer_namt"><div class="container padding-top--md padding-bottom--lg"><div class="row"><div class="col docItemCol_YAwJ"><div class="docItemContainer_Rv5Z"><article><nav class="theme-doc-breadcrumbs breadcrumbsContainer_zCmv" aria-label="Breadcrumbs"><ul class="breadcrumbs" itemscope="" itemtype="https://schema.org/BreadcrumbList"><li class="breadcrumbs__item"><a aria-label="Home page" class="breadcrumbs__link" href="/tools/staticdocs/"><svg viewBox="0 0 24 24" class="breadcrumbHomeIcon_JFrk"><path d="M10 19v-5h4v5c0 .55.45 1 1 1h3c.55 0 1-.45 1-1v-7h1.7c.46 0 .68-.57.33-.87L12.67 3.6c-.38-.34-.96-.34-1.34 0l-8.36 7.53c-.34.3-.13.87.33.87H5v7c0 .55.45 1 1 1h3c.55 0 1-.45 1-1z" fill="currentColor"></path></svg></a></li><li itemscope="" itemprop="itemListElement" itemtype="https://schema.org/ListItem" class="breadcrumbs__item"><a class="breadcrumbs__link" itemprop="item" href="/tools/staticdocs/docs/configuration"><span itemprop="name">Configuration</span></a><meta itemprop="position" content="1"></li><li itemscope="" itemprop="itemListElement" itemtype="https://schema.org/ListItem" class="breadcrumbs__item breadcrumbs__item--active"><span class="breadcrumbs__link" itemprop="name">Protocols</span><meta itemprop="position" content="2"></li></ul></nav><div class="tocCollapsible_O_Qc theme-doc-toc-mobile tocMobile_tjDr"><button type="button" class="clean-btn tocCollapsibleButton_htYj">On this page</button></div><div class="theme-doc-markdown markdown"><header><h1>Protocols</h1></header><p>Protocols process data on behalf of an 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.</p>
12
- <admonition title="Protocol Run Order" type="info"><p>Read protocols execute in the order specified (First specified runs first). Write protocols execute in the reverse order (Last specified executes first).</p></admonition>
12
+ <div class="theme-admonition theme-admonition-info admonition_IZjC alert alert--info"><div class="admonitionHeading_uVvU"><span class="admonitionIcon_HiR3"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path></svg></span>Protocol Run Order</div><div class="admonitionContent_bl22"><p>Read protocols execute in the order specified (First specified runs first). Write protocols execute in the reverse order (Last specified executes first).</p></div></div>
13
13
  <p>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.</p>
14
14
  <p>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.</p>
15
15
  <p>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).</p>
16
16
  <p>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.)</p>
17
17
  <p>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.</p>
18
- <h2 id="packet-delineation-protocols">Packet Delineation Protocols</h2>
18
+ <h2 class="anchor anchorWithStickyNavbar_fF9Z" id="packet-delineation-protocols">Packet Delineation Protocols<a href="#packet-delineation-protocols" class="hash-link" aria-label="Direct link to Packet Delineation Protocols" title="Direct link to Packet Delineation Protocols">​</a></h2>
19
19
  <p>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.</p>
20
20
  <p>Note that all protocols take a final parameter called &quot;Allow Empty Data&quot;. 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 <a href="/tools/staticdocs/docs/configuration/protocols#custom-protocols">Custom Protocols</a> documentation.</p>
21
- <h3 id="cobs-protocol">COBS Protocol</h3>
22
- <p>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 <a href="https://en.wikipedia.org/wiki/Consistent_Overhead_Byte_Stuffing">https://en.wikipedia.org/wiki/Consistent_Overhead_Byte_Stuffing</a> for more).</p>
23
- <h3 id="slip-protocol">SLIP Protocol</h3>
24
- <p>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 <a href="https://datatracker.ietf.org/doc/html/rfc1055">https://datatracker.ietf.org/doc/html/rfc1055</a> for more).</p>
21
+ <h3 class="anchor anchorWithStickyNavbar_fF9Z" id="cobs-protocol">COBS Protocol<a href="#cobs-protocol" class="hash-link" aria-label="Direct link to COBS Protocol" title="Direct link to COBS Protocol">​</a></h3>
22
+ <p>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 <a href="https://en.wikipedia.org/wiki/Consistent_Overhead_Byte_Stuffing" target="_blank" rel="noopener noreferrer">https://en.wikipedia.org/wiki/Consistent_Overhead_Byte_Stuffing</a> for more).</p>
23
+ <h3 class="anchor anchorWithStickyNavbar_fF9Z" id="slip-protocol">SLIP Protocol<a href="#slip-protocol" class="hash-link" aria-label="Direct link to SLIP Protocol" title="Direct link to SLIP Protocol">​</a></h3>
24
+ <p>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 <a href="https://datatracker.ietf.org/doc/html/rfc1055" target="_blank" rel="noopener noreferrer">https://datatracker.ietf.org/doc/html/rfc1055</a> for more).</p>
25
25
  <table><thead><tr><th>Parameter</th><th>Description</th><th>Required</th><th>Default</th></tr></thead><tbody><tr><td>Start Char</td><td>Character to place at the start of frames</td><td>No</td><td>nil (no character)</td></tr><tr><td>Read Strip Characters</td><td>Strip off start_char and end_char from reads</td><td>No</td><td>true</td></tr><tr><td>Read Enable Escaping</td><td>Whether to enable character escaping on reads</td><td>No</td><td>true</td></tr><tr><td>Write Enable Escaping</td><td>Whether to enable character escaping on writes</td><td>No</td><td>true</td></tr><tr><td>End Char</td><td>Character to place at the end of frames</td><td>No</td><td>0xC0</td></tr><tr><td>Esc Char</td><td>Escape character</td><td>No</td><td>0xDB</td></tr><tr><td>Escape End Char</td><td>Character to escape End character</td><td>No</td><td>0xDC</td></tr><tr><td>Escape Esc Char</td><td>Character to escape Esc character</td><td>No</td><td>0xDD</td></tr></tbody></table>
26
- <h3 id="burst-protocol">Burst Protocol</h3>
26
+ <h3 class="anchor anchorWithStickyNavbar_fF9Z" id="burst-protocol">Burst Protocol<a href="#burst-protocol" class="hash-link" aria-label="Direct link to Burst Protocol" title="Direct link to Burst Protocol">​</a></h3>
27
27
  <p>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.</p>
28
28
  <table><thead><tr><th>Parameter</th><th>Description</th><th>Required</th><th>Default</th></tr></thead><tbody><tr><td>Discard Leading Bytes</td><td>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.</td><td>No</td><td>0 (do not discard bytes)</td></tr><tr><td>Sync Pattern</td><td>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</td><td>No</td><td>nil (no sync pattern)</td></tr><tr><td>Fill Fields</td><td>Whether to fill in the sync pattern on outgoing packets</td><td>No</td><td>false</td></tr></tbody></table>
29
- <h3 id="fixed-protocol">Fixed Protocol</h3>
29
+ <h3 class="anchor anchorWithStickyNavbar_fF9Z" id="fixed-protocol">Fixed Protocol<a href="#fixed-protocol" class="hash-link" aria-label="Direct link to Fixed Protocol" title="Direct link to Fixed Protocol">​</a></h3>
30
30
  <p>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.</p>
31
31
  <table><thead><tr><th>Parameter</th><th>Description</th><th>Required</th><th>Default</th></tr></thead><tbody><tr><td>Minimum ID Size</td><td>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.</td><td>Yes</td><td></td></tr><tr><td>Discard Leading Bytes</td><td>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.</td><td>No</td><td>0 (do not discard bytes)</td></tr><tr><td>Sync Pattern</td><td>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.</td><td>No</td><td>nil (no sync pattern)</td></tr><tr><td>Telemetry</td><td>Whether the data is telemetry</td><td>No</td><td>true (false means command)</td></tr><tr><td>Fill Fields</td><td>Whether to fill in the sync pattern on outgoing packets</td><td>No</td><td>false</td></tr><tr><td>Unknown Raise</td><td>Whether to raise an exception for an unknown packet</td><td>No</td><td>false</td></tr></tbody></table>
32
- <h3 id="length-protocol">Length Protocol</h3>
32
+ <h3 class="anchor anchorWithStickyNavbar_fF9Z" id="length-protocol">Length Protocol<a href="#length-protocol" class="hash-link" aria-label="Direct link to Length Protocol" title="Direct link to Length Protocol">​</a></h3>
33
33
  <p>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.</p>
34
34
  <table><thead><tr><th>Parameter</th><th>Description</th><th>Required</th><th>Default</th></tr></thead><tbody><tr><td>Length Bit Offset</td><td>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).</td><td>No</td><td>0 bits</td></tr><tr><td>Length Bit Size</td><td>The size in bits of the length field</td><td>No</td><td>16 bits</td></tr><tr><td>Length Value Offset</td><td>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).</td><td>No</td><td>0</td></tr><tr><td>Bytes per Count</td><td>The number of bytes per each length field &#x27;count&#x27;. 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.</td><td>No</td><td>1 byte</td></tr><tr><td>Length Endianness</td><td>The endianness of the length field. Must be either &#x27;BIG_ENDIAN&#x27; or &#x27;LITTLE_ENDIAN&#x27;.</td><td>No</td><td>&#x27;BIG_ENDIAN&#x27;</td></tr><tr><td>Discard Leading Bytes</td><td>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.</td><td>No</td><td>0 (do not discard bytes)</td></tr><tr><td>Sync Pattern</td><td>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.</td><td>No</td><td>nil (no sync pattern)</td></tr><tr><td>Max Length</td><td>The maximum allowed value in the length field</td><td>No</td><td>nil (no maximum length)</td></tr><tr><td>Fill Length and Sync Pattern</td><td>Setting this flag to true causes the length field and sync pattern (if present) to be filled automatically on outgoing packets.</td><td>No</td><td>false</td></tr></tbody></table>
35
35
  <p>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:</p>
36
36
  <table><thead><tr><th>Sync (4 bytes)</th><th>Header (4 bytes)</th><th>Length (2 bytes)</th><th>Data (4 bytes)</th></tr></thead><tbody><tr><td>0x1ACFFC1D</td><td>0x0001CADB</td><td>0x0003</td><td>0xDEADBEEF</td></tr></tbody></table>
37
37
  <p>In this case the total length of the packet is 14 bytes: <strong>4 + 4 + 2 + 4 = 14</strong>. 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 (<strong>3 + 11 = 14</strong>).</p>
38
- <h3 id="terminated-protocol">Terminated Protocol</h3>
38
+ <h3 class="anchor anchorWithStickyNavbar_fF9Z" id="terminated-protocol">Terminated Protocol<a href="#terminated-protocol" class="hash-link" aria-label="Direct link to Terminated Protocol" title="Direct link to Terminated Protocol">​</a></h3>
39
39
  <p>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.</p>
40
40
  <table><thead><tr><th>Parameter</th><th>Description</th><th>Required</th><th>Default</th></tr></thead><tbody><tr><td>Write Termination Characters</td><td>The data to write after writing a command packet. Given as a hex string such as 0xABCD.</td><td>Yes</td><td></td></tr><tr><td>Read Termination Characters</td><td>The characters which delineate the end of a telemetry packet. Given as a hex string such as 0xABCD.</td><td>Yes</td><td></td></tr><tr><td>Strip Read Termination</td><td>Whether to remove the read termination characters before returning the telemetry packet</td><td>No</td><td>true</td></tr><tr><td>Discard Leading Bytes</td><td>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.</td><td>No</td><td>0 (do not discard bytes)</td></tr><tr><td>Sync Pattern</td><td>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.</td><td>No</td><td>nil (no sync pattern)</td></tr><tr><td>Fill Fields</td><td>Whether to fill in the sync pattern on outgoing packets</td><td>No</td><td>false</td></tr></tbody></table>
41
- <h3 id="template-protocol">Template Protocol</h3>
41
+ <h3 class="anchor anchorWithStickyNavbar_fF9Z" id="template-protocol">Template Protocol<a href="#template-protocol" class="hash-link" aria-label="Direct link to Template Protocol" title="Direct link to Template Protocol">​</a></h3>
42
42
  <p><strong>Deprecated</strong></p>
43
43
  <p>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.</p>
44
44
  <p>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 <code>&quot;&lt;EXAMPLE&gt;&quot;</code>. 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.</p>
45
45
  <table><thead><tr><th>Parameter</th><th>Description</th><th>Required</th><th>Default</th></tr></thead><tbody><tr><td>Write Termination Characters</td><td>The data to write after writing a command packet. Given as a hex string such as 0xABCD.</td><td>Yes</td><td></td></tr><tr><td>Read Termination Characters</td><td>The characters which delineate the end of a telemetry packet. Given as a hex string such as 0xABCD.</td><td>Yes</td><td></td></tr><tr><td>Ignore Lines</td><td>Number of response lines to ignore (completely drop)</td><td>No</td><td>0 lines</td></tr><tr><td>Initial Read Delay</td><td>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.</td><td>No</td><td>nil (no initial read)</td></tr><tr><td>Response Lines</td><td>The number of lines that make up expected responses</td><td>No</td><td>1 line</td></tr><tr><td>Strip Read Termination</td><td>Whether to remove the read termination characters before returning the telemetry packet</td><td>No</td><td>true</td></tr><tr><td>Discard Leading Bytes</td><td>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.</td><td>No</td><td>0 (do not discard bytes)</td></tr><tr><td>Sync Pattern</td><td>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.</td><td>No</td><td>nil (no sync pattern)</td></tr><tr><td>Fill Fields</td><td>Whether to fill in the sync pattern on outgoing packets</td><td>No</td><td>false</td></tr><tr><td>Response Timeout</td><td>Number of seconds to wait for a response before timing out</td><td>No</td><td>5.0</td></tr><tr><td>Response Polling Period</td><td>Number of seconds to wait between polling for a response</td><td>No</td><td>0.02</td></tr><tr><td>Raise Exceptions</td><td>Whether to raise exceptions when errors occur like timeouts or unexpected responses</td><td>No</td><td>false</td></tr></tbody></table>
46
- <h3 id="preidentified-protocol">Preidentified Protocol</h3>
46
+ <h3 class="anchor anchorWithStickyNavbar_fF9Z" id="preidentified-protocol">Preidentified Protocol<a href="#preidentified-protocol" class="hash-link" aria-label="Direct link to Preidentified Protocol" title="Direct link to Preidentified Protocol">​</a></h3>
47
47
  <p>The Preidentified Protocol delineates packets using a custom COSMOS header. This Protocol is created to allow tools to connect and receive the entire packet stream. It can also be used to chain COSMOS instances together although that should rarely be needed with the new web native implementation.</p>
48
48
  <table><thead><tr><th>Parameter</th><th>Description</th><th>Required</th><th>Default</th></tr></thead><tbody><tr><td>Sync Pattern</td><td>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.</td><td>No</td><td>nil (no sync pattern)</td></tr><tr><td>Max Length</td><td>The maximum allowed value in the length field</td><td>No</td><td>nil (no maximum length)</td></tr><tr><td>Mode</td><td>The Version of the preidentified protocol to support (2 or 4).3</td><td>No</td><td>4</td></tr></tbody></table>
49
- <h2 id="helper-protocols">Helper Protocols</h2>
49
+ <h2 class="anchor anchorWithStickyNavbar_fF9Z" id="helper-protocols">Helper Protocols<a href="#helper-protocols" class="hash-link" aria-label="Direct link to Helper Protocols" title="Direct link to Helper Protocols">​</a></h2>
50
50
  <p>COSMOS provides the following helper protocols: CmdResponse, Crc and Ignore. These protocols provide helper functionality to Interfaces.</p>
51
- <h3 id="cmdresponse-protocol">CmdResponse Protocol</h3>
51
+ <h3 class="anchor anchorWithStickyNavbar_fF9Z" id="cmdresponse-protocol">CmdResponse Protocol<a href="#cmdresponse-protocol" class="hash-link" aria-label="Direct link to CmdResponse Protocol" title="Direct link to CmdResponse Protocol">​</a></h3>
52
52
  <p>The CmdResponse Protocol waits for a response for any commands with a defined response packet (TODO: More documentation and examples).</p>
53
53
  <table><thead><tr><th>Parameter</th><th>Description</th><th>Required</th><th>Default</th></tr></thead><tbody><tr><td>Response Timeout</td><td>Number of seconds to wait before timing out when waiting for a response</td><td>No</td><td>5</td></tr><tr><td>Response Polling Period</td><td>Number of seconds to wait between polling for a response</td><td>No</td><td>0.02</td></tr><tr><td>Raise Exceptions</td><td>Whether to raise exceptions when errors occur in the protocol like unexpected responses or response timeouts</td><td>No</td><td>false</td></tr></tbody></table>
54
- <h3 id="crc-protocol">CRC Protocol</h3>
54
+ <h3 class="anchor anchorWithStickyNavbar_fF9Z" id="crc-protocol">CRC Protocol<a href="#crc-protocol" class="hash-link" aria-label="Direct link to CRC Protocol" title="Direct link to CRC Protocol">​</a></h3>
55
55
  <p>The CRC protocol can add CRCs to outgoing commands and verify CRCs on incoming telemetry packets.</p>
56
56
  <table><thead><tr><th>Parameter</th><th>Description</th><th>Required</th><th>Default</th></tr></thead><tbody><tr><td>Write Item Name</td><td>Item to fill with calculated CRC value for outgoing packets (nil = don&#x27;t fill)</td><td>No</td><td>nil</td></tr><tr><td>Strip CRC</td><td>Whether to remove the CRC from incoming packets</td><td>No</td><td>false</td></tr><tr><td>Bad Strategy</td><td>How to handle CRC errors on incoming packets. ERROR = Just log the error, DISCONNECT = Disconnect interface</td><td>No</td><td>&quot;ERROR&quot;</td></tr><tr><td>Bit Offset</td><td>Bit offset of the CRC in the data. Can be negative to indicate distance from end of packet</td><td>No</td><td>-32</td></tr><tr><td>Bit Size</td><td>Bit size of the CRC - Must be 16, 32, or 64</td><td>No</td><td>32</td></tr><tr><td>Endianness</td><td>Endianness of the CRC (BIG_ENDIAN/LITTLE_ENDIAN)</td><td>No</td><td>&quot;BIG_ENDIAN&quot;</td></tr><tr><td>Poly</td><td>Polynomial to use when calculating the CRC expressed as an integer</td><td>No</td><td>nil (use default polynomial - 16-bit=0x1021, 32-bit=0x04C11DB7, 64-bit=0x42F0E1EBA9EA3693)</td></tr><tr><td>Seed</td><td>Seed value to start the calculation</td><td>No</td><td>nil (use default seed - 16-bit=0xFFFF, 32-bit=0xFFFFFFFF, 64-bit=0xFFFFFFFFFFFFFFFF)</td></tr><tr><td>Xor</td><td>Whether to XOR the CRC result with 0xFFFF</td><td>No</td><td>nil (use default value - 16-bit=false, 32-bit=true, 64-bit=true)</td></tr><tr><td>Reflect</td><td>Whether to bit reverse each byte of data before calculating the CRC</td><td>No</td><td>nil (use default value - 16-bit=false, 32-bit=true, 64-bit=true)</td></tr></tbody></table>
57
- <h3 id="ignore-packet-protocol">Ignore Packet Protocol</h3>
57
+ <h3 class="anchor anchorWithStickyNavbar_fF9Z" id="ignore-packet-protocol">Ignore Packet Protocol<a href="#ignore-packet-protocol" class="hash-link" aria-label="Direct link to Ignore Packet Protocol" title="Direct link to Ignore Packet Protocol">​</a></h3>
58
58
  <p>The Ignore Packet protocol drops specified command packets sent by COSMOS or drops incoming telemetry packets.</p>
59
59
  <table><thead><tr><th>Parameter</th><th>Description</th><th>Required</th><th>Default</th></tr></thead><tbody><tr><td>Target Name</td><td>Target name of the packet to ignore</td><td>Yes</td><td>nil</td></tr><tr><td>Packet Name</td><td>Packet name of the packet to ignore</td><td>Yes</td><td>nil</td></tr></tbody></table>
60
- <h2 id="custom-protocols">Custom Protocols</h2>
60
+ <h2 class="anchor anchorWithStickyNavbar_fF9Z" id="custom-protocols">Custom Protocols<a href="#custom-protocols" class="hash-link" aria-label="Direct link to Custom Protocols" title="Direct link to Custom Protocols">​</a></h2>
61
61
  <p>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 base 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.</p>
62
- <p>All custom Protocols should derive from the Protocol class found in the COSMOS gem at <a href="https://github.com/OpenC3/cosmos/blob/main/openc3/lib/openc3/interfaces/protocols/protocol.rb">lib/openc3/interfaces/protocols/protocol.rb</a>. 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.</p>
63
- <admonition title="Protocol APIs" type="info"><p>Protocols should not <code>require &#x27;openc3/script&#x27;</code> since they are part of a COSMOS interface. They should use the COSMOS library code directly like <a href="https://github.com/OpenC3/cosmos/blob/main/openc3/lib/openc3/system/system.rb">System</a>, <a href="https://github.com/OpenC3/cosmos/blob/main/openc3/lib/openc3/packets/packet.rb">Packet</a>, <a href="https://github.com/OpenC3/cosmos/blob/main/openc3/lib/openc3/utilities/bucket.rb">Bucket</a>, <a href="https://github.com/OpenC3/cosmos/blob/main/openc3/lib/openc3/accessors/binary_accessor.rb">BinaryAccessor</a>, etc. When in doubt, consult the existing COSMOS <a href="https://github.com/OpenC3/cosmos/tree/main/openc3/lib/openc3/interfaces/protocols">protocol</a> classes.</p></admonition>
62
+ <p>All custom Protocols should derive from the Protocol class <a href="https://github.com/OpenC3/cosmos/blob/main/openc3/lib/openc3/interfaces/protocols/protocol.rb" target="_blank" rel="noopener noreferrer">openc3/interfaces/protocols/protocol.rb</a> (Ruby) and <a href="https://github.com/OpenC3/cosmos/blob/main/openc3/python/openc3/interfaces/protocols/protocol.py" target="_blank" rel="noopener noreferrer">openc3/interfaces/protocols/protocol.py</a> (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.</p>
63
+ <div class="theme-admonition theme-admonition-info admonition_IZjC alert alert--info"><div class="admonitionHeading_uVvU"><span class="admonitionIcon_HiR3"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path></svg></span>Ruby Protocol APIs</div><div class="admonitionContent_bl22"><p>Protocols should not <code>require &#x27;openc3/script&#x27;</code> since they are part of a COSMOS interface. They should use the COSMOS library code directly like <a href="https://github.com/OpenC3/cosmos/blob/main/openc3/lib/openc3/system/system.rb" target="_blank" rel="noopener noreferrer">System</a>, <a href="https://github.com/OpenC3/cosmos/blob/main/openc3/lib/openc3/packets/packet.rb" target="_blank" rel="noopener noreferrer">Packet</a>, <a href="https://github.com/OpenC3/cosmos/blob/main/openc3/lib/openc3/utilities/bucket.rb" target="_blank" rel="noopener noreferrer">Bucket</a>, <a href="https://github.com/OpenC3/cosmos/blob/main/openc3/lib/openc3/accessors/binary_accessor.rb" target="_blank" rel="noopener noreferrer">BinaryAccessor</a>, etc. When in doubt, consult the existing COSMOS <a href="https://github.com/OpenC3/cosmos/tree/main/openc3/lib/openc3/interfaces/protocols" target="_blank" rel="noopener noreferrer">protocol</a> classes.</p></div></div>
64
+ <div class="theme-admonition theme-admonition-info admonition_IZjC alert alert--info"><div class="admonitionHeading_uVvU"><span class="admonitionIcon_HiR3"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path></svg></span>Python Protocol APIs</div><div class="admonitionContent_bl22"><p>Protocols should not <code>from openc3.script import *</code> since they are part of a COSMOS interface. They should use the COSMOS library code directly like <a href="https://github.com/OpenC3/cosmos/blob/main/openc3/python/openc3/system/system.py" target="_blank" rel="noopener noreferrer">System</a>, <a href="https://github.com/OpenC3/cosmos/blob/main/openc3/python/openc3/packets/packet.py" target="_blank" rel="noopener noreferrer">Packet</a>, <a href="https://github.com/OpenC3/cosmos/blob/main/openc3/python/openc3/utilities/bucket.py" target="_blank" rel="noopener noreferrer">Bucket</a>, <a href="https://github.com/OpenC3/cosmos/blob/main/openc3/python/openc3/accessors/binary_accessor.py" target="_blank" rel="noopener noreferrer">BinaryAccessor</a>, etc. When in doubt, consult the existing COSMOS <a href="https://github.com/OpenC3/cosmos/tree/main/openc3/python/openc3/interfaces/protocols" target="_blank" rel="noopener noreferrer">protocol</a> classes.</p></div></div>
64
65
  <p>To really understand how Protocols work, you first must understand the logic within the base Interface class read and write methods.</p>
65
66
  <p>Let&#x27;s first discuss the read method.</p>
66
- <p><img alt="Interface Read Logic" src="/tools/staticdocs/assets/images/interface_read_logic-0deef27c1d2fec9de2a3720a3c9ecedb21a00dca7aabd13da0b8815c037e4c26.png" width="1063" height="542"></p>
67
- <p>On EVERY call to read, an empty Ruby string &quot;&quot; is first passed down to each of the read Protocol&#x27;s read_data() method BEFORE new raw data is attempted to be read using the Interface&#x27;s 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 read_data() methods will return <!-- -->:STOP<!-- --> in response to the empty string, indicating that more data is required to generate a packet. Each Protocol&#x27;s 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&#x27;s 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&#x27;s read_data() methods it is then converted into a COSMOS packet using the Interface&#x27;s convert_data_to_packet() method. This packet is then run in a similar fashion through each Read Protocol&#x27;s read_packet() method. This method has essentially the same return possibilities: a Packet (instead of data as in 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.</p>
68
- <p><img alt="Interface Write Logic" src="/tools/staticdocs/assets/images/interface_write_logic-3360afe1b4af20b10dafba848a21e09baccaacc06e2ec8b6c132ac7a3c99e994.png" width="931" height="944"></p>
67
+ <div class="theme-admonition theme-admonition-info admonition_IZjC alert alert--info"><div class="admonitionHeading_uVvU"><span class="admonitionIcon_HiR3"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path></svg></span>Ruby Symbols, Python Strings</div><div class="admonitionContent_bl22"><p>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 &quot;STOP&quot; in Python.</p></div></div>
68
+ <p><img decoding="async" loading="lazy" alt="Interface Read Logic" src="/tools/staticdocs/assets/images/interface_read_logic-0deef27c1d2fec9de2a3720a3c9ecedb21a00dca7aabd13da0b8815c037e4c26.png" width="1063" height="542" class="img__Ss2"></p>
69
+ <p>On <em>every</em> call to read, an empty string &quot;&quot; is first passed down to each of the read Protocol&#x27;s <code>read_data()</code> method <em>before</em> new raw data is attempted to be read using the Interface&#x27;s <code>read_interface()</code> 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 <code>read_data()</code> methods will return STOP in response to the empty string, indicating that more data is required to generate a packet. Each Protocol&#x27;s <code>read_data()</code> 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&#x27;s <code>read_data()</code> 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&#x27;s <code>read_data()</code> methods it is then converted into a COSMOS packet using the Interface&#x27;s convert_data_to_packet() method. This packet is then run in a similar fashion through each Read Protocol&#x27;s read_packet() method. This method has essentially the same return possibilities: a Packet (instead of data as in <code>read_data()</code>), 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.</p>
70
+ <p><img decoding="async" loading="lazy" alt="Interface Write Logic" src="/tools/staticdocs/assets/images/interface_write_logic-3360afe1b4af20b10dafba848a21e09baccaacc06e2ec8b6c132ac7a3c99e994.png" width="931" height="944" class="img__Ss2"></p>
69
71
  <p>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&#x27;re typically stripping layers of data and when writing you&#x27;re typically adding on layers in reverse order.)</p>
70
- <p>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&#x27;s write_packet() methods, then it is converted to binary data using the Interface&#x27;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&#x27;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.</p>
71
- <h2 id="method-discussions">Method discussions</h2>
72
- <h3 id="initialize">initialize</h3>
72
+ <p>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&#x27;s write_packet() methods, then it is converted to binary data using the Interface&#x27;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&#x27;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.</p>
73
+ <h2 class="anchor anchorWithStickyNavbar_fF9Z" id="method-discussions">Method discussions<a href="#method-discussions" class="hash-link" aria-label="Direct link to Method discussions" title="Direct link to Method discussions">​</a></h2>
74
+ <h3 class="anchor anchorWithStickyNavbar_fF9Z" id="initialize-or-init">initialize or <strong>init</strong><a href="#initialize-or-init" class="hash-link" aria-label="Direct link to initialize-or-init" title="Direct link to initialize-or-init">​</a></h3>
73
75
  <p>This is the constructor for your custom Protocol. It should always call super(allow_empty_data) to initialize the base Protocol class.</p>
74
- <p>Base class implementation:</p>
75
- <pre><code class="language-ruby"># @param allow_empty_data [true/false] Whether STOP should be returned on empty data
76
- def initialize(allow_empty_data = false)
77
- @interface = nil
78
- @allow_empty_data = ConfigParser.handle_true_false(allow_empty_data)
79
- reset()
80
- end
81
- </code></pre>
82
- <p>As you can see, every Protocol maintains state on at least two items. @interface 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 read_data(data) method that is discussed later in this document.</p>
83
- <h3 id="reset">reset</h3>
76
+ <p>Base class Ruby implementation:</p>
77
+ <div class="language-ruby codeBlockContainer_ZGJx theme-code-block" style="--prism-color:#d6deeb;--prism-background-color:#011627"><div class="codeBlockContent_qZBB"><pre tabindex="0" class="prism-code language-ruby codeBlock_TAPP thin-scrollbar" style="color:#d6deeb;background-color:#011627"><code class="codeBlockLines_AdAo"><span class="token-line" style="color:#d6deeb"><span class="token comment" style="color:rgb(99, 119, 119);font-style:italic"># @param allow_empty_data [true/false] Whether STOP should be returned on empty data</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"></span><span class="token keyword" style="color:rgb(127, 219, 202)">def</span><span class="token plain"> </span><span class="token method-definition function" style="color:rgb(130, 170, 255)">initialize</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token plain">allow_empty_data </span><span class="token operator" style="color:rgb(127, 219, 202)">=</span><span class="token plain"> </span><span class="token boolean" style="color:rgb(255, 88, 116)">false</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"> </span><span class="token variable" style="color:rgb(214, 222, 235)">@interface</span><span class="token plain"> </span><span class="token operator" style="color:rgb(127, 219, 202)">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(127, 219, 202)">nil</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"> </span><span class="token variable" style="color:rgb(214, 222, 235)">@allow_empty_data</span><span class="token plain"> </span><span class="token operator" style="color:rgb(127, 219, 202)">=</span><span class="token plain"> ConfigParser</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token plain">handle_true_false</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token plain">allow_empty_data</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"> reset</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"></span><span class="token keyword" style="color:rgb(127, 219, 202)">end</span><br></span></code></pre><div class="buttonGroup_TNwR"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_MVhB" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_yxgH"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_QJLJ"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
78
+ <p>Base class Python implementation:</p>
79
+ <div class="language-python codeBlockContainer_ZGJx theme-code-block" style="--prism-color:#d6deeb;--prism-background-color:#011627"><div class="codeBlockContent_qZBB"><pre tabindex="0" class="prism-code language-python codeBlock_TAPP thin-scrollbar" style="color:#d6deeb;background-color:#011627"><code class="codeBlockLines_AdAo"><span class="token-line" style="color:#d6deeb"><span class="token keyword" style="color:rgb(127, 219, 202)">def</span><span class="token plain"> </span><span class="token function" style="color:rgb(130, 170, 255)">__init__</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token plain">self</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> allow_empty_data</span><span class="token operator" style="color:rgb(127, 219, 202)">=</span><span class="token boolean" style="color:rgb(255, 88, 116)">None</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token punctuation" style="color:rgb(199, 146, 234)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"> self</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token plain">interface </span><span class="token operator" style="color:rgb(127, 219, 202)">=</span><span class="token plain"> </span><span class="token boolean" style="color:rgb(255, 88, 116)">None</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"> self</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token plain">allow_empty_data </span><span class="token operator" style="color:rgb(127, 219, 202)">=</span><span class="token plain"> ConfigParser</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token plain">handle_true_false_none</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token plain">allow_empty_data</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"> self</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token plain">reset</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><br></span></code></pre><div class="buttonGroup_TNwR"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_MVhB" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_yxgH"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_QJLJ"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
80
+ <p>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 <code>read_data(data)</code> method that is discussed later in this document.</p>
81
+ <h3 class="anchor anchorWithStickyNavbar_fF9Z" id="reset">reset<a href="#reset" class="hash-link" aria-label="Direct link to reset" title="Direct link to reset">​</a></h3>
84
82
  <p>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.</p>
85
- <p>Base class implementation:</p>
86
- <pre><code class="language-ruby">def reset
87
- end
88
- </code></pre>
83
+ <p>Base class Ruby implementation:</p>
84
+ <div class="language-ruby codeBlockContainer_ZGJx theme-code-block" style="--prism-color:#d6deeb;--prism-background-color:#011627"><div class="codeBlockContent_qZBB"><pre tabindex="0" class="prism-code language-ruby codeBlock_TAPP thin-scrollbar" style="color:#d6deeb;background-color:#011627"><code class="codeBlockLines_AdAo"><span class="token-line" style="color:#d6deeb"><span class="token keyword" style="color:rgb(127, 219, 202)">def</span><span class="token plain"> </span><span class="token method-definition function" style="color:rgb(130, 170, 255)">reset</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"></span><span class="token keyword" style="color:rgb(127, 219, 202)">end</span><br></span></code></pre><div class="buttonGroup_TNwR"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_MVhB" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_yxgH"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_QJLJ"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
85
+ <p>Base class Python implementation:</p>
86
+ <div class="language-python codeBlockContainer_ZGJx theme-code-block" style="--prism-color:#d6deeb;--prism-background-color:#011627"><div class="codeBlockContent_qZBB"><pre tabindex="0" class="prism-code language-python codeBlock_TAPP thin-scrollbar" style="color:#d6deeb;background-color:#011627"><code class="codeBlockLines_AdAo"><span class="token-line" style="color:#d6deeb"><span class="token keyword" style="color:rgb(127, 219, 202)">def</span><span class="token plain"> </span><span class="token function" style="color:rgb(130, 170, 255)">reset</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token plain">self</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token punctuation" style="color:rgb(199, 146, 234)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"> </span><span class="token keyword" style="color:rgb(127, 219, 202)">pass</span><br></span></code></pre><div class="buttonGroup_TNwR"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_MVhB" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_yxgH"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_QJLJ"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
89
87
  <p>As you can see, the base class reset implementation doesn&#x27;t do anything.</p>
90
- <h3 id="connect_reset">connect_reset</h3>
88
+ <h3 class="anchor anchorWithStickyNavbar_fF9Z" id="connect_reset">connect_reset<a href="#connect_reset" class="hash-link" aria-label="Direct link to connect_reset" title="Direct link to connect_reset">​</a></h3>
91
89
  <p>The connect_reset method is used to reset internal Protocol state each time the Interface is connected.</p>
92
- <p>Base class implementation:</p>
93
- <pre><code class="language-ruby">def connect_reset
94
- reset()
95
- end
96
- </code></pre>
90
+ <p>Base class Ruby implementation:</p>
91
+ <div class="language-ruby codeBlockContainer_ZGJx theme-code-block" style="--prism-color:#d6deeb;--prism-background-color:#011627"><div class="codeBlockContent_qZBB"><pre tabindex="0" class="prism-code language-ruby codeBlock_TAPP thin-scrollbar" style="color:#d6deeb;background-color:#011627"><code class="codeBlockLines_AdAo"><span class="token-line" style="color:#d6deeb"><span class="token keyword" style="color:rgb(127, 219, 202)">def</span><span class="token plain"> </span><span class="token method-definition function" style="color:rgb(130, 170, 255)">connect_reset</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"> reset</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"></span><span class="token keyword" style="color:rgb(127, 219, 202)">end</span><br></span></code></pre><div class="buttonGroup_TNwR"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_MVhB" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_yxgH"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_QJLJ"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
92
+ <p>Base class Python implementation:</p>
93
+ <div class="language-python codeBlockContainer_ZGJx theme-code-block" style="--prism-color:#d6deeb;--prism-background-color:#011627"><div class="codeBlockContent_qZBB"><pre tabindex="0" class="prism-code language-python codeBlock_TAPP thin-scrollbar" style="color:#d6deeb;background-color:#011627"><code class="codeBlockLines_AdAo"><span class="token-line" style="color:#d6deeb"><span class="token keyword" style="color:rgb(127, 219, 202)">def</span><span class="token plain"> </span><span class="token function" style="color:rgb(130, 170, 255)">connect_reset</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token plain">self</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token punctuation" style="color:rgb(199, 146, 234)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"> self</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token plain">reset</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><br></span></code></pre><div class="buttonGroup_TNwR"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_MVhB" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_yxgH"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_QJLJ"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
97
94
  <p>The base class connect_reset implementation just calls the reset method to ensure common reset logic is run.</p>
98
- <h3 id="disconnect_reset">disconnect_reset</h3>
95
+ <h3 class="anchor anchorWithStickyNavbar_fF9Z" id="disconnect_reset">disconnect_reset<a href="#disconnect_reset" class="hash-link" aria-label="Direct link to disconnect_reset" title="Direct link to disconnect_reset">​</a></h3>
99
96
  <p>The disconnect_reset method is used to reset internal Protocol state each time the Interface is disconnected.</p>
100
- <p>Base class implementation:</p>
101
- <pre><code class="language-ruby">def disconnect_reset
102
- reset()
103
- end
104
- </code></pre>
97
+ <p>Base class Ruby implementation:</p>
98
+ <div class="language-ruby codeBlockContainer_ZGJx theme-code-block" style="--prism-color:#d6deeb;--prism-background-color:#011627"><div class="codeBlockContent_qZBB"><pre tabindex="0" class="prism-code language-ruby codeBlock_TAPP thin-scrollbar" style="color:#d6deeb;background-color:#011627"><code class="codeBlockLines_AdAo"><span class="token-line" style="color:#d6deeb"><span class="token keyword" style="color:rgb(127, 219, 202)">def</span><span class="token plain"> </span><span class="token method-definition function" style="color:rgb(130, 170, 255)">disconnect_reset</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"> reset</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"></span><span class="token keyword" style="color:rgb(127, 219, 202)">end</span><br></span></code></pre><div class="buttonGroup_TNwR"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_MVhB" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_yxgH"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_QJLJ"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
99
+ <p>Base class Python implementation:</p>
100
+ <div class="language-python codeBlockContainer_ZGJx theme-code-block" style="--prism-color:#d6deeb;--prism-background-color:#011627"><div class="codeBlockContent_qZBB"><pre tabindex="0" class="prism-code language-python codeBlock_TAPP thin-scrollbar" style="color:#d6deeb;background-color:#011627"><code class="codeBlockLines_AdAo"><span class="token-line" style="color:#d6deeb"><span class="token keyword" style="color:rgb(127, 219, 202)">def</span><span class="token plain"> </span><span class="token function" style="color:rgb(130, 170, 255)">disconnect_reset</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token plain">self</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token punctuation" style="color:rgb(199, 146, 234)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"> self</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token plain">reset</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><br></span></code></pre><div class="buttonGroup_TNwR"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_MVhB" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_yxgH"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_QJLJ"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
105
101
  <p>The base class disconnect_reset implementation just calls the reset method to ensure common reset logic is run.</p>
106
- <h3 id="read_data">read_data</h3>
107
- <p>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 Ruby string of data, <!-- -->:STOP<!-- -->, or <!-- -->:DISCONNECT<!-- -->. If it returns a Ruby 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).</p>
108
- <p>Base Class Implemenation:</p>
109
- <pre><code class="language-ruby">def read_data(data)
110
- if (data.length &lt;= 0)
111
- if @allow_empty_data.nil?
112
- if @interface and @interface.read_protocols[-1] == self # Last read interface in chain with auto @allow_empty_data
113
- return :STOP
114
- end
115
- elsif !@allow_empty_data # Don&#x27;t @allow_empty_data means STOP
116
- return :STOP
117
- end
118
- end
119
- data
120
- end
121
- </code></pre>
122
- <p>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 or if it nil and the Protocol is the last in the chain, then the base implementation will return <!-- -->:STOP<!-- --> data to indicate that it is time to call the Interface read_interface() method to get more data. Blank strings are used to signal Protocols that they have an opportunity to return a cached packet.</p>
123
- <h3 id="read_packet">read_packet</h3>
124
- <p>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.</p>
125
- <p>Base Class Implementation:</p>
126
- <pre><code class="language-ruby">def read_packet(packet)
127
- return packet
128
- end
129
- </code></pre>
102
+ <h3 class="anchor anchorWithStickyNavbar_fF9Z" id="read_data">read_data<a href="#read_data" class="hash-link" aria-label="Direct link to read_data" title="Direct link to read_data">​</a></h3>
103
+ <p>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).</p>
104
+ <p>Base class Ruby implemenation:</p>
105
+ <div class="language-ruby codeBlockContainer_ZGJx theme-code-block" style="--prism-color:#d6deeb;--prism-background-color:#011627"><div class="codeBlockContent_qZBB"><pre tabindex="0" class="prism-code language-ruby codeBlock_TAPP thin-scrollbar" style="color:#d6deeb;background-color:#011627"><code class="codeBlockLines_AdAo"><span class="token-line" style="color:#d6deeb"><span class="token keyword" style="color:rgb(127, 219, 202)">def</span><span class="token plain"> </span><span class="token method-definition function" style="color:rgb(130, 170, 255)">read_data</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token plain">data</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"> </span><span class="token keyword" style="color:rgb(127, 219, 202)">if</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token plain">data</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token plain">length </span><span class="token operator" style="color:rgb(127, 219, 202)">&lt;=</span><span class="token plain"> </span><span class="token number" style="color:rgb(247, 140, 108)">0</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"> </span><span class="token keyword" style="color:rgb(127, 219, 202)">if</span><span class="token plain"> </span><span class="token variable" style="color:rgb(214, 222, 235)">@allow_empty_data</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token keyword" style="color:rgb(127, 219, 202)">nil</span><span class="token operator" style="color:rgb(127, 219, 202)">?</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"> </span><span class="token keyword" style="color:rgb(127, 219, 202)">if</span><span class="token plain"> </span><span class="token variable" style="color:rgb(214, 222, 235)">@interface</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(127, 219, 202)">and</span><span class="token plain"> </span><span class="token variable" style="color:rgb(214, 222, 235)">@interface</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token plain">read_protocols</span><span class="token punctuation" style="color:rgb(199, 146, 234)">[</span><span class="token operator" style="color:rgb(127, 219, 202)">-</span><span class="token number" style="color:rgb(247, 140, 108)">1</span><span class="token punctuation" style="color:rgb(199, 146, 234)">]</span><span class="token plain"> </span><span class="token operator" style="color:rgb(127, 219, 202)">==</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(127, 219, 202)">self</span><span class="token plain"> </span><span class="token comment" style="color:rgb(99, 119, 119);font-style:italic"># Last read interface in chain with auto @allow_empty_data</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"> </span><span class="token keyword" style="color:rgb(127, 219, 202)">return</span><span class="token plain"> </span><span class="token symbol">:STOP</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"> </span><span class="token keyword" style="color:rgb(127, 219, 202)">end</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"> </span><span class="token keyword" style="color:rgb(127, 219, 202)">elsif</span><span class="token plain"> </span><span class="token operator" style="color:rgb(127, 219, 202)">!</span><span class="token variable" style="color:rgb(214, 222, 235)">@allow_empty_data</span><span class="token plain"> </span><span class="token comment" style="color:rgb(99, 119, 119);font-style:italic"># Don&#x27;t @allow_empty_data means STOP</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"> </span><span class="token keyword" style="color:rgb(127, 219, 202)">return</span><span class="token plain"> </span><span class="token symbol">:STOP</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"> </span><span class="token keyword" style="color:rgb(127, 219, 202)">end</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"> </span><span class="token keyword" style="color:rgb(127, 219, 202)">end</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"> data</span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"></span><span class="token keyword" style="color:rgb(127, 219, 202)">end</span><br></span></code></pre><div class="buttonGroup_TNwR"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_MVhB" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_yxgH"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_QJLJ"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
106
+ <p>Base class Python implemenation:</p>
107
+ <div class="language-python codeBlockContainer_ZGJx theme-code-block" style="--prism-color:#d6deeb;--prism-background-color:#011627"><div class="codeBlockContent_qZBB"><pre tabindex="0" class="prism-code language-python codeBlock_TAPP thin-scrollbar" style="color:#d6deeb;background-color:#011627"><code class="codeBlockLines_AdAo"><span class="token-line" style="color:#d6deeb"><span class="token keyword" style="color:rgb(127, 219, 202)">def</span><span class="token plain"> </span><span class="token function" style="color:rgb(130, 170, 255)">read_data</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token plain">self</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> data</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> extra</span><span class="token operator" style="color:rgb(127, 219, 202)">=</span><span class="token boolean" style="color:rgb(255, 88, 116)">None</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token punctuation" style="color:rgb(199, 146, 234)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"> </span><span class="token keyword" style="color:rgb(127, 219, 202)">if</span><span class="token plain"> </span><span class="token builtin" style="color:rgb(130, 170, 255)">len</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token plain">data</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"> </span><span class="token operator" style="color:rgb(127, 219, 202)">&lt;=</span><span class="token plain"> </span><span class="token number" style="color:rgb(247, 140, 108)">0</span><span class="token punctuation" style="color:rgb(199, 146, 234)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"> </span><span class="token keyword" style="color:rgb(127, 219, 202)">if</span><span class="token plain"> self</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token plain">allow_empty_data </span><span class="token keyword" style="color:rgb(127, 219, 202)">is</span><span class="token plain"> </span><span class="token boolean" style="color:rgb(255, 88, 116)">None</span><span class="token punctuation" style="color:rgb(199, 146, 234)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"> </span><span class="token keyword" style="color:rgb(127, 219, 202)">if</span><span class="token plain"> self</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token plain">interface </span><span class="token keyword" style="color:rgb(127, 219, 202)">and</span><span class="token plain"> self</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token plain">interface</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token plain">read_protocols</span><span class="token punctuation" style="color:rgb(199, 146, 234)">[</span><span class="token operator" style="color:rgb(127, 219, 202)">-</span><span class="token number" style="color:rgb(247, 140, 108)">1</span><span class="token punctuation" style="color:rgb(199, 146, 234)">]</span><span class="token plain"> </span><span class="token operator" style="color:rgb(127, 219, 202)">==</span><span class="token plain"> self</span><span class="token punctuation" style="color:rgb(199, 146, 234)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"> </span><span class="token comment" style="color:rgb(99, 119, 119);font-style:italic"># Last read interface in chain with auto self.allow_empty_data</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"> </span><span class="token keyword" style="color:rgb(127, 219, 202)">return</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string" style="color:rgb(173, 219, 103)">&quot;STOP&quot;</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> extra</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"> </span><span class="token keyword" style="color:rgb(127, 219, 202)">elif</span><span class="token plain"> self</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token plain">allow_empty_data</span><span class="token punctuation" style="color:rgb(199, 146, 234)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"> </span><span class="token comment" style="color:rgb(99, 119, 119);font-style:italic"># Don&#x27;t self.allow_empty_data means STOP</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"> </span><span class="token keyword" style="color:rgb(127, 219, 202)">return</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string" style="color:rgb(173, 219, 103)">&quot;STOP&quot;</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> extra</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"> </span><span class="token keyword" style="color:rgb(127, 219, 202)">return</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token plain">data</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> extra</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><br></span></code></pre><div class="buttonGroup_TNwR"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_MVhB" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_yxgH"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_QJLJ"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
108
+ <p>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 <code>read_interface()</code> method to get more data. Blank strings are used to signal Protocols that they have an opportunity to return a cached packet.</p>
109
+ <h3 class="anchor anchorWithStickyNavbar_fF9Z" id="read_packet">read_packet<a href="#read_packet" class="hash-link" aria-label="Direct link to read_packet" title="Direct link to read_packet">​</a></h3>
110
+ <p>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.</p>
111
+ <p>Base class Ruby implementation:</p>
112
+ <div class="language-ruby codeBlockContainer_ZGJx theme-code-block" style="--prism-color:#d6deeb;--prism-background-color:#011627"><div class="codeBlockContent_qZBB"><pre tabindex="0" class="prism-code language-ruby codeBlock_TAPP thin-scrollbar" style="color:#d6deeb;background-color:#011627"><code class="codeBlockLines_AdAo"><span class="token-line" style="color:#d6deeb"><span class="token keyword" style="color:rgb(127, 219, 202)">def</span><span class="token plain"> </span><span class="token method-definition function" style="color:rgb(130, 170, 255)">read_packet</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token plain">packet</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"> </span><span class="token keyword" style="color:rgb(127, 219, 202)">return</span><span class="token plain"> packet</span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"></span><span class="token keyword" style="color:rgb(127, 219, 202)">end</span><br></span></code></pre><div class="buttonGroup_TNwR"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_MVhB" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_yxgH"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_QJLJ"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
113
+ <p>Base class Python implementation:</p>
114
+ <div class="language-python codeBlockContainer_ZGJx theme-code-block" style="--prism-color:#d6deeb;--prism-background-color:#011627"><div class="codeBlockContent_qZBB"><pre tabindex="0" class="prism-code language-python codeBlock_TAPP thin-scrollbar" style="color:#d6deeb;background-color:#011627"><code class="codeBlockLines_AdAo"><span class="token-line" style="color:#d6deeb"><span class="token keyword" style="color:rgb(127, 219, 202)">def</span><span class="token plain"> </span><span class="token function" style="color:rgb(130, 170, 255)">read_packet</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token plain">self</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> packet</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token punctuation" style="color:rgb(199, 146, 234)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"> </span><span class="token keyword" style="color:rgb(127, 219, 202)">return</span><span class="token plain"> packet</span><br></span></code></pre><div class="buttonGroup_TNwR"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_MVhB" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_yxgH"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_QJLJ"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
130
115
  <p>The base class always just returns the packet given.</p>
131
- <h3 id="write_packet">write_packet</h3>
132
- <p>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).</p>
133
- <p>Base Class Implementation:</p>
134
- <pre><code class="language-ruby">def write_packet(packet)
135
- return packet
136
- end
137
- </code></pre>
116
+ <h3 class="anchor anchorWithStickyNavbar_fF9Z" id="write_packet">write_packet<a href="#write_packet" class="hash-link" aria-label="Direct link to write_packet" title="Direct link to write_packet">​</a></h3>
117
+ <p>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).</p>
118
+ <p>Base class Ruby implementation:</p>
119
+ <div class="language-ruby codeBlockContainer_ZGJx theme-code-block" style="--prism-color:#d6deeb;--prism-background-color:#011627"><div class="codeBlockContent_qZBB"><pre tabindex="0" class="prism-code language-ruby codeBlock_TAPP thin-scrollbar" style="color:#d6deeb;background-color:#011627"><code class="codeBlockLines_AdAo"><span class="token-line" style="color:#d6deeb"><span class="token keyword" style="color:rgb(127, 219, 202)">def</span><span class="token plain"> </span><span class="token method-definition function" style="color:rgb(130, 170, 255)">write_packet</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token plain">packet</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"> </span><span class="token keyword" style="color:rgb(127, 219, 202)">return</span><span class="token plain"> packet</span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"></span><span class="token keyword" style="color:rgb(127, 219, 202)">end</span><br></span></code></pre><div class="buttonGroup_TNwR"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_MVhB" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_yxgH"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_QJLJ"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
120
+ <p>Base class Python implementation:</p>
121
+ <div class="language-python codeBlockContainer_ZGJx theme-code-block" style="--prism-color:#d6deeb;--prism-background-color:#011627"><div class="codeBlockContent_qZBB"><pre tabindex="0" class="prism-code language-python codeBlock_TAPP thin-scrollbar" style="color:#d6deeb;background-color:#011627"><code class="codeBlockLines_AdAo"><span class="token-line" style="color:#d6deeb"><span class="token keyword" style="color:rgb(127, 219, 202)">def</span><span class="token plain"> </span><span class="token function" style="color:rgb(130, 170, 255)">write_packet</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token plain">self</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> packet</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token punctuation" style="color:rgb(199, 146, 234)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"> </span><span class="token keyword" style="color:rgb(127, 219, 202)">return</span><span class="token plain"> packet</span><br></span></code></pre><div class="buttonGroup_TNwR"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_MVhB" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_yxgH"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_QJLJ"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
138
122
  <p>The base class always just returns the packet given.</p>
139
- <h3 id="write_data">write_data</h3>
140
- <p>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 Ruby String of data, <!-- -->:STOP<!-- -->, or <!-- -->:DISCONNECT<!-- -->. If it returns a Ruby 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).</p>
141
- <p>Base Class Implementation:</p>
142
- <pre><code class="language-ruby">def write_data(data)
143
- return data
144
- end
145
- </code></pre>
123
+ <h3 class="anchor anchorWithStickyNavbar_fF9Z" id="write_data">write_data<a href="#write_data" class="hash-link" aria-label="Direct link to write_data" title="Direct link to write_data">​</a></h3>
124
+ <p>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).</p>
125
+ <p>Base class Ruby implementation:</p>
126
+ <div class="language-ruby codeBlockContainer_ZGJx theme-code-block" style="--prism-color:#d6deeb;--prism-background-color:#011627"><div class="codeBlockContent_qZBB"><pre tabindex="0" class="prism-code language-ruby codeBlock_TAPP thin-scrollbar" style="color:#d6deeb;background-color:#011627"><code class="codeBlockLines_AdAo"><span class="token-line" style="color:#d6deeb"><span class="token keyword" style="color:rgb(127, 219, 202)">def</span><span class="token plain"> </span><span class="token method-definition function" style="color:rgb(130, 170, 255)">write_data</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token plain">data</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"> </span><span class="token keyword" style="color:rgb(127, 219, 202)">return</span><span class="token plain"> data</span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"></span><span class="token keyword" style="color:rgb(127, 219, 202)">end</span><br></span></code></pre><div class="buttonGroup_TNwR"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_MVhB" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_yxgH"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_QJLJ"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
127
+ <p>Base class Python implementation:</p>
128
+ <div class="language-python codeBlockContainer_ZGJx theme-code-block" style="--prism-color:#d6deeb;--prism-background-color:#011627"><div class="codeBlockContent_qZBB"><pre tabindex="0" class="prism-code language-python codeBlock_TAPP thin-scrollbar" style="color:#d6deeb;background-color:#011627"><code class="codeBlockLines_AdAo"><span class="token-line" style="color:#d6deeb"><span class="token keyword" style="color:rgb(127, 219, 202)">def</span><span class="token plain"> </span><span class="token function" style="color:rgb(130, 170, 255)">write_data</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token plain">self</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> data</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> extra</span><span class="token operator" style="color:rgb(127, 219, 202)">=</span><span class="token boolean" style="color:rgb(255, 88, 116)">None</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token punctuation" style="color:rgb(199, 146, 234)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"> </span><span class="token keyword" style="color:rgb(127, 219, 202)">return</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token plain">data</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> extra</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><br></span></code></pre><div class="buttonGroup_TNwR"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_MVhB" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_yxgH"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_QJLJ"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
146
129
  <p>The base class always just returns the data given.</p>
147
- <h3 id="post_write_interface">post_write_interface</h3>
148
- <p>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 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 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 &quot;packet&quot;, is checked to be <!-- -->:STOP<!-- -->, or <!-- -->:DISCONNECT<!-- --> on the return.</p>
149
- <p>Base Class Implementation:</p>
150
- <pre><code class="language-ruby">def post_write_interface(packet, data)
151
- return packet, data
152
- end
153
- </code></pre>
130
+ <h3 class="anchor anchorWithStickyNavbar_fF9Z" id="post_write_interface">post_write_interface<a href="#post_write_interface" class="hash-link" aria-label="Direct link to post_write_interface" title="Direct link to post_write_interface">​</a></h3>
131
+ <p>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 <code>write_packet()</code> 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 <code>post_write_interface()</code> 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 &quot;packet&quot;, is checked to be STOP, or DISCONNECT on the return.</p>
132
+ <p>Base class Ruby implementation:</p>
133
+ <div class="language-ruby codeBlockContainer_ZGJx theme-code-block" style="--prism-color:#d6deeb;--prism-background-color:#011627"><div class="codeBlockContent_qZBB"><pre tabindex="0" class="prism-code language-ruby codeBlock_TAPP thin-scrollbar" style="color:#d6deeb;background-color:#011627"><code class="codeBlockLines_AdAo"><span class="token-line" style="color:#d6deeb"><span class="token keyword" style="color:rgb(127, 219, 202)">def</span><span class="token plain"> </span><span class="token method-definition function" style="color:rgb(130, 170, 255)">post_write_interface</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token plain">packet</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> data</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"> </span><span class="token keyword" style="color:rgb(127, 219, 202)">return</span><span class="token plain"> packet</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> data</span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"></span><span class="token keyword" style="color:rgb(127, 219, 202)">end</span><br></span></code></pre><div class="buttonGroup_TNwR"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_MVhB" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_yxgH"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_QJLJ"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
134
+ <p>Base class Python implementation:</p>
135
+ <div class="language-python codeBlockContainer_ZGJx theme-code-block" style="--prism-color:#d6deeb;--prism-background-color:#011627"><div class="codeBlockContent_qZBB"><pre tabindex="0" class="prism-code language-python codeBlock_TAPP thin-scrollbar" style="color:#d6deeb;background-color:#011627"><code class="codeBlockLines_AdAo"><span class="token-line" style="color:#d6deeb"><span class="token keyword" style="color:rgb(127, 219, 202)">def</span><span class="token plain"> </span><span class="token function" style="color:rgb(130, 170, 255)">post_write_interface</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token plain">self</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> packet</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> data</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> extra</span><span class="token operator" style="color:rgb(127, 219, 202)">=</span><span class="token boolean" style="color:rgb(255, 88, 116)">None</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token punctuation" style="color:rgb(199, 146, 234)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"> </span><span class="token keyword" style="color:rgb(127, 219, 202)">return</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token plain">packet</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> data</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> extra</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><br></span></code></pre><div class="buttonGroup_TNwR"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_MVhB" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_yxgH"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_QJLJ"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
154
136
  <p>The base class always just returns the packet/data given.</p>
155
- <h2 id="examples">Examples</h2>
156
- <p>Please see the included COSMOS protocol code for examples of the above methods in action.</p>
157
- <p><a href="https://github.com/OpenC3/cosmos/blob/main/openc3/lib/openc3/interfaces/protocols/protocol.rb">lib/openc3/interfaces/protocols/protocol.rb</a>
158
- <a href="https://github.com/OpenC3/cosmos/blob/main/openc3/lib/openc3/interfaces/protocols/burst_protocol.rb">lib/openc3/interfaces/protocols/burst_protocol.rb</a>
159
- <a href="https://github.com/OpenC3/cosmos/blob/main/openc3/lib/openc3/interfaces/protocols/fixed_protocol.rb">lib/openc3/interfaces/protocols/fixed_protocol.rb</a>
160
- <a href="https://github.com/OpenC3/cosmos/blob/main/openc3/lib/openc3/interfaces/protocols/length_protocol.rb">lib/openc3/interfaces/protocols/length_protocol.rb</a>
161
- <a href="https://github.com/OpenC3/cosmos/blob/main/openc3/lib/openc3/interfaces/protocols/terminated_protocol.rb">lib/openc3/interfaces/protocols/terminated_protocol.rb</a>
162
- <a href="https://github.com/OpenC3/cosmos/blob/main/openc3/lib/openc3/interfaces/protocols/template_protocol.rb">lib/openc3/interfaces/protocols/template_protocol.rb</a>
163
- <a href="https://github.com/OpenC3/cosmos/blob/main/openc3/lib/openc3/interfaces/protocols/crc_protocol.rb">lib/openc3/interfaces/protocols/crc_protocol.rb</a>
164
- <a href="https://github.com/OpenC3/cosmos/blob/main/openc3/lib/openc3/interfaces/protocols/preidentified_protocol.rb">lib/openc3/interfaces/protocols/preidentified_protocol.rb</a></p></div><footer class="theme-doc-footer docusaurus-mt-lg"><div class="row margin-top--sm theme-doc-footer-edit-meta-row"><div class="col"><a href="https://github.com/OpenC3/cosmos/tree/main/docs.openc3.com/docs/configuration/protocols.md" target="_blank" rel="noopener noreferrer" class="theme-edit-this-page"><svg fill="currentColor" height="20" width="20" viewBox="0 0 40 40" class="iconEdit_UohW" aria-hidden="true"><g><path d="m34.5 11.7l-3 3.1-6.3-6.3 3.1-3q0.5-0.5 1.2-0.5t1.1 0.5l3.9 3.9q0.5 0.4 0.5 1.1t-0.5 1.2z m-29.5 17.1l18.4-18.5 6.3 6.3-18.4 18.4h-6.3v-6.2z"></path></g></svg>Edit this page</a></div><div class="col lastUpdated_g62E"></div></div></footer></article><nav class="pagination-nav docusaurus-mt-lg" aria-label="Docs pages"><a class="pagination-nav__link pagination-nav__link--prev" href="/tools/staticdocs/docs/configuration/interfaces"><div class="pagination-nav__sublabel">Previous</div><div class="pagination-nav__label">Interfaces</div></a><a class="pagination-nav__link pagination-nav__link--next" href="/tools/staticdocs/docs/configuration/table"><div class="pagination-nav__sublabel">Next</div><div class="pagination-nav__label">Tables</div></a></nav></div></div><div class="col col--3"><div class="tableOfContents_TN1Q thin-scrollbar theme-doc-toc-desktop"><ul class="table-of-contents table-of-contents__left-border"><li><a class="table-of-contents__link toc-highlight" href="/tools/staticdocs/docs/configuration/protocols#packet-delineation-protocols">Packet Delineation Protocols</a><ul><li><a class="table-of-contents__link toc-highlight" href="/tools/staticdocs/docs/configuration/protocols#cobs-protocol">COBS Protocol</a></li><li><a class="table-of-contents__link toc-highlight" href="/tools/staticdocs/docs/configuration/protocols#slip-protocol">SLIP Protocol</a></li><li><a class="table-of-contents__link toc-highlight" href="/tools/staticdocs/docs/configuration/protocols#burst-protocol">Burst Protocol</a></li><li><a class="table-of-contents__link toc-highlight" href="/tools/staticdocs/docs/configuration/protocols#fixed-protocol">Fixed Protocol</a></li><li><a class="table-of-contents__link toc-highlight" href="/tools/staticdocs/docs/configuration/protocols#length-protocol">Length Protocol</a></li><li><a class="table-of-contents__link toc-highlight" href="/tools/staticdocs/docs/configuration/protocols#terminated-protocol">Terminated Protocol</a></li><li><a class="table-of-contents__link toc-highlight" href="/tools/staticdocs/docs/configuration/protocols#template-protocol">Template Protocol</a></li><li><a class="table-of-contents__link toc-highlight" href="/tools/staticdocs/docs/configuration/protocols#preidentified-protocol">Preidentified Protocol</a></li></ul></li><li><a class="table-of-contents__link toc-highlight" href="/tools/staticdocs/docs/configuration/protocols#helper-protocols">Helper Protocols</a><ul><li><a class="table-of-contents__link toc-highlight" href="/tools/staticdocs/docs/configuration/protocols#cmdresponse-protocol">CmdResponse Protocol</a></li><li><a class="table-of-contents__link toc-highlight" href="/tools/staticdocs/docs/configuration/protocols#crc-protocol">CRC Protocol</a></li><li><a class="table-of-contents__link toc-highlight" href="/tools/staticdocs/docs/configuration/protocols#ignore-packet-protocol">Ignore Packet Protocol</a></li></ul></li><li><a class="table-of-contents__link toc-highlight" href="/tools/staticdocs/docs/configuration/protocols#custom-protocols">Custom Protocols</a></li><li><a class="table-of-contents__link toc-highlight" href="/tools/staticdocs/docs/configuration/protocols#method-discussions">Method discussions</a><ul><li><a class="table-of-contents__link toc-highlight" href="/tools/staticdocs/docs/configuration/protocols#initialize">initialize</a></li><li><a class="table-of-contents__link toc-highlight" href="/tools/staticdocs/docs/configuration/protocols#reset">reset</a></li><li><a class="table-of-contents__link toc-highlight" href="/tools/staticdocs/docs/configuration/protocols#connect_reset">connect_reset</a></li><li><a class="table-of-contents__link toc-highlight" href="/tools/staticdocs/docs/configuration/protocols#disconnect_reset">disconnect_reset</a></li><li><a class="table-of-contents__link toc-highlight" href="/tools/staticdocs/docs/configuration/protocols#read_data">read_data</a></li><li><a class="table-of-contents__link toc-highlight" href="/tools/staticdocs/docs/configuration/protocols#read_packet">read_packet</a></li><li><a class="table-of-contents__link toc-highlight" href="/tools/staticdocs/docs/configuration/protocols#write_packet">write_packet</a></li><li><a class="table-of-contents__link toc-highlight" href="/tools/staticdocs/docs/configuration/protocols#write_data">write_data</a></li><li><a class="table-of-contents__link toc-highlight" href="/tools/staticdocs/docs/configuration/protocols#post_write_interface">post_write_interface</a></li></ul></li><li><a class="table-of-contents__link toc-highlight" href="/tools/staticdocs/docs/configuration/protocols#examples">Examples</a></li></ul></div></div></div></div></main></div></div></div><footer class="footer footer--dark"><div class="container container-fluid"><div class="row footer__links"><div class="col footer__col"><div class="footer__title">Homepage</div><ul class="footer__items clean-list"><li class="footer__item"><a href="https://openc3.com" target="_blank" rel="noopener noreferrer" class="footer__link-item">Home</a></li></ul></div><div class="col footer__col"><div class="footer__title">Docs</div><ul class="footer__items clean-list"><li class="footer__item"><a class="footer__link-item" href="/tools/staticdocs/docs">Documentation</a></li></ul></div><div class="col footer__col"><div class="footer__title">Community</div><ul class="footer__items clean-list"><li class="footer__item"><a href="https://www.linkedin.com/company/openc3" target="_blank" rel="noopener noreferrer" class="footer__link-item">LinkedIn<svg width="13.5" height="13.5" aria-hidden="true" viewBox="0 0 24 24" class="iconExternalLink_awgD"><path fill="currentColor" d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"></path></svg></a></li></ul></div><div class="col footer__col"><div class="footer__title">More</div><ul class="footer__items clean-list"><li class="footer__item"><a href="https://github.com/OpenC3/cosmos" target="_blank" rel="noopener noreferrer" class="footer__link-item">GitHub<svg width="13.5" height="13.5" aria-hidden="true" viewBox="0 0 24 24" class="iconExternalLink_awgD"><path fill="currentColor" d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"></path></svg></a></li><li class="footer__item"><a class="footer__link-item" href="/tools/staticdocs/docs/privacy">Privacy</a></li></ul></div></div><div class="footer__bottom text--center"><div class="footer__copyright">Copyright © 2024 OpenC3, Inc.</div></div></div></footer></div>
137
+ <h3 class="anchor anchorWithStickyNavbar_fF9Z" id="protocol_cmd">protocol_cmd<a href="#protocol_cmd" class="hash-link" aria-label="Direct link to protocol_cmd" title="Direct link to protocol_cmd">​</a></h3>
138
+ <p>The protocol_cmd method is used to send commands to the protocol itself. This is useful to change protocol behavior during runtime. See <a href="/tools/staticdocs/docs/guides/scripting-api#interface_protocol_cmd">interface_protocol_cmd</a> for more information.</p>
139
+ <p>Base class Ruby implementation:</p>
140
+ <div class="language-ruby codeBlockContainer_ZGJx theme-code-block" style="--prism-color:#d6deeb;--prism-background-color:#011627"><div class="codeBlockContent_qZBB"><pre tabindex="0" class="prism-code language-ruby codeBlock_TAPP thin-scrollbar" style="color:#d6deeb;background-color:#011627"><code class="codeBlockLines_AdAo"><span class="token-line" style="color:#d6deeb"><span class="token keyword" style="color:rgb(127, 219, 202)">def</span><span class="token plain"> </span><span class="token method-definition function" style="color:rgb(130, 170, 255)">protocol_cmd</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token plain">cmd_name</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> </span><span class="token operator" style="color:rgb(127, 219, 202)">*</span><span class="token plain">cmd_args</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"> </span><span class="token comment" style="color:rgb(99, 119, 119);font-style:italic"># Default do nothing - Implemented by subclasses</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"> </span><span class="token keyword" style="color:rgb(127, 219, 202)">return</span><span class="token plain"> </span><span class="token boolean" style="color:rgb(255, 88, 116)">false</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"></span><span class="token keyword" style="color:rgb(127, 219, 202)">end</span><br></span></code></pre><div class="buttonGroup_TNwR"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_MVhB" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_yxgH"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_QJLJ"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
141
+ <p>Base class Python implementation:</p>
142
+ <div class="language-python codeBlockContainer_ZGJx theme-code-block" style="--prism-color:#d6deeb;--prism-background-color:#011627"><div class="codeBlockContent_qZBB"><pre tabindex="0" class="prism-code language-python codeBlock_TAPP thin-scrollbar" style="color:#d6deeb;background-color:#011627"><code class="codeBlockLines_AdAo"><span class="token-line" style="color:#d6deeb"><span class="token keyword" style="color:rgb(127, 219, 202)">def</span><span class="token plain"> </span><span class="token function" style="color:rgb(130, 170, 255)">protocol_cmd</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token plain">self</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> cmd_name</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> </span><span class="token operator" style="color:rgb(127, 219, 202)">*</span><span class="token plain">cmd_args</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token punctuation" style="color:rgb(199, 146, 234)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"> </span><span class="token comment" style="color:rgb(99, 119, 119);font-style:italic"># Default do nothing - Implemented by subclasses</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"> </span><span class="token keyword" style="color:rgb(127, 219, 202)">return</span><span class="token plain"> </span><span class="token boolean" style="color:rgb(255, 88, 116)">False</span><br></span></code></pre><div class="buttonGroup_TNwR"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_MVhB" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_yxgH"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_QJLJ"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
143
+ <p>The base class does nothing as this is special functionality implemented by subclasses.</p>
144
+ <h2 class="anchor anchorWithStickyNavbar_fF9Z" id="examples">Examples<a href="#examples" class="hash-link" aria-label="Direct link to Examples" title="Direct link to Examples">​</a></h2>
145
+ <p>Please see the linked <a href="https://github.com/OpenC3/cosmos/blob/main/openc3/lib/openc3/interfaces/protocols" target="_blank" rel="noopener noreferrer">Ruby Protocol</a> and <a href="https://github.com/OpenC3/cosmos/blob/main/openc3/python/openc3/interfaces/protocols" target="_blank" rel="noopener noreferrer">Python Protocol</a> code for examples of the above methods in action.</p></div><footer class="theme-doc-footer docusaurus-mt-lg"><div class="row margin-top--sm theme-doc-footer-edit-meta-row"><div class="col"><a href="https://github.com/OpenC3/cosmos/tree/main/docs.openc3.com/docs/configuration/protocols.md" target="_blank" rel="noopener noreferrer" class="theme-edit-this-page"><svg fill="currentColor" height="20" width="20" viewBox="0 0 40 40" class="iconEdit_UohW" aria-hidden="true"><g><path d="m34.5 11.7l-3 3.1-6.3-6.3 3.1-3q0.5-0.5 1.2-0.5t1.1 0.5l3.9 3.9q0.5 0.4 0.5 1.1t-0.5 1.2z m-29.5 17.1l18.4-18.5 6.3 6.3-18.4 18.4h-6.3v-6.2z"></path></g></svg>Edit this page</a></div><div class="col lastUpdated_g62E"></div></div></footer></article><nav class="pagination-nav docusaurus-mt-lg" aria-label="Docs pages"><a class="pagination-nav__link pagination-nav__link--prev" href="/tools/staticdocs/docs/configuration/interfaces"><div class="pagination-nav__sublabel">Previous</div><div class="pagination-nav__label">Interfaces</div></a><a class="pagination-nav__link pagination-nav__link--next" href="/tools/staticdocs/docs/configuration/table"><div class="pagination-nav__sublabel">Next</div><div class="pagination-nav__label">Tables</div></a></nav></div></div><div class="col col--3"><div class="tableOfContents_TN1Q thin-scrollbar theme-doc-toc-desktop"><ul class="table-of-contents table-of-contents__left-border"><li><a href="#packet-delineation-protocols" class="table-of-contents__link toc-highlight">Packet Delineation Protocols</a><ul><li><a href="#cobs-protocol" class="table-of-contents__link toc-highlight">COBS Protocol</a></li><li><a href="#slip-protocol" class="table-of-contents__link toc-highlight">SLIP Protocol</a></li><li><a href="#burst-protocol" class="table-of-contents__link toc-highlight">Burst Protocol</a></li><li><a href="#fixed-protocol" class="table-of-contents__link toc-highlight">Fixed Protocol</a></li><li><a href="#length-protocol" class="table-of-contents__link toc-highlight">Length Protocol</a></li><li><a href="#terminated-protocol" class="table-of-contents__link toc-highlight">Terminated Protocol</a></li><li><a href="#template-protocol" class="table-of-contents__link toc-highlight">Template Protocol</a></li><li><a href="#preidentified-protocol" class="table-of-contents__link toc-highlight">Preidentified Protocol</a></li></ul></li><li><a href="#helper-protocols" class="table-of-contents__link toc-highlight">Helper Protocols</a><ul><li><a href="#cmdresponse-protocol" class="table-of-contents__link toc-highlight">CmdResponse Protocol</a></li><li><a href="#crc-protocol" class="table-of-contents__link toc-highlight">CRC Protocol</a></li><li><a href="#ignore-packet-protocol" class="table-of-contents__link toc-highlight">Ignore Packet Protocol</a></li></ul></li><li><a href="#custom-protocols" class="table-of-contents__link toc-highlight">Custom Protocols</a></li><li><a href="#method-discussions" class="table-of-contents__link toc-highlight">Method discussions</a><ul><li><a href="#initialize-or-init" class="table-of-contents__link toc-highlight">initialize or <strong>init</strong></a></li><li><a href="#reset" class="table-of-contents__link toc-highlight">reset</a></li><li><a href="#connect_reset" class="table-of-contents__link toc-highlight">connect_reset</a></li><li><a href="#disconnect_reset" class="table-of-contents__link toc-highlight">disconnect_reset</a></li><li><a href="#read_data" class="table-of-contents__link toc-highlight">read_data</a></li><li><a href="#read_packet" class="table-of-contents__link toc-highlight">read_packet</a></li><li><a href="#write_packet" class="table-of-contents__link toc-highlight">write_packet</a></li><li><a href="#write_data" class="table-of-contents__link toc-highlight">write_data</a></li><li><a href="#post_write_interface" class="table-of-contents__link toc-highlight">post_write_interface</a></li><li><a href="#protocol_cmd" class="table-of-contents__link toc-highlight">protocol_cmd</a></li></ul></li><li><a href="#examples" class="table-of-contents__link toc-highlight">Examples</a></li></ul></div></div></div></div></main></div></div></div><footer class="footer footer--dark"><div class="container container-fluid"><div class="row footer__links"><div class="col footer__col"><div class="footer__title">Homepage</div><ul class="footer__items clean-list"><li class="footer__item"><a href="https://openc3.com" target="_blank" rel="noopener noreferrer" class="footer__link-item">Home</a></li></ul></div><div class="col footer__col"><div class="footer__title">Docs</div><ul class="footer__items clean-list"><li class="footer__item"><a class="footer__link-item" href="/tools/staticdocs/docs">Documentation</a></li></ul></div><div class="col footer__col"><div class="footer__title">Community</div><ul class="footer__items clean-list"><li class="footer__item"><a href="https://www.linkedin.com/company/openc3" target="_blank" rel="noopener noreferrer" class="footer__link-item">LinkedIn<svg width="13.5" height="13.5" aria-hidden="true" viewBox="0 0 24 24" class="iconExternalLink_awgD"><path fill="currentColor" d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"></path></svg></a></li></ul></div><div class="col footer__col"><div class="footer__title">More</div><ul class="footer__items clean-list"><li class="footer__item"><a href="https://github.com/OpenC3/cosmos" target="_blank" rel="noopener noreferrer" class="footer__link-item">GitHub<svg width="13.5" height="13.5" aria-hidden="true" viewBox="0 0 24 24" class="iconExternalLink_awgD"><path fill="currentColor" d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"></path></svg></a></li><li class="footer__item"><a class="footer__link-item" href="/tools/staticdocs/docs/privacy">Privacy</a></li></ul></div></div><div class="footer__bottom text--center"><div class="footer__copyright">Copyright © 2024 OpenC3, Inc.</div></div></div></footer></div>
165
146
  </body>
166
147
  </html>