openc3-cosmos-tool-docs 6.3.0 → 6.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/tools/staticdocs/404.html +1 -1
- data/tools/staticdocs/assets/images/cosmos-containers-7ecd745840fcff307f0fec01ac4d88a8fa76d531abeae407fee0e508f50a487c.png +0 -0
- data/tools/staticdocs/assets/images/cosmos-images-8e15c197653ac3a1f39e8c5eaa56155f364e67d87d66647cff1355b960093af1.png +0 -0
- data/tools/staticdocs/assets/js/2bb7bf90.1772f030.js +1 -0
- data/tools/staticdocs/assets/js/411898ad.f7b3ff17.js +1 -0
- data/tools/staticdocs/assets/js/5b233ba7.9d6ba314.js +1 -0
- data/tools/staticdocs/assets/js/6831b732.1318b398.js +1 -0
- data/tools/staticdocs/assets/js/696b4199.1e950fcb.js +1 -0
- data/tools/staticdocs/assets/js/867640d5.27d9d599.js +1 -0
- data/tools/staticdocs/assets/js/89e76475.e1b0dbdb.js +1 -0
- data/tools/staticdocs/assets/js/964eb012.0e04c58d.js +1 -0
- data/tools/staticdocs/assets/js/9d6e81d0.36405219.js +1 -0
- data/tools/staticdocs/assets/js/a677c089.cfa50691.js +1 -0
- data/tools/staticdocs/assets/js/a9b2dc27.805dc1ba.js +1 -0
- data/tools/staticdocs/assets/js/aa6b6c1b.ef9b0f38.js +1 -0
- data/tools/staticdocs/assets/js/b062d239.57d6e194.js +1 -0
- data/tools/staticdocs/assets/js/b6d70f94.a9228642.js +1 -0
- data/tools/staticdocs/assets/js/c24eae19.0575c394.js +1 -0
- data/tools/staticdocs/assets/js/d1b923aa.da892cde.js +1 -0
- data/tools/staticdocs/assets/js/d66bf9c0.80a50660.js +1 -0
- data/tools/staticdocs/assets/js/d9b92eba.5db8667e.js +1 -0
- data/tools/staticdocs/assets/js/{main.8d947189.js → main.a8e2c06c.js} +5 -5
- data/tools/staticdocs/assets/js/{runtime~main.d38c5d36.js → runtime~main.7102cb65.js} +1 -1
- data/tools/staticdocs/docs/configuration/accessors.html +4 -3
- data/tools/staticdocs/docs/configuration/command.html +1 -1
- data/tools/staticdocs/docs/configuration/format.html +1 -1
- data/tools/staticdocs/docs/configuration/interfaces.html +15 -4
- data/tools/staticdocs/docs/configuration/plugins.html +5 -5
- data/tools/staticdocs/docs/configuration/protocols.html +7 -6
- data/tools/staticdocs/docs/configuration/ssl-tls.html +115 -76
- data/tools/staticdocs/docs/configuration/table.html +1 -1
- data/tools/staticdocs/docs/configuration/target.html +1 -1
- data/tools/staticdocs/docs/configuration/telemetry-screens.html +1 -1
- data/tools/staticdocs/docs/configuration/telemetry.html +1 -1
- data/tools/staticdocs/docs/configuration.html +1 -1
- data/tools/staticdocs/docs/development/curl.html +4 -4
- data/tools/staticdocs/docs/development/developing.html +2 -2
- data/tools/staticdocs/docs/development/json-api.html +1 -1
- data/tools/staticdocs/docs/development/log-structure.html +1 -1
- data/tools/staticdocs/docs/development/roadmap.html +1 -1
- data/tools/staticdocs/docs/development/streaming-api.html +1 -1
- data/tools/staticdocs/docs/development/testing.html +1 -1
- data/tools/staticdocs/docs/development.html +1 -1
- data/tools/staticdocs/docs/getting-started/cli.html +2 -2
- data/tools/staticdocs/docs/getting-started/generators.html +2 -2
- data/tools/staticdocs/docs/getting-started/gettingstarted.html +1 -1
- data/tools/staticdocs/docs/getting-started/installation.html +1 -1
- data/tools/staticdocs/docs/getting-started/key-concepts.html +8 -4
- data/tools/staticdocs/docs/getting-started/podman.html +1 -1
- data/tools/staticdocs/docs/getting-started/requirements.html +1 -1
- data/tools/staticdocs/docs/getting-started/upgrading.html +1 -1
- data/tools/staticdocs/docs/getting-started.html +1 -1
- data/tools/staticdocs/docs/guides/bridges.html +1 -1
- data/tools/staticdocs/docs/guides/cfs.html +12 -12
- data/tools/staticdocs/docs/guides/custom-widgets.html +1 -1
- data/tools/staticdocs/docs/guides/dynamic-packets.html +1 -1
- data/tools/staticdocs/docs/guides/exposing-microservices.html +4 -4
- data/tools/staticdocs/docs/guides/little-endian-bitfields.html +1 -1
- data/tools/staticdocs/docs/guides/local-mode.html +1 -1
- data/tools/staticdocs/docs/guides/logging.html +1 -1
- data/tools/staticdocs/docs/guides/monitoring.html +1 -1
- data/tools/staticdocs/docs/guides/performance.html +6 -6
- data/tools/staticdocs/docs/guides/raspberrypi.html +1 -1
- data/tools/staticdocs/docs/guides/script-writing.html +1 -1
- data/tools/staticdocs/docs/guides/scripting-api.html +55 -16
- data/tools/staticdocs/docs/guides.html +1 -1
- data/tools/staticdocs/docs/meta/contributing.html +1 -1
- data/tools/staticdocs/docs/meta/licenses.html +8 -8
- data/tools/staticdocs/docs/meta/philosophy.html +2 -2
- data/tools/staticdocs/docs/meta/xtce.html +1 -1
- data/tools/staticdocs/docs/meta.html +1 -1
- data/tools/staticdocs/docs/privacy.html +1 -1
- data/tools/staticdocs/docs/tools/admin.html +1 -1
- data/tools/staticdocs/docs/tools/autonomic.html +1 -1
- data/tools/staticdocs/docs/tools/bucket-explorer.html +2 -2
- data/tools/staticdocs/docs/tools/calendar.html +1 -1
- data/tools/staticdocs/docs/tools/cmd-sender.html +1 -1
- data/tools/staticdocs/docs/tools/cmd-tlm-server.html +1 -1
- data/tools/staticdocs/docs/tools/command_history.html +1 -1
- data/tools/staticdocs/docs/tools/data-extractor.html +1 -1
- data/tools/staticdocs/docs/tools/data-viewer.html +1 -1
- data/tools/staticdocs/docs/tools/handbooks.html +1 -1
- data/tools/staticdocs/docs/tools/limits-monitor.html +1 -1
- data/tools/staticdocs/docs/tools/packet-viewer.html +1 -1
- data/tools/staticdocs/docs/tools/script-runner.html +1 -1
- data/tools/staticdocs/docs/tools/table-manager.html +1 -1
- data/tools/staticdocs/docs/tools/tlm-grapher.html +1 -1
- data/tools/staticdocs/docs/tools/tlm-viewer.html +1 -1
- data/tools/staticdocs/docs/tools.html +1 -1
- data/tools/staticdocs/docs.html +1 -1
- data/tools/staticdocs/img/cosmos-containers.png +0 -0
- data/tools/staticdocs/img/cosmos-images.png +0 -0
- data/tools/staticdocs/index.html +1 -1
- data/tools/staticdocs/lunr-index-1746647301890.json +1 -0
- data/tools/staticdocs/lunr-index.json +1 -1
- data/tools/staticdocs/markdown-page.html +1 -1
- data/tools/staticdocs/search-doc-1746647301890.json +1 -0
- data/tools/staticdocs/search-doc.json +1 -1
- metadata +28 -24
- data/tools/staticdocs/assets/js/2bb7bf90.4a658ce6.js +0 -1
- data/tools/staticdocs/assets/js/411898ad.f7fc4d80.js +0 -1
- data/tools/staticdocs/assets/js/5b233ba7.2ea0179c.js +0 -1
- data/tools/staticdocs/assets/js/6831b732.0a867cbc.js +0 -1
- data/tools/staticdocs/assets/js/696b4199.2a7ff897.js +0 -1
- data/tools/staticdocs/assets/js/867640d5.2c0fa6d9.js +0 -1
- data/tools/staticdocs/assets/js/89e76475.a76d0072.js +0 -1
- data/tools/staticdocs/assets/js/964eb012.dbc2c206.js +0 -1
- data/tools/staticdocs/assets/js/9d6e81d0.44e2d544.js +0 -1
- data/tools/staticdocs/assets/js/a677c089.18f98b70.js +0 -1
- data/tools/staticdocs/assets/js/a9b2dc27.e01c9bb4.js +0 -1
- data/tools/staticdocs/assets/js/aa6b6c1b.3aad95fc.js +0 -1
- data/tools/staticdocs/assets/js/b062d239.535a2ceb.js +0 -1
- data/tools/staticdocs/assets/js/b6d70f94.7813125e.js +0 -1
- data/tools/staticdocs/assets/js/c24eae19.aaae7796.js +0 -1
- data/tools/staticdocs/assets/js/d1b923aa.a73e7e79.js +0 -1
- data/tools/staticdocs/assets/js/d66bf9c0.842d2efa.js +0 -1
- data/tools/staticdocs/assets/js/d9b92eba.34e63ba6.js +0 -1
- data/tools/staticdocs/lunr-index-1743825503427.json +0 -1
- data/tools/staticdocs/search-doc-1743825503427.json +0 -1
@@ -1 +0,0 @@
|
|
1
|
-
"use strict";(self.webpackChunkdocs_openc3_com=self.webpackChunkdocs_openc3_com||[]).push([["718"],{5809:function(e,n,i){i.r(n),i.d(n,{default:()=>h,frontMatter:()=>s,metadata:()=>r,assets:()=>a,toc:()=>l,contentTitle:()=>c});var r=JSON.parse('{"id":"guides/exposing-microservices","title":"Exposing Microservices","description":"Provide external accessibility to microservices","source":"@site/docs/guides/exposing-microservices.md","sourceDirName":"guides","slug":"/guides/exposing-microservices","permalink":"/tools/staticdocs/docs/guides/exposing-microservices","draft":false,"unlisted":false,"editUrl":"https://github.com/OpenC3/cosmos/tree/main/docs.openc3.com/docs/guides/exposing-microservices.md","tags":[],"version":"current","frontMatter":{"title":"Exposing Microservices","description":"Provide external accessibility to microservices","sidebar_custom_props":{"myEmoji":"\uD83D\uDEAA"}},"sidebar":"defaultSidebar","previous":{"title":"Dynamic Packets","permalink":"/tools/staticdocs/docs/guides/dynamic-packets"},"next":{"title":"Little Endian Bitfields","permalink":"/tools/staticdocs/docs/guides/little-endian-bitfields"}}'),t=i("2322"),o=i("2840");let s={title:"Exposing Microservices",description:"Provide external accessibility to microservices",sidebar_custom_props:{myEmoji:"\uD83D\uDEAA"}},c=void 0,a={},l=[{value:"Expose microservices using the PORT and ROUTE_PREFIX keywords",id:"expose-microservices-using-the-port-and-route_prefix-keywords",level:2},{value:"Connecting to microservices from a different INTERFACE in plugin.txt",id:"connecting-to-microservices-from-a-different-interface-in-plugintxt",level:2}];function d(e){let n={a:"a",admonition:"admonition",code:"code",h2:"h2",li:"li",p:"p",pre:"pre",ul:"ul",...(0,o.a)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.p,{children:"COSMOS provides a simple method to add new APIs and make custom microservices and interfaces accessible to the network."}),"\n",(0,t.jsx)(n.admonition,{title:"Make sure anything you expose is secure",type:"warning",children:(0,t.jsx)(n.p,{children:"Make sure that any new apis you expose check for user credentials and authorize actions appropriately."})}),"\n",(0,t.jsx)(n.h2,{id:"expose-microservices-using-the-port-and-route_prefix-keywords",children:"Expose microservices using the PORT and ROUTE_PREFIX keywords"}),"\n",(0,t.jsxs)(n.p,{children:["In your plugin.txt file, both ",(0,t.jsx)(n.a,{href:"../configuration/plugins#interface-1",children:"INTERFACE"})," and ",(0,t.jsx)(n.a,{href:"../configuration/plugins#microservice-1",children:"MICROSERVICE"})," support the keywords ",(0,t.jsx)(n.a,{href:"../configuration/plugins#port-1",children:"PORT"})," and ",(0,t.jsx)(n.a,{href:"../configuration/plugins#route_prefix-1",children:"ROUTE_PREFIX"}),"."]}),"\n",(0,t.jsxs)(n.p,{children:[(0,t.jsx)(n.a,{href:"../configuration/plugins#port-1",children:"PORT"})," is used to declare the port(s) that your microservice is listening for connections on. This is used in combination with ",(0,t.jsx)(n.a,{href:"../configuration/plugins#route_prefix-1",children:"ROUTE_PREFIX"})," to create a dynamic traefik route to your microservice."]}),"\n",(0,t.jsx)(n.p,{children:"The following code is used internally to let traefik know where to connect to your microservice internally:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-ruby",children:"if ENV['OPENC3_OPERATOR_HOSTNAME']\n url = \"http://#{ENV['OPENC3_OPERATOR_HOSTNAME']}:#{port}\"\nelse\n if ENV['KUBERNETES_SERVICE_HOST']\n url = \"http://#{microservice_name.downcase.gsub('__', '-').gsub('_', '-')}-service:#{port}\"\n else\n url = \"http://openc3-operator:#{port}\"\n end\nend\n"})}),"\n",(0,t.jsx)(n.p,{children:"Note that this is the internal route to your microservice. Determining this route checks two different environment variables."}),"\n",(0,t.jsx)(n.p,{children:'OPENC3_OPERATOR_HOSTNAME is used to override the default service name for our regular docker compose operator of "openc3-operator". Usually this is not set.'}),"\n",(0,t.jsx)(n.p,{children:"In OpenC3 Enterprise, KUBERNETES_SERVICE_HOST is used to detect if we are running in a Kubernetes environment (it will be set by Kubernetes), in which case the service is expected to have a Kubernetes service named scope-user-microservicename-service. For example, if you are using the DEFAULT scope and have a microservice named MYMICROSERVICE the service would be found at the hostname: default-user-mymicroservice-service. Double underscores or single underscores are replaced by a dash and the name is all lower case."}),"\n",(0,t.jsxs)(n.p,{children:[(0,t.jsx)(n.a,{href:"../configuration/plugins#route_prefix-1",children:"ROUTE_PREFIX"})," is used to define the external route. The external route will take the form of http(s)://YOURCOSMOSDOMAIN",":PORT","/ROUTE_PREFIX. So for example, if you set the ",(0,t.jsx)(n.a,{href:"../configuration/plugins#route_prefix-1",children:"ROUTE_PREFIX"})," to /mymicroservice then on a default local installation, it could be reached at ",(0,t.jsx)(n.code,{children:"http://localhost:2900/mymicroservice"}),". The ",(0,t.jsx)(n.code,{children:"http://localhost:2900"})," part should be substituted by whatever domain you are accessing COSMOS at."]}),"\n",(0,t.jsxs)(n.p,{children:["Here is a snippet of code showing ",(0,t.jsx)(n.a,{href:"../configuration/plugins#port-1",children:"PORT"})," and ",(0,t.jsx)(n.a,{href:"../configuration/plugins#route_prefix-1",children:"ROUTE_PREFIX"})," in use within a plugin.txt file:"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"VARIABLE cfdp_microservice_name CFDP\nVARIABLE cfdp_route_prefix /cfdp\nVARIABLE cfdp_port 2905\n\nMICROSERVICE CFDP <%= cfdp_microservice_name %>\n WORK_DIR .\n ROUTE_PREFIX <%= cfdp_route_prefix %>\n PORT <%= cfdp_port %>\n"})}),"\n",(0,t.jsx)(n.p,{children:"Leaving the variables at their default values the following will occur:"}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:["The microservice will be exposed internally to Docker (Open Source or Enterprise) at: ",(0,t.jsx)(n.code,{children:"http://openc3-operator:2905"})]}),"\n",(0,t.jsxs)(n.li,{children:["The microservice will be exposed internally to Kubernetes (Enterprise) at: ",(0,t.jsx)(n.code,{children:"http://default-user-cfdp-service:2905"})]}),"\n",(0,t.jsxs)(n.li,{children:["The microservice will be exposed externally to the network at: ",(0,t.jsx)(n.code,{children:"http://localhost:2900/cfdp"})]}),"\n"]}),"\n",(0,t.jsxs)(n.p,{children:["The same can be done for ",(0,t.jsx)(n.a,{href:"../configuration/plugins#interface-1",children:"INTERFACE"})," but note that the Kubernetes service name will use the microservice name of the interface which takes the form of ",(0,t.jsx)(n.code,{children:"SCOPE__INTERFACE__INTERFACENAME"}),"."]}),"\n",(0,t.jsxs)(n.p,{children:["Here is an example using ",(0,t.jsx)(n.a,{href:"../configuration/plugins#port",children:"PORT"})," and ",(0,t.jsx)(n.a,{href:"../configuration/plugins#route_prefix",children:"ROUTE_PREFIX"})," with ",(0,t.jsx)(n.a,{href:"../configuration/plugins#interface-1",children:"INTERFACE"}),":"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"VARIABLE my_interface_name MY_INT\nVARIABLE my_route_prefix /myint\nVARIABLE my_port 2910\n\nINTERFACE <%= my_interface_name %> http_server_interface.rb <%= my_port %>\n ROUTE_PREFIX <%= my_route_prefix %>\n PORT <%= my_port %>\n"})}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:["The interface will be exposed internally to Docker (Open Source or Enterprise) at: ",(0,t.jsx)(n.code,{children:"http://openc3-operator:2910"})]}),"\n",(0,t.jsxs)(n.li,{children:["The interface will be exposed internally to Kubernetes (Enterprise) at: ",(0,t.jsx)(n.code,{children:"http://default-interface-my-int-service:2905"})]}),"\n",(0,t.jsxs)(n.li,{children:["The interface will be exposed externally to the network at: ",(0,t.jsx)(n.code,{children:"http://localhost:2900/myint"})]}),"\n"]}),"\n",(0,t.jsx)(n.admonition,{title:"Sharded Operator on Kubernetes (Enterprise)",type:"warning",children:(0,t.jsx)(n.p,{children:"The sharded operator is expected to be used on Kubernetes whenever the Kubernetes Operator is not used. Typically this will be because the user does not have permission to use the Kubernetes API directly to spawn containers which is required for use of the Kubernetes Operator. In this case, Kubernetes services will NOT be automatically created, and will have to be manually created by a user with permissions in Kubernetes, or through some other authorized method (like a custom framework dashboard or config file)."})}),"\n",(0,t.jsx)(n.h2,{id:"connecting-to-microservices-from-a-different-interface-in-plugintxt",children:"Connecting to microservices from a different INTERFACE in plugin.txt"}),"\n",(0,t.jsx)(n.p,{children:"Sometimes you might want to have an INTERFACE connect to a microservice you are running. For this case, only the PORT keyword is required on the INTERFACE or MICROSERVICE because we are only connecting internally and ROUTE_PREFIX isn't used."}),"\n",(0,t.jsx)(n.p,{children:"The following code taken from our demo plugin provides an example of how to calculate the correct hostname across both Open Source and Enterprise versions of COSMOS in a plugin.txt file:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{children:" <% example_host = ENV['KUBERNETES_SERVICE_HOST'] ? \"#{scope}-user-#{example_microservice_name.downcase.gsub('__', '-').gsub('_', '-')}-service\" : \"openc3-operator\" %>\n INTERFACE <%= example_int_name %> example_interface.rb <%= example_host %> <%= example_port %>\n MAP_TARGET <%= example_target_name %>\n"})}),"\n",(0,t.jsx)(n.p,{children:"Note that the above code does not handle the OPENC3_OPERATOR_HOSTNAME environment variable which might change the default name of openc3-operator. Update as needed."})]})}function h(e={}){let{wrapper:n}={...(0,o.a)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(d,{...e})}):d(e)}},2840:function(e,n,i){i.d(n,{Z:function(){return c},a:function(){return s}});var r=i(2784);let t={},o=r.createContext(t);function s(e){let n=r.useContext(o);return r.useMemo(function(){return"function"==typeof e?e(n):{...n,...e}},[n,e])}function c(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(t):e.components||t:s(e.components),r.createElement(o.Provider,{value:n},e.children)}}}]);
|
@@ -1 +0,0 @@
|
|
1
|
-
"use strict";(self.webpackChunkdocs_openc3_com=self.webpackChunkdocs_openc3_com||[]).push([["8197"],{1647:function(e,t,n){n.r(t),n.d(t,{default:()=>h,frontMatter:()=>a,metadata:()=>s,assets:()=>d,toc:()=>c,contentTitle:()=>o});var s=JSON.parse('{"id":"configuration/protocols","title":"Protocols","description":"Built-in COSMOS protocols including how to create one","source":"@site/docs/configuration/protocols.md","sourceDirName":"configuration","slug":"/configuration/protocols","permalink":"/tools/staticdocs/docs/configuration/protocols","draft":false,"unlisted":false,"editUrl":"https://github.com/OpenC3/cosmos/tree/main/docs.openc3.com/docs/configuration/protocols.md","tags":[],"version":"current","sidebarPosition":7,"frontMatter":{"sidebar_position":7,"title":"Protocols","description":"Built-in COSMOS protocols including how to create one","sidebar_custom_props":{"myEmoji":"\uD83D\uDCA1"}},"sidebar":"defaultSidebar","previous":{"title":"Interfaces","permalink":"/tools/staticdocs/docs/configuration/interfaces"},"next":{"title":"Accessors","permalink":"/tools/staticdocs/docs/configuration/accessors"}}'),r=n("2322"),i=n("2840");let a={sidebar_position:7,title:"Protocols",description:"Built-in COSMOS protocols including how to create one",sidebar_custom_props:{myEmoji:"\uD83D\uDCA1"}},o=void 0,d={},c=[{value:"Packet Delineation Protocols",id:"packet-delineation-protocols",level:2},{value:"COBS Protocol",id:"cobs-protocol",level:3},{value:"SLIP Protocol",id:"slip-protocol",level:3},{value:"Burst Protocol",id:"burst-protocol",level:3},{value:"Fixed Protocol",id:"fixed-protocol",level:3},{value:"Length Protocol",id:"length-protocol",level:3},{value:"Terminated Protocol",id:"terminated-protocol",level:3},{value:"GEMS Protocol (Enterprise)",id:"gems-protocol-enterprise",level:3},{value:"CCSDS CLTU Protocol (Enterprise)",id:"ccsds-cltu-protocol-enterprise",level:3},{value:"CCSDS TCTF Protocol (Enterprise)",id:"ccsds-tctf-protocol-enterprise",level:3},{value:"CCSDS TMTF Protocol (Enterprise)",id:"ccsds-tmtf-protocol-enterprise",level:3},{value:"Template Protocol (Deprecated)",id:"template-protocol-deprecated",level:3},{value:"Preidentified Protocol (Internal)",id:"preidentified-protocol-internal",level:3},{value:"Helper Protocols",id:"helper-protocols",level:2},{value:"CmdResponse Protocol",id:"cmdresponse-protocol",level:3},{value:"Packet Definitions",id:"packet-definitions",level:4},{value:"CRC Protocol",id:"crc-protocol",level:3},{value:"Ignore Packet Protocol",id:"ignore-packet-protocol",level:3},{value:"Custom Protocols",id:"custom-protocols",level:2},{value:"Method discussions",id:"method-discussions",level:2},{value:"initialize or <strong>init</strong>",id:"initialize-or-init",level:3},{value:"reset",id:"reset",level:3},{value:"connect_reset",id:"connect_reset",level:3},{value:"disconnect_reset",id:"disconnect_reset",level:3},{value:"read_data",id:"read_data",level:3},{value:"read_packet",id:"read_packet",level:3},{value:"write_packet",id:"write_packet",level:3},{value:"write_data",id:"write_data",level:3},{value:"post_write_interface",id:"post_write_interface",level:3},{value:"protocol_cmd",id:"protocol_cmd",level:3},{value:"Examples",id:"examples",level:2}];function l(e){let t={a:"a",admonition:"admonition",code:"code",em:"em",h2:"h2",h3:"h3",h4:"h4",img:"img",p:"p",pre:"pre",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",...(0,i.a)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(t.p,{children:["Protocols process data on behalf of an ",(0,r.jsx)(t.a,{href:"interfaces",children:"Interface"}),". They can modify the data being written, data being read, or both. Protocols can also mark a packet as stored instead of real-time which means COSMOS will not update the current value table with the packet data. Protocols can be layered and will be processed in order. For example, if you have a low-level encryption layer that must be first removed before processing a higher level buffer length protocol."]}),"\n",(0,r.jsx)(t.admonition,{title:"Protocol Run Order",type:"info",children:(0,r.jsx)(t.p,{children:"Read protocols execute in the order specified (First specified runs first). Write protocols execute in the reverse order (Last specified executes first)."})}),"\n",(0,r.jsx)(t.p,{children:"Protocols are typically used to define the logic to delineate packets and manipulate data as it written to and read from Interfaces. COSMOS includes Interfaces for TCP/IP Client, TCP/IP Server, Udp Client / Server, and Serial connections. For 99% of use cases these Interfaces should not require any changes as they universally handle the low-level details of reading and writing from these types of connections. All unique behavior should now be defined in Protocols."}),"\n",(0,r.jsx)(t.p,{children:"At a minimum, any byte stream based Interface will require a Protocol to delineate packets. TCP/IP and Serial are examples of byte stream based Interfaces. A byte stream is just a simple stream of bytes and thus you need some way to know where packets begin and end within the stream."}),"\n",(0,r.jsx)(t.p,{children:"TCP/IP is a friendly byte stream. Unless you are dealing with a very poorly written system, the first byte received on a TCP/IP connection will always be the start of a packet. Also, TCP/IP is a reliable connection in that it ensures that all data is received in the correct order, that no data is lost, and that the data is not corrupted (TCP/IP is protected by a CRC32 which is pretty good for avoiding unrecognized data corruption)."}),"\n",(0,r.jsx)(t.p,{children:"Serial is a much less friendly byte stream. With serial connections, it is very likely that when you open a serial port and start receiving data you will receive the middle of a message. (This problem is only avoided when interfacing with a system that only writes to the serial port in response to a command). For this reason, sync patterns are highly beneficial for serial interfaces. Additionally, serial interfaces may use some method to protect against unrecognized data corruption (Checksums, CRCs, etc.)"}),"\n",(0,r.jsx)(t.p,{children:"UDP is an inherently packet based connection. If you read from a UDP socket, you will always receive back an entire packet. The best UDP based Protocols take advantage of this fact. Some implementations try to make UDP act like a byte stream, but this is a misuse of the protocol because it is highly likely that you will lose data and have no way to recover."}),"\n",(0,r.jsxs)(t.p,{children:["For more information about how Protocols fit with Interfaces and Accessors see ",(0,r.jsx)(t.a,{href:"https://www.openc3.com/news/interoperability-without-standards",children:"Interoperability Without Standards"}),"."]}),"\n",(0,r.jsx)(t.h2,{id:"packet-delineation-protocols",children:"Packet Delineation Protocols"}),"\n",(0,r.jsx)(t.p,{children:"COSMOS provides the following packet delineation protocols: COBS, SLIP, Burst, Fixed, Length, Template (deprecated), Terminated and Preidentified. Each of these protocols has the primary purpose of separating out packets from a byte stream."}),"\n",(0,r.jsx)(t.p,{children:"COSMOS Enterprise provides the following packet delineation protocols: CCSDS CLTU (with BCH Encoding), CCSDS TCTF (with Randomizer), CCSDS TMTF (with Randomizer), and GEMS."}),"\n",(0,r.jsxs)(t.p,{children:['Note that all protocols take a final parameter called "Allow Empty Data". This indicates whether the protocol will allow an empty string to be passed down to later Protocols (instead of returning ',":STOP","). Can be true, false, or nil, where nil is interpreted as true unless the Protocol is the last Protocol of the chain. End users of a protocol will almost always simply leave off this parameter. For more information read the ",(0,r.jsx)(t.a,{href:"/tools/staticdocs/docs/configuration/protocols#custom-protocols",children:"Custom Protocols"})," documentation."]}),"\n",(0,r.jsx)(t.p,{children:"Note the first parameter after the PROTOCOL keyword is how to apply the protocol: READ, WRITE, or READ_WRITE. Read applies the protocol on incoming packets (telemetry) and write on outgoing packets (commands). The next parameter is the protocol filename or class name. All other parameters are protocol specific."}),"\n",(0,r.jsx)(t.h3,{id:"cobs-protocol",children:"COBS Protocol"}),"\n",(0,r.jsxs)(t.p,{children:["The Consistent Overhead Byte Stuffing (COBS) Protocol is an algorithm for encoding data bytes that results in efficient, reliable, unambiguous packet framing regardless of packet content, thus making it easy for receiving applications to recover from malformed packets. It employs the zero byte value to serve as a packet delimiter (a special value that indicates the boundary between packets). The algorithm replaces each zero data byte with a non-zero value so that no zero data bytes will appear in the packet and thus be misinterpreted as packet boundaries (See ",(0,r.jsx)(t.a,{href:"https://en.wikipedia.org/wiki/Consistent_Overhead_Byte_Stuffing",children:"https://en.wikipedia.org/wiki/Consistent_Overhead_Byte_Stuffing"})," for more)."]}),"\n",(0,r.jsx)(t.h3,{id:"slip-protocol",children:"SLIP Protocol"}),"\n",(0,r.jsxs)(t.p,{children:["The Serial Line IP (SLIP) Protocol defines a sequence of characters that frame IP packets on a serial line. It defines two special characters: END and ESC. END is 0xC0 and ESC is 0xDB. To send a packet, a SLIP host simply starts sending the data in the packet. If a data byte is the same code as END character, a two byte sequence of ESC and 0xDC is sent instead. If a data bytes is the same as an ESC character, an two byte sequence of ESC and 0xDD is sent instead. When the last byte in the packet has been sent, an END character is then transmitted (See ",(0,r.jsx)(t.a,{href:"https://datatracker.ietf.org/doc/html/rfc1055",children:"https://datatracker.ietf.org/doc/html/rfc1055"})," for more)."]}),"\n",(0,r.jsxs)(t.table,{children:[(0,r.jsx)(t.thead,{children:(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.th,{children:"Parameter"}),(0,r.jsx)(t.th,{children:"Description"}),(0,r.jsx)(t.th,{children:"Required"}),(0,r.jsx)(t.th,{children:"Default"})]})}),(0,r.jsxs)(t.tbody,{children:[(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Start Char"}),(0,r.jsx)(t.td,{children:"Character to place at the start of frames"}),(0,r.jsx)(t.td,{children:"No"}),(0,r.jsx)(t.td,{children:"nil (no character)"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Read Strip Characters"}),(0,r.jsx)(t.td,{children:"Strip off start_char and end_char from reads"}),(0,r.jsx)(t.td,{children:"No"}),(0,r.jsx)(t.td,{children:"true"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Read Enable Escaping"}),(0,r.jsx)(t.td,{children:"Whether to enable character escaping on reads"}),(0,r.jsx)(t.td,{children:"No"}),(0,r.jsx)(t.td,{children:"true"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Write Enable Escaping"}),(0,r.jsx)(t.td,{children:"Whether to enable character escaping on writes"}),(0,r.jsx)(t.td,{children:"No"}),(0,r.jsx)(t.td,{children:"true"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"End Char"}),(0,r.jsx)(t.td,{children:"Character to place at the end of frames"}),(0,r.jsx)(t.td,{children:"No"}),(0,r.jsx)(t.td,{children:"0xC0"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Esc Char"}),(0,r.jsx)(t.td,{children:"Escape character"}),(0,r.jsx)(t.td,{children:"No"}),(0,r.jsx)(t.td,{children:"0xDB"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Escape End Char"}),(0,r.jsx)(t.td,{children:"Character to escape End character"}),(0,r.jsx)(t.td,{children:"No"}),(0,r.jsx)(t.td,{children:"0xDC"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Escape Esc Char"}),(0,r.jsx)(t.td,{children:"Character to escape Esc character"}),(0,r.jsx)(t.td,{children:"No"}),(0,r.jsx)(t.td,{children:"0xDD"})]})]})]}),"\n",(0,r.jsx)(t.h3,{id:"burst-protocol",children:"Burst Protocol"}),"\n",(0,r.jsx)(t.p,{children:"The Burst Protocol simply reads as much data as it can from the interface before returning the data as a COSMOS Packet (It returns a packet for each burst of data read). This Protocol relies on regular bursts of data delimited by time and thus is not very robust. However, it can utilize a sync pattern which does allow it to re-sync if necessary. It can also discard bytes from the incoming data to remove the sync pattern. Finally, it can add sync patterns to data being written out of the Interface."}),"\n",(0,r.jsxs)(t.table,{children:[(0,r.jsx)(t.thead,{children:(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.th,{children:"Parameter"}),(0,r.jsx)(t.th,{children:"Description"}),(0,r.jsx)(t.th,{children:"Required"}),(0,r.jsx)(t.th,{children:"Default"})]})}),(0,r.jsxs)(t.tbody,{children:[(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Discard Leading Bytes"}),(0,r.jsx)(t.td,{children:"The number of bytes to discard from the binary data after reading. Note that this applies to bytes starting with the sync pattern if the sync pattern is being used."}),(0,r.jsx)(t.td,{children:"No"}),(0,r.jsx)(t.td,{children:"0 (do not discard bytes)"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Sync Pattern"}),(0,r.jsx)(t.td,{children:"Hex string representing a byte pattern that will be searched for in the raw data. This pattern represents a packet delimiter and all data found including the sync pattern will be returned"}),(0,r.jsx)(t.td,{children:"No"}),(0,r.jsx)(t.td,{children:"nil (no sync pattern)"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Fill Fields"}),(0,r.jsx)(t.td,{children:"Whether to fill in the sync pattern on outgoing packets"}),(0,r.jsx)(t.td,{children:"No"}),(0,r.jsx)(t.td,{children:"false"})]})]})]}),"\n",(0,r.jsx)(t.h3,{id:"fixed-protocol",children:"Fixed Protocol"}),"\n",(0,r.jsx)(t.p,{children:"The Fixed Protocol reads a preset minimum amount of data which is necessary to properly identify all the defined packets using the interface. It then identifies the packet and proceeds to read as much data from the interface as necessary to create the packet which it then returns. This protocol relies on all the packets on the interface being fixed in length. For example, all the packets using the interface are a fixed size and contain a simple header with a 32-bit sync pattern followed by a 16 bit ID. The Fixed Protocol would elegantly handle this case with a minimum read size of 6 bytes. The Fixed Protocol also supports a sync pattern, discarding leading bytes, and filling the sync pattern similar to the Burst Protocol."}),"\n",(0,r.jsxs)(t.table,{children:[(0,r.jsx)(t.thead,{children:(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.th,{children:"Parameter"}),(0,r.jsx)(t.th,{children:"Description"}),(0,r.jsx)(t.th,{children:"Required"}),(0,r.jsx)(t.th,{children:"Default"})]})}),(0,r.jsxs)(t.tbody,{children:[(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Minimum ID Size"}),(0,r.jsx)(t.td,{children:"The minimum number of bytes needed to identify a packet. All the packet definitions must declare their ID_ITEM(s) within this given number of bytes."}),(0,r.jsx)(t.td,{children:"Yes"}),(0,r.jsx)(t.td,{})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Discard Leading Bytes"}),(0,r.jsx)(t.td,{children:"The number of bytes to discard from the binary data after reading. Note that this applies to bytes starting with the sync pattern if the sync pattern is being used."}),(0,r.jsx)(t.td,{children:"No"}),(0,r.jsx)(t.td,{children:"0 (do not discard bytes)"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Sync Pattern"}),(0,r.jsx)(t.td,{children:"Hex string representing a byte pattern that will be searched for in the raw data. This pattern represents a packet delimiter and all data found including the sync pattern will be returned."}),(0,r.jsx)(t.td,{children:"No"}),(0,r.jsx)(t.td,{children:"nil (no sync pattern)"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Telemetry"}),(0,r.jsx)(t.td,{children:"Whether the data is telemetry"}),(0,r.jsx)(t.td,{children:"No"}),(0,r.jsx)(t.td,{children:"true (false means command)"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Fill Fields"}),(0,r.jsx)(t.td,{children:"Whether to fill in the sync pattern on outgoing packets"}),(0,r.jsx)(t.td,{children:"No"}),(0,r.jsx)(t.td,{children:"false"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Unknown Raise"}),(0,r.jsx)(t.td,{children:"Whether to raise an exception for an unknown packet"}),(0,r.jsx)(t.td,{children:"No"}),(0,r.jsx)(t.td,{children:"false"})]})]})]}),"\n",(0,r.jsx)(t.h3,{id:"length-protocol",children:"Length Protocol"}),"\n",(0,r.jsx)(t.p,{children:"The Length Protocol depends on a length field at a fixed location in the defined packets using the interface. It then reads enough data to grab the length field, decodes it, and reads the remaining length of the packet. For example, all the packets using the interface contain a CCSDS header with a length field. The Length Protocol can be set up to handle the length field and even the length offset CCSDS uses. The Length Protocol also supports a sync pattern, discarding leading bytes, and filling the length and sync pattern similar to the Burst Protocol."}),"\n",(0,r.jsxs)(t.table,{children:[(0,r.jsx)(t.thead,{children:(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.th,{children:"Parameter"}),(0,r.jsx)(t.th,{children:"Description"}),(0,r.jsx)(t.th,{children:"Required"}),(0,r.jsx)(t.th,{children:"Default"})]})}),(0,r.jsxs)(t.tbody,{children:[(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Length Bit Offset"}),(0,r.jsx)(t.td,{children:"The bit offset from the start of the packet to the length field. Every packet using this interface must have the same structure such that the length field is the same size at the same location. Be sure to account for the length of the Sync Pattern in this value (if present)."}),(0,r.jsx)(t.td,{children:"No"}),(0,r.jsx)(t.td,{children:"0 bits"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Length Bit Size"}),(0,r.jsx)(t.td,{children:"The size in bits of the length field"}),(0,r.jsx)(t.td,{children:"No"}),(0,r.jsx)(t.td,{children:"16 bits"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Length Value Offset"}),(0,r.jsx)(t.td,{children:"The offset to apply to the length field value. The actual value of the length field plus this offset should equal the exact number of bytes required to read all data for the packet (including the length field itself, sync pattern, etc). For example, if the length field indicates packet length minus one, this value should be one. Be sure to account for the length of the Sync Pattern in this value (if present)."}),(0,r.jsx)(t.td,{children:"No"}),(0,r.jsx)(t.td,{children:"0"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Bytes per Count"}),(0,r.jsx)(t.td,{children:"The number of bytes per each length field 'count'. This is used if the units of the length field is something other than bytes, e.g. if the length field count is in words."}),(0,r.jsx)(t.td,{children:"No"}),(0,r.jsx)(t.td,{children:"1 byte"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Length Endianness"}),(0,r.jsx)(t.td,{children:"The endianness of the length field. Must be either 'BIG_ENDIAN' or 'LITTLE_ENDIAN'."}),(0,r.jsx)(t.td,{children:"No"}),(0,r.jsx)(t.td,{children:"'BIG_ENDIAN'"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Discard Leading Bytes"}),(0,r.jsx)(t.td,{children:"The number of bytes to discard from the binary data after reading. Note that this applies to bytes including the sync pattern if the sync pattern is being used. Discarding is one of the very last steps so any size and offsets above need to account for all the data before discarding."}),(0,r.jsx)(t.td,{children:"No"}),(0,r.jsx)(t.td,{children:"0 (do not discard bytes)"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Sync Pattern"}),(0,r.jsx)(t.td,{children:"Hex string representing a byte pattern that will be searched for in the raw data. This pattern represents a packet delimiter and all data found including the sync pattern will be returned."}),(0,r.jsx)(t.td,{children:"No"}),(0,r.jsx)(t.td,{children:"nil (no sync pattern)"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Max Length"}),(0,r.jsx)(t.td,{children:"The maximum allowed value in the length field"}),(0,r.jsx)(t.td,{children:"No"}),(0,r.jsx)(t.td,{children:"nil (no maximum length)"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Fill Length and Sync Pattern"}),(0,r.jsx)(t.td,{children:"Setting this flag to true causes the length field and sync pattern (if present) to be filled automatically on outgoing packets."}),(0,r.jsx)(t.td,{children:"No"}),(0,r.jsx)(t.td,{children:"false"})]})]})]}),"\n",(0,r.jsx)(t.p,{children:"The most confusing aspect of the Length Protocol is calculating the Length Value Offset. This is especially true in the commonly used CCSDS Space Packet Protocol. The best way to illustrate this is with an example. Suppose you have CCSDS Space Packets prepended with a Sync Pattern of 0x1ACFFC1D. This would look like the following:"}),"\n",(0,r.jsxs)(t.table,{children:[(0,r.jsx)(t.thead,{children:(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.th,{children:"Sync (4 bytes)"}),(0,r.jsx)(t.th,{children:"Header (4 bytes)"}),(0,r.jsx)(t.th,{children:"Length (2 bytes)"}),(0,r.jsx)(t.th,{children:"Data (4 bytes)"})]})}),(0,r.jsx)(t.tbody,{children:(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"0x1ACFFC1D"}),(0,r.jsx)(t.td,{children:"0x0001CADB"}),(0,r.jsx)(t.td,{children:"0x0003"}),(0,r.jsx)(t.td,{children:"0xDEADBEEF"})]})})]}),"\n",(0,r.jsxs)(t.p,{children:["In this case the total length of the packet is 14 bytes: ",(0,r.jsx)(t.strong,{children:"4 + 4 + 2 + 4 = 14"}),". With 4 bytes of data, the length field is 3 because in CCSDS the length field is calculated as (data length - 1). So how would we calculate the Length Value Offset? COSMOS reads all the bytes in the packet (including the Sync Pattern) so the total length is 14 bytes. The length field is 3 so the Length Value Offset (offset to apply to the length field value) should be 11 (",(0,r.jsx)(t.strong,{children:"3 + 11 = 14"}),")."]}),"\n",(0,r.jsx)(t.h3,{id:"terminated-protocol",children:"Terminated Protocol"}),"\n",(0,r.jsx)(t.p,{children:"The Terminated Protocol delineates packets using termination characters found at the end of every packet. It continuously reads data until the termination characters are found at which point it returns the packet data. For example, all the packets using the interface are followed by 0xABCD. This data can either be a part of each packet that is kept or something which is known only by the Terminated Protocol and simply thrown away."}),"\n",(0,r.jsxs)(t.table,{children:[(0,r.jsx)(t.thead,{children:(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.th,{children:"Parameter"}),(0,r.jsx)(t.th,{children:"Description"}),(0,r.jsx)(t.th,{children:"Required"}),(0,r.jsx)(t.th,{children:"Default"})]})}),(0,r.jsxs)(t.tbody,{children:[(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Write Termination Characters"}),(0,r.jsx)(t.td,{children:"The data to write after writing a command packet. Given as a hex string such as 0xABCD."}),(0,r.jsx)(t.td,{children:"Yes"}),(0,r.jsx)(t.td,{})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Read Termination Characters"}),(0,r.jsx)(t.td,{children:"The characters which delineate the end of a telemetry packet. Given as a hex string such as 0xABCD."}),(0,r.jsx)(t.td,{children:"Yes"}),(0,r.jsx)(t.td,{})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Strip Read Termination"}),(0,r.jsx)(t.td,{children:"Whether to remove the read termination characters before returning the telemetry packet"}),(0,r.jsx)(t.td,{children:"No"}),(0,r.jsx)(t.td,{children:"true"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Discard Leading Bytes"}),(0,r.jsx)(t.td,{children:"The number of bytes to discard from the binary data after reading. Note that this applies to bytes including the sync pattern if the sync pattern is being used."}),(0,r.jsx)(t.td,{children:"No"}),(0,r.jsx)(t.td,{children:"0 (do not discard bytes)"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Sync Pattern"}),(0,r.jsx)(t.td,{children:"Hex string representing a byte pattern that will be searched for in the raw data. This pattern represents a packet delimiter and all data found including the sync pattern will be returned."}),(0,r.jsx)(t.td,{children:"No"}),(0,r.jsx)(t.td,{children:"nil (no sync pattern)"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Fill Fields"}),(0,r.jsx)(t.td,{children:"Whether to fill in the sync pattern on outgoing packets"}),(0,r.jsx)(t.td,{children:"No"}),(0,r.jsx)(t.td,{children:"false"})]})]})]}),"\n",(0,r.jsx)(t.h3,{id:"gems-protocol-enterprise",children:"GEMS Protocol (Enterprise)"}),"\n",(0,r.jsx)(t.p,{children:"The GEMS Protocol implements the Ground Equipment Monitoring Service protocol. It is added along with the TerminatedProtocol which delineates packets using '|END'. The GEMS Interface is currently only implemented in Ruby."}),"\n",(0,r.jsx)(t.p,{children:"The GEMS protocol doesn't take any parameters but should be added to an interface after the TerminatedProtocol and CmdResponseProtocol."}),"\n",(0,r.jsx)(t.p,{children:"plugin.txt Ruby Example:"}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-ruby",children:"INTERFACE GEMS_INT tcpip_client_interface.rb openc3-operator 8080 8080 10.0 nil nil\n # TerminatedProtocol 0x7C454E44 0x7C454E44 false 0 0x7C47454D53 false ... means:\n # wtc rtc strip discard sync fill\n # where wtc = write termination characters, end of the gems protocol: 0x7C454E44 == '|END'\n # rtc = read termination characters, end of the gems protocol: 0x7C454E44 == '|END'\n # strip = strip read termination (false)\n # discard = 0 bytes\n # sync pattern = beginning of the GEMS protocol: 0x7C47454D53 == '|GEMS'\n # fill = whether to fill in the sync pattern (false as we specify fill in our cmd/tlm definitions)\n PROTOCOL READ TerminatedProtocol 0x7C454E44 0x7C454E44 false 0 0x7C47454D53 false\n # CmdResponseProtocol 5.0 0.2 true means:\n # 5 sec response timeout, 0.2 sec response polling,\n # and true to raise exceptions when protocol errors occur\n PROTOCOL READ_WRITE CmdResponseProtocol 5.0 0.2 true\n PROTOCOL READ_WRITE GemsProtocol\n"})}),"\n",(0,r.jsxs)(t.p,{children:["For a full example, please see the ",(0,r.jsx)(t.a,{href:"https://github.com/OpenC3/cosmos-enterprise-plugins/tree/main/openc3-cosmos-gems-interface",children:"openc3-cosmos-gems-interface"})," in the COSMOS Enterprise Plugins."]}),"\n",(0,r.jsx)(t.h3,{id:"ccsds-cltu-protocol-enterprise",children:"CCSDS CLTU Protocol (Enterprise)"}),"\n",(0,r.jsx)(t.p,{children:"The CCSDS CLTU Protocol handles the CLTU (Communicates Link Transfer Unit) for Command Streams. It encodes outgoing messages with a BCH encoding and then applies a header and footer to the data."}),"\n",(0,r.jsxs)(t.table,{children:[(0,r.jsx)(t.thead,{children:(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.th,{children:"Parameter"}),(0,r.jsx)(t.th,{children:"Description"}),(0,r.jsx)(t.th,{children:"Required"}),(0,r.jsx)(t.th,{children:"Default"})]})}),(0,r.jsxs)(t.tbody,{children:[(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Header"}),(0,r.jsx)(t.td,{children:"Header before BCH encoded data"}),(0,r.jsx)(t.td,{children:"No"}),(0,r.jsx)(t.td,{children:"0xEB90"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Footer"}),(0,r.jsx)(t.td,{children:"Footer after BCH encoded data"}),(0,r.jsx)(t.td,{children:"No"}),(0,r.jsx)(t.td,{children:"0xC5C5C5C5C5C5C579"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Fill Byte"}),(0,r.jsx)(t.td,{children:"BCH encoding fill byte"}),(0,r.jsx)(t.td,{children:"No"}),(0,r.jsx)(t.td,{children:"0x55"})]})]})]}),"\n",(0,r.jsxs)(t.p,{children:["For a full example, please see the ",(0,r.jsx)(t.a,{href:"https://github.com/OpenC3/cosmos-enterprise-plugins/tree/main/openc3-cosmos-ccsds-protocols",children:"openc3-cosmos-ccsds-protocols"})," in the COSMOS Enterprise Plugins."]}),"\n",(0,r.jsx)(t.h3,{id:"ccsds-tctf-protocol-enterprise",children:"CCSDS TCTF Protocol (Enterprise)"}),"\n",(0,r.jsx)(t.p,{children:"The CCSDS TCTF Protocol handles the Telecommand Transfer Frame for Command Streams."}),"\n",(0,r.jsxs)(t.table,{children:[(0,r.jsx)(t.thead,{children:(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.th,{children:"Parameter"}),(0,r.jsx)(t.th,{children:"Description"}),(0,r.jsx)(t.th,{children:"Required"}),(0,r.jsx)(t.th,{children:"Default"})]})}),(0,r.jsxs)(t.tbody,{children:[(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Randomization"}),(0,r.jsx)(t.td,{children:"Whether to encode and randomize the transfer frame"}),(0,r.jsx)(t.td,{children:"No"}),(0,r.jsx)(t.td,{children:"true"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Error Control"}),(0,r.jsx)(t.td,{children:"Whether to use the Frame Error Control Field and apply a 16 bit CRC"}),(0,r.jsx)(t.td,{children:"No"}),(0,r.jsx)(t.td,{children:"false"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Bypass"}),(0,r.jsx)(t.td,{children:"Bypass bit where 0 is Type-A and 1 is Type-B (bypass frame acceptance checks)"}),(0,r.jsx)(t.td,{children:"No"}),(0,r.jsx)(t.td,{children:"1"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"SCID"}),(0,r.jsx)(t.td,{children:"Spacecraft Identifier (10 bits)"}),(0,r.jsx)(t.td,{children:"No"}),(0,r.jsx)(t.td,{children:"0"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"VCID"}),(0,r.jsx)(t.td,{children:"Virtual Channel Identifier (6 bits)"}),(0,r.jsx)(t.td,{children:"No"}),(0,r.jsx)(t.td,{children:"0"})]})]})]}),"\n",(0,r.jsxs)(t.p,{children:["For a full example, please see the ",(0,r.jsx)(t.a,{href:"https://github.com/OpenC3/cosmos-enterprise-plugins/tree/main/openc3-cosmos-ccsds-protocols",children:"openc3-cosmos-ccsds-protocols"})," in the COSMOS Enterprise Plugins."]}),"\n",(0,r.jsx)(t.h3,{id:"ccsds-tmtf-protocol-enterprise",children:"CCSDS TMTF Protocol (Enterprise)"}),"\n",(0,r.jsx)(t.p,{children:"The CCSDS TMTF Protocol handles the Telemetry Transfer Frame for Telemetry Streams. It adds VCID, MC_FRM_CNT, VC_FRM_CNT to extra which will be included in the Decom data."}),"\n",(0,r.jsxs)(t.table,{children:[(0,r.jsx)(t.thead,{children:(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.th,{children:"Parameter"}),(0,r.jsx)(t.th,{children:"Description"}),(0,r.jsx)(t.th,{children:"Required"}),(0,r.jsx)(t.th,{children:"Default"})]})}),(0,r.jsxs)(t.tbody,{children:[(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"SCID"}),(0,r.jsx)(t.td,{children:"Spacecraft Identifier (10 bits)"}),(0,r.jsx)(t.td,{children:"Yes"}),(0,r.jsx)(t.td,{})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Frame Length"}),(0,r.jsx)(t.td,{}),(0,r.jsx)(t.td,{children:"No"}),(0,r.jsx)(t.td,{children:"2048"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Randomization"}),(0,r.jsx)(t.td,{children:"Whether the transfer frame was encoded and randomized"}),(0,r.jsx)(t.td,{children:"No"}),(0,r.jsx)(t.td,{children:"true"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Discard Leading Bytes"}),(0,r.jsx)(t.td,{children:"The number of bytes to discard from the binary data after reading. Note that this applies to bytes including the sync pattern if the sync pattern is being used."}),(0,r.jsx)(t.td,{children:"No"}),(0,r.jsx)(t.td,{children:"0 (do not discard bytes)"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Sync Pattern"}),(0,r.jsx)(t.td,{children:"Hex string representing a byte pattern that will be searched for in the raw data. This pattern represents a packet delimiter and all data found including the sync pattern will be returned."}),(0,r.jsx)(t.td,{children:"No"}),(0,r.jsx)(t.td,{children:"0x1ACFFC1D"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Fill Fields"}),(0,r.jsx)(t.td,{children:"Whether to fill in the sync pattern on outgoing packets"}),(0,r.jsx)(t.td,{children:"No"}),(0,r.jsx)(t.td,{children:"true"})]})]})]}),"\n",(0,r.jsxs)(t.p,{children:["For a full example, please see the ",(0,r.jsx)(t.a,{href:"https://github.com/OpenC3/cosmos-enterprise-plugins/tree/main/openc3-cosmos-ccsds-protocols",children:"openc3-cosmos-ccsds-protocols"})," in the COSMOS Enterprise Plugins."]}),"\n",(0,r.jsx)(t.h3,{id:"template-protocol-deprecated",children:"Template Protocol (Deprecated)"}),"\n",(0,r.jsx)(t.p,{children:"This protocol is now deprecated because it is not able to capture the original SCPI messages in COSMOS raw logging. Please use the TemplateAccessor with the CmdResponseProtocol instead."}),"\n",(0,r.jsxs)(t.p,{children:["The Template Protocol works much like the Terminated Protocol except it is designed for text-based command and response type interfaces such as SCPI (Standard Commands for Programmable Instruments). It delineates packets in the same way as the Terminated Protocol except each packet is referred to as a line (because each usually contains a line of text). For outgoing packets, a CMD_TEMPLATE field is expected to exist in the packet. This field contains a template string with items to be filled in delineated within HTML tag style brackets ",(0,r.jsx)(t.code,{children:'"<EXAMPLE>"'}),". The Template Protocol will read the named items from within the packet and fill in the CMD_TEMPLATE. This filled in string is then sent out rather than the originally passed in packet. Correspondingly, if a response is expected the outgoing packet should include a RSP_TEMPLATE and RSP_PACKET field. The RSP_TEMPLATE is used to extract data from the response string and build a corresponding RSP_PACKET. See the TEMPLATE target within the COSMOS Demo configuration for an example of usage."]}),"\n",(0,r.jsxs)(t.table,{children:[(0,r.jsx)(t.thead,{children:(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.th,{children:"Parameter"}),(0,r.jsx)(t.th,{children:"Description"}),(0,r.jsx)(t.th,{children:"Required"}),(0,r.jsx)(t.th,{children:"Default"})]})}),(0,r.jsxs)(t.tbody,{children:[(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Write Termination Characters"}),(0,r.jsx)(t.td,{children:"The data to write after writing a command packet. Given as a hex string such as 0xABCD."}),(0,r.jsx)(t.td,{children:"Yes"}),(0,r.jsx)(t.td,{})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Read Termination Characters"}),(0,r.jsx)(t.td,{children:"The characters which delineate the end of a telemetry packet. Given as a hex string such as 0xABCD."}),(0,r.jsx)(t.td,{children:"Yes"}),(0,r.jsx)(t.td,{})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Ignore Lines"}),(0,r.jsx)(t.td,{children:"Number of response lines to ignore (completely drop)"}),(0,r.jsx)(t.td,{children:"No"}),(0,r.jsx)(t.td,{children:"0 lines"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Initial Read Delay"}),(0,r.jsx)(t.td,{children:"An initial delay after connecting after which the interface will be read till empty and data dropped. Useful for discarding connect headers and initial prompts."}),(0,r.jsx)(t.td,{children:"No"}),(0,r.jsx)(t.td,{children:"nil (no initial read)"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Response Lines"}),(0,r.jsx)(t.td,{children:"The number of lines that make up expected responses"}),(0,r.jsx)(t.td,{children:"No"}),(0,r.jsx)(t.td,{children:"1 line"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Strip Read Termination"}),(0,r.jsx)(t.td,{children:"Whether to remove the read termination characters before returning the telemetry packet"}),(0,r.jsx)(t.td,{children:"No"}),(0,r.jsx)(t.td,{children:"true"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Discard Leading Bytes"}),(0,r.jsx)(t.td,{children:"The number of bytes to discard from the binary data after reading. Note that this applies to bytes including the sync pattern if the sync pattern is being used."}),(0,r.jsx)(t.td,{children:"No"}),(0,r.jsx)(t.td,{children:"0 (do not discard bytes)"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Sync Pattern"}),(0,r.jsx)(t.td,{children:"Hex string representing a byte pattern that will be searched for in the raw data. This pattern represents a packet delimiter and all data found including the sync pattern will be returned."}),(0,r.jsx)(t.td,{children:"No"}),(0,r.jsx)(t.td,{children:"nil (no sync pattern)"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Fill Fields"}),(0,r.jsx)(t.td,{children:"Whether to fill in the sync pattern on outgoing packets"}),(0,r.jsx)(t.td,{children:"No"}),(0,r.jsx)(t.td,{children:"false"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Response Timeout"}),(0,r.jsx)(t.td,{children:"Number of seconds to wait for a response before timing out"}),(0,r.jsx)(t.td,{children:"No"}),(0,r.jsx)(t.td,{children:"5.0"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Response Polling Period"}),(0,r.jsx)(t.td,{children:"Number of seconds to wait between polling for a response"}),(0,r.jsx)(t.td,{children:"No"}),(0,r.jsx)(t.td,{children:"0.02"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Raise Exceptions"}),(0,r.jsx)(t.td,{children:"Whether to raise exceptions when errors occur like timeouts or unexpected responses"}),(0,r.jsx)(t.td,{children:"No"}),(0,r.jsx)(t.td,{children:"false"})]})]})]}),"\n",(0,r.jsx)(t.h3,{id:"preidentified-protocol-internal",children:"Preidentified Protocol (Internal)"}),"\n",(0,r.jsx)(t.p,{children:"The Preidentified Protocol delineates packets using a custom COSMOS header. This internal Protocol was 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."}),"\n",(0,r.jsxs)(t.table,{children:[(0,r.jsx)(t.thead,{children:(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.th,{children:"Parameter"}),(0,r.jsx)(t.th,{children:"Description"}),(0,r.jsx)(t.th,{children:"Required"}),(0,r.jsx)(t.th,{children:"Default"})]})}),(0,r.jsxs)(t.tbody,{children:[(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Sync Pattern"}),(0,r.jsx)(t.td,{children:"Hex string representing a byte pattern that will be searched for in the raw data. This pattern represents a packet delimiter and all data found AFTER the sync pattern will be returned. The sync pattern itself is discarded."}),(0,r.jsx)(t.td,{children:"No"}),(0,r.jsx)(t.td,{children:"nil (no sync pattern)"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Max Length"}),(0,r.jsx)(t.td,{children:"The maximum allowed value in the length field"}),(0,r.jsx)(t.td,{children:"No"}),(0,r.jsx)(t.td,{children:"nil (no maximum length)"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Mode"}),(0,r.jsx)(t.td,{children:"The Version of the preidentified protocol to support (2 or 4).3"}),(0,r.jsx)(t.td,{children:"No"}),(0,r.jsx)(t.td,{children:"4"})]})]})]}),"\n",(0,r.jsx)(t.h2,{id:"helper-protocols",children:"Helper Protocols"}),"\n",(0,r.jsx)(t.p,{children:"COSMOS provides the following helper protocols: CmdResponse, Crc and Ignore. These protocols provide helper functionality to Interfaces."}),"\n",(0,r.jsx)(t.h3,{id:"cmdresponse-protocol",children:"CmdResponse Protocol"}),"\n",(0,r.jsx)(t.p,{children:"The CmdResponse Protocol waits for a response for any commands with a defined response packet."}),"\n",(0,r.jsxs)(t.table,{children:[(0,r.jsx)(t.thead,{children:(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.th,{children:"Parameter"}),(0,r.jsx)(t.th,{children:"Description"}),(0,r.jsx)(t.th,{children:"Required"}),(0,r.jsx)(t.th,{children:"Default"})]})}),(0,r.jsxs)(t.tbody,{children:[(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Response Timeout"}),(0,r.jsx)(t.td,{children:"Number of seconds to wait before timing out when waiting for a response"}),(0,r.jsx)(t.td,{children:"No"}),(0,r.jsx)(t.td,{children:"5"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Response Polling Period"}),(0,r.jsx)(t.td,{children:"Number of seconds to wait between polling for a response"}),(0,r.jsx)(t.td,{children:"No"}),(0,r.jsx)(t.td,{children:"0.02"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Raise Exceptions"}),(0,r.jsx)(t.td,{children:"Whether to raise exceptions when errors occur in the protocol like unexpected responses or response timeouts"}),(0,r.jsx)(t.td,{children:"No"}),(0,r.jsx)(t.td,{children:"false"})]})]})]}),"\n",(0,r.jsx)(t.h4,{id:"packet-definitions",children:"Packet Definitions"}),"\n",(0,r.jsxs)(t.p,{children:["The CmdResponseProtocol utilizes the ",(0,r.jsx)(t.a,{href:"../configuration/command#response",children:"RESPONSE"})," keyword in the command definition to determine which telemetry packet should be expected when the given command is sent."]}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{children:'COMMAND SCPI_PS GET_STATUS BIG_ENDIAN "Gets status"\n ACCESSOR TemplateAccessor\n TEMPLATE ":MEAS:VOLT? (@1:2)"\n RESPONSE SCPI_PS STATUS\n'})}),"\n",(0,r.jsx)(t.p,{children:"The Response packet (STATUS) should be defined to contain the response data."}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{children:'TELEMETRY SCPI_PS STATUS BIG_ENDIAN "Status"\n ACCESSOR TemplateAccessor\n TEMPLATE "<MEAS_VOLTAGE_1>,<MEAS_VOLTAGE_2>"\n APPEND_ITEM MEAS_VOLTAGE_1 32 FLOAT "Voltage Reading for Channel 1"\n UNITS VOLTS V\n FORMAT_STRING %0.3f\n APPEND_ITEM MEAS_VOLTAGE_2 32 FLOAT "Voltage Reading for Channel 2"\n UNITS VOLTS V\n FORMAT_STRING %0.3f\n'})}),"\n",(0,r.jsxs)(t.p,{children:["For a full example, please see the ",(0,r.jsx)(t.a,{href:"https://github.com/OpenC3/cosmos-enterprise-plugins/tree/main/openc3-cosmos-scpi-power-supply",children:"openc3-cosmos-scpi-power-supply"})," in the COSMOS Enterprise Plugins."]}),"\n",(0,r.jsx)(t.h3,{id:"crc-protocol",children:"CRC Protocol"}),"\n",(0,r.jsx)(t.p,{children:"The CRC protocol can add CRCs to outgoing commands and verify CRCs on incoming telemetry packets."}),"\n",(0,r.jsxs)(t.table,{children:[(0,r.jsx)(t.thead,{children:(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.th,{children:"Parameter"}),(0,r.jsx)(t.th,{children:"Description"}),(0,r.jsx)(t.th,{children:"Required"}),(0,r.jsx)(t.th,{children:"Default"})]})}),(0,r.jsxs)(t.tbody,{children:[(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Write Item Name"}),(0,r.jsx)(t.td,{children:"Item to fill with calculated CRC value for outgoing packets (nil = don't fill)"}),(0,r.jsx)(t.td,{children:"No"}),(0,r.jsx)(t.td,{children:"nil"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Strip CRC"}),(0,r.jsx)(t.td,{children:"Whether to remove the CRC from incoming packets"}),(0,r.jsx)(t.td,{children:"No"}),(0,r.jsx)(t.td,{children:"false"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Bad Strategy"}),(0,r.jsx)(t.td,{children:"How to handle CRC errors on incoming packets. ERROR = Just log the error, DISCONNECT = Disconnect interface"}),(0,r.jsx)(t.td,{children:"No"}),(0,r.jsx)(t.td,{children:'"ERROR"'})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Bit Offset"}),(0,r.jsx)(t.td,{children:"Bit offset of the CRC in the data. Can be negative to indicate distance from end of packet"}),(0,r.jsx)(t.td,{children:"No"}),(0,r.jsx)(t.td,{children:"-32"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Bit Size"}),(0,r.jsx)(t.td,{children:"Bit size of the CRC - Must be 16, 32, or 64"}),(0,r.jsx)(t.td,{children:"No"}),(0,r.jsx)(t.td,{children:"32"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Endianness"}),(0,r.jsx)(t.td,{children:"Endianness of the CRC (BIG_ENDIAN/LITTLE_ENDIAN)"}),(0,r.jsx)(t.td,{children:"No"}),(0,r.jsx)(t.td,{children:'"BIG_ENDIAN"'})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Poly"}),(0,r.jsx)(t.td,{children:"Polynomial to use when calculating the CRC expressed as an integer"}),(0,r.jsx)(t.td,{children:"No"}),(0,r.jsx)(t.td,{children:"nil (use default polynomial - 16-bit=0x1021, 32-bit=0x04C11DB7, 64-bit=0x42F0E1EBA9EA3693)"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Seed"}),(0,r.jsx)(t.td,{children:"Seed value to start the calculation"}),(0,r.jsx)(t.td,{children:"No"}),(0,r.jsx)(t.td,{children:"nil (use default seed - 16-bit=0xFFFF, 32-bit=0xFFFFFFFF, 64-bit=0xFFFFFFFFFFFFFFFF)"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Xor"}),(0,r.jsx)(t.td,{children:"Whether to XOR the CRC result with 0xFFFF"}),(0,r.jsx)(t.td,{children:"No"}),(0,r.jsx)(t.td,{children:"nil (use default value - 16-bit=false, 32-bit=true, 64-bit=true)"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Reflect"}),(0,r.jsx)(t.td,{children:"Whether to bit reverse each byte of data before calculating the CRC"}),(0,r.jsx)(t.td,{children:"No"}),(0,r.jsx)(t.td,{children:"nil (use default value - 16-bit=false, 32-bit=true, 64-bit=true)"})]})]})]}),"\n",(0,r.jsx)(t.h3,{id:"ignore-packet-protocol",children:"Ignore Packet Protocol"}),"\n",(0,r.jsx)(t.p,{children:"The Ignore Packet protocol drops specified command packets sent by COSMOS or drops incoming telemetry packets."}),"\n",(0,r.jsxs)(t.table,{children:[(0,r.jsx)(t.thead,{children:(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.th,{children:"Parameter"}),(0,r.jsx)(t.th,{children:"Description"}),(0,r.jsx)(t.th,{children:"Required"}),(0,r.jsx)(t.th,{children:"Default"})]})}),(0,r.jsxs)(t.tbody,{children:[(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Target Name"}),(0,r.jsx)(t.td,{children:"Target name of the packet to ignore"}),(0,r.jsx)(t.td,{children:"Yes"}),(0,r.jsx)(t.td,{children:"nil"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Packet Name"}),(0,r.jsx)(t.td,{children:"Packet name of the packet to ignore"}),(0,r.jsx)(t.td,{children:"Yes"}),(0,r.jsx)(t.td,{children:"nil"})]})]})]}),"\n",(0,r.jsx)(t.h2,{id:"custom-protocols",children:"Custom Protocols"}),"\n",(0,r.jsx)(t.p,{children:"Creating a custom protocol is easy and should be the default solution for customizing COSMOS Interfaces (rather than creating a new Interface class). However, creating custom Interfaces is still useful for defaulting parameters to values that always are fixed for your target and for including the necessary Protocols. The 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."}),"\n",(0,r.jsxs)(t.p,{children:["All custom Protocols should derive from the Protocol class ",(0,r.jsx)(t.a,{href:"https://github.com/OpenC3/cosmos/blob/main/openc3/lib/openc3/interfaces/protocols/protocol.rb",children:"openc3/interfaces/protocols/protocol.rb"})," (Ruby) and ",(0,r.jsx)(t.a,{href:"https://github.com/OpenC3/cosmos/blob/main/openc3/python/openc3/interfaces/protocols/protocol.py",children:"openc3/interfaces/protocols/protocol.py"})," (Python). This class defines the 9 methods that are relevant to writing your own protocol. The base class implementation for each method is included below as well as a discussion as to how the methods should be overridden and used in your own Protocols."]}),"\n",(0,r.jsx)(t.admonition,{title:"Ruby Protocol APIs",type:"info",children:(0,r.jsxs)(t.p,{children:["Protocols should not ",(0,r.jsx)(t.code,{children:"require 'openc3/script'"})," since they are part of a COSMOS interface. They should use the COSMOS library code directly like ",(0,r.jsx)(t.a,{href:"https://github.com/OpenC3/cosmos/blob/main/openc3/lib/openc3/system/system.rb",children:"System"}),", ",(0,r.jsx)(t.a,{href:"https://github.com/OpenC3/cosmos/blob/main/openc3/lib/openc3/packets/packet.rb",children:"Packet"}),", ",(0,r.jsx)(t.a,{href:"https://github.com/OpenC3/cosmos/blob/main/openc3/lib/openc3/utilities/bucket.rb",children:"Bucket"}),", ",(0,r.jsx)(t.a,{href:"https://github.com/OpenC3/cosmos/blob/main/openc3/lib/openc3/accessors/binary_accessor.rb",children:"BinaryAccessor"}),", etc. When in doubt, consult the existing COSMOS ",(0,r.jsx)(t.a,{href:"https://github.com/OpenC3/cosmos/tree/main/openc3/lib/openc3/interfaces/protocols",children:"protocol"})," classes."]})}),"\n",(0,r.jsx)(t.admonition,{title:"Python Protocol APIs",type:"info",children:(0,r.jsxs)(t.p,{children:["Protocols should not ",(0,r.jsx)(t.code,{children:"from openc3.script import *"})," since they are part of a COSMOS interface. They should use the COSMOS library code directly like ",(0,r.jsx)(t.a,{href:"https://github.com/OpenC3/cosmos/blob/main/openc3/python/openc3/system/system.py",children:"System"}),", ",(0,r.jsx)(t.a,{href:"https://github.com/OpenC3/cosmos/blob/main/openc3/python/openc3/packets/packet.py",children:"Packet"}),", ",(0,r.jsx)(t.a,{href:"https://github.com/OpenC3/cosmos/blob/main/openc3/python/openc3/utilities/bucket.py",children:"Bucket"}),", ",(0,r.jsx)(t.a,{href:"https://github.com/OpenC3/cosmos/blob/main/openc3/python/openc3/accessors/binary_accessor.py",children:"BinaryAccessor"}),", etc. When in doubt, consult the existing COSMOS ",(0,r.jsx)(t.a,{href:"https://github.com/OpenC3/cosmos/tree/main/openc3/python/openc3/interfaces/protocols",children:"protocol"})," classes."]})}),"\n",(0,r.jsx)(t.p,{children:"To really understand how Protocols work, you first must understand the logic within the base Interface class read and write methods."}),"\n",(0,r.jsx)(t.p,{children:"Let's first discuss the read method."}),"\n",(0,r.jsx)(t.admonition,{title:"Ruby Symbols, Python Strings",type:"info",children:(0,r.jsxs)(t.p,{children:["In the following discussions an all caps word is a symbol in Ruby and a string in Python. So a reference to STOP means ",":STOP",' in Ruby and "STOP" in Python.']})}),"\n",(0,r.jsx)(t.p,{children:(0,r.jsx)(t.img,{alt:"Interface Read Logic",src:n(1188).Z+"",width:"1063",height:"542"})}),"\n",(0,r.jsxs)(t.p,{children:["On ",(0,r.jsx)(t.em,{children:"every"}),' call to read, an empty string "" is first passed down to each of the read Protocol\'s ',(0,r.jsx)(t.code,{children:"read_data()"})," method ",(0,r.jsx)(t.em,{children:"before"})," new raw data is attempted to be read using the Interface's ",(0,r.jsx)(t.code,{children:"read_interface()"})," method. This is a signal to Protocols that have cached up more than one packet worth of data to output those cached packets before any new data is read from the Interface. Typically no data will be cached up and one of the Protocols ",(0,r.jsx)(t.code,{children:"read_data()"})," methods will return STOP in response to the empty string, indicating that more data is required to generate a packet. Each Protocol's ",(0,r.jsx)(t.code,{children:"read_data()"})," method can return one of three things: data that will be passed down to any additional Protocols or turned into a Packet, STOP which means more data is required from the Interface for the Protocol to continue, or DISCONNECT which means that something has happened that requires disconnecting the Interface (and by default trying to reconnect). Each Protocol's ",(0,r.jsx)(t.code,{children:"read_data()"})," method is passed the data that will eventually be turned into a packet and returns a possibly modified set of data. If the data passes through all Protocol's ",(0,r.jsx)(t.code,{children:"read_data()"})," methods it is then converted into a COSMOS packet using the Interface's convert_data_to_packet() method. This packet is then run in a similar fashion through each Read Protocol's read_packet() method. This method has essentially the same return possibilities: a Packet (instead of data as in ",(0,r.jsx)(t.code,{children:"read_data()"}),"), STOP, or DISCONNECT. If the Packet makes it through all read_packet() methods then the Interface packet read counter is incremented and the Packet is returned to the Interface."]}),"\n",(0,r.jsx)(t.p,{children:(0,r.jsx)(t.img,{alt:"Interface Write Logic",src:n(3756).Z+"",width:"931",height:"944"})}),"\n",(0,r.jsx)(t.p,{children:"The Interface write() method works very similarly to read. (It should be mentioned that by default write protocols run in the reverse order of read protocols. This makes sense because when reading you're typically stripping layers of data and when writing you're typically adding on layers in reverse order.)"}),"\n",(0,r.jsx)(t.p,{children:"First, the packet write counter is incremented. Then each write Protocol is given a chance to modify the packet by its write_packet() method being called. This method can either return a potentially modified packet, STOP, or DISCONNECT. If a write Protocol returns STOP no data will be written out the Interface and it is assumed that more packets are necessary before a final packet can be output. DISCONNECT will disconnect the Interface. If the packet makes it through all the write Protocol's write_packet() methods, then it is converted to binary data using the Interface's convert_packet_to_data() method. Next the write_data() method is called for each write Protocol giving it a chance to modify the lower level data. The same return options are available except a Ruby string of data is returned instead of a COSMOS packet. If the data makes it through all write_data() methods, then it is written out on the Interface using the write_interface() method. Afterwards, each Protocol's post_write_interface() method is called with both the final modified Packet, and the actual data written out to the Interface. This method allows follow-up such as waiting for a response after writing out a message."}),"\n",(0,r.jsx)(t.h2,{id:"method-discussions",children:"Method discussions"}),"\n",(0,r.jsxs)(t.h3,{id:"initialize-or-init",children:["initialize or ",(0,r.jsx)(t.strong,{children:"init"})]}),"\n",(0,r.jsx)(t.p,{children:"This is the constructor for your custom Protocol. It should always call super(allow_empty_data) to initialize the base Protocol class."}),"\n",(0,r.jsx)(t.p,{children:"Base class Ruby implementation:"}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-ruby",children:"# @param allow_empty_data [true/false] Whether STOP should be returned on empty data\ndef initialize(allow_empty_data = false)\n @interface = nil\n @allow_empty_data = ConfigParser.handle_true_false(allow_empty_data)\n reset()\nend\n"})}),"\n",(0,r.jsx)(t.p,{children:"Base class Python implementation:"}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-python",children:"def __init__(self, allow_empty_data=None):\n self.interface = None\n self.allow_empty_data = ConfigParser.handle_true_false_none(allow_empty_data)\n self.reset()\n"})}),"\n",(0,r.jsxs)(t.p,{children:["As you can see, every Protocol maintains state on at least two items. The interface variable holds the Interface class instance that the protocol is associated with. This is sometimes necessary to introspect details that only the Interface knows. allow_empty_data is a flag used by the ",(0,r.jsx)(t.code,{children:"read_data(data)"})," method that is discussed later in this document."]}),"\n",(0,r.jsx)(t.h3,{id:"reset",children:"reset"}),"\n",(0,r.jsx)(t.p,{children:"The reset method is used to reset internal protocol state when the Interface is connected and/or disconnected. This method should be used for common resetting logic. Connect and Disconnect specific logic are handled in the next two methods."}),"\n",(0,r.jsx)(t.p,{children:"Base class Ruby implementation:"}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-ruby",children:"def reset\nend\n"})}),"\n",(0,r.jsx)(t.p,{children:"Base class Python implementation:"}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-python",children:"def reset(self):\n pass\n"})}),"\n",(0,r.jsx)(t.p,{children:"As you can see, the base class reset implementation doesn't do anything."}),"\n",(0,r.jsx)(t.h3,{id:"connect_reset",children:"connect_reset"}),"\n",(0,r.jsx)(t.p,{children:"The connect_reset method is used to reset internal Protocol state each time the Interface is connected."}),"\n",(0,r.jsx)(t.p,{children:"Base class Ruby implementation:"}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-ruby",children:"def connect_reset\n reset()\nend\n"})}),"\n",(0,r.jsx)(t.p,{children:"Base class Python implementation:"}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-python",children:"def connect_reset(self):\n self.reset()\n"})}),"\n",(0,r.jsx)(t.p,{children:"The base class connect_reset implementation just calls the reset method to ensure common reset logic is run."}),"\n",(0,r.jsx)(t.h3,{id:"disconnect_reset",children:"disconnect_reset"}),"\n",(0,r.jsx)(t.p,{children:"The disconnect_reset method is used to reset internal Protocol state each time the Interface is disconnected."}),"\n",(0,r.jsx)(t.p,{children:"Base class Ruby implementation:"}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-ruby",children:"def disconnect_reset\n reset()\nend\n"})}),"\n",(0,r.jsx)(t.p,{children:"Base class Python implementation:"}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-python",children:"def disconnect_reset(self):\n self.reset()\n"})}),"\n",(0,r.jsx)(t.p,{children:"The base class disconnect_reset implementation just calls the reset method to ensure common reset logic is run."}),"\n",(0,r.jsx)(t.h3,{id:"read_data",children:"read_data"}),"\n",(0,r.jsx)(t.p,{children:"The read_data method is used to analyze and potentially modify any raw data read by an Interface. It takes one parameter as the current state of the data to be analyzed. It can return either a string of data, STOP, or DISCONNECT. If it returns a string, then it believes that data may be ready to be a full packet, and is ready for processing by any following Protocols. If STOP is returned then the Protocol believes it needs more data to complete a full packet. If DISCONNECT is returned then the Protocol believes the Interface should be disconnected (and typically automatically reconnected)."}),"\n",(0,r.jsx)(t.p,{children:"Base class Ruby implementation:"}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-ruby",children:"def read_data(data)\n if (data.length <= 0)\n if @allow_empty_data.nil?\n if @interface and @interface.read_protocols[-1] == self # Last read interface in chain with auto @allow_empty_data\n return :STOP\n end\n elsif !@allow_empty_data # Don't @allow_empty_data means STOP\n return :STOP\n end\n end\n data\nend\n"})}),"\n",(0,r.jsx)(t.p,{children:"Base class Python implementation:"}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-python",children:'def read_data(self, data, extra=None):\n if len(data) <= 0:\n if self.allow_empty_data is None:\n if self.interface and self.interface.read_protocols[-1] == self:\n # Last read interface in chain with auto self.allow_empty_data\n return ("STOP", extra)\n elif self.allow_empty_data:\n # Don\'t self.allow_empty_data means STOP\n return ("STOP", extra)\n return (data, extra)\n'})}),"\n",(0,r.jsxs)(t.p,{children:["The base class implementation does nothing except return the data it was given. The only exception to this is when handling an empty string. If the allow_empty_data flag is false / False or if it is nil / None and the Protocol is the last in the chain, then the base implementation will return STOP to indicate that it is time to call the Interface ",(0,r.jsx)(t.code,{children:"read_interface()"})," method to get more data. Blank strings are used to signal Protocols that they have an opportunity to return a cached packet."]}),"\n",(0,r.jsx)(t.h3,{id:"read_packet",children:"read_packet"}),"\n",(0,r.jsx)(t.p,{children:"The read_packet method is used to analyze and potentially modify a COSMOS packet before it is returned by the Interface. It takes one parameter as the current state of the packet to be analyzed. It can return either a COSMOS packet, STOP, or DISCONNECT. If it returns a COSMOS packet, then it believes that the packet is valid, should be returned, and is ready for processing by any following Protocols. If STOP is returned then the Protocol believes the packet should be silently dropped. If DISCONNECT is returned then the Protocol believes the Interface should be disconnected (and typically automatically reconnected). This method is where a Protocol would set the stored flag on a packet if it determines that the packet is stored telemetry instead of real-time telemetry."}),"\n",(0,r.jsx)(t.p,{children:"Base class Ruby implementation:"}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-ruby",children:"def read_packet(packet)\n return packet\nend\n"})}),"\n",(0,r.jsx)(t.p,{children:"Base class Python implementation:"}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-python",children:"def read_packet(self, packet):\n return packet\n"})}),"\n",(0,r.jsx)(t.p,{children:"The base class always just returns the packet given."}),"\n",(0,r.jsx)(t.h3,{id:"write_packet",children:"write_packet"}),"\n",(0,r.jsx)(t.p,{children:"The write_packet method is used to analyze and potentially modify a COSMOS packet before it is output by the Interface. It takes one parameter as the current state of the packet to be analyzed. It can return either a COSMOS packet, STOP, or DISCONNECT. If it returns a COSMOS packet, then it believes that the packet is valid, should be written out the Interface, and is ready for processing by any following Protocols. If STOP is returned then the Protocol believes the packet should be silently dropped. If DISCONNECT is returned then the Protocol believes the Interface should be disconnected (and typically automatically reconnected)."}),"\n",(0,r.jsx)(t.p,{children:"Base class Ruby implementation:"}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-ruby",children:"def write_packet(packet)\n return packet\nend\n"})}),"\n",(0,r.jsx)(t.p,{children:"Base class Python implementation:"}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-python",children:"def write_packet(self, packet):\n return packet\n"})}),"\n",(0,r.jsx)(t.p,{children:"The base class always just returns the packet given."}),"\n",(0,r.jsx)(t.h3,{id:"write_data",children:"write_data"}),"\n",(0,r.jsx)(t.p,{children:"The write_data method is used to analyze and potentially modify data before it is written out by the Interface. It takes one parameter as the current state of the data to be analyzed and sent. It can return either a string of data, STOP, or DISCONNECT. If it returns a string of data, then it believes that the data is valid, should be written out the Interface, and is ready for processing by any following Protocols. If STOP is returned then the Protocol believes the data should be silently dropped. If DISCONNECT is returned then the Protocol believes the Interface should be disconnected (and typically automatically reconnected)."}),"\n",(0,r.jsx)(t.p,{children:"Base class Ruby implementation:"}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-ruby",children:"def write_data(data)\n return data\nend\n"})}),"\n",(0,r.jsx)(t.p,{children:"Base class Python implementation:"}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-python",children:"def write_data(self, data, extra=None):\n return (data, extra)\n"})}),"\n",(0,r.jsx)(t.p,{children:"The base class always just returns the data given."}),"\n",(0,r.jsx)(t.h3,{id:"post_write_interface",children:"post_write_interface"}),"\n",(0,r.jsxs)(t.p,{children:["The post_write_interface method is called after data has been written out the Interface. The typical use of this method is to provide a hook to implement command/response type interfaces where a response is always immediately expected in response to a command. It takes two parameters, the packet after all modifications by ",(0,r.jsx)(t.code,{children:"write_packet()"})," and the data that was actually written out the Interface. It can return either the same pair of packet/data, STOP, or DISCONNECT. If it returns a packet/data pair then they are passed on to any other Protocols. If STOP is returned then the Interface write() call completes and no further Protocols ",(0,r.jsx)(t.code,{children:"post_write_interface()"}),' methods are called. If DISCONNECT is returned then the Protocol believes the Interface should be disconnected (and typically automatically reconnected). Note that only the first parameter "packet", is checked to be STOP, or DISCONNECT on the return.']}),"\n",(0,r.jsx)(t.p,{children:"Base class Ruby implementation:"}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-ruby",children:"def post_write_interface(packet, data)\n return packet, data\nend\n"})}),"\n",(0,r.jsx)(t.p,{children:"Base class Python implementation:"}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-python",children:"def post_write_interface(self, packet, data, extra=None):\n return (packet, data, extra)\n"})}),"\n",(0,r.jsx)(t.p,{children:"The base class always just returns the packet/data given."}),"\n",(0,r.jsx)(t.h3,{id:"protocol_cmd",children:"protocol_cmd"}),"\n",(0,r.jsxs)(t.p,{children:["The protocol_cmd method is used to send commands to the protocol itself. This is useful to change protocol behavior during runtime. See ",(0,r.jsx)(t.a,{href:"../guides/scripting-api#interface_protocol_cmd",children:"interface_protocol_cmd"})," for more information."]}),"\n",(0,r.jsx)(t.p,{children:"Base class Ruby implementation:"}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-ruby",children:"def protocol_cmd(cmd_name, *cmd_args)\n # Default do nothing - Implemented by subclasses\n return false\nend\n"})}),"\n",(0,r.jsx)(t.p,{children:"Base class Python implementation:"}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-python",children:"def protocol_cmd(self, cmd_name, *cmd_args):\n # Default do nothing - Implemented by subclasses\n return False\n"})}),"\n",(0,r.jsx)(t.p,{children:"The base class does nothing as this is special functionality implemented by subclasses."}),"\n",(0,r.jsx)(t.h2,{id:"examples",children:"Examples"}),"\n",(0,r.jsxs)(t.p,{children:["Please see the linked ",(0,r.jsx)(t.a,{href:"https://github.com/OpenC3/cosmos/blob/main/openc3/lib/openc3/interfaces/protocols",children:"Ruby Protocol"})," and ",(0,r.jsx)(t.a,{href:"https://github.com/OpenC3/cosmos/blob/main/openc3/python/openc3/interfaces/protocols",children:"Python Protocol"})," code for examples of the above methods in action."]})]})}function h(e={}){let{wrapper:t}={...(0,i.a)(),...e.components};return t?(0,r.jsx)(t,{...e,children:(0,r.jsx)(l,{...e})}):l(e)}},1188:function(e,t,n){n.d(t,{Z:function(){return s}});let s=n.p+"assets/images/interface_read_logic-0deef27c1d2fec9de2a3720a3c9ecedb21a00dca7aabd13da0b8815c037e4c26.png"},3756:function(e,t,n){n.d(t,{Z:function(){return s}});let s=n.p+"assets/images/interface_write_logic-3360afe1b4af20b10dafba848a21e09baccaacc06e2ec8b6c132ac7a3c99e994.png"},2840:function(e,t,n){n.d(t,{Z:function(){return o},a:function(){return a}});var s=n(2784);let r={},i=s.createContext(r);function a(e){let t=s.useContext(i);return s.useMemo(function(){return"function"==typeof e?e(t):{...t,...e}},[t,e])}function o(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:a(e.components),s.createElement(i.Provider,{value:t},e.children)}}}]);
|
@@ -1 +0,0 @@
|
|
1
|
-
"use strict";(self.webpackChunkdocs_openc3_com=self.webpackChunkdocs_openc3_com||[]).push([["7306"],{5077:function(e,n,o){o.r(n),o.d(n,{default:()=>p,frontMatter:()=>c,metadata:()=>s,assets:()=>l,toc:()=>a,contentTitle:()=>r});var s=JSON.parse('{"id":"development/developing","title":"Developing COSMOS","description":"Building COSMOS and developing the frontend and backend","source":"@site/docs/development/developing.md","sourceDirName":"development","slug":"/development/developing","permalink":"/tools/staticdocs/docs/development/developing","draft":false,"unlisted":false,"editUrl":"https://github.com/OpenC3/cosmos/tree/main/docs.openc3.com/docs/development/developing.md","tags":[],"version":"current","frontMatter":{"title":"Developing COSMOS","description":"Building COSMOS and developing the frontend and backend","sidebar_custom_props":{"myEmoji":"\uD83D\uDCBB"}},"sidebar":"defaultSidebar","previous":{"title":"Testing with Curl","permalink":"/tools/staticdocs/docs/development/curl"},"next":{"title":"JSON API","permalink":"/tools/staticdocs/docs/development/json-api"}}'),t=o("2322"),i=o("2840");let c={title:"Developing COSMOS",description:"Building COSMOS and developing the frontend and backend",sidebar_custom_props:{myEmoji:"\uD83D\uDCBB"}},r="Developing COSMOS",l={},a=[{value:"Development Tools",id:"development-tools",level:2},{value:"Running a Frontend Application",id:"running-a-frontend-application",level:2},{value:"Running a Backend Server",id:"running-a-backend-server",level:2}];function d(e){let n={a:"a",admonition:"admonition",code:"code",h1:"h1",h2:"h2",header:"header",li:"li",ol:"ol",p:"p",pre:"pre",...(0,i.a)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.header,{children:(0,t.jsx)(n.h1,{id:"developing-cosmos",children:"Developing COSMOS"})}),"\n",(0,t.jsxs)(n.p,{children:["So you want to help develop COSMOS? All of our open source COSMOS code is on ",(0,t.jsx)(n.a,{href:"https://github.com/",children:"Github"})," so the first thing to do is get an ",(0,t.jsx)(n.a,{href:"https://github.com/join",children:"account"}),". Next ",(0,t.jsx)(n.a,{href:"https://docs.github.com/en/repositories/creating-and-managing-repositories/cloning-a-repository",children:"clone"})," the ",(0,t.jsx)(n.a,{href:"https://github.com/openc3/cosmos",children:"COSMOS"})," repository. We accept contributions from others as ",(0,t.jsx)(n.a,{href:"https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-pull-requests",children:"Pull Requests"}),"."]}),"\n",(0,t.jsx)(n.h2,{id:"development-tools",children:"Development Tools"}),"\n",(0,t.jsxs)(n.p,{children:["The core COSMOS team develops with the ",(0,t.jsx)(n.a,{href:"https://code.visualstudio.com/",children:"Visual Studio Code"})," editor and we highly recommend it. We also utilize a number of extensions including docker, kubernetes, gitlens, prettier, eslint, python, vetur, and ruby. We commit our ",(0,t.jsx)(n.code,{children:"openc3.code-workspace"})," configuration for VSCode to help configure these plugins. You also need ",(0,t.jsx)(n.a,{href:"https://www.docker.com/products/docker-desktop",children:"Docker Desktop"})," which you should already have as it is a requirement to run COSMOS. You'll also need ",(0,t.jsx)(n.a,{href:"https://nodejs.org/en/download/",children:"NodeJS"})," and ",(0,t.jsx)(n.a,{href:"https://yarnpkg.com/getting-started/install",children:"yarn"})," installed."]}),"\n",(0,t.jsx)(n.h1,{id:"building-cosmos",children:"Building COSMOS"}),"\n",(0,t.jsx)(n.p,{children:"Note: We primarily develop COSMOS in MacOS so the commands here will reference bash scripts but the same files exist in Windows as batch scripts."}),"\n",(0,t.jsxs)(n.p,{children:["Build COSMOS using the ",(0,t.jsx)(n.code,{children:"openc3.sh"})," script:"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"% ./openc3.sh build\n"})}),"\n",(0,t.jsx)(n.p,{children:"This will pull all the COSMOS container dependencies and build our local containers. Note: This can take a long time especially for your first build!"}),"\n",(0,t.jsx)(n.p,{children:"Once the build completes you can see the built images with the following command:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:'% docker image ls | grep "openc3"\nopenc3inc/openc3-cosmos-init latest 4cac7a3ea9d3 29 hours ago 446MB\nopenc3inc/openc3-cosmos-script-runner-api latest 4aacbaf49f7a 29 hours ago 431MB\nopenc3inc/openc3-cosmos-cmd-tlm-api latest 9a8806bd4be3 3 days ago 432MB\nopenc3inc/openc3-operator latest 223e98129fe9 3 days ago 405MB\nopenc3inc/openc3-base latest 98df5c0378c2 3 days ago 405MB\nopenc3inc/openc3-redis latest 5a3003a49199 8 days ago 111MB\nopenc3inc/openc3-traefik latest ec13a8d16a2f 8 days ago 104MB\nopenc3inc/openc3-minio latest 787f6e3fc0be 8 days ago 238MB\nopenc3inc/openc3-node latest b3ee86d3620a 8 days ago 372MB\nopenc3inc/openc3-ruby latest aa158bbb9539 8 days ago 326MB\n'})}),"\n",(0,t.jsxs)(n.admonition,{title:"Offline Building",type:"info",children:[(0,t.jsxs)(n.p,{children:["If you're building in a offline environment or want to use a private Rubygems, NPM or APK server (e.g. Nexus), you can update the following environment variables: RUBYGEMS_URL, NPM_URL, APK_URL, and more in the ",(0,t.jsx)(n.a,{href:"https://github.com/openc3/cosmos/blob/main/.env",children:".env"})," file. Example values:"]}),(0,t.jsxs)(n.p,{children:["ALPINE_VERSION=3.19",(0,t.jsx)("br",{}),"\nALPINE_BUILD=7",(0,t.jsx)("br",{}),"\nRUBYGEMS_URL=",(0,t.jsx)(n.a,{href:"https://rubygems.org",children:"https://rubygems.org"}),(0,t.jsx)("br",{}),"\nNPM_URL=",(0,t.jsx)(n.a,{href:"https://registry.npmjs.org",children:"https://registry.npmjs.org"}),(0,t.jsx)("br",{}),"\nAPK_URL=",(0,t.jsx)(n.a,{href:"http://dl-cdn.alpinelinux.org",children:"http://dl-cdn.alpinelinux.org"}),(0,t.jsx)("br",{})]})]}),"\n",(0,t.jsx)(n.h1,{id:"running-cosmos",children:"Running COSMOS"}),"\n",(0,t.jsxs)(n.p,{children:["Running COSMOS in development mode enables localhost access to internal API ports as well as sets ",(0,t.jsx)(n.code,{children:"RAILS_ENV=development"})," in the cmd-tlm-api and script-runner-api Rails servers. To run in development mode:"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"% ./openc3.sh run\n"})}),"\n",(0,t.jsx)(n.p,{children:"You can now see the running containers (I removed CONTAINER ID, CREATED and STATUS to save space):"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:'% docker ps\nIMAGE COMMAND PORTS NAMES\nopenc3/openc3-cmd-tlm-api:latest "/sbin/tini -- rails\u2026" 127.0.0.1:2901->2901/tcp cosmos-openc3-cmd-tlm-api-1\nopenc3/openc3-script-runner-api:latest "/sbin/tini -- rails\u2026" 127.0.0.1:2902->2902/tcp cosmos-openc3-script-runner-api-1\nopenc3/openc3-traefik:latest "/entrypoint.sh trae\u2026" 0.0.0.0:2900->80/tcp cosmos-openc3-traefik-1\nopenc3/openc3-operator:latest "/sbin/tini -- ruby \u2026" cosmos-openc3-operator-1\nopenc3/openc3-minio:latest "/usr/bin/docker-ent\u2026" 127.0.0.1:9000->9000/tcp cosmos-openc3-minio-1\nopenc3/openc3-redis:latest "docker-entrypoint.s\u2026" 127.0.0.1:6379->6379/tcp cosmos-openc3-redis-1\n'})}),"\n",(0,t.jsx)(n.p,{children:"If you go to localhost:2900 you should see COSMOS up and running!"}),"\n",(0,t.jsx)(n.h2,{id:"running-a-frontend-application",children:"Running a Frontend Application"}),"\n",(0,t.jsx)(n.p,{children:"So now that you have COSMOS up and running how do you develop an individual COSMOS application?"}),"\n",(0,t.jsxs)(n.ol,{children:["\n",(0,t.jsx)(n.li,{children:"Bootstrap the frontend with yarn"}),"\n"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"openc3-init/plugins % yarn\nopenc3-init/plugins % yarn build:common\n"})}),"\n",(0,t.jsxs)(n.ol,{children:["\n",(0,t.jsx)(n.li,{children:"Serve a local COSMOS application (CmdTlmServer, ScriptRunner, etc)"}),"\n"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"openc3-init % cd plugins/packages/openc3-tool-scriptrunner\nopenc3-tool-scriptrunner % yarn serve\nbuilt in 128722ms\n"})}),"\n",(0,t.jsxs)(n.ol,{children:["\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsxs)(n.p,{children:["Set the ",(0,t.jsx)(n.a,{href:"https://single-spa.js.org/",children:"single SPA"})," override for the application"]}),"\n",(0,t.jsxs)(n.p,{children:["Visit localhost:2900 and Right-click 'Inspect'",(0,t.jsx)("br",{}),"\nIn the console paste:"]}),"\n"]}),"\n"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-javascript",children:'localStorage.setItem("devtools", true);\n'})}),"\n",(0,t.jsxs)(n.p,{children:["Refresh and you should see ",(0,t.jsx)(n.code,{children:"{...}"})," in the bottom right",(0,t.jsx)("br",{}),"\nClick the Default button next to the application (@openc3/tool-scriptrunner)",(0,t.jsx)("br",{}),"\nPaste in the development path which is dependent on the port returned by the local yarn serve and the tool name (scriptrunner)"]}),"\n",(0,t.jsx)(n.p,{children:(0,t.jsx)(n.a,{href:"http://localhost:2914/tools/scriptrunner/main.js",children:"http://localhost:2914/tools/scriptrunner/main.js"})}),"\n",(0,t.jsxs)(n.ol,{children:["\n",(0,t.jsxs)(n.li,{children:["Refresh the page and you should see your local copy of the application (Script Runner in this example). If you dynamically add code (like ",(0,t.jsx)(n.code,{children:"console.log"}),") the yarn window should re-compile and the browser should refresh displaying your new code. It is highly recommended to get familiar with your browser's ",(0,t.jsx)(n.a,{href:"https://developer.chrome.com/docs/devtools/overview/",children:"development tools"})," if you plan to do frontend development."]}),"\n"]}),"\n",(0,t.jsx)(n.h2,{id:"running-a-backend-server",children:"Running a Backend Server"}),"\n",(0,t.jsx)(n.p,{children:"If the code you want to develop is the cmd-tlm-api or script-runner-api backend servers there are several steps to enable access to a development copy."}),"\n",(0,t.jsxs)(n.ol,{children:["\n",(0,t.jsx)(n.li,{children:"Run a development version of traefik. COSMOS uses traefik to direct API requests to the correct locations."}),"\n"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"% cd openc3-traefik\nopenc3-traefik % docker ps\n# Look for the container with name including traefik\nopenc3-traefik % docker stop cosmos-openc3-traefik-1\nopenc3-traefik % docker build --build-arg TRAEFIK_CONFIG=traefik-dev.yaml -t openc3-traefik-dev .\nopenc3-traefik % docker run --network=openc3-cosmos-network -p 2900:2900 -it --rm openc3-traefik-dev\n"})}),"\n",(0,t.jsxs)(n.ol,{children:["\n",(0,t.jsx)(n.li,{children:"Run a local copy of the cmd-tlm-api or script-runner-api"}),"\n"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"% cd openc3-cosmos-cmd-tlm-api\nopenc3-cosmos-cmd-tlm-api % docker ps\n# Look for the container with name including cmd-tlm-api\nopenc3-cosmos-cmd-tlm-api % docker stop cosmos-openc3-cosmos-cmd-tlm-api-1\n# Run the following on Windows:\nopenc3-cosmos-cmd-tlm-api> dev_server.bat\n# In Linux, set all the environment variables in the .env file, but override REDIS to be local\nopenc3-cosmos-cmd-tlm-api % set -a; source ../.env; set +a\nopenc3-cosmos-cmd-tlm-api % export OPENC3_REDIS_HOSTNAME=127.0.0.1\nopenc3-cosmos-cmd-tlm-api % export OPENC3_REDIS_EPHEMERAL_HOSTNAME=127.0.0.1\nopenc3-cosmos-cmd-tlm-api % bundle install\nopenc3-cosmos-cmd-tlm-api % bundle exec rails s\n"})}),"\n",(0,t.jsxs)(n.ol,{children:["\n",(0,t.jsxs)(n.li,{children:["Once the ",(0,t.jsx)(n.code,{children:"bundle exec rails s"})," command returns you should see API requests coming from interactions in the frontend code. If you add code (like Ruby debugging statements) to the cmd-tlm-api code you need to stop the server (CTRL-C) and restart it to see the effect."]}),"\n"]})]})}function p(e={}){let{wrapper:n}={...(0,i.a)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(d,{...e})}):d(e)}},2840:function(e,n,o){o.d(n,{Z:function(){return r},a:function(){return c}});var s=o(2784);let t={},i=s.createContext(t);function c(e){let n=s.useContext(i);return s.useMemo(function(){return"function"==typeof e?e(n):{...n,...e}},[n,e])}function r(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(t):e.components||t:c(e.components),s.createElement(i.Provider,{value:n},e.children)}}}]);
|
@@ -1 +0,0 @@
|
|
1
|
-
"use strict";(self.webpackChunkdocs_openc3_com=self.webpackChunkdocs_openc3_com||[]).push([["4706"],{7019:function(e,t,s){s.r(t),s.d(t,{default:()=>a,frontMatter:()=>l,metadata:()=>n,assets:()=>o,toc:()=>c,contentTitle:()=>d});var n=JSON.parse('{"id":"guides/performance","title":"Performance","description":"Hardware requirements like memory and CPU","source":"@site/docs/guides/performance.md","sourceDirName":"guides","slug":"/guides/performance","permalink":"/tools/staticdocs/docs/guides/performance","draft":false,"unlisted":false,"editUrl":"https://github.com/OpenC3/cosmos/tree/main/docs.openc3.com/docs/guides/performance.md","tags":[],"version":"current","frontMatter":{"title":"Performance","description":"Hardware requirements like memory and CPU","sidebar_custom_props":{"myEmoji":"\uD83D\uDCCA"}},"sidebar":"defaultSidebar","previous":{"title":"Monitoring","permalink":"/tools/staticdocs/docs/guides/monitoring"},"next":{"title":"Raspberry Pi","permalink":"/tools/staticdocs/docs/guides/raspberrypi"}}'),i=s("2322"),r=s("2840");let l={title:"Performance",description:"Hardware requirements like memory and CPU",sidebar_custom_props:{myEmoji:"\uD83D\uDCCA"}},d="COSMOS Hardware Requirements",o={},c=[{value:"Memory",id:"memory",level:2},{value:"CPU",id:"cpu",level:2},{value:"Performance Comparison",id:"performance-comparison",level:2}];function h(e){let t={a:"a",code:"code",h1:"h1",h2:"h2",header:"header",li:"li",ol:"ol",p:"p",pre:"pre",section:"section",sup:"sup",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,r.a)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(t.p,{children:["The COSMOS architecture was created with scalability in mind. Our goal is to support an unlimited number of connections and use cloud technologies to scale. Only ",(0,i.jsx)(t.a,{href:"https://openc3.com/enterprise",children:"COSMOS Enterprise Edition"})," supports Kubernetes and the various cloud platforms which allow this level of scalability. While true scalability is only achieved in COSMOS Enterprise, both Open Source and Enterprise have various levels of observability and configuration settings which can affect performance."]}),"\n",(0,i.jsx)(t.header,{children:(0,i.jsx)(t.h1,{id:"cosmos-hardware-requirements",children:"COSMOS Hardware Requirements"})}),"\n",(0,i.jsx)(t.h2,{id:"memory",children:"Memory"}),"\n",(0,i.jsx)(t.p,{children:"COSMOS can run on a Raspberry Pi up to a Kubernetes cluster in the cloud. On all platforms the key performance factor is the number and complexity of the targets and their defined packets. Targets can vary from simple targets taking 100 MB of RAM to complex targets taking 400 MB. The base COSMOS containers require about 800 MB of RAM. A good rule of thumb is to average about 300 MB of RAM for targets. As an example data point, the COSMOS Demo has 4 targets, two complex (INST & INST2) and two relatively simple (EXAMPLE & TEMPLATED), and requires 800 MB of RAM (on top of the 800 MB of base container RAM)."}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsx)(t.li,{children:"Base RAM MB Calculator = 800 + (num targets) * 300"}),"\n"]}),"\n",(0,i.jsxs)(t.p,{children:["In addition, the Redis streams contain the last 10 min of both raw and decommutated data from all targets. Thus you must wait ~15min to truly see what the high water memory mark will be. In the COSMOS Demo the INST & INST2 targets are fairly simple with four 1Hz packet of ~15 items and one 10Hz packet with 20 items. This only causes 50 MiB of redis RAM usage according to ",(0,i.jsx)(t.code,{children:"docker stats"}),". Installing the COSMOS ",(0,i.jsx)(t.a,{href:"https://github.com/OpenC3/openc3-cosmos-load-sim",children:"LoadSim"})," with 10 packets with 1000 items each at 10Hz pushed the redis memory usage to about 350 MiB."]}),"\n",(0,i.jsx)(t.h2,{id:"cpu",children:"CPU"}),"\n",(0,i.jsx)(t.p,{children:"Another consideration is the CPU performance. In the Open Source Edition, by default COSMOS spawns off 2 microservices per target. One combines packet logging and decommutation of the data and the other performs data reduction. In COSMOS Enterprise Edition on Kubernetes, each process becomes an independent container that is deployed on the cluster allowing horizontal scaling."}),"\n",(0,i.jsxs)(t.p,{children:["The COSMOS command and telemetry API and script running API servers should have a dedicated core while targets can generally share cores. It's hard to provide a general rule of thumb with the wide variety of architectures, clock speeds, and core counts. The best practice is to install COSMOS with the expected load and do some monitoring with ",(0,i.jsx)(t.code,{children:"htop"})," to visualize the load on the various cores. Any time a single core gets overloaded (100%) this is a concern and system slowdown can occur."]}),"\n",(0,i.jsx)(t.h2,{id:"performance-comparison",children:"Performance Comparison"}),"\n",(0,i.jsxs)(t.p,{children:["Performance characterization was performed in Azure on a Standard D4s v5 (4 vcpus, 16 GiB memory) chosen to allow virtualization per ",(0,i.jsx)(t.a,{href:"https://docs.docker.com/desktop/vm-vdi/#turn-on-nested-virtualization-on-microsoft-hyper-v",children:"Docker"}),". COSMOS ",(0,i.jsx)(t.a,{href:"https://github.com/OpenC3/cosmos-enterprise/releases/tag/v5.9.1",children:"5.9.1"})," Enterprise Edition was installed on both Windows 11 Pro ",(0,i.jsx)(t.sup,{children:(0,i.jsx)(t.a,{href:"#user-content-fn-1",id:"user-content-fnref-1","data-footnote-ref":!0,"aria-describedby":"footnote-label",children:"1"})})," and Ubuntu 22. Note: Enterprise Edition was not utilizing Kubernetes, just Docker. Testing involved starting the COSMOS Demo, connecting all targets (EXAMPLE, INST, INST2, TEMPLATED), opening the following TlmViewer screens (ADCS, ARRAY, BLOCK, COMMANDING, HS, LATEST, LIMITS, OTHER, PARAMS, SIMPLE, TABS) and creating two TlmGrapher graphs consisting of INST HEALTH_STATUS TEMP[1-4] and INST ADCS POS[X,Y,Z] and INST ADCS VEL[X,Y,Z]. This was allowed to run for 1hr and results were collected using ",(0,i.jsx)(t.code,{children:"htop"}),":"]}),"\n",(0,i.jsxs)(t.table,{children:[(0,i.jsx)(t.thead,{children:(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Platform"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Core CPU %"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"RAM"})]})}),(0,i.jsxs)(t.tbody,{children:[(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"Windows 11 Pro"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"12% 12% 10% 10%"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"3.9G / 7.7G"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"Headless Ubuntu 22"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"7% 7% 8% 6%"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"3.2G / 15.6G"})]})]})]}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:["Windows was only allocated 8 GB of RAM due to the ",(0,i.jsx)(t.a,{href:"https://learn.microsoft.com/en-us/windows/wsl/wsl-config#configuration-setting-for-wslconfig",children:".wslconfig"})," settings."]}),"\n",(0,i.jsx)(t.li,{children:"Since Ubuntu was running headless, the screens and graphs were brought up on another machine."}),"\n"]}),"\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"docker stats"})," was also run to show individual container cpu and memory usage:"]}),"\n",(0,i.jsxs)(t.table,{children:[(0,i.jsx)(t.thead,{children:(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"NAME"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Windows CPU %"}),(0,i.jsx)(t.th,{children:"Ubuntu CPU %"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Windows MEM"}),(0,i.jsx)(t.th,{children:"Ubuntu MEM"})]})}),(0,i.jsxs)(t.tbody,{children:[(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"cosmos-enterprise-project-openc3-traefik-1"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"4.16%"}),(0,i.jsx)(t.td,{children:"1.32%"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"43.54MiB"}),(0,i.jsx)(t.td,{children:"51.38MiB"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"cosmos-enterprise-project-openc3-cosmos-cmd-tlm-api-1"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"10.16%"}),(0,i.jsx)(t.td,{children:"6.14%"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"401.6MiB"}),(0,i.jsx)(t.td,{children:"392MiB"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"cosmos-enterprise-project-openc3-keycloak-1"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"0.17%"}),(0,i.jsx)(t.td,{children:"0.13%"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"476.8MiB"}),(0,i.jsx)(t.td,{children:"476.8MiB"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"cosmos-enterprise-project-openc3-operator-1"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"21.27%"}),(0,i.jsx)(t.td,{children:"13.91%"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"1.214GiB"}),(0,i.jsx)(t.td,{children:"1.207GiB"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"cosmos-enterprise-project-openc3-cosmos-script-runner-api-1"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"0.01%"}),(0,i.jsx)(t.td,{children:"0.01%"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"127.4MiB"}),(0,i.jsx)(t.td,{children:"117.1MiB"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"cosmos-enterprise-project-openc3-metrics-1"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"0.01%"}),(0,i.jsx)(t.td,{children:"0.00%"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"105.2MiB"}),(0,i.jsx)(t.td,{children:"83.87MiB"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"cosmos-enterprise-project-openc3-redis-ephemeral-1"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"4.05%"}),(0,i.jsx)(t.td,{children:"1.89%"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"46.22MiB"}),(0,i.jsx)(t.td,{children:"69.84MiB"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"cosmos-enterprise-project-openc3-redis-1"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"1.56%"}),(0,i.jsx)(t.td,{children:"0.72%"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"12.82MiB"}),(0,i.jsx)(t.td,{children:"9.484MiB"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"cosmos-enterprise-project-openc3-minio-1"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"0.01%"}),(0,i.jsx)(t.td,{children:"0.00%"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"152.9MiB"}),(0,i.jsx)(t.td,{children:"169.8MiB"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"cosmos-enterprise-project-openc3-postgresql-1"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"0.00%"}),(0,i.jsx)(t.td,{children:"0.39%"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"37.33MiB"}),(0,i.jsx)(t.td,{children:"41.02MiB"})]})]})]}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsx)(t.li,{children:"memory profiles are similar between the two platforms"}),"\n",(0,i.jsx)(t.li,{children:"redis-ephemeral isn't using much memory on the base Demo with its small packets"}),"\n"]}),"\n",(0,i.jsxs)(t.p,{children:["At this point the COSMOS ",(0,i.jsx)(t.a,{href:"https://github.com/OpenC3/openc3-cosmos-load-sim",children:"LoadSim"})," was installed with default settings which creates 10 packets with 1000 items each at 10Hz (110kB/s). After a 1 hr soak, htop now indicated:"]}),"\n",(0,i.jsxs)(t.table,{children:[(0,i.jsx)(t.thead,{children:(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Platform"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Core CPU %"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"RAM"})]})}),(0,i.jsxs)(t.tbody,{children:[(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"Windows 11 Pro"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"40% 35% 39% 42%"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"4.64G / 7.7G"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"Headless Ubuntu 22"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"17% 20% 16% 18%"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"3.74G / 15.6G"})]})]})]}),"\n",(0,i.jsx)(t.p,{children:"The larger packets and data rate of the LoadSim target caused both platforms to dramatically increase CPU utilization but the Linux machine stays quite performant."}),"\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"docker stats"})," was also run to show individual container cpu and memory usage:"]}),"\n",(0,i.jsxs)(t.table,{children:[(0,i.jsx)(t.thead,{children:(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"NAME"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Windows CPU %"}),(0,i.jsx)(t.th,{children:"Ubuntu CPU %"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Windows MEM"}),(0,i.jsx)(t.th,{children:"Ubuntu MEM"})]})}),(0,i.jsxs)(t.tbody,{children:[(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"cosmos-enterprise-project-openc3-traefik-1"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"4.09%"}),(0,i.jsx)(t.td,{children:"0.01%"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"44.3MiB"}),(0,i.jsx)(t.td,{children:"0.34MiB"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"cosmos-enterprise-project-openc3-cosmos-cmd-tlm-api-1"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"17.78%"}),(0,i.jsx)(t.td,{children:"6.18%"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"407.9MiB"}),(0,i.jsx)(t.td,{children:"405.8MiB"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"cosmos-enterprise-project-openc3-keycloak-1"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"0.20%"}),(0,i.jsx)(t.td,{children:"0.12%"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"480.2MiB"}),(0,i.jsx)(t.td,{children:"481.5MiB"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"cosmos-enterprise-project-openc3-operator-1"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"221.15%"}),(0,i.jsx)(t.td,{children:"66.72%"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"1.6GiB"}),(0,i.jsx)(t.td,{children:"1.512GiB"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"cosmos-enterprise-project-openc3-cosmos-script-runner-api-1"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"0.01%"}),(0,i.jsx)(t.td,{children:"0.01%"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"136.6MiB"}),(0,i.jsx)(t.td,{children:"127.5MiB"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"cosmos-enterprise-project-openc3-metrics-1"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"0.01%"}),(0,i.jsx)(t.td,{children:"0.01%"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"106.3MiB"}),(0,i.jsx)(t.td,{children:"84.87MiB"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"cosmos-enterprise-project-openc3-redis-ephemeral-1"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"19.63%"}),(0,i.jsx)(t.td,{children:"3.91%"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"333.8MiB"}),(0,i.jsx)(t.td,{children:"370.8MiB"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"cosmos-enterprise-project-openc3-redis-1"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"7.42%"}),(0,i.jsx)(t.td,{children:"1.49%"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"15.87MiB"}),(0,i.jsx)(t.td,{children:"11.81MiB"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"cosmos-enterprise-project-openc3-minio-1"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"0.10%"}),(0,i.jsx)(t.td,{children:"0.02%"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"167.8MiB"}),(0,i.jsx)(t.td,{children:"179.2MiB"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"cosmos-enterprise-project-openc3-postgresql-1"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"0.00%"}),(0,i.jsx)(t.td,{children:"0.00%"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"35.4MiB"}),(0,i.jsx)(t.td,{children:"42.93MiB"})]})]})]}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsx)(t.li,{children:"memory profiles are similar between the two platforms"}),"\n",(0,i.jsx)(t.li,{children:"redis-ephemeral is now using much more RAM as it is storing the large LoadSim packets"}),"\n",(0,i.jsx)(t.li,{children:"Windows is using much more CPU power running the operator, cmd-tlm, and redis"}),"\n"]}),"\n",(0,i.jsx)(t.h1,{id:"conclusions",children:"Conclusions"}),"\n",(0,i.jsxs)(t.p,{children:["While it is easy to run COSMOS on any Docker platform, increasing the number and complexity of the targets requires choosing the correct hardware. Sizing can be approximated but the best solution is to install representative targets and use ",(0,i.jsx)(t.code,{children:"docker stats"})," and ",(0,i.jsx)(t.code,{children:"htop"})," to judge the CPU and memory pressure on the given hardware."]}),"\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.a,{href:"https://openc3.com/enterprise",children:"COSMOS Enterprise Edition"})," on Kubernetes helps to eliminate the hardware sizing issue by scaling the cluster to meet the needs of the system. Check out ",(0,i.jsx)(t.a,{href:"https://openc3.com/news/scaling",children:"this recent talk"})," Ryan gave at GSAW showing how we scaled to over 160 satellites on a 4 node kubernetes cluster on EKS."]}),"\n",(0,i.jsx)("hr",{}),"\n","\n",(0,i.jsxs)(t.section,{"data-footnotes":!0,className:"footnotes",children:[(0,i.jsx)(t.h2,{className:"sr-only",id:"footnote-label",children:"Footnotes"}),"\n",(0,i.jsxs)(t.ol,{children:["\n",(0,i.jsxs)(t.li,{id:"user-content-fn-1",children:["\n",(0,i.jsx)(t.p,{children:"Full specs of the Windows Platform:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{children:"Windows 11 Pro\nDocker Desktop 4.22.0\nWSL version: 1.2.5.0\nKernel version: 5.15.90.1\nWSLg version: 1.0.51\nMSRDC version: 1.2.3770\nDirect3D version: 1.608.2-61064218\nDXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp\nWindows version: 10.0.22621.2134\n"})}),"\n",(0,i.jsx)(t.a,{href:"#user-content-fnref-1","data-footnote-backref":"","aria-label":"Back to reference 1",className:"data-footnote-backref",children:"\u21A9"}),"\n"]}),"\n"]}),"\n"]})]})}function a(e={}){let{wrapper:t}={...(0,r.a)(),...e.components};return t?(0,i.jsx)(t,{...e,children:(0,i.jsx)(h,{...e})}):h(e)}},2840:function(e,t,s){s.d(t,{Z:function(){return d},a:function(){return l}});var n=s(2784);let i={},r=n.createContext(i);function l(e){let t=n.useContext(r);return n.useMemo(function(){return"function"==typeof e?e(t):{...t,...e}},[t,e])}function d(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:l(e.components),n.createElement(r.Provider,{value:t},e.children)}}}]);
|
@@ -1 +0,0 @@
|
|
1
|
-
"use strict";(self.webpackChunkdocs_openc3_com=self.webpackChunkdocs_openc3_com||[]).push([["6868"],{3704:function(e,s,t){t.r(s),t.d(s,{default:()=>h,frontMatter:()=>o,metadata:()=>n,assets:()=>c,toc:()=>l,contentTitle:()=>a});var n=JSON.parse('{"id":"configuration/accessors","title":"Accessors","description":"Responsible for reading and writing data to a buffer","source":"@site/docs/configuration/accessors.md","sourceDirName":"configuration","slug":"/configuration/accessors","permalink":"/tools/staticdocs/docs/configuration/accessors","draft":false,"unlisted":false,"editUrl":"https://github.com/OpenC3/cosmos/tree/main/docs.openc3.com/docs/configuration/accessors.md","tags":[],"version":"current","sidebarPosition":8,"frontMatter":{"sidebar_position":8,"title":"Accessors","description":"Responsible for reading and writing data to a buffer","sidebar_custom_props":{"myEmoji":"\u270F\uFE0F"}},"sidebar":"defaultSidebar","previous":{"title":"Protocols","permalink":"/tools/staticdocs/docs/configuration/protocols"},"next":{"title":"Tables","permalink":"/tools/staticdocs/docs/configuration/table"}}'),r=t("2322"),i=t("2840");let o={sidebar_position:8,title:"Accessors",description:"Responsible for reading and writing data to a buffer",sidebar_custom_props:{myEmoji:"\u270F\uFE0F"}},a=void 0,c={},l=[{value:"Binary Accessor",id:"binary-accessor",level:3},{value:"Commands",id:"commands",level:4},{value:"Telemetry",id:"telemetry",level:4},{value:"CBOR Accessor",id:"cbor-accessor",level:3},{value:"Commands",id:"commands-1",level:4},{value:"Telemetry",id:"telemetry-1",level:4},{value:"Form Accessor",id:"form-accessor",level:3},{value:"Commands",id:"commands-2",level:4},{value:"Telemetry",id:"telemetry-2",level:4},{value:"HTML Accessor",id:"html-accessor",level:3},{value:"Commands",id:"commands-3",level:4},{value:"Telemetry",id:"telemetry-3",level:4},{value:"HTTP Accessor",id:"http-accessor",level:3},{value:"Commands",id:"commands-4",level:4},{value:"Telemetry",id:"telemetry-4",level:4},{value:"JSON Accessor",id:"json-accessor",level:3},{value:"Commands",id:"commands-5",level:4},{value:"Telemetry",id:"telemetry-5",level:4},{value:"Template Accessor",id:"template-accessor",level:3},{value:"Commands",id:"commands-6",level:4},{value:"Telemetry",id:"telemetry-6",level:4},{value:"XML Accessor",id:"xml-accessor",level:3},{value:"Commands",id:"commands-7",level:4},{value:"Telemetry",id:"telemetry-7",level:4},{value:"GEMS Ascii (Enterprise)",id:"gems-ascii-enterprise",level:3},{value:"Prometheus (Enterprise)",id:"prometheus-enterprise",level:3},{value:"Protocol Buffer (Enterprise)",id:"protocol-buffer-enterprise",level:3}];function d(e){let s={a:"a",code:"code",h3:"h3",h4:"h4",p:"p",pre:"pre",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",...(0,i.a)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(s.p,{children:"Accessors are the low level code which know how to read and write data into a buffer. The buffer data then gets written out an interface which uses protocols to potentially change the data before it goes to the target. Accessors handle the different serializations formats such as binary (CCSDS), JSON, CBOR, XML, HTML, Protocol Buffers, etc."}),"\n",(0,r.jsxs)(s.p,{children:["For more information about how Accessors fit with Interfaces and Protocols see ",(0,r.jsx)(s.a,{href:"https://www.openc3.com/news/interoperability-without-standards",children:"Interoperability Without Standards"}),"."]}),"\n",(0,r.jsx)(s.p,{children:"COSMOS provides the following built-in accessors: Binary, CBOR, Form, HTML, HTTP, JSON, Template, XML."}),"\n",(0,r.jsx)(s.p,{children:"COSMOS Enterprise provides the following accessors: GEMS Ascii, Prometheus, Protocol Buffer."}),"\n",(0,r.jsx)(s.h3,{id:"binary-accessor",children:"Binary Accessor"}),"\n",(0,r.jsx)(s.p,{children:"The Binary Accessor serializes data into a binary format when writing to the buffer. This is how many devices expect their data including those following the CCSDS standard. COSMOS handles converting signed and unsigned integers, floats, strings, etc. into their binary representation in the buffer. This includes handling big and little endian, bitfields, and variable length fields. Since binary is so common this is the default Accessor and will be used if no other accessors are given."}),"\n",(0,r.jsx)(s.h4,{id:"commands",children:"Commands"}),"\n",(0,r.jsx)(s.pre,{children:(0,r.jsx)(s.code,{className:"language-ruby",children:'COMMAND INST COLLECT BIG_ENDIAN "Starts a collect"\n ACCESSOR BinaryAccessor # Typically not explicitly defined because it is the default\n PARAMETER TYPE 64 16 UINT MIN MAX 0 "Collect type"\n PARAMETER DURATION 80 32 FLOAT 0.0 10.0 1.0 "Collect duration"\n PARAMETER OPCODE 112 8 UINT 0x0 0xFF 0xAB "Collect opcode"\n'})}),"\n",(0,r.jsx)(s.h4,{id:"telemetry",children:"Telemetry"}),"\n",(0,r.jsx)(s.pre,{children:(0,r.jsx)(s.code,{className:"language-ruby",children:'TELEMETRY INST HEALTH_STATUS BIG_ENDIAN "Health and status"\n ACCESSOR BinaryAccessor # Typically not explicitly defined because it is the default\n APPEND_ITEM CMD_ACPT_CNT 32 UINT "Command accept count"\n APPEND_ITEM COLLECTS 16 UINT "Number of collects"\n APPEND_ITEM DURATION 32 FLOAT "Most recent collect duration"\n'})}),"\n",(0,r.jsx)(s.h3,{id:"cbor-accessor",children:"CBOR Accessor"}),"\n",(0,r.jsxs)(s.p,{children:["The Concise Binary Object Representation (",(0,r.jsx)(s.a,{href:"https://en.wikipedia.org/wiki/CBOR",children:"CBOR"}),") Accessor serializes data into a binary format loosely based on JSON. It is a subclass of the JSON Accessor and is what COSMOS uses natively to store log files."]}),"\n",(0,r.jsx)(s.h4,{id:"commands-1",children:"Commands"}),"\n",(0,r.jsxs)(s.p,{children:["Using the CBOR Accessor for ",(0,r.jsx)(s.a,{href:"command",children:"command definitions"})," requires the use of ",(0,r.jsx)(s.a,{href:"command#template_file",children:"TEMPLATE_FILE"})," and ",(0,r.jsx)(s.a,{href:"command#key",children:"KEY"})," to allow the user to set values in the CBOR data. Note that the KEY values use ",(0,r.jsx)(s.a,{href:"https://en.wikipedia.org/wiki/JSONPath",children:"JSONPath"}),"."]}),"\n",(0,r.jsx)(s.pre,{children:(0,r.jsx)(s.code,{className:"language-ruby",children:'COMMAND CBOR CBORCMD BIG_ENDIAN "CBOR Accessor Command"\n ACCESSOR CborAccessor\n TEMPLATE_FILE _cbor_template.bin\n APPEND_ID_PARAMETER ID_ITEM 32 INT 2 2 2 "Int Item"\n KEY $.id_item\n APPEND_PARAMETER ITEM1 16 UINT MIN MAX 101 "Int Item 2"\n KEY $.item1\n UNITS CELSIUS C\n APPEND_PARAMETER ITEM2 16 UINT MIN MAX 12 "Int Item 3"\n KEY $.more.item2\n FORMAT_STRING "0x%X"\n APPEND_PARAMETER ITEM3 64 FLOAT MIN MAX 3.14 "Float Item"\n KEY $.more.item3\n APPEND_PARAMETER ITEM4 128 STRING "Example" "String Item"\n KEY $.more.item4\n APPEND_ARRAY_PARAMETER ITEM5 8 UINT 0 "Array Item"\n KEY $.more.item5\n'})}),"\n",(0,r.jsx)(s.p,{children:"Creating the template file requires the use of the Ruby or Python CBOR libraries. Here is an example from Ruby:"}),"\n",(0,r.jsx)(s.pre,{children:(0,r.jsx)(s.code,{className:"language-ruby",children:'require \'cbor\'\ndata = {"id_item" : 2, "item1" : 101, "more" : { "item2" : 12, "item3" : 3.14, "item4" : "Example", "item5" : [4, 3, 2, 1] } }\nFile.open("_cbor_template.bin", \'wb\') do |file|\n file.write(data.to_cbor)\nend\n'})}),"\n",(0,r.jsx)(s.h4,{id:"telemetry-1",children:"Telemetry"}),"\n",(0,r.jsxs)(s.p,{children:["Using the CBOR Accessor for ",(0,r.jsx)(s.a,{href:"telemetry",children:"telemetry definitions"})," only requires the use of ",(0,r.jsx)(s.a,{href:"command#key",children:"KEY"})," to pull values from the CBOR data. Note that the KEY values use ",(0,r.jsx)(s.a,{href:"https://en.wikipedia.org/wiki/JSONPath",children:"JSONPath"}),"."]}),"\n",(0,r.jsx)(s.pre,{children:(0,r.jsx)(s.code,{className:"language-ruby",children:'TELEMETRY CBOR CBORTLM BIG_ENDIAN "CBOR Accessor Telemetry"\n ACCESSOR CborAccessor\n APPEND_ID_ITEM ID_ITEM 32 INT 2 "Int Item"\n KEY $.id_item\n APPEND_ITEM ITEM1 16 UINT "Int Item 2"\n KEY $.item1\n GENERIC_READ_CONVERSION_START UINT 16\n value * 2\n GENERIC_READ_CONVERSION_END\n UNITS CELSIUS C\n APPEND_ITEM ITEM2 16 UINT "Int Item 3"\n KEY $.more.item2\n FORMAT_STRING "0x%X"\n APPEND_ITEM ITEM3 64 FLOAT "Float Item"\n KEY $.more.item3\n APPEND_ITEM ITEM4 128 STRING "String Item"\n KEY $.more.item4\n APPEND_ARRAY_ITEM ITEM5 8 UINT 0 "Array Item"\n KEY $.more.item5\n'})}),"\n",(0,r.jsx)(s.h3,{id:"form-accessor",children:"Form Accessor"}),"\n",(0,r.jsxs)(s.p,{children:["The Form Accessor is typically used with the ",(0,r.jsx)(s.a,{href:"interfaces#http-client-interface",children:"HTTP Client"})," interface to submit forms to a remote HTTP Server."]}),"\n",(0,r.jsx)(s.h4,{id:"commands-2",children:"Commands"}),"\n",(0,r.jsxs)(s.p,{children:["Using the Form Accessor for ",(0,r.jsx)(s.a,{href:"command",children:"command definitions"})," requires the use of ",(0,r.jsx)(s.a,{href:"command#key",children:"KEY"})," to allow the user to set values in the HTTP form. Note that the KEY values use ",(0,r.jsx)(s.a,{href:"https://en.wikipedia.org/wiki/XPath",children:"XPath"}),"."]}),"\n",(0,r.jsx)(s.pre,{children:(0,r.jsx)(s.code,{className:"language-ruby",children:'COMMAND FORM FORMCMD BIG_ENDIAN "Form Accessor Command"\n ACCESSOR FormAccessor\n APPEND_ID_PARAMETER ID_ITEM 32 INT 2 2 2 "Int Item"\n KEY $.id_item\n APPEND_PARAMETER ITEM1 16 UINT MIN MAX 101 "Int Item 2"\n KEY $.item1\n UNITS CELSIUS C\n'})}),"\n",(0,r.jsx)(s.h4,{id:"telemetry-2",children:"Telemetry"}),"\n",(0,r.jsxs)(s.p,{children:["Using the Form Accessor for ",(0,r.jsx)(s.a,{href:"telemetry",children:"telemetry definitions"})," only requires the use of ",(0,r.jsx)(s.a,{href:"command#key",children:"KEY"})," to pull values from the HTTP response data. Note that the KEY values use ",(0,r.jsx)(s.a,{href:"https://en.wikipedia.org/wiki/XPath",children:"XPath"}),"."]}),"\n",(0,r.jsx)(s.pre,{children:(0,r.jsx)(s.code,{className:"language-ruby",children:'TELEMETRY FORM FORMTLM BIG_ENDIAN "Form Accessor Telemetry"\n ACCESSOR FormAccessor\n APPEND_ID_ITEM ID_ITEM 32 INT 1 "Int Item"\n KEY $.id_item\n APPEND_ITEM ITEM1 16 UINT "Int Item 2"\n KEY $.item1\n'})}),"\n",(0,r.jsx)(s.h3,{id:"html-accessor",children:"HTML Accessor"}),"\n",(0,r.jsxs)(s.p,{children:["The HTML Accessor is typically used with the ",(0,r.jsx)(s.a,{href:"interfaces#http-client-interface",children:"HTTP Client"})," interface to parse a web page."]}),"\n",(0,r.jsxs)(s.p,{children:["For a full example see ",(0,r.jsx)(s.a,{href:"https://github.com/OpenC3/cosmos/tree/main/examples/openc3-cosmos-http-get",children:"openc3-cosmos-http-get"}),"."]}),"\n",(0,r.jsx)(s.h4,{id:"commands-3",children:"Commands"}),"\n",(0,r.jsx)(s.p,{children:"HTML Accessor is not typically used for commands but it would be similar to Telemetry using XPath Keys."}),"\n",(0,r.jsx)(s.h4,{id:"telemetry-3",children:"Telemetry"}),"\n",(0,r.jsx)(s.pre,{children:(0,r.jsx)(s.code,{className:"language-ruby",children:'TELEMETRY HTML RESPONSE BIG_ENDIAN "Search results"\n # Typically you use the HtmlAccessor to parse out the page that is returned\n # HtmlAccessor is passed to HttpAccessor and used internally\n ACCESSOR HttpAccessor HtmlAccessor\n APPEND_ITEM NAME 240 STRING\n # Keys were located by doing a manual search and then inspecting the page\n # Right click the text you\'re looking for and then Copy -> Copy XPath\n KEY normalize-space(//main/div/a[2]/span/h2/text())\n APPEND_ITEM DESCRIPTION 480 STRING\n KEY //main/div/a[2]/span/p/text()\n APPEND_ITEM VERSION 200 STRING\n KEY //main/div/a[2]/span/h2/span/text()\n APPEND_ITEM DOWNLOADS 112 STRING\n KEY normalize-space(//main/div/a[2]/p/text())\n'})}),"\n",(0,r.jsx)(s.h3,{id:"http-accessor",children:"HTTP Accessor"}),"\n",(0,r.jsxs)(s.p,{children:["HTTP Accessor is typically used with the ",(0,r.jsx)(s.a,{href:"interfaces#http-client-interface",children:"HTTP Client"})," or ",(0,r.jsx)(s.a,{href:"interfaces#http-server-interface",children:"HTTP Server"})," interface to parse a web page. It takes another accessor to do the low level reading and writing of the items. The default accessor is FormAccessor. HtlmAccessor, XmlAccessor and JsonAccessor are also common for manipulating HTML, XML and JSON respectively."]}),"\n",(0,r.jsxs)(s.p,{children:["For a full example see ",(0,r.jsx)(s.a,{href:"https://github.com/OpenC3/cosmos/tree/main/examples/openc3-cosmos-http-get",children:"openc3-cosmos-http-get"}),"."]}),"\n",(0,r.jsx)(s.h4,{id:"commands-4",children:"Commands"}),"\n",(0,r.jsx)(s.p,{children:"When used with the HTTP Client Interface, HTTP Accessor utilizes the following command parameters:"}),"\n",(0,r.jsxs)(s.table,{children:[(0,r.jsx)(s.thead,{children:(0,r.jsxs)(s.tr,{children:[(0,r.jsx)(s.th,{children:"Parameter"}),(0,r.jsx)(s.th,{children:"Description"})]})}),(0,r.jsxs)(s.tbody,{children:[(0,r.jsxs)(s.tr,{children:[(0,r.jsx)(s.td,{children:"HTTP_PATH"}),(0,r.jsx)(s.td,{children:"requests at this path"})]}),(0,r.jsxs)(s.tr,{children:[(0,r.jsx)(s.td,{children:"HTTP_METHOD"}),(0,r.jsx)(s.td,{children:"request method (GET, POST, DELETE)"})]}),(0,r.jsxs)(s.tr,{children:[(0,r.jsx)(s.td,{children:"HTTP_PACKET"}),(0,r.jsx)(s.td,{children:"telemetry packet to store the response"})]}),(0,r.jsxs)(s.tr,{children:[(0,r.jsx)(s.td,{children:"HTTP_ERROR_PACKET"}),(0,r.jsx)(s.td,{children:"telemetry packet to store error responses (status code >= 300)"})]}),(0,r.jsxs)(s.tr,{children:[(0,r.jsx)(s.td,{children:"HTTP_QUERY_XXX"}),(0,r.jsx)(s.td,{children:"sets a value in the params passed to the request (XXX => value, or KEY => value), see example below"})]}),(0,r.jsxs)(s.tr,{children:[(0,r.jsx)(s.td,{children:"HTTP_HEADER_XXX"}),(0,r.jsx)(s.td,{children:"sets a value in the headers passed to the request (XXX => value, or KEY => value), see example below"})]})]})]}),"\n",(0,r.jsx)(s.p,{children:"When used with the HTTP Server Interface, HTTP Accessor utilizes the following command parameters:"}),"\n",(0,r.jsxs)(s.table,{children:[(0,r.jsx)(s.thead,{children:(0,r.jsxs)(s.tr,{children:[(0,r.jsx)(s.th,{children:"Parameter"}),(0,r.jsx)(s.th,{children:"Description"})]})}),(0,r.jsxs)(s.tbody,{children:[(0,r.jsxs)(s.tr,{children:[(0,r.jsx)(s.td,{children:"HTTP_STATUS"}),(0,r.jsx)(s.td,{children:"status to return to clients"})]}),(0,r.jsxs)(s.tr,{children:[(0,r.jsx)(s.td,{children:"HTTP_PATH"}),(0,r.jsx)(s.td,{children:"mount point for server"})]}),(0,r.jsxs)(s.tr,{children:[(0,r.jsx)(s.td,{children:"HTTP_PACKET"}),(0,r.jsx)(s.td,{children:"telemetry packet to store the request"})]}),(0,r.jsxs)(s.tr,{children:[(0,r.jsx)(s.td,{children:"HTTP_HEADER_XXX"}),(0,r.jsx)(s.td,{children:"sets a value in the response headers (XXX => value, or KEY => value), see example below"})]})]})]}),"\n",(0,r.jsx)(s.pre,{children:(0,r.jsx)(s.code,{className:"language-ruby",children:'COMMAND HTML SEARCH BIG_ENDIAN "Searches Rubygems.org"\n # Note FormAccessor is the default argument for HttpAccessor so it is typically not specified\n ACCESSOR HttpAccessor\n PARAMETER HTTP_PATH 0 0 DERIVED nil nil "/search"\n PARAMETER HTTP_METHOD 0 0 DERIVED nil nil "GET"\n PARAMETER HTTP_PACKET 0 0 DERIVED nil nil "RESPONSE"\n PARAMETER HTTP_ERROR_PACKET 0 0 DERIVED nil nil "ERROR"\n # This sets parameter query=openc3+cosmos\n # Note the parameter name \'query\' based on HTTP_QUERY_QUERY\n PARAMETER HTTP_QUERY_QUERY 0 0 DERIVED nil nil "openc3 cosmos"\n GENERIC_READ_CONVERSION_START\n value.split.join(\'+\')\n GENERIC_READ_CONVERSION_END\n # This sets header Content-Type=text/html\n # Note that TYPE is not used since the KEY is specified\n PARAMETER HTTP_HEADER_TYPE 0 0 DERIVED nil nil "text/html"\n KEY Content-Type\n'})}),"\n",(0,r.jsx)(s.h4,{id:"telemetry-4",children:"Telemetry"}),"\n",(0,r.jsx)(s.p,{children:"HTTP Accessor utilizes the following telemetry items:"}),"\n",(0,r.jsxs)(s.table,{children:[(0,r.jsx)(s.thead,{children:(0,r.jsxs)(s.tr,{children:[(0,r.jsx)(s.th,{children:"Parameter"}),(0,r.jsx)(s.th,{children:"Description"})]})}),(0,r.jsxs)(s.tbody,{children:[(0,r.jsxs)(s.tr,{children:[(0,r.jsx)(s.td,{children:"HTTP_STATUS"}),(0,r.jsx)(s.td,{children:"the request status"})]}),(0,r.jsxs)(s.tr,{children:[(0,r.jsx)(s.td,{children:"HTTP_HEADERS"}),(0,r.jsx)(s.td,{children:"hash of the response headers"})]}),(0,r.jsxs)(s.tr,{children:[(0,r.jsx)(s.td,{children:"HTTP_REQUEST"}),(0,r.jsxs)(s.td,{children:["optional hash which returns all the request parameters, see ",(0,r.jsx)(s.a,{href:"interfaces#http-client-interface",children:"HTTP Client Interface"})]})]})]})]}),"\n",(0,r.jsx)(s.pre,{children:(0,r.jsx)(s.code,{className:"language-ruby",children:'TELEMETRY HTML RESPONSE BIG_ENDIAN "Search results"\n # Typically you use the HtmlAccessor to parse out the page that is returned\n ACCESSOR HttpAccessor HtmlAccessor\n APPEND_ITEM NAME 240 STRING\n # Keys were located by doing a manual search and then inspecting the page\n # Right click the text you\'re looking for and then Copy -> Copy XPath\n KEY normalize-space(//main/div/a[2]/span/h2/text())\n APPEND_ITEM DESCRIPTION 480 STRING\n KEY //main/div/a[2]/span/p/text()\n APPEND_ITEM VERSION 200 STRING\n KEY //main/div/a[2]/span/h2/span/text()\n APPEND_ITEM DOWNLOADS 112 STRING\n KEY normalize-space(//main/div/a[2]/p/text())\n'})}),"\n",(0,r.jsx)(s.h3,{id:"json-accessor",children:"JSON Accessor"}),"\n",(0,r.jsxs)(s.p,{children:["The JSON Accessor serializes data into JavaScript Object Notation (",(0,r.jsx)(s.a,{href:"https://en.wikipedia.org/wiki/JSON",children:"JSON"}),"). JSON is a data interchange format that uses human-readable text to transmit data consisting of key value pairs and arrays."]}),"\n",(0,r.jsxs)(s.p,{children:["For a full example see ",(0,r.jsx)(s.a,{href:"https://github.com/OpenC3/cosmos/tree/main/examples/openc3-cosmos-accessor-test",children:"openc3-cosmos-accessor-test"}),"."]}),"\n",(0,r.jsx)(s.h4,{id:"commands-5",children:"Commands"}),"\n",(0,r.jsxs)(s.p,{children:["Using the JSON Accessor for ",(0,r.jsx)(s.a,{href:"command",children:"command definitions"})," requires the use of ",(0,r.jsx)(s.a,{href:"command#template",children:"TEMPLATE"})," and ",(0,r.jsx)(s.a,{href:"command#key",children:"KEY"})," to allow the user to set values in the JSON data. Note that the KEY values use ",(0,r.jsx)(s.a,{href:"https://en.wikipedia.org/wiki/JSONPath",children:"JSONPath"}),"."]}),"\n",(0,r.jsx)(s.pre,{children:(0,r.jsx)(s.code,{className:"language-ruby",children:'COMMAND JSON JSONCMD BIG_ENDIAN "JSON Accessor Command"\n ACCESSOR JsonAccessor\n TEMPLATE \'{"id_item":1, "item1":101, "more": { "item2":12, "item3":3.14, "item4":"Example", "item5":[4, 3, 2, 1] } }\'\n APPEND_ID_PARAMETER ID_ITEM 32 INT 2 2 2 "Int Item"\n KEY $.id_item\n APPEND_PARAMETER ITEM1 16 UINT MIN MAX 101 "Int Item 2"\n KEY $.item1\n UNITS CELSIUS C\n APPEND_PARAMETER ITEM2 16 UINT MIN MAX 12 "Int Item 3"\n KEY $.more.item2\n FORMAT_STRING "0x%X"\n APPEND_PARAMETER ITEM3 64 FLOAT MIN MAX 3.14 "Float Item"\n KEY $.more.item3\n APPEND_PARAMETER ITEM4 128 STRING "Example" "String Item"\n KEY $.more.item4\n APPEND_ARRAY_PARAMETER ITEM5 8 UINT 0 "Array Item"\n KEY $.more.item5\n'})}),"\n",(0,r.jsx)(s.h4,{id:"telemetry-5",children:"Telemetry"}),"\n",(0,r.jsxs)(s.p,{children:["Using the JSON Accessor for ",(0,r.jsx)(s.a,{href:"telemetry",children:"telemetry definitions"})," only requires the use of ",(0,r.jsx)(s.a,{href:"command#key",children:"KEY"})," to pull values from the JSON data. Note that the KEY values use ",(0,r.jsx)(s.a,{href:"https://en.wikipedia.org/wiki/JSONPath",children:"JSONPath"}),"."]}),"\n",(0,r.jsx)(s.pre,{children:(0,r.jsx)(s.code,{className:"language-ruby",children:'TELEMETRY JSON JSONTLM BIG_ENDIAN "JSON Accessor Telemetry"\n ACCESSOR JsonAccessor\n APPEND_ID_ITEM ID_ITEM 32 INT 1 "Int Item"\n KEY $.id_item\n APPEND_ITEM ITEM1 16 UINT "Int Item 2"\n KEY $.item1\n GENERIC_READ_CONVERSION_START UINT 16\n value * 2\n GENERIC_READ_CONVERSION_END\n UNITS CELSIUS C\n APPEND_ITEM ITEM2 16 UINT "Int Item 3"\n KEY $.more.item2\n FORMAT_STRING "0x%X"\n APPEND_ITEM ITEM3 64 FLOAT "Float Item"\n KEY $.more.item3\n APPEND_ITEM ITEM4 128 STRING "String Item"\n KEY $.more.item4\n APPEND_ARRAY_ITEM ITEM5 8 UINT 0 "Array Item"\n KEY $.more.item5\n'})}),"\n",(0,r.jsx)(s.h3,{id:"template-accessor",children:"Template Accessor"}),"\n",(0,r.jsxs)(s.p,{children:["The Template Accessor is commonly used with string based command / response protocols such as the ",(0,r.jsx)(s.a,{href:"protocols#cmdresponse-protocol",children:"CmdResponseProtocol"}),"."]}),"\n",(0,r.jsxs)(s.p,{children:["For a full example see ",(0,r.jsx)(s.a,{href:"https://github.com/OpenC3/cosmos-enterprise-plugins/tree/main/openc3-cosmos-scpi-power-supply",children:"openc3-cosmos-scpi-power-supply"})," in the COSMOS Enterprise Plugins."]}),"\n",(0,r.jsx)(s.h4,{id:"commands-6",children:"Commands"}),"\n",(0,r.jsxs)(s.p,{children:["Using the Template Accessor for ",(0,r.jsx)(s.a,{href:"command",children:"command definitions"})," requires the use of ",(0,r.jsx)(s.a,{href:"command#template",children:"TEMPLATE"})," to define a string template with optional parameters that are populated using the command parameters."]}),"\n",(0,r.jsx)(s.pre,{children:(0,r.jsx)(s.code,{className:"language-ruby",children:'# Some commands don\'t have any parameters and the template is sent as-is\nCOMMAND SCPI_PS RESET BIG_ENDIAN "Reset the power supply state"\n ACCESSOR TemplateAccessor\n TEMPLATE "*RST"\n\n# This command has two parameters in the template defined by <XXX>\nCOMMAND SCPI_PS VOLTAGE BIG_ENDIAN "Sets the voltage of a power supply channel"\n ACCESSOR TemplateAccessor\n # <VOLTAGE> and <CHANNEL> are replaced by the parameter values\n TEMPLATE "VOLT <VOLTAGE>, (@<CHANNEL>)"\n APPEND_PARAMETER VOLTAGE 32 FLOAT MIN MAX 0.0 "Voltage Setting"\n UNITS VOLTS V\n APPEND_PARAMETER CHANNEL 8 UINT 1 2 1 "Output Channel"\n'})}),"\n",(0,r.jsx)(s.h4,{id:"telemetry-6",children:"Telemetry"}),"\n",(0,r.jsxs)(s.p,{children:["Using the Template Accessor for ",(0,r.jsx)(s.a,{href:"telemetry",children:"telemetry definitions"})," requires the use of ",(0,r.jsx)(s.a,{href:"telemetry#template",children:"TEMPLATE"})," to define a template where telemetry values are pulled from the string buffer."]}),"\n",(0,r.jsx)(s.pre,{children:(0,r.jsx)(s.code,{className:"language-ruby",children:'TELEMETRY SCPI_PS STATUS BIG_ENDIAN "Power supply status"\n ACCESSOR TemplateAccessor\n # The raw string from the target is something like "1.234,2.345"\n # String is split by the comma and pushed into MEAS_VOLTAGE_1, MEAS_VOLTAGE_2\n TEMPLATE "<MEAS_VOLTAGE_1>,<MEAS_VOLTAGE_2>"\n APPEND_ITEM MEAS_VOLTAGE_1 32 FLOAT "Current Reading for Channel 1"\n APPEND_ITEM MEAS_VOLTAGE_2 32 FLOAT "Current Reading for Channel 2"\n'})}),"\n",(0,r.jsx)(s.h3,{id:"xml-accessor",children:"XML Accessor"}),"\n",(0,r.jsxs)(s.p,{children:["The XML Accessor is typically used with the ",(0,r.jsx)(s.a,{href:"interfaces#http-client-interface",children:"HTTP Client"})," interface to send and receive XML from a web server."]}),"\n",(0,r.jsxs)(s.p,{children:["For a full example see ",(0,r.jsx)(s.a,{href:"https://github.com/OpenC3/cosmos/tree/main/examples/openc3-cosmos-accessor-test",children:"openc3-cosmos-accessor-test"}),"."]}),"\n",(0,r.jsx)(s.h4,{id:"commands-7",children:"Commands"}),"\n",(0,r.jsxs)(s.p,{children:["Using the XML Accessor for ",(0,r.jsx)(s.a,{href:"command",children:"command definitions"})," requires the use of ",(0,r.jsx)(s.a,{href:"command#template",children:"TEMPLATE"})," and ",(0,r.jsx)(s.a,{href:"command#key",children:"KEY"})," to allow the user to set values in the XML data. Note that the KEY values use ",(0,r.jsx)(s.a,{href:"https://en.wikipedia.org/wiki/XPath",children:"XPath"}),"."]}),"\n",(0,r.jsx)(s.pre,{children:(0,r.jsx)(s.code,{className:"language-ruby",children:'COMMAND XML XMLCMD BIG_ENDIAN "XML Accessor Command"\n ACCESSOR XmlAccessor\n TEMPLATE \'<html><head><script src="3"><\/script><noscript>101</noscript></head><body><img src="12"/><div><ul><li>3.14</li><li>Example</li></ul></div><div></div></body></html>\'\n APPEND_ID_PARAMETER ID_ITEM 32 INT 3 3 3 "Int Item"\n KEY "/html/head/script/@src"\n APPEND_PARAMETER ITEM1 16 UINT MIN MAX 101 "Int Item 2"\n KEY "/html/head/noscript/text()"\n UNITS CELSIUS C\n APPEND_PARAMETER ITEM2 16 UINT MIN MAX 12 "Int Item 3"\n KEY "/html/body/img/@src"\n FORMAT_STRING "0x%X"\n APPEND_PARAMETER ITEM3 64 FLOAT MIN MAX 3.14 "Float Item"\n KEY "/html/body/div/ul/li[1]/text()"\n APPEND_PARAMETER ITEM4 128 STRING "Example" "String Item"\n KEY "/html/body/div/ul/li[2]/text()"\n'})}),"\n",(0,r.jsx)(s.h4,{id:"telemetry-7",children:"Telemetry"}),"\n",(0,r.jsxs)(s.p,{children:["Using the XML Accessor for ",(0,r.jsx)(s.a,{href:"telemetry",children:"telemetry definitions"})," only requires the use of ",(0,r.jsx)(s.a,{href:"command#key",children:"KEY"})," to pull values from the XML data. Note that the KEY values use ",(0,r.jsx)(s.a,{href:"https://en.wikipedia.org/wiki/XPath",children:"XPath"}),"."]}),"\n",(0,r.jsx)(s.pre,{children:(0,r.jsx)(s.code,{className:"language-ruby",children:'TELEMETRY XML XMLTLM BIG_ENDIAN "XML Accessor Telemetry"\n ACCESSOR XmlAccessor\n # Template is not required for telemetry, but is useful for simulation\n TEMPLATE \'<html><head><script src="3"><\/script><noscript>101</noscript></head><body><img src="12"/><div><ul><li>3.14</li><li>Example</li></ul></div><div></div></body></html>\'\n APPEND_ID_ITEM ID_ITEM 32 INT 3 "Int Item"\n KEY "/html/head/script/@src"\n APPEND_ITEM ITEM1 16 UINT "Int Item 2"\n KEY "/html/head/noscript/text()"\n GENERIC_READ_CONVERSION_START UINT 16\n value * 2\n GENERIC_READ_CONVERSION_END\n UNITS CELSIUS C\n APPEND_ITEM ITEM2 16 UINT "Int Item 3"\n KEY "/html/body/img/@src"\n FORMAT_STRING "0x%X"\n APPEND_ITEM ITEM3 64 FLOAT "Float Item"\n KEY "/html/body/div/ul/li[1]/text()"\n APPEND_ITEM ITEM4 128 STRING "String Item"\n KEY "/html/body/div/ul/li[2]/text()"\n'})}),"\n",(0,r.jsx)(s.h3,{id:"gems-ascii-enterprise",children:"GEMS Ascii (Enterprise)"}),"\n",(0,r.jsxs)(s.p,{children:["The GemsAsciiAccessor inherits from ",(0,r.jsx)(s.a,{href:"accessors#template-accessor",children:"TemplateAccessor"}),' to escape the following characters in outgoing commands: "&" => "&a", "|" => "&b", "," => "&c", and ";" => "&d" and reverse them in telemetry. See the ',(0,r.jsx)(s.a,{href:"https://www.omg.org/spec/GEMS/1.3/PDF",children:"GEMS Spec"})," for more information."]}),"\n",(0,r.jsxs)(s.p,{children:["For a full example, please see the ",(0,r.jsx)(s.a,{href:"https://github.com/OpenC3/cosmos-enterprise-plugins/tree/main/openc3-cosmos-gems-interface",children:"openc3-cosmos-gems-interface"})," in the COSMOS Enterprise Plugins."]}),"\n",(0,r.jsx)(s.h3,{id:"prometheus-enterprise",children:"Prometheus (Enterprise)"}),"\n",(0,r.jsx)(s.p,{children:"The PrometheusAccessor is used to read from a Prometheus endpoint and can automatically parse the results into a packet. The PrometheusAccessor is currently only implemented in Ruby."}),"\n",(0,r.jsxs)(s.p,{children:["For a full example, please see the ",(0,r.jsx)(s.a,{href:"https://github.com/OpenC3/cosmos-enterprise-plugins/tree/main/openc3-cosmos-prometheus-metrics",children:"openc3-cosmos-prometheus-metrics"})," in the COSMOS Enterprise Plugins."]}),"\n",(0,r.jsx)(s.h3,{id:"protocol-buffer-enterprise",children:"Protocol Buffer (Enterprise)"}),"\n",(0,r.jsxs)(s.p,{children:["The ProtoAccessor is used to read and write protocol buffers. It is primarily used in conjunction with the ",(0,r.jsx)(s.a,{href:"interfaces#grpc-interface-enterprise",children:"GrpcInterface"}),". The ProtoAccessor is currently only implemented in Ruby."]}),"\n",(0,r.jsxs)(s.table,{children:[(0,r.jsx)(s.thead,{children:(0,r.jsxs)(s.tr,{children:[(0,r.jsx)(s.th,{children:"Parameter"}),(0,r.jsx)(s.th,{children:"Description"}),(0,r.jsx)(s.th,{children:"Required"})]})}),(0,r.jsxs)(s.tbody,{children:[(0,r.jsxs)(s.tr,{children:[(0,r.jsx)(s.td,{children:"Filename"}),(0,r.jsx)(s.td,{children:"File generated by the protocol buffer compiler"}),(0,r.jsx)(s.td,{children:"Yes"})]}),(0,r.jsxs)(s.tr,{children:[(0,r.jsx)(s.td,{children:"Class"}),(0,r.jsx)(s.td,{children:"Class to use when encoding and decoding the buffer"}),(0,r.jsx)(s.td,{children:"Yes"})]})]})]}),"\n",(0,r.jsxs)(s.p,{children:["For a full example, please see the ",(0,r.jsx)(s.a,{href:"https://github.com/OpenC3/cosmos-enterprise-plugins/tree/main/openc3-cosmos-proto-target",children:"openc3-cosmos-proto-target"})," in the COSMOS Enterprise Plugins."]})]})}function h(e={}){let{wrapper:s}={...(0,i.a)(),...e.components};return s?(0,r.jsx)(s,{...e,children:(0,r.jsx)(d,{...e})}):d(e)}},2840:function(e,s,t){t.d(s,{Z:function(){return a},a:function(){return o}});var n=t(2784);let r={},i=n.createContext(r);function o(e){let s=n.useContext(i);return n.useMemo(function(){return"function"==typeof e?e(s):{...s,...e}},[s,e])}function a(e){let s;return s=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:o(e.components),n.createElement(i.Provider,{value:s},e.children)}}}]);
|
@@ -1 +0,0 @@
|
|
1
|
-
"use strict";(self.webpackChunkdocs_openc3_com=self.webpackChunkdocs_openc3_com||[]).push([["9148"],{5952:function(e,t,o){o.r(t),o.d(t,{default:()=>h,frontMatter:()=>r,metadata:()=>n,assets:()=>l,toc:()=>c,contentTitle:()=>a});var n=JSON.parse('{"id":"meta/philosophy","title":"Philosophy","description":"COSMOS goals and philosophy","source":"@site/docs/meta/philosophy.md","sourceDirName":"meta","slug":"/meta/philosophy","permalink":"/tools/staticdocs/docs/meta/philosophy","draft":false,"unlisted":false,"editUrl":"https://github.com/OpenC3/cosmos/tree/main/docs.openc3.com/docs/meta/philosophy.md","tags":[],"version":"current","frontMatter":{"title":"Philosophy","description":"COSMOS goals and philosophy","sidebar_custom_props":{"myEmoji":"\uD83E\uDD14"}},"sidebar":"defaultSidebar","previous":{"title":"Licenses","permalink":"/tools/staticdocs/docs/meta/licenses"},"next":{"title":"XTCE Support","permalink":"/tools/staticdocs/docs/meta/xtce"}}'),i=o("2322"),s=o("2840");let r={title:"Philosophy",description:"COSMOS goals and philosophy",sidebar_custom_props:{myEmoji:"\uD83E\uDD14"}},a=void 0,l={},c=[];function d(e){let t={li:"li",ol:"ol",p:"p",...(0,s.a)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(t.p,{children:"COSMOS is a C3 (Command, Control and Communication) system with the following primary goals:"}),"\n",(0,i.jsxs)(t.ol,{children:["\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsx)(t.p,{children:"Interface with Anything"}),"\n",(0,i.jsx)(t.p,{children:"COSMOS should be able to communicate with anything that provides a computer-to-computer interface, regardless of what the interface is. This means that COSMOS adapts to what other systems are doing and evolves over time. It does not publish an API that hardware must adhere to if it wants to communicate with COSMOS."}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsx)(t.p,{children:"Log Everything"}),"\n",(0,i.jsx)(t.p,{children:"All data that flows into and out of COSMOS is logged. This provides history as well as attribution for what happened when and why. Keeping accurate logs is an essential and critical aspect of COSMOS."}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsx)(t.p,{children:"Open Architecture and Source"}),"\n",(0,i.jsx)(t.p,{children:"Nothing about how COSMOS is implemented is meant to be secret or hidden, even in Enterprise Edition. In all editions, the source code for everything in COSMOS is provided and available for users to inspect or modify as needed. Never worry about an unsolvable problem or having to accept some detail that you don't like. This also opens the world to integrate anything they need into COSMOS without restriction or limitation."}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsx)(t.p,{children:"Be Modular"}),"\n",(0,i.jsx)(t.p,{children:"There are infinite number of things for COSMOS to connect to, but it is impossible to ship COSMOS with all the code it would need to talk to everything. For this reason, COSMOS is designed to be modular in all the places that matter."}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsx)(t.p,{children:"Use Configuration when Possible, and Code When Logic Is Needed"}),"\n",(0,i.jsx)(t.p,{children:"Configuration is great for making COSMOS as usable as possible by non-software engineers. It also shows where common patterns exist. However, configuration is horrible when logic or custom math are needed."}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsx)(t.p,{children:"Empower Developers"}),"\n",(0,i.jsx)(t.p,{children:"COSMOS is meant to be easy enough to be used by everyone, not just C2 software experts."}),"\n"]}),"\n"]})]})}function h(e={}){let{wrapper:t}={...(0,s.a)(),...e.components};return t?(0,i.jsx)(t,{...e,children:(0,i.jsx)(d,{...e})}):d(e)}},2840:function(e,t,o){o.d(t,{Z:function(){return a},a:function(){return r}});var n=o(2784);let i={},s=n.createContext(i);function r(e){let t=n.useContext(s);return n.useMemo(function(){return"function"==typeof e?e(t):{...t,...e}},[t,e])}function a(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:r(e.components),n.createElement(s.Provider,{value:t},e.children)}}}]);
|